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 diff --git a/app/config/configuration-per-admin-unit.js b/app/config/configuration-per-admin-unit.js new file mode 100644 index 000000000..dc8239ea0 --- /dev/null +++ b/app/config/configuration-per-admin-unit.js @@ -0,0 +1,16 @@ +import { ADMINISTRATIVE_UNIT_URIS } from './constants'; + +export default { + [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 e44f28c43..4293b5310 100644 --- a/app/config/constants.js +++ b/app/config/constants.js @@ -116,3 +116,10 @@ export const IV_CLASSIFICATIE_MAP = { [BESTUURSEENHEID_CLASSIFICATIE_CODES.OCMW]: BESTUURSORGAAN_CLASSIFICATIE_CODES.OCMW_RAAD, }; + +export const ADMINISTRATIVE_UNIT_URIS = { + GEMEENTE_GENT: + '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 c743aad99..3adf0062a 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.uri] || {}; + } + 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 c576d6825..1487bd57b 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.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", - "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.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 a333c50a5..077a23c40 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.1.0", "@lblod/template-uuid-instantiator": "^1.0.3", "@release-it-plugins/lerna-changelog": "^6.0.0", "@tsconfig/ember": "^3.0.8",