Skip to content

Commit

Permalink
GN-4430: Don't allow editing agendapoint participants if votings are …
Browse files Browse the repository at this point in the history
…present (#564)

Co-authored-by: Ruben <[email protected]>
  • Loading branch information
x-m-el and Ruben authored Sep 6, 2023
1 parent c53d617 commit fe40765
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/components/behandeling-van-agendapunt.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@
@onSave={{this.saveParticipants}}
@meeting={{@meeting}}
@modalTitle={{t "behandeling-van-agendapunten.participation-list-button"}}
@readOnly={{not this.editable}}
@readOnly={{or (not this.editable) (not this.canEditParticipants)}}
@readOnlyText={{unless this.canEditParticipants (t "behandeling-van-agendapunten.cannot-edit-participants")}}
/>
{{/if}}

Expand Down
4 changes: 4 additions & 0 deletions app/components/behandeling-van-agendapunt.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ export default class BehandelingVanAgendapuntComponent extends Component {
return !(this.published || this.args.readOnly);
}

get canEditParticipants() {
return this.behandeling.stemmingen.length === 0;
}

get documentContainer() {
return this.args.behandeling.documentContainer;
}
Expand Down
12 changes: 12 additions & 0 deletions app/components/participation-list.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,18 @@
{{@modalTitle}}
</AuButton>
{{/unless}}
{{#if (and @readOnly @readOnlyText)}}
<AuButton
@width="block"
@skin="secondary"
@icon="cross"
@iconAlignment="left"
class="au-u-margin-top-small"
@disabled={{true}}
>
{{@readOnlyText}}
</AuButton>
{{/if}}

<ParticipationList::Modal
@chairman={{this.defaultedChairman}}
Expand Down
1 change: 1 addition & 0 deletions translations/en-us.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ behandeling-van-agendapunten:
voting-title: "Voting"
content-title: "Content"
needs-participants: Please configure the participants to this agenda-item before adding a voting.
cannot-edit-participants: Cannot configure participants if votings exist for this agenda item.
edit-document: "Edit document"

contact:
Expand Down
1 change: 1 addition & 0 deletions translations/nl-BE.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ behandeling-van-agendapunten:
voting-title: "Stemming"
content-title: "Inhoud"
needs-participants: Configureer de aanwezigen bij dit agendapunt alvorens een stemming toe te voegen.
cannot-edit-participants: Aanwezigen zijn niet aanpasbaar als er al een stemming plaatsvond.
edit-document: "Bewerk document"

contact:
Expand Down

0 comments on commit fe40765

Please sign in to comment.