diff --git a/app/config/publications/overview-table-columns.js b/app/config/publications/overview-table-columns.js index 7167dcc9df..207ac404ad 100644 --- a/app/config/publications/overview-table-columns.js +++ b/app/config/publications/overview-table-columns.js @@ -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, } + + ]; diff --git a/app/pods/publications/index/controller.js b/app/pods/publications/index/controller.js index 7283113c34..20abbfa288 100644 --- a/app/pods/publications/index/controller.js +++ b/app/pods/publications/index/controller.js @@ -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')) @@ -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); + } } diff --git a/app/pods/publications/index/route.js b/app/pods/publications/index/route.js index d6c5328a79..f62125e70a 100644 --- a/app/pods/publications/index/route.js +++ b/app/pods/publications/index/route.js @@ -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]); @@ -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) { @@ -99,7 +94,6 @@ export default class PublicationsIndexRoute extends Route { apiSort = `-${apiSort}`; } } - return this.store.query('publication-flow', { filter: filter, sort: apiSort, diff --git a/app/pods/publications/index/template.hbs b/app/pods/publications/index/template.hbs index c0e296e353..5ba2c2e737 100644 --- a/app/pods/publications/index/template.hbs +++ b/app/pods/publications/index/template.hbs @@ -10,7 +10,7 @@ - + @@ -21,297 +21,305 @@ + (fn this.showPublicationModal)}}> {{t "publications-new"}} -
-
- - - - - {{#each this.tableColumns as |column|}} - {{#if (get this.tableColumnDisplayOptions column.keyName)}} +
+
+
+ {{#if (gt this.model.length 0) }} + + + + {{#each this.tableColumns as |column|}} + {{#if (get this.tableColumnDisplayOptions column.keyName)}} {{!-- first cases that need a special treament. The "else" clause treats the default case --}} - {{#if (eq column.keyName "caseName")}} - {{!-- TODO not a clean solution using style inline, need an auk-u class for this --}} - - {{else}} - {{#if column.sortable}} - - {{else}} - + {{#if (eq column.keyName "caseName")}} + + {{else}} + {{#if column.sortable}} + + {{else}} + + {{/if}} + {{/if}} {{/if}} - {{/if}} - {{/if}} - {{/each}} - - - - {{#if this.tableColumnDisplayOptions.caseName}} - {{!-- There is legacy data were case does not have a shortTitle, we have to fall back to title --}} - - {{/if}} - {{#if this.tableColumnDisplayOptions.publicationNumber}} - - {{/if}} - {{#if this.tableColumnDisplayOptions.numacNumber}} - - {{/if}} - {{#if this.tableColumnDisplayOptions.regulationType}} - - {{/if}} - {{#if this.tableColumnDisplayOptions.meetingDate}} - - {{/if}} - {{#if this.tableColumnDisplayOptions.requestedPublicationDate}} - - {{/if}} - {{#if this.tableColumnDisplayOptions.finalPublicationDate}} - - {{/if}} - {{#if this.tableColumnDisplayOptions.publicationDate}} - - {{/if}} - - {{#if this.tableColumnDisplayOptions.caseManager}} - - {{/if}} - - {{#if this.tableColumnDisplayOptions.lastEdited}} - - {{/if}} - - - {{#if this.tableColumnDisplayOptions.lastEditedBy}} - - {{/if}} - - {{#if this.tableColumnDisplayOptions.withdrawnDate}} - - {{/if}} - - {{#if this.tableColumnDisplayOptions.pauseDate}} - - {{/if}} - - {{#if this.tableColumnDisplayOptions.translateRequests}} - + + + + {{#each this.model as |row|}} + + {{#if this.tableColumnDisplayOptions.caseName}} + {{!-- There is legacy data were case does not have a shortTitle, we have to fall back to title --}} + {{/if}} - {{else}} - - {{/if}} - - {{/if}} - - - - {{#if this.tableColumnDisplayOptions.signRequests}} - - {{/if}} - {{#if this.tableColumnDisplayOptions.publishPreviewRequests}} - {{/if}} - {{else}} - - {{/if}} - - {{/if}} - - {{#if this.tableColumnDisplayOptions.speedProcedure}} - - {{/if}} - - {{#if this.tableColumnDisplayOptions.comment}} - - {{/if}} - {{#if this.tableColumnDisplayOptions.fromDesignAgenda}} - - {{/if}} - - - - + {{#if this.tableColumnDisplayOptions.speedProcedure}} + + {{/if}} + {{#if this.tableColumnDisplayOptions.decisionDate}} + + {{/if}} + {{#if this.tableColumnDisplayOptions.publicationNumber}} + + {{/if}} + {{#if this.tableColumnDisplayOptions.regulationType}} + + {{/if}} + {{#if this.tableColumnDisplayOptions.numacNumber}} + + {{/if}} + {{#if this.tableColumnDisplayOptions.requestedPublicationDate}} + + {{/if}} + {{#if this.tableColumnDisplayOptions.requestedTranslationDate}} + + {{/if}} + {{#if this.tableColumnDisplayOptions.publicationDate}} + + {{/if}} + {{#if this.tableColumnDisplayOptions.translateRequests}} + + {{/if}} + {{#if this.tableColumnDisplayOptions.publishPreviewRequests}} + + {{/if}} + {{#if this.tableColumnDisplayOptions.lastEdited}} + + {{/if}} + {{#if this.tableColumnDisplayOptions.lastEditedBy}} + + {{/if}} + {{#if this.tableColumnDisplayOptions.previewTranslator}} + + {{/if}} + {{#if this.tableColumnDisplayOptions.status}} + + {{/if}} + {{#if this.tableColumnDisplayOptions.source}} + + {{/if}} + {{#if this.tableColumnDisplayOptions.signStatus}} + + {{/if}} + + + {{/each}} + +
- {{t column.translationKey}} - {{t column.translationKey}}{{t column.translationKeySmall}} -   - - {{#if row.case.shortTitle}} - - {{else}} - {{#if row.case.title}} - - {{else}} - {{t "dash"}} - {{/if}} - {{/if}} - - {{#if row.identification.idName}} - {{row.identification.idName}} - {{else}} - {{t "dash"}} - {{/if}} - - {{#each row.numacNumbers as |numac|}} - {{numac.idName}} - {{else}} - {{t "dash"}} {{/each}} - - {{#if row.regulationType}} - {{row.regulationType.label}} - {{else}} - {{t "dash"}} - {{/if}} - - {{t "dash"}} - - {{#if row.publishDateRequested}} - {{moment-format row.publishDateRequested "DD-MM-YYYY"}} - {{else}} - {{t "dash"}} - {{/if}} - - {{#if row.publishBefore}} - {{!-- TODO We want to check if the publication is still ongoing, no warnings for published/withdrawn --}} - - {{else}} - {{t "dash"}} - {{/if}} - - {{if - row.publishedAt - (moment-format row.publishedAt "DD-MM-YYYY") - (t "dash") - }} - - {{t "dash"}} - - {{moment-format row.modified "DD-MM-YYYY"}}
- - {{moment-format row.modified "HH:mm"}} - -
- {{t "dash"}} - - {{#if row.status.isWithdrawn }} - {{moment-format row.publicationStatusChange.startedAt "DD-MM-YYYY"}} -
- - {{moment-format row.publicationStatusChange.startedAt "HH:mm"}} - - {{else}} - {{t "dash"}} - {{/if}} -
- {{#if row.status.isPaused}} - {{moment-format row.publicationStatusChange.startedAt "DD-MM-YYYY"}} -
- - {{moment-format row.publicationStatusChange.startedAt "HH:mm"}} - - {{else}} - {{t "dash"}} - {{/if}} -
- {{#if (gt (await row.translationRequestsTotal) 0)}} - {{#if - (eq (await row.translationRequestsFinished) (await row.translationRequestsTotal)) - }} - - {{await row.translationRequestsFinished}} / {{await row.translationRequestsTotal}} - - {{else}} - - {{await row.translationRequestsFinished}} / {{await row.translationRequestsTotal}} - +  
+ {{#if row.case.shortTitle}} + + {{else}} + {{#if row.case.title}} + + {{else}} + {{t "dash"}} + {{/if}} + {{/if}} + - {{t "dash"}} - - {{#if (gt (await row.publishpreviewRequestsTotal) 0)}} - {{#if - (eq (await row.publishpreviewRequestsFinished) (await row.publishpreviewRequestsTotal)) - }} - - {{await row.publishpreviewRequestsFinished}} / {{await row.publishpreviewRequestsTotal}} - - {{else}} - - {{await row.publishpreviewRequestsFinished}} / {{await row.publishpreviewRequestsTotal}} - + {{#if this.tableColumnDisplayOptions.comment}} + + {{#if row.remark}} + + +

+ {{row.remark}} +

+
+ {{else}} + {{t "dash"}} + {{/if}} +
- {{#if row.urgencyLevel.isUrgent}} - - -

- {{t "priority-procedure"}} -

-
- {{else}} - {{t "dash"}} - {{/if}} -
- {{#if row.remark}} - - -

- {{row.remark}} -

-
- {{else}} - {{t "dash"}} - {{/if}} -
- {{t "dash"}} - - - - - + {{#if row.urgencyLevel.isUrgent}} + + +

+ {{t "priority-procedure"}} +

+
+ {{else}} + {{t "dash"}} + {{/if}} +
+ {{t "dash"}} + + {{#if row.identification.idName}} + {{row.identification.idName}} + {{else}} + {{t "dash"}} + {{/if}} + + {{#if row.regulationType}} + {{row.regulationType.label}} + {{else}} + {{t "dash"}} + {{/if}} + + {{#each row.numacNumbers as |numac|}} + {{numac.name}} + {{else}} + {{t "dash"}} + {{/each}} + + {{#if row.publishDateRequested}} + {{moment-format row.publishDateRequested "DD-MM-YYYY"}} + {{else}} + {{t "dash"}} + {{/if}} + + {{t "dash"}} + + {{if row.publishedAt (moment-format row.publishedAt "DD-MM-YYYY") (t "dash") }} + + {{#if (gt (await row.translationRequestsTotal) 0)}} + {{#if + (eq (await row.translationRequestsFinished) (await row.translationRequestsTotal)) + }} + + {{await row.translationRequestsFinished}} / {{await row.translationRequestsTotal}} + + {{else}} + + {{await row.translationRequestsFinished}} / {{await row.translationRequestsTotal}} + + {{/if}} + {{else}} + + {{/if}} + + {{#if (gt (await row.publishpreviewRequestsTotal) 0)}} + {{#if + (eq (await row.publishpreviewRequestsFinished) (await row.publishpreviewRequestsTotal)) + }} + + {{await row.publishpreviewRequestsFinished}} / {{await row.publishpreviewRequestsTotal}} + + {{else}} + + {{await row.publishpreviewRequestsFinished}} / {{await row.publishpreviewRequestsTotal}} + + {{/if}} + {{else}} + + {{/if}} + + {{moment-format row.modified "DD-MM-YYYY"}}
+ + {{moment-format row.modified "HH:mm"}} + +
+ {{t "dash"}} + + {{t "dash"}} + + {{#if row.status }} + {{row.status.label}} + {{#if (or row.status.isWithdrawn row.status.isPaused) }} +
+ + {{moment-format row.publicationStatusChange.startedAt "DD-MM-YYYY HH:mm"}} + + {{/if}} + {{else}} + {{t "dash"}} + {{/if}} +
+ {{t "dash"}} + + {{t "dash"}} + + + + +
+ {{else }} + + + + + + {{/if}} +
+
+
+
+
+
+
+
+
+
+ {{!-- TODO Fix pagination --}} + +
+
+
+
+
+

{{t "amount-showed"}}

+ + {{option}} + +
+
+
+ +
+
{{#if this.isShowPublicationModal}} + @onCancel={{this.closePublicationModal}} + @onSave={{this.saveNewPublication}} /> {{/if}} {{#if this.isShowPublicationFilterModal}} + @filter={{this.publicationFilter}} + @onCancel={{this.cancelPublicationsFilter}} + @onSave={{this.savePublicationsFilter}} /> {{/if}} {{#if this.showTableDisplayOptions}} {{/if}} {{!-- LOADER --}} {{#if this.showLoader}} - + {{/if}} \ No newline at end of file diff --git a/app/styles/au-kaleidos-css/_auk-additions.scss b/app/styles/au-kaleidos-css/_auk-additions.scss index ccfdf54ed3..4ebb50366b 100644 --- a/app/styles/au-kaleidos-css/_auk-additions.scss +++ b/app/styles/au-kaleidos-css/_auk-additions.scss @@ -323,3 +323,10 @@ margin: 0 !important; } } + +/* Publications table + ========================================================================== */ + +.auk-case-name-header{ + min-width: 25rem +} diff --git a/translations/nl-be.json b/translations/nl-be.json index 6c542f345c..2df209d842 100644 --- a/translations/nl-be.json +++ b/translations/nl-be.json @@ -785,28 +785,43 @@ "number-point-title": "{number}. {title}", "publications-filter": "Filter publicaties", "source": "Bron", - "publications-table-case-name" : "Dossiernaam (Korte titel)", - "publications-table-publication-number" : "Publicatienummer", - "publications-table-regulation-type" : "Type regelgeving", - "publications-table-on-meeting" : "Geagendeerd op Ministerraad", - "publications-table-title-subcase" : "Dossiernaam (Lange titel)", - "publications-table-requested-publication-date" : "Gewenste publicatie", - "publications-table-final-publication-date" : "Uiterste publicatie", - "publications-table-publication-date" : "Publicatiedatum", - "publications-table-actual-publication-date" : "Effectieve publicatiedatum", - "publications-table-numacnummer-bs" : "Werknummer BS", - "publications-table-case-manager" : "Dossierbeheerder", + "publications-decision-date": "Datum beslissing of ondertekening", + "publications-decision-date-small": "Datum beslissing", + "publications-setting-show-columns-modal-title" : "Weergave instellingen", + "publications-table-case-name" : "Korte titel", + "publications-table-case-name-small" : "Korte titel", + "publications-table-comment" : "Opmerking", + "publications-table-comment-small" : "Opm.", "publications-table-last-edited" : "Laatst gewijzigd", "publications-table-last-edited-by" : "Laatst gewijzigd door", - "publications-table-withdrawn-date" : "Intrekdatum", - "publications-table-pause-date" : "Pauzeerdatum", - "publications-table-translate-requests" : "Vertalingaanvragen", - "publications-table-sign-requests" : "Handtekenaanvragen", - "publications-table-publish-preview-requests" : "Drukproefaanvragen", + "publications-table-last-edited-by-small" : "Laatst gew. door", + "publications-table-last-edited-small" : "Laatst gewijzigd", + "publications-table-numacnummer-bs" : "Werknummer Belgisch Staatblad", + "publications-table-numacnummer-bs-small" : "Numac", + "publications-table-publication-date" : "Publicatiedatum", + "publications-table-publication-date-small" : "Pub. BS", + "publications-table-publication-number" : "Publicatienummer", + "publications-table-publication-number-small" : "Pubnr.", + "publications-table-publish-preview-requests" : "Drukproef status", + "publications-table-publish-preview-requests-small" : "Proef", + "publications-table-regulation-type" : "Type Regelgeving", + "publications-table-regulation-type-small" : "Type Reg.", + "publications-table-requested-publication-date" : "Gevraagde publicatiedatum", + "publications-table-requested-publication-date-small" : "Gevr. Pub.", "publications-table-speed-procedure" : "Spoedprocedure", - "publications-table-comment" : "Opmerking", - "publications-setting-show-columns-modal-title" : "Weergave instellingen", - "publications-table-from-designagenda" : "Uit ontwerpagenda", + "publications-table-speed-procedure-small" : "Sp.?", + "publications-table-translate-requests" : "Vertaling status", + "publications-table-translate-requests-small" : "Vert.", + "publications-table-requested-translation": "Gevraagde vertaaldatum", + "publications-table-requested-translation-small": "Gevr. Vert.", + "publications-table-preview-translator": "Drukproef verbeteraar", + "publications-table-preview-translator-small": "Verbeteraar", + "publications-table-status": "Status", + "publications-table-status-small": "Status", + "publications-table-source": "Bron", + "publications-table-source-small": "Bron", + "publications-table-sign-status": "Handteken status", + "publications-table-sign-status-small": "Getekend", "show-filter": "Toon filter", "filter-plural": "Filteren", "reset": "Reset",