@lblod/ember-rdfa-editor-lblod-plugins 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.release-it.json +14 -0
- package/.woodpecker/.release.yml +15 -0
- package/.woodpecker/.test.yml +23 -0
- package/CHANGELOG.md +84 -0
- package/RELEASE.md +60 -0
- package/addon/commands/generate-template-command.js +35 -0
- package/addon/commands/insert-and-collapse.js +32 -0
- package/addon/commands/modify-date-command.js +42 -0
- package/addon/components/besluit-type-plugin/besluit-type-select.hbs +28 -0
- package/addon/components/besluit-type-plugin/besluit-type-select.js +21 -0
- package/addon/components/besluit-type-plugin/toolbar-dropdown.hbs +83 -0
- package/addon/components/besluit-type-plugin/toolbar-dropdown.js +188 -0
- package/addon/components/citaten-plugin/citaat-card.hbs +76 -0
- package/addon/components/citaten-plugin/citaat-card.js +286 -0
- package/addon/components/citaten-plugin/citaat-insert.hbs +20 -0
- package/addon/components/citaten-plugin/citaat-insert.js +68 -0
- package/addon/components/citaten-plugin/citations/article-list.hbs +13 -0
- package/addon/components/citaten-plugin/citations/article-preview.hbs +16 -0
- package/addon/components/citaten-plugin/citations/decision-detail.hbs +110 -0
- package/addon/components/citaten-plugin/citations/decision-detail.js +94 -0
- package/addon/components/citaten-plugin/citations/decision-list.hbs +15 -0
- package/addon/components/citaten-plugin/citations/decision-preview.hbs +53 -0
- package/addon/components/citaten-plugin/citations/search-modal.hbs +175 -0
- package/addon/components/citaten-plugin/citations/search-modal.js +244 -0
- package/addon/components/citaten-plugin/helpers/alert-load-error.hbs +21 -0
- package/addon/components/citaten-plugin/helpers/alert-no-items.hbs +10 -0
- package/addon/components/import-snippet-plugin/card.hbs +17 -0
- package/addon/components/import-snippet-plugin/card.js +95 -0
- package/addon/components/insert-variable-plugin/insert-variable-card.hbs +33 -0
- package/addon/components/insert-variable-plugin/insert-variable-card.js +125 -0
- package/addon/components/rdfa-date-plugin/rdfa-date-plugin-card.hbs +22 -0
- package/addon/components/rdfa-date-plugin/rdfa-date-plugin-card.js +64 -0
- package/addon/components/rdfa-date-plugin/rdfa-date-plugin-insert.hbs +18 -0
- package/addon/components/rdfa-date-plugin/rdfa-date-plugin-insert.js +24 -0
- package/addon/components/rdfa-date-plugin/rdfa-date-time-picker.hbs +21 -0
- package/addon/components/rdfa-date-plugin/rdfa-date-time-picker.js +73 -0
- package/addon/components/roadsign-regulation-plugin/expanded-measure.hbs +44 -0
- package/addon/components/roadsign-regulation-plugin/expanded-measure.js +38 -0
- package/addon/components/roadsign-regulation-plugin/measure-template.hbs +5 -0
- package/addon/components/roadsign-regulation-plugin/measure-template.js +30 -0
- package/addon/components/roadsign-regulation-plugin/roadsign-regulation-card.hbs +12 -0
- package/addon/components/roadsign-regulation-plugin/roadsign-regulation-card.js +101 -0
- package/addon/components/roadsign-regulation-plugin/roadsigns-modal.hbs +92 -0
- package/addon/components/roadsign-regulation-plugin/roadsigns-modal.js +268 -0
- package/addon/components/roadsign-regulation-plugin/roadsigns-pagination.hbs +25 -0
- package/addon/components/roadsign-regulation-plugin/roadsigns-pagination.js +55 -0
- package/addon/components/roadsign-regulation-plugin/roadsigns-table.hbs +73 -0
- package/addon/components/roadsign-regulation-plugin/roadsigns-table.js +24 -0
- package/addon/components/standard-template-plugin/template-card.hbs +16 -0
- package/addon/components/standard-template-plugin/template-card.js +7 -0
- package/addon/components/standard-template-plugin/template-provider.hbs +6 -0
- package/addon/components/standard-template-plugin/template-provider.js +75 -0
- package/addon/components/table-of-contents-plugin/card.hbs +5 -0
- package/addon/components/table-of-contents-plugin/card.js +53 -0
- package/addon/components/table-of-contents-plugin/inline-components/outline.hbs +21 -0
- package/addon/components/table-of-contents-plugin/inline-components/table-of-contents.hbs +9 -0
- package/addon/components/table-of-contents-plugin/inline-components/table-of-contents.js +100 -0
- package/addon/components/template-variable-plugin/template-variable-card.hbs +34 -0
- package/addon/components/template-variable-plugin/template-variable-card.js +230 -0
- package/addon/constants.js +24 -0
- package/{dist → addon}/helpers/limit-text.js +1 -4
- package/addon/initializers/plugin-initializer.js +75 -0
- package/addon/inline-components/table-of-contents.js +43 -0
- package/addon/marks/citaten-mark.js +32 -0
- package/addon/models/instruction.js +19 -0
- package/addon/models/measure.js +46 -0
- package/{dist → addon}/models/sign.js +12 -13
- package/addon/models/template.js +9 -0
- package/addon/plugins/besluit-type-plugin.js +16 -0
- package/addon/plugins/citaten-plugin.js +22 -0
- package/addon/plugins/generate-template-plugin.js +16 -0
- package/addon/plugins/import-snippet-plugin.js +16 -0
- package/addon/plugins/insert-variable-plugin.js +19 -0
- package/addon/plugins/rdfa-date-plugin.js +26 -0
- package/addon/plugins/roadsign-regulation-plugin.js +24 -0
- package/addon/plugins/standard-template-plugin.js +33 -0
- package/addon/plugins/table-of-contents-plugin.js +27 -0
- package/addon/plugins/template-variable-plugin.js +21 -0
- package/addon/serializers/application.js +8 -0
- package/{dist → addon}/services/import-rdfa-snippet.js +28 -18
- package/{dist → addon}/services/roadsign-registry.js +67 -121
- package/addon/services/standard-template-plugin.js +45 -0
- package/addon/utils/fetchBesluitTypes.js +90 -0
- package/addon/utils/generate-template-plugin/default-resources.js +9 -0
- package/addon/utils/instantiate-uuids.js +34 -0
- package/addon/utils/legislation-types.js +32 -0
- package/addon/utils/memoize.js +8 -0
- package/addon/utils/processMatch.js +80 -0
- package/addon/utils/roadsign-regulation-plugin/fetchData.js +78 -0
- package/addon/utils/roadsign-regulation-plugin/includeInstructions.js +10 -0
- package/addon/utils/variable-plugins/default-variable-types.js +56 -0
- package/{dist/fetch-data-284bf106.js → addon/utils/variable-plugins/fetch-data.js} +36 -18
- package/{dist/vlaamse-codex-187fe526.js → addon/utils/vlaamse-codex.js} +159 -63
- package/app/components/besluit-type-plugin/besluit-type-select.js +1 -0
- package/app/components/besluit-type-plugin/toolbar-dropdown.js +1 -0
- package/app/components/citaten-plugin/citaat-card.js +1 -0
- package/app/components/citaten-plugin/citaat-insert.js +1 -0
- package/app/components/citaten-plugin/citations/article-list.js +1 -0
- package/app/components/citaten-plugin/citations/article-preview.js +1 -0
- package/app/components/citaten-plugin/citations/decision-detail.js +1 -0
- package/app/components/citaten-plugin/citations/decision-list.js +1 -0
- package/app/components/citaten-plugin/citations/decision-preview.js +1 -0
- package/app/components/citaten-plugin/citations/modal.js +1 -0
- package/app/components/citaten-plugin/citations/search-modal.js +1 -0
- package/app/components/citaten-plugin/helpers/alert-load-error.js +1 -0
- package/app/components/citaten-plugin/helpers/alert-no-items.js +1 -0
- package/app/components/import-snippet-plugin/card.js +1 -0
- package/app/components/insert-variable-plugin/insert-variable-card.js +1 -0
- package/app/components/rdfa-date-plugin/rdfa-date-plugin-card.js +1 -0
- package/app/components/rdfa-date-plugin/rdfa-date-plugin-insert.js +1 -0
- package/app/components/rdfa-date-plugin/rdfa-date-time-picker.js +1 -0
- package/app/components/roadsign-regulation-plugin/expanded-measure.js +1 -0
- package/app/components/roadsign-regulation-plugin/measure-template.js +1 -0
- package/app/components/roadsign-regulation-plugin/roadsign-regulation-card.js +1 -0
- package/app/components/roadsign-regulation-plugin/roadsigns-modal.js +1 -0
- package/app/components/roadsign-regulation-plugin/roadsigns-pagination.js +1 -0
- package/app/components/roadsign-regulation-plugin/roadsigns-table.js +1 -0
- package/app/components/standard-template-plugin/template-card.js +1 -0
- package/app/components/standard-template-plugin/template-provider.js +1 -0
- package/app/components/table-of-contents-plugin/card.js +1 -0
- package/app/components/table-of-contents-plugin/inline-components/outline.js +1 -0
- package/app/components/table-of-contents-plugin/inline-components/table-of-contents.js +1 -0
- package/app/components/template-variable-plugin/template-variable-card.js +1 -0
- package/app/helpers/limit-text.js +4 -0
- package/app/initializers/plugin-initializer.js +4 -0
- package/app/models/instruction.js +1 -0
- package/app/models/measure.js +1 -0
- package/app/models/sign.js +1 -0
- package/app/models/template.js +1 -0
- package/app/serializers/application.js +1 -0
- package/app/services/import-rdfa-snippet.js +1 -0
- package/app/services/rdfa-editor-roadsign-regulation-plugin.js +1 -0
- package/app/services/roadsign-registry.js +1 -0
- package/app/services/standard-template-plugin.js +1 -0
- package/{dist → app}/styles/citaten-plugin.scss +0 -0
- package/config/environment.js +0 -1
- package/index.js +8 -0
- package/package.json +110 -106
- package/tsconfig.json +42 -0
- package/types/dummy/index.d.ts +1 -0
- package/types/ember-data/types/registries/model.d.ts +6 -0
- package/types/global.d.ts +7 -0
- package/addon-main.js +0 -4
- package/dist/_app_/components/besluit-type-plugin/besluit-type-select.js +0 -1
- package/dist/_app_/components/besluit-type-plugin/toolbar-dropdown.js +0 -1
- package/dist/_app_/components/citaten-plugin/citaat-card.js +0 -1
- package/dist/_app_/components/citaten-plugin/citaat-insert.js +0 -1
- package/dist/_app_/components/citaten-plugin/citations/article-list.js +0 -1
- package/dist/_app_/components/citaten-plugin/citations/article-preview.js +0 -1
- package/dist/_app_/components/citaten-plugin/citations/decision-detail.js +0 -1
- package/dist/_app_/components/citaten-plugin/citations/decision-list.js +0 -1
- package/dist/_app_/components/citaten-plugin/citations/decision-preview.js +0 -1
- package/dist/_app_/components/citaten-plugin/citations/search-modal.js +0 -1
- package/dist/_app_/components/citaten-plugin/helpers/alert-load-error.js +0 -1
- package/dist/_app_/components/citaten-plugin/helpers/alert-no-items.js +0 -1
- package/dist/_app_/components/import-snippet-plugin/card.js +0 -1
- package/dist/_app_/components/insert-variable-plugin/insert-variable-card.js +0 -1
- package/dist/_app_/components/rdfa-date-plugin/rdfa-date-plugin-card.js +0 -1
- package/dist/_app_/components/rdfa-date-plugin/rdfa-date-plugin-insert.js +0 -1
- package/dist/_app_/components/rdfa-date-plugin/rdfa-date-time-picker.js +0 -1
- package/dist/_app_/components/roadsign-regulation-plugin/expanded-measure.js +0 -1
- package/dist/_app_/components/roadsign-regulation-plugin/measure-template.js +0 -1
- package/dist/_app_/components/roadsign-regulation-plugin/roadsign-regulation-card.js +0 -1
- package/dist/_app_/components/roadsign-regulation-plugin/roadsigns-modal.js +0 -1
- package/dist/_app_/components/roadsign-regulation-plugin/roadsigns-pagination.js +0 -1
- package/dist/_app_/components/roadsign-regulation-plugin/roadsigns-table.js +0 -1
- package/dist/_app_/components/standard-template-plugin/template-card.js +0 -1
- package/dist/_app_/components/standard-template-plugin/template-provider.js +0 -1
- package/dist/_app_/components/table-of-contents-plugin/card.js +0 -1
- package/dist/_app_/components/table-of-contents-plugin/inline-components/outline.js +0 -1
- package/dist/_app_/components/table-of-contents-plugin/inline-components/table-of-contents.js +0 -1
- package/dist/_app_/components/template-variable-plugin/template-variable-card.js +0 -1
- package/dist/_app_/helpers/limit-text.js +0 -1
- package/dist/_app_/initializers/plugin-initializer.js +0 -1
- package/dist/_app_/models/instruction.js +0 -1
- package/dist/_app_/models/measure.js +0 -1
- package/dist/_app_/models/sign.js +0 -1
- package/dist/_app_/models/template.js +0 -1
- package/dist/_app_/serializers/application.js +0 -1
- package/dist/_app_/services/import-rdfa-snippet.js +0 -1
- package/dist/_app_/services/roadsign-registry.js +0 -1
- package/dist/_app_/services/standard-template-plugin.js +0 -1
- package/dist/_rollupPluginBabelHelpers-537ad14b.js +0 -48
- package/dist/_rollupPluginBabelHelpers-537ad14b.js.map +0 -1
- package/dist/components/besluit-type-plugin/besluit-type-select.js +0 -30
- package/dist/components/besluit-type-plugin/besluit-type-select.js.map +0 -1
- package/dist/components/besluit-type-plugin/toolbar-dropdown.js +0 -292
- package/dist/components/besluit-type-plugin/toolbar-dropdown.js.map +0 -1
- package/dist/components/citaten-plugin/citaat-card.js +0 -367
- package/dist/components/citaten-plugin/citaat-card.js.map +0 -1
- package/dist/components/citaten-plugin/citaat-insert.js +0 -84
- package/dist/components/citaten-plugin/citaat-insert.js.map +0 -1
- package/dist/components/citaten-plugin/citations/article-list.js +0 -10
- package/dist/components/citaten-plugin/citations/article-list.js.map +0 -1
- package/dist/components/citaten-plugin/citations/article-preview.js +0 -10
- package/dist/components/citaten-plugin/citations/article-preview.js.map +0 -1
- package/dist/components/citaten-plugin/citations/decision-detail.js +0 -123
- package/dist/components/citaten-plugin/citations/decision-detail.js.map +0 -1
- package/dist/components/citaten-plugin/citations/decision-list.js +0 -10
- package/dist/components/citaten-plugin/citations/decision-list.js.map +0 -1
- package/dist/components/citaten-plugin/citations/decision-preview.js +0 -10
- package/dist/components/citaten-plugin/citations/decision-preview.js.map +0 -1
- package/dist/components/citaten-plugin/citations/search-modal.js +0 -282
- package/dist/components/citaten-plugin/citations/search-modal.js.map +0 -1
- package/dist/components/citaten-plugin/helpers/alert-load-error.js +0 -10
- package/dist/components/citaten-plugin/helpers/alert-load-error.js.map +0 -1
- package/dist/components/citaten-plugin/helpers/alert-no-items.js +0 -10
- package/dist/components/citaten-plugin/helpers/alert-no-items.js.map +0 -1
- package/dist/components/import-snippet-plugin/card.js +0 -99
- package/dist/components/import-snippet-plugin/card.js.map +0 -1
- package/dist/components/insert-variable-plugin/insert-variable-card.js +0 -190
- package/dist/components/insert-variable-plugin/insert-variable-card.js.map +0 -1
- package/dist/components/rdfa-date-plugin/rdfa-date-plugin-card.js +0 -85
- package/dist/components/rdfa-date-plugin/rdfa-date-plugin-card.js.map +0 -1
- package/dist/components/rdfa-date-plugin/rdfa-date-plugin-insert.js +0 -23
- package/dist/components/rdfa-date-plugin/rdfa-date-plugin-insert.js.map +0 -1
- package/dist/components/rdfa-date-plugin/rdfa-date-time-picker.js +0 -91
- package/dist/components/rdfa-date-plugin/rdfa-date-time-picker.js.map +0 -1
- package/dist/components/roadsign-regulation-plugin/expanded-measure.js +0 -52
- package/dist/components/roadsign-regulation-plugin/expanded-measure.js.map +0 -1
- package/dist/components/roadsign-regulation-plugin/measure-template.js +0 -42
- package/dist/components/roadsign-regulation-plugin/measure-template.js.map +0 -1
- package/dist/components/roadsign-regulation-plugin/roadsign-regulation-card.js +0 -82
- package/dist/components/roadsign-regulation-plugin/roadsign-regulation-card.js.map +0 -1
- package/dist/components/roadsign-regulation-plugin/roadsigns-modal.js +0 -251
- package/dist/components/roadsign-regulation-plugin/roadsigns-modal.js.map +0 -1
- package/dist/components/roadsign-regulation-plugin/roadsigns-pagination.js +0 -71
- package/dist/components/roadsign-regulation-plugin/roadsigns-pagination.js.map +0 -1
- package/dist/components/roadsign-regulation-plugin/roadsigns-table.js +0 -36
- package/dist/components/roadsign-regulation-plugin/roadsigns-table.js.map +0 -1
- package/dist/components/standard-template-plugin/template-card.js +0 -15
- package/dist/components/standard-template-plugin/template-card.js.map +0 -1
- package/dist/components/standard-template-plugin/template-provider.js +0 -109
- package/dist/components/standard-template-plugin/template-provider.js.map +0 -1
- package/dist/components/table-of-contents-plugin/card.js +0 -52
- package/dist/components/table-of-contents-plugin/card.js.map +0 -1
- package/dist/components/table-of-contents-plugin/inline-components/outline.js +0 -10
- package/dist/components/table-of-contents-plugin/inline-components/outline.js.map +0 -1
- package/dist/components/table-of-contents-plugin/inline-components/table-of-contents.js +0 -92
- package/dist/components/table-of-contents-plugin/inline-components/table-of-contents.js.map +0 -1
- package/dist/components/template-variable-plugin/template-variable-card.js +0 -178
- package/dist/components/template-variable-plugin/template-variable-card.js.map +0 -1
- package/dist/constants-c77fd478.js +0 -16
- package/dist/constants-c77fd478.js.map +0 -1
- package/dist/fetch-data-284bf106.js.map +0 -1
- package/dist/helpers/limit-text.js.map +0 -1
- package/dist/includeInstructions-a32c24e6.js +0 -10
- package/dist/includeInstructions-a32c24e6.js.map +0 -1
- package/dist/index.js +0 -2
- package/dist/index.js.map +0 -1
- package/dist/initializers/plugin-initializer.js +0 -401
- package/dist/initializers/plugin-initializer.js.map +0 -1
- package/dist/legislation-types-4d487cb9.js +0 -26
- package/dist/legislation-types-4d487cb9.js.map +0 -1
- package/dist/models/instruction.js +0 -18
- package/dist/models/instruction.js.map +0 -1
- package/dist/models/measure.js +0 -41
- package/dist/models/measure.js.map +0 -1
- package/dist/models/sign.js.map +0 -1
- package/dist/models/template.js +0 -48
- package/dist/models/template.js.map +0 -1
- package/dist/serializers/application.js +0 -10
- package/dist/serializers/application.js.map +0 -1
- package/dist/services/import-rdfa-snippet.js.map +0 -1
- package/dist/services/roadsign-registry.js.map +0 -1
- package/dist/services/standard-template-plugin.js +0 -53
- package/dist/services/standard-template-plugin.js.map +0 -1
- package/dist/styles/test.css +0 -0
- package/dist/vlaamse-codex-187fe526.js.map +0 -1
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import Service, { inject as service } from '@ember/service';
|
|
2
|
+
import { task, waitForProperty } from 'ember-concurrency';
|
|
3
|
+
import { tracked } from '@glimmer/tracking';
|
|
4
|
+
|
|
5
|
+
export default class RdfaEditorStandardTemplatePluginService extends Service {
|
|
6
|
+
@service store;
|
|
7
|
+
@tracked templates;
|
|
8
|
+
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.loadTemplates();
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@task
|
|
15
|
+
*fetchTemplates() {
|
|
16
|
+
yield waitForProperty(this, 'templates');
|
|
17
|
+
return this.templates;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
async loadTemplates() {
|
|
21
|
+
this.templates = await this.store.query('template', {
|
|
22
|
+
fields: { templates: 'title,contexts,matches,disabled-in-contexts' },
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
Filter the valid templates for a context.
|
|
28
|
+
@method templatesForContext
|
|
29
|
+
@param {Array} Array of templates
|
|
30
|
+
@param {Array} The path of rdfaContext objects from the root till the current context
|
|
31
|
+
@return {Array} Array of templates (filtered)
|
|
32
|
+
@private
|
|
33
|
+
*/
|
|
34
|
+
templatesForContext(templates, rdfaTypes) {
|
|
35
|
+
let isMatchingForContext = (template) => {
|
|
36
|
+
return (
|
|
37
|
+
rdfaTypes.filter((e) => template.get('contexts').includes(e)).length >
|
|
38
|
+
0 &&
|
|
39
|
+
rdfaTypes.filter((e) => template.get('disabledInContexts').includes(e))
|
|
40
|
+
.length === 0
|
|
41
|
+
);
|
|
42
|
+
};
|
|
43
|
+
return templates.filter(isMatchingForContext);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { SparqlEndpointFetcher } from 'fetch-sparql-endpoint';
|
|
2
|
+
|
|
3
|
+
export default async function fetchBesluitTypes(classificationUri, ENV) {
|
|
4
|
+
const query = `
|
|
5
|
+
PREFIX conceptscheme: <https://data.vlaanderen.be/id/conceptscheme/>
|
|
6
|
+
PREFIX BesluitType: <https://data.vlaanderen.be/id/concept/BesluitType/>
|
|
7
|
+
PREFIX BesluitDocumentType: <https://data.vlaanderen.be/id/concept/BesluitDocumentType/>
|
|
8
|
+
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
|
|
9
|
+
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
|
|
10
|
+
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
|
|
11
|
+
PREFIX core: <http://mu.semte.ch/vocabularies/core/>
|
|
12
|
+
PREFIX besluit: <http://lblod.data.gift/vocabularies/besluit/>
|
|
13
|
+
PREFIX BestuurseenheidClassificatieCode: <http://data.vlaanderen.be/id/concept/BestuurseenheidClassificatieCode/>
|
|
14
|
+
PREFIX sch: <http://schema.org/>
|
|
15
|
+
PREFIX rule: <http://lblod.data.gift/vocabularies/notification/>
|
|
16
|
+
PREFIX lblodRule: <http://data.lblod.info/id/notification-rule/>
|
|
17
|
+
|
|
18
|
+
SELECT ?s ?p ?o WHERE {
|
|
19
|
+
?s skos:inScheme conceptscheme:BesluitType ;
|
|
20
|
+
besluit:notificationRule ?rule .
|
|
21
|
+
?rule besluit:decidableBy <${classificationUri}> .
|
|
22
|
+
OPTIONAL { ?rule sch:validFrom ?validFrom . }
|
|
23
|
+
OPTIONAL { ?rule sch:validThrough ?validThrough . }
|
|
24
|
+
BIND(now() AS ?currentTime) .
|
|
25
|
+
BIND(STRLEN(STR(?validFrom)) > 0 AS ?validFromExists) .
|
|
26
|
+
BIND(STRLEN(STR(?validThrough)) > 0 AS ?validThroughExists) .
|
|
27
|
+
FILTER(
|
|
28
|
+
((?validFromExists && ?validThroughExists) && (?currentTime < ?validThrough && ?currentTime >= ?validFrom)) ||
|
|
29
|
+
((!?validFromExists && ?validThroughExists) && (?currentTime < ?validThrough)) ||
|
|
30
|
+
((?validFromExists && !?validThroughExists) && (?currentTime >= ?validFrom))
|
|
31
|
+
) .
|
|
32
|
+
?s ?p ?o .
|
|
33
|
+
VALUES ?p {
|
|
34
|
+
skos:prefLabel
|
|
35
|
+
skos:definition
|
|
36
|
+
skos:broader
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
`;
|
|
40
|
+
const typeFetcher = new SparqlEndpointFetcher({
|
|
41
|
+
method: 'POST',
|
|
42
|
+
});
|
|
43
|
+
const endpoint = ENV.besluitTypePlugin.endpoint;
|
|
44
|
+
const bindingStream = await typeFetcher.fetchBindings(endpoint, query);
|
|
45
|
+
const validBesluitTriples = [];
|
|
46
|
+
bindingStream.on('data', (triple) => {
|
|
47
|
+
validBesluitTriples.push(triple);
|
|
48
|
+
});
|
|
49
|
+
return new Promise((resolve, reject) => {
|
|
50
|
+
bindingStream.on('error', reject);
|
|
51
|
+
bindingStream.on('end', () => {
|
|
52
|
+
resolve(validBesluitTriples);
|
|
53
|
+
});
|
|
54
|
+
}).then(quadsToBesluitTypeObjects);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function quadsToBesluitTypeObjects(triples) {
|
|
58
|
+
const besluitTypes = new Map();
|
|
59
|
+
triples.forEach((triple) => {
|
|
60
|
+
const existing = besluitTypes.get(triple.s.value) || {
|
|
61
|
+
uri: triple.s.value,
|
|
62
|
+
};
|
|
63
|
+
switch (triple.p.value) {
|
|
64
|
+
case 'http://www.w3.org/2004/02/skos/core#definition':
|
|
65
|
+
existing.definition = triple.o.value;
|
|
66
|
+
break;
|
|
67
|
+
case 'http://www.w3.org/2004/02/skos/core#prefLabel':
|
|
68
|
+
existing.label = triple.o.value;
|
|
69
|
+
break;
|
|
70
|
+
case 'http://www.w3.org/2004/02/skos/core#broader':
|
|
71
|
+
existing.broader = triple.o.value;
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
besluitTypes.set(triple.s.value, existing);
|
|
75
|
+
});
|
|
76
|
+
return createBesluitTypeObjectsHierarchy([...besluitTypes.values()]);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function createBesluitTypeObjectsHierarchy(allBesluitTypes) {
|
|
80
|
+
const besluitTypes = allBesluitTypes.filter((bst) => !bst.broader);
|
|
81
|
+
const subTypes = allBesluitTypes.filter((bst) => !!bst.broader);
|
|
82
|
+
subTypes.forEach((subtype) => {
|
|
83
|
+
//Use allBesluitTypes to find the parent. This means no tree recursive search process, but we can still create trees of multiple levels deep.
|
|
84
|
+
const parent = allBesluitTypes.find((type) => type.uri === subtype.broader);
|
|
85
|
+
if (parent)
|
|
86
|
+
if (parent.subTypes) parent.subTypes.push(subtype);
|
|
87
|
+
else parent.subTypes = [subtype];
|
|
88
|
+
});
|
|
89
|
+
return besluitTypes;
|
|
90
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import memoize from './memoize';
|
|
2
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Given a template string, we instantiate uuids by matching
|
|
6
|
+
* ${generateUuid()} pattern in the string and evaluating generateUuid()
|
|
7
|
+
*
|
|
8
|
+
* Note: the general approach is similar to converting a string to a template literal, but since
|
|
9
|
+
* this approach does not work in IE, we had to fall back to plain regex matching.
|
|
10
|
+
*
|
|
11
|
+
* @method instantiateUuids
|
|
12
|
+
* @param {String} templateString
|
|
13
|
+
*
|
|
14
|
+
* @return {String} template string with instantiated uuids
|
|
15
|
+
*
|
|
16
|
+
* @private
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
function determineFunction(string) {
|
|
20
|
+
switch (string) {
|
|
21
|
+
case 'generateUuid()':
|
|
22
|
+
return uuidv4;
|
|
23
|
+
case 'generateBoundUuid()':
|
|
24
|
+
return memoize(uuidv4);
|
|
25
|
+
default:
|
|
26
|
+
throw new Error(`Could not convert ${string} to function`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export default function instantiateUuids(templateString) {
|
|
30
|
+
return templateString.replace(/\$\{.+?}/g, (match) => {
|
|
31
|
+
//input '${content}' and eval('content')
|
|
32
|
+
return determineFunction(match.substring(2, match.length - 1))();
|
|
33
|
+
});
|
|
34
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const LEGISLATION_TYPES = {
|
|
2
|
+
decreet: 'https://data.vlaanderen.be/id/concept/AardWetgeving/Decreet',
|
|
3
|
+
'koninklijk besluit':
|
|
4
|
+
'https://data.vlaanderen.be/id/concept/AardWetgeving/KoninklijkBesluit',
|
|
5
|
+
wet: 'https://data.vlaanderen.be/id/concept/AardWetgeving/Wet',
|
|
6
|
+
'ministerieel besluit':
|
|
7
|
+
'https://data.vlaanderen.be/id/concept/AardWetgeving/MinisterieelBesluit',
|
|
8
|
+
'besluit van de vlaamse regering':
|
|
9
|
+
'https://data.vlaanderen.be/id/concept/AardWetgeving/BesluitVanDeVlaamseRegering',
|
|
10
|
+
omzendbrief:
|
|
11
|
+
'https://data.vlaanderen.be/id/concept/AardWetgeving/Omzendbrief',
|
|
12
|
+
verdrag: 'https://data.vlaanderen.be/id/concept/AardWetgeving/Verdrag',
|
|
13
|
+
grondwet: 'https://data.vlaanderen.be/id/concept/AardWetgeving/Grondwet',
|
|
14
|
+
grondwetswijziging:
|
|
15
|
+
'https://data.vlaanderen.be/id/concept/AardWetgeving/Grondwetwijziging',
|
|
16
|
+
samenwerkingsakkoord:
|
|
17
|
+
'https://data.vlaanderen.be/id/concept/AardWetgeving/Samenwerkingsakkoord',
|
|
18
|
+
wetboek: 'https://data.vlaanderen.be/id/concept/AardWetgeving/Wetboek',
|
|
19
|
+
'gecoördineerde wetten':
|
|
20
|
+
'https://data.vlaanderen.be/id/concept/AardWetgeving/GecoordineerdeWetten',
|
|
21
|
+
'bijzondere wet':
|
|
22
|
+
'https://data.vlaanderen.be/id/concept/AardWetgeving/BijzondereWet',
|
|
23
|
+
'genummerd koninklijk besluit':
|
|
24
|
+
'https://data.vlaanderen.be/id/concept/AardWetgeving/GenummerdKoninklijkBesluit',
|
|
25
|
+
protocol: 'https://data.vlaanderen.be/id/concept/AardWetgeving/Protocol',
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const LEGISLATION_TYPE_CONCEPTS = Object.keys(LEGISLATION_TYPES).map((key) => {
|
|
29
|
+
return { label: key, value: LEGISLATION_TYPES[key] };
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export { LEGISLATION_TYPES, LEGISLATION_TYPE_CONCEPTS };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { LEGISLATION_TYPES } from './legislation-types';
|
|
2
|
+
import { isBlank } from '@ember/utils';
|
|
3
|
+
|
|
4
|
+
const STOP_WORDS = ['het', 'de', 'van', 'tot', 'dat'];
|
|
5
|
+
const DATE_REGEX = new RegExp('(\\d{1,2})\\s(\\w+)\\s(\\d{2,4})', 'g');
|
|
6
|
+
const INVISIBLE_SPACE = '\u200B';
|
|
7
|
+
const SPACES_REGEX = new RegExp('[\\s${UNBREAKABLE_SPACE}]+');
|
|
8
|
+
|
|
9
|
+
export default function processMatch(match) {
|
|
10
|
+
const matchgroups = match.groups;
|
|
11
|
+
const type = matchgroups[2];
|
|
12
|
+
const searchTerms = matchgroups[3];
|
|
13
|
+
let cleanedSearchTerms = cleanupText(searchTerms)
|
|
14
|
+
.split(SPACES_REGEX)
|
|
15
|
+
.filter(
|
|
16
|
+
(word) => !isBlank(word) && word.length > 3 && !STOP_WORDS.includes(word)
|
|
17
|
+
)
|
|
18
|
+
.join(' ');
|
|
19
|
+
|
|
20
|
+
let typeLabel;
|
|
21
|
+
if (/\w+decreet/i.test(type)) {
|
|
22
|
+
typeLabel = 'decreet';
|
|
23
|
+
cleanedSearchTerms = `${type} ${cleanedSearchTerms}`;
|
|
24
|
+
} else if (/decreet/i.test(type)) {
|
|
25
|
+
typeLabel = 'decreet';
|
|
26
|
+
} else if (/\w+wetboek/i.test(type)) {
|
|
27
|
+
typeLabel = 'wetboek';
|
|
28
|
+
cleanedSearchTerms = `${type} ${cleanedSearchTerms}`;
|
|
29
|
+
} else if (/wetboek/i.test(type)) {
|
|
30
|
+
typeLabel = 'wetboek';
|
|
31
|
+
} else if (/geco[oö]rdineerde[^\S\n]wetten/i.test(type)) {
|
|
32
|
+
typeLabel = 'gecoördineerde wetten';
|
|
33
|
+
} else if (/grondwetswijziging/i.test(type)) {
|
|
34
|
+
typeLabel = 'grondwetswijziging';
|
|
35
|
+
} else if (/grondwet/i.test(type)) {
|
|
36
|
+
typeLabel = 'grondwet';
|
|
37
|
+
} else if (/\w+wet/i.test(type)) {
|
|
38
|
+
typeLabel = 'wet';
|
|
39
|
+
cleanedSearchTerms = `${type} ${cleanedSearchTerms}`;
|
|
40
|
+
} else if (/wet/i.test(type)) {
|
|
41
|
+
typeLabel = 'wet';
|
|
42
|
+
} else {
|
|
43
|
+
typeLabel = type.toLowerCase().trim();
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const typeUri = LEGISLATION_TYPES[typeLabel] || LEGISLATION_TYPES['decreet'];
|
|
47
|
+
return {
|
|
48
|
+
text: cleanedSearchTerms,
|
|
49
|
+
legislationTypeUri: typeUri,
|
|
50
|
+
range: match.groupRanges[1],
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function cleanupText(text) {
|
|
55
|
+
if (!text) return '';
|
|
56
|
+
const { textWithoutDates } = extractDates(text);
|
|
57
|
+
const textWithoutOddChars = textWithoutDates.replace(
|
|
58
|
+
new RegExp(`[,.:"()&${INVISIBLE_SPACE}]`, 'g'),
|
|
59
|
+
''
|
|
60
|
+
);
|
|
61
|
+
const articleIndex = textWithoutOddChars.indexOf('artikel');
|
|
62
|
+
return articleIndex >= 0
|
|
63
|
+
? textWithoutOddChars.slice(0, articleIndex)
|
|
64
|
+
: textWithoutOddChars;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function extractDates(text) {
|
|
68
|
+
let date;
|
|
69
|
+
const matches = [];
|
|
70
|
+
while ((date = DATE_REGEX.exec(text)) !== null) {
|
|
71
|
+
matches.push(date);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
let textWithoutDates = text;
|
|
75
|
+
for (let match of matches) {
|
|
76
|
+
textWithoutDates = textWithoutDates.replace(match[0], '');
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return { dates: matches, textWithoutDates };
|
|
80
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { POTENTIALLY_ZONAL_URI } from '../../constants';
|
|
2
|
+
|
|
3
|
+
function buildFilters({ zonality, type, codes, category }) {
|
|
4
|
+
const filters = [];
|
|
5
|
+
if (zonality) {
|
|
6
|
+
filters.push(
|
|
7
|
+
`FILTER(?zonality IN (<${zonality}>, <${POTENTIALLY_ZONAL_URI}>))`
|
|
8
|
+
);
|
|
9
|
+
}
|
|
10
|
+
if (type) {
|
|
11
|
+
filters.push(`FILTER(?signType = <${type}>)`);
|
|
12
|
+
}
|
|
13
|
+
if (codes) {
|
|
14
|
+
filters.push(`
|
|
15
|
+
${codes
|
|
16
|
+
.map(
|
|
17
|
+
(uri) => `
|
|
18
|
+
?uri ext:relation/ext:concept <${uri}>.
|
|
19
|
+
`
|
|
20
|
+
)
|
|
21
|
+
.join(' ')}
|
|
22
|
+
`);
|
|
23
|
+
}
|
|
24
|
+
if (category) {
|
|
25
|
+
filters.push(`FILTER(?signClassification = <${category}>)`);
|
|
26
|
+
}
|
|
27
|
+
return filters;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function generateMeasuresQuery({
|
|
31
|
+
zonality,
|
|
32
|
+
type,
|
|
33
|
+
codes,
|
|
34
|
+
category,
|
|
35
|
+
pageStart = 0,
|
|
36
|
+
count,
|
|
37
|
+
}) {
|
|
38
|
+
const filters = buildFilters({ zonality, type, codes, category });
|
|
39
|
+
let pagination = '';
|
|
40
|
+
if (!count) {
|
|
41
|
+
pagination = `LIMIT 10 OFFSET ${pageStart}`;
|
|
42
|
+
}
|
|
43
|
+
const query = `
|
|
44
|
+
SELECT ${
|
|
45
|
+
count
|
|
46
|
+
? '(COUNT(DISTINCT(?template)) AS ?count)'
|
|
47
|
+
: '?uri ?label ?basicTemplate ?annotatedTemplate ?zonality ?temporal'
|
|
48
|
+
}
|
|
49
|
+
WHERE {
|
|
50
|
+
?uri a lblodMobiliteit:TrafficMeasureConcept;
|
|
51
|
+
skos:prefLabel ?label;
|
|
52
|
+
ext:zonality ?zonality;
|
|
53
|
+
ext:relation ?relationUri;
|
|
54
|
+
ext:template ?template.
|
|
55
|
+
?template ext:annotated ?annotatedTemplate;
|
|
56
|
+
ext:value ?basicTemplate.
|
|
57
|
+
?relationUri a ext:MustUseRelation ;
|
|
58
|
+
ext:concept ?signUri.
|
|
59
|
+
?signUri a ?signType;
|
|
60
|
+
skos:prefLabel ?signCode.
|
|
61
|
+
|
|
62
|
+
${filters.join('\n')}
|
|
63
|
+
OPTIONAL {
|
|
64
|
+
?uri ext:temporal ?temporal.
|
|
65
|
+
}
|
|
66
|
+
OPTIONAL {
|
|
67
|
+
?signUri org:classification ?signClassification.
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
${
|
|
71
|
+
count
|
|
72
|
+
? ''
|
|
73
|
+
: `GROUP BY ?uri ?label ?template ?zonality\n ORDER BY ASC(strlen(str(?label))) ASC(?label)`
|
|
74
|
+
}
|
|
75
|
+
${pagination}
|
|
76
|
+
`;
|
|
77
|
+
return query;
|
|
78
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default function includeInstructions(html, instructions, annotated) {
|
|
2
|
+
let finalHtml = html;
|
|
3
|
+
for (let instruction of instructions) {
|
|
4
|
+
finalHtml = finalHtml.replaceAll(
|
|
5
|
+
`\${${instruction.name}}`,
|
|
6
|
+
annotated ? instruction.annotatedTemplate : instruction.template
|
|
7
|
+
);
|
|
8
|
+
}
|
|
9
|
+
return finalHtml;
|
|
10
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { fetchCodeListsByPublisher } from './fetch-data';
|
|
2
|
+
|
|
3
|
+
export const defaultVariableTypes = {
|
|
4
|
+
text: {
|
|
5
|
+
label: 'text',
|
|
6
|
+
template: `
|
|
7
|
+
<span property="dct:type" content="text"></span>
|
|
8
|
+
<span property="ext:content">
|
|
9
|
+
<span class="mark-highlight-manual">\${text}</span>
|
|
10
|
+
</span>
|
|
11
|
+
`,
|
|
12
|
+
},
|
|
13
|
+
number: {
|
|
14
|
+
label: 'number',
|
|
15
|
+
template: `
|
|
16
|
+
<span property="dct:type" content="number"></span>
|
|
17
|
+
<span property="ext:content" datatype="xsd:integer">
|
|
18
|
+
<span class="mark-highlight-manual">\${number}</span>
|
|
19
|
+
</span>
|
|
20
|
+
`,
|
|
21
|
+
},
|
|
22
|
+
date: {
|
|
23
|
+
label: 'date',
|
|
24
|
+
template: `
|
|
25
|
+
<span property="dct:type" content="date"></span>
|
|
26
|
+
<span property="ext:content" datatype="xsd:date">
|
|
27
|
+
<span class="mark-highlight-manual">\${date}</span>
|
|
28
|
+
</span>
|
|
29
|
+
`,
|
|
30
|
+
},
|
|
31
|
+
location: {
|
|
32
|
+
label: 'location',
|
|
33
|
+
template: (endpoint) => `
|
|
34
|
+
<span property="dct:type" content="location"></span>
|
|
35
|
+
<span property="dct:source" resource="${endpoint}"></span>
|
|
36
|
+
<span property="ext:content">
|
|
37
|
+
<span class="mark-highlight-manual">\${location}</span>
|
|
38
|
+
</span>
|
|
39
|
+
`,
|
|
40
|
+
},
|
|
41
|
+
codelist: {
|
|
42
|
+
label: 'codelist',
|
|
43
|
+
fetchSubtypes: async (endpoint, publisher) => {
|
|
44
|
+
const codelists = fetchCodeListsByPublisher(endpoint, publisher);
|
|
45
|
+
return codelists;
|
|
46
|
+
},
|
|
47
|
+
template: (endpoint, selectedCodelist) => `
|
|
48
|
+
<span property="ext:codelist" resource="${selectedCodelist.uri}"></span>
|
|
49
|
+
<span property="dct:type" content="codelist"></span>
|
|
50
|
+
<span property="dct:source" resource="${endpoint}"></span>
|
|
51
|
+
<span property="ext:content">
|
|
52
|
+
<span class="mark-highlight-manual">\${${selectedCodelist.label}}</span>
|
|
53
|
+
</span>
|
|
54
|
+
`,
|
|
55
|
+
},
|
|
56
|
+
};
|
|
@@ -19,6 +19,7 @@ function generateCodeListOptionsQuery(codelistUri) {
|
|
|
19
19
|
`;
|
|
20
20
|
return codeListOptionsQuery;
|
|
21
21
|
}
|
|
22
|
+
|
|
22
23
|
function generateCodeListsByPublisherQuery(publisher) {
|
|
23
24
|
const codeListOptionsQuery = `
|
|
24
25
|
PREFIX lblodMobilitiet: <http://data.lblod.info/vocabularies/mobiliteit/>
|
|
@@ -28,36 +29,54 @@ function generateCodeListsByPublisherQuery(publisher) {
|
|
|
28
29
|
SELECT DISTINCT * WHERE {
|
|
29
30
|
?uri a lblodMobilitiet:Codelist;
|
|
30
31
|
skos:prefLabel ?label.
|
|
31
|
-
${
|
|
32
|
+
${
|
|
33
|
+
publisher
|
|
34
|
+
? `
|
|
32
35
|
?uri dct:publisher <${publisher}>.
|
|
33
|
-
`
|
|
36
|
+
`
|
|
37
|
+
: ''
|
|
38
|
+
}
|
|
34
39
|
}
|
|
35
40
|
`;
|
|
36
41
|
return codeListOptionsQuery;
|
|
37
42
|
}
|
|
38
|
-
|
|
39
|
-
|
|
43
|
+
|
|
44
|
+
export async function fetchCodeListOptions(endpoint, codelistUri) {
|
|
45
|
+
const codelistsOptionsQueryResult = await executeQuery(
|
|
46
|
+
endpoint,
|
|
47
|
+
generateCodeListOptionsQuery(codelistUri)
|
|
48
|
+
);
|
|
40
49
|
const options = parseCodelistOptions(codelistsOptionsQueryResult);
|
|
41
50
|
return {
|
|
42
|
-
type:
|
|
43
|
-
|
|
51
|
+
type:
|
|
52
|
+
codelistsOptionsQueryResult.results.bindings[0] &&
|
|
53
|
+
codelistsOptionsQueryResult.results.bindings[0].type
|
|
54
|
+
? codelistsOptionsQueryResult.results.bindings[0].type.value
|
|
55
|
+
: '',
|
|
56
|
+
options,
|
|
44
57
|
};
|
|
45
58
|
}
|
|
46
|
-
|
|
47
|
-
|
|
59
|
+
|
|
60
|
+
export async function fetchCodeListsByPublisher(endpoint, publisher) {
|
|
61
|
+
const codelistsOptionsQueryResult = await executeQuery(
|
|
62
|
+
endpoint,
|
|
63
|
+
generateCodeListsByPublisherQuery(publisher)
|
|
64
|
+
);
|
|
48
65
|
const bindings = codelistsOptionsQueryResult.results.bindings;
|
|
49
|
-
return bindings.map(binding => ({
|
|
66
|
+
return bindings.map((binding) => ({
|
|
50
67
|
uri: binding.uri.value,
|
|
51
|
-
label: binding.label.value
|
|
68
|
+
label: binding.label.value,
|
|
52
69
|
}));
|
|
53
70
|
}
|
|
71
|
+
|
|
54
72
|
function parseCodelistOptions(queryResult) {
|
|
55
73
|
const bindings = queryResult.results.bindings;
|
|
56
|
-
return bindings.map(binding => ({
|
|
74
|
+
return bindings.map((binding) => ({
|
|
57
75
|
value: binding.label.value,
|
|
58
|
-
label: binding.label.value
|
|
76
|
+
label: binding.label.value,
|
|
59
77
|
}));
|
|
60
78
|
}
|
|
79
|
+
|
|
61
80
|
async function executeQuery(endpoint, query) {
|
|
62
81
|
const encodedQuery = encodeURIComponent(query.trim());
|
|
63
82
|
const response = await fetch(endpoint, {
|
|
@@ -65,16 +84,15 @@ async function executeQuery(endpoint, query) {
|
|
|
65
84
|
mode: 'cors',
|
|
66
85
|
headers: {
|
|
67
86
|
Accept: 'application/sparql-results+json',
|
|
68
|
-
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
|
|
87
|
+
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
|
|
69
88
|
},
|
|
70
|
-
body: `query=${encodedQuery}
|
|
89
|
+
body: `query=${encodedQuery}`,
|
|
71
90
|
});
|
|
72
91
|
if (response.ok) {
|
|
73
92
|
return response.json();
|
|
74
93
|
} else {
|
|
75
|
-
throw new Error(
|
|
94
|
+
throw new Error(
|
|
95
|
+
`Request to MOW backend was unsuccessful: [${response.status}] ${response.statusText}`
|
|
96
|
+
);
|
|
76
97
|
}
|
|
77
98
|
}
|
|
78
|
-
|
|
79
|
-
export { fetchCodeListOptions as a, fetchCodeListsByPublisher as f };
|
|
80
|
-
//# sourceMappingURL=fetch-data-284bf106.js.map
|