From e117cc150e59cfd5e109afe2ff4709cd40d78e2b Mon Sep 17 00:00:00 2001 From: Oscar Date: Wed, 4 Dec 2024 12:43:23 +0100 Subject: [PATCH 1/6] Add configuration per administrative unit --- app/config/configuration-per-admin-unit.js | 10 ++++++++++ app/config/constants.js | 5 +++++ app/services/editor/agendapoint.js | 14 ++++++++++---- package-lock.json | 8 ++++---- package.json | 2 +- 5 files changed, 30 insertions(+), 9 deletions(-) create mode 100644 app/config/configuration-per-admin-unit.js diff --git a/app/config/configuration-per-admin-unit.js b/app/config/configuration-per-admin-unit.js new file mode 100644 index 000000000..295cf33c0 --- /dev/null +++ b/app/config/configuration-per-admin-unit.js @@ -0,0 +1,10 @@ +import { ADMINISTRATIVE_UNIT_IDS } from './constants'; + +export default { + [ADMINISTRATIVE_UNIT_IDS.GEMEENTE_GENT]: { + structure: { + fullLenghtArticles: true, + disableOnlyArticleSpecialName: true, + }, + }, +}; diff --git a/app/config/constants.js b/app/config/constants.js index 70c0ce28a..bce4b819a 100644 --- a/app/config/constants.js +++ b/app/config/constants.js @@ -114,3 +114,8 @@ export const IV_CLASSIFICATIE_MAP = { [BESTUURSEENHEID_CLASSIFICATIE_CODES.OCMW]: BESTUURSORGAAN_CLASSIFICATIE_CODES.OCMW_RAAD, }; + +export const ADMINISTRATIVE_UNIT_IDS = { + GEMEENTE_GENT: + '353234a365664e581db5c2f7cc07add2534b47b8e1ab87c821fc6e6365e6bef5', +}; diff --git a/app/services/editor/agendapoint.js b/app/services/editor/agendapoint.js index c743aad99..9804363cf 100644 --- a/app/services/editor/agendapoint.js +++ b/app/services/editor/agendapoint.js @@ -88,8 +88,8 @@ import { OCMW, } from '../../utils/bestuurseenheid-classificatie-codes'; import { - structure, - structureView, + structureWithConfig, + structureViewWithConfig, } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/structure-plugin/node'; import { inlineRdfaWithConfig, @@ -120,6 +120,7 @@ import { htmlToDoc } from '@lblod/ember-rdfa-editor/utils/_private/html-utils'; import { citationPlugin } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/citation-plugin'; import { isRdfaAttrs } from '@lblod/ember-rdfa-editor/core/schema'; import { BESLUIT } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/constants'; +import configurationPerAdminUnit from '../../config/configuration-per-admin-unit'; export default class AgendapointEditorService extends Service { @service intl; @@ -218,6 +219,7 @@ export default class AgendapointEditorService extends Service { insertArticle: { uriGenerator: () => `http://data.lblod.info/artikels/${uuidv4()}`, }, + ...this.adminUnitConfig, }; } @@ -231,6 +233,10 @@ export default class AgendapointEditorService extends Service { } } + get adminUnitConfig() { + return configurationPerAdminUnit[this.defaultMunicipality.id] || {}; + } + get codelistEditOptions() { return { endpoint: ENV.fallbackCodelistEndpoint, @@ -265,7 +271,7 @@ export default class AgendapointEditorService extends Service { controller, ), snippet: snippetView(this.config.snippet)(controller), - structure: structureView(controller), + structure: structureViewWithConfig(this.config.structure)(controller), mandatee_table: mandateeTableView(controller), person_variable: personVariableView(controller), autofilled_variable: autofilledVariableView(controller), @@ -284,7 +290,7 @@ export default class AgendapointEditorService extends Service { doc: docWithConfig({ rdfaAware: true }), paragraph, repaired_block: repairedBlockWithConfig({ rdfaAware: true }), - structure, + structure: structureWithConfig(this.config.structure), list_item: listItemWithConfig({ enableHierarchicalList: true }), ordered_list: orderedListWithConfig({ enableHierarchicalList: true }), bullet_list: bulletListWithConfig({ enableHierarchicalList: true }), diff --git a/package-lock.json b/package-lock.json index 72c705e37..ee487348e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,7 +34,7 @@ "@lblod/ember-environment-banner": "^0.5.0", "@lblod/ember-mock-login": "^0.10.0", "@lblod/ember-rdfa-editor": "10.9.0", - "@lblod/ember-rdfa-editor-lblod-plugins": "26.0.2", + "@lblod/ember-rdfa-editor-lblod-plugins": "26.0.2-dev.e1f47919b3f6af6300bbf4b6ea2e418240220666", "@lblod/template-uuid-instantiator": "^1.0.3", "@release-it-plugins/lerna-changelog": "^6.0.0", "@tsconfig/ember": "^3.0.8", @@ -7571,9 +7571,9 @@ } }, "node_modules/@lblod/ember-rdfa-editor-lblod-plugins": { - "version": "26.0.2", - "resolved": "https://registry.npmjs.org/@lblod/ember-rdfa-editor-lblod-plugins/-/ember-rdfa-editor-lblod-plugins-26.0.2.tgz", - "integrity": "sha512-cGq9/dH8ZHcbf0p6zdwAETE/eYwG1Wk4OmXro1tufWJNzUwIotUxRPsrmVYMQ//cVkx9b3FEspUrom+pdH69gw==", + "version": "26.0.2-dev.e1f47919b3f6af6300bbf4b6ea2e418240220666", + "resolved": "https://registry.npmjs.org/@lblod/ember-rdfa-editor-lblod-plugins/-/ember-rdfa-editor-lblod-plugins-26.0.2-dev.e1f47919b3f6af6300bbf4b6ea2e418240220666.tgz", + "integrity": "sha512-BCxw3iwrWGDKA/DJDQbx6vwUMzOCPn+LOmXyIz036CEsUq/DiNUS7DNtqOOQ/7OBILXtHYtVgZnZ3s7jhrB1ig==", "dev": true, "dependencies": { "@codemirror/lang-html": "^6.4.9", diff --git a/package.json b/package.json index cb32a9fa7..057246403 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "@lblod/ember-environment-banner": "^0.5.0", "@lblod/ember-mock-login": "^0.10.0", "@lblod/ember-rdfa-editor": "10.9.0", - "@lblod/ember-rdfa-editor-lblod-plugins": "26.0.2", + "@lblod/ember-rdfa-editor-lblod-plugins": "26.0.2-dev.e1f47919b3f6af6300bbf4b6ea2e418240220666", "@lblod/template-uuid-instantiator": "^1.0.3", "@release-it-plugins/lerna-changelog": "^6.0.0", "@tsconfig/ember": "^3.0.8", From 3ff7901952dcc89696c1ba36c390b8a5ca27a77e Mon Sep 17 00:00:00 2001 From: Oscar Date: Wed, 4 Dec 2024 12:54:47 +0100 Subject: [PATCH 2/6] changeset --- .changeset/eight-ravens-allow.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/eight-ravens-allow.md diff --git a/.changeset/eight-ravens-allow.md b/.changeset/eight-ravens-allow.md new file mode 100644 index 000000000..e9faa44b5 --- /dev/null +++ b/.changeset/eight-ravens-allow.md @@ -0,0 +1,5 @@ +--- +'frontend-gelinkt-notuleren': minor +--- + +Add configuration per administrative unit From 519784be77acae57d79f4697a0f1499c94939f2f Mon Sep 17 00:00:00 2001 From: Oscar Date: Thu, 5 Dec 2024 10:53:01 +0100 Subject: [PATCH 3/6] use new configuration API --- app/config/configuration-per-admin-unit.js | 2 +- package-lock.json | 8 ++++---- package.json | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/config/configuration-per-admin-unit.js b/app/config/configuration-per-admin-unit.js index 295cf33c0..1dedd7111 100644 --- a/app/config/configuration-per-admin-unit.js +++ b/app/config/configuration-per-admin-unit.js @@ -4,7 +4,7 @@ export default { [ADMINISTRATIVE_UNIT_IDS.GEMEENTE_GENT]: { structure: { fullLenghtArticles: true, - disableOnlyArticleSpecialName: true, + onlyArticleSpecialName: false, }, }, }; diff --git a/package-lock.json b/package-lock.json index ee487348e..4851d57e7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,7 +34,7 @@ "@lblod/ember-environment-banner": "^0.5.0", "@lblod/ember-mock-login": "^0.10.0", "@lblod/ember-rdfa-editor": "10.9.0", - "@lblod/ember-rdfa-editor-lblod-plugins": "26.0.2-dev.e1f47919b3f6af6300bbf4b6ea2e418240220666", + "@lblod/ember-rdfa-editor-lblod-plugins": "26.0.2-dev.eadf45ef6147459d8a437b13d625ba41f7083753", "@lblod/template-uuid-instantiator": "^1.0.3", "@release-it-plugins/lerna-changelog": "^6.0.0", "@tsconfig/ember": "^3.0.8", @@ -7571,9 +7571,9 @@ } }, "node_modules/@lblod/ember-rdfa-editor-lblod-plugins": { - "version": "26.0.2-dev.e1f47919b3f6af6300bbf4b6ea2e418240220666", - "resolved": "https://registry.npmjs.org/@lblod/ember-rdfa-editor-lblod-plugins/-/ember-rdfa-editor-lblod-plugins-26.0.2-dev.e1f47919b3f6af6300bbf4b6ea2e418240220666.tgz", - "integrity": "sha512-BCxw3iwrWGDKA/DJDQbx6vwUMzOCPn+LOmXyIz036CEsUq/DiNUS7DNtqOOQ/7OBILXtHYtVgZnZ3s7jhrB1ig==", + "version": "26.0.2-dev.eadf45ef6147459d8a437b13d625ba41f7083753", + "resolved": "https://registry.npmjs.org/@lblod/ember-rdfa-editor-lblod-plugins/-/ember-rdfa-editor-lblod-plugins-26.0.2-dev.eadf45ef6147459d8a437b13d625ba41f7083753.tgz", + "integrity": "sha512-68d12W8bPdVKt2RznwYc0BES3J9rfd3V3HVOldVj4hY4GLP3HKIyKSkBRniEmeWLRqiDjZbat/9+SamccwVfAQ==", "dev": true, "dependencies": { "@codemirror/lang-html": "^6.4.9", diff --git a/package.json b/package.json index 057246403..a88d39807 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "@lblod/ember-environment-banner": "^0.5.0", "@lblod/ember-mock-login": "^0.10.0", "@lblod/ember-rdfa-editor": "10.9.0", - "@lblod/ember-rdfa-editor-lblod-plugins": "26.0.2-dev.e1f47919b3f6af6300bbf4b6ea2e418240220666", + "@lblod/ember-rdfa-editor-lblod-plugins": "26.0.2-dev.eadf45ef6147459d8a437b13d625ba41f7083753", "@lblod/template-uuid-instantiator": "^1.0.3", "@release-it-plugins/lerna-changelog": "^6.0.0", "@tsconfig/ember": "^3.0.8", From ce62e6ba73d824fb1a9f79d73d95069ba383902f Mon Sep 17 00:00:00 2001 From: Oscar Date: Thu, 5 Dec 2024 12:33:04 +0100 Subject: [PATCH 4/6] fix typo --- app/config/configuration-per-admin-unit.js | 2 +- package-lock.json | 8 ++++---- package.json | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/config/configuration-per-admin-unit.js b/app/config/configuration-per-admin-unit.js index 1dedd7111..2bf0a3fbf 100644 --- a/app/config/configuration-per-admin-unit.js +++ b/app/config/configuration-per-admin-unit.js @@ -3,7 +3,7 @@ import { ADMINISTRATIVE_UNIT_IDS } from './constants'; export default { [ADMINISTRATIVE_UNIT_IDS.GEMEENTE_GENT]: { structure: { - fullLenghtArticles: true, + fullLengthArticles: true, onlyArticleSpecialName: false, }, }, diff --git a/package-lock.json b/package-lock.json index 4851d57e7..e2bd64ce1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,7 +34,7 @@ "@lblod/ember-environment-banner": "^0.5.0", "@lblod/ember-mock-login": "^0.10.0", "@lblod/ember-rdfa-editor": "10.9.0", - "@lblod/ember-rdfa-editor-lblod-plugins": "26.0.2-dev.eadf45ef6147459d8a437b13d625ba41f7083753", + "@lblod/ember-rdfa-editor-lblod-plugins": "26.0.2-dev.e49bd26451885d41001ac2058f4d5ed921987013", "@lblod/template-uuid-instantiator": "^1.0.3", "@release-it-plugins/lerna-changelog": "^6.0.0", "@tsconfig/ember": "^3.0.8", @@ -7571,9 +7571,9 @@ } }, "node_modules/@lblod/ember-rdfa-editor-lblod-plugins": { - "version": "26.0.2-dev.eadf45ef6147459d8a437b13d625ba41f7083753", - "resolved": "https://registry.npmjs.org/@lblod/ember-rdfa-editor-lblod-plugins/-/ember-rdfa-editor-lblod-plugins-26.0.2-dev.eadf45ef6147459d8a437b13d625ba41f7083753.tgz", - "integrity": "sha512-68d12W8bPdVKt2RznwYc0BES3J9rfd3V3HVOldVj4hY4GLP3HKIyKSkBRniEmeWLRqiDjZbat/9+SamccwVfAQ==", + "version": "26.0.2-dev.e49bd26451885d41001ac2058f4d5ed921987013", + "resolved": "https://registry.npmjs.org/@lblod/ember-rdfa-editor-lblod-plugins/-/ember-rdfa-editor-lblod-plugins-26.0.2-dev.e49bd26451885d41001ac2058f4d5ed921987013.tgz", + "integrity": "sha512-IfcihYUTNkTES+b5Stylpl1/eiRkMCVpaeAsZ3A7YxClg6JTdVHhyJDGCzVs7Et+EPhZLBR4WBmj80H80MrJIw==", "dev": true, "dependencies": { "@codemirror/lang-html": "^6.4.9", diff --git a/package.json b/package.json index a88d39807..d64adabb7 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "@lblod/ember-environment-banner": "^0.5.0", "@lblod/ember-mock-login": "^0.10.0", "@lblod/ember-rdfa-editor": "10.9.0", - "@lblod/ember-rdfa-editor-lblod-plugins": "26.0.2-dev.eadf45ef6147459d8a437b13d625ba41f7083753", + "@lblod/ember-rdfa-editor-lblod-plugins": "26.0.2-dev.e49bd26451885d41001ac2058f4d5ed921987013", "@lblod/template-uuid-instantiator": "^1.0.3", "@release-it-plugins/lerna-changelog": "^6.0.0", "@tsconfig/ember": "^3.0.8", From cbadf05b84f8b7ba61f921db6759d226f5f18dcd Mon Sep 17 00:00:00 2001 From: Oscar Date: Thu, 5 Dec 2024 15:28:40 +0100 Subject: [PATCH 5/6] use released version, change to uri and include OCMW gent --- app/config/configuration-per-admin-unit.js | 10 ++++++++-- app/config/constants.js | 6 ++++-- app/services/editor/agendapoint.js | 3 ++- package-lock.json | 8 ++++---- package.json | 2 +- 5 files changed, 19 insertions(+), 10 deletions(-) diff --git a/app/config/configuration-per-admin-unit.js b/app/config/configuration-per-admin-unit.js index 2bf0a3fbf..dc8239ea0 100644 --- a/app/config/configuration-per-admin-unit.js +++ b/app/config/configuration-per-admin-unit.js @@ -1,7 +1,13 @@ -import { ADMINISTRATIVE_UNIT_IDS } from './constants'; +import { ADMINISTRATIVE_UNIT_URIS } from './constants'; export default { - [ADMINISTRATIVE_UNIT_IDS.GEMEENTE_GENT]: { + [ADMINISTRATIVE_UNIT_URIS.GEMEENTE_GENT]: { + structure: { + fullLengthArticles: true, + onlyArticleSpecialName: false, + }, + }, + [ADMINISTRATIVE_UNIT_URIS.OCMW_GENT]: { structure: { fullLengthArticles: true, onlyArticleSpecialName: false, diff --git a/app/config/constants.js b/app/config/constants.js index bce4b819a..6446d0da7 100644 --- a/app/config/constants.js +++ b/app/config/constants.js @@ -115,7 +115,9 @@ export const IV_CLASSIFICATIE_MAP = { BESTUURSORGAAN_CLASSIFICATIE_CODES.OCMW_RAAD, }; -export const ADMINISTRATIVE_UNIT_IDS = { +export const ADMINISTRATIVE_UNIT_URIS = { GEMEENTE_GENT: - '353234a365664e581db5c2f7cc07add2534b47b8e1ab87c821fc6e6365e6bef5', + 'http://data.lblod.info/id/bestuurseenheden/353234a365664e581db5c2f7cc07add2534b47b8e1ab87c821fc6e6365e6bef5', + OCMW_GENT: + 'http://data.lblod.info/id/bestuurseenheden/c5623baf3970c5efa9746dff01afd43092c1321a47316dbe81ed79604b56e8ea', }; diff --git a/app/services/editor/agendapoint.js b/app/services/editor/agendapoint.js index 9804363cf..87279a728 100644 --- a/app/services/editor/agendapoint.js +++ b/app/services/editor/agendapoint.js @@ -234,7 +234,8 @@ export default class AgendapointEditorService extends Service { } get adminUnitConfig() { - return configurationPerAdminUnit[this.defaultMunicipality.id] || {}; + console.log(this.defaultMunicipality); + return configurationPerAdminUnit[this.defaultMunicipality.uri] || {}; } get codelistEditOptions() { diff --git a/package-lock.json b/package-lock.json index e2bd64ce1..259812557 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,7 +34,7 @@ "@lblod/ember-environment-banner": "^0.5.0", "@lblod/ember-mock-login": "^0.10.0", "@lblod/ember-rdfa-editor": "10.9.0", - "@lblod/ember-rdfa-editor-lblod-plugins": "26.0.2-dev.e49bd26451885d41001ac2058f4d5ed921987013", + "@lblod/ember-rdfa-editor-lblod-plugins": "26.1.0", "@lblod/template-uuid-instantiator": "^1.0.3", "@release-it-plugins/lerna-changelog": "^6.0.0", "@tsconfig/ember": "^3.0.8", @@ -7571,9 +7571,9 @@ } }, "node_modules/@lblod/ember-rdfa-editor-lblod-plugins": { - "version": "26.0.2-dev.e49bd26451885d41001ac2058f4d5ed921987013", - "resolved": "https://registry.npmjs.org/@lblod/ember-rdfa-editor-lblod-plugins/-/ember-rdfa-editor-lblod-plugins-26.0.2-dev.e49bd26451885d41001ac2058f4d5ed921987013.tgz", - "integrity": "sha512-IfcihYUTNkTES+b5Stylpl1/eiRkMCVpaeAsZ3A7YxClg6JTdVHhyJDGCzVs7Et+EPhZLBR4WBmj80H80MrJIw==", + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/@lblod/ember-rdfa-editor-lblod-plugins/-/ember-rdfa-editor-lblod-plugins-26.1.0.tgz", + "integrity": "sha512-XEWcQFsDrJ6AMj5Q6oW9D83gNZ00y/ADE432bme1C3ULGTfvar2g8VHv4m5wBi9SlBa8PC9cQLHMogPeDt8HFQ==", "dev": true, "dependencies": { "@codemirror/lang-html": "^6.4.9", diff --git a/package.json b/package.json index d64adabb7..c1bc61777 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "@lblod/ember-environment-banner": "^0.5.0", "@lblod/ember-mock-login": "^0.10.0", "@lblod/ember-rdfa-editor": "10.9.0", - "@lblod/ember-rdfa-editor-lblod-plugins": "26.0.2-dev.e49bd26451885d41001ac2058f4d5ed921987013", + "@lblod/ember-rdfa-editor-lblod-plugins": "26.1.0", "@lblod/template-uuid-instantiator": "^1.0.3", "@release-it-plugins/lerna-changelog": "^6.0.0", "@tsconfig/ember": "^3.0.8", From 9134820c18326be9a432c11d442406c9b80744fa Mon Sep 17 00:00:00 2001 From: Elena Poelman Date: Fri, 6 Dec 2024 15:14:47 +0100 Subject: [PATCH 6/6] remove console log --- app/services/editor/agendapoint.js | 1 - 1 file changed, 1 deletion(-) diff --git a/app/services/editor/agendapoint.js b/app/services/editor/agendapoint.js index 87279a728..3adf0062a 100644 --- a/app/services/editor/agendapoint.js +++ b/app/services/editor/agendapoint.js @@ -234,7 +234,6 @@ export default class AgendapointEditorService extends Service { } get adminUnitConfig() { - console.log(this.defaultMunicipality); return configurationPerAdminUnit[this.defaultMunicipality.uri] || {}; }