@lblod/ember-rdfa-editor-lblod-plugins 0.3.0 → 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/README.md +311 -14
- 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 +112 -107
- 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,21 @@
|
|
|
1
|
+
<AuFormRow>
|
|
2
|
+
<AuDatePicker
|
|
3
|
+
@onChange={{this.onChangeDate}}
|
|
4
|
+
@value={{this.date}}
|
|
5
|
+
@label={{t "date-plugin.card.label"}}
|
|
6
|
+
@localization={{this.datePickerLocalization}}/>
|
|
7
|
+
</AuFormRow>
|
|
8
|
+
{{#unless @onlyDate}}
|
|
9
|
+
<AuFormRow>
|
|
10
|
+
<AuTimePicker
|
|
11
|
+
@hoursLabel={{t "date-plugin.card.hours"}}
|
|
12
|
+
@minutesLabel={{t "date-plugin.card.minutes"}}
|
|
13
|
+
@nowLabel={{t "date-plugin.card.now"}}
|
|
14
|
+
@hours={{this.hours}}
|
|
15
|
+
@minutes={{this.minutes}}
|
|
16
|
+
@showSeconds={{false}}
|
|
17
|
+
@showNow={{true}}
|
|
18
|
+
@onChange={{this.onChangeTime}}
|
|
19
|
+
/>
|
|
20
|
+
</AuFormRow>
|
|
21
|
+
{{/unless}}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { action } from '@ember/object';
|
|
3
|
+
import { inject as service } from '@ember/service';
|
|
4
|
+
import { localCopy } from 'tracked-toolbox';
|
|
5
|
+
|
|
6
|
+
export default class RdfaDateTimePicker extends Component {
|
|
7
|
+
@service intl;
|
|
8
|
+
@localCopy('args.value') date;
|
|
9
|
+
|
|
10
|
+
get hours() {
|
|
11
|
+
return this.date.getHours();
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
get minutes() {
|
|
15
|
+
return this.date.getMinutes();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
get datePickerLocalization() {
|
|
19
|
+
return {
|
|
20
|
+
buttonLabel: this.intl.t('auDatePicker.buttonLabel'),
|
|
21
|
+
selectedDateMessage: this.intl.t('auDatePicker.selectedDateMessage'),
|
|
22
|
+
prevMonthLabel: this.intl.t('auDatePicker.prevMonthLabel'),
|
|
23
|
+
nextMonthLabel: this.intl.t('auDatePicker.nextMonthLabel'),
|
|
24
|
+
monthSelectLabel: this.intl.t('auDatePicker.monthSelectLabel'),
|
|
25
|
+
yearSelectLabel: this.intl.t('auDatePicker.yearSelectLabel'),
|
|
26
|
+
closeLabel: this.intl.t('auDatePicker.closeLabel'),
|
|
27
|
+
keyboardInstruction: this.intl.t('auDatePicker.keyboardInstruction'),
|
|
28
|
+
calendarHeading: this.intl.t('auDatePicker.calendarHeading'),
|
|
29
|
+
dayNames: getLocalizedDays(this.intl),
|
|
30
|
+
monthNames: getLocalizedMonths(this.intl),
|
|
31
|
+
monthNamesShort: getLocalizedMonths(this.intl, 'short'),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@action
|
|
36
|
+
onChangeDate(isoDate, date) {
|
|
37
|
+
let wasDateInputCleared = !date;
|
|
38
|
+
if (!wasDateInputCleared) {
|
|
39
|
+
if (!this.date) {
|
|
40
|
+
this.date = new Date();
|
|
41
|
+
}
|
|
42
|
+
this.date.setDate(date.getDate());
|
|
43
|
+
this.date.setMonth(date.getMonth());
|
|
44
|
+
this.date.setFullYear(date.getFullYear());
|
|
45
|
+
this.args.onChange(this.date);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@action
|
|
50
|
+
onChangeTime(timeObject) {
|
|
51
|
+
if (!this.date) this.date = new Date();
|
|
52
|
+
this.date.setHours(timeObject.hours);
|
|
53
|
+
this.date.setMinutes(timeObject.minutes);
|
|
54
|
+
this.args.onChange(this.date);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function getLocalizedMonths(intl, monthFormat = 'long') {
|
|
59
|
+
let someYear = 2021;
|
|
60
|
+
return [...Array(12).keys()].map((monthIndex) => {
|
|
61
|
+
let date = new Date(someYear, monthIndex);
|
|
62
|
+
return intl.formatDate(date, { month: monthFormat });
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function getLocalizedDays(intl, weekdayFormat = 'long') {
|
|
67
|
+
let someSunday = new Date('2021-01-03');
|
|
68
|
+
return [...Array(7).keys()].map((index) => {
|
|
69
|
+
let weekday = new Date(someSunday.getTime());
|
|
70
|
+
weekday.setDate(someSunday.getDate() + index);
|
|
71
|
+
return intl.formatDate(weekday, { weekday: weekdayFormat });
|
|
72
|
+
});
|
|
73
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<tr class="au-c-data-table__detail">
|
|
2
|
+
<td colspan="5" class="au-o-flow au-o-flow--small">
|
|
3
|
+
<AuHeading @level="6" @skin="6">Voeg maatregel in:</AuHeading>
|
|
4
|
+
<p>
|
|
5
|
+
<AuPill>
|
|
6
|
+
<RoadsignRegulationPlugin::MeasureTemplate @measure={{@measure.uri}} @template={{@measure.template}} />
|
|
7
|
+
</AuPill>
|
|
8
|
+
</p>
|
|
9
|
+
{{#if this.isPotentiallyZonal}}
|
|
10
|
+
<AuHeading @level="6" @skin="6">Selecteer zonale geldigheid:</AuHeading>
|
|
11
|
+
<div class="au-c-form">
|
|
12
|
+
<ul>
|
|
13
|
+
<li>
|
|
14
|
+
<AuControlRadio @label="Zonaal" @name="zonal" @value={{this.ZONAL_URI}} @identifier="zonal" {{on 'change' this.changeZonality}} />
|
|
15
|
+
</li>
|
|
16
|
+
<li>
|
|
17
|
+
<AuControlRadio @label="Niet zonaal" @name="zonal" @value={{this.NON_ZONAL_URI}} @identifier="non-zonal" {{on 'change' this.changeZonality}} />
|
|
18
|
+
</li>
|
|
19
|
+
</ul>
|
|
20
|
+
</div>
|
|
21
|
+
{{/if}}
|
|
22
|
+
{{#if @measure.temporal}}
|
|
23
|
+
<AuHeading @level="6" @skin="6">Variabele signalisatie:</AuHeading>
|
|
24
|
+
<div class="au-c-form">
|
|
25
|
+
<ul>
|
|
26
|
+
<li>
|
|
27
|
+
<AuControlRadio @label="Variabel" @name="temporal" @value={{true}} @identifier="true" {{on 'change' this.changeTemporality}} />
|
|
28
|
+
</li>
|
|
29
|
+
<li>
|
|
30
|
+
<AuControlRadio @label="Niet variabel" @name="temporal" @value={{false}} @identifier="false" {{on 'change' this.changeTemporality}} />
|
|
31
|
+
</li>
|
|
32
|
+
</ul>
|
|
33
|
+
</div>
|
|
34
|
+
{{/if}}
|
|
35
|
+
<AuButtonGroup>
|
|
36
|
+
<AuButton {{on 'click' this.insert}} @disabled={{this.insertButtonDisabled}}>
|
|
37
|
+
Voeg in
|
|
38
|
+
</AuButton>
|
|
39
|
+
<AuButton @skin="secondary" {{on "click" this.unselectRow }}>
|
|
40
|
+
Annuleer
|
|
41
|
+
</AuButton>
|
|
42
|
+
</AuButtonGroup>
|
|
43
|
+
</td>
|
|
44
|
+
</tr>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { tracked } from '@glimmer/tracking';
|
|
3
|
+
import { action } from '@ember/object';
|
|
4
|
+
import {
|
|
5
|
+
NON_ZONAL_URI,
|
|
6
|
+
POTENTIALLY_ZONAL_URI,
|
|
7
|
+
ZONAL_URI,
|
|
8
|
+
} from '../../constants';
|
|
9
|
+
|
|
10
|
+
export default class ExpandedMeasureComponent extends Component {
|
|
11
|
+
@tracked zonalityValue;
|
|
12
|
+
@tracked temporalValue;
|
|
13
|
+
ZONAL_URI = ZONAL_URI;
|
|
14
|
+
NON_ZONAL_URI = NON_ZONAL_URI;
|
|
15
|
+
get isPotentiallyZonal() {
|
|
16
|
+
return this.args.measure.zonality === POTENTIALLY_ZONAL_URI;
|
|
17
|
+
}
|
|
18
|
+
get insertButtonDisabled() {
|
|
19
|
+
return this.isPotentiallyZonal && !this.zonalityValue;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@action
|
|
23
|
+
changeZonality(e) {
|
|
24
|
+
this.zonalityValue = e.target.value;
|
|
25
|
+
}
|
|
26
|
+
@action
|
|
27
|
+
changeTemporality(e) {
|
|
28
|
+
this.temporalValue = e.target.value;
|
|
29
|
+
}
|
|
30
|
+
@action
|
|
31
|
+
insert() {
|
|
32
|
+
this.args.insert(this.args.measure, this.zonalityValue, this.temporalValue);
|
|
33
|
+
}
|
|
34
|
+
@action
|
|
35
|
+
unselectRow() {
|
|
36
|
+
this.args.selectRow(this.args.measure.uri);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { inject as service } from '@ember/service';
|
|
3
|
+
import { task } from 'ember-concurrency';
|
|
4
|
+
import { tracked } from '@glimmer/tracking';
|
|
5
|
+
import includeInstructions from '../../utils/roadsign-regulation-plugin/includeInstructions';
|
|
6
|
+
|
|
7
|
+
export default class MeasureTemplateComponent extends Component {
|
|
8
|
+
@service roadsignRegistry;
|
|
9
|
+
@tracked template = '';
|
|
10
|
+
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.template = this.args.template;
|
|
14
|
+
this.fetchData.perform();
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@task
|
|
18
|
+
*fetchData() {
|
|
19
|
+
const instructions =
|
|
20
|
+
yield this.roadsignRegistry.getInstructionsForMeasure.perform(
|
|
21
|
+
this.args.measure
|
|
22
|
+
);
|
|
23
|
+
let template = includeInstructions(
|
|
24
|
+
this.args.template,
|
|
25
|
+
instructions,
|
|
26
|
+
this.args.annotated
|
|
27
|
+
);
|
|
28
|
+
this.template = template;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<AuList::Item>
|
|
2
|
+
<AuButton
|
|
3
|
+
@skin="link"
|
|
4
|
+
@icon="add"
|
|
5
|
+
@iconAlignment="left"
|
|
6
|
+
@disabled={{if this.showCard false true}}
|
|
7
|
+
{{on "click" this.toggleModal}}
|
|
8
|
+
>
|
|
9
|
+
Voeg mobiliteitsmaatregel in
|
|
10
|
+
</AuButton>
|
|
11
|
+
</AuList::Item>
|
|
12
|
+
<RoadsignRegulationPlugin::RoadsignsModal @modalOpen={{this.modalOpen}} @closeModal={{this.toggleModal}} @controller={{@controller}} @insert={{this.insert}}/>
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { action } from '@ember/object';
|
|
2
|
+
import Component from '@glimmer/component';
|
|
3
|
+
import { tracked } from '@glimmer/tracking';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Card displaying a hint of the Date plugin
|
|
7
|
+
*
|
|
8
|
+
* @module editor-roadsign-regulation-plugin
|
|
9
|
+
* @class RoadsignRegulationCard
|
|
10
|
+
* @extends Ember.Component
|
|
11
|
+
*/
|
|
12
|
+
const acceptedTypes = [
|
|
13
|
+
'>https://data.vlaanderen.be/id/concept/BesluitType/4d8f678a-6fa4-4d5f-a2a1-80974e43bf34',
|
|
14
|
+
'>https://data.vlaanderen.be/id/concept/BesluitType/7d95fd2e-3cc9-4a4c-a58e-0fbc408c2f9b',
|
|
15
|
+
'>https://data.vlaanderen.be/id/concept/BesluitType/3bba9f10-faff-49a6-acaa-85af7f2199a3',
|
|
16
|
+
'>https://data.vlaanderen.be/id/concept/BesluitType/0d1278af-b69e-4152-a418-ec5cfd1c7d0b',
|
|
17
|
+
'>https://data.vlaanderen.be/id/concept/BesluitType/e8afe7c5-9640-4db8-8f74-3f023bec3241',
|
|
18
|
+
'>https://data.vlaanderen.be/id/concept/BesluitType/256bd04a-b74b-4f2a-8f5d-14dda4765af9',
|
|
19
|
+
'>https://data.vlaanderen.be/id/concept/BesluitType/67378dd0-5413-474b-8996-d992ef81637a',
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
export default class RoadsignRegulationCard extends Component {
|
|
23
|
+
@tracked modalOpen;
|
|
24
|
+
@tracked showCard = false;
|
|
25
|
+
|
|
26
|
+
constructor() {
|
|
27
|
+
super(...arguments);
|
|
28
|
+
this.args.controller.onEvent('selectionChanged', this.selectionChanged);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@action
|
|
32
|
+
toggleModal() {
|
|
33
|
+
this.modalOpen = !this.modalOpen;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@action
|
|
37
|
+
insert(html) {
|
|
38
|
+
const selectedRange = this.args.controller.selection.lastRange;
|
|
39
|
+
if (!selectedRange) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const limitedDatastore = this.args.controller.datastore.limitToRange(
|
|
43
|
+
selectedRange,
|
|
44
|
+
'rangeIsInside'
|
|
45
|
+
);
|
|
46
|
+
const besluit = limitedDatastore
|
|
47
|
+
.match(null, 'a')
|
|
48
|
+
.transformDataset((dataset, termConverter) => {
|
|
49
|
+
return dataset.filter((quad) =>
|
|
50
|
+
acceptedTypes
|
|
51
|
+
.map((type) => termConverter(type).value)
|
|
52
|
+
.includes(quad.object.value)
|
|
53
|
+
);
|
|
54
|
+
})
|
|
55
|
+
.asSubjectNodes()
|
|
56
|
+
.next().value;
|
|
57
|
+
const besluitNode = [...besluit.nodes][0];
|
|
58
|
+
let articleContainerNode;
|
|
59
|
+
for (let child of besluitNode.children) {
|
|
60
|
+
if (child.attributeMap.get('property') === 'prov:value') {
|
|
61
|
+
articleContainerNode = child;
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
const range = this.args.controller.rangeFactory.fromInNode(
|
|
66
|
+
articleContainerNode,
|
|
67
|
+
articleContainerNode.getMaxOffset(),
|
|
68
|
+
articleContainerNode.getMaxOffset()
|
|
69
|
+
);
|
|
70
|
+
this.args.controller.executeCommand('insert-html', html, range);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
@action
|
|
74
|
+
selectionChanged() {
|
|
75
|
+
const selectedRange = this.args.controller.selection.lastRange;
|
|
76
|
+
if (!selectedRange) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const limitedDatastore = this.args.controller.datastore.limitToRange(
|
|
80
|
+
selectedRange,
|
|
81
|
+
'rangeIsInside'
|
|
82
|
+
);
|
|
83
|
+
const besluit = limitedDatastore
|
|
84
|
+
.match(null, 'a')
|
|
85
|
+
.transformDataset((dataset, termConverter) => {
|
|
86
|
+
return dataset.filter((quad) =>
|
|
87
|
+
acceptedTypes
|
|
88
|
+
.map((type) => termConverter(type).value)
|
|
89
|
+
.includes(quad.object.value)
|
|
90
|
+
);
|
|
91
|
+
})
|
|
92
|
+
.asQuads()
|
|
93
|
+
.next().value;
|
|
94
|
+
if (besluit) {
|
|
95
|
+
this.showCard = true;
|
|
96
|
+
this.besluitUri = besluit.subject.value;
|
|
97
|
+
} else {
|
|
98
|
+
this.showCard = false;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<AuModal
|
|
2
|
+
class="au-c-modal--flush"
|
|
3
|
+
@size="large"
|
|
4
|
+
@modalTitle="Mobiliteitsmaatregel toevoegen"
|
|
5
|
+
@modalOpen={{@modalOpen}}
|
|
6
|
+
@closeModal={{this.closeModal}} as |Modal| >
|
|
7
|
+
<Modal.Body>
|
|
8
|
+
<div class="au-c-body-container">
|
|
9
|
+
<div class="au-o-box au-u-background-gray-100">
|
|
10
|
+
<div class="au-o-grid au-o-grid--tiny au-o-grid--bottom">
|
|
11
|
+
<div class="au-o-grid__item au-u-1-4">
|
|
12
|
+
<AuLabel>
|
|
13
|
+
Filter op type
|
|
14
|
+
</AuLabel>
|
|
15
|
+
<PowerSelect
|
|
16
|
+
@renderInPlace={{true}}
|
|
17
|
+
@options={{this.typeOptions}}
|
|
18
|
+
@verticalPosition="below"
|
|
19
|
+
@searchEnabled={{true}}
|
|
20
|
+
@selected={{or this.typeSelected this.categorySelected}}
|
|
21
|
+
@allowClear={{true}}
|
|
22
|
+
@onChange={{this.selectTypeOrCategory}}
|
|
23
|
+
as |option|>
|
|
24
|
+
{{option.label}}
|
|
25
|
+
</PowerSelect>
|
|
26
|
+
</div>
|
|
27
|
+
<div class="au-o-grid__item au-u-1-4">
|
|
28
|
+
<AuLabel>
|
|
29
|
+
Filter op code
|
|
30
|
+
</AuLabel>
|
|
31
|
+
<PowerSelect
|
|
32
|
+
@renderInPlace={{true}}
|
|
33
|
+
@verticalPosition="below"
|
|
34
|
+
@searchEnabled={{true}}
|
|
35
|
+
@search={{this.searchCodes}}
|
|
36
|
+
@selected={{this.selectedCode}}
|
|
37
|
+
@allowClear={{true}}
|
|
38
|
+
@onChange={{this.changeCode}}
|
|
39
|
+
as |option|>
|
|
40
|
+
{{option.label}}
|
|
41
|
+
</PowerSelect>
|
|
42
|
+
</div>
|
|
43
|
+
<div class="au-o-grid__item au-u-1-4">
|
|
44
|
+
<AuLabel>
|
|
45
|
+
Combineer met code
|
|
46
|
+
</AuLabel>
|
|
47
|
+
<PowerSelectMultiple
|
|
48
|
+
@renderInPlace={{true}}
|
|
49
|
+
@verticalPosition="below"
|
|
50
|
+
@searchEnabled={{true}}
|
|
51
|
+
@searchField="label"
|
|
52
|
+
@selected={{this.selectedCodeCombination}}
|
|
53
|
+
@allowClear={{true}}
|
|
54
|
+
@onChange={{this.changeCodeCombination}}
|
|
55
|
+
@options={{this.codeCombinationOptions}}
|
|
56
|
+
@disabled={{not this.selectedCode}}
|
|
57
|
+
as |option|>
|
|
58
|
+
{{option.label}}
|
|
59
|
+
</PowerSelectMultiple>
|
|
60
|
+
</div>
|
|
61
|
+
<div class="au-o-grid__item au-u-1-4">
|
|
62
|
+
<AuLabel>
|
|
63
|
+
Filter op zonale geldigheid
|
|
64
|
+
</AuLabel>
|
|
65
|
+
<PowerSelect
|
|
66
|
+
@renderInPlace={{true}}
|
|
67
|
+
@options={{this.zonalityOptions}}
|
|
68
|
+
@verticalPosition="below"
|
|
69
|
+
@searchEnabled={{false}}
|
|
70
|
+
@selected={{this.zonalitySelected}}
|
|
71
|
+
@allowClear={{true}}
|
|
72
|
+
@onChange={{this.selectZonality}}
|
|
73
|
+
as |option|>
|
|
74
|
+
{{option.label}}
|
|
75
|
+
</PowerSelect>
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
<div class="au-c-body-container">
|
|
80
|
+
<RoadsignRegulationPlugin::RoadsignsTable
|
|
81
|
+
@content={{this.tableData}}
|
|
82
|
+
@isLoading={{this.fetchSigns.isRunning}}
|
|
83
|
+
@insert={{this.insertHtml}}
|
|
84
|
+
@count={{this.count}}
|
|
85
|
+
@goToPage={{this.goToPage}}
|
|
86
|
+
@pageSize={{this.pageSize}}
|
|
87
|
+
@pageStart={{this.pageStart}}
|
|
88
|
+
/>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
</Modal.Body>
|
|
92
|
+
</AuModal>
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import { action } from '@ember/object';
|
|
2
|
+
import Component from '@glimmer/component';
|
|
3
|
+
import { tracked } from '@glimmer/tracking';
|
|
4
|
+
import { restartableTask } from 'ember-concurrency';
|
|
5
|
+
import { getOwner } from '@ember/application';
|
|
6
|
+
import { v4 as uuid } from 'uuid';
|
|
7
|
+
import { inject as service } from '@ember/service';
|
|
8
|
+
import includeInstructions from '../../utils/roadsign-regulation-plugin/includeInstructions';
|
|
9
|
+
import {
|
|
10
|
+
NON_ZONAL_URI,
|
|
11
|
+
POTENTIALLY_ZONAL_URI,
|
|
12
|
+
ZONAL_URI,
|
|
13
|
+
} from '../../constants';
|
|
14
|
+
|
|
15
|
+
const PAGE_SIZE = 10;
|
|
16
|
+
const SIGN_TYPE_URI =
|
|
17
|
+
'https://data.vlaanderen.be/ns/mobiliteit#Verkeersbordconcept';
|
|
18
|
+
const ROAD_MARKING_URI =
|
|
19
|
+
'https://data.vlaanderen.be/ns/mobiliteit#Wegmarkeringconcept';
|
|
20
|
+
const TRAFFIC_LIGHT_URI =
|
|
21
|
+
'https://data.vlaanderen.be/ns/mobiliteit#Verkeerslichtconcept';
|
|
22
|
+
const measureTypes = [SIGN_TYPE_URI, ROAD_MARKING_URI, TRAFFIC_LIGHT_URI];
|
|
23
|
+
export default class RoadsignRegulationCard extends Component {
|
|
24
|
+
endpoint;
|
|
25
|
+
|
|
26
|
+
pageSize = PAGE_SIZE;
|
|
27
|
+
@service roadsignRegistry;
|
|
28
|
+
|
|
29
|
+
@tracked typeSelected;
|
|
30
|
+
|
|
31
|
+
@tracked categorySelected;
|
|
32
|
+
|
|
33
|
+
@tracked zonalityOptions = [
|
|
34
|
+
{
|
|
35
|
+
label: 'Zonaal',
|
|
36
|
+
value: ZONAL_URI,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
label: 'Niet zonaal',
|
|
40
|
+
value: NON_ZONAL_URI,
|
|
41
|
+
},
|
|
42
|
+
];
|
|
43
|
+
@tracked zonalitySelected;
|
|
44
|
+
|
|
45
|
+
@tracked selectedCode;
|
|
46
|
+
@tracked selectedCodeCombination;
|
|
47
|
+
@tracked codeCombinationOptions;
|
|
48
|
+
@tracked tableData = [];
|
|
49
|
+
@tracked count;
|
|
50
|
+
@tracked pageStart = 0;
|
|
51
|
+
|
|
52
|
+
get isNotTypeSign() {
|
|
53
|
+
if (!this.typeSelected) return true;
|
|
54
|
+
return this.typeSelected.value !== SIGN_TYPE_URI;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
constructor() {
|
|
58
|
+
super(...arguments);
|
|
59
|
+
const config = getOwner(this).resolveRegistration('config:environment');
|
|
60
|
+
this.endpoint = config.roadsignRegulationPlugin.endpoint;
|
|
61
|
+
this.search();
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@action
|
|
65
|
+
selectTypeOrCategory(option) {
|
|
66
|
+
if (!option) {
|
|
67
|
+
this.typeSelected = undefined;
|
|
68
|
+
this.categorySelected = undefined;
|
|
69
|
+
} else {
|
|
70
|
+
if (measureTypes.includes(option.value)) {
|
|
71
|
+
this.typeSelected = option;
|
|
72
|
+
this.categorySelected = undefined;
|
|
73
|
+
} else {
|
|
74
|
+
this.typeSelected = undefined;
|
|
75
|
+
this.categorySelected = option;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
this.selectedCode = undefined;
|
|
79
|
+
this.selectedCodeCombination = undefined;
|
|
80
|
+
this.search();
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
@action
|
|
84
|
+
changeCode(value) {
|
|
85
|
+
this.selectedCode = value;
|
|
86
|
+
this.selectedCodeCombination = undefined;
|
|
87
|
+
this.fetchCodeCombinations();
|
|
88
|
+
this.search();
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
@action
|
|
92
|
+
changeCodeCombination(value) {
|
|
93
|
+
this.selectedCodeCombination = value;
|
|
94
|
+
this.fetchCodeCombinations();
|
|
95
|
+
this.search();
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@action
|
|
99
|
+
changeDescription(e) {
|
|
100
|
+
this.descriptionFilter = e.target.value;
|
|
101
|
+
this.search();
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
@action
|
|
105
|
+
selectCategory(value) {
|
|
106
|
+
this.categorySelected = value;
|
|
107
|
+
this.search();
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
@action
|
|
111
|
+
selectZonality(value) {
|
|
112
|
+
this.zonalitySelected = value;
|
|
113
|
+
this.search();
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
@action
|
|
117
|
+
closeModal() {
|
|
118
|
+
this.args.closeModal();
|
|
119
|
+
}
|
|
120
|
+
@action
|
|
121
|
+
searchCodes(term) {
|
|
122
|
+
const category = this.categorySelected
|
|
123
|
+
? this.categorySelected.value
|
|
124
|
+
: undefined;
|
|
125
|
+
const type = this.typeSelected ? this.typeSelected.value : undefined;
|
|
126
|
+
return this.roadsignRegistry.searchCode.perform(term, category, type);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
async fetchCodeCombinations() {
|
|
130
|
+
let signs = [this.selectedCode.value];
|
|
131
|
+
if (this.selectedCodeCombination) {
|
|
132
|
+
signs = [
|
|
133
|
+
this.selectedCode.value,
|
|
134
|
+
...this.selectedCodeCombination.map((s) => s.value),
|
|
135
|
+
];
|
|
136
|
+
}
|
|
137
|
+
const codes = await this.roadsignRegistry.searchCode.perform(
|
|
138
|
+
undefined,
|
|
139
|
+
undefined,
|
|
140
|
+
undefined,
|
|
141
|
+
signs
|
|
142
|
+
);
|
|
143
|
+
this.codeCombinationOptions = codes;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
get typeOptions() {
|
|
147
|
+
return [
|
|
148
|
+
{
|
|
149
|
+
groupName: 'Types',
|
|
150
|
+
options: [
|
|
151
|
+
{
|
|
152
|
+
label: 'Verkeersborden',
|
|
153
|
+
value: SIGN_TYPE_URI,
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
label: 'Wegmarkeringen',
|
|
157
|
+
value:
|
|
158
|
+
'https://data.vlaanderen.be/ns/mobiliteit#Wegmarkeringconcept',
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
label: 'Verkeerslichten',
|
|
162
|
+
value:
|
|
163
|
+
'https://data.vlaanderen.be/ns/mobiliteit#Verkeerslichtconcept',
|
|
164
|
+
},
|
|
165
|
+
],
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
groupName: 'Categorieën',
|
|
169
|
+
options: this.roadsignRegistry.classifications,
|
|
170
|
+
},
|
|
171
|
+
];
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
@restartableTask
|
|
175
|
+
*fetchSigns() {
|
|
176
|
+
let codes = [];
|
|
177
|
+
if (this.selectedCodeCombination) {
|
|
178
|
+
codes.push(...this.selectedCodeCombination);
|
|
179
|
+
}
|
|
180
|
+
if (this.selectedCode) {
|
|
181
|
+
codes.push(this.selectedCode);
|
|
182
|
+
}
|
|
183
|
+
const { measures, count } =
|
|
184
|
+
yield this.roadsignRegistry.fetchMeasures.perform({
|
|
185
|
+
zonality: this.zonalitySelected
|
|
186
|
+
? this.zonalitySelected.value
|
|
187
|
+
: undefined,
|
|
188
|
+
type: this.typeSelected ? this.typeSelected.value : undefined,
|
|
189
|
+
codes: codes.length ? codes.map((code) => code.value) : undefined,
|
|
190
|
+
category: this.categorySelected
|
|
191
|
+
? this.categorySelected.value
|
|
192
|
+
: undefined,
|
|
193
|
+
pageStart: this.pageStart,
|
|
194
|
+
});
|
|
195
|
+
this.tableData = measures;
|
|
196
|
+
this.count = count;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
@action
|
|
200
|
+
async insertHtml(measure, zonalityValue, temporalValue) {
|
|
201
|
+
const instructions =
|
|
202
|
+
await this.roadsignRegistry.fetchInstructionsForMeasure.perform(
|
|
203
|
+
measure.uri
|
|
204
|
+
);
|
|
205
|
+
const zonality = zonalityValue ? zonalityValue : measure.zonality;
|
|
206
|
+
const html = includeInstructions(
|
|
207
|
+
measure.annotatedTemplate,
|
|
208
|
+
instructions,
|
|
209
|
+
true
|
|
210
|
+
);
|
|
211
|
+
const signsHTML = measure.signs
|
|
212
|
+
.map((sign) => {
|
|
213
|
+
const roadSignUri = 'http://data.lblod.info/verkeerstekens/' + uuid();
|
|
214
|
+
return `<li style="margin-bottom:1rem;"><span property="mobiliteit:wordtAangeduidDoor" resource=${roadSignUri} typeof="mobiliteit:Verkeersbord-Verkeersteken">
|
|
215
|
+
<span property="mobiliteit:heeftVerkeersbordconcept" resource="${
|
|
216
|
+
sign.uri
|
|
217
|
+
}" typeof="mobiliteit:Verkeersbordconcept" style="display:flex;align-items:center;">
|
|
218
|
+
<span property="skos:prefLabel" style="padding-bottom:0;margin-left:0;margin-right:.4rem;">${
|
|
219
|
+
sign.code
|
|
220
|
+
}</span>
|
|
221
|
+
<span style="margin-left:0;margin-top:0;">${
|
|
222
|
+
sign.zonality === POTENTIALLY_ZONAL_URI && zonality === ZONAL_URI
|
|
223
|
+
? 'met zonale geldigheid'
|
|
224
|
+
: ''
|
|
225
|
+
}
|
|
226
|
+
</span>
|
|
227
|
+
</span>
|
|
228
|
+
</span>
|
|
229
|
+
</li>`;
|
|
230
|
+
})
|
|
231
|
+
.join('\n');
|
|
232
|
+
|
|
233
|
+
this.args.controller.executeCommand(
|
|
234
|
+
'insert-article',
|
|
235
|
+
this.args.controller,
|
|
236
|
+
`<div property="mobiliteit:heeftVerkeersmaatregel" typeof="mobiliteit:Mobiliteitsmaatregel" resource="http://data.lblod.info/mobiliteitsmaatregels/${uuid()}">
|
|
237
|
+
<span style="display:none;" property="prov:wasDerivedFrom" resource="${
|
|
238
|
+
measure.uri
|
|
239
|
+
}"> </span>
|
|
240
|
+
<span style="display:none;" property="ext:zonality" resource="${zonality}"></span>
|
|
241
|
+
<span style="display:none;" property="ext:temporal" value="${
|
|
242
|
+
measure.temporal
|
|
243
|
+
}"></span>
|
|
244
|
+
<div property="dct:description">
|
|
245
|
+
${html}
|
|
246
|
+
<p>Dit wordt aangeduid door verkeerstekens:</p>
|
|
247
|
+
<ul style="list-style:none;">
|
|
248
|
+
${signsHTML}
|
|
249
|
+
</ul>
|
|
250
|
+
${temporalValue === 'true' ? 'Deze signalisatie is dynamisch.' : ''}
|
|
251
|
+
</div>
|
|
252
|
+
</div>
|
|
253
|
+
`
|
|
254
|
+
);
|
|
255
|
+
this.args.closeModal();
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
@action
|
|
259
|
+
goToPage(pageStart) {
|
|
260
|
+
this.pageStart = pageStart;
|
|
261
|
+
this.fetchSigns.perform();
|
|
262
|
+
}
|
|
263
|
+
@action
|
|
264
|
+
search() {
|
|
265
|
+
this.pageStart = 0;
|
|
266
|
+
this.fetchSigns.perform();
|
|
267
|
+
}
|
|
268
|
+
}
|