Skip to content

Commit

Permalink
Merge branch 'development' of github.com:lblod/frontend-gelinkt-notul…
Browse files Browse the repository at this point in the history
…eren
  • Loading branch information
nvdk committed Jan 19, 2022
2 parents 891cfe4 + 1500c5c commit 1b2ad20
Show file tree
Hide file tree
Showing 42 changed files with 36,719 additions and 288 deletions.
2 changes: 1 addition & 1 deletion .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ steps:
- name: install
image: danlynn/ember-cli:3.20.0
commands:
- npm install
- npm ci
- name: lint
image: danlynn/ember-cli:3.20.0
commands:
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

*~
.DS_Store
package-lock.json
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
Expand Down
1 change: 0 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
package-lock=false
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ FROM madnificent/ember:3.20.0 as builder
LABEL maintainer="[email protected]"

WORKDIR /app
COPY package.json .
RUN npm install
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
RUN ember build -prod

Expand Down
10 changes: 5 additions & 5 deletions app/components/administrative-body-select.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
as |administrativeBody|
>
{{administrativeBody.isTijdsspecialisatieVan.naam}}
(periode: {{moment-format administrativeBody.bindingStart "MM/DD/YYYY"}} -
(periode: {{plain-date administrativeBody.bindingStart}} -
{{#if administrativeBody.bindingEinde~}}
{{moment-format administrativeBody.bindingEinde "MM/DD/YYYY"}}
{{~else~}}
{{plain-date administrativeBody.bindingEinde}}
{{else}}
nvt.
{{~/if}})
{{/if}})
</PowerSelect>
</div>
</div>
6 changes: 4 additions & 2 deletions app/components/administrative-body-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { inject as service } from '@ember/service';
import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
import { task } from 'ember-concurrency';
import moment from 'moment';
import sub from 'date-fns/sub';
import isAfter from 'date-fns/isAfter';

const VALID_ADMINISTRATIVE_BODY_CLASSIFICATIONS = [
"http://data.vlaanderen.be/id/concept/BestuursorgaanClassificatieCode/5ab0e9b8a3b2ca7c5e000005", // "Gemeenteraad"
Expand Down Expand Up @@ -76,7 +77,8 @@ export default class AdministrativeBodySelectComponent extends Component {
if(!endDate) {
return true;
}
return moment(endDate).isAfter(moment().subtract(2, 'months'));
const twoMonthsAgo = sub(new Date(), {months: 2});
return isAfter(endDate,twoMonthsAgo);
}
);
}
Expand Down
2 changes: 1 addition & 1 deletion app/components/app-chrome.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
{{#if @editorDocument.updatedOn}}
<li class="au-c-list-horizontal__item">
<span class="au-c-app-chrome__status">
Bewaard op {{moment-calendar @editorDocument.updatedOn}}
Bewaard op {{human-friendly-date @editorDocument.updatedOn}}
</span>
</li>
{{else}}
Expand Down
2 changes: 1 addition & 1 deletion app/components/extracts/print-view.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<br>
{{meeting.bestuursorgaan.isTijdsspecialisatieVan.naam}}
<br>
zitting van {{moment-format meeting.geplandeStart 'L LT'}}
zitting van {{detailed-date meeting.geplandeStart}}
</AuHeading>
<p class="au-u-margin-top-small au-u-margin-bottom">Het document slaat op de situatie zoals gekend bij het
afleveren.</p>
Expand Down
11 changes: 5 additions & 6 deletions app/components/manage-intermissions/index.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

<div class="au-c-meeting-chrome-card au-u-margin-bottom-none">
<AuHeading @level="3" @skin="6" class="au-c-meeting-chrome-card__title">{{t "manageIntermissions.title"}}</AuHeading>
<table class="au-c-meeting-chrome-table">
Expand Down Expand Up @@ -34,18 +33,18 @@
{{#if this.fetchIntermissions.lastSuccessful}}
{{#each this.intermissions as |intermission|}}
<tr>
<td>{{moment-format intermission.startedAt "DD/MM/YYYY HH:mm"}}</td>
<td>{{moment-format intermission.endedAt "DD/MM/YYYY HH:mm"}}</td>
<td>{{detailed-date intermission.startedAt}}</td>
<td>{{detailed-date intermission.endedAt}}</td>
<td>
{{#if intermission.agendaPosition}}
{{#if (eq intermission.agendaPosition.position.label "during")}}
{{t "manageIntermissions.duringAp"}}:
{{t "manageIntermissions.duringAp"}}:
{{/if}}
{{#if (eq intermission.agendaPosition.position.label "before")}}
{{t "manageIntermissions.beforeAp"}}:
{{t "manageIntermissions.beforeAp"}}:
{{/if}}
{{#if (eq intermission.agendaPosition.position.label "after")}}
{{t "manageIntermissions.afterAp"}}:
{{t "manageIntermissions.afterAp"}}:
{{/if}}
<a href="#behandeling-{{intermission.agendaPosition.agendapoint.behandeling.id}}" class="au-c-link au-c-link--secondary">
{{intermission.agendaPosition.agendapoint.titel}}
Expand Down
6 changes: 3 additions & 3 deletions app/components/meeting-form.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</AuToolbar>
<AuToolbar @size="small" class="au-u-padding-top-none">
<AuToolbarGroup>
<h1 class="au-c-app-chrome__title">{{t "meetingForm.scheduledText"}} {{moment-format @zitting.geplandeStart "DD/MM/YYYY"}}</h1>
<h1 class="au-c-app-chrome__title">{{t "meetingForm.scheduledText"}} {{plain-date @zitting.geplandeStart}}</h1>
</AuToolbarGroup>
<AuToolbarGroup class="au-c-toolbar__group--actions">
{{#if this.isComplete}}
Expand Down Expand Up @@ -94,7 +94,7 @@
{{!-- Meeting title --}}
<AuHeading>
{{t "meetingForm.meetingHeadingPartOne"}} {{t this.headerArticleTranslationString}} <span class="au-c-meeting-chrome__highlight">{{@zitting.bestuursorgaan.isTijdsspecialisatieVan.naam}},</span>
{{t "meetingForm.meetingHeadingPartTwo"}} <span class="au-c-meeting-chrome__highlight">{{moment-format @zitting.geplandeStart "DD/MM/YYYY HH:mm"}}</span>
{{t "meetingForm.meetingHeadingPartTwo"}} <span class="au-c-meeting-chrome__highlight">{{detailed-date @zitting.geplandeStart}}</span>
</AuHeading>
<AuHr @size="large"/>

Expand Down Expand Up @@ -191,7 +191,7 @@
@possibleParticipants={{this.possibleParticipants}}
@behandeling={{behandeling}}
@readOnly={{this.readOnly}}
@bestuursorgaan={{this.zitting.bestuursorgaan}}
@bestuursorgaan={{this.bestuursorgaan}}
@meeting={{this.zitting}}
/>
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
@onChange={{@onSelect}}
as |functionaris| >
{{functionaris.isBestuurlijkeAliasVan.gebruikteVoornaam}} {{functionaris.isBestuurlijkeAliasVan.achternaam}},
{{functionaris.bekleedt.rol.label}} (periode {{moment-format functionaris.start "MM/DD/YYYY"}} - {{moment-format functionaris.einde "MM/DD/YYYY"}})
{{functionaris.bekleedt.rol.label}} (periode {{plain-date functionaris.start}} - {{plain-date functionaris.einde}})
</PowerSelect>
{{/if}}
2 changes: 1 addition & 1 deletion app/components/participation-list/mandataris-row.hbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<tr>
<td>{{@mandataris.isBestuurlijkeAliasVan.gebruikteVoornaam}} {{@mandataris.isBestuurlijkeAliasVan.achternaam}}</td>
<td>{{@mandataris.bekleedt.bestuursfunctie.label}}</td>
<td>{{moment-format @mandataris.isBestuurlijkeAliasVan.geboorte.datum 'DD/MM/YYYY'}}</td>
<td>{{plain-date @mandataris.isBestuurlijkeAliasVan.geboorte.datum}}</td>
<td>
<label class="checkbox checkbox--block">
<input class="checkbox__toggle" type="checkbox" checked={{@selected}} {{on "input" (fn @toggle @mandataris @selected)}} />
Expand Down
2 changes: 1 addition & 1 deletion app/components/print-view/signature.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="au-o-grid__item au-u-1-2@medium">
<AuHeading @level="3" @skin="6" class="au-u-margin-bottom-tiny">Ondertekend door</AuHeading>
<p>{{@fullName}} <br> {{moment-format @createdOn 'L LT'}}</p>
<p>{{@fullName}} <br> {{detailed-date @createdOn}}</p>
<p>{{@hashValue}}</p>
</div>
14 changes: 8 additions & 6 deletions app/components/rdfa-editor-container.hbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{#if @busy}}
<div class="container-flex--contain">
<div class="au-c-rdfa-editor">
<div class="say-container say-container--sidebar-left">
<div class="say-container say-container--sidebar-left say-container--paper say-container--sidebar-right">
<div class="say-container__main">
<div class="say-editor rdfa-annotations rdfa-annotations-highlight rdfa-annotations-hover">
<div class="say-editor__paper">
Expand All @@ -27,10 +27,12 @@
<div class="container-flex--contain" vocab="{{this.vocab}}" {{did-insert this.setPrefix}}
typeof="{{@typeOfWrappingDiv}}" property="{{@property}}" resource="#">
<Rdfa::RdfaEditor
class="au-c-rdfa-editor"
@profile={{@profile}}
@rdfaEditorInit={{this.rdfaEditorInit}}
@editorOptions={{this.editorOptions}}
@toolbarOptions={{this.toolbarOptions}} />
class="au-c-rdfa-editor"
@profile={{@profile}}
@rdfaEditorInit={{this.rdfaEditorInit}}
@editorOptions={{this.editorOptions}}
@toolbarOptions={{this.toolbarOptions}}
@plugins={{this.plugins}}
/>
</div>
{{/if}}
9 changes: 8 additions & 1 deletion app/components/rdfa-editor-container.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ import { tracked } from '@glimmer/tracking';

export default class RdfaEditorContainerComponent extends Component {
@tracked editor;

plugins = [
'roadsign-regulation',
'template-variable',
'besluit',
'rdfa-date',
];
get editorOptions() {
return (
this.args.editorOptions ?? {
Expand All @@ -13,6 +18,8 @@ export default class RdfaEditorContainerComponent extends Component {
showRdfa: true,
showRdfaHighlight: true,
showRdfaHover: true,
showPaper: true,
showSidebar: true
}
);
}
Expand Down
4 changes: 2 additions & 2 deletions app/components/signatures/published-resource.hbs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<AuHeading @level="3" @skin="6" class="au-u-margin-bottom-tiny">{{t "publishedResource.publishedByLabel"}}</AuHeading>
<p>{{@publication.gebruiker.voornaam}} {{@publication.gebruiker.achternaam}} <br> {{moment-format @publication.createdOn 'L LT'}}</p>
<p>{{@publication.gebruiker.voornaam}} {{@publication.gebruiker.achternaam}} <br> {{detailed-date @publication.createdOn}}</p>

{{#if this.submissionSucceeded}}
<AuHeading @level="3" @skin="6" class="au-u-margin-bottom-tiny au-u-margin-top">{{t "publishedResource.reportLabel"}}</AuHeading>
<p>{{t "publishedResource.reportText"}} <br> {{@publication.gebruiker.voornaam}} {{@publication.gebruiker.achternaam}} <br> {{moment-format @publication.createdOn 'L LT'}}</p>
<p>{{t "publishedResource.reportText"}} <br> {{@publication.gebruiker.voornaam}} {{@publication.gebruiker.achternaam}} <br> {{detailed-date @publication.createdOn 'L LT'}}</p>
<p class="u-spacer--bottom--small text-fade smaller">{{t "publishedResource.notificationText"}} <a href="https://loket.lokaalbestuur.vlaanderen.be/" target="_blank" rel="noopener noreferrer">Loket voor Lokale Besturen</a>.</p>
{{else if this.submissionFailed}}
<AuHeading @level="3" @skin="6" class="au-u-margin-bottom-tiny au-u-margin-top">{{t "publishedResource.reportLabel"}}</AuHeading>
Expand Down
2 changes: 1 addition & 1 deletion app/components/signatures/signed-resource.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{{@signature.gebruiker.voornaam}} {{@signature.gebruiker.achternaam}} <br>
<AuHelpText @size="large" @skin="secondary" class="au-u-margin-top-none">
<AuIcon @icon="calendar" />
{{moment-format @signature.createdOn 'L LT'}}
{{detailed-date @signature.createdOn}}
</AuHelpText>
</p>
<p class="au-u-margin-top-tiny">
Expand Down
2 changes: 1 addition & 1 deletion app/components/zitting-link.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{#if this.meeting.id}}
<LinkTo @route="meetings.edit" @model={{this.meeting.id}} class="au-c-link">
Zitting van {{this.meeting.bestuursorgaan.isTijdsspecialisatieVan.naam}} op {{moment-format this.meeting.geplandeStart "DD/MM/YYYY HH:mm"}}
Zitting van {{this.meeting.bestuursorgaan.isTijdsspecialisatieVan.naam}} op {{detailed-date this.meeting.geplandeStart}}
</LinkTo>
{{/if}}
12 changes: 6 additions & 6 deletions app/components/zitting/manage-zittingsdata.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
{{t "manageZittingsData.bestuursorganLabel"}} <strong>{{this.bestuursorgaan.isTijdsspecialisatieVan.naam}}</strong>
</li>
<li class="au-c-list-divider__item">
{{t "manageZittingsData.geplandeStartLabel"}} <strong>{{moment-format this.geplandeStart "DD/MM/YYYY HH:mm"}}</strong>
{{t "manageZittingsData.geplandeStartLabel"}} <strong>{{detailed-date this.geplandeStart}}</strong>
</li>
<li class="au-c-list-divider__item">
{{t "manageZittingsData.opLocatieLabel"}} <strong>{{this.opLocatie}}</strong>
</li>
<li class="au-c-list-divider__item">
{{t "manageZittingsData.gestartOpTijdstipLabel"}} <strong>{{moment-format this.gestartOpTijdstip "DD/MM/YYYY HH:mm"}}</strong>
{{t "manageZittingsData.gestartOpTijdstipLabel"}} <strong>{{detailed-date this.gestartOpTijdstip}}</strong>
</li>
<li class="au-c-list-divider__item">
{{t "manageZittingsData.geeindigdOpTijdstipLabel"}} <strong>{{moment-format this.geeindigdOpTijdstip "DD/MM/YYYY HH:mm"}}</strong>
{{t "manageZittingsData.geeindigdOpTijdstipLabel"}} <strong>{{detailed-date this.geeindigdOpTijdstip}}</strong>
</li>
</ul>
{{#unless @readOnly}}
Expand All @@ -31,8 +31,8 @@
<div>
<AuLabel>{{t "manageZittingsData.bestuursorganLabel"}}</AuLabel>
{{this.bestuursorgaan.isTijdsspecialisatieVan.naam}}
(periode: {{moment-format this.bestuursorgaan.bindingStart "MM/DD/YYYY"}} -
{{#if this.bestuursorgaan.bindingEinde}}{{moment-format this.bestuursorgaan.bindingEinde "MM/DD/YYYY"}}{{else}}nvt.{{/if}})
(periode: {{plain-date this.bestuursorgaan.bindingStart}} -
{{#if this.bestuursorgaan.bindingEinde}}{{plain-date this.bestuursorgaan.bindingEinde}}{{else}}nvt.{{/if}})
</div>
<div>
{{#let (unique-id) as |id|}}
Expand Down Expand Up @@ -65,4 +65,4 @@
</AuButtonGroup>
</Modal.Footer>
</AuModal>
{{/if}}
{{/if}}
10 changes: 0 additions & 10 deletions app/config/editor-profiles.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,24 @@
export default {
default: [
"rdfa-editor-document-title-plugin",
"rdfa-editor-generic-model-plugin",
"rdfa-editor-standard-template-plugin",
"rdfa-editor-citaten-plugin",
"rdfa-editor-import-snippet-plugin",
"rdfa-editor-roadsign-hint-plugin",
"rdfa-editor-besluit-type-plugin",
],

//GEMEENTE
"http://data.vlaanderen.be/id/concept/BestuurseenheidClassificatieCode/5ab0e9b8a3b2ca7c5e000001": [
"rdfa-editor-document-title-plugin",
"rdfa-editor-generic-model-plugin",
"rdfa-editor-standard-template-plugin",
"rdfa-editor-citaten-plugin",
"rdfa-editor-import-snippet-plugin",
"rdfa-editor-roadsign-hint-plugin",
"rdfa-editor-besluit-type-plugin",
],

//OCMW
"http://data.vlaanderen.be/id/concept/BestuurseenheidClassificatieCode/5ab0e9b8a3b2ca7c5e000002": [
"rdfa-editor-document-title-plugin",
"rdfa-editor-generic-model-plugin",
"rdfa-editor-standard-template-plugin",
"rdfa-editor-citaten-plugin",
"rdfa-editor-import-snippet-plugin",
"rdfa-editor-roadsign-hint-plugin",
"rdfa-editor-besluit-type-plugin",

],
Expand All @@ -36,7 +27,6 @@ export default {
"rdfa-editor-citaten-plugin",
"rdfa-editor-import-snippet-plugin",
"rdfa-editor-besluit-type-plugin",
"rdfa-editor-roadsign-hint-plugin"

],
none: []
Expand Down
14 changes: 14 additions & 0 deletions app/helpers/detailed-date.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { helper } from '@ember/component/helper';

export default helper(function detailedDate([datetime]/*, hash*/) {
//If not a date (e.g. date is undefined) return "" for printing on screen.
if (!(datetime instanceof Date)) return "";

try {
return Intl.DateTimeFormat("nl-BE", { dateStyle: "short", timeStyle: "short" }).format(datetime);
}
catch(e) {
console.error(e);
return "";
}
});
17 changes: 17 additions & 0 deletions app/helpers/human-friendly-date.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { helper } from '@ember/component/helper';
import formatRelative from 'date-fns/formatRelative';
import { nl } from 'date-fns/locale';

// this is a helper to mimic the moment-calendar behaviour
export default helper(function humanFriendlyDate([referenceDatetime]/*, hash*/) {
//If not a date (e.g. date is undefined) return "" for printing on screen.
if (!(referenceDatetime instanceof Date)) return "";

try {
return formatRelative(referenceDatetime, new Date(), { locale: nl });
}
catch(e) {
console.error(e);
return "";
}
});
14 changes: 14 additions & 0 deletions app/helpers/plain-date.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { helper } from '@ember/component/helper';

export default helper(function plainDate([datetime]/*, hash*/) {
//If not a date (e.g. date is undefined) return "" for printing on screen.
if (!(datetime instanceof Date)) return "";

try {
return Intl.DateTimeFormat("nl-BE", { dateStyle: "short" }).format(datetime);
}
catch(e) {
console.error(e);
return "";
}
});
3 changes: 0 additions & 3 deletions app/instance-initializers/intl.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@
// to set the locale
export function initialize(appInstance) {
const intl = appInstance.lookup('service:intl');
const moment = appInstance.lookup('service:moment');
const userLocale = ( navigator.language || navigator.languages[0] );
intl.setLocale([userLocale, 'nl-BE']);
flatpickr.localize(flatpickr.l10ns.nl);
moment.setTimeZone('Europe/Brussels');
moment.setLocale('nl');
}

export default {
Expand Down
Loading

0 comments on commit 1b2ad20

Please sign in to comment.