@lblod/ember-rdfa-editor-lblod-plugins 12.0.0 → 13.0.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/.woodpecker/.changeset.yml +1 -2
- package/CHANGELOG.md +49 -1
- package/README.md +242 -138
- package/addon/components/citation-plugin/citations/search-modal.hbs +22 -0
- package/addon/components/citation-plugin/citations/search-modal.ts +15 -0
- package/addon/components/decision-plugin/decision-plugin-card.hbs +3 -3
- package/addon/components/snippet-plugin/snippet-list/snippet-list-view.hbs +2 -2
- package/addon/components/table-of-contents-plugin/ember-nodes/table-of-contents.ts +1 -0
- package/addon/components/template-comments-plugin/template-comment.hbs +4 -4
- package/addon/components/template-comments-plugin/template-comment.ts +16 -0
- package/addon/components/variable-plugin/address/edit.ts +1 -1
- package/addon/components/variable-plugin/address/insert-variable.hbs +9 -0
- package/addon/components/variable-plugin/address/insert-variable.ts +40 -0
- package/addon/components/variable-plugin/address/insert.hbs +2 -1
- package/addon/components/variable-plugin/address/insert.ts +22 -18
- package/addon/components/variable-plugin/address/nodeview.hbs +2 -2
- package/addon/components/variable-plugin/address/nodeview.ts +23 -1
- package/addon/components/variable-plugin/address/utils.ts +26 -0
- package/addon/components/variable-plugin/codelist/insert.ts +10 -1
- package/addon/components/{rdfa-date-plugin → variable-plugin/date}/date-time-picker.ts +1 -1
- package/addon/components/{rdfa-date-plugin/card.hbs → variable-plugin/date/edit.hbs} +3 -3
- package/addon/components/{rdfa-date-plugin/card.ts → variable-plugin/date/edit.ts} +10 -10
- package/addon/components/{rdfa-date-plugin → variable-plugin/date}/help-modal.ts +2 -2
- package/addon/components/variable-plugin/date/insert-variable.hbs +9 -0
- package/addon/components/variable-plugin/date/insert-variable.ts +57 -0
- package/addon/components/variable-plugin/date/insert.hbs +9 -9
- package/addon/components/variable-plugin/date/insert.ts +13 -10
- package/addon/components/{rdfa-date-plugin/date.hbs → variable-plugin/date/nodeview.hbs} +1 -1
- package/addon/components/{rdfa-date-plugin/date.ts → variable-plugin/date/nodeview.ts} +20 -6
- package/addon/components/variable-plugin/location/insert.ts +11 -2
- package/addon/components/variable-plugin/location/nodeview.hbs +8 -0
- package/addon/components/variable-plugin/location/nodeview.ts +15 -0
- package/addon/components/variable-plugin/number/insert.hbs +1 -1
- package/addon/components/variable-plugin/number/insert.ts +9 -1
- package/addon/components/variable-plugin/number/nodeview.hbs +2 -2
- package/addon/components/variable-plugin/number/nodeview.ts +17 -0
- package/addon/components/variable-plugin/text/insert.ts +14 -2
- package/addon/components/variable-plugin/variable/nodeview.hbs +1 -0
- package/addon/plugins/citation-plugin/index.ts +1 -0
- package/addon/plugins/citation-plugin/utils/legal-documents.ts +2 -0
- package/addon/plugins/citation-plugin/utils/public-decisions.ts +62 -26
- package/addon/plugins/table-of-contents-plugin/nodes/table-of-contents.ts +8 -13
- package/addon/plugins/table-of-contents-plugin/utils/index.ts +7 -4
- package/addon/plugins/template-comments-plugin/node.ts +12 -3
- package/addon/plugins/variable-plugin/variables/address.ts +15 -8
- package/addon/plugins/variable-plugin/variables/codelist.ts +4 -4
- package/addon/plugins/variable-plugin/variables/date.ts +200 -0
- package/addon/plugins/variable-plugin/variables/index.ts +1 -0
- package/addon/plugins/variable-plugin/variables/location.ts +4 -4
- package/addon/plugins/variable-plugin/variables/number.ts +11 -8
- package/addon/plugins/variable-plugin/variables/text.ts +4 -4
- package/addon/utils/translation.ts +19 -0
- package/app/components/variable-plugin/address/insert-variable.js +1 -0
- package/app/components/variable-plugin/date/date-time-picker.js +1 -0
- package/app/components/{rdfa-date-plugin/card.js → variable-plugin/date/edit.js} +1 -1
- package/app/components/{rdfa-date-plugin → variable-plugin/date}/help-modal.js +1 -1
- package/app/components/{rdfa-date-plugin/date.js → variable-plugin/date/insert-variable.js} +1 -1
- package/app/components/{rdfa-date-plugin/insert.js → variable-plugin/date/nodeview.js} +1 -1
- package/app/components/{rdfa-date-plugin/date-time-picker.js → variable-plugin/location/nodeview.js} +1 -1
- package/app/styles/besluit-plugin.scss +2 -2
- package/app/styles/date-plugin.scss +0 -20
- package/app/styles/snippet-plugin.scss +1 -1
- package/app/styles/template-comments-plugin.scss +4 -4
- package/app/styles/variable-plugin.scss +8 -4
- package/components/citation-plugin/citations/search-modal.d.ts +3 -0
- package/components/template-comments-plugin/template-comment.d.ts +6 -0
- package/components/variable-plugin/address/insert-variable.d.ts +15 -0
- package/components/variable-plugin/address/insert.d.ts +4 -1
- package/components/variable-plugin/address/nodeview.d.ts +7 -0
- package/components/variable-plugin/address/utils.d.ts +2 -0
- package/components/variable-plugin/codelist/insert.d.ts +1 -0
- package/components/{rdfa-date-plugin → variable-plugin/date}/date-time-picker.d.ts +1 -1
- package/components/{rdfa-date-plugin/card.d.ts → variable-plugin/date/edit.d.ts} +3 -3
- package/components/{rdfa-date-plugin → variable-plugin/date}/help-modal.d.ts +1 -1
- package/components/variable-plugin/date/insert-variable.d.ts +16 -0
- package/components/variable-plugin/date/insert.d.ts +4 -3
- package/components/{rdfa-date-plugin/date.d.ts → variable-plugin/date/nodeview.d.ts} +5 -1
- package/components/variable-plugin/location/insert.d.ts +1 -0
- package/components/variable-plugin/location/nodeview.d.ts +12 -0
- package/components/variable-plugin/number/insert.d.ts +1 -0
- package/components/variable-plugin/number/nodeview.d.ts +5 -0
- package/components/variable-plugin/text/insert.d.ts +3 -0
- package/index.js +3 -0
- package/package.json +14 -10
- package/plugins/citation-plugin/index.d.ts +1 -0
- package/plugins/citation-plugin/utils/legal-documents.d.ts +1 -0
- package/plugins/table-of-contents-plugin/utils/index.d.ts +3 -2
- package/plugins/{rdfa-date-plugin/nodes → variable-plugin/variables}/date.d.ts +10 -1
- package/plugins/variable-plugin/variables/index.d.ts +1 -0
- package/translations/en-US.yaml +12 -0
- package/translations/nl-BE.yaml +13 -0
- package/utils/translation.d.ts +3 -0
- package/addon/components/rdfa-date-plugin/insert.hbs +0 -9
- package/addon/components/rdfa-date-plugin/insert.ts +0 -52
- package/addon/plugins/rdfa-date-plugin/index.ts +0 -28
- package/addon/plugins/rdfa-date-plugin/nodes/date.ts +0 -167
- package/components/rdfa-date-plugin/insert.d.ts +0 -16
- package/plugins/rdfa-date-plugin/index.d.ts +0 -15
- /package/addon/components/{rdfa-date-plugin → variable-plugin/date}/date-time-picker.hbs +0 -0
- /package/addon/components/{rdfa-date-plugin → variable-plugin/date}/help-modal.hbs +0 -0
- /package/addon/plugins/{rdfa-date-plugin/utils.ts → variable-plugin/utils/date-helpers.ts} +0 -0
- /package/plugins/{rdfa-date-plugin/utils.d.ts → variable-plugin/utils/date-helpers.d.ts} +0 -0
|
@@ -7,11 +7,12 @@ import {
|
|
|
7
7
|
SayView,
|
|
8
8
|
} from '@lblod/ember-rdfa-editor';
|
|
9
9
|
import { action } from '@ember/object';
|
|
10
|
+
import IntlService from 'ember-intl/services/intl';
|
|
11
|
+
import { service } from '@ember/service';
|
|
10
12
|
import {
|
|
11
13
|
formatDate,
|
|
12
14
|
validateDateFormat,
|
|
13
|
-
} from '
|
|
14
|
-
import { DateOptions } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/rdfa-date-plugin';
|
|
15
|
+
} from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/variable-plugin/utils/date-helpers';
|
|
15
16
|
|
|
16
17
|
type Args = {
|
|
17
18
|
getPos: () => number | undefined;
|
|
@@ -23,7 +24,17 @@ type Args = {
|
|
|
23
24
|
contentDecorations?: DecorationSource;
|
|
24
25
|
};
|
|
25
26
|
|
|
26
|
-
export default class
|
|
27
|
+
export default class DateNodeviewComponent extends Component<Args> {
|
|
28
|
+
@service declare intl: IntlService;
|
|
29
|
+
|
|
30
|
+
get controller() {
|
|
31
|
+
return this.args.controller;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
get documentLanguage() {
|
|
35
|
+
return this.controller.documentLanguage;
|
|
36
|
+
}
|
|
37
|
+
|
|
27
38
|
@action
|
|
28
39
|
onClick() {
|
|
29
40
|
const tr = this.args.controller.activeEditorState.tr;
|
|
@@ -46,10 +57,13 @@ export default class VariableComponent extends Component<Args> {
|
|
|
46
57
|
return 'Ongeldig formaat';
|
|
47
58
|
}
|
|
48
59
|
} else {
|
|
49
|
-
const options = this.args.node.type.spec.options as DateOptions;
|
|
50
60
|
return (this.args.node.attrs.onlyDate as boolean)
|
|
51
|
-
?
|
|
52
|
-
|
|
61
|
+
? this.intl.t('date-plugin.insert.date', {
|
|
62
|
+
locale: this.documentLanguage,
|
|
63
|
+
})
|
|
64
|
+
: this.intl.t('date-plugin.insert.datetime', {
|
|
65
|
+
locale: this.documentLanguage,
|
|
66
|
+
});
|
|
53
67
|
}
|
|
54
68
|
}
|
|
55
69
|
}
|
|
@@ -28,6 +28,10 @@ export default class LocationInsertComponent extends Component<Args> {
|
|
|
28
28
|
return this.controller.schema;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
get documentLanguage() {
|
|
32
|
+
return this.controller.documentLanguage;
|
|
33
|
+
}
|
|
34
|
+
|
|
31
35
|
get endpoint() {
|
|
32
36
|
return this.args.options.endpoint;
|
|
33
37
|
}
|
|
@@ -41,15 +45,20 @@ export default class LocationInsertComponent extends Component<Args> {
|
|
|
41
45
|
insert() {
|
|
42
46
|
const mappingResource = `http://data.lblod.info/mappings/${uuidv4()}`;
|
|
43
47
|
const variableInstance = `http://data.lblod.info/variables/${uuidv4()}`;
|
|
48
|
+
|
|
49
|
+
const placeholder = this.intl.t('variable.location.label', {
|
|
50
|
+
locale: this.documentLanguage,
|
|
51
|
+
});
|
|
52
|
+
|
|
44
53
|
const node = this.schema.nodes.location.create(
|
|
45
54
|
{
|
|
46
55
|
mappingResource,
|
|
47
56
|
variableInstance,
|
|
48
|
-
label: this.label,
|
|
57
|
+
label: this.label ?? placeholder,
|
|
49
58
|
source: this.endpoint,
|
|
50
59
|
},
|
|
51
60
|
this.schema.node('placeholder', {
|
|
52
|
-
placeholderText:
|
|
61
|
+
placeholderText: placeholder,
|
|
53
62
|
}),
|
|
54
63
|
);
|
|
55
64
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { SayController, SayView } from '@lblod/ember-rdfa-editor';
|
|
3
|
+
import { tracked } from '@glimmer/tracking';
|
|
4
|
+
import { addressView } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/variable-plugin/variables';
|
|
5
|
+
|
|
6
|
+
type Args = {
|
|
7
|
+
controller: SayController;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export default class LocationNodeViewComponent extends Component<Args> {
|
|
11
|
+
@tracked nodeViews = {
|
|
12
|
+
address: addressView(this.args.controller),
|
|
13
|
+
};
|
|
14
|
+
@tracked innerView?: SayView;
|
|
15
|
+
}
|
|
@@ -42,6 +42,10 @@ export default class NumberInsertComponent extends Component<Args> {
|
|
|
42
42
|
return this.args.controller.schema;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
get documentLanguage() {
|
|
46
|
+
return this.controller.documentLanguage;
|
|
47
|
+
}
|
|
48
|
+
|
|
45
49
|
get numberVariableError() {
|
|
46
50
|
if (!this.validMinimum || !this.validMaximum) {
|
|
47
51
|
return this.intl.t('variable.number.error-not-number');
|
|
@@ -83,8 +87,12 @@ export default class NumberInsertComponent extends Component<Args> {
|
|
|
83
87
|
const mappingResource = `http://data.lblod.info/mappings/${uuidv4()}`;
|
|
84
88
|
const variableInstance = `http://data.lblod.info/variables/${uuidv4()}`;
|
|
85
89
|
|
|
90
|
+
const defaultLabel = this.intl.t('variable.number.label', {
|
|
91
|
+
locale: this.documentLanguage,
|
|
92
|
+
});
|
|
93
|
+
|
|
86
94
|
const node = this.schema.nodes.number.create({
|
|
87
|
-
label: this.label,
|
|
95
|
+
label: this.label ?? defaultLabel,
|
|
88
96
|
value: null,
|
|
89
97
|
mappingResource,
|
|
90
98
|
variableInstance,
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<AuPill
|
|
6
6
|
@icon='pencil'
|
|
7
7
|
@iconAlignment='right'
|
|
8
|
-
class='variable'
|
|
8
|
+
class='variable atomic'
|
|
9
9
|
{{velcro.hook}}
|
|
10
10
|
{{select-node-on-click @controller @getPos}}
|
|
11
11
|
>
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
{{this.formattedNumber}}
|
|
14
14
|
{{else}}
|
|
15
15
|
<span class='mark-highlight-manual'>
|
|
16
|
-
{{
|
|
16
|
+
{{this.translations.placeholder}}
|
|
17
17
|
</span>
|
|
18
18
|
{{/if}}
|
|
19
19
|
{{#if @node.attrs.label}}
|
|
@@ -22,6 +22,7 @@ type Args = {
|
|
|
22
22
|
selected: boolean;
|
|
23
23
|
contentDecorations?: DecorationSource;
|
|
24
24
|
};
|
|
25
|
+
|
|
25
26
|
export default class NumberNodeviewComponent extends Component<Args> {
|
|
26
27
|
@localCopy('args.node.attrs.value', '') declare inputNumber: string;
|
|
27
28
|
@localCopy('args.node.attrs.writtenNumber', false)
|
|
@@ -33,6 +34,22 @@ export default class NumberNodeviewComponent extends Component<Args> {
|
|
|
33
34
|
element.focus();
|
|
34
35
|
}
|
|
35
36
|
|
|
37
|
+
get controller() {
|
|
38
|
+
return this.args.controller;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
get documentLanguage() {
|
|
42
|
+
return this.controller.documentLanguage;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
get translations() {
|
|
46
|
+
return {
|
|
47
|
+
placeholder: this.intl.t('variable.number.placeholder', {
|
|
48
|
+
locale: this.documentLanguage,
|
|
49
|
+
}),
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
36
53
|
get node() {
|
|
37
54
|
return this.args.node;
|
|
38
55
|
}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
import { tracked } from '@glimmer/tracking';
|
|
3
3
|
import { action } from '@ember/object';
|
|
4
|
+
import { service } from '@ember/service';
|
|
4
5
|
import { SayController } from '@lblod/ember-rdfa-editor';
|
|
5
6
|
import { v4 as uuidv4 } from 'uuid';
|
|
7
|
+
import IntlService from 'ember-intl/services/intl';
|
|
6
8
|
|
|
7
9
|
type Args = {
|
|
8
10
|
controller: SayController;
|
|
9
11
|
};
|
|
10
12
|
|
|
11
13
|
export default class TextVariableInsertComponent extends Component<Args> {
|
|
14
|
+
@service declare intl: IntlService;
|
|
12
15
|
@tracked label?: string;
|
|
13
16
|
|
|
14
17
|
get controller() {
|
|
@@ -19,6 +22,10 @@ export default class TextVariableInsertComponent extends Component<Args> {
|
|
|
19
22
|
return this.args.controller.schema;
|
|
20
23
|
}
|
|
21
24
|
|
|
25
|
+
get documentLanguage() {
|
|
26
|
+
return this.controller.documentLanguage;
|
|
27
|
+
}
|
|
28
|
+
|
|
22
29
|
@action
|
|
23
30
|
updateLabel(event: InputEvent) {
|
|
24
31
|
this.label = (event.target as HTMLInputElement).value;
|
|
@@ -28,13 +35,18 @@ export default class TextVariableInsertComponent extends Component<Args> {
|
|
|
28
35
|
insert() {
|
|
29
36
|
const mappingResource = `http://data.lblod.info/mappings/${uuidv4()}`;
|
|
30
37
|
const variableInstance = `http://data.lblod.info/variables/${uuidv4()}`;
|
|
38
|
+
|
|
39
|
+
const placeholder = this.intl.t('variable.text.label', {
|
|
40
|
+
locale: this.documentLanguage,
|
|
41
|
+
});
|
|
42
|
+
|
|
31
43
|
const node = this.schema.nodes.text_variable.create(
|
|
32
44
|
{
|
|
33
|
-
label: this.label,
|
|
45
|
+
label: this.label ?? placeholder,
|
|
34
46
|
mappingResource,
|
|
35
47
|
variableInstance,
|
|
36
48
|
},
|
|
37
|
-
this.schema.node('placeholder', { placeholderText:
|
|
49
|
+
this.schema.node('placeholder', { placeholderText: placeholder }),
|
|
38
50
|
);
|
|
39
51
|
|
|
40
52
|
this.label = undefined;
|
|
@@ -140,6 +140,7 @@ export type CitationPluginConfig =
|
|
|
140
140
|
export type CitationPluginEmberComponentConfig = CitationPluginConfig & {
|
|
141
141
|
endpoint: string;
|
|
142
142
|
decisionsEndpoint?: string;
|
|
143
|
+
defaultDecisionsGovernmentName?: string;
|
|
143
144
|
};
|
|
144
145
|
|
|
145
146
|
export function citationPlugin(config: CitationPluginConfig): CitationPlugin {
|
|
@@ -65,6 +65,7 @@ export interface LegalDocumentsQueryFilter {
|
|
|
65
65
|
documentDateTo?: Option<string>;
|
|
66
66
|
publicationDateFrom?: Option<string>;
|
|
67
67
|
publicationDateTo?: Option<string>;
|
|
68
|
+
governmentName?: Option<string>;
|
|
68
69
|
}
|
|
69
70
|
|
|
70
71
|
export type LegalDocumentsQueryConfig = {
|
|
@@ -94,6 +95,7 @@ export async function fetchLegalDocuments({
|
|
|
94
95
|
documentDateTo: filter.documentDateTo || null,
|
|
95
96
|
publicationDateFrom: filter.publicationDateFrom || null,
|
|
96
97
|
publicationDateTo: filter.publicationDateTo || null,
|
|
98
|
+
governmentName: filter.governmentName || null,
|
|
97
99
|
};
|
|
98
100
|
const stringArguments = JSON.stringify({
|
|
99
101
|
words,
|
|
@@ -42,6 +42,12 @@ const getFilters = ({
|
|
|
42
42
|
);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
const governmentNameFilter = filter.governmentName?.trim()
|
|
46
|
+
? `FILTER (CONTAINS(LCASE(?administrativeUnitName), "${replaceDiacriticsInWord(
|
|
47
|
+
filter.governmentName?.trim(),
|
|
48
|
+
).toLowerCase()}"))`
|
|
49
|
+
: '';
|
|
50
|
+
|
|
45
51
|
return `
|
|
46
52
|
${words
|
|
47
53
|
.map(
|
|
@@ -51,7 +57,10 @@ const getFilters = ({
|
|
|
51
57
|
).toLowerCase()}"))`,
|
|
52
58
|
)
|
|
53
59
|
.join('\n')}
|
|
54
|
-
${documentDateFilter.join('\n')}
|
|
60
|
+
${documentDateFilter.join('\n')}
|
|
61
|
+
${governmentNameFilter}
|
|
62
|
+
FILTER(BOUND(?decisionTitle))
|
|
63
|
+
`;
|
|
55
64
|
};
|
|
56
65
|
|
|
57
66
|
const getCountQuery = ({
|
|
@@ -69,25 +78,31 @@ const getCountQuery = ({
|
|
|
69
78
|
PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>
|
|
70
79
|
PREFIX eli: <http://data.europa.eu/eli/ontology#>
|
|
71
80
|
PREFIX prov: <http://www.w3.org/ns/prov#>
|
|
72
|
-
PREFIX schema: <http://schema.org/>
|
|
73
81
|
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
|
|
74
82
|
PREFIX mandaat: <http://data.vlaanderen.be/ns/mandaat#>
|
|
75
|
-
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
|
|
76
83
|
PREFIX mu: <http://mu.semte.ch/vocabularies/core/>
|
|
84
|
+
PREFIX dct: <http://purl.org/dc/terms/>
|
|
77
85
|
|
|
78
86
|
SELECT (COUNT(DISTINCT(?decision)) as ?count) WHERE {
|
|
79
87
|
?session rdf:type besluit:Zitting;
|
|
80
88
|
mu:uuid ?zittingUuid;
|
|
81
|
-
(besluit:isGehoudenDoor/mandaat:isTijdspecialisatieVan
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
?
|
|
89
|
+
(besluit:isGehoudenDoor/mandaat:isTijdspecialisatieVan) ?administrativeUnit.
|
|
90
|
+
?administrativeUnit skos:prefLabel ?administrativeUnitFullName;
|
|
91
|
+
besluit:bestuurt ?bestuurseenheid.
|
|
92
|
+
?bestuurseenheid skos:prefLabel ?administrativeUnitName;
|
|
93
|
+
(besluit:classificatie/skos:prefLabel) ?administrativeUnitTypeName.
|
|
85
94
|
OPTIONAL {
|
|
86
|
-
?
|
|
95
|
+
?session besluit:behandelt ?agendaPoint.
|
|
96
|
+
?agendaPointTreatment dct:subject ?agendaPoint;
|
|
87
97
|
prov:generated ?decision.
|
|
88
|
-
?
|
|
89
|
-
|
|
90
|
-
|
|
98
|
+
?decision eli:title ?decisionTitle.
|
|
99
|
+
}
|
|
100
|
+
OPTIONAL {
|
|
101
|
+
?session ext:uittreksel ?treatment.
|
|
102
|
+
?treatment mu:uuid ?treatmentUuid.
|
|
103
|
+
?treatment ext:uittrekselBvap ?agendaPointTreatment.
|
|
104
|
+
?agendaPointTreatment prov:generated ?decision.
|
|
105
|
+
?decision eli:title ?decisionTitle.
|
|
91
106
|
}
|
|
92
107
|
${filterString}
|
|
93
108
|
}
|
|
@@ -113,25 +128,31 @@ const getQuery = ({
|
|
|
113
128
|
PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>
|
|
114
129
|
PREFIX eli: <http://data.europa.eu/eli/ontology#>
|
|
115
130
|
PREFIX prov: <http://www.w3.org/ns/prov#>
|
|
116
|
-
PREFIX schema: <http://schema.org/>
|
|
117
131
|
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
|
|
118
132
|
PREFIX mandaat: <http://data.vlaanderen.be/ns/mandaat#>
|
|
119
|
-
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
|
|
120
133
|
PREFIX mu: <http://mu.semte.ch/vocabularies/core/>
|
|
134
|
+
PREFIX dct: <http://purl.org/dc/terms/>
|
|
121
135
|
|
|
122
|
-
SELECT DISTINCT ?
|
|
136
|
+
SELECT DISTINCT ?administrativeUnitFullName ?administrativeUnitTypeName ?administrativeUnitName ?documentDate ?decision ?decisionTitle ?zittingUuid ?treatmentUuid WHERE {
|
|
123
137
|
?session rdf:type besluit:Zitting;
|
|
124
138
|
mu:uuid ?zittingUuid;
|
|
125
|
-
(besluit:isGehoudenDoor/mandaat:isTijdspecialisatieVan
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
?
|
|
139
|
+
(besluit:isGehoudenDoor/mandaat:isTijdspecialisatieVan) ?administrativeUnit.
|
|
140
|
+
?administrativeUnit skos:prefLabel ?administrativeUnitFullName;
|
|
141
|
+
besluit:bestuurt ?bestuurseenheid.
|
|
142
|
+
?bestuurseenheid skos:prefLabel ?administrativeUnitName;
|
|
143
|
+
(besluit:classificatie/skos:prefLabel) ?administrativeUnitTypeName.
|
|
129
144
|
OPTIONAL {
|
|
130
|
-
?
|
|
145
|
+
?session besluit:behandelt ?agendaPoint.
|
|
146
|
+
?agendaPointTreatment dct:subject ?agendaPoint;
|
|
131
147
|
prov:generated ?decision.
|
|
132
|
-
?
|
|
133
|
-
|
|
134
|
-
|
|
148
|
+
?decision eli:title ?decisionTitle.
|
|
149
|
+
}
|
|
150
|
+
OPTIONAL {
|
|
151
|
+
?session ext:uittreksel ?treatment.
|
|
152
|
+
?treatment mu:uuid ?treatmentUuid.
|
|
153
|
+
?treatment ext:uittrekselBvap ?agendaPointTreatment.
|
|
154
|
+
?agendaPointTreatment prov:generated ?decision.
|
|
155
|
+
?decision eli:title ?decisionTitle.
|
|
135
156
|
}
|
|
136
157
|
${filterString}
|
|
137
158
|
}
|
|
@@ -142,7 +163,9 @@ const getQuery = ({
|
|
|
142
163
|
};
|
|
143
164
|
|
|
144
165
|
interface PublicDecisionLegalDocumentBinding {
|
|
145
|
-
|
|
166
|
+
administrativeUnitName: Binding<string>;
|
|
167
|
+
administrativeUnitTypeName: Binding<string>;
|
|
168
|
+
administrativeUnitFullName: Binding<string>;
|
|
146
169
|
decision: Binding<string>;
|
|
147
170
|
decisionTitle: Binding<string>;
|
|
148
171
|
documentDate?: Binding<string>;
|
|
@@ -176,7 +199,7 @@ export async function fetchPublicDecisions({
|
|
|
176
199
|
|
|
177
200
|
const legalDocuments = response.results.bindings.map((binding) => {
|
|
178
201
|
const escapedGovernmentName =
|
|
179
|
-
escapeValue(binding.
|
|
202
|
+
escapeValue(binding.administrativeUnitFullName.value) ?? '';
|
|
180
203
|
|
|
181
204
|
const escapedTitle = escapeValue(binding.decisionTitle.value) ?? '';
|
|
182
205
|
|
|
@@ -198,8 +221,12 @@ export async function fetchPublicDecisions({
|
|
|
198
221
|
publicationLink:
|
|
199
222
|
binding.zittingUuid.value && binding.treatmentUuid?.value
|
|
200
223
|
? getPublicationLink({
|
|
224
|
+
administrativeUnitName: binding.administrativeUnitName.value,
|
|
225
|
+
administrativeUnitTypeName:
|
|
226
|
+
binding.administrativeUnitTypeName.value,
|
|
201
227
|
zittingUuid: binding.zittingUuid.value,
|
|
202
228
|
treatmentUuid: binding.treatmentUuid.value,
|
|
229
|
+
decisionsEndpoint: config.endpoint,
|
|
203
230
|
})
|
|
204
231
|
: null,
|
|
205
232
|
},
|
|
@@ -219,10 +246,19 @@ export async function fetchPublicDecisions({
|
|
|
219
246
|
}
|
|
220
247
|
|
|
221
248
|
const getPublicationLink = ({
|
|
249
|
+
administrativeUnitName,
|
|
250
|
+
administrativeUnitTypeName,
|
|
222
251
|
zittingUuid,
|
|
223
252
|
treatmentUuid,
|
|
253
|
+
decisionsEndpoint,
|
|
224
254
|
}: {
|
|
255
|
+
administrativeUnitName: string;
|
|
256
|
+
administrativeUnitTypeName: string;
|
|
225
257
|
zittingUuid: string;
|
|
226
258
|
treatmentUuid: string;
|
|
227
|
-
|
|
228
|
-
|
|
259
|
+
decisionsEndpoint: string;
|
|
260
|
+
}) => {
|
|
261
|
+
return `https://${
|
|
262
|
+
new URL(decisionsEndpoint).host
|
|
263
|
+
}/${administrativeUnitName}/${administrativeUnitTypeName}/zittingen/${zittingUuid}/uittreksels/${treatmentUuid}`;
|
|
264
|
+
};
|
|
@@ -8,15 +8,16 @@ import {
|
|
|
8
8
|
createTableOfContents,
|
|
9
9
|
extractOutline,
|
|
10
10
|
} from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/table-of-contents-plugin/utils';
|
|
11
|
-
import
|
|
12
|
-
import
|
|
11
|
+
import TableOfContentsComponent from '@lblod/ember-rdfa-editor-lblod-plugins/components/table-of-contents-plugin/ember-nodes/table-of-contents';
|
|
12
|
+
import type { ComponentLike } from '@glint/template';
|
|
13
|
+
import { getTranslationFunction } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/translation';
|
|
13
14
|
|
|
14
15
|
export const emberNodeConfig: (
|
|
15
16
|
config: TableOfContentsConfig,
|
|
16
17
|
) => EmberNodeConfig = (config) => {
|
|
17
18
|
return {
|
|
18
19
|
name: 'table-of-contents',
|
|
19
|
-
|
|
20
|
+
component: TableOfContentsComponent as unknown as ComponentLike,
|
|
20
21
|
inline: false,
|
|
21
22
|
group: 'table_of_contents',
|
|
22
23
|
atom: true,
|
|
@@ -26,23 +27,17 @@ export const emberNodeConfig: (
|
|
|
26
27
|
},
|
|
27
28
|
},
|
|
28
29
|
serialize(node, state) {
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
?.application.lookup('service:intl') as IntlService | undefined;
|
|
32
|
-
const lang = state.doc.attrs.lang as string;
|
|
30
|
+
const t = getTranslationFunction(state);
|
|
31
|
+
|
|
33
32
|
const { config } = node.attrs;
|
|
34
33
|
const entries = extractOutline({
|
|
35
34
|
node: state.doc,
|
|
36
35
|
pos: -1,
|
|
37
36
|
config: config as TableOfContentsConfig,
|
|
37
|
+
state,
|
|
38
38
|
});
|
|
39
39
|
|
|
40
|
-
const title =
|
|
41
|
-
? intl.t('table-of-contents-plugin.title', {
|
|
42
|
-
locale: lang,
|
|
43
|
-
})
|
|
44
|
-
: 'Inhoudstafel';
|
|
45
|
-
|
|
40
|
+
const title = t('table-of-contents-plugin.title', 'Inhoudstafel');
|
|
46
41
|
return [
|
|
47
42
|
'div',
|
|
48
43
|
{ 'data-ember-node': 'table-of-contents', class: 'table-of-contents' },
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DOMOutputSpec, PNode } from '@lblod/ember-rdfa-editor';
|
|
1
|
+
import { DOMOutputSpec, EditorState, PNode } from '@lblod/ember-rdfa-editor';
|
|
2
2
|
import { NodeWithPos } from '@curvenote/prosemirror-utils';
|
|
3
3
|
|
|
4
4
|
export type OutlineEntry = {
|
|
@@ -49,10 +49,12 @@ export function extractOutline({
|
|
|
49
49
|
node,
|
|
50
50
|
pos,
|
|
51
51
|
config,
|
|
52
|
+
state,
|
|
52
53
|
}: {
|
|
53
54
|
node: PNode;
|
|
54
55
|
pos: number;
|
|
55
56
|
config: Config;
|
|
57
|
+
state: EditorState;
|
|
56
58
|
}): OutlineEntry[] {
|
|
57
59
|
let result: OutlineEntry[] = [];
|
|
58
60
|
let parent: OutlineEntry | undefined;
|
|
@@ -74,10 +76,11 @@ export function extractOutline({
|
|
|
74
76
|
}
|
|
75
77
|
if (currentNode) {
|
|
76
78
|
const outlineText = currentNode.node.type.spec.outlineText as
|
|
77
|
-
| ((node: PNode) => string)
|
|
79
|
+
| ((node: PNode, state: EditorState) => string)
|
|
78
80
|
| undefined;
|
|
79
81
|
const content =
|
|
80
|
-
outlineText?.(currentNode.node) ??
|
|
82
|
+
outlineText?.(currentNode.node, state) ??
|
|
83
|
+
currentNode.node.textContent;
|
|
81
84
|
parent = {
|
|
82
85
|
pos: currentNode.pos,
|
|
83
86
|
content,
|
|
@@ -88,7 +91,7 @@ export function extractOutline({
|
|
|
88
91
|
const subResults: OutlineEntry[] = [];
|
|
89
92
|
node.forEach((child, offset) => {
|
|
90
93
|
subResults.push(
|
|
91
|
-
...extractOutline({ node: child, pos: pos + 1 + offset, config }),
|
|
94
|
+
...extractOutline({ node: child, pos: pos + 1 + offset, config, state }),
|
|
92
95
|
);
|
|
93
96
|
});
|
|
94
97
|
if (parent) {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { ComponentLike } from '@glint/template';
|
|
2
|
+
import TemplateCommentsComponent from '@lblod/ember-rdfa-editor-lblod-plugins/components/template-comments-plugin/template-comment';
|
|
1
3
|
import { EXT } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/constants';
|
|
2
4
|
import { hasRDFaAttribute } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/namespace';
|
|
3
5
|
import {
|
|
@@ -5,11 +7,12 @@ import {
|
|
|
5
7
|
createEmberNodeView,
|
|
6
8
|
EmberNodeConfig,
|
|
7
9
|
} from '@lblod/ember-rdfa-editor/utils/ember-node';
|
|
10
|
+
import { getTranslationFunction } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/translation';
|
|
8
11
|
|
|
9
12
|
export const emberNodeConfig: () => EmberNodeConfig = () => {
|
|
10
13
|
return {
|
|
11
14
|
name: 'template-comment',
|
|
12
|
-
|
|
15
|
+
component: TemplateCommentsComponent as unknown as ComponentLike,
|
|
13
16
|
inline: false,
|
|
14
17
|
group: 'block',
|
|
15
18
|
content: '(paragraph|list)+',
|
|
@@ -18,13 +21,19 @@ export const emberNodeConfig: () => EmberNodeConfig = () => {
|
|
|
18
21
|
isolating: true,
|
|
19
22
|
atom: false,
|
|
20
23
|
attrs: {},
|
|
21
|
-
|
|
24
|
+
serialize(_, state) {
|
|
25
|
+
const t = getTranslationFunction(state);
|
|
26
|
+
const heading = t(
|
|
27
|
+
'template-comments-plugin.heading',
|
|
28
|
+
'toelichtingsbepaling',
|
|
29
|
+
);
|
|
30
|
+
|
|
22
31
|
return [
|
|
23
32
|
'div',
|
|
24
33
|
{
|
|
25
34
|
typeof: EXT('TemplateComment').prefixed,
|
|
26
35
|
},
|
|
27
|
-
['h3', {},
|
|
36
|
+
['h3', {}, heading],
|
|
28
37
|
['div', { property: EXT('content').prefixed }, 0],
|
|
29
38
|
];
|
|
30
39
|
},
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
EmberNodeConfig,
|
|
11
11
|
} from '@lblod/ember-rdfa-editor/utils/ember-node';
|
|
12
12
|
import { v4 as uuidv4 } from 'uuid';
|
|
13
|
-
import { DOMOutputSpec, PNode } from '@lblod/ember-rdfa-editor';
|
|
13
|
+
import { DOMOutputSpec, EditorState, PNode } from '@lblod/ember-rdfa-editor';
|
|
14
14
|
import {
|
|
15
15
|
isVariable,
|
|
16
16
|
parseLabel,
|
|
@@ -28,6 +28,9 @@ import {
|
|
|
28
28
|
mappingSpan,
|
|
29
29
|
typeSpan,
|
|
30
30
|
} from '../utils/dom-constructors';
|
|
31
|
+
import AddressNodeviewComponent from '@lblod/ember-rdfa-editor-lblod-plugins/components/variable-plugin/address/nodeview';
|
|
32
|
+
import type { ComponentLike } from '@glint/template';
|
|
33
|
+
import { getTranslationFunction } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/translation';
|
|
31
34
|
|
|
32
35
|
export class Address {
|
|
33
36
|
declare id?: string;
|
|
@@ -245,13 +248,19 @@ const parseDOM = [
|
|
|
245
248
|
},
|
|
246
249
|
];
|
|
247
250
|
|
|
248
|
-
const
|
|
251
|
+
const serialize = (node: PNode, state: EditorState): DOMOutputSpec => {
|
|
252
|
+
const t = getTranslationFunction(state);
|
|
253
|
+
|
|
249
254
|
const { mappingResource, variableInstance, label, value } = node.attrs;
|
|
250
255
|
let contentNode: DOMOutputSpec;
|
|
251
256
|
if (value) {
|
|
252
257
|
contentNode = constructAddressNode(value);
|
|
253
258
|
} else {
|
|
254
|
-
|
|
259
|
+
const placeholder = t(
|
|
260
|
+
'editor-plugins.address.nodeview.placeholder',
|
|
261
|
+
'Voeg adres in',
|
|
262
|
+
);
|
|
263
|
+
contentNode = contentSpan({}, placeholder);
|
|
255
264
|
}
|
|
256
265
|
return mappingSpan(
|
|
257
266
|
mappingResource,
|
|
@@ -266,7 +275,7 @@ const toDOM = (node: PNode): DOMOutputSpec => {
|
|
|
266
275
|
|
|
267
276
|
const emberNodeConfig: EmberNodeConfig = {
|
|
268
277
|
name: 'address',
|
|
269
|
-
|
|
278
|
+
component: AddressNodeviewComponent as unknown as ComponentLike,
|
|
270
279
|
inline: true,
|
|
271
280
|
group: 'inline variable',
|
|
272
281
|
content: 'inline*',
|
|
@@ -278,14 +287,12 @@ const emberNodeConfig: EmberNodeConfig = {
|
|
|
278
287
|
attrs: {
|
|
279
288
|
mappingResource: {},
|
|
280
289
|
variableInstance: {},
|
|
281
|
-
label: {
|
|
282
|
-
default: 'adres',
|
|
283
|
-
},
|
|
290
|
+
label: { default: null },
|
|
284
291
|
value: {
|
|
285
292
|
default: null,
|
|
286
293
|
},
|
|
287
294
|
},
|
|
288
|
-
|
|
295
|
+
serialize,
|
|
289
296
|
parseDOM,
|
|
290
297
|
};
|
|
291
298
|
|
|
@@ -23,6 +23,8 @@ import {
|
|
|
23
23
|
typeSpan,
|
|
24
24
|
} from '../utils/dom-constructors';
|
|
25
25
|
import { span } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/dom-output-spec-helpers';
|
|
26
|
+
import VariableNodeViewComponent from '@lblod/ember-rdfa-editor-lblod-plugins/components/variable-plugin/variable/nodeview';
|
|
27
|
+
import type { ComponentLike } from '@glint/template';
|
|
26
28
|
|
|
27
29
|
const CONTENT_SELECTOR = `span[property~='${EXT('content').prefixed}'],
|
|
28
30
|
span[property~='${EXT('content').full}']`;
|
|
@@ -100,7 +102,7 @@ const toDOM = (node: PNode): DOMOutputSpec => {
|
|
|
100
102
|
|
|
101
103
|
const emberNodeConfig: EmberNodeConfig = {
|
|
102
104
|
name: 'codelist',
|
|
103
|
-
|
|
105
|
+
component: VariableNodeViewComponent as unknown as ComponentLike,
|
|
104
106
|
inline: true,
|
|
105
107
|
group: 'inline variable',
|
|
106
108
|
content: 'inline*',
|
|
@@ -118,9 +120,7 @@ const emberNodeConfig: EmberNodeConfig = {
|
|
|
118
120
|
source: {
|
|
119
121
|
default: null,
|
|
120
122
|
},
|
|
121
|
-
label: {
|
|
122
|
-
default: 'codelijst',
|
|
123
|
-
},
|
|
123
|
+
label: { default: null },
|
|
124
124
|
selectionStyle: {
|
|
125
125
|
default: null,
|
|
126
126
|
},
|