Skip to content

Commit

Permalink
filter secretary so only active functions are shown
Browse files Browse the repository at this point in the history
  • Loading branch information
nvdk committed Mar 26, 2021
1 parent b217dbe commit fce0691
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
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}}
{{functionaris.bekleedt.rol.label}} (periode {{moment-format functionaris.start "MM/DD/YYYY"}} - {{moment-format functionaris.einde "MM/DD/YYYY"}})
</PowerSelect>
{{/if}}
5 changes: 4 additions & 1 deletion app/components/participation-list/functionaris-selector.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,13 @@ export default class ParticipationListFunctionarisSelectorComponent extends Comp
}
}
});
const startOfMeeting = this.args.meeting.gestartOpTijdstip ? this.args.meeting.gestartOpTijdstip : this.args.meeting.geplandeStart;
let queryParams = {
sort: 'is-bestuurlijke-alias-van.achternaam',
'filter[bekleedt][bevat-in][:id:]': bestuursorganen.map((b) => b.id).join(','),
'filter[:lte:start]': startOfMeeting.toISOString()
};
this.options = yield this.store.query('functionaris', queryParams);
const candidateOptions = yield this.store.query('functionaris', queryParams);
this.options = candidateOptions.reject((functionaris) => functionaris.einde && functionaris.einde < startOfMeeting);
}
}
1 change: 1 addition & 0 deletions app/components/participation-list/modal.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<ParticipationList::FunctionarisSelector
@onSelect={{this.selectSecretaris}}
@functionaris={{this.secretaris}}
@meeting={{@meeting}}
/>
</div>
<div>
Expand Down

0 comments on commit fce0691

Please sign in to comment.