-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1269 from kanselarij-vlaanderen/feature/KAS-2430-…
…gebruik-vergaderactiviteit-codelist-uit-backend-om-keuzelijst-op-te-stellen-in-frontend Feature/kas 2430 gebruik vergaderactiviteit codelist uit backend om keuzelijst op te stellen in frontend
- Loading branch information
Showing
24 changed files
with
155 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,18 @@ | ||
{{! TODO: octane-refactor }} | ||
{{! template-lint-disable no-action }} | ||
<div data-test-utils-kind-selector class="auk-form-group"> | ||
{{#if (not this.hideLabel)}} | ||
{{#if this.isLoading}} | ||
<div class="auk-u-text-muted"> | ||
{{t "please-be-patient"}} | ||
<div class="auk-loader" role="alert" aria-busy="true"></div> | ||
</div> | ||
{{else}} | ||
<div data-test-utils-kind-selector class="auk-form-group"> | ||
<Auk::Label>{{t "kind"}}</Auk::Label> | ||
{{/if}} | ||
{{#if this.isLoading}} | ||
<div class="auk-u-text-muted"> | ||
{{t "please-be-patient"}} | ||
<div class="auk-loader" role="alert" aria-busy="true"></div> | ||
</div> | ||
{{else}} | ||
<PowerSelect | ||
@options={{this.options}} | ||
@selected={{this.selectedkind}} | ||
@onChange={{action "setAction"}} | ||
@selected={{@selectedKind}} | ||
@onChange={{@onChange}} | ||
as |option| | ||
> | ||
{{option.label}} | ||
</PowerSelect> | ||
{{/if}} | ||
</div> | ||
</div> | ||
{{/if}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,42 @@ | ||
/* eslint-disable ember/no-arrow-function-computed-properties */ | ||
// TODO: octane-refactor | ||
// eslint-disable-next-line ember/no-classic-components | ||
import Component from '@ember/component'; | ||
import CONFIG from 'frontend-kaleidos/utils/config'; | ||
import EmberObject, { computed } from '@ember/object'; | ||
import Component from '@glimmer/component'; | ||
import { tracked } from '@glimmer/tracking'; | ||
import { inject as service } from '@ember/service'; | ||
import { task } from 'ember-concurrency'; | ||
import CONSTANTS from '../../config/constants'; | ||
import { PAGE_SIZE } from 'frontend-kaleidos/config/config'; | ||
|
||
// TODO: octane-refactor | ||
// eslint-disable-next-line ember/no-classic-classes, ember/require-tagless-components | ||
export default Component.extend({ | ||
classNames: ['auk-u-mb-2'], | ||
isLoading: null, | ||
hideLabel: null, | ||
/** | ||
* @argument {Concept} selectedKind The meeting kind to set the dropdown to | ||
* @argument {function} onChange Action to perform once a meeting kind has been selected | ||
* @argument {boolean} disabled | ||
*/ | ||
export default class UtilsKindSelector extends Component { | ||
@service store; | ||
|
||
options: computed(() => CONFIG.MINISTERRAAD_TYPES.TYPES.map((meetingType) => EmberObject.create(meetingType))), | ||
@tracked options; | ||
|
||
selectedkind: computed('kind.uri', 'options', function() { | ||
return this.options.find((kind) => this.kind && kind.uri === this.kind.uri) || this.options.get('firstObject'); | ||
}), | ||
constructor() { | ||
super(...arguments); | ||
|
||
// TODO: octane-refactor | ||
// eslint-disable-next-line ember/no-actions-hash | ||
actions: { | ||
setAction(meetingType) { | ||
this.set('selectedkind', meetingType); | ||
this.setAction(meetingType.get('uri')); | ||
}, | ||
}, | ||
}); | ||
this.loadKinds.perform(); | ||
} | ||
|
||
get isLoading() { | ||
return this.args.isLoading || this.loadKinds.isRunning; | ||
} | ||
|
||
@task | ||
*loadKinds() { | ||
this.options = yield this.store.query('concept', { | ||
filter: { | ||
'concept-schemes': { | ||
':uri:': CONSTANTS.CONCEPT_SCHEMES.VERGADERACTIVITEIT, | ||
}, | ||
':has-no:narrower': true, // Only the most specific concepts, i.e. the actual meeting kinds (so no "Annex") | ||
}, | ||
include: 'broader,narrower', | ||
'page[size]': PAGE_SIZE.CODE_LISTS, | ||
sort: 'position', | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ export const PAGE_SIZE = { | |
PIECES: 500, | ||
ACTIVITIES: 500, | ||
CASES: 500, | ||
|
||
SELECT: 10, | ||
}; | ||
|
||
|
Oops, something went wrong.