@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
package/.release-it.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
pipeline:
|
|
2
|
+
install:
|
|
3
|
+
image: danlynn/ember-cli:4.4.0
|
|
4
|
+
commands:
|
|
5
|
+
- npm ci
|
|
6
|
+
release:
|
|
7
|
+
image: plugins/npm
|
|
8
|
+
settings:
|
|
9
|
+
token:
|
|
10
|
+
from_secret: npm_access_token
|
|
11
|
+
# Pipeline level conditions aren't supported yet:
|
|
12
|
+
# https://github.com/woodpecker-ci/woodpecker/issues/283
|
|
13
|
+
when:
|
|
14
|
+
event: tag
|
|
15
|
+
tag: v*
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
|
|
2
|
+
pipeline:
|
|
3
|
+
install:
|
|
4
|
+
image: danlynn/ember-cli:4.4.0
|
|
5
|
+
commands:
|
|
6
|
+
- npm ci
|
|
7
|
+
lint-js:
|
|
8
|
+
image: danlynn/ember-cli:4.4.0
|
|
9
|
+
group: lint
|
|
10
|
+
commands:
|
|
11
|
+
- npm run lint:js
|
|
12
|
+
lint-hbs:
|
|
13
|
+
image: danlynn/ember-cli:4.4.0
|
|
14
|
+
group: lint
|
|
15
|
+
commands:
|
|
16
|
+
- npm run lint:hbs
|
|
17
|
+
test:
|
|
18
|
+
image: danlynn/ember-cli:4.4.0
|
|
19
|
+
commands:
|
|
20
|
+
- npm run test:ember || exit 0
|
|
21
|
+
when:
|
|
22
|
+
event:
|
|
23
|
+
- pull_request
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
## 0.4.0 (2022-12-01)
|
|
10
|
+
|
|
11
|
+
#### :house: Internal
|
|
12
|
+
* [#23](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/23) Add typescript support ([@elpoelma](https://github.com/elpoelma))
|
|
13
|
+
* [#22](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/22) Move to classic ember addon ([@elpoelma](https://github.com/elpoelma))
|
|
14
|
+
|
|
15
|
+
#### Committers: 1
|
|
16
|
+
- Elena Poelman ([@elpoelma](https://github.com/elpoelma))
|
|
17
|
+
|
|
18
|
+
## v0.3.1 (2022-11-24)
|
|
19
|
+
|
|
20
|
+
#### :memo: Documentation
|
|
21
|
+
* [#15](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/15) Add documentation to readme ([@elpoelma](https://github.com/elpoelma))
|
|
22
|
+
|
|
23
|
+
#### Committers: 1
|
|
24
|
+
- Elena Poelman ([@elpoelma](https://github.com/elpoelma))
|
|
25
|
+
|
|
26
|
+
## v0.3.0 (2022-11-23)
|
|
27
|
+
|
|
28
|
+
#### :rocket: Enhancement
|
|
29
|
+
* [#7](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/7) Add roadsign regulation plugin ([@elpoelma](https://github.com/elpoelma))
|
|
30
|
+
|
|
31
|
+
#### Committers: 1
|
|
32
|
+
- Elena Poelman ([@elpoelma](https://github.com/elpoelma))
|
|
33
|
+
|
|
34
|
+
## v0.2.0 (2022-11-23)
|
|
35
|
+
|
|
36
|
+
#### :rocket: Enhancement
|
|
37
|
+
* [#14](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/14) Add insert and template variable plugins ([@elpoelma](https://github.com/elpoelma))
|
|
38
|
+
|
|
39
|
+
#### Committers: 1
|
|
40
|
+
- Elena Poelman ([@elpoelma](https://github.com/elpoelma))
|
|
41
|
+
|
|
42
|
+
## v0.1.3 (2022-11-23)
|
|
43
|
+
|
|
44
|
+
#### :bug: Bug Fix
|
|
45
|
+
* [#13](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/13) Fix path of table-of-contents outline component ([@elpoelma](https://github.com/elpoelma))
|
|
46
|
+
|
|
47
|
+
#### Committers: 1
|
|
48
|
+
- Elena Poelman ([@elpoelma](https://github.com/elpoelma))
|
|
49
|
+
|
|
50
|
+
## v0.1.2 (2022-11-23)
|
|
51
|
+
|
|
52
|
+
#### :house: Internal
|
|
53
|
+
* [#12](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/12) Export config and translations ([@elpoelma](https://github.com/elpoelma))
|
|
54
|
+
|
|
55
|
+
#### Committers: 1
|
|
56
|
+
- Elena Poelman ([@elpoelma](https://github.com/elpoelma))
|
|
57
|
+
|
|
58
|
+
## v0.1.1 (2022-11-23)
|
|
59
|
+
|
|
60
|
+
#### :house: Internal
|
|
61
|
+
* [#11](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/11) Loosen ember-data peerdep requirement to 3.27.0 ([@elpoelma](https://github.com/elpoelma))
|
|
62
|
+
|
|
63
|
+
#### Committers: 1
|
|
64
|
+
- Elena Poelman ([@elpoelma](https://github.com/elpoelma))
|
|
65
|
+
|
|
66
|
+
## v0.1.0 (2022-11-23)
|
|
67
|
+
|
|
68
|
+
#### :rocket: Enhancement
|
|
69
|
+
* [#9](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/9) Add import-snippet plugin ([@elpoelma](https://github.com/elpoelma))
|
|
70
|
+
* [#8](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/8) Add rdfa-date plugin ([@elpoelma](https://github.com/elpoelma))
|
|
71
|
+
* [#3](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/3) Add standard-template plugin ([@elpoelma](https://github.com/elpoelma))
|
|
72
|
+
* [#4](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/4) Add besluit-type plugin ([@elpoelma](https://github.com/elpoelma))
|
|
73
|
+
* [#6](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/6) Add generate template plugin ([@elpoelma](https://github.com/elpoelma))
|
|
74
|
+
* [#5](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/5) Add table-of-contents plugin ([@elpoelma](https://github.com/elpoelma))
|
|
75
|
+
* [#2](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/2) Add citaten-plugin ([@elpoelma](https://github.com/elpoelma))
|
|
76
|
+
|
|
77
|
+
#### :house: Internal
|
|
78
|
+
* [#10](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/10) Set up woodpecker ([@elpoelma](https://github.com/elpoelma))
|
|
79
|
+
* [#1](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/1) Setup basic test-app ([@elpoelma](https://github.com/elpoelma))
|
|
80
|
+
|
|
81
|
+
#### Committers: 1
|
|
82
|
+
- Elena Poelman ([@elpoelma](https://github.com/elpoelma))
|
|
83
|
+
|
|
84
|
+
# Changelog
|
package/RELEASE.md
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Release Process
|
|
2
|
+
|
|
3
|
+
Releases are mostly automated using
|
|
4
|
+
[release-it](https://github.com/release-it/release-it/) and
|
|
5
|
+
[lerna-changelog](https://github.com/lerna/lerna-changelog/).
|
|
6
|
+
|
|
7
|
+
## Preparation
|
|
8
|
+
|
|
9
|
+
Since the majority of the actual release process is automated, the primary
|
|
10
|
+
remaining task prior to releasing is confirming that all pull requests that
|
|
11
|
+
have been merged since the last release have been labeled with the appropriate
|
|
12
|
+
`lerna-changelog` labels and the titles have been updated to ensure they
|
|
13
|
+
represent something that would make sense to our users. Some great information
|
|
14
|
+
on why this is important can be found at
|
|
15
|
+
[keepachangelog.com](https://keepachangelog.com/en/1.0.0/), but the overall
|
|
16
|
+
guiding principle here is that changelogs are for humans, not machines.
|
|
17
|
+
|
|
18
|
+
When reviewing merged PR's the labels to be used are:
|
|
19
|
+
|
|
20
|
+
* breaking - Used when the PR is considered a breaking change.
|
|
21
|
+
* enhancement - Used when the PR adds a new feature or enhancement.
|
|
22
|
+
* bug - Used when the PR fixes a bug included in a previous release.
|
|
23
|
+
* documentation - Used when the PR adds or updates documentation.
|
|
24
|
+
* internal - Used for internal changes that still require a mention in the
|
|
25
|
+
changelog/release notes.
|
|
26
|
+
|
|
27
|
+
## Release
|
|
28
|
+
|
|
29
|
+
Once the prep work is completed, the actual release is straight forward:
|
|
30
|
+
|
|
31
|
+
* First, ensure that you have installed your projects dependencies:
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
npm install
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
* Second, ensure that you have obtained a
|
|
38
|
+
[GitHub personal access token][generate-token] with the `repo` scope (no
|
|
39
|
+
other permissions are needed). Make sure the token is available as the
|
|
40
|
+
`GITHUB_AUTH` environment variable.
|
|
41
|
+
|
|
42
|
+
For instance:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
export GITHUB_AUTH=abc123def456
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
[generate-token]: https://github.com/settings/tokens/new?scopes=repo&description=GITHUB_AUTH+env+variable
|
|
49
|
+
|
|
50
|
+
* And last (but not least 😁) do your release.
|
|
51
|
+
|
|
52
|
+
```sh
|
|
53
|
+
npx release-it
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
[release-it](https://github.com/release-it/release-it/) manages the actual
|
|
57
|
+
release process. It will prompt you to to choose the version number after which
|
|
58
|
+
you will have the chance to hand tweak the changelog to be used (for the
|
|
59
|
+
`CHANGELOG.md` and GitHub release), then `release-it` continues on to tagging,
|
|
60
|
+
pushing the tag and commits, etc.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import defaultResources from '../utils/generate-template-plugin/default-resources';
|
|
2
|
+
|
|
3
|
+
export default class GenerateTemplateCommand {
|
|
4
|
+
name = 'generateTemplate';
|
|
5
|
+
|
|
6
|
+
constructor(model) {
|
|
7
|
+
this.model = model;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
canExecute() {
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
execute(controller) {
|
|
15
|
+
let uris = [];
|
|
16
|
+
for (let resource of defaultResources) {
|
|
17
|
+
const quads = [
|
|
18
|
+
...controller.datastore.match(null, 'a', `>${resource}`).asQuads(),
|
|
19
|
+
];
|
|
20
|
+
const resourceUris = quads.map((quad) => quad.subject.value);
|
|
21
|
+
uris = [...uris, ...resourceUris];
|
|
22
|
+
}
|
|
23
|
+
let documentHTML = controller.htmlContent;
|
|
24
|
+
for (let uri of uris) {
|
|
25
|
+
const uriParts = uri.split('/');
|
|
26
|
+
uriParts.pop();
|
|
27
|
+
const uriWithoutUuid = uriParts.join('/');
|
|
28
|
+
documentHTML = documentHTML.replace(
|
|
29
|
+
uri,
|
|
30
|
+
`${uriWithoutUuid}/\${generateUuid()}`
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
return documentHTML;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export default class InsertAndCollapseCommand {
|
|
2
|
+
name = 'insert-and-collapse';
|
|
3
|
+
|
|
4
|
+
constructor(model) {
|
|
5
|
+
this.model = model;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
canExecute() {
|
|
9
|
+
return true;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
execute(controller, htmlString, node) {
|
|
13
|
+
const range = controller.rangeFactory.fromInNode(
|
|
14
|
+
node,
|
|
15
|
+
0,
|
|
16
|
+
node.getMaxOffset()
|
|
17
|
+
);
|
|
18
|
+
controller.executeCommand('insert-html', htmlString, range);
|
|
19
|
+
|
|
20
|
+
controller.selection.selectRange(
|
|
21
|
+
controller.selection.lastRange.shrinkToVisible()
|
|
22
|
+
);
|
|
23
|
+
const containedNodes =
|
|
24
|
+
controller.selection.lastRange.contextNodes('rangeContains');
|
|
25
|
+
containedNodes.next();
|
|
26
|
+
const span = containedNodes.next().value;
|
|
27
|
+
const finalRange = controller.rangeFactory.fromInNode(span);
|
|
28
|
+
controller.selection.selectRange(finalRange);
|
|
29
|
+
|
|
30
|
+
this.model.writeSelection();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export default class ModifyDateCommand {
|
|
2
|
+
name = 'modify-date';
|
|
3
|
+
|
|
4
|
+
constructor(model) {
|
|
5
|
+
this.model = model;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
canExecute() {
|
|
9
|
+
return true;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
execute(controller, element, dateValue, onlyDate) {
|
|
13
|
+
this.model.change((mutator) => {
|
|
14
|
+
const range = controller.rangeFactory.fromInElement(
|
|
15
|
+
element,
|
|
16
|
+
0,
|
|
17
|
+
element.getMaxOffset()
|
|
18
|
+
);
|
|
19
|
+
mutator.insertText(
|
|
20
|
+
range,
|
|
21
|
+
this.formatDate(dateValue, onlyDate),
|
|
22
|
+
range.getMarks()
|
|
23
|
+
);
|
|
24
|
+
element.attributeMap.set('content', dateValue.toISOString());
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
formatDate(date, onlyDate) {
|
|
29
|
+
let options = {
|
|
30
|
+
year: 'numeric',
|
|
31
|
+
month: '2-digit',
|
|
32
|
+
day: '2-digit',
|
|
33
|
+
hour: '2-digit',
|
|
34
|
+
minute: '2-digit',
|
|
35
|
+
};
|
|
36
|
+
if (onlyDate) {
|
|
37
|
+
options.hour = undefined;
|
|
38
|
+
options.minute = undefined;
|
|
39
|
+
}
|
|
40
|
+
return date.toLocaleString('nl-BE', options);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<div ...attributes>
|
|
2
|
+
<PowerSelect
|
|
3
|
+
@renderInPlace={{true}}
|
|
4
|
+
@searchEnabled={{true}}
|
|
5
|
+
@searchMessage={{t "besluit-type-plugin.search-message"}}
|
|
6
|
+
@noMatchesMessage={{t "besluit-type-plugin.no-matches-message"}}
|
|
7
|
+
@search={{this.search}}
|
|
8
|
+
@options={{this.besluitTypes}}
|
|
9
|
+
@selected={{@selected}}
|
|
10
|
+
@onChange={{@onchange}} as |besluitType|>
|
|
11
|
+
{{besluitType.label}}
|
|
12
|
+
</PowerSelect>
|
|
13
|
+
<p class='au-u-muted au-u-margin-tiny au-u-margin-bottom-small'>
|
|
14
|
+
{{@selected.definition}}
|
|
15
|
+
</p>
|
|
16
|
+
{{#if @showWarningWhenEmpty}}
|
|
17
|
+
{{#unless @selected}}
|
|
18
|
+
<AuAlert
|
|
19
|
+
@icon="alert-triangle"
|
|
20
|
+
@title={{t "besluit-type-plugin.alert-title"}}
|
|
21
|
+
@skin="warning"
|
|
22
|
+
@size="small"
|
|
23
|
+
class="au-u-margin-bottom-none au-u-margin-top-small">
|
|
24
|
+
<p>{{t "besluit-type-plugin.alert-body"}}</p>
|
|
25
|
+
</AuAlert>
|
|
26
|
+
{{/unless}}
|
|
27
|
+
{{/if}}
|
|
28
|
+
</div>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { action } from '@ember/object';
|
|
3
|
+
import { tracked } from '@glimmer/tracking';
|
|
4
|
+
|
|
5
|
+
export default class BesluitTypePluginBesluitTypeSelectComponent extends Component {
|
|
6
|
+
@tracked besluitTypes;
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.besluitTypes = this.args.besluitTypes.sort((a, b) =>
|
|
10
|
+
a.label > b.label ? 1 : -1
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@action
|
|
15
|
+
search(term) {
|
|
16
|
+
const lowerTerm = term.toLowerCase();
|
|
17
|
+
return this.args.besluitTypes.filter((besluitType) =>
|
|
18
|
+
besluitType.label.toLowerCase().includes(lowerTerm)
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
{{#if this.showCard}}
|
|
2
|
+
{{#if this.loadDataTaskInstance.isError}}
|
|
3
|
+
<AuPill
|
|
4
|
+
@skin="error"
|
|
5
|
+
@icon="circle-x"
|
|
6
|
+
@iconAlignment="left"
|
|
7
|
+
class="au-c-pill--link"
|
|
8
|
+
{{on "click" this.toggleCard}}>
|
|
9
|
+
{{t "besluit-type-plugin.error-short"}}
|
|
10
|
+
</AuPill>
|
|
11
|
+
{{else}}
|
|
12
|
+
{{#if this.besluit.label}}
|
|
13
|
+
<AuPill
|
|
14
|
+
@skin="link"
|
|
15
|
+
{{on "click" this.toggleCard}}>
|
|
16
|
+
{{t "besluit-type-plugin.dt"}}: {{this.besluit.label}}
|
|
17
|
+
</AuPill>
|
|
18
|
+
{{else}}
|
|
19
|
+
<AuPill
|
|
20
|
+
@icon="alert-triangle"
|
|
21
|
+
@iconAlignment="left"
|
|
22
|
+
@skin="link"
|
|
23
|
+
{{on "click" this.toggleCard}}>
|
|
24
|
+
{{t "besluit-type-plugin.insert-dt"}}
|
|
25
|
+
</AuPill>
|
|
26
|
+
{{/if}}
|
|
27
|
+
{{/if}}
|
|
28
|
+
{{/if}}
|
|
29
|
+
{{#if this.cardExpanded}}
|
|
30
|
+
<AuModal
|
|
31
|
+
@title={{t "besluit-type-plugin.insert-dt"}}
|
|
32
|
+
@closeModal={{this.toggleCard}}
|
|
33
|
+
@modalOpen={{true}}
|
|
34
|
+
@size='default'
|
|
35
|
+
class="au-c-modal--overflow"
|
|
36
|
+
as |Modal|>
|
|
37
|
+
<Modal.Body>
|
|
38
|
+
{{#if this.loadDataTaskInstance.isError}}
|
|
39
|
+
<AuAlert
|
|
40
|
+
@title={{t "besluit-type-plugin.error-title"}}
|
|
41
|
+
@skin="error"
|
|
42
|
+
@icon="cross">
|
|
43
|
+
<p>
|
|
44
|
+
{{t "besluit-type-plugin.error-first-body"}}
|
|
45
|
+
{{!-- template-lint-disable no-bare-strings --}}
|
|
46
|
+
<AuLinkExternal
|
|
47
|
+
href="mailto:gelinktnotuleren@vlaanderen.be"
|
|
48
|
+
@icon="mail"
|
|
49
|
+
@iconAlignment="left">
|
|
50
|
+
GelinktNotuleren@vlaanderen.be
|
|
51
|
+
</AuLinkExternal>
|
|
52
|
+
{{!-- template-lint-enable no-bare-strings --}}
|
|
53
|
+
{{t "besluit-type-plugin.error-rest-body"}}
|
|
54
|
+
</p>
|
|
55
|
+
</AuAlert>
|
|
56
|
+
{{else}}
|
|
57
|
+
<BesluitTypePlugin::BesluitTypeSelect
|
|
58
|
+
@besluitTypes={{this.types}}
|
|
59
|
+
@onchange={{this.updateBesluitType}}
|
|
60
|
+
@selected={{this.besluit}}
|
|
61
|
+
@showWarningWhenEmpty={{false}}/>
|
|
62
|
+
{{#if this.besluit.subTypes.length}}
|
|
63
|
+
<AuHr @size="large"/>
|
|
64
|
+
<BesluitTypePlugin::BesluitTypeSelect
|
|
65
|
+
@besluitTypes={{this.besluit.subTypes}}
|
|
66
|
+
@onchange={{this.updateBesluitSubType}}
|
|
67
|
+
@selected={{this.subBesluit}}
|
|
68
|
+
@showWarningWhenEmpty={{true}}
|
|
69
|
+
class="au-u-padding-left au-u-padding-right"/>
|
|
70
|
+
{{/if}}
|
|
71
|
+
{{#if this.subBesluit.subTypes.length}}
|
|
72
|
+
<AuHr @size="large"/>
|
|
73
|
+
<BesluitTypePlugin::BesluitTypeSelect
|
|
74
|
+
@besluitTypes={{this.subBesluit.subTypes}}
|
|
75
|
+
@onchange={{this.updateBesluitSubSubType}}
|
|
76
|
+
@selected={{this.subSubBesluit}}
|
|
77
|
+
@showWarningWhenEmpty={{true}}
|
|
78
|
+
class="au-u-padding-left au-u-padding-right"/>
|
|
79
|
+
{{/if}}
|
|
80
|
+
{{/if}}
|
|
81
|
+
</Modal.Body>
|
|
82
|
+
</AuModal>
|
|
83
|
+
{{/if}}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { tracked } from '@glimmer/tracking';
|
|
2
|
+
import Component from '@glimmer/component';
|
|
3
|
+
import { action } from '@ember/object';
|
|
4
|
+
import { task } from 'ember-concurrency';
|
|
5
|
+
import { getOwner } from '@ember/application';
|
|
6
|
+
import fetchBesluitTypes from '../../utils/fetchBesluitTypes';
|
|
7
|
+
import { inject as service } from '@ember/service';
|
|
8
|
+
|
|
9
|
+
export default class BesluitTypePluginToolbarDropdownComponent extends Component {
|
|
10
|
+
@service currentSession;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Actual besluit type selected
|
|
14
|
+
* @property besluitType
|
|
15
|
+
* @type BesluitType
|
|
16
|
+
* @private
|
|
17
|
+
*/
|
|
18
|
+
@tracked besluitType;
|
|
19
|
+
@tracked previousBesluitType;
|
|
20
|
+
@tracked types = [];
|
|
21
|
+
|
|
22
|
+
//used to update selections since the other vars dont seem to work in octane
|
|
23
|
+
@tracked besluit;
|
|
24
|
+
@tracked subBesluit;
|
|
25
|
+
@tracked subSubBesluit;
|
|
26
|
+
|
|
27
|
+
@tracked cardExpanded = false;
|
|
28
|
+
@tracked showCard = false;
|
|
29
|
+
|
|
30
|
+
@tracked loadDataTaskInstance;
|
|
31
|
+
|
|
32
|
+
constructor(...args) {
|
|
33
|
+
super(...args);
|
|
34
|
+
this.loadDataTaskInstance = this.loadData.perform();
|
|
35
|
+
this.args.controller.onEvent('selectionChanged', this.getBesluitType);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@task
|
|
39
|
+
*loadData() {
|
|
40
|
+
const bestuurseenheid = yield this.currentSession.get('group');
|
|
41
|
+
const classificatie = yield bestuurseenheid.get('classificatie');
|
|
42
|
+
const ENV = getOwner(this).resolveRegistration('config:environment');
|
|
43
|
+
const types = yield fetchBesluitTypes(classificatie.uri, ENV);
|
|
44
|
+
this.types = types;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@action
|
|
48
|
+
getBesluitType() {
|
|
49
|
+
const selectedRange = this.args.controller.selection.lastRange;
|
|
50
|
+
if (!selectedRange) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const limitedDatastore = this.args.controller.datastore.limitToRange(
|
|
54
|
+
selectedRange,
|
|
55
|
+
'rangeIsInside'
|
|
56
|
+
);
|
|
57
|
+
const besluit = limitedDatastore
|
|
58
|
+
.match(null, 'a', '>http://data.vlaanderen.be/ns/besluit#Besluit')
|
|
59
|
+
.asQuads()
|
|
60
|
+
.next().value;
|
|
61
|
+
if (!besluit) {
|
|
62
|
+
this.showCard = false;
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
this.showCard = true;
|
|
66
|
+
const besluitUri = besluit.subject.value;
|
|
67
|
+
const besluitTypes = limitedDatastore
|
|
68
|
+
.match(`>${besluitUri}`, 'a', null)
|
|
69
|
+
.asQuads();
|
|
70
|
+
const besluitTypesUris = [...besluitTypes].map((quad) => quad.object.value);
|
|
71
|
+
const besluitTypeRelevant = besluitTypesUris.find((type) =>
|
|
72
|
+
type.includes('https://data.vlaanderen.be/id/concept/BesluitType/')
|
|
73
|
+
);
|
|
74
|
+
this.besluitNode = [
|
|
75
|
+
...limitedDatastore
|
|
76
|
+
.match(`>${besluitUri}`, 'a', null)
|
|
77
|
+
.asSubjectNodes()
|
|
78
|
+
.next().value.nodes,
|
|
79
|
+
][0];
|
|
80
|
+
if (besluitTypeRelevant) {
|
|
81
|
+
this.previousBesluitType = besluitTypeRelevant;
|
|
82
|
+
const besluitType = this.findBesluitTypeByURI(besluitTypeRelevant);
|
|
83
|
+
|
|
84
|
+
const firstAncestor = this.findBesluitTypeParent(besluitType);
|
|
85
|
+
const secondAncestor = this.findBesluitTypeParent(firstAncestor);
|
|
86
|
+
if (firstAncestor && secondAncestor) {
|
|
87
|
+
this.besluit = secondAncestor;
|
|
88
|
+
this.subBesluit = firstAncestor;
|
|
89
|
+
this.subSubBesluit = besluitType;
|
|
90
|
+
} else if (firstAncestor) {
|
|
91
|
+
this.besluit = firstAncestor;
|
|
92
|
+
this.subBesluit = besluitType;
|
|
93
|
+
this.subSubBesluit = undefined;
|
|
94
|
+
} else {
|
|
95
|
+
this.besluit = besluitType;
|
|
96
|
+
this.subBesluit = undefined;
|
|
97
|
+
this.subSubBesluit = undefined;
|
|
98
|
+
}
|
|
99
|
+
this.cardExpanded = false;
|
|
100
|
+
} else {
|
|
101
|
+
this.cardExpanded = true;
|
|
102
|
+
this.besluit = undefined;
|
|
103
|
+
this.subBesluit = undefined;
|
|
104
|
+
this.subSubBesluit = undefined;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
@action
|
|
109
|
+
updateBesluitType(selected) {
|
|
110
|
+
this.besluit = selected;
|
|
111
|
+
this.besluitType = selected;
|
|
112
|
+
this.subBesluit = null;
|
|
113
|
+
this.subSubBesluit = null;
|
|
114
|
+
if (!selected.subTypes || !selected.subTypes.length) this.insert();
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
@action
|
|
118
|
+
updateBesluitSubType(selected) {
|
|
119
|
+
this.subBesluit = selected;
|
|
120
|
+
this.besluitType = selected;
|
|
121
|
+
this.subSubBesluit = null;
|
|
122
|
+
if (!selected.subTypes || !selected.subTypes.length) this.insert();
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
@action
|
|
126
|
+
updateBesluitSubSubType(selected) {
|
|
127
|
+
this.subSubBesluit = selected;
|
|
128
|
+
this.besluitType = selected;
|
|
129
|
+
if (!selected.subTypes || !selected.subTypes.length) this.insert();
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
findBesluitTypeParent(besluitType, array = this.types, parent = null) {
|
|
133
|
+
if (!besluitType || !array) {
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
for (let i = 0; i < array.length; i++) {
|
|
137
|
+
if (array[i] == besluitType) {
|
|
138
|
+
return parent;
|
|
139
|
+
} else if (array[i].subTypes && array[i].subTypes.length) {
|
|
140
|
+
parent = array[i];
|
|
141
|
+
return this.findBesluitTypeParent(
|
|
142
|
+
besluitType,
|
|
143
|
+
array[i].subTypes,
|
|
144
|
+
parent
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
return null;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
findBesluitTypeByURI(uri, types = this.types) {
|
|
152
|
+
if (uri) {
|
|
153
|
+
for (const besluitType of types) {
|
|
154
|
+
if (besluitType.uri === uri) {
|
|
155
|
+
return besluitType;
|
|
156
|
+
} else if (besluitType.subTypes && besluitType.subTypes.length) {
|
|
157
|
+
const subType = this.findBesluitTypeByURI(uri, besluitType.subTypes);
|
|
158
|
+
if (subType) {
|
|
159
|
+
return subType;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return null;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
insert() {
|
|
168
|
+
this.cardExpanded = false;
|
|
169
|
+
if (this.previousBesluitType) {
|
|
170
|
+
this.besluitNode = this.args.controller.executeCommand(
|
|
171
|
+
'remove-type',
|
|
172
|
+
this.previousBesluitType,
|
|
173
|
+
this.besluitNode
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
this.args.controller.executeCommand(
|
|
178
|
+
'add-type',
|
|
179
|
+
this.besluitType.uri,
|
|
180
|
+
this.besluitNode
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
@action
|
|
185
|
+
toggleCard() {
|
|
186
|
+
this.cardExpanded = !this.cardExpanded;
|
|
187
|
+
}
|
|
188
|
+
}
|