@lblod/ember-rdfa-editor-lblod-plugins 25.2.0 → 25.2.1-dev.3f3b7d0dfbeef50aaf66f35c51097fc42ad192cd
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/.changeset/metal-bags-pump.md +5 -0
- package/.changeset/twelve-mugs-think.md +9 -0
- package/.changeset/wild-walls-turn.md +17 -0
- package/CHANGELOG.md +8 -0
- package/addon/components/lmb-plugin/insert.ts +10 -3
- package/addon/components/lmb-plugin/list.hbs +16 -22
- package/addon/components/lmb-plugin/search-modal.ts +11 -11
- package/addon/components/location-plugin/nodeview.gts +16 -28
- package/addon/components/variable-plugin/address/nodeview.hbs +4 -18
- package/addon/components/variable-plugin/address/nodeview.ts +12 -23
- package/addon/components/variable-plugin/autofilled/insert.gts +3 -2
- package/addon/components/variable-plugin/codelist/insert.ts +1 -1
- package/addon/components/variable-plugin/date/nodeview.hbs +4 -12
- package/addon/components/variable-plugin/date/nodeview.ts +5 -23
- package/addon/components/variable-plugin/location/insert.ts +4 -2
- package/addon/components/variable-plugin/number/nodeview.hbs +4 -19
- package/addon/components/variable-plugin/number/nodeview.ts +12 -10
- package/addon/components/variable-plugin/person/edit.ts +12 -12
- package/addon/components/variable-plugin/person/nodeview.hbs +4 -18
- package/addon/components/variable-plugin/person/nodeview.ts +16 -23
- package/addon/components/variable-plugin/text/insert.ts +1 -1
- package/addon/components/variable-plugin/variable/nodeview.hbs +2 -8
- package/addon/components/variable-plugin/variable/nodeview.ts +16 -7
- package/addon/models/electee.ts +22 -0
- package/addon/plugins/lmb-plugin/index.ts +7 -9
- package/addon/plugins/lmb-plugin/utils/fetchElectees.ts +163 -0
- package/addon/plugins/variable-plugin/variables/autofilled.ts +2 -2
- package/addon/plugins/variable-plugin/variables/location.ts +2 -3
- package/addon/plugins/variable-plugin/variables/person.ts +27 -10
- package/addon/utils/namespace.ts +4 -1
- package/app/styles/variable-plugin.scss +21 -26
- package/declarations/addon/components/lmb-plugin/insert.d.ts +2 -2
- package/declarations/addon/components/lmb-plugin/search-modal.d.ts +6 -6
- package/declarations/addon/components/location-plugin/nodeview.d.ts +2 -3
- package/declarations/addon/components/variable-plugin/address/nodeview.d.ts +2 -8
- package/declarations/addon/components/variable-plugin/date/nodeview.d.ts +2 -6
- package/declarations/addon/components/variable-plugin/number/nodeview.d.ts +2 -4
- package/declarations/addon/components/variable-plugin/person/edit.d.ts +2 -2
- package/declarations/addon/components/variable-plugin/person/nodeview.d.ts +4 -9
- package/declarations/addon/components/variable-plugin/variable/nodeview.d.ts +2 -2
- package/declarations/addon/models/electee.d.ts +10 -0
- package/declarations/addon/plugins/lmb-plugin/index.d.ts +2 -2
- package/declarations/addon/plugins/lmb-plugin/utils/{fetchMandatees.d.ts → fetchElectees.d.ts} +4 -4
- package/declarations/addon/plugins/variable-plugin/variables/person.d.ts +5 -0
- package/package.json +3 -3
- package/pnpm-lock.yaml +24 -17
- package/translations/en-US.yaml +12 -11
- package/translations/nl-BE.yaml +9 -10
- package/addon/components/variable-plugin/autofilled/nodeview.gts +0 -100
- package/addon/components/variable-plugin/location/nodeview.hbs +0 -24
- package/addon/components/variable-plugin/location/nodeview.ts +0 -46
- package/addon/models/mandatee.ts +0 -35
- package/addon/plugins/lmb-plugin/utils/fetchMandatees.ts +0 -143
- package/declarations/addon/components/variable-plugin/autofilled/nodeview.d.ts +0 -22
- package/declarations/addon/components/variable-plugin/location/nodeview.d.ts +0 -11
- package/declarations/addon/models/mandatee.d.ts +0 -13
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import { SearchSort } from '@lblod/ember-rdfa-editor-lblod-plugins/components/lmb-plugin/search-modal';
|
|
2
|
-
import Mandatee from '@lblod/ember-rdfa-editor-lblod-plugins/models/mandatee';
|
|
3
|
-
import { BESTUURSPERIODES } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/constants';
|
|
4
|
-
import {
|
|
5
|
-
executeQuery,
|
|
6
|
-
sparqlEscapeString,
|
|
7
|
-
} from '@lblod/ember-rdfa-editor-lblod-plugins/utils/sparql-helpers';
|
|
8
|
-
|
|
9
|
-
export type FetchMandateesArgs = {
|
|
10
|
-
endpoint: string;
|
|
11
|
-
searchString: string;
|
|
12
|
-
adminUnitSearch: string;
|
|
13
|
-
page: number;
|
|
14
|
-
pageSize: number;
|
|
15
|
-
sort: SearchSort;
|
|
16
|
-
period: (typeof BESTUURSPERIODES)[keyof typeof BESTUURSPERIODES];
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export async function countMandatees({
|
|
20
|
-
endpoint,
|
|
21
|
-
searchString,
|
|
22
|
-
adminUnitSearch,
|
|
23
|
-
period,
|
|
24
|
-
}: Pick<
|
|
25
|
-
FetchMandateesArgs,
|
|
26
|
-
'searchString' | 'endpoint' | 'period' | 'adminUnitSearch'
|
|
27
|
-
>) {
|
|
28
|
-
const query = `
|
|
29
|
-
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>
|
|
30
|
-
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
|
|
31
|
-
PREFIX mandaat: <http://data.vlaanderen.be/ns/mandaat#>
|
|
32
|
-
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
|
|
33
|
-
PREFIX persoon: <http://data.vlaanderen.be/ns/persoon#>
|
|
34
|
-
PREFIX org: <http://www.w3.org/ns/org#>
|
|
35
|
-
PREFIX regorg: <https://www.w3.org/ns/regorg#>
|
|
36
|
-
PREFIX lmb: <http://lblod.data.gift/vocabularies/lmb/>
|
|
37
|
-
SELECT DISTINCT (count(distinct ?mandatee) as ?count) WHERE {
|
|
38
|
-
?mandatee a mandaat:Mandataris;
|
|
39
|
-
org:holds ?mandaat;
|
|
40
|
-
mandaat:status ?status;
|
|
41
|
-
mandaat:isBestuurlijkeAliasVan ?person.
|
|
42
|
-
?person foaf:familyName ?lastName;
|
|
43
|
-
persoon:gebruikteVoornaam ?firstName.
|
|
44
|
-
?status skos:prefLabel ?statusLabel.
|
|
45
|
-
?mandaat org:role ?role.
|
|
46
|
-
?role skos:prefLabel ?roleLabel.
|
|
47
|
-
?bestuursorgaanIT org:hasPost ?mandaat.
|
|
48
|
-
?bestuursorgaanIT lmb:heeftBestuursperiode <${period}>.
|
|
49
|
-
?bestuursorgaanIT mandaat:isTijdspecialisatieVan/besluit:bestuurt/skos:prefLabel ?adminUnitName.
|
|
50
|
-
|
|
51
|
-
${adminUnitSearch.length ? `FILTER(contains(lcase(?adminUnitName), lcase(${sparqlEscapeString(adminUnitSearch)}) )).` : ''}
|
|
52
|
-
${searchString.length ? `FILTER(contains(lcase(concat(?firstName, " ", ?lastName)), lcase(${sparqlEscapeString(searchString)}) )).` : ''}
|
|
53
|
-
}
|
|
54
|
-
`;
|
|
55
|
-
const response = await executeQuery({
|
|
56
|
-
query,
|
|
57
|
-
endpoint,
|
|
58
|
-
});
|
|
59
|
-
console.log(response);
|
|
60
|
-
return Number(response.results.bindings[0].count.value);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export async function fetchMandatees({
|
|
64
|
-
endpoint,
|
|
65
|
-
page,
|
|
66
|
-
pageSize,
|
|
67
|
-
searchString,
|
|
68
|
-
adminUnitSearch,
|
|
69
|
-
sort,
|
|
70
|
-
period,
|
|
71
|
-
}: FetchMandateesArgs) {
|
|
72
|
-
const count = await countMandatees({
|
|
73
|
-
endpoint,
|
|
74
|
-
searchString,
|
|
75
|
-
period,
|
|
76
|
-
adminUnitSearch,
|
|
77
|
-
});
|
|
78
|
-
let sortString = '?lastName ?firstName';
|
|
79
|
-
if (sort) {
|
|
80
|
-
const [key, direction] = sort;
|
|
81
|
-
switch (key) {
|
|
82
|
-
case 'fullName':
|
|
83
|
-
sortString = `${direction}(?lastName) ?firstName`;
|
|
84
|
-
break;
|
|
85
|
-
case 'status':
|
|
86
|
-
sortString = `${direction}(?statusLabel) ?lastName ?firstName`;
|
|
87
|
-
break;
|
|
88
|
-
case 'fractie':
|
|
89
|
-
sortString = `${direction}(?fractieLabel) ?lastName ?firstName`;
|
|
90
|
-
break;
|
|
91
|
-
case 'role':
|
|
92
|
-
sortString = `${direction}(?roleLabel) ?lastName ?firstName`;
|
|
93
|
-
break;
|
|
94
|
-
|
|
95
|
-
default:
|
|
96
|
-
break;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
const query = `
|
|
101
|
-
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>
|
|
102
|
-
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
|
|
103
|
-
PREFIX mandaat: <http://data.vlaanderen.be/ns/mandaat#>
|
|
104
|
-
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
|
|
105
|
-
PREFIX persoon: <http://data.vlaanderen.be/ns/persoon#>
|
|
106
|
-
PREFIX org: <http://www.w3.org/ns/org#>
|
|
107
|
-
PREFIX regorg: <https://www.w3.org/ns/regorg#>
|
|
108
|
-
PREFIX lmb: <http://lblod.data.gift/vocabularies/lmb/>
|
|
109
|
-
SELECT DISTINCT ?mandatee ?person ?firstName ?lastName ?statusLabel ?fractieLabel ?roleLabel WHERE {
|
|
110
|
-
{
|
|
111
|
-
?mandatee a mandaat:Mandataris;
|
|
112
|
-
org:holds ?mandaat;
|
|
113
|
-
mandaat:status ?status;
|
|
114
|
-
mandaat:isBestuurlijkeAliasVan ?person.
|
|
115
|
-
?person foaf:familyName ?lastName;
|
|
116
|
-
persoon:gebruikteVoornaam ?firstName.
|
|
117
|
-
?status skos:prefLabel ?statusLabel.
|
|
118
|
-
?mandaat org:role ?role.
|
|
119
|
-
?role skos:prefLabel ?roleLabel.
|
|
120
|
-
?bestuursorgaanIT org:hasPost ?mandaat.
|
|
121
|
-
?bestuursorgaanIT lmb:heeftBestuursperiode <${period}>.
|
|
122
|
-
?bestuursorgaanIT mandaat:isTijdspecialisatieVan/besluit:bestuurt/skos:prefLabel ?adminUnitName.
|
|
123
|
-
}
|
|
124
|
-
OPTIONAL {
|
|
125
|
-
?mandatee org:hasMembership ?membership.
|
|
126
|
-
?membership org:organisation ?fractie.
|
|
127
|
-
?fractie regorg:legalName ?fractieLabel.
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
${adminUnitSearch.length ? `FILTER(contains(lcase(?adminUnitName), lcase(${sparqlEscapeString(adminUnitSearch)}) )).` : ''}
|
|
131
|
-
${searchString.length ? `FILTER(contains(lcase(concat(?firstName, "", ?lastName)), lcase(${sparqlEscapeString(searchString)}) )).` : ''}
|
|
132
|
-
}
|
|
133
|
-
ORDER BY ${sortString}
|
|
134
|
-
LIMIT ${pageSize} OFFSET ${page * pageSize}
|
|
135
|
-
`;
|
|
136
|
-
const response = await executeQuery({
|
|
137
|
-
query,
|
|
138
|
-
endpoint,
|
|
139
|
-
});
|
|
140
|
-
console.log(response.results.bindings);
|
|
141
|
-
const mandatees = response.results.bindings.map(Mandatee.fromBinding);
|
|
142
|
-
return { mandatees, count };
|
|
143
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import Component from '@glimmer/component';
|
|
2
|
-
import { PNode, ProsePlugin, SayController, SayView } from '@lblod/ember-rdfa-editor';
|
|
3
|
-
import { EmberNodeArgs, SayNodeViewConstructor } from '@lblod/ember-rdfa-editor/utils/ember-node';
|
|
4
|
-
type Args = EmberNodeArgs & {
|
|
5
|
-
getPos: () => number | undefined;
|
|
6
|
-
node: PNode;
|
|
7
|
-
updateAttribute: (attr: string, value: unknown) => void;
|
|
8
|
-
controller: SayController;
|
|
9
|
-
view: SayView;
|
|
10
|
-
selected: boolean;
|
|
11
|
-
selectNode: () => void;
|
|
12
|
-
nodeViews: Record<string, SayNodeViewConstructor>;
|
|
13
|
-
};
|
|
14
|
-
export default class AutoFilledVariableNodeViewComponent extends Component<Args> {
|
|
15
|
-
PencilIcon: TOC<import("@appuniversum/ember-appuniversum/components/icons/pencil").PencilIconSignature>;
|
|
16
|
-
innerView?: SayView;
|
|
17
|
-
get plugins(): ProsePlugin[];
|
|
18
|
-
onClick(): void;
|
|
19
|
-
initEditor(view: SayView): void;
|
|
20
|
-
get label(): string | undefined;
|
|
21
|
-
}
|
|
22
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import Component from '@glimmer/component';
|
|
2
|
-
import { ProsePlugin, SayView } from '@lblod/ember-rdfa-editor';
|
|
3
|
-
import { EmberNodeArgs } from '@lblod/ember-rdfa-editor/utils/ember-node';
|
|
4
|
-
export default class LocationNodeViewComponent extends Component<EmberNodeArgs> {
|
|
5
|
-
PencilIcon: TOC<import("@appuniversum/ember-appuniversum/components/icons/pencil").PencilIconSignature>;
|
|
6
|
-
innerView?: SayView;
|
|
7
|
-
get plugins(): ProsePlugin[];
|
|
8
|
-
onClick(): void;
|
|
9
|
-
initEditor(view: SayView): void;
|
|
10
|
-
get label(): string;
|
|
11
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { IBindings } from 'fetch-sparql-endpoint';
|
|
2
|
-
export default class Mandatee {
|
|
3
|
-
readonly personUri: string;
|
|
4
|
-
readonly mandateeUri: string;
|
|
5
|
-
readonly firstName: string;
|
|
6
|
-
readonly lastName: string;
|
|
7
|
-
readonly fullName: string;
|
|
8
|
-
readonly status: string;
|
|
9
|
-
readonly role: string;
|
|
10
|
-
readonly fractie: string;
|
|
11
|
-
constructor(personUri: string, mandateeUri: string, firstName: string, lastName: string, fullName: string, status: string, role: string, fractie: string);
|
|
12
|
-
static fromBinding(binding: IBindings): Mandatee;
|
|
13
|
-
}
|