@lblod/ember-rdfa-editor-lblod-plugins 25.2.2 → 26.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/CHANGELOG.md +36 -0
- package/addon/components/lmb-plugin/insert.ts +17 -5
- package/addon/components/lmb-plugin/list.hbs +16 -22
- package/addon/components/lmb-plugin/search-modal.ts +11 -11
- package/addon/components/location-plugin/insert.gts +2 -0
- package/addon/components/mandatee-table-plugin/node.gts +13 -4
- package/addon/components/structure-plugin/_private/structure.gts +1 -16
- package/addon/components/variable-plugin/address/insert-variable.ts +2 -0
- package/addon/components/variable-plugin/address/insert.ts +2 -0
- package/addon/components/variable-plugin/address/utils.ts +7 -2
- package/addon/components/variable-plugin/autofilled/insert.gts +7 -2
- package/addon/components/variable-plugin/codelist/insert.ts +7 -2
- package/addon/components/variable-plugin/date/insert-variable.ts +7 -2
- package/addon/components/variable-plugin/date/insert.ts +7 -3
- package/addon/components/variable-plugin/insert-variable-card.hbs +1 -0
- package/addon/components/variable-plugin/location/insert.ts +7 -2
- package/addon/components/variable-plugin/number/insert.ts +7 -2
- package/addon/components/variable-plugin/person/edit.ts +12 -12
- package/addon/components/variable-plugin/person/insert.ts +7 -2
- package/addon/components/variable-plugin/person/nodeview.ts +7 -7
- package/addon/components/variable-plugin/text/insert.ts +7 -2
- 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/location-plugin/utils/node-utils.ts +7 -3
- package/addon/plugins/variable-plugin/recreateUuidsOnPaste.ts +11 -3
- package/addon/plugins/variable-plugin/variables/person.ts +31 -11
- package/app/styles/mandatee-table-plugin.scss +5 -2
- package/app/styles/structure-plugin.scss +0 -12
- package/declarations/addon/components/lmb-plugin/insert.d.ts +3 -2
- package/declarations/addon/components/lmb-plugin/search-modal.d.ts +6 -6
- package/declarations/addon/components/location-plugin/insert.d.ts +1 -0
- package/declarations/addon/components/structure-plugin/_private/structure.d.ts +0 -1
- package/declarations/addon/components/variable-plugin/address/insert-variable.d.ts +1 -0
- package/declarations/addon/components/variable-plugin/address/insert.d.ts +1 -0
- package/declarations/addon/components/variable-plugin/address/utils.d.ts +1 -1
- package/declarations/addon/components/variable-plugin/autofilled/insert.d.ts +1 -0
- package/declarations/addon/components/variable-plugin/codelist/insert.d.ts +1 -0
- package/declarations/addon/components/variable-plugin/date/insert-variable.d.ts +1 -0
- package/declarations/addon/components/variable-plugin/date/insert.d.ts +1 -0
- package/declarations/addon/components/variable-plugin/location/insert.d.ts +1 -0
- package/declarations/addon/components/variable-plugin/number/insert.d.ts +1 -0
- package/declarations/addon/components/variable-plugin/person/edit.d.ts +2 -2
- package/declarations/addon/components/variable-plugin/person/insert.d.ts +1 -0
- package/declarations/addon/components/variable-plugin/person/nodeview.d.ts +2 -2
- package/declarations/addon/components/variable-plugin/text/insert.d.ts +1 -0
- 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/location-plugin/utils/node-utils.d.ts +1 -1
- package/declarations/addon/plugins/variable-plugin/variables/person.d.ts +5 -0
- package/package.json +1 -1
- package/translations/en-US.yaml +8 -7
- package/translations/nl-BE.yaml +5 -7
- package/addon/models/mandatee.ts +0 -35
- package/addon/plugins/lmb-plugin/utils/fetchMandatees.ts +0 -143
- package/declarations/addon/models/mandatee.d.ts +0 -13
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IBindings } from 'fetch-sparql-endpoint';
|
|
2
|
+
import { unwrap } from '../utils/option';
|
|
3
|
+
|
|
4
|
+
export default class Electee {
|
|
5
|
+
constructor(
|
|
6
|
+
readonly uri: string,
|
|
7
|
+
readonly firstName: string,
|
|
8
|
+
readonly lastName: string,
|
|
9
|
+
readonly kandidatenlijst?: string,
|
|
10
|
+
) {}
|
|
11
|
+
static fromBinding(binding: IBindings) {
|
|
12
|
+
const uri = unwrap(binding['person'].value);
|
|
13
|
+
const firstName = unwrap(binding['firstName'].value);
|
|
14
|
+
const lastName = unwrap(binding['lastName'].value);
|
|
15
|
+
const kandidatenlijst = binding['kandidatenlijstLabel']?.value;
|
|
16
|
+
return new Electee(uri, firstName, lastName, kandidatenlijst);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
get fullName() {
|
|
20
|
+
return `${this.firstName} ${this.lastName}`;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SayController } from '@lblod/ember-rdfa-editor';
|
|
2
|
-
import Mandatee from '@lblod/ember-rdfa-editor-lblod-plugins/models/mandatee';
|
|
3
2
|
import { BestuursperiodeLabel } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/constants';
|
|
3
|
+
import { Person } from '../variable-plugin/variables';
|
|
4
4
|
|
|
5
5
|
export type LmbPluginConfig = {
|
|
6
6
|
endpoint: string;
|
|
@@ -8,18 +8,16 @@ export type LmbPluginConfig = {
|
|
|
8
8
|
defaultAdminUnit?: string;
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
-
export function
|
|
12
|
-
controller: SayController,
|
|
13
|
-
mandatee: Mandatee,
|
|
14
|
-
) {
|
|
11
|
+
export function createPersonNode(controller: SayController, person: Person) {
|
|
15
12
|
const schema = controller.schema;
|
|
16
|
-
const
|
|
13
|
+
const fullName = `${person.firstName} ${person.lastName}`;
|
|
14
|
+
const electeeNode = schema.node(
|
|
17
15
|
'inline_rdfa',
|
|
18
16
|
{
|
|
19
17
|
rdfaNodeType: 'resource',
|
|
20
|
-
subject:
|
|
18
|
+
subject: person.uri,
|
|
21
19
|
},
|
|
22
|
-
[schema.text(`${
|
|
20
|
+
[schema.text(`${fullName}`)],
|
|
23
21
|
);
|
|
24
|
-
return
|
|
22
|
+
return electeeNode;
|
|
25
23
|
}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { SearchSort } from '@lblod/ember-rdfa-editor-lblod-plugins/components/lmb-plugin/search-modal';
|
|
2
|
+
import Electee from '@lblod/ember-rdfa-editor-lblod-plugins/models/electee';
|
|
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 countElectees({
|
|
20
|
+
endpoint,
|
|
21
|
+
searchString,
|
|
22
|
+
adminUnitSearch,
|
|
23
|
+
period,
|
|
24
|
+
}: Pick<
|
|
25
|
+
FetchMandateesArgs,
|
|
26
|
+
'searchString' | 'endpoint' | 'period' | 'adminUnitSearch'
|
|
27
|
+
>) {
|
|
28
|
+
const query = /* sparql */ `
|
|
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 person: <http://www.w3.org/ns/person#>
|
|
35
|
+
PREFIX lmb: <http://lblod.data.gift/vocabularies/lmb/>
|
|
36
|
+
PREFIX org: <http://www.w3.org/ns/org#>
|
|
37
|
+
|
|
38
|
+
SELECT (COUNT(DISTINCT ?person) as ?count) WHERE {
|
|
39
|
+
?person a person:Person;
|
|
40
|
+
foaf:familyName ?lastName;
|
|
41
|
+
persoon:gebruikteVoornaam ?firstName.
|
|
42
|
+
|
|
43
|
+
?bestuursorgaanIT lmb:heeftBestuursperiode <${period}>;
|
|
44
|
+
mandaat:isTijdspecialisatieVan/besluit:bestuurt/skos:prefLabel ?adminUnitName.
|
|
45
|
+
{
|
|
46
|
+
?verkiezing mandaat:steltSamen ?bestuursorgaanIT.
|
|
47
|
+
?kandidatenlijst mandaat:behoortTot ?verkiezing.
|
|
48
|
+
|
|
49
|
+
?verkiezingsresultaat mandaat:isResultaatVoor ?kandidatenlijst.
|
|
50
|
+
?verkiezingsresultaat mandaat:isResultaatVan ?person.
|
|
51
|
+
}
|
|
52
|
+
UNION
|
|
53
|
+
{
|
|
54
|
+
?mandatee a mandaat:Mandataris;
|
|
55
|
+
org:holds ?mandaat;
|
|
56
|
+
mandaat:isBestuurlijkeAliasVan ?person.
|
|
57
|
+
?bestuursorgaanIT org:hasPost ?mandaat.
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
${adminUnitSearch.length ? `FILTER(contains(lcase(?adminUnitName), lcase(${sparqlEscapeString(adminUnitSearch)}) )).` : ''}
|
|
61
|
+
${searchString.length ? `FILTER(contains(lcase(concat(?firstName, " ", ?lastName)), lcase(${sparqlEscapeString(searchString)}) )).` : ''}
|
|
62
|
+
}
|
|
63
|
+
`;
|
|
64
|
+
const response = await executeQuery({
|
|
65
|
+
query,
|
|
66
|
+
endpoint,
|
|
67
|
+
});
|
|
68
|
+
return Number(response.results.bindings[0].count.value);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export async function fetchElectees({
|
|
72
|
+
endpoint,
|
|
73
|
+
page,
|
|
74
|
+
pageSize,
|
|
75
|
+
searchString,
|
|
76
|
+
adminUnitSearch,
|
|
77
|
+
sort,
|
|
78
|
+
period,
|
|
79
|
+
}: FetchMandateesArgs) {
|
|
80
|
+
const count = await countElectees({
|
|
81
|
+
endpoint,
|
|
82
|
+
searchString,
|
|
83
|
+
period,
|
|
84
|
+
adminUnitSearch,
|
|
85
|
+
});
|
|
86
|
+
let sortString = '?lastName ?firstName';
|
|
87
|
+
if (sort) {
|
|
88
|
+
const [key, direction] = sort;
|
|
89
|
+
switch (key) {
|
|
90
|
+
case 'fullName':
|
|
91
|
+
sortString = `${direction}(?lastName) ?firstName`;
|
|
92
|
+
break;
|
|
93
|
+
case 'kandidatenlijst':
|
|
94
|
+
sortString = `${direction}(?kandidatenlijstLabel) ?lastName ?firstName`;
|
|
95
|
+
break;
|
|
96
|
+
default:
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* This query fetches two types of people:
|
|
103
|
+
* - People who have participated in the elections (and may or may not have a mandatee)
|
|
104
|
+
* - People who have a mandatee
|
|
105
|
+
* (here we filter out the ones who participated in the elections as we don't want to get duplicates)
|
|
106
|
+
*/
|
|
107
|
+
const query = /* sparql */ `
|
|
108
|
+
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>
|
|
109
|
+
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
|
|
110
|
+
PREFIX mandaat: <http://data.vlaanderen.be/ns/mandaat#>
|
|
111
|
+
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
|
|
112
|
+
PREFIX persoon: <http://data.vlaanderen.be/ns/persoon#>
|
|
113
|
+
PREFIX person: <http://www.w3.org/ns/person#>
|
|
114
|
+
PREFIX lmb: <http://lblod.data.gift/vocabularies/lmb/>
|
|
115
|
+
PREFIX org: <http://www.w3.org/ns/org#>
|
|
116
|
+
|
|
117
|
+
SELECT DISTINCT ?person ?firstName ?lastName ?kandidatenlijstLabel WHERE {
|
|
118
|
+
?person a person:Person;
|
|
119
|
+
foaf:familyName ?lastName;
|
|
120
|
+
persoon:gebruikteVoornaam ?firstName.
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
?bestuursorgaanIT lmb:heeftBestuursperiode <${period}>;
|
|
124
|
+
mandaat:isTijdspecialisatieVan/besluit:bestuurt/skos:prefLabel ?adminUnitName.
|
|
125
|
+
{
|
|
126
|
+
?verkiezing mandaat:steltSamen ?bestuursorgaanIT.
|
|
127
|
+
?kandidatenlijst mandaat:behoortTot ?verkiezing.
|
|
128
|
+
?kandidatenlijst skos:prefLabel ?kandidatenlijstLabel.
|
|
129
|
+
|
|
130
|
+
?verkiezingsresultaat mandaat:isResultaatVoor ?kandidatenlijst.
|
|
131
|
+
?verkiezingsresultaat mandaat:isResultaatVan ?person.
|
|
132
|
+
}
|
|
133
|
+
UNION
|
|
134
|
+
{
|
|
135
|
+
?mandatee a mandaat:Mandataris;
|
|
136
|
+
org:holds ?mandaat;
|
|
137
|
+
mandaat:isBestuurlijkeAliasVan ?person.
|
|
138
|
+
?bestuursorgaanIT org:hasPost ?mandaat.
|
|
139
|
+
|
|
140
|
+
FILTER NOT EXISTS {
|
|
141
|
+
?_bestuursorgaanIT lmb:heeftBestuursperiode <${period}>.
|
|
142
|
+
?verkiezing mandaat:steltSamen ?_bestuursorgaanIT.
|
|
143
|
+
?kandidatenlijst mandaat:behoortTot ?verkiezing.
|
|
144
|
+
?kandidatenlijst skos:prefLabel ?kandidatenlijstLabel.
|
|
145
|
+
|
|
146
|
+
?verkiezingsresultaat mandaat:isResultaatVoor ?kandidatenlijst.
|
|
147
|
+
?verkiezingsresultaat mandaat:isResultaatVan ?person.
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
${adminUnitSearch.length ? `FILTER(contains(lcase(?adminUnitName), lcase(${sparqlEscapeString(adminUnitSearch)}) )).` : ''}
|
|
152
|
+
${searchString.length ? `FILTER(contains(lcase(concat(?firstName, " ", ?lastName)), lcase(${sparqlEscapeString(searchString)}) )).` : ''}
|
|
153
|
+
}
|
|
154
|
+
ORDER BY ${sortString}
|
|
155
|
+
LIMIT ${pageSize} OFFSET ${page * pageSize}
|
|
156
|
+
`;
|
|
157
|
+
const response = await executeQuery({
|
|
158
|
+
query,
|
|
159
|
+
endpoint,
|
|
160
|
+
});
|
|
161
|
+
const electees = response.results.bindings.map(Electee.fromBinding);
|
|
162
|
+
return { electees, count };
|
|
163
|
+
}
|
|
@@ -10,10 +10,14 @@ import { v4 as uuidv4 } from 'uuid';
|
|
|
10
10
|
export function replaceSelectionWithAddress(
|
|
11
11
|
controller: SayController,
|
|
12
12
|
label?: string,
|
|
13
|
+
templateMode?: boolean,
|
|
13
14
|
) {
|
|
14
|
-
const mappingResource = `http://data.lblod.info/mappings/${
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
const mappingResource = `http://data.lblod.info/mappings/${
|
|
16
|
+
templateMode ? '--ref-uuid4-' : ''
|
|
17
|
+
}$${uuidv4()}`;
|
|
18
|
+
const variableInstance = `http://data.lblod.info/variables/${
|
|
19
|
+
templateMode ? '--ref-uuid4-' : ''
|
|
20
|
+
}$${uuidv4()}`;
|
|
17
21
|
controller.withTransaction((tr) => {
|
|
18
22
|
tr.replaceSelectionWith(
|
|
19
23
|
controller.schema.node('oslo_location', {
|
|
@@ -73,11 +73,19 @@ function recreateUuidsOnNode(node: Node, schema: Schema) {
|
|
|
73
73
|
|
|
74
74
|
attrs.properties = (attrs.properties as OutgoingTriple[]).map((prop) => {
|
|
75
75
|
if (prop.predicate === EXT('instance').full) {
|
|
76
|
+
let recreatedUri;
|
|
77
|
+
if (
|
|
78
|
+
prop.object.value.includes(
|
|
79
|
+
'http://data.lblod.info/variables/--ref-uuid4-',
|
|
80
|
+
)
|
|
81
|
+
) {
|
|
82
|
+
recreatedUri = `http://data.lblod.info/variables/--ref-uuid4-${uuidv4()}`;
|
|
83
|
+
} else {
|
|
84
|
+
recreatedUri = `http://data.lblod.info/variables/${uuidv4()}`;
|
|
85
|
+
}
|
|
76
86
|
return {
|
|
77
87
|
predicate: prop.predicate,
|
|
78
|
-
object: sayDataFactory.namedNode(
|
|
79
|
-
`http://data.lblod.info/variables/${uuidv4()}`,
|
|
80
|
-
),
|
|
88
|
+
object: sayDataFactory.namedNode(recreatedUri),
|
|
81
89
|
};
|
|
82
90
|
}
|
|
83
91
|
|
|
@@ -19,13 +19,18 @@ import PersonNodeViewComponent from '@lblod/ember-rdfa-editor-lblod-plugins/comp
|
|
|
19
19
|
import type { ComponentLike } from '@glint/template';
|
|
20
20
|
import { hasOutgoingNamedNodeTriple } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/namespace';
|
|
21
21
|
import { renderRdfaAware } from '@lblod/ember-rdfa-editor/core/schema';
|
|
22
|
-
import Mandatee from '@lblod/ember-rdfa-editor-lblod-plugins/models/mandatee';
|
|
23
22
|
import { getTranslationFunction } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/translation';
|
|
24
23
|
|
|
25
24
|
const TRANSLATION_FALLBACKS = {
|
|
26
25
|
nodeview_placeholder: 'persoon',
|
|
27
26
|
};
|
|
28
27
|
|
|
28
|
+
export type Person = {
|
|
29
|
+
uri: string;
|
|
30
|
+
firstName: string;
|
|
31
|
+
lastName: string;
|
|
32
|
+
};
|
|
33
|
+
|
|
29
34
|
const rdfaAware = true;
|
|
30
35
|
const parseDOM = [
|
|
31
36
|
{
|
|
@@ -44,9 +49,28 @@ const parseDOM = [
|
|
|
44
49
|
if (attrs.rdfaNodeType !== 'resource') {
|
|
45
50
|
return false;
|
|
46
51
|
}
|
|
52
|
+
let value: Person | undefined;
|
|
53
|
+
if (node.dataset.value) {
|
|
54
|
+
value = JSON.parse(node.dataset.value) as Person | undefined;
|
|
55
|
+
} else if (node.dataset.mandatee) {
|
|
56
|
+
const mandatee = JSON.parse(node.dataset.mandatee) as
|
|
57
|
+
| {
|
|
58
|
+
personUri: string;
|
|
59
|
+
firstName: string;
|
|
60
|
+
lastName: string;
|
|
61
|
+
}
|
|
62
|
+
| undefined;
|
|
63
|
+
if (mandatee) {
|
|
64
|
+
value = {
|
|
65
|
+
uri: mandatee.personUri,
|
|
66
|
+
firstName: mandatee.firstName,
|
|
67
|
+
lastName: mandatee.lastName,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
}
|
|
47
71
|
return {
|
|
48
72
|
...attrs,
|
|
49
|
-
|
|
73
|
+
value,
|
|
50
74
|
};
|
|
51
75
|
}
|
|
52
76
|
|
|
@@ -58,16 +82,15 @@ const parseDOM = [
|
|
|
58
82
|
|
|
59
83
|
const serialize = (node: PNode, state: EditorState): DOMOutputSpec => {
|
|
60
84
|
const t = getTranslationFunction(state);
|
|
61
|
-
const
|
|
85
|
+
const person = node.attrs.value as Person | undefined;
|
|
62
86
|
return renderRdfaAware({
|
|
63
87
|
renderable: node,
|
|
64
88
|
tag: 'span',
|
|
65
89
|
attrs: {
|
|
66
|
-
|
|
67
|
-
'data-mandatee': JSON.stringify(mandatee),
|
|
90
|
+
'data-value': JSON.stringify(person),
|
|
68
91
|
},
|
|
69
|
-
content:
|
|
70
|
-
? `${
|
|
92
|
+
content: person
|
|
93
|
+
? `${person.firstName} ${person.lastName}`
|
|
71
94
|
: t(
|
|
72
95
|
'variable-plugin.person.nodeview-placeholder',
|
|
73
96
|
TRANSLATION_FALLBACKS.nodeview_placeholder,
|
|
@@ -90,10 +113,7 @@ const emberNodeConfig: EmberNodeConfig = {
|
|
|
90
113
|
selectable: true,
|
|
91
114
|
attrs: {
|
|
92
115
|
...rdfaAttrSpec({ rdfaAware }),
|
|
93
|
-
|
|
94
|
-
default: null,
|
|
95
|
-
},
|
|
96
|
-
mandatee: {
|
|
116
|
+
value: {
|
|
97
117
|
default: null,
|
|
98
118
|
},
|
|
99
119
|
},
|
|
@@ -9,12 +9,15 @@
|
|
|
9
9
|
cursor: default;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
.say-mandatee-table__warning {
|
|
13
|
+
.au-c-alert__content {
|
|
14
|
+
margin-top: 0;
|
|
15
|
+
}
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
.say-mandatee-table-content {
|
|
17
19
|
padding: 1.2rem;
|
|
20
|
+
margin-top: 0;
|
|
18
21
|
}
|
|
19
22
|
|
|
20
23
|
.say-mandatee-table__title {
|
|
@@ -46,18 +46,6 @@
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
.say-structure__content.say-empty {
|
|
50
|
-
[data-ember-node-content] {
|
|
51
|
-
p::before {
|
|
52
|
-
color: var(--au-gray-400);
|
|
53
|
-
content: 'Fill in content...';
|
|
54
|
-
float: left;
|
|
55
|
-
height: 0;
|
|
56
|
-
pointer-events: none;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
49
|
.ember-node.say-active:has(> .say-structure) {
|
|
62
50
|
outline: none;
|
|
63
51
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
import { SayController } from '@lblod/ember-rdfa-editor';
|
|
3
3
|
import { LmbPluginConfig } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/lmb-plugin';
|
|
4
|
-
import
|
|
4
|
+
import Electee from '@lblod/ember-rdfa-editor-lblod-plugins/models/electee';
|
|
5
5
|
import IntlService from 'ember-intl/services/intl';
|
|
6
6
|
interface Args {
|
|
7
7
|
controller: SayController;
|
|
8
8
|
config: LmbPluginConfig;
|
|
9
|
+
templateMode?: boolean;
|
|
9
10
|
}
|
|
10
11
|
export default class LmbPluginInsertComponent extends Component<Args> {
|
|
11
12
|
intl: IntlService;
|
|
@@ -14,6 +15,6 @@ export default class LmbPluginInsertComponent extends Component<Args> {
|
|
|
14
15
|
get controller(): SayController;
|
|
15
16
|
openModal(): void;
|
|
16
17
|
closeModal(): void;
|
|
17
|
-
onInsert(
|
|
18
|
+
onInsert(electee: Electee): void;
|
|
18
19
|
}
|
|
19
20
|
export {};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
import { LmbPluginConfig } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/lmb-plugin';
|
|
3
|
-
import
|
|
4
|
-
import { FetchMandateesArgs } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/lmb-plugin/utils/
|
|
3
|
+
import Electee from '@lblod/ember-rdfa-editor-lblod-plugins/models/electee';
|
|
4
|
+
import { FetchMandateesArgs } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/lmb-plugin/utils/fetchElectees';
|
|
5
5
|
import { BestuursperiodeLabel, BestuursperiodeURI } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/constants';
|
|
6
|
-
export type SearchSort = [keyof
|
|
6
|
+
export type SearchSort = [keyof Electee, 'ASC' | 'DESC'] | false;
|
|
7
7
|
interface Args {
|
|
8
8
|
config: LmbPluginConfig;
|
|
9
9
|
open: boolean;
|
|
10
10
|
closeModal: () => void;
|
|
11
|
-
onInsert: (
|
|
11
|
+
onInsert: (electee: Electee) => void;
|
|
12
12
|
}
|
|
13
13
|
interface AdminPeriodOption {
|
|
14
14
|
label: BestuursperiodeLabel;
|
|
@@ -31,7 +31,7 @@ export default class LmbPluginSearchModalComponent extends Component<Args> {
|
|
|
31
31
|
setAdminUnitSearch: (event: InputEvent) => void;
|
|
32
32
|
closeModal(): Promise<void>;
|
|
33
33
|
search: import("ember-concurrency").TaskForAsyncTaskFunction<unknown, ({ endpoint, searchString, page, pageSize, sort, period, adminUnitSearch, }: FetchMandateesArgs) => Promise<{
|
|
34
|
-
results:
|
|
34
|
+
results: Electee[];
|
|
35
35
|
totalCount: number;
|
|
36
36
|
}>>;
|
|
37
37
|
servicesResource: import("reactiveweb/ember-concurrency").TaskInstance<unknown>;
|
|
@@ -39,6 +39,6 @@ export default class LmbPluginSearchModalComponent extends Component<Args> {
|
|
|
39
39
|
setInputSearchText(event: InputEvent): void;
|
|
40
40
|
previousPage(): void;
|
|
41
41
|
nextPage(): void;
|
|
42
|
-
onInsert(
|
|
42
|
+
onInsert(electee: Electee): Promise<void>;
|
|
43
43
|
}
|
|
44
44
|
export {};
|
|
@@ -19,7 +19,6 @@ export default class Structure extends Component<Sig> {
|
|
|
19
19
|
get showPlaceholder(): boolean;
|
|
20
20
|
get controller(): import("@lblod/ember-rdfa-editor").SayController;
|
|
21
21
|
get node(): import("prosemirror-model").Node;
|
|
22
|
-
get isEmpty(): boolean;
|
|
23
22
|
get tag(): string;
|
|
24
23
|
get titleAttr(): any;
|
|
25
24
|
get headerTag(): any;
|
|
@@ -3,6 +3,7 @@ import { SayController } from '@lblod/ember-rdfa-editor';
|
|
|
3
3
|
import IntlService from 'ember-intl/services/intl';
|
|
4
4
|
type Args = {
|
|
5
5
|
controller: SayController;
|
|
6
|
+
templateMode?: boolean;
|
|
6
7
|
};
|
|
7
8
|
export default class VariablePluginAddressInsertVariableComponent extends Component<Args> {
|
|
8
9
|
intl: IntlService;
|
|
@@ -3,6 +3,7 @@ import { SayController } from '@lblod/ember-rdfa-editor';
|
|
|
3
3
|
import IntlService from 'ember-intl/services/intl';
|
|
4
4
|
type Args = {
|
|
5
5
|
controller: SayController;
|
|
6
|
+
templateMode?: boolean;
|
|
6
7
|
};
|
|
7
8
|
export default class InsertAddressComponent extends Component<Args> {
|
|
8
9
|
AddIcon: TOC<import("@appuniversum/ember-appuniversum/components/icons/add").AddIconSignature>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { SayController } from '@lblod/ember-rdfa-editor';
|
|
2
|
-
export declare function replaceSelectionWithAddress(controller: SayController, label?: string): void;
|
|
2
|
+
export declare function replaceSelectionWithAddress(controller: SayController, label?: string, templateMode?: boolean): void;
|
|
@@ -3,6 +3,7 @@ import { type SayController } from '@lblod/ember-rdfa-editor';
|
|
|
3
3
|
import IntlService from 'ember-intl/services/intl';
|
|
4
4
|
type Args = {
|
|
5
5
|
controller: SayController;
|
|
6
|
+
templateMode?: boolean;
|
|
6
7
|
};
|
|
7
8
|
export default class AutoFilledVariableInsertComponent extends Component<Args> {
|
|
8
9
|
intl: IntlService;
|
|
@@ -3,6 +3,7 @@ import { SayController } from '@lblod/ember-rdfa-editor';
|
|
|
3
3
|
import IntlService from 'ember-intl/services/intl';
|
|
4
4
|
type Args = {
|
|
5
5
|
controller: SayController;
|
|
6
|
+
templateMode?: boolean;
|
|
6
7
|
};
|
|
7
8
|
export default class DateInsertVariableComponent extends Component<Args> {
|
|
8
9
|
intl: IntlService;
|
|
@@ -3,6 +3,7 @@ import { SayController } from '@lblod/ember-rdfa-editor';
|
|
|
3
3
|
import IntlService from 'ember-intl/services/intl';
|
|
4
4
|
type Args = {
|
|
5
5
|
controller: SayController;
|
|
6
|
+
templateMode?: boolean;
|
|
6
7
|
};
|
|
7
8
|
export default class DateInsertComponent extends Component<Args> {
|
|
8
9
|
AddIcon: TOC<import("@appuniversum/ember-appuniversum/components/icons/add").AddIconSignature>;
|
|
@@ -3,6 +3,7 @@ import { SayController } from '@lblod/ember-rdfa-editor';
|
|
|
3
3
|
import IntlService from 'ember-intl/services/intl';
|
|
4
4
|
type Args = {
|
|
5
5
|
controller: SayController;
|
|
6
|
+
templateMode?: boolean;
|
|
6
7
|
};
|
|
7
8
|
export default class NumberInsertComponent extends Component<Args> {
|
|
8
9
|
intl: IntlService;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
import { SayController, PNode } from '@lblod/ember-rdfa-editor';
|
|
3
3
|
import { LmbPluginConfig } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/lmb-plugin';
|
|
4
|
-
import
|
|
4
|
+
import Electee from '@lblod/ember-rdfa-editor-lblod-plugins/models/electee';
|
|
5
5
|
type Args = {
|
|
6
6
|
controller: SayController;
|
|
7
7
|
config: LmbPluginConfig;
|
|
@@ -18,6 +18,6 @@ export default class PersonEditComponent extends Component<Args> {
|
|
|
18
18
|
get isEditing(): boolean;
|
|
19
19
|
openModal(): void;
|
|
20
20
|
closeModal(): void;
|
|
21
|
-
onInsert(
|
|
21
|
+
onInsert(electee: Electee): void;
|
|
22
22
|
}
|
|
23
23
|
export {};
|
|
@@ -3,6 +3,7 @@ import { type SayController } from '@lblod/ember-rdfa-editor';
|
|
|
3
3
|
import IntlService from 'ember-intl/services/intl';
|
|
4
4
|
type Args = {
|
|
5
5
|
controller: SayController;
|
|
6
|
+
templateMode?: boolean;
|
|
6
7
|
};
|
|
7
8
|
export default class PersonVariableInsertComponent extends Component<Args> {
|
|
8
9
|
intl: IntlService;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
import { PNode, SayController } from '@lblod/ember-rdfa-editor';
|
|
3
|
-
import
|
|
3
|
+
import { Person } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/variable-plugin/variables';
|
|
4
4
|
type Args = {
|
|
5
5
|
getPos: () => number | undefined;
|
|
6
6
|
node: PNode;
|
|
@@ -9,7 +9,7 @@ type Args = {
|
|
|
9
9
|
export default class PersonNodeviewComponent extends Component<Args> {
|
|
10
10
|
get controller(): SayController;
|
|
11
11
|
get node(): PNode;
|
|
12
|
-
get
|
|
12
|
+
get person(): Person | null;
|
|
13
13
|
get label(): string | undefined;
|
|
14
14
|
get filled(): boolean;
|
|
15
15
|
get content(): string | undefined;
|
|
@@ -3,6 +3,7 @@ import { type SayController } from '@lblod/ember-rdfa-editor';
|
|
|
3
3
|
import IntlService from 'ember-intl/services/intl';
|
|
4
4
|
type Args = {
|
|
5
5
|
controller: SayController;
|
|
6
|
+
templateMode?: boolean;
|
|
6
7
|
};
|
|
7
8
|
export default class TextVariableInsertComponent extends Component<Args> {
|
|
8
9
|
intl: IntlService;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IBindings } from 'fetch-sparql-endpoint';
|
|
2
|
+
export default class Electee {
|
|
3
|
+
readonly uri: string;
|
|
4
|
+
readonly firstName: string;
|
|
5
|
+
readonly lastName: string;
|
|
6
|
+
readonly kandidatenlijst?: string | undefined;
|
|
7
|
+
constructor(uri: string, firstName: string, lastName: string, kandidatenlijst?: string | undefined);
|
|
8
|
+
static fromBinding(binding: IBindings): Electee;
|
|
9
|
+
get fullName(): string;
|
|
10
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { SayController } from '@lblod/ember-rdfa-editor';
|
|
2
|
-
import Mandatee from '@lblod/ember-rdfa-editor-lblod-plugins/models/mandatee';
|
|
3
2
|
import { BestuursperiodeLabel } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/constants';
|
|
3
|
+
import { Person } from '../variable-plugin/variables';
|
|
4
4
|
export type LmbPluginConfig = {
|
|
5
5
|
endpoint: string;
|
|
6
6
|
defaultPeriod?: BestuursperiodeLabel;
|
|
7
7
|
defaultAdminUnit?: string;
|
|
8
8
|
};
|
|
9
|
-
export declare function
|
|
9
|
+
export declare function createPersonNode(controller: SayController, person: Person): import("prosemirror-model").Node;
|
package/declarations/addon/plugins/lmb-plugin/utils/{fetchMandatees.d.ts → fetchElectees.d.ts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SearchSort } from '@lblod/ember-rdfa-editor-lblod-plugins/components/lmb-plugin/search-modal';
|
|
2
|
-
import
|
|
2
|
+
import Electee from '@lblod/ember-rdfa-editor-lblod-plugins/models/electee';
|
|
3
3
|
import { BESTUURSPERIODES } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/constants';
|
|
4
4
|
export type FetchMandateesArgs = {
|
|
5
5
|
endpoint: string;
|
|
@@ -10,8 +10,8 @@ export type FetchMandateesArgs = {
|
|
|
10
10
|
sort: SearchSort;
|
|
11
11
|
period: (typeof BESTUURSPERIODES)[keyof typeof BESTUURSPERIODES];
|
|
12
12
|
};
|
|
13
|
-
export declare function
|
|
14
|
-
export declare function
|
|
15
|
-
|
|
13
|
+
export declare function countElectees({ endpoint, searchString, adminUnitSearch, period, }: Pick<FetchMandateesArgs, 'searchString' | 'endpoint' | 'period' | 'adminUnitSearch'>): Promise<number>;
|
|
14
|
+
export declare function fetchElectees({ endpoint, page, pageSize, searchString, adminUnitSearch, sort, period, }: FetchMandateesArgs): Promise<{
|
|
15
|
+
electees: Electee[];
|
|
16
16
|
count: number;
|
|
17
17
|
}>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { SayController } from '@lblod/ember-rdfa-editor';
|
|
2
|
-
export declare function replaceSelectionWithAddress(controller: SayController, label?: string): void;
|
|
2
|
+
export declare function replaceSelectionWithAddress(controller: SayController, label?: string, templateMode?: boolean): void;
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
+
export type Person = {
|
|
2
|
+
uri: string;
|
|
3
|
+
firstName: string;
|
|
4
|
+
lastName: string;
|
|
5
|
+
};
|
|
1
6
|
export declare const person_variable: import("@lblod/ember-rdfa-editor/core/say-node-spec").default;
|
|
2
7
|
export declare const personVariableView: (controller: import("@lblod/ember-rdfa-editor").SayController) => import("@lblod/ember-rdfa-editor/utils/ember-node").SayNodeViewConstructor;
|