Skip to content

Commit

Permalink
Merge pull request #361 from lblod/feature/read-only-on-published-not…
Browse files Browse the repository at this point in the history
…ulen

When the notulen is published disable the editing
  • Loading branch information
lagartoverde authored Nov 11, 2022
2 parents a8c60fc + 7dc214e commit 99f3cf0
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
5 changes: 5 additions & 0 deletions app/components/meeting-form.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
<AuToolbar @size="small" class="au-u-padding-top-none" as |Group|>
<Group>
<h1 class="au-c-app-chrome__title">{{t "meetingForm.scheduledText"}} {{plain-date @zitting.geplandeStart}}</h1>
{{#if this.isPublished}}
<AuPill @skin="success">
{{t "meetingForm.notulenPublished"}}
</AuPill>
{{/if}}
</Group>
<Group>
{{#unless this.readOnly}}
Expand Down
12 changes: 11 additions & 1 deletion app/components/meeting-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,16 @@ export default class MeetingForm extends Component {
@tracked possibleParticipants;
@tracked behandelingen;
@tracked headerArticleTranslationString = '';
@tracked isPublished = false;
@service store;
@service currentSession;
@service router;

get readOnly() {
return !this.currentSession.canWrite && this.currentSession.canRead;
return (
(!this.currentSession.canWrite && this.currentSession.canRead) ||
this.isPublished
);
}

constructor() {
Expand All @@ -46,6 +50,12 @@ export default class MeetingForm extends Component {
const classification = yield specialisedBestuursorgaan.get(
'classificatie'
);
const versionedNotulen = yield this.store.query('versioned-notulen', {
'filter[zitting][id]': this.zitting.get('id'),
});
if (versionedNotulen.firstObject) {
this.isPublished = true;
}
this.headerArticleTranslationString =
articlesBasedOnClassifcationMap[classification.get('uri')];
this.secretaris = yield this.zitting.get('secretaris');
Expand Down
1 change: 1 addition & 0 deletions translations/en-us.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ meetingForm:
fifthSectionNotFilledWarning: Manage your decision and votes.
sixthSectionNotFilledWarning: Fill outFree text (meeting outro).
bestuursorganNotSelectedWarning: Alvorens u verder kan gaan, dient de zitting eerst informatie te hebben over het bestuursorgaan.
notulenPublished: Meeting is published

meetings:
delete:
Expand Down
1 change: 1 addition & 0 deletions translations/nl-BE.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ meetingForm:
fifthSectionNotFilledWarning: Bewerk je besluiten en beheer de stemmingen
sixthSectionNotFilledWarning: Vull in vrie tekst (zitting outro).
bestuursorganNotSelectedWarning: Alvorens u verder kan gaan, dient de zitting eerst informatie te hebben over het bestuursorgaan.
notulenPublished: Notulen gepubliceerd

meetings:
delete:
Expand Down

0 comments on commit 99f3cf0

Please sign in to comment.