Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GN-4430: Don't allow editing agendapoint participants if votings are present #564

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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