Skip to content

Commit

Permalink
Update to latest plugins and add worship-services plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
piemonkey committed Apr 12, 2024
1 parent a1c1b58 commit 968dc25
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 29 deletions.
5 changes: 5 additions & 0 deletions .changeset/four-boats-breathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"frontend-gelinkt-notuleren": minor
---

Add initial version of worship service plugin
35 changes: 20 additions & 15 deletions app/controllers/agendapoints/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { task } from 'ember-concurrency';
import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object';
import { service } from '@ember/service';
import { TRASH_STATUS_ID } from 'frontend-gelinkt-notuleren/utils/constants';
import generateExportFromEditorDocument from 'frontend-gelinkt-notuleren/utils/generate-export-from-editor-document';

import { Schema } from '@lblod/ember-rdfa-editor';
import {
em,
Expand Down Expand Up @@ -55,30 +54,21 @@ import { blockquote } from '@lblod/ember-rdfa-editor/plugins/blockquote';
import { code_block } from '@lblod/ember-rdfa-editor/plugins/code';
import { image, imageView } from '@lblod/ember-rdfa-editor/plugins/image';
import { inline_rdfa } from '@lblod/ember-rdfa-editor/marks';

import {
createInvisiblesPlugin,
hardBreak,
heading as headingInvisible,
paragraph as paragraphInvisible,
} from '@lblod/ember-rdfa-editor/plugins/invisibles';

import {
besluitNodes,
structureSpecs,
} from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/standard-template-plugin';

import { citationPlugin } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/citation-plugin';

import {
templateComment,
templateCommentView,
} from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/template-comments-plugin';

import {
regulatoryStatementNode,
regulatoryStatementNodeView,
} from '../../editor-plugins/regulatory-statements-plugin';
import { roadsign_regulation } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/roadsign-regulation-plugin/nodes';
import {
link,
Expand All @@ -87,14 +77,21 @@ import {
} from '@lblod/ember-rdfa-editor/plugins/link';
import { highlight } from '@lblod/ember-rdfa-editor/plugins/highlight/marks/highlight';
import { color } from '@lblod/ember-rdfa-editor/plugins/color/marks/color';
import ENV from 'frontend-gelinkt-notuleren/config/environment';
import { validation } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/validation';
import { atLeastOneArticleContainer } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/decision-plugin/utils/validation-rules';
import { undo } from '@lblod/ember-rdfa-editor/plugins/history';

import { TRASH_STATUS_ID } from 'frontend-gelinkt-notuleren/utils/constants';
import generateExportFromEditorDocument from 'frontend-gelinkt-notuleren/utils/generate-export-from-editor-document';
import ENV from 'frontend-gelinkt-notuleren/config/environment';
import {
regulatoryStatementNode,
regulatoryStatementNodeView,
} from '../../editor-plugins/regulatory-statements-plugin';
import {
GEMEENTE,
OCMW,
} from '../../utils/bestuurseenheid-classificatie-codes';
import { undo } from '@lblod/ember-rdfa-editor/plugins/history';

export default class AgendapointsEditController extends Controller {
@service store;
Expand Down Expand Up @@ -160,6 +157,7 @@ export default class AgendapointsEditController extends Controller {

get config() {
const classificatie = this.currentSession.classificatie;
const municipality = this.defaultMunicipality;
return {
date: {
formats: [
Expand All @@ -185,7 +183,7 @@ export default class AgendapointsEditController extends Controller {
},
endpoint: '/codex/sparql',
decisionsEndpoint: ENV.publicatieEndpoint,
defaultDecisionsGovernmentName: this.defaultMunicipality,
defaultDecisionsGovernmentName: municipality.naam,
},
link: {
interactive: true,
Expand All @@ -199,13 +197,20 @@ export default class AgendapointsEditController extends Controller {
classificatieUri: classificatie?.uri,
},
structures: structureSpecs,
worship: {
endpoint: 'https://data.lblod.info/sparql',
defaultAdministrativeUnit: municipality && {
label: municipality.naam,
uri: municipality.uri,
},
},
};
}

get defaultMunicipality() {
const classificatie = this.currentSession.classificatie;
if (classificatie?.uri === GEMEENTE || classificatie?.uri === OCMW) {
return this.currentSession.group.naam;
return this.currentSession.group;
} else {
return null;
}
Expand Down
21 changes: 14 additions & 7 deletions app/controllers/regulatory-statements/edit.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import Controller from '@ember/controller';
import { action } from '@ember/object';
import { tracked } from '@glimmer/tracking';

import { task } from 'ember-concurrency';
import generateExportFromEditorDocument from 'frontend-gelinkt-notuleren/utils/generate-export-from-editor-document';
import { service } from '@ember/service';
import { getOwner } from '@ember/application';

import {
em,
strikethrough,
Expand Down Expand Up @@ -53,7 +52,6 @@ import { blockquote } from '@lblod/ember-rdfa-editor/plugins/blockquote';
import { code_block } from '@lblod/ember-rdfa-editor/plugins/code';
import { image, imageView } from '@lblod/ember-rdfa-editor/plugins/image';
import { inline_rdfa } from '@lblod/ember-rdfa-editor/marks';

import { Schema } from '@lblod/ember-rdfa-editor';
import {
address,
Expand Down Expand Up @@ -82,15 +80,16 @@ import {
} from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/table-of-contents-plugin/nodes';
import { emberApplication } from '@lblod/ember-rdfa-editor/plugins/ember-application';
import { document_title } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/document-title-plugin/nodes';

import { highlight } from '@lblod/ember-rdfa-editor/plugins/highlight/marks/highlight';
import { color } from '@lblod/ember-rdfa-editor/plugins/color/marks/color';
import { undo } from '@lblod/ember-rdfa-editor/plugins/history';

import generateExportFromEditorDocument from 'frontend-gelinkt-notuleren/utils/generate-export-from-editor-document';
import ENV from 'frontend-gelinkt-notuleren/config/environment';
import {
GEMEENTE,
OCMW,
} from '../../utils/bestuurseenheid-classificatie-codes';
import { undo } from '@lblod/ember-rdfa-editor/plugins/history';

export default class RegulatoryStatementsRoute extends Controller {
@service documentService;
Expand Down Expand Up @@ -186,6 +185,7 @@ export default class RegulatoryStatementsRoute extends Controller {
}

get config() {
const municipality = this.defaultMunicipality;
return {
tableOfContents: [
{
Expand Down Expand Up @@ -221,12 +221,19 @@ export default class RegulatoryStatementsRoute extends Controller {
},
endpoint: '/codex/sparql',
decisionsEndpoint: ENV.publicatieEndpoint,
defaultDecisionsGovernmentName: this.defaultMunicipality,
defaultDecisionsGovernmentName: municipality.naam,
},
link: {
interactive: true,
},
structures: STRUCTURE_SPECS,
worship: {
endpoint: 'https://data.lblod.info/sparql',
defaultAdministrativeUnit: municipality && {
label: municipality.naam,
uri: municipality.uri,
},
},
};
}

Expand Down Expand Up @@ -273,7 +280,7 @@ export default class RegulatoryStatementsRoute extends Controller {
const classificatie = this.currentSession.classificatie;

if (classificatie?.uri === GEMEENTE || classificatie?.uri === OCMW) {
return this.currentSession.group.naam;
return this.currentSession.group;
} else {
return null;
}
Expand Down
1 change: 1 addition & 0 deletions app/styles/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
@import "variable-plugin";
@import "besluit-plugin";
@import "template-comments-plugin";
@import "worship-plugin";
@import "project/p-annotations"; // @TODO: refactor in ember-rdfa-editor

// give treatment (behandeling) content the same style as other say-documents
Expand Down
6 changes: 5 additions & 1 deletion app/templates/agendapoints/edit.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@
{{/if}}
<TemplateCommentsPlugin::Insert @controller={{this.controller}} />
<VariablePlugin::Address::Insert @controller={{this.controller}} />
<WorshipPlugin::Insert
@controller={{this.controller}}
@config={{this.config.worship}}
/>
</:sidebarCollapsible>
<:sidebar>
<ArticleStructurePlugin::StructureCard
Expand Down Expand Up @@ -176,7 +180,7 @@
/>
<VariablePlugin::Address::Edit
@controller={{this.controller}}
@defaultMunicipality={{this.defaultMunicipality}}
@defaultMunicipality={{this.defaultMunicipality.naam}}
/>
<TemplateCommentsPlugin::EditCard @controller={{this.controller}} />
</:sidebar>
Expand Down
6 changes: 5 additions & 1 deletion app/templates/regulatory-statements/edit.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@
/>
<TemplateCommentsPlugin::Insert @controller={{this.controller}} />
<VariablePlugin::Address::Insert @controller={{this.controller}} />
<WorshipPlugin::Insert
@controller={{this.controller}}
@config={{this.config.worship}}
/>
</:sidebarCollapsible>
<:sidebar>
<ArticleStructurePlugin::StructureCard
Expand All @@ -160,7 +164,7 @@
/>
<VariablePlugin::Address::Edit
@controller={{this.controller}}
@defaultMunicipality={{this.defaultMunicipality}}
@defaultMunicipality={{this.defaultMunicipality.naam}}
/>
<TemplateCommentsPlugin::EditCard @controller={{this.controller}} />
</:sidebar>
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@lblod/ember-environment-banner": "^0.2.0",
"@lblod/ember-mock-login": "0.7.0",
"@lblod/ember-rdfa-editor": "9.6.1",
"@lblod/ember-rdfa-editor-lblod-plugins": "^16.3.0",
"@lblod/ember-rdfa-editor-lblod-plugins": "^16.4.0",
"@release-it-plugins/lerna-changelog": "^6.0.0",
"broccoli-asset-rev": "^3.0.0",
"broccoli-plugin": "^4.0.7",
Expand Down

0 comments on commit 968dc25

Please sign in to comment.