-
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 branch 'development' into DES/enhancement/#732-vlc-refactor
- Loading branch information
Showing
17 changed files
with
222 additions
and
188 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
42 changes: 42 additions & 0 deletions
42
app/components/publications/publication/documents/documents-filter.hbs
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<WebComponents::AuPanel> | ||
<WebComponents::AuPanel::Body class="auk-panel--editing"> | ||
<div class="auk-u-flex"> | ||
<div class="auk-form-group auk-u-maximize-width auk-u-mr-2"> | ||
<WebComponents::AuLabel for="blockInput">{{t "name-document" }}</WebComponents::AuLabel> | ||
<WebComponents::AuInput @value={{this.filter.documentName}} type="text" id="blockInput" @block="true" /> | ||
</div> | ||
<div class="auk-form-group auk-u-maximize-width auk-u-mr-2 auk-u-ml-2"> | ||
<WebComponents::AuLabel for="blockInput">{{t "file-extension" }}</WebComponents::AuLabel> | ||
<PowerSelectMultiple @options={{this.fileTypes}} @searchEnabled={{true}} | ||
@selected={{this.filter.fileTypes}} | ||
@onchange={{fn (mut this.filter.fileTypes)}} | ||
as | ||
|fileExtension|> | ||
{{fileExtension}} | ||
</PowerSelectMultiple> | ||
</div> | ||
<div class="auk-form-group auk-u-maximize-width auk-u-ml-2"> | ||
<WebComponents::AuLabel for="blockInput">{{t "file-type" }}</WebComponents::AuLabel> | ||
{{#unless this.loadDocumentTypes.isRunning}} | ||
<PowerSelectMultiple @options={{this.documentTypes}} @isSearchable={{false}} | ||
@selected={{this.filter.documentTypes}} | ||
@onchange={{fn (mut this.filter.documentTypes)}} | ||
as |pieceType|> | ||
{{get pieceType "label"}} | ||
</PowerSelectMultiple> | ||
{{/unless}} | ||
</div> | ||
</div> | ||
<div class="auk-u-flex auk-u-flex--justify-end"> | ||
<div> | ||
<WebComponents::AuButton data-test-publication-filter-reset @skin="secondary" {{on "click" this.reset}}> | ||
{{t "reset"}} | ||
</WebComponents::AuButton> | ||
<WebComponents::AuButton @icon="filter" data-test-publication-filter @skin="primary" | ||
{{on "click" this.apply}}> | ||
{{t "filter-plural"}} | ||
</WebComponents::AuButton> | ||
</div> | ||
</div> | ||
</WebComponents::AuPanel::Body> | ||
</WebComponents::AuPanel> |
57 changes: 57 additions & 0 deletions
57
app/components/publications/publication/documents/documents-filter.js
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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import Component from '@glimmer/component'; | ||
import { action } from '@ember/object'; | ||
import { inject } from '@ember/service'; | ||
import { tracked } from '@glimmer/tracking'; | ||
import { task } from 'ember-concurrency-decorators'; | ||
|
||
export default class PublicationsPublicationDocumentsFilterComponent extends Component { | ||
@inject store; | ||
@inject fileService; | ||
|
||
@tracked documentTypes = []; | ||
@tracked fileTypes = []; | ||
@tracked state; | ||
|
||
constructor(owner, args) { | ||
super(owner, args); | ||
|
||
// clone for internal use | ||
this.filter = this.args.filter.clone(); | ||
|
||
this.loadDocumentTypes.perform(); | ||
this.loadFileTypes.perform(); | ||
} | ||
|
||
@task | ||
*loadDocumentTypes() { | ||
if (!this.documentTypes.length) { | ||
this.documentTypes = yield this.store.query('document-type', { | ||
page: { | ||
size: 50, | ||
}, | ||
sort: 'priority', | ||
}); | ||
} | ||
} | ||
|
||
@task | ||
*loadFileTypes() { | ||
if (!this.fileTypes.length) { | ||
this.fileTypes = yield this.fileService.getFileExtensions(); | ||
} | ||
} | ||
|
||
@action | ||
reset() { | ||
this.filter.reset(); | ||
|
||
const filter = this.filter.clone(); | ||
this.args.onChange(filter); | ||
} | ||
|
||
@action | ||
apply() { | ||
const filter = this.filter.clone(); | ||
this.args.onChange(filter); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export default { | ||
ACCESS_LEVELS: { | ||
INTERN_REGERING: 'http://kanselarij.vo.data.gift/id/concept/toegangs-niveaus/d335f7e3-aefd-4f93-81a2-1629c2edafa3', | ||
INTERN_OVERHEID: 'http://kanselarij.vo.data.gift/id/concept/toegangs-niveaus/abe4c18d-13a9-45f0-8cdd-c493eabbbe29', | ||
PUBLIEK: 'http://kanselarij.vo.data.gift/id/concept/toegangs-niveaus/6ca49d86-d40f-46c9-bde3-a322aa7e5c8e', | ||
}, | ||
}; |
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
Oops, something went wrong.