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 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
102 changes: 64 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,130 @@ 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: 'comment',
translationKey: 'publications-table-comment',
translationKeySmall: 'publications-table-comment-small',
showByDefault: true,
sortable: true,
},
{
keyName: 'numacNumber',
translationKey: 'publications-table-numacnummer-bs',
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: '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',
translationKeySmall: 'publications-table-requested-publication-date-small',
showByDefault: true,
sortable: true,
},
{
keyName: 'finalPublicationDate',
translationKey: 'publications-table-final-publication-date',
keyName: 'requestedTranslationDate',
translationKey: 'publications-table-requested-translation',
translationKeySmall: 'publications-table-requested-translation-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',
keyName: 'translateRequests',
translationKey: 'publications-table-translate-requests',
translationKeySmall: 'publications-table-translate-requests-small',
showByDefault: true,
sortable: true,
},
{
keyName: 'publishPreviewRequests',
translationKey: 'publications-table-publish-preview-requests',
translationKeySmall: 'publications-table-publish-preview-requests-small',
showByDefault: true,
sortable: true,
},
{
keyName: 'lastEdited',
translationKey: 'publications-table-last-edited',
translationKeySmall: 'publications-table-last-edited-small',
showByDefault: true,
sortable: true,
},
{
keyName: 'lastEditedBy',
translationKey: 'publications-table-last-edited-by',
showByDefault: true,
},
{
keyName: 'withdrawnDate',
translationKey: 'publications-table-withdrawn-date',
translationKeySmall: 'publications-table-last-edited-by-small',
showByDefault: true,
sortable: true,
},

{
keyName: 'pauseDate',
translationKey: 'publications-table-pause-date',
keyName: 'previewTranslator',
translationKey: 'publications-table-preview-translator',
translationKeySmall: 'publications-table-preview-translator-small',
showByDefault: true,
sortable: true,
},
{
keyName: 'translateRequests',
translationKey: 'publications-table-translate-requests',
showByDefault: true,
},
{
keyName: 'signRequests',
translationKey: 'publications-table-sign-requests',
showByDefault: true,
},
{
keyName: 'publishPreviewRequests',
translationKey: 'publications-table-publish-preview-requests',
showByDefault: true,
},
{
keyName: 'speedProcedure',
translationKey: 'publications-table-speed-procedure',
keyName: 'status',
translationKey: 'publications-table-status',
translationKeySmall: 'publications-table-status-small',
showByDefault: true,
sortable: true,
},
{
keyName: 'comment',
translationKey: 'publications-table-comment',
keyName: 'source',
translationKey: 'publications-table-source',
translationKeySmall: 'publications-table-source-small',
showByDefault: true,
sortable: true,
},
{
keyName: 'fromDesignAgenda',
translationKey: 'publications-table-from-designagenda',
keyName: 'signStatus',
translationKey: 'publications-table-sign-status',
translationKeySmall: 'publications-table-sign-status-small',
showByDefault: true,
sortable: true,
}


];
21 changes: 19 additions & 2 deletions app/pods/publications/index/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ export default class PublicationsIndexController extends Controller {
@service publicationService;

page = 0;
size = 25;
size = 10;
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.set('page', this.page - 1);
}
}

@action
nextPage() {
this.set('page', this.page + 1);
}

@action
setSizeOption(size) {
this.set('size', size);
}
}
14 changes: 4 additions & 10 deletions app/pods/publications/index/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ export default class PublicationsIndexRoute extends Route {
async model(params) {
const statusIds = [];
let ministerFilter = {};

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,22 +57,14 @@ 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 descending;
if (qpSort) {
Expand Down Expand Up @@ -99,7 +94,6 @@ export default class PublicationsIndexRoute extends Route {
apiSort = `-${apiSort}`;
}
}

return this.store.query('publication-flow', {
filter: filter,
sort: apiSort,
Expand Down
Loading