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

added validation to meeting end date/time #276

Merged
merged 2 commits into from
May 19, 2022
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
5 changes: 4 additions & 1 deletion app/components/zitting/manage-zittingsdata.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@
</div>
<div>
<AuLabel>{{t "manageZittingsData.geeindigdOpTijdstipLabel"}}</AuLabel>
<DateTimePicker @alignment="top" @onChange={{fn this.changeDate 'geeindigdOpTijdstip'}} @value={{this.geeindigdOpTijdstip}}/>
<DateTimePicker @alignment="top" @onChange={{this.changeEndDate}} @value={{this.geeindigdOpTijdstip}} />
{{#if this.dateError}}
<AuPill @skin="warning" @draft={{true}} @icon="info-circle">{{t "meetingForm.dateWarning"}}</AuPill>
{{/if}}
</div>
</div>
</Modal.Body>
Expand Down
11 changes: 11 additions & 0 deletions app/components/zitting/manage-zittingsdata.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export default class ZittingManageZittingsdataComponent extends Component {
@tracked geeindigdOpTijdstip;
@tracked opLocatie;
@tracked bestuursorgaan;
@tracked dateError = false;

constructor() {
super(...arguments);
Expand Down Expand Up @@ -52,4 +53,14 @@ export default class ZittingManageZittingsdataComponent extends Component {
changeDate(targetProperty, value) {
this[targetProperty] = value;
}

@action
changeEndDate(value) {
if (value < this.gestartOpTijdstip) {
this.dateError = true;
} else {
this.geeindigdOpTijdstip = value;
this.dateError = false;
}
}
}
1 change: 1 addition & 0 deletions translations/en-us.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ behandelingVanAgendapunten:
needsParticipants: Please configure the participants to this agenda-item before adding a voting.
editDocument: "Edit document"
meetingForm:
dateWarning: You can't pick an end-date that is before the start date.
incompleteWarning: Please fill out the meeting details and add at least one agenda item before publishing.
backButton: Back to meetings
scheduledText: Meeting scheduled on
Expand Down
1 change: 1 addition & 0 deletions translations/nl-BE.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ behandelingVanAgendapunten:
needsParticipants: Configureer de aanwezigen bij dit agendapunt alvorens een stemming toe te voegen.
editDocument: "Bewerk document"
meetingForm:
dateWarning: U kunt geen einddatum kiezen die vóór de startdatum ligt.
incompleteWarning: Voor je kan doorgaan met publiceren is het nodig om een bestuursorgaan in te stellen en minstens 1 agendapunt toe te voegen.
backButton: Terug naar overzicht zittingen
scheduledText: Zitting gepland op
Expand Down