Skip to content

Commit

Permalink
Fix SparnaturalFormElement
Browse files Browse the repository at this point in the history
  • Loading branch information
tfrancart committed Nov 22, 2024
1 parent 3d76efb commit cd113df
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
7 changes: 4 additions & 3 deletions src/SparnaturalFormElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,12 @@ export class SparnaturalFormElement extends HTMLElement {
callback: (data: any) => void,
errorCallback?: (error: any) => void
) {
let sparqlFetcherFactory: SparqlHandlerFactory = new SparqlHandlerFactory(
this.sparnaturalForm.catalog,
let sparqlFetcherFactory: SparqlHandlerFactory = new SparqlHandlerFactory(
getSettings().language,
getSettings().localCacheDataTtl,
getSettings().customization.headers
getSettings().customization.headers,
getSettings().customization.sparqlHandler,
this.sparnaturalForm.catalog
);

let sparqlFetcher: SparqlHandlerIfc =
Expand Down
2 changes: 2 additions & 0 deletions src/sparnatural-form/settings/ISettings.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { AutocompleteConfiguration } from "../../sparnatural/components/widgets/AutoCompleteWidget";
import { SparqlHandlerIfc } from "../../sparnatural/components/widgets/data/SparqlHandler";
import { ListConfiguration } from "../../sparnatural/components/widgets/ListWidget";
import { MapConfiguration } from "../../sparnatural/components/widgets/MapWidget";
import { NumberConfiguration } from "../../sparnatural/components/widgets/NumberWidget";
Expand All @@ -25,6 +26,7 @@ interface ISettings {
tree?: Partial<TreeConfiguration>;
number?: Partial<NumberConfiguration>;
map?: Partial<MapConfiguration>;
sparqlHandler?: SparqlHandlerIfc;
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class WidgetFactory {
parentComponent:HTMLComponent;
specProvider: any;
settings: WidgetFactorySettings;
catalog:Catalog;
catalog?:Catalog;

private sparqlFetcherFactory:SparqlHandlerFactory;
private sparqlPostProcessor:{ semanticPostProcess: (sparql:string)=>string };
Expand All @@ -68,12 +68,12 @@ export class WidgetFactory {
this.catalog = catalog;

// how to fetch a SPARQL query
this.sparqlFetcherFactory = new SparqlHandlerFactory(
this.catalog,
this.sparqlFetcherFactory = new SparqlHandlerFactory(
this.settings.language,
this.settings.localCacheDataTtl,
this.settings.customization.headers,
this.settings.customization.sparqlHandler
this.settings.customization.sparqlHandler,
this.catalog
);

// how to post-process the generated SPARQL after it is constructed and before it is send
Expand Down

0 comments on commit cd113df

Please sign in to comment.