@lblod/ember-rdfa-editor-lblod-plugins 13.0.0 → 14.1.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/CHANGELOG.md +43 -0
- package/README.md +1 -1
- package/addon/components/besluit-type-plugin/toolbar-dropdown.ts +1 -8
- package/addon/components/citation-plugin/citation-card.hbs +7 -7
- package/addon/components/citation-plugin/citation-card.ts +21 -16
- package/addon/components/citation-plugin/citation-insert.hbs +1 -1
- package/addon/components/citation-plugin/citation-insert.ts +8 -8
- package/addon/components/citation-plugin/citations/article-preview.hbs +1 -1
- package/addon/components/citation-plugin/citations/article-preview.ts +13 -0
- package/addon/components/citation-plugin/citations/{decision-detail.hbs → legal-document-detail.hbs} +6 -6
- package/addon/components/citation-plugin/citations/{decision-detail.ts → legal-document-detail.ts} +6 -3
- package/addon/components/citation-plugin/citations/{decision-list.hbs → legal-document-list.hbs} +6 -6
- package/addon/components/citation-plugin/citations/{decision-preview.hbs → legal-document-preview.hbs} +5 -5
- package/addon/components/citation-plugin/citations/{decision-preview.ts → legal-document-preview.ts} +4 -4
- package/addon/components/citation-plugin/citations/search-modal.hbs +12 -12
- package/addon/components/citation-plugin/citations/search-modal.ts +22 -19
- package/addon/components/standard-template-plugin/card.hbs +1 -1
- package/addon/components/standard-template-plugin/card.ts +5 -0
- package/addon/components/standard-template-plugin/template-provider.hbs +1 -2
- package/addon/components/standard-template-plugin/template-provider.ts +6 -14
- package/addon/components/variable-plugin/address/edit.hbs +13 -11
- package/addon/components/variable-plugin/address/edit.ts +88 -22
- package/addon/components/variable-plugin/date/edit.hbs +12 -10
- package/addon/components/variable-plugin/date/edit.ts +7 -0
- package/addon/models/template.ts +6 -13
- package/addon/plugins/besluit-type-plugin/index.ts +1 -0
- package/addon/plugins/citation-plugin/index.ts +1 -1
- package/addon/plugins/citation-plugin/utils/legal-documents.ts +3 -3
- package/addon/plugins/citation-plugin/utils/public-decisions.ts +6 -4
- package/addon/plugins/citation-plugin/utils/types.ts +7 -3
- package/addon/plugins/standard-template-plugin/index.ts +2 -0
- package/addon/plugins/standard-template-plugin/utils/instantiate-uuids.ts +5 -13
- package/addon/plugins/variable-plugin/utils/address-helpers.ts +19 -5
- package/addon/plugins/variable-plugin/variables/date.ts +15 -2
- package/addon/utils/memoize.ts +11 -3
- package/app/components/citation-plugin/citations/{decision-list.js → legal-document-detail.js} +1 -1
- package/app/components/citation-plugin/citations/{decision-detail.js → legal-document-list.js} +1 -1
- package/app/components/citation-plugin/citations/{decision-preview.js → legal-document-preview.js} +1 -1
- package/components/besluit-type-plugin/toolbar-dropdown.d.ts +0 -2
- package/components/citation-plugin/citation-card.d.ts +7 -7
- package/components/citation-plugin/citation-insert.d.ts +2 -2
- package/components/citation-plugin/citations/article-preview.d.ts +9 -0
- package/components/citation-plugin/citations/{decision-detail.d.ts → legal-document-detail.d.ts} +2 -2
- package/components/citation-plugin/citations/{decision-preview.d.ts → legal-document-preview.d.ts} +2 -2
- package/components/citation-plugin/citations/search-modal.d.ts +10 -11
- package/components/standard-template-plugin/card.d.ts +3 -0
- package/components/standard-template-plugin/template-provider.d.ts +5 -7
- package/components/variable-plugin/address/edit.d.ts +5 -3
- package/components/variable-plugin/date/edit.d.ts +1 -0
- package/models/template.d.ts +1 -7
- package/package.json +2 -9
- package/plugins/besluit-type-plugin/index.d.ts +1 -0
- package/plugins/citation-plugin/utils/types.d.ts +5 -4
- package/plugins/standard-template-plugin/index.d.ts +1 -0
- package/plugins/variable-plugin/utils/address-helpers.d.ts +3 -2
- package/translations/en-US.yaml +2 -0
- package/translations/nl-BE.yaml +2 -0
- package/utils/memoize.d.ts +6 -1
- package/addon/services/standard-template-plugin.ts +0 -55
- package/app/services/standard-template-plugin.js +0 -1
- package/services/standard-template-plugin.d.ts +0 -20
- package/types/lblod/frontend-gelinkt-notuleren/models/account.d.ts +0 -10
- package/types/lblod/frontend-gelinkt-notuleren/models/bestuurseenheid-classificatie-code.d.ts +0 -10
- package/types/lblod/frontend-gelinkt-notuleren/models/bestuurseenheid.d.ts +0 -12
- package/types/lblod/frontend-gelinkt-notuleren/models/gebruiker-model.d.ts +0 -18
- package/types/lblod/frontend-gelinkt-notuleren/services/current-session.d.ts +0 -30
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,48 @@
|
|
|
1
1
|
# @lblod/ember-rdfa-editor-lblod-plugins
|
|
2
2
|
|
|
3
|
+
## 14.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#315](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/315) [`01163d8`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/01163d8d45b801a50728b9aeabaf0e52a1cf9a33) Thanks [@piemonkey](https://github.com/piemonkey)! - Export standard-template-plugin's uuid instantiation function
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- [#317](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/317) [`1d28bc9`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/1d28bc9b9b0e07e8eb5698988dfe0e3dd946c2a3) Thanks [@dkozickis](https://github.com/dkozickis)! - GN-4538: Display correctly that there are no streets when searching in the address plugin
|
|
12
|
+
|
|
13
|
+
- [#316](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/316) [`e109035`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/e109035809df341ede0a03fb0b146909883903ef) Thanks [@x-m-el](https://github.com/x-m-el)! - - Bugfix: `allowCustomFormat` for rdfa-date variable will now disable custom formats if set to false.
|
|
14
|
+
- No changes for old documents: date variables in old documents will allow custom formats, which is the default.
|
|
15
|
+
|
|
16
|
+
## 14.0.0
|
|
17
|
+
|
|
18
|
+
### Major Changes
|
|
19
|
+
|
|
20
|
+
- [#314](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/314) [`a4402a0`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/a4402a0eb3acc4b7184ed362451875a6cf43be76) Thanks [@piemonkey](https://github.com/piemonkey)! - Remove Current Session Service from plugins, now classificatie uri needs to be passed in to the besluit-type plugin
|
|
21
|
+
|
|
22
|
+
- [#313](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/313) [`d4127ce`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/d4127cece3424051447b0b3407202f0f05f23512) Thanks [@piemonkey](https://github.com/piemonkey)! - Breaking change: Standard Template plugin now requires a list of templates to be passed in.
|
|
23
|
+
No depends on ember-data.
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- [#309](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/309) [`679b030`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/679b030539d5b604e5eaa4276a4e3d966998fc3f) Thanks [@dkozickis](https://github.com/dkozickis)! - GN-4539: Rename `besluit` to `gemeentebesluit`
|
|
28
|
+
|
|
29
|
+
- [#310](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/310) [`b07035f`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/b07035f8568ea397a5ed6514701ebedb284078b9) Thanks [@dkozickis](https://github.com/dkozickis)! - GN-4501: Fail gracefully when house number does not exist
|
|
30
|
+
|
|
31
|
+
When house number does not exist provide user with an alternative of inserting
|
|
32
|
+
address with just the street information.
|
|
33
|
+
|
|
34
|
+
- [#309](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/309) [`679b030`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/679b030539d5b604e5eaa4276a4e3d966998fc3f) Thanks [@dkozickis](https://github.com/dkozickis)! - GN-4539: Rename references to `decision` in Citation plugin
|
|
35
|
+
|
|
36
|
+
Instead of using `decision` use `legalDocument` in Citation plugin, to not confuse with `besluit` usage (which also means "decision" in Flemish).
|
|
37
|
+
|
|
38
|
+
- [#311](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/311) [`bb8eee6`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/bb8eee6f60acaae7c243b85a30979137757ba1dc) Thanks [@dkozickis](https://github.com/dkozickis)! - GN-4544: Decision title sometimes is not present from public decisions query
|
|
39
|
+
|
|
40
|
+
- [#308](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/308) [`39f3105`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/39f31053b59a5077c9a118431154c6d766f494eb) Thanks [@dkozickis](https://github.com/dkozickis)! - GN-4534: Citation insert card filter enhancement
|
|
41
|
+
|
|
42
|
+
- [#307](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/307) [`03ab824`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/03ab824d7dbe3eab6a86b6b0aa6c99a27d9fbeee) Thanks [@elpoelma](https://github.com/elpoelma)! - Allow municipality and street fields of address-variable to be cleared when editing
|
|
43
|
+
|
|
44
|
+
- [#312](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/312) [`52420c6`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/52420c62846b18532b1d87b8d746c201ac1be408) Thanks [@elpoelma](https://github.com/elpoelma)! - reset address-edit input fields when `currentAddress` property changes
|
|
45
|
+
|
|
3
46
|
## 13.0.0
|
|
4
47
|
|
|
5
48
|
### Major Changes
|
package/README.md
CHANGED
|
@@ -695,7 +695,7 @@ get dateOptions(){
|
|
|
695
695
|
- `key`: A **unique** identifier used for identification in the internal code.
|
|
696
696
|
- `dateFormat`: The date format used when this is selected.
|
|
697
697
|
- `dateTimeFormat`: The datetime format to use when this is selected. Used when the user selects "Include time".
|
|
698
|
-
- `allowCustomFormat`: true
|
|
698
|
+
- `allowCustomFormat`: true by default, determines if the option to insert a fully custom format is available for newly created date nodes.
|
|
699
699
|
|
|
700
700
|
The syntax of formats can be found at [date-fns](https://date-fns.org/v2.29.3/docs/format).
|
|
701
701
|
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { tracked } from '@glimmer/tracking';
|
|
2
2
|
import Component from '@glimmer/component';
|
|
3
3
|
import { action } from '@ember/object';
|
|
4
|
-
import { inject as service } from '@ember/service';
|
|
5
4
|
import {
|
|
6
5
|
addType,
|
|
7
6
|
removeType,
|
|
8
7
|
} from '@lblod/ember-rdfa-editor/commands/type-commands';
|
|
9
8
|
import { SayController } from '@lblod/ember-rdfa-editor';
|
|
10
|
-
import CurrentSessionService from '@lblod/frontend-gelinkt-notuleren/services/current-session';
|
|
11
9
|
import { ResolvedPNode } from '@lblod/ember-rdfa-editor/plugins/datastore';
|
|
12
10
|
import { getRdfaAttribute } from '@lblod/ember-rdfa-editor/utils/rdfa-utils';
|
|
13
11
|
import fetchBesluitTypes, {
|
|
@@ -30,8 +28,6 @@ type Args = {
|
|
|
30
28
|
};
|
|
31
29
|
|
|
32
30
|
export default class EditorPluginsToolbarDropdownComponent extends Component<Args> {
|
|
33
|
-
@service declare currentSession: CurrentSessionService;
|
|
34
|
-
|
|
35
31
|
/**
|
|
36
32
|
* Actual besluit type selected
|
|
37
33
|
* @property besluitType
|
|
@@ -61,11 +57,8 @@ export default class EditorPluginsToolbarDropdownComponent extends Component<Arg
|
|
|
61
57
|
}
|
|
62
58
|
|
|
63
59
|
types = trackedFunction(this, async () => {
|
|
64
|
-
// eslint-disable-next-line @typescript-eslint/await-thenable
|
|
65
|
-
const bestuurseenheid = await this.currentSession.get('group');
|
|
66
|
-
const classificatie = await bestuurseenheid.get('classificatie');
|
|
67
60
|
const types = await fetchBesluitTypes(
|
|
68
|
-
|
|
61
|
+
this.args.options.classificatieUri,
|
|
69
62
|
this.args.options.endpoint,
|
|
70
63
|
);
|
|
71
64
|
return types;
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
</div>
|
|
80
80
|
</c.content>
|
|
81
81
|
<c.footer class='au-u-background-gray-100 au-u-padding-none'>
|
|
82
|
-
{{#if this.
|
|
82
|
+
{{#if this.legalDocumentsResource.isRunning}}
|
|
83
83
|
<AuLoader />
|
|
84
84
|
<span class='au-u-hidden-visually'>{{t
|
|
85
85
|
'citaten-plugin.alert.loading'
|
|
@@ -99,10 +99,10 @@
|
|
|
99
99
|
<div
|
|
100
100
|
class='citaten--decision-list au-u-margin-none au-u-padding-top-tiny au-u-padding-bottom-tiny'
|
|
101
101
|
>
|
|
102
|
-
<CitationPlugin::Citations::
|
|
103
|
-
@
|
|
104
|
-
@onCitationInsert={{this.
|
|
105
|
-
@onCitationDetails={{this.
|
|
102
|
+
<CitationPlugin::Citations::LegalDocumentList
|
|
103
|
+
@legalDocuments={{this.legalDocumentsResource.value}}
|
|
104
|
+
@onCitationInsert={{this.insertLegalDocumentCitation}}
|
|
105
|
+
@onCitationDetails={{this.openLegalDocumentDetailModal}}
|
|
106
106
|
/>
|
|
107
107
|
</div>
|
|
108
108
|
{{/if}}
|
|
@@ -113,9 +113,9 @@
|
|
|
113
113
|
<CitationPlugin::Citations::SearchModal
|
|
114
114
|
@open={{this.showModal}}
|
|
115
115
|
@closeModal={{this.closeModal}}
|
|
116
|
-
@
|
|
116
|
+
@insertLegalDocumentCitation={{this.insertLegalDocumentCitation}}
|
|
117
117
|
@insertArticleCitation={{this.insertArticleCitation}}
|
|
118
|
-
@
|
|
118
|
+
@selectedLegalDocument={{this.legalDocument}}
|
|
119
119
|
@legislationTypeUri={{this.selectedLegislationTypeUri}}
|
|
120
120
|
@selectLegislationType={{this.selectLegislationType}}
|
|
121
121
|
@text={{this.searchText}}
|
|
@@ -19,6 +19,7 @@ import { citedText } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/citati
|
|
|
19
19
|
import {
|
|
20
20
|
LEGISLATION_TYPE_CONCEPTS,
|
|
21
21
|
legislationKeysCapitalized,
|
|
22
|
+
legislationKeysCapitalizedWithoutGemeentebesluit,
|
|
22
23
|
} from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/citation-plugin/utils/types';
|
|
23
24
|
import { Article } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/citation-plugin/utils/article';
|
|
24
25
|
import {
|
|
@@ -39,10 +40,9 @@ export default class CitationCardComponent extends Component<Args> {
|
|
|
39
40
|
@tracked pageSize = 5;
|
|
40
41
|
@tracked totalSize = 0;
|
|
41
42
|
@tracked totalCount = 0;
|
|
42
|
-
@tracked decisions = [];
|
|
43
43
|
@tracked error: unknown;
|
|
44
44
|
@tracked showModal = false;
|
|
45
|
-
@tracked
|
|
45
|
+
@tracked legalDocument: LegalDocument | null = null;
|
|
46
46
|
@tracked cardText: string | null = null;
|
|
47
47
|
@tracked cardLegislationType: string | null = null;
|
|
48
48
|
@tracked documentLegislationType: Option<string>;
|
|
@@ -95,7 +95,7 @@ export default class CitationCardComponent extends Component<Args> {
|
|
|
95
95
|
return legislationKeysCapitalized;
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
return
|
|
98
|
+
return legislationKeysCapitalizedWithoutGemeentebesluit;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
get selectedLegislationType() {
|
|
@@ -121,6 +121,10 @@ export default class CitationCardComponent extends Component<Args> {
|
|
|
121
121
|
this.cardText = (event.target as HTMLInputElement).value;
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
+
get governmentName() {
|
|
125
|
+
return this.config.defaultDecisionsGovernmentName;
|
|
126
|
+
}
|
|
127
|
+
|
|
124
128
|
resourceSearch = restartableTask(async () => {
|
|
125
129
|
await timeout(100);
|
|
126
130
|
this.error = null;
|
|
@@ -131,6 +135,7 @@ export default class CitationCardComponent extends Component<Args> {
|
|
|
131
135
|
const words = this.searchText.match(/\S+/g) || [];
|
|
132
136
|
const filter = {
|
|
133
137
|
type: unwrapOr('', this.selectedLegislationTypeUri),
|
|
138
|
+
governmentName: this.governmentName,
|
|
134
139
|
};
|
|
135
140
|
const results = await fetchLegalDocuments({
|
|
136
141
|
words: words,
|
|
@@ -152,7 +157,7 @@ export default class CitationCardComponent extends Component<Args> {
|
|
|
152
157
|
}
|
|
153
158
|
});
|
|
154
159
|
|
|
155
|
-
|
|
160
|
+
legalDocumentsResource = trackedTask(this, this.resourceSearch, () => [
|
|
156
161
|
this.searchText,
|
|
157
162
|
this.selectedLegislationType,
|
|
158
163
|
this.pageNumber,
|
|
@@ -171,8 +176,8 @@ export default class CitationCardComponent extends Component<Args> {
|
|
|
171
176
|
}
|
|
172
177
|
|
|
173
178
|
@action
|
|
174
|
-
|
|
175
|
-
this.
|
|
179
|
+
openLegalDocumentDetailModal(legalDocument: LegalDocument): void {
|
|
180
|
+
this.legalDocument = legalDocument;
|
|
176
181
|
/** why focus? see {@link EditorPluginsCitationInsertComponent.openModal } */
|
|
177
182
|
this.focus();
|
|
178
183
|
this.showModal = true;
|
|
@@ -180,8 +185,8 @@ export default class CitationCardComponent extends Component<Args> {
|
|
|
180
185
|
|
|
181
186
|
@action
|
|
182
187
|
async openSearchModal(): Promise<void> {
|
|
183
|
-
await this.
|
|
184
|
-
this.
|
|
188
|
+
await this.legalDocumentsResource.cancel();
|
|
189
|
+
this.legalDocument = null;
|
|
185
190
|
this.focus();
|
|
186
191
|
this.showModal = true;
|
|
187
192
|
}
|
|
@@ -189,7 +194,7 @@ export default class CitationCardComponent extends Component<Args> {
|
|
|
189
194
|
@action
|
|
190
195
|
closeModal(lastSearchType: string, lastSearchTerm: string): void {
|
|
191
196
|
this.showModal = false;
|
|
192
|
-
this.
|
|
197
|
+
this.legalDocument = null;
|
|
193
198
|
if (lastSearchType) {
|
|
194
199
|
this.cardLegislationType = lastSearchType;
|
|
195
200
|
}
|
|
@@ -199,9 +204,9 @@ export default class CitationCardComponent extends Component<Args> {
|
|
|
199
204
|
}
|
|
200
205
|
|
|
201
206
|
@action
|
|
202
|
-
|
|
203
|
-
const uri =
|
|
204
|
-
const title =
|
|
207
|
+
insertLegalDocumentCitation(legalDocument: LegalDocument): void {
|
|
208
|
+
const uri = legalDocument.uri;
|
|
209
|
+
const title = legalDocument.title ?? '';
|
|
205
210
|
const { from, to } = unwrap(this.activeDecoration);
|
|
206
211
|
this.controller.withTransaction(
|
|
207
212
|
(tr: Transaction) =>
|
|
@@ -218,11 +223,11 @@ export default class CitationCardComponent extends Component<Args> {
|
|
|
218
223
|
}
|
|
219
224
|
|
|
220
225
|
@action
|
|
221
|
-
insertArticleCitation(
|
|
226
|
+
insertArticleCitation(legalDocument: LegalDocument, article: Article): void {
|
|
222
227
|
const uri = article.uri;
|
|
223
228
|
let title = '';
|
|
224
|
-
if (
|
|
225
|
-
title = `${
|
|
229
|
+
if (legalDocument.title) {
|
|
230
|
+
title = `${legalDocument.title}, ${article.number || ''}`;
|
|
226
231
|
}
|
|
227
232
|
const { from, to } = unwrap(this.activeDecoration);
|
|
228
233
|
this.controller.withTransaction(
|
|
@@ -245,7 +250,7 @@ export default class CitationCardComponent extends Component<Args> {
|
|
|
245
250
|
|
|
246
251
|
willDestroy(): void {
|
|
247
252
|
// Not necessary as ember-concurrency does this for us.
|
|
248
|
-
// this.
|
|
253
|
+
// this.legalDocumentsResource.cancel();
|
|
249
254
|
cleanCaches();
|
|
250
255
|
super.willDestroy();
|
|
251
256
|
}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
<CitationPlugin::Citations::SearchModal
|
|
14
14
|
@open={{this.showModal}}
|
|
15
15
|
@closeModal={{this.closeModal}}
|
|
16
|
-
@
|
|
16
|
+
@insertLegalDocumentCitation={{this.insertLegalDocumentCitation}}
|
|
17
17
|
@insertArticleCitation={{this.insertArticleCitation}}
|
|
18
18
|
@legislationTypeUri={{this.selectedLegislationTypeUri}}
|
|
19
19
|
@selectLegislationType={{this.selectLegislationType}}
|
|
@@ -104,10 +104,10 @@ export default class EditorPluginsCitationInsertComponent extends Component<Args
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
@action
|
|
107
|
-
|
|
108
|
-
const type =
|
|
109
|
-
const uri =
|
|
110
|
-
const title =
|
|
107
|
+
insertLegalDocumentCitation(legalDocument: LegalDocument) {
|
|
108
|
+
const type = legalDocument.legislationType?.label || '';
|
|
109
|
+
const uri = legalDocument.uri;
|
|
110
|
+
const title = legalDocument.title ?? '';
|
|
111
111
|
this.controller.withTransaction(
|
|
112
112
|
(tr: Transaction) =>
|
|
113
113
|
tr
|
|
@@ -127,12 +127,12 @@ export default class EditorPluginsCitationInsertComponent extends Component<Args
|
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
@action
|
|
130
|
-
insertArticleCitation(
|
|
131
|
-
const type =
|
|
130
|
+
insertArticleCitation(legalDocument: LegalDocument, article: Article) {
|
|
131
|
+
const type = legalDocument.legislationType?.label || '';
|
|
132
132
|
const uri = article.uri;
|
|
133
133
|
let title = '';
|
|
134
|
-
if (
|
|
135
|
-
title = `${
|
|
134
|
+
if (legalDocument.title) {
|
|
135
|
+
title = `${legalDocument.title}, ${article.number ?? ''}`;
|
|
136
136
|
}
|
|
137
137
|
const { from, to } = this.controller.mainEditorState.selection;
|
|
138
138
|
this.controller.withTransaction(
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { htmlSafe } from '@ember/template';
|
|
3
|
+
import { Article } from '../../../plugins/citation-plugin/utils/article';
|
|
4
|
+
|
|
5
|
+
interface Args {
|
|
6
|
+
article: Article;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export default class ArticlePreviewComponent extends Component<Args> {
|
|
10
|
+
get content() {
|
|
11
|
+
return htmlSafe(this.args.article.content ?? '');
|
|
12
|
+
}
|
|
13
|
+
}
|
package/addon/components/citation-plugin/citations/{decision-detail.hbs → legal-document-detail.hbs}
RENAMED
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
{{! Heading with title and actions }}
|
|
4
4
|
<div class="citaten--container-header au-u-background-gray-100 au-o-box">
|
|
5
5
|
<AuHeading @level="2" @skin="4">
|
|
6
|
-
{{capitalize @
|
|
6
|
+
{{capitalize @legalDocument.fullTitle}}
|
|
7
7
|
</AuHeading>
|
|
8
|
-
{{#if @
|
|
8
|
+
{{#if @legalDocument.publicationDate}}
|
|
9
9
|
<AuPill
|
|
10
10
|
class="au-u-margin-top-small au-u-margin-bottom-small"
|
|
11
11
|
@skin="border"
|
|
12
12
|
@icon="calendar"
|
|
13
13
|
@iconAlignment="left">
|
|
14
|
-
{{@
|
|
14
|
+
{{@legalDocument.publicationDate}}
|
|
15
15
|
</AuPill>
|
|
16
16
|
{{/if}}
|
|
17
17
|
<br/>
|
|
@@ -20,14 +20,14 @@
|
|
|
20
20
|
@icon="plus-text"
|
|
21
21
|
@iconAlignment="left"
|
|
22
22
|
class="au-u-margin-right"
|
|
23
|
-
{{on "click" (fn @
|
|
23
|
+
{{on "click" (fn @insertLegalDocumentCitation @legalDocument)}}>
|
|
24
24
|
{{t "citaten-plugin.references.refer-whole"}}
|
|
25
25
|
</AuButton>
|
|
26
26
|
<AuLinkExternal
|
|
27
27
|
@skin="primary"
|
|
28
28
|
@icon="link-external"
|
|
29
29
|
@iconAlignment="left"
|
|
30
|
-
href={{@
|
|
30
|
+
href={{@legalDocument.uri}}
|
|
31
31
|
rel="noreferrer noopener">
|
|
32
32
|
{{t "citaten-plugin.references.lookup-codex"}}
|
|
33
33
|
</AuLinkExternal>
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
<CitationPlugin::Helpers::AlertLoadError @fullSize={{true}} @error={{this.error}} class="au-o-box"/>
|
|
51
51
|
{{else}}
|
|
52
52
|
<CitationPlugin::Citations::ArticleList
|
|
53
|
-
@insertArticleCitation={{fn @insertArticleCitation @
|
|
53
|
+
@insertArticleCitation={{fn @insertArticleCitation @legalDocument}}
|
|
54
54
|
@articles={{this.articleResource.value}}
|
|
55
55
|
@fullSize={{true}}/>
|
|
56
56
|
{{/if}}
|
package/addon/components/citation-plugin/citations/{decision-detail.ts → legal-document-detail.ts}
RENAMED
|
@@ -8,12 +8,12 @@ import { LegalDocument } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/ci
|
|
|
8
8
|
import { fetchArticles } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/citation-plugin/utils/article';
|
|
9
9
|
|
|
10
10
|
interface Args {
|
|
11
|
-
|
|
11
|
+
legalDocument: LegalDocument;
|
|
12
12
|
close: () => void;
|
|
13
13
|
config: { endpoint: string };
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
export default class
|
|
16
|
+
export default class LegalDocumentDetailComponent extends Component<Args> {
|
|
17
17
|
@tracked error: unknown;
|
|
18
18
|
@tracked pageNumber = 0;
|
|
19
19
|
@tracked pageSize = 5;
|
|
@@ -33,13 +33,16 @@ export default class EditorPluginsCitationsDecisionDetailComponent extends Compo
|
|
|
33
33
|
const abortController = new AbortController();
|
|
34
34
|
try {
|
|
35
35
|
const results = await fetchArticles({
|
|
36
|
-
legalExpression: this.args.
|
|
36
|
+
legalExpression: this.args.legalDocument.uri,
|
|
37
37
|
pageNumber: this.pageNumber,
|
|
38
38
|
pageSize: this.pageSize,
|
|
39
39
|
articleFilter: this.articleFilterAfterTimeout,
|
|
40
40
|
config: this.args.config,
|
|
41
41
|
});
|
|
42
42
|
this.totalCount = results.totalCount;
|
|
43
|
+
|
|
44
|
+
console.log({ result: results.articles });
|
|
45
|
+
|
|
43
46
|
return results.articles;
|
|
44
47
|
} catch (e) {
|
|
45
48
|
console.warn(e); // eslint-ignore-line no-console
|
package/addon/components/citation-plugin/citations/{decision-list.hbs → legal-document-list.hbs}
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
{{#if @
|
|
1
|
+
{{#if @legalDocuments.length}}
|
|
2
2
|
<AuList @direction="vertical" @divider={{true}}>
|
|
3
|
-
{{#each @
|
|
3
|
+
{{#each @legalDocuments as |legalDocument|}}
|
|
4
4
|
<AuList::Item class="au-u-padding-left-small au-u-padding-right-small">
|
|
5
|
-
<CitationPlugin::Citations::
|
|
6
|
-
@
|
|
7
|
-
@onCitationInsert={{fn @onCitationInsert
|
|
8
|
-
@onCitationDetails={{fn @onCitationDetails
|
|
5
|
+
<CitationPlugin::Citations::LegalDocumentPreview
|
|
6
|
+
@legalDocument={{legalDocument}}
|
|
7
|
+
@onCitationInsert={{fn @onCitationInsert legalDocument}}
|
|
8
|
+
@onCitationDetails={{fn @onCitationDetails legalDocument}}
|
|
9
9
|
@fullSize={{@fullSize}} />
|
|
10
10
|
</AuList::Item>
|
|
11
11
|
{{/each}}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<div class="citaten--decision-list-item {{if @fullSize "au-u-padding-small"}}" ...attributes>
|
|
2
2
|
<p class="citaten--decision-title {{if @fullSize "au-u-h6 au-u-medium" "au-u-h-functional"}}">
|
|
3
|
-
{{if @fullSize (capitalize @
|
|
3
|
+
{{if @fullSize (capitalize @legalDocument.fullTitle) @legalDocument.title}}
|
|
4
4
|
</p>
|
|
5
|
-
{{#if (and @fullSize @
|
|
5
|
+
{{#if (and @fullSize @legalDocument.publicationDate)}}
|
|
6
6
|
<AuPill
|
|
7
7
|
class="au-u-margin-top-small au-u-margin-bottom-small"
|
|
8
8
|
@skin="border"
|
|
9
9
|
@icon="calendar"
|
|
10
10
|
@iconAlignment="left">
|
|
11
|
-
{{@
|
|
11
|
+
{{@legalDocument.publicationDate}}
|
|
12
12
|
</AuPill>
|
|
13
13
|
{{/if}}
|
|
14
14
|
{{#if @fullSize}}
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
@skin="button"
|
|
28
28
|
@icon="link-external"
|
|
29
29
|
@iconAlignment="left"
|
|
30
|
-
href={{@
|
|
30
|
+
href={{@legalDocument.meta.publicationLink}}
|
|
31
31
|
rel="noreferrer noopener">
|
|
32
32
|
{{t "citaten-plugin.references.lookup-publicatie"}}
|
|
33
33
|
</AuLinkExternal>
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
@skin="link"
|
|
70
70
|
@icon="link-external"
|
|
71
71
|
@iconAlignment="left"
|
|
72
|
-
href={{@
|
|
72
|
+
href={{@legalDocument.meta.publicationLink}}
|
|
73
73
|
rel="noreferrer noopener"
|
|
74
74
|
class="au-u-h-functional"
|
|
75
75
|
>
|
package/addon/components/citation-plugin/citations/{decision-preview.ts → legal-document-preview.ts}
RENAMED
|
@@ -5,15 +5,15 @@ import {
|
|
|
5
5
|
} from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/citation-plugin/utils/legal-documents';
|
|
6
6
|
|
|
7
7
|
interface Args {
|
|
8
|
-
|
|
8
|
+
legalDocument: LegalDocument;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export default class
|
|
11
|
+
export default class LegalDocumentPreviewComponent extends Component<Args> {
|
|
12
12
|
get isBesluit() {
|
|
13
|
-
return isBesluitLegalDocument(this.args.
|
|
13
|
+
return isBesluitLegalDocument(this.args.legalDocument);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
get hasPublicationLink() {
|
|
17
|
-
return this.isBesluit && this.args.
|
|
17
|
+
return this.isBesluit && this.args.legalDocument.meta?.publicationLink;
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
@padding='none'
|
|
7
7
|
as |modal|
|
|
8
8
|
>
|
|
9
|
-
{{#if this.
|
|
9
|
+
{{#if this.selectedLegalDocument}}
|
|
10
10
|
<modal.Body>
|
|
11
|
-
<CitationPlugin::Citations::
|
|
12
|
-
@
|
|
11
|
+
<CitationPlugin::Citations::LegalDocumentDetail
|
|
12
|
+
@insertLegalDocumentCitation={{this.insertLegalDocumentCitation}}
|
|
13
13
|
@insertArticleCitation={{this.insertArticleCitation}}
|
|
14
|
-
@close={{this.
|
|
15
|
-
@
|
|
14
|
+
@close={{this.closeLegalDocumentDetail}}
|
|
15
|
+
@legalDocument={{this.selectedLegalDocument}}
|
|
16
16
|
@config={{this.config}}
|
|
17
17
|
/>
|
|
18
18
|
</modal.Body>
|
|
@@ -195,7 +195,7 @@
|
|
|
195
195
|
</div>
|
|
196
196
|
</mc.sidebar>
|
|
197
197
|
<mc.content>
|
|
198
|
-
{{#if this.
|
|
198
|
+
{{#if this.legalDocumentResource.isRunning}}
|
|
199
199
|
<div class='au-u-margin'>
|
|
200
200
|
<AuLoader @padding='large' />
|
|
201
201
|
<span class='au-u-hidden-visually'>{{t
|
|
@@ -210,14 +210,14 @@
|
|
|
210
210
|
class='au-u-margin'
|
|
211
211
|
/>
|
|
212
212
|
{{else}}
|
|
213
|
-
{{#if this.
|
|
213
|
+
{{#if this.legalDocumentResource.value.length}}
|
|
214
214
|
<div
|
|
215
215
|
class='citaten--container-content au-u-padding-top-small au-u-padding-bottom-small'
|
|
216
216
|
>
|
|
217
|
-
<CitationPlugin::Citations::
|
|
218
|
-
@
|
|
219
|
-
@onCitationInsert={{this.
|
|
220
|
-
@onCitationDetails={{this.
|
|
217
|
+
<CitationPlugin::Citations::LegalDocumentList
|
|
218
|
+
@legalDocuments={{this.legalDocumentResource.value}}
|
|
219
|
+
@onCitationInsert={{this.insertLegalDocumentCitation}}
|
|
220
|
+
@onCitationDetails={{this.openLegalDocumentDetail}}
|
|
221
221
|
@fullSize={{true}}
|
|
222
222
|
/>
|
|
223
223
|
</div>
|
|
@@ -229,7 +229,7 @@
|
|
|
229
229
|
{{/if}}
|
|
230
230
|
{{/if}}
|
|
231
231
|
{{/if}}
|
|
232
|
-
{{#if this.
|
|
232
|
+
{{#if this.legalDocumentResource.value.length}}
|
|
233
233
|
{{#let
|
|
234
234
|
(pagination
|
|
235
235
|
page=this.pageNumber
|
|
@@ -6,10 +6,11 @@ import { inject as service } from '@ember/service';
|
|
|
6
6
|
import { capitalize } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/strings';
|
|
7
7
|
import { task as trackedTask } from 'ember-resources/util/ember-concurrency';
|
|
8
8
|
import {
|
|
9
|
-
|
|
9
|
+
isGemeenteBesluitType,
|
|
10
10
|
LEGISLATION_TYPE_CONCEPTS,
|
|
11
11
|
LEGISLATION_TYPES,
|
|
12
12
|
legislationKeysCapitalized,
|
|
13
|
+
legislationKeysCapitalizedWithoutGemeentebesluit,
|
|
13
14
|
} from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/citation-plugin/utils/types';
|
|
14
15
|
import { CitationPluginEmberComponentConfig } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/citation-plugin';
|
|
15
16
|
import IntlService from 'ember-intl/services/intl';
|
|
@@ -37,26 +38,28 @@ function getISODate(date: Option<Date>): string | null {
|
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
interface Args {
|
|
40
|
-
|
|
41
|
+
selectedLegalDocument: LegalDocument;
|
|
41
42
|
legislationTypeUri: string;
|
|
42
43
|
text: string;
|
|
43
|
-
|
|
44
|
-
insertArticleCitation: (
|
|
44
|
+
insertLegalDocumentCitation: (legalDocument: LegalDocument) => void;
|
|
45
|
+
insertArticleCitation: (
|
|
46
|
+
legalDocument: LegalDocument,
|
|
47
|
+
article: Article,
|
|
48
|
+
) => void;
|
|
45
49
|
closeModal: (legislationTypeUri?: string, text?: string) => void;
|
|
46
50
|
config: CitationPluginEmberComponentConfig;
|
|
47
51
|
}
|
|
48
52
|
|
|
49
53
|
export default class EditorPluginsCitationsSearchModalComponent extends Component<Args> {
|
|
50
54
|
@service declare intl: IntlService;
|
|
51
|
-
// Vlaamse Codex currently doesn't contain captions and content of
|
|
55
|
+
// Vlaamse Codex currently doesn't contain captions and content of legal document
|
|
52
56
|
// @tracked isEnabledSearchCaption = false
|
|
53
57
|
// @tracked isEnabledSearchContent = false
|
|
54
58
|
@tracked pageNumber = 0;
|
|
55
59
|
@tracked pageSize = 5;
|
|
56
60
|
@tracked totalCount = 0;
|
|
57
|
-
@tracked decisions = [];
|
|
58
61
|
@tracked error: unknown;
|
|
59
|
-
@tracked
|
|
62
|
+
@tracked selectedLegalDocument: LegalDocument | null = null;
|
|
60
63
|
@tracked documentDateFrom: Date | null = null;
|
|
61
64
|
@tracked documentDateTo: Date | null = null;
|
|
62
65
|
@tracked publicationDateFrom: Date | null = null;
|
|
@@ -92,7 +95,7 @@ export default class EditorPluginsCitationsSearchModalComponent extends Componen
|
|
|
92
95
|
return legislationKeysCapitalized;
|
|
93
96
|
}
|
|
94
97
|
|
|
95
|
-
return
|
|
98
|
+
return legislationKeysCapitalizedWithoutGemeentebesluit;
|
|
96
99
|
}
|
|
97
100
|
|
|
98
101
|
get legislationSelected() {
|
|
@@ -159,7 +162,7 @@ export default class EditorPluginsCitationsSearchModalComponent extends Componen
|
|
|
159
162
|
}
|
|
160
163
|
});
|
|
161
164
|
|
|
162
|
-
|
|
165
|
+
legalDocumentResource = trackedTask(this, this.resourceSearch, () => [
|
|
163
166
|
this.searchText,
|
|
164
167
|
this.governmentSearchText,
|
|
165
168
|
this.legislationTypeUri,
|
|
@@ -172,7 +175,7 @@ export default class EditorPluginsCitationsSearchModalComponent extends Componen
|
|
|
172
175
|
]);
|
|
173
176
|
|
|
174
177
|
get isBesluitType() {
|
|
175
|
-
return
|
|
178
|
+
return isGemeenteBesluitType(this.legislationTypeUri);
|
|
176
179
|
}
|
|
177
180
|
|
|
178
181
|
@action
|
|
@@ -206,32 +209,32 @@ export default class EditorPluginsCitationsSearchModalComponent extends Componen
|
|
|
206
209
|
}
|
|
207
210
|
|
|
208
211
|
@action
|
|
209
|
-
async
|
|
210
|
-
this.args.
|
|
212
|
+
async insertLegalDocumentCitation(legalDocument: LegalDocument) {
|
|
213
|
+
this.args.insertLegalDocumentCitation(legalDocument);
|
|
211
214
|
await this.closeModal();
|
|
212
215
|
}
|
|
213
216
|
|
|
214
217
|
@action
|
|
215
|
-
async insertArticleCitation(
|
|
216
|
-
this.args.insertArticleCitation(
|
|
218
|
+
async insertArticleCitation(legalDocument: LegalDocument, article: Article) {
|
|
219
|
+
this.args.insertArticleCitation(legalDocument, article);
|
|
217
220
|
await this.closeModal();
|
|
218
221
|
}
|
|
219
222
|
|
|
220
223
|
@action
|
|
221
224
|
async closeModal(legislationTypeUri?: string, text?: string) {
|
|
222
|
-
await this.
|
|
225
|
+
await this.legalDocumentResource.cancel();
|
|
223
226
|
this.inputSearchText = null;
|
|
224
227
|
this.args.closeModal(legislationTypeUri, text);
|
|
225
228
|
}
|
|
226
229
|
|
|
227
230
|
@action
|
|
228
|
-
|
|
229
|
-
this.
|
|
231
|
+
openLegalDocumentDetail(legalDocument: LegalDocument) {
|
|
232
|
+
this.selectedLegalDocument = legalDocument;
|
|
230
233
|
}
|
|
231
234
|
|
|
232
235
|
@action
|
|
233
|
-
|
|
234
|
-
this.
|
|
236
|
+
closeLegalDocumentDetail() {
|
|
237
|
+
this.selectedLegalDocument = null;
|
|
235
238
|
}
|
|
236
239
|
|
|
237
240
|
// Pagination
|