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

Feature/kas 2219 headers publicaties grid #868

Merged
merged 15 commits into from
May 11, 2021
Merged
Show file tree
Hide file tree
Changes from 12 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
85 changes: 47 additions & 38 deletions app/config/publications/overview-table-columns.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,104 +2,113 @@ export default [
{
keyName: 'caseName',
translationKey: 'publications-table-case-name',
translationKeySmall: 'publications-table-case-name-small',
sortable: true,
showByDefault: true,
},
{
keyName: 'publicationNumber',
translationKey: 'publications-table-publication-number',
keyName: 'speedProcedure',
translationKey: 'publications-table-speed-procedure',
translationKeySmall: 'publications-table-speed-procedure-small',
sortable: true,
showByDefault: true,
},
{
keyName: 'decisionDate',
translationKey: 'publications-decision-date',
translationKeySmall: 'publications-decision-date-small',
sortable: true,
showByDefault: true,
},
{
keyName: 'numacNumber',
translationKey: 'publications-table-numacnummer-bs',
keyName: 'publicationNumber',
translationKey: 'publications-table-publication-number',
translationKeySmall: 'publications-table-publication-number-small',
showByDefault: true,
sortable: true,
},
{
keyName: 'regulationType',
translationKey: 'publications-table-regulation-type',
translationKeySmall: 'publications-table-regulation-type-small',
showByDefault: true,
sortable: true,
},
{
keyName: 'meetingDate',
translationKey: 'publications-table-on-meeting',
keyName: 'numacNumber',
translationKey: 'publications-table-numacnummer-bs',
translationKeySmall: 'publications-table-numacnummer-bs-small',
showByDefault: true,
sortable: true,
},
{
keyName: 'requestedPublicationDate',
translationKey: 'publications-table-requested-publication-date',
showByDefault: true,
sortable: true,
},
{
keyName: 'finalPublicationDate',
translationKey: 'publications-table-final-publication-date',
translationKeySmall: 'publications-table-requested-publication-date-small',
showByDefault: true,
sortable: true,
},
{
keyName: 'publicationDate',
translationKey: 'publications-table-publication-date',
translationKeySmall: 'publications-table-publication-date-small',
showByDefault: true,
sortable: true,
},
{
keyName: 'caseManager',
translationKey: 'publications-table-case-manager',
showByDefault: true,
},
{
keyName: 'lastEdited',
translationKey: 'publications-table-last-edited',
showByDefault: true,
sortable: true,
},
{
keyName: 'lastEditedBy',
translationKey: 'publications-table-last-edited-by',
showByDefault: true,
},
{
keyName: 'withdrawnDate',
translationKey: 'publications-table-withdrawn-date',
translationKeySmall: 'publications-table-withdrawn-date-small',
showByDefault: true,
sortable: true,
},
{
keyName: 'pauseDate',
translationKey: 'publications-table-pause-date',
translationKeySmall: 'publications-table-pause-date-small',
showByDefault: true,
sortable: true,
},
{
keyName: 'translateRequests',
translationKey: 'publications-table-translate-requests',
translationKeySmall: 'publications-table-translate-requests-small',
showByDefault: true,
sortable: true,
},
{
keyName: 'signRequests',
translationKey: 'publications-table-sign-requests',
keyName: 'publishPreviewRequests',
translationKey: 'publications-table-publish-preview-requests',
translationKeySmall: 'publications-table-publish-preview-requests-small',
showByDefault: true,
sortable: true,
},
{
keyName: 'publishPreviewRequests',
translationKey: 'publications-table-publish-preview-requests',
keyName: 'publishPreviewReady',
translationKey: 'publications-table-preview-ready',
translationKeySmall: 'publications-table-preview-ready-small',
showByDefault: true,
sortable: true,
},
{
keyName: 'speedProcedure',
translationKey: 'publications-table-speed-procedure',
keyName: 'lastEdited',
translationKey: 'publications-table-last-edited',
translationKeySmall: 'publications-table-last-edited-small',
showByDefault: true,
sortable: true,
},
{
keyName: 'comment',
translationKey: 'publications-table-comment',
keyName: 'lastEditedBy',
translationKey: 'publications-table-last-edited-by',
translationKeySmall: 'publications-table-last-edited-by-small',
showByDefault: true,
sortable: true,
},
{
keyName: 'fromDesignAgenda',
translationKey: 'publications-table-from-designagenda',
keyName: 'comment',
translationKey: 'publications-table-comment',
translationKeySmall: 'publications-table-comment-small',
showByDefault: true,
sortable: true,
}
];
23 changes: 20 additions & 3 deletions app/pods/publications/index/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ export default class PublicationsIndexController extends Controller {

@service publicationService;

page = 0;
size = 25;
@tracked page = 0;
@tracked size = 10;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Van @MikiDi geleerd dat er een issue is met @tracked query params in de Ember versie die we momenteel gebruiken. Voor query params gebruiken we dus nog de oude Ember-manier: geen @tracked en wijzigen via set('page', 5) uit @ember/object

sort = '-created';
sizeOptions = Object.freeze([5, 10, 25, 50, 100, 200]);
sizeOptions = [10, 25, 50, 100, 200];
urgencyLevels = CONFIG.URGENCY_LEVELS;

@tracked tableColumnDisplayOptions = JSON.parse(localStorage.getItem('tableColumnDisplayOptions'))
Expand Down Expand Up @@ -149,4 +149,21 @@ export default class PublicationsIndexController extends Controller {
await publicationFlow.save();
return publicationFlow;
}

@action
prevPage() {
if (this.page > 0) {
this.page = this.page - 1;
}
}

@action
nextPage() {
this.page = this.page + 1;
}

@action
setSizeOption(size) {
this.size = size;
}
}
23 changes: 9 additions & 14 deletions app/pods/publications/index/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default class PublicationsIndexRoute extends Route {
as: 'sorteer',
},
}

params;
statusFilters = Object.freeze({ // map filter name to concept uri
publishedFilterOption: CONSTANTS.PUBLICATION_STATUSES.PUBLISHED,
pausedFilterOption: CONSTANTS.PUBLICATION_STATUSES.PAUSED,
Expand All @@ -34,7 +34,11 @@ export default class PublicationsIndexRoute extends Route {
async model(params) {
const statusIds = [];
let ministerFilter = {};

this.params = params;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dit lijkt me niet meer nodig nu alles weer in 1 method zit

let apiSort;
const filter = {
':has:case': 'yes',
};
for (const statusFilter of Object.keys(this.statusFilters)) {
if (this.publicationFilter[statusFilter]) {
const status = await this.store.findRecordByUri('publication-status', this.statusFilters[statusFilter]);
Expand All @@ -54,23 +58,15 @@ export default class PublicationsIndexRoute extends Route {
};
}
}

const filter = {
':has:case': 'yes',
};

if (ministerFilter) {
filter.case = ministerFilter;
}

if (statusIds.length > 0) {
filter.status = {
':id:': statusIds.join(','),
};
}

let apiSort;
let qpSort = params.sort;
let qpSort = this.params.sort;
let descending;
if (qpSort) {
if (qpSort.startsWith('-')) {
Expand Down Expand Up @@ -99,13 +95,12 @@ export default class PublicationsIndexRoute extends Route {
apiSort = `-${apiSort}`;
}
}

return this.store.query('publication-flow', {
filter: filter,
sort: apiSort,
page: {
number: params.page,
size: params.size,
number: this.params.page,
size: this.params.size,
},
include: 'case,status,identification,identification.structured-identifier',
});
Expand Down
Loading