@lblod/ember-rdfa-editor-lblod-plugins 0.4.1 → 1.0.0-alpha.1
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/CHANGELOG.md +25 -0
- package/addon/commands/article-structure-plugin/delete-structure.ts +85 -0
- package/addon/commands/article-structure-plugin/index.ts +4 -0
- package/addon/commands/article-structure-plugin/insert-article-structure.ts +137 -0
- package/addon/commands/article-structure-plugin/move-structure.ts +227 -0
- package/addon/commands/article-structure-plugin/recalculate-structure-numbers.ts +88 -0
- package/addon/commands/besluit-plugin/get-article-nodes-for-besluit.ts +30 -0
- package/addon/commands/besluit-plugin/index.ts +4 -0
- package/addon/commands/besluit-plugin/insert-article.ts +94 -0
- package/addon/commands/besluit-plugin/insert-title.ts +67 -0
- package/addon/commands/besluit-plugin/move-article.ts +69 -0
- package/addon/commands/besluit-plugin/recalculate-article-numbers.ts +44 -0
- package/addon/commands/modify-date-command.ts +48 -0
- package/addon/components/article-structure-plugin/article-structure-card.hbs +14 -0
- package/addon/components/article-structure-plugin/article-structure-card.ts +83 -0
- package/addon/components/article-structure-plugin/structure-card.hbs +42 -0
- package/addon/components/article-structure-plugin/structure-card.ts +140 -0
- package/addon/components/au-native-input.hbs +30 -0
- package/addon/components/au-native-input.ts +47 -0
- package/addon/components/besluit-plugin/besluit-context-card.hbs +44 -0
- package/addon/components/besluit-plugin/besluit-context-card.ts +144 -0
- package/addon/components/besluit-plugin/besluit-plugin-card.hbs +20 -0
- package/addon/components/besluit-plugin/besluit-plugin-card.ts +42 -0
- package/addon/components/besluit-type-plugin/{besluit-type-select.js → besluit-type-select.ts} +9 -4
- package/addon/components/besluit-type-plugin/toolbar-dropdown.hbs +2 -0
- package/addon/components/besluit-type-plugin/toolbar-dropdown.ts +216 -0
- package/addon/components/citation-plugin/citation-card.hbs +118 -0
- package/addon/components/citation-plugin/citation-card.ts +230 -0
- package/addon/components/citation-plugin/citation-insert.hbs +20 -0
- package/addon/components/citation-plugin/citation-insert.ts +102 -0
- package/addon/components/{citaten-plugin → citation-plugin}/citations/article-list.hbs +2 -2
- package/addon/components/{citaten-plugin → citation-plugin}/citations/article-preview.hbs +0 -0
- package/addon/components/{citaten-plugin → citation-plugin}/citations/decision-detail.hbs +9 -6
- package/addon/components/{citaten-plugin/citations/decision-detail.js → citation-plugin/citations/decision-detail.ts} +30 -31
- package/addon/components/{citaten-plugin → citation-plugin}/citations/decision-list.hbs +2 -2
- package/addon/components/{citaten-plugin → citation-plugin}/citations/decision-preview.hbs +0 -0
- package/addon/components/citation-plugin/citations/search-modal.hbs +254 -0
- package/addon/components/{citaten-plugin/citations/search-modal.js → citation-plugin/citations/search-modal.ts} +116 -89
- package/addon/components/{citaten-plugin → citation-plugin}/helpers/alert-load-error.hbs +0 -0
- package/addon/components/{citaten-plugin → citation-plugin}/helpers/alert-no-items.hbs +0 -0
- package/addon/components/import-snippet-plugin/card.ts +119 -0
- package/addon/components/insert-variable-plugin/insert-variable-card.hbs +2 -1
- package/addon/components/insert-variable-plugin/insert-variable-card.ts +134 -0
- package/addon/components/rdfa-date-plugin/{rdfa-date-plugin-card.hbs → card.hbs} +3 -1
- package/addon/components/rdfa-date-plugin/card.ts +72 -0
- package/addon/components/rdfa-date-plugin/{rdfa-date-time-picker.hbs → date-time-picker.hbs} +0 -0
- package/addon/components/rdfa-date-plugin/{rdfa-date-time-picker.js → date-time-picker.ts} +26 -12
- package/addon/components/rdfa-date-plugin/{rdfa-date-plugin-insert.hbs → insert.hbs} +0 -0
- package/addon/components/rdfa-date-plugin/insert.ts +44 -0
- package/addon/components/roadsign-regulation-plugin/expanded-measure.ts +58 -0
- package/addon/components/roadsign-regulation-plugin/measure-template.ts +35 -0
- package/addon/components/roadsign-regulation-plugin/roadsign-regulation-card.hbs +2 -2
- package/addon/components/roadsign-regulation-plugin/roadsign-regulation-card.ts +60 -0
- package/addon/components/roadsign-regulation-plugin/{roadsigns-modal.js → roadsigns-modal.ts} +101 -64
- package/addon/components/roadsign-regulation-plugin/{roadsigns-pagination.js → roadsigns-pagination.ts} +7 -3
- package/addon/components/roadsign-regulation-plugin/roadsigns-table.ts +32 -0
- package/addon/components/standard-template-plugin/{template-card.hbs → card.hbs} +0 -0
- package/addon/components/standard-template-plugin/card.ts +11 -0
- package/addon/components/standard-template-plugin/template-provider.hbs +3 -1
- package/addon/components/standard-template-plugin/template-provider.ts +75 -0
- package/addon/components/table-of-contents-plugin/card.hbs +12 -1
- package/addon/components/table-of-contents-plugin/card.ts +60 -0
- package/addon/components/table-of-contents-plugin/{inline-components → ember-nodes}/outline.hbs +2 -2
- package/addon/components/table-of-contents-plugin/ember-nodes/table-of-contents.hbs +9 -0
- package/addon/components/table-of-contents-plugin/ember-nodes/table-of-contents.ts +95 -0
- package/addon/components/template-variable-plugin/template-variable-card.hbs +2 -1
- package/addon/components/template-variable-plugin/template-variable-card.ts +227 -0
- package/addon/{constants.js → constants.ts} +15 -3
- package/addon/ember-nodes/table-of-contents.ts +53 -0
- package/addon/helpers/{limit-text.js → limit-text.ts} +2 -2
- package/addon/initializers/plugin-initializer.js +0 -75
- package/addon/models/instruction.ts +18 -0
- package/addon/models/measure.ts +38 -0
- package/addon/models/sign.ts +36 -0
- package/addon/models/template.ts +14 -0
- package/addon/plugins/article-structure-plugin.ts +55 -0
- package/addon/plugins/besluit-plugin.ts +27 -0
- package/addon/plugins/besluit-type-plugin.ts +6 -0
- package/addon/plugins/citation-plugin/index.ts +216 -0
- package/addon/plugins/citation-plugin/marks/citation.ts +27 -0
- package/addon/plugins/citation-plugin/utils/cited-text.ts +17 -0
- package/addon/plugins/citation-plugin/utils/process-match.ts +135 -0
- package/addon/{utils/vlaamse-codex.js → plugins/citation-plugin/utils/vlaamse-codex.ts} +161 -42
- package/addon/plugins/import-snippet-plugin.ts +6 -0
- package/addon/plugins/insert-variable-plugin.ts +11 -0
- package/addon/plugins/rdfa-date-plugin.ts +11 -0
- package/addon/plugins/roadsign-regulation-plugin.ts +6 -0
- package/addon/plugins/standard-template-plugin.ts +6 -0
- package/addon/plugins/table-of-contents-plugin.ts +14 -0
- package/addon/plugins/template-variable-plugin.ts +6 -0
- package/addon/services/{import-rdfa-snippet.js → import-rdfa-snippet.ts} +48 -36
- package/addon/services/roadsign-registry.ts +288 -0
- package/addon/services/{standard-template-plugin.js → standard-template-plugin.ts} +17 -11
- package/addon/utils/article-structure-plugin/constants.ts +260 -0
- package/addon/utils/article-structure-plugin/defaults.ts +3 -0
- package/addon/utils/article-structure-plugin/options-with-defaults.ts +31 -0
- package/addon/utils/article-structure-plugin/validate-datastore.ts +23 -0
- package/addon/utils/besluit-plugin/get-title-for-decision.ts +35 -0
- package/addon/utils/{fetchBesluitTypes.js → fetchBesluitTypes.ts} +36 -16
- package/addon/utils/generate-template-plugin/{default-resources.js → default-resources.ts} +0 -0
- package/addon/utils/{instantiate-uuids.js → instantiate-uuids.ts} +9 -6
- package/addon/utils/{legislation-types.js → legislation-types.ts} +17 -3
- package/addon/utils/{memoize.js → memoize.ts} +4 -2
- package/addon/utils/option.ts +58 -0
- package/addon/utils/roadsign-regulation-plugin/{fetchData.js → fetchData.ts} +19 -2
- package/addon/utils/roadsign-regulation-plugin/includeInstructions.ts +16 -0
- package/addon/utils/romanize.ts +47 -0
- package/addon/utils/variable-plugins/{default-variable-types.js → default-variable-types.ts} +18 -7
- package/addon/utils/variable-plugins/{fetch-data.js → fetch-data.ts} +43 -15
- package/app/components/article-structure-plugin/article-structure-card.js +1 -0
- package/app/components/article-structure-plugin/structure-card.js +1 -0
- package/app/components/{citaten-plugin/citaat-card.js → au-native-input.js} +1 -1
- package/app/components/{citaten-plugin/citations/article-list.js → besluit-plugin/besluit-context-card.js} +1 -1
- package/app/components/besluit-plugin/besluit-plugin-card.js +1 -0
- package/app/components/{citaten-plugin/citations/modal.js → citation-plugin/citation-card.js} +1 -1
- package/app/components/citation-plugin/citation-insert.js +1 -0
- package/app/components/{citaten-plugin/citations/decision-list.js → citation-plugin/citations/article-list.js} +1 -1
- package/app/components/{citaten-plugin → citation-plugin}/citations/article-preview.js +1 -1
- package/app/components/{citaten-plugin → citation-plugin}/citations/decision-detail.js +1 -1
- package/app/components/citation-plugin/citations/decision-list.js +1 -0
- package/app/components/{citaten-plugin → citation-plugin}/citations/decision-preview.js +1 -1
- package/app/components/citation-plugin/citations/modal.js +1 -0
- package/app/components/{citaten-plugin → citation-plugin}/citations/search-modal.js +1 -1
- package/app/components/{citaten-plugin → citation-plugin}/helpers/alert-load-error.js +1 -1
- package/app/components/{citaten-plugin → citation-plugin}/helpers/alert-no-items.js +1 -1
- package/app/components/{citaten-plugin/citaat-insert.js → rdfa-date-plugin/card.js} +1 -1
- package/app/components/rdfa-date-plugin/date-time-picker.js +1 -0
- package/app/components/rdfa-date-plugin/insert.js +1 -0
- package/app/components/standard-template-plugin/card.js +1 -0
- package/app/components/table-of-contents-plugin/ember-nodes/outline.js +1 -0
- package/app/components/table-of-contents-plugin/ember-nodes/table-of-contents.js +1 -0
- package/app/styles/citaten-plugin.scss +1 -1
- package/commands/article-structure-plugin/delete-structure.d.ts +4 -0
- package/commands/article-structure-plugin/index.d.ts +4 -0
- package/commands/article-structure-plugin/insert-article-structure.d.ts +6 -0
- package/commands/article-structure-plugin/move-structure.d.ts +5 -0
- package/commands/article-structure-plugin/recalculate-structure-numbers.d.ts +7 -0
- package/commands/besluit-plugin/get-article-nodes-for-besluit.d.ts +5 -0
- package/commands/besluit-plugin/index.d.ts +4 -0
- package/commands/besluit-plugin/insert-article.d.ts +3 -0
- package/commands/besluit-plugin/insert-title.d.ts +2 -0
- package/commands/besluit-plugin/move-article.d.ts +2 -0
- package/commands/besluit-plugin/recalculate-article-numbers.d.ts +2 -0
- package/commands/modify-date-command.d.ts +2 -0
- package/components/article-structure-plugin/article-structure-card.d.ts +36 -0
- package/components/article-structure-plugin/structure-card.d.ts +23 -0
- package/components/au-native-input.d.ts +20 -0
- package/components/besluit-plugin/besluit-context-card.d.ts +29 -0
- package/components/besluit-plugin/besluit-plugin-card.d.ts +14 -0
- package/components/besluit-type-plugin/besluit-type-select.d.ts +11 -0
- package/components/besluit-type-plugin/toolbar-dropdown.d.ts +46 -0
- package/components/citation-plugin/citation-card.d.ts +51 -0
- package/components/citation-plugin/citation-insert.d.ts +24 -0
- package/components/citation-plugin/citations/decision-detail.d.ts +26 -0
- package/components/citation-plugin/citations/search-modal.d.ts +67 -0
- package/components/import-snippet-plugin/card.d.ts +19 -0
- package/components/insert-variable-plugin/insert-variable-card.d.ts +31 -0
- package/components/rdfa-date-plugin/card.d.ts +20 -0
- package/components/rdfa-date-plugin/date-time-picker.d.ts +32 -0
- package/components/rdfa-date-plugin/insert.d.ts +12 -0
- package/components/roadsign-regulation-plugin/expanded-measure.d.ts +20 -0
- package/components/roadsign-regulation-plugin/measure-template.d.ts +14 -0
- package/components/roadsign-regulation-plugin/roadsign-regulation-card.d.ts +12 -0
- package/components/roadsign-regulation-plugin/roadsigns-modal.d.ts +57 -0
- package/components/roadsign-regulation-plugin/roadsigns-pagination.d.ts +19 -0
- package/components/roadsign-regulation-plugin/roadsigns-table.d.ts +9 -0
- package/components/standard-template-plugin/card.d.ts +9 -0
- package/components/standard-template-plugin/template-provider.d.ts +17 -0
- package/components/table-of-contents-plugin/card.d.ts +20 -0
- package/components/table-of-contents-plugin/ember-nodes/table-of-contents.d.ts +22 -0
- package/components/template-variable-plugin/template-variable-card.d.ts +27 -0
- package/constants.d.ts +11 -0
- package/ember-nodes/table-of-contents.d.ts +4 -0
- package/helpers/limit-text.d.ts +8 -0
- package/index.js +5 -0
- package/models/instruction.d.ts +8 -0
- package/models/measure.d.ts +14 -0
- package/models/sign.d.ts +12 -0
- package/models/template.d.ts +13 -0
- package/package.json +27 -8
- package/plugins/article-structure-plugin.d.ts +29 -0
- package/plugins/besluit-plugin.d.ts +9 -0
- package/plugins/besluit-type-plugin.d.ts +2 -0
- package/plugins/citation-plugin/index.d.ts +31 -0
- package/plugins/citation-plugin/marks/citation.d.ts +2 -0
- package/plugins/citation-plugin/utils/cited-text.d.ts +3 -0
- package/plugins/citation-plugin/utils/process-match.d.ts +23 -0
- package/plugins/citation-plugin/utils/vlaamse-codex.d.ts +56 -0
- package/plugins/import-snippet-plugin.d.ts +2 -0
- package/plugins/insert-variable-plugin.d.ts +2 -0
- package/plugins/rdfa-date-plugin.d.ts +3 -0
- package/plugins/roadsign-regulation-plugin.d.ts +2 -0
- package/plugins/standard-template-plugin.d.ts +2 -0
- package/plugins/table-of-contents-plugin.d.ts +3 -0
- package/plugins/template-variable-plugin.d.ts +2 -0
- package/services/import-rdfa-snippet.d.ts +99 -0
- package/services/roadsign-registry.d.ts +42 -0
- package/services/standard-template-plugin.d.ts +21 -0
- package/translations/en-US.yaml +47 -1
- package/translations/nl-BE.yaml +49 -3
- package/tsconfig.json +34 -9
- package/types/config/environment.d.ts +22 -0
- package/types/ember-mu-transform-helpers/transforms/string-set.d.ts +14 -0
- package/types/lblod/frontend-gelinkt-notuleren/models/account.d.ts +10 -0
- package/types/lblod/frontend-gelinkt-notuleren/models/bestuurseenheid-classificatie-code.d.ts +10 -0
- package/types/lblod/frontend-gelinkt-notuleren/models/bestuurseenheid.d.ts +12 -0
- package/types/lblod/frontend-gelinkt-notuleren/models/gebruiker-model.d.ts +18 -0
- package/types/lblod/frontend-gelinkt-notuleren/services/current-session.d.ts +30 -0
- package/types/lblod/marawa/dom-helpers.d.ts +4 -0
- package/types/lblod/marawa/ember-object-mock.d.ts +3 -0
- package/types/lblod/marawa/node-walker.d.ts +18 -0
- package/types/lblod/marawa/range-helpers.d.ts +10 -0
- package/types/lblod/marawa/rdfa-attributes.d.ts +25 -0
- package/types/lblod/marawa/rdfa-block.d.ts +22 -0
- package/types/lblod/marawa/rdfa-context-scanner.d.ts +13 -0
- package/types/lblod/marawa/rdfa-helpers.d.ts +22 -0
- package/types/lblod/marawa/rich-node.d.ts +50 -0
- package/types/lblod/marawa/triple.d.ts +16 -0
- package/utils/article-structure-plugin/constants.d.ts +2 -0
- package/utils/article-structure-plugin/defaults.d.ts +4 -0
- package/utils/article-structure-plugin/options-with-defaults.d.ts +2 -0
- package/utils/article-structure-plugin/validate-datastore.d.ts +3 -0
- package/utils/besluit-plugin/get-title-for-decision.d.ts +10 -0
- package/utils/fetchBesluitTypes.d.ts +12 -0
- package/utils/generate-template-plugin/default-resources.d.ts +2 -0
- package/utils/instantiate-uuids.d.ts +1 -0
- package/utils/legislation-types.d.ts +24 -0
- package/utils/memoize.d.ts +1 -0
- package/utils/option.d.ts +14 -0
- package/utils/roadsign-regulation-plugin/fetchData.d.ts +8 -0
- package/utils/roadsign-regulation-plugin/includeInstructions.d.ts +2 -0
- package/utils/romanize.d.ts +2 -0
- package/utils/variable-plugins/default-variable-types.d.ts +7 -0
- package/utils/variable-plugins/fetch-data.d.ts +14 -0
- package/addon/commands/generate-template-command.js +0 -35
- package/addon/commands/insert-and-collapse.js +0 -32
- package/addon/commands/modify-date-command.js +0 -42
- package/addon/components/besluit-type-plugin/toolbar-dropdown.js +0 -188
- package/addon/components/citaten-plugin/citaat-card.hbs +0 -76
- package/addon/components/citaten-plugin/citaat-card.js +0 -286
- package/addon/components/citaten-plugin/citaat-insert.hbs +0 -20
- package/addon/components/citaten-plugin/citaat-insert.js +0 -68
- package/addon/components/citaten-plugin/citations/search-modal.hbs +0 -175
- package/addon/components/import-snippet-plugin/card.js +0 -95
- package/addon/components/insert-variable-plugin/insert-variable-card.js +0 -125
- package/addon/components/rdfa-date-plugin/rdfa-date-plugin-card.js +0 -71
- package/addon/components/rdfa-date-plugin/rdfa-date-plugin-insert.js +0 -24
- package/addon/components/roadsign-regulation-plugin/expanded-measure.js +0 -38
- package/addon/components/roadsign-regulation-plugin/measure-template.js +0 -30
- package/addon/components/roadsign-regulation-plugin/roadsign-regulation-card.js +0 -101
- package/addon/components/roadsign-regulation-plugin/roadsigns-table.js +0 -24
- package/addon/components/standard-template-plugin/template-card.js +0 -7
- package/addon/components/standard-template-plugin/template-provider.js +0 -75
- package/addon/components/table-of-contents-plugin/card.js +0 -53
- package/addon/components/table-of-contents-plugin/inline-components/table-of-contents.hbs +0 -9
- package/addon/components/table-of-contents-plugin/inline-components/table-of-contents.js +0 -100
- package/addon/components/template-variable-plugin/template-variable-card.js +0 -230
- package/addon/inline-components/table-of-contents.js +0 -43
- package/addon/models/instruction.js +0 -19
- package/addon/models/measure.js +0 -46
- package/addon/models/sign.js +0 -37
- package/addon/models/template.js +0 -9
- package/addon/plugins/besluit-type-plugin.js +0 -16
- package/addon/plugins/citaten-plugin.js +0 -22
- package/addon/plugins/import-snippet-plugin.js +0 -16
- package/addon/plugins/insert-variable-plugin.js +0 -19
- package/addon/plugins/rdfa-date-plugin.js +0 -26
- package/addon/plugins/roadsign-regulation-plugin.js +0 -24
- package/addon/plugins/standard-template-plugin.js +0 -33
- package/addon/plugins/table-of-contents-plugin.js +0 -27
- package/addon/plugins/template-variable-plugin.js +0 -21
- package/addon/services/roadsign-registry.js +0 -240
- package/addon/utils/processMatch.js +0 -80
- package/addon/utils/roadsign-regulation-plugin/includeInstructions.js +0 -10
- package/app/components/rdfa-date-plugin/rdfa-date-plugin-card.js +0 -1
- package/app/components/rdfa-date-plugin/rdfa-date-plugin-insert.js +0 -1
- package/app/components/rdfa-date-plugin/rdfa-date-time-picker.js +0 -1
- package/app/components/standard-template-plugin/template-card.js +0 -1
- package/app/components/table-of-contents-plugin/inline-components/outline.js +0 -1
- package/app/components/table-of-contents-plugin/inline-components/table-of-contents.js +0 -1
- package/app/initializers/plugin-initializer.js +0 -4
- package/types/dummy/index.d.ts +0 -1
- package/types/ember-data/types/registries/model.d.ts +0 -6
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
<AuModal
|
|
2
|
+
@modalOpen={{@open}}
|
|
3
|
+
@closeModal={{fn this.closeModal this.legislationTypeUri this.text}}
|
|
4
|
+
@title={{t 'citaten-plugin.card.title'}}
|
|
5
|
+
@size='large'
|
|
6
|
+
@padding='none'
|
|
7
|
+
as |modal|
|
|
8
|
+
>
|
|
9
|
+
{{#if this.selectedDecision}}
|
|
10
|
+
<modal.Body>
|
|
11
|
+
<CitationPlugin::Citations::DecisionDetail
|
|
12
|
+
@insertDecisionCitation={{this.insertDecisionCitation}}
|
|
13
|
+
@insertArticleCitation={{this.insertArticleCitation}}
|
|
14
|
+
@close={{this.closeDecisionDetail}}
|
|
15
|
+
@decision={{this.selectedDecision}}
|
|
16
|
+
/>
|
|
17
|
+
</modal.Body>
|
|
18
|
+
{{else}}
|
|
19
|
+
<modal.Body>
|
|
20
|
+
<AuMainContainer class='citaten--main-container' as |mc|>
|
|
21
|
+
<mc.sidebar class='citaten--sidebar' @scroll={{true}}>
|
|
22
|
+
<div class='au-c-sidebar'>
|
|
23
|
+
<div class='au-c-sidebar__content au-u-padding'>
|
|
24
|
+
<AuLabel
|
|
25
|
+
class='au-margin-bottom-small'
|
|
26
|
+
for='typeofdocumentexpanded'
|
|
27
|
+
@inline={{false}}
|
|
28
|
+
@required={{false}}
|
|
29
|
+
@error={{false}}
|
|
30
|
+
@warning={{false}}
|
|
31
|
+
>{{t 'citaten-plugin.search.type'}}</AuLabel>
|
|
32
|
+
<PowerSelect
|
|
33
|
+
id='typeofdocumentexpanded'
|
|
34
|
+
@renderInPlace={{true}}
|
|
35
|
+
@allowClear={{false}}
|
|
36
|
+
@disabled={{false}}
|
|
37
|
+
@searchEnabled={{true}}
|
|
38
|
+
@loadingMessage={{t 'citaten-plugin.alert.loading'}}
|
|
39
|
+
@noMatchesMessage={{t 'citaten-plugin.alert.no-results'}}
|
|
40
|
+
@searchMessage={{t 'citaten-plugin.search.placeholder'}}
|
|
41
|
+
@options={{this.legislationTypes}}
|
|
42
|
+
@selected={{this.legislationSelected}}
|
|
43
|
+
@onChange={{this.selectLegislationType}}
|
|
44
|
+
as |type|
|
|
45
|
+
>
|
|
46
|
+
{{type}}
|
|
47
|
+
</PowerSelect>
|
|
48
|
+
<AuLabel
|
|
49
|
+
class='au-u-margin-top au-margin-bottom-small'
|
|
50
|
+
for='searchtermexpanded'
|
|
51
|
+
@inline={{false}}
|
|
52
|
+
@required={{false}}
|
|
53
|
+
@error={{false}}
|
|
54
|
+
@warning={{false}}
|
|
55
|
+
>{{t 'citaten-plugin.search.term'}}</AuLabel>
|
|
56
|
+
<AuNativeInput
|
|
57
|
+
@icon='search'
|
|
58
|
+
@type='text'
|
|
59
|
+
@width='block'
|
|
60
|
+
@iconAlignment='right'
|
|
61
|
+
id='searchtermexpanded'
|
|
62
|
+
value={{this.searchText}}
|
|
63
|
+
placeholder={{t 'citaten-plugin.search.placeholder'}}
|
|
64
|
+
{{on 'input' this.setInputSearchText}}
|
|
65
|
+
/>
|
|
66
|
+
|
|
67
|
+
<AuHr @size='large' />
|
|
68
|
+
{{! Date of document }}
|
|
69
|
+
<AuLabel
|
|
70
|
+
class='au-u-margin-top au-u-margin-bottom-small'
|
|
71
|
+
for='search-codex-datum-document-van'
|
|
72
|
+
@inline={{false}}
|
|
73
|
+
>{{t 'citaten-plugin.search.date-document'}}</AuLabel>
|
|
74
|
+
{{! From }}
|
|
75
|
+
<AuFormRow @alignment='pre' class='au-u-margin-bottom-tiny'>
|
|
76
|
+
<AuLabel
|
|
77
|
+
for='search-codex-datum-document-van'
|
|
78
|
+
class='au-u-hidden-visually'
|
|
79
|
+
>{{t 'citaten-plugin.search.date-document-from'}}</AuLabel>
|
|
80
|
+
<AuLabel
|
|
81
|
+
for='search-codex-datum-document-van'
|
|
82
|
+
aria-hidden='true'
|
|
83
|
+
class='au-u-1-4'
|
|
84
|
+
@inline={{true}}
|
|
85
|
+
>{{t 'citaten-plugin.search.from'}}</AuLabel>
|
|
86
|
+
<AuDatePicker
|
|
87
|
+
@id='search-codex-datum-document-van'
|
|
88
|
+
@alignment='top'
|
|
89
|
+
@onChange={{this.updateDocumentDateFrom}}
|
|
90
|
+
@value={{this.documentDateFrom}}
|
|
91
|
+
@min={{this.minDate}}
|
|
92
|
+
@max={{this.maxDate}}
|
|
93
|
+
@localization={{this.datePickerLocalization}}
|
|
94
|
+
/>
|
|
95
|
+
</AuFormRow>
|
|
96
|
+
{{! To }}
|
|
97
|
+
<AuFormRow @alignment='pre'>
|
|
98
|
+
<AuLabel
|
|
99
|
+
for='search-codex-datum-document-tot'
|
|
100
|
+
class='au-u-hidden-visually'
|
|
101
|
+
>{{t 'citaten-plugin.search.date-document-to'}}</AuLabel>
|
|
102
|
+
<AuLabel
|
|
103
|
+
for='search-codex-datum-document-tot'
|
|
104
|
+
aria-hidden='true'
|
|
105
|
+
class='au-u-1-4'
|
|
106
|
+
@inline={{true}}
|
|
107
|
+
>{{t 'citaten-plugin.search.to'}}</AuLabel>
|
|
108
|
+
<AuDatePicker
|
|
109
|
+
@id='search-codex-datum-document-tot'
|
|
110
|
+
@alignment='top'
|
|
111
|
+
@onChange={{this.updateDocumentDateTo}}
|
|
112
|
+
@value={{this.documentDateTo}}
|
|
113
|
+
@min={{this.minDate}}
|
|
114
|
+
@max={{this.maxDate}}
|
|
115
|
+
@localization={{this.datePickerLocalization}}
|
|
116
|
+
/>
|
|
117
|
+
</AuFormRow>
|
|
118
|
+
|
|
119
|
+
{{! Date of staatsblad }}
|
|
120
|
+
<AuLabel
|
|
121
|
+
class='au-u-margin-top au-u-margin-bottom-small'
|
|
122
|
+
for='search-codex-datum-staatsblad-van'
|
|
123
|
+
@inline={{false}}
|
|
124
|
+
>{{t 'citaten-plugin.search.date-publication'}}</AuLabel>
|
|
125
|
+
{{! From }}
|
|
126
|
+
<AuFormRow @alignment='pre' class='au-u-margin-bottom-tiny'>
|
|
127
|
+
<AuLabel
|
|
128
|
+
for='search-codex-datum-staatsblad-van'
|
|
129
|
+
class='au-u-hidden-visually'
|
|
130
|
+
>{{t 'citaten-plugin.search.date-publication-from'}}</AuLabel>
|
|
131
|
+
<AuLabel
|
|
132
|
+
for='search-codex-datum-staatsblad-van'
|
|
133
|
+
aria-hidden='true'
|
|
134
|
+
class='au-u-1-4'
|
|
135
|
+
@inline={{true}}
|
|
136
|
+
>{{t 'citaten-plugin.search.from'}}</AuLabel>
|
|
137
|
+
<AuDatePicker
|
|
138
|
+
@id='search-codex-datum-staatsblad-van'
|
|
139
|
+
@alignment='top'
|
|
140
|
+
@onChange={{this.updatePublicationDateFrom}}
|
|
141
|
+
@value={{this.publicationDateFrom}}
|
|
142
|
+
@min={{this.minDate}}
|
|
143
|
+
@max={{this.maxDate}}
|
|
144
|
+
@localization={{this.datePickerLocalization}}
|
|
145
|
+
/>
|
|
146
|
+
</AuFormRow>
|
|
147
|
+
{{! To }}
|
|
148
|
+
<AuFormRow @alignment='pre'>
|
|
149
|
+
<AuLabel
|
|
150
|
+
for='search-codex-datum-staatsblad-tot'
|
|
151
|
+
class='au-u-hidden-visually'
|
|
152
|
+
>{{t 'citaten-plugin.search.date-publication-to'}}</AuLabel>
|
|
153
|
+
<AuLabel
|
|
154
|
+
for='search-codex-datum-staatsblad-tot'
|
|
155
|
+
aria-hidden='true'
|
|
156
|
+
class='au-u-1-4'
|
|
157
|
+
@inline={{true}}
|
|
158
|
+
>{{t 'citaten-plugin.search.to'}}</AuLabel>
|
|
159
|
+
<AuDatePicker
|
|
160
|
+
@id='search-codex-datum-staatsblad-tot'
|
|
161
|
+
@alignment='top'
|
|
162
|
+
@onChange={{this.updatePublicationDateTo}}
|
|
163
|
+
@value={{this.publicationDateTo}}
|
|
164
|
+
@min={{this.minDate}}
|
|
165
|
+
@max={{this.maxDate}}
|
|
166
|
+
@localization={{this.datePickerLocalization}}
|
|
167
|
+
/>
|
|
168
|
+
</AuFormRow>
|
|
169
|
+
</div>
|
|
170
|
+
</div>
|
|
171
|
+
</mc.sidebar>
|
|
172
|
+
<mc.content>
|
|
173
|
+
{{#if this.decisionResource.isRunning}}
|
|
174
|
+
<div class='au-u-margin'>
|
|
175
|
+
<AuLoader @padding='large' />
|
|
176
|
+
<span class='au-u-hidden-visually'>{{t
|
|
177
|
+
'citaten-plugin.alert.loading'
|
|
178
|
+
}}</span>
|
|
179
|
+
</div>
|
|
180
|
+
{{else}}
|
|
181
|
+
{{#if this.error}}
|
|
182
|
+
<CitationPlugin::Helpers::AlertLoadError
|
|
183
|
+
@fullSize={{true}}
|
|
184
|
+
@error={{this.error}}
|
|
185
|
+
class='au-u-margin'
|
|
186
|
+
/>
|
|
187
|
+
{{else}}
|
|
188
|
+
{{#if this.decisionResource.value.length}}
|
|
189
|
+
<div
|
|
190
|
+
class='citaten--container-content au-u-padding-top-small au-u-padding-bottom-small'
|
|
191
|
+
>
|
|
192
|
+
<CitationPlugin::Citations::DecisionList
|
|
193
|
+
@decisions={{this.decisionResource.value}}
|
|
194
|
+
@onCitationInsert={{this.insertDecisionCitation}}
|
|
195
|
+
@onCitationDetails={{this.openDecisionDetail}}
|
|
196
|
+
@fullSize={{true}}
|
|
197
|
+
/>
|
|
198
|
+
</div>
|
|
199
|
+
{{else}}
|
|
200
|
+
<CitationPlugin::Helpers::AlertNoItems
|
|
201
|
+
@fullSize={{true}}
|
|
202
|
+
class='au-u-margin'
|
|
203
|
+
/>
|
|
204
|
+
{{/if}}
|
|
205
|
+
{{/if}}
|
|
206
|
+
{{/if}}
|
|
207
|
+
{{#if this.decisionResource.value.length}}
|
|
208
|
+
{{! Pagination in the footer of the dialog }}
|
|
209
|
+
<div class='citaten--container-footer au-u-background-gray-100'>
|
|
210
|
+
<AuToolbar @border='top' @size='large' @nowrap={{true}}>
|
|
211
|
+
<div class='au-c-pagination'>
|
|
212
|
+
<p>
|
|
213
|
+
<span class='au-u-hidden-visually'>{{t
|
|
214
|
+
'citaten-plugin.search.results'
|
|
215
|
+
}}</span>
|
|
216
|
+
<strong>
|
|
217
|
+
{{this.rangeStart}}
|
|
218
|
+
-
|
|
219
|
+
{{this.rangeEnd}}
|
|
220
|
+
</strong>
|
|
221
|
+
{{t 'citaten-plugin.pagination.of'}}
|
|
222
|
+
{{this.totalCount}}
|
|
223
|
+
</p>
|
|
224
|
+
<div class='au-c-pagination__list-item'>
|
|
225
|
+
{{#unless this.isFirstPage}}
|
|
226
|
+
<AuButton
|
|
227
|
+
@skin='link'
|
|
228
|
+
@icon='nav-left'
|
|
229
|
+
@iconAlignment='left'
|
|
230
|
+
{{on 'click' this.previousPage}}
|
|
231
|
+
>
|
|
232
|
+
{{t 'citaten-plugin.pagination.previous'}}
|
|
233
|
+
</AuButton>
|
|
234
|
+
{{/unless}}
|
|
235
|
+
{{#unless this.isLastPage}}
|
|
236
|
+
<AuButton
|
|
237
|
+
@skin='link'
|
|
238
|
+
@icon='nav-right'
|
|
239
|
+
@iconAlignment='right'
|
|
240
|
+
{{on 'click' this.nextPage}}
|
|
241
|
+
>
|
|
242
|
+
{{t 'citaten-plugin.pagination.next'}}
|
|
243
|
+
</AuButton>
|
|
244
|
+
{{/unless}}
|
|
245
|
+
</div>
|
|
246
|
+
</div>
|
|
247
|
+
</AuToolbar>
|
|
248
|
+
</div>
|
|
249
|
+
{{/if}}
|
|
250
|
+
</mc.content>
|
|
251
|
+
</AuMainContainer>
|
|
252
|
+
</modal.Body>
|
|
253
|
+
{{/if}}
|
|
254
|
+
</AuModal>
|
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
import { tracked } from '@glimmer/tracking';
|
|
3
3
|
import { action } from '@ember/object';
|
|
4
|
-
import {
|
|
4
|
+
import { restartableTask, timeout } from 'ember-concurrency';
|
|
5
5
|
import { inject as service } from '@ember/service';
|
|
6
6
|
import { capitalize } from '@ember/string';
|
|
7
7
|
import { task as trackedTask } from 'ember-resources/util/ember-concurrency';
|
|
8
8
|
import {
|
|
9
|
-
LEGISLATION_TYPES,
|
|
10
9
|
LEGISLATION_TYPE_CONCEPTS,
|
|
10
|
+
LEGISLATION_TYPES,
|
|
11
11
|
} from '../../../utils/legislation-types';
|
|
12
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
Article,
|
|
14
|
+
Decision,
|
|
15
|
+
fetchDecisions,
|
|
16
|
+
} from '../../../plugins/citation-plugin/utils/vlaamse-codex';
|
|
17
|
+
import IntlService from 'ember-intl/services/intl';
|
|
18
|
+
import {
|
|
19
|
+
Option,
|
|
20
|
+
unwrap,
|
|
21
|
+
} from '@lblod/ember-rdfa-editor-lblod-plugins/utils/option';
|
|
13
22
|
|
|
14
|
-
function getISODate(date) {
|
|
23
|
+
function getISODate(date: Option<Date>): string | null {
|
|
15
24
|
if (date) {
|
|
16
25
|
// Flatpickr captures the date in local time. Hence date.toISOString() may return the day before the selected date
|
|
17
26
|
// E.g. selected date 2020-04-15 00:00:00 GMT+0200 will become 2020-04-14 22:00:00 UTC
|
|
@@ -24,27 +33,42 @@ function getISODate(date) {
|
|
|
24
33
|
}
|
|
25
34
|
}
|
|
26
35
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
36
|
+
interface Args {
|
|
37
|
+
selectedDecision: Decision;
|
|
38
|
+
legislationTypeUri: string;
|
|
39
|
+
text: string;
|
|
40
|
+
insertDecisionCitation: (decision: Decision) => void;
|
|
41
|
+
insertArticleCitation: (decision: Decision, article: Article) => void;
|
|
42
|
+
closeModal: (legislationTypeUri?: string, text?: string) => void;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export default class EditorPluginsCitationsSearchModalComponent extends Component<Args> {
|
|
46
|
+
@service declare intl: IntlService;
|
|
31
47
|
// Vlaamse Codex currently doesn't contain captions and content of decisions
|
|
32
48
|
// @tracked isEnabledSearchCaption = false
|
|
33
49
|
// @tracked isEnabledSearchContent = false
|
|
34
|
-
@tracked legislationTypeUri;
|
|
50
|
+
@tracked legislationTypeUri: string;
|
|
35
51
|
@tracked pageNumber = 0;
|
|
36
52
|
@tracked pageSize = 5;
|
|
37
|
-
@tracked totalCount;
|
|
53
|
+
@tracked totalCount = 0;
|
|
38
54
|
@tracked decisions = [];
|
|
39
|
-
@tracked error;
|
|
40
|
-
@tracked selectedDecision;
|
|
41
|
-
@tracked documentDateFrom = null;
|
|
42
|
-
@tracked documentDateTo = null;
|
|
43
|
-
@tracked publicationDateFrom = null;
|
|
44
|
-
@tracked publicationDateTo = null;
|
|
55
|
+
@tracked error: unknown;
|
|
56
|
+
@tracked selectedDecision: Decision | null;
|
|
57
|
+
@tracked documentDateFrom: Date | null = null;
|
|
58
|
+
@tracked documentDateTo: Date | null = null;
|
|
59
|
+
@tracked publicationDateFrom: Date | null = null;
|
|
60
|
+
@tracked publicationDateTo: Date | null = null;
|
|
61
|
+
@tracked inputSearchText: string | null = null;
|
|
45
62
|
minDate = new Date('1930-01-01T12:00:00');
|
|
46
63
|
maxDate = new Date(`${new Date().getFullYear() + 10}-01-01T12:00:00`);
|
|
47
64
|
|
|
65
|
+
constructor(owner: unknown, args: Args) {
|
|
66
|
+
super(owner, args);
|
|
67
|
+
this.selectedDecision = this.args.selectedDecision;
|
|
68
|
+
this.legislationTypeUri =
|
|
69
|
+
this.args.legislationTypeUri || LEGISLATION_TYPES['decreet'];
|
|
70
|
+
}
|
|
71
|
+
|
|
48
72
|
get datePickerLocalization() {
|
|
49
73
|
return {
|
|
50
74
|
buttonLabel: this.intl.t('auDatePicker.buttonLabel'),
|
|
@@ -62,14 +86,6 @@ export default class EditorPluginsCitationsSearchModalComponent extends Componen
|
|
|
62
86
|
};
|
|
63
87
|
}
|
|
64
88
|
|
|
65
|
-
constructor() {
|
|
66
|
-
super(...arguments);
|
|
67
|
-
this.selectedDecision = this.args.selectedDecision;
|
|
68
|
-
this.legislationTypeUri =
|
|
69
|
-
this.args.legislationTypeUri || LEGISLATION_TYPES['decreet'];
|
|
70
|
-
this.text = this.args.text;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
89
|
get legislationTypes() {
|
|
74
90
|
return Object.keys(LEGISLATION_TYPES).map(capitalize);
|
|
75
91
|
}
|
|
@@ -78,31 +94,44 @@ export default class EditorPluginsCitationsSearchModalComponent extends Componen
|
|
|
78
94
|
const found = LEGISLATION_TYPE_CONCEPTS.find(
|
|
79
95
|
(c) => c.value === this.legislationTypeUri
|
|
80
96
|
);
|
|
81
|
-
return capitalize(
|
|
97
|
+
return capitalize(
|
|
98
|
+
found ? found.label : unwrap(LEGISLATION_TYPE_CONCEPTS[0]).label
|
|
99
|
+
);
|
|
82
100
|
}
|
|
83
101
|
|
|
84
|
-
|
|
85
|
-
this.
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
this.
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
102
|
+
get text() {
|
|
103
|
+
return this.args.text;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
get searchText() {
|
|
107
|
+
return this.inputSearchText ?? this.text;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
get rangeStart() {
|
|
111
|
+
return this.pageNumber * this.pageSize + 1;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
get rangeEnd() {
|
|
115
|
+
const end = this.rangeStart + this.pageSize - 1;
|
|
116
|
+
return end > this.totalCount ? this.totalCount : end;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
get isFirstPage() {
|
|
120
|
+
return this.pageNumber == 0;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
get isLastPage() {
|
|
124
|
+
return this.rangeEnd == this.totalCount;
|
|
125
|
+
}
|
|
94
126
|
|
|
95
|
-
|
|
96
|
-
|
|
127
|
+
resourceSearch = restartableTask(async () => {
|
|
128
|
+
await timeout(500);
|
|
97
129
|
this.error = null;
|
|
98
|
-
yield undefined; //To prevent retriggering because of the use of this.text later.
|
|
99
130
|
const abortController = new AbortController();
|
|
100
|
-
const signal = abortController.signal;
|
|
101
131
|
try {
|
|
102
132
|
// Split search string by grouping on non-whitespace characters
|
|
103
133
|
// This probably needs to be more complex to search on group of words
|
|
104
|
-
const words =
|
|
105
|
-
(this.textAfterTimeout || this.text || '').match(/\S+/g) || [];
|
|
134
|
+
const words = this.searchText.match(/\S+/g) || [];
|
|
106
135
|
const filter = {
|
|
107
136
|
type: this.legislationTypeUri,
|
|
108
137
|
documentDateFrom: getISODate(this.documentDateFrom),
|
|
@@ -110,12 +139,11 @@ export default class EditorPluginsCitationsSearchModalComponent extends Componen
|
|
|
110
139
|
publicationDateFrom: getISODate(this.publicationDateFrom),
|
|
111
140
|
publicationDateTo: getISODate(this.publicationDateTo),
|
|
112
141
|
};
|
|
113
|
-
const results =
|
|
142
|
+
const results = await fetchDecisions(
|
|
114
143
|
words,
|
|
115
144
|
filter,
|
|
116
145
|
this.pageNumber,
|
|
117
|
-
this.pageSize
|
|
118
|
-
signal
|
|
146
|
+
this.pageSize
|
|
119
147
|
);
|
|
120
148
|
this.totalCount = results.totalCount;
|
|
121
149
|
return results.decisions;
|
|
@@ -128,72 +156,82 @@ export default class EditorPluginsCitationsSearchModalComponent extends Componen
|
|
|
128
156
|
//Abort all requests now that this task has either successfully finished or has been cancelled
|
|
129
157
|
abortController.abort();
|
|
130
158
|
}
|
|
131
|
-
}
|
|
159
|
+
});
|
|
132
160
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
this.
|
|
137
|
-
this.pageNumber
|
|
161
|
+
decisionResource = trackedTask(this, this.resourceSearch, () => [
|
|
162
|
+
this.searchText,
|
|
163
|
+
this.legislationTypeUri,
|
|
164
|
+
this.pageSize,
|
|
165
|
+
this.pageNumber,
|
|
166
|
+
this.documentDateFrom,
|
|
167
|
+
this.documentDateTo,
|
|
168
|
+
this.publicationDateFrom,
|
|
169
|
+
this.publicationDateTo,
|
|
170
|
+
]);
|
|
171
|
+
|
|
172
|
+
@action
|
|
173
|
+
setInputSearchText(event: InputEvent) {
|
|
174
|
+
this.inputSearchText = (event.target as HTMLInputElement).value;
|
|
138
175
|
}
|
|
139
176
|
|
|
140
177
|
@action
|
|
141
|
-
selectLegislationType(type) {
|
|
178
|
+
selectLegislationType(type: string) {
|
|
142
179
|
type = type.toLowerCase();
|
|
143
180
|
const found = LEGISLATION_TYPE_CONCEPTS.find(
|
|
144
181
|
(c) => c.label.toLowerCase() === type
|
|
145
182
|
);
|
|
146
183
|
this.legislationTypeUri = found
|
|
147
184
|
? found.value
|
|
148
|
-
: LEGISLATION_TYPE_CONCEPTS[0].value;
|
|
185
|
+
: unwrap(LEGISLATION_TYPE_CONCEPTS[0]).value;
|
|
149
186
|
}
|
|
150
187
|
|
|
151
188
|
@action
|
|
152
|
-
updateDocumentDateFrom(
|
|
189
|
+
updateDocumentDateFrom(_isoDate: unknown, date: Date) {
|
|
153
190
|
this.documentDateFrom = date;
|
|
154
191
|
}
|
|
155
192
|
|
|
156
193
|
@action
|
|
157
|
-
updateDocumentDateTo(
|
|
194
|
+
updateDocumentDateTo(_isoDate: unknown, date: Date) {
|
|
158
195
|
this.documentDateTo = date;
|
|
159
196
|
}
|
|
160
197
|
|
|
161
198
|
@action
|
|
162
|
-
updatePublicationDateFrom(
|
|
199
|
+
updatePublicationDateFrom(_isoDate: unknown, date: Date) {
|
|
163
200
|
this.publicationDateFrom = date;
|
|
164
201
|
}
|
|
165
202
|
|
|
166
203
|
@action
|
|
167
|
-
updatePublicationDateTo(
|
|
204
|
+
updatePublicationDateTo(_isoDate: unknown, date: Date) {
|
|
168
205
|
this.publicationDateTo = date;
|
|
169
206
|
}
|
|
170
207
|
|
|
171
208
|
@action
|
|
172
|
-
insertDecisionCitation(decision) {
|
|
209
|
+
async insertDecisionCitation(decision: Decision) {
|
|
173
210
|
this.args.insertDecisionCitation(decision);
|
|
174
|
-
this.closeModal();
|
|
211
|
+
await this.closeModal();
|
|
175
212
|
}
|
|
176
213
|
|
|
177
214
|
@action
|
|
178
|
-
insertArticleCitation(decision, article) {
|
|
215
|
+
async insertArticleCitation(decision: Decision, article: Article) {
|
|
179
216
|
this.args.insertArticleCitation(decision, article);
|
|
180
|
-
this.closeModal();
|
|
217
|
+
await this.closeModal();
|
|
181
218
|
}
|
|
182
219
|
|
|
183
220
|
@action
|
|
184
|
-
closeModal(legislationTypeUri, text) {
|
|
185
|
-
this.decisionResource.cancel();
|
|
221
|
+
async closeModal(legislationTypeUri?: string, text?: string) {
|
|
222
|
+
await this.decisionResource.cancel();
|
|
223
|
+
this.inputSearchText = null;
|
|
186
224
|
this.args.closeModal(legislationTypeUri, text);
|
|
187
225
|
}
|
|
188
226
|
|
|
189
227
|
@action
|
|
190
|
-
|
|
191
|
-
this.selectedDecision =
|
|
228
|
+
openDecisionDetail(decision: Decision) {
|
|
229
|
+
this.selectedDecision = decision;
|
|
192
230
|
}
|
|
193
231
|
|
|
194
232
|
@action
|
|
195
|
-
|
|
196
|
-
this.selectedDecision =
|
|
233
|
+
closeDecisionDetail() {
|
|
234
|
+
this.selectedDecision = null;
|
|
197
235
|
}
|
|
198
236
|
|
|
199
237
|
// Pagination
|
|
@@ -207,37 +245,26 @@ export default class EditorPluginsCitationsSearchModalComponent extends Componen
|
|
|
207
245
|
nextPage() {
|
|
208
246
|
++this.pageNumber;
|
|
209
247
|
}
|
|
210
|
-
|
|
211
|
-
get rangeStart() {
|
|
212
|
-
return this.pageNumber * this.pageSize + 1;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
get rangeEnd() {
|
|
216
|
-
const end = this.rangeStart + this.pageSize - 1;
|
|
217
|
-
return end > this.totalCount ? this.totalCount : end;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
get isFirstPage() {
|
|
221
|
-
return this.pageNumber == 0;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
get isLastPage() {
|
|
225
|
-
return this.rangeEnd == this.totalCount;
|
|
226
|
-
}
|
|
227
248
|
}
|
|
228
249
|
|
|
229
|
-
function getLocalizedMonths(
|
|
230
|
-
|
|
250
|
+
function getLocalizedMonths(
|
|
251
|
+
intl: IntlService,
|
|
252
|
+
monthFormat: Intl.DateTimeFormatOptions['month'] = 'long'
|
|
253
|
+
) {
|
|
254
|
+
const someYear = 2021;
|
|
231
255
|
return [...Array(12).keys()].map((monthIndex) => {
|
|
232
|
-
|
|
256
|
+
const date = new Date(someYear, monthIndex);
|
|
233
257
|
return intl.formatDate(date, { month: monthFormat });
|
|
234
258
|
});
|
|
235
259
|
}
|
|
236
260
|
|
|
237
|
-
function getLocalizedDays(
|
|
238
|
-
|
|
261
|
+
function getLocalizedDays(
|
|
262
|
+
intl: IntlService,
|
|
263
|
+
weekdayFormat: Intl.DateTimeFormatOptions['weekday'] = 'long'
|
|
264
|
+
) {
|
|
265
|
+
const someSunday = new Date('2021-01-03');
|
|
239
266
|
return [...Array(7).keys()].map((index) => {
|
|
240
|
-
|
|
267
|
+
const weekday = new Date(someSunday.getTime());
|
|
241
268
|
weekday.setDate(someSunday.getDate() + index);
|
|
242
269
|
return intl.formatDate(weekday, { weekday: weekdayFormat });
|
|
243
270
|
});
|
|
File without changes
|
|
File without changes
|