Skip to content

Commit

Permalink
Merge branch 'acceptance' of https://github.com/kanselarij-vlaanderen…
Browse files Browse the repository at this point in the history
…/kaleidos-frontend into development
  • Loading branch information
ValenberghsSven committed Mar 8, 2021
2 parents ff4707d + 7d1879c commit 26858d2
Show file tree
Hide file tree
Showing 11 changed files with 84 additions and 49 deletions.
5 changes: 4 additions & 1 deletion app/models/subcase.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,10 @@ export default ModelWithModifier.extend({

onAgendaInfo: computed('latestMeeting', async function() {
const latestMeeting = await this.get('latestMeeting');
return latestMeeting.plannedStart;
if (latestMeeting) {
return latestMeeting.plannedStart;
}
return null;
}),

approved: computed('treatments', 'treatments.@each.decisionResultCode', function() {
Expand Down
20 changes: 11 additions & 9 deletions app/pods/components/agenda/agenda-header/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@
</li>
<li class="vlc-dropdown-menu__separator" aria-hidden="true"></li>
{{/if}}
<li class="vlc-dropdown-menu__item">
{{#if (not currentSession.isFinal)}}
{{#if (await isSessionClosable)}}
{{#if (not currentSession.isFinal)}}
{{#if (await isSessionClosable)}}
<li class="vlc-dropdown-menu__item">
<a href=""
data-test-agenda-header-lockAgenda
class="vl-link vl-link--block vl-u-text--error"
Expand All @@ -90,8 +90,11 @@
>
{{t "agenda-close"}}
</a>
{{/if}}
{{else}}
</li>
<li class="vlc-dropdown-menu__separator" aria-hidden="true"></li>
{{/if}}
{{else}}
<li class="vlc-dropdown-menu__item">
<a href=""
data-test-agenda-header-unlockAgenda
class="vl-link vl-link--block"
Expand All @@ -100,13 +103,12 @@
>
{{t "agenda-reopen"}}
</a>
{{/if}}
</li>

</li>
<li class="vlc-dropdown-menu__separator" aria-hidden="true"></li>
{{/if}}
{{/if}}
{{!-- These actions check for isEditor/isAdmin themselves, so we put these outside the previous if statement --}}
{{#if (await canDeleteSelectedAgenda)}}
<li class="vlc-dropdown-menu__separator" aria-hidden="true"></li>
<li class="vlc-dropdown-menu__item vlc-dropdown-menu__item--action-danger">
<a href=""
data-test-agenda-header-deleteAgenda
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
{{#if this.textTooLong}}
<div class="auk-u-flex">
{{this.textAbbreviated}}
{{#if this.isCustom}}
<div class="{{@customTextClass}}" ...attributes>{{this.textAbbreviated}}</div>
{{else}}
{{this.textAbbreviated}}
{{/if}}
<WebComponents::AuButtonLink
@icon="circle-more"
@skin="mute"
@layout="icon-only">
@layout="icon-only"
class="auk-u-flex--vertical-center"
>
<EmberTooltip @tooltipClass="auk-tooltip">
{{@text}}
</EmberTooltip>
</WebComponents::AuButtonLink>
</div>
{{else}}
{{#if this.isCustom}}
<h4 class="auk-toolbar-complex__title" data-test-publication-detail-menu-short-title>
{{@text}}
</h4>
<div class="{{@customTextClass}}" ...attributes>{{@text}}</div>
{{else}}
{{@text}}
{{/if}}
Expand Down
41 changes: 25 additions & 16 deletions app/pods/publications/index/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
{{/if}}

{{#if this.filterTableColumnOptionKeys.numacNumberFilterOption}}
<th>{{t "numac-number"}}</th>
<th>{{t "publications-table-numacnummer-bs"}}</th>
{{/if}}

{{#if this.filterTableColumnOptionKeys.derivedPublicationTypeFilterOption}}
Expand Down Expand Up @@ -74,10 +74,6 @@
/>
{{/if}}

{{#if this.filterTableColumnOptionKeys.numacNuberBsFilterOption}}
<th>{{t "publications-table-numacnummer-bs"}}</th>
{{/if}}

{{#if this.filterTableColumnOptionKeys.caseManagerFilterOption}}
<th>{{t "publications-table-case-manager"}}</th>
{{/if}}
Expand Down Expand Up @@ -141,11 +137,15 @@
{{#if this.filterTableColumnOptionKeys.caseNameFilterOption}}
{{!-- There is legacy data were case does not have a shortTitle, we have to fall back to title --}}
<td class="auk-table__col--6">
{{if
row.case.shortTitle
row.case.shortTitle
(if row.case.title row.case.title (t "dash"))
}}
{{#if row.case.shortTitle}}
<WebComponents::AuAbbreviatedText @text={{row.case.shortTitle}} @size="150"/>
{{else}}
{{#if row.case.title}}
<WebComponents::AuAbbreviatedText @text={{row.case.title}} @size="150"/>
{{else}}
{{t "dash"}}
{{/if}}
{{/if}}
</td>
{{/if}}
{{#if this.filterTableColumnOptionKeys.publicationNumberFilterOption}}
Expand All @@ -160,14 +160,16 @@
{{#if this.filterTableColumnOptionKeys.numacNumberFilterOption}}
<td>
{{#each row.numacNumbers as |numac|}}
<WebComponents::AuPill>{{numac.name }}</WebComponents::AuPill>
<WebComponents::AuPill>{{numac.name}}</WebComponents::AuPill>
{{else}}
{{t "dash"}}
{{/each}}
</td>
{{/if}}
{{#if this.filterTableColumnOptionKeys.derivedPublicationTypeFilterOption}}
<td>
{{#if row.deducedType}}
{{ row.deducedType.label }}
{{row.deducedType.label}}
{{else}}
{{t "dash"}}
{{/if}}
Expand All @@ -190,14 +192,17 @@
{{#if this.filterTableColumnOptionKeys.finalPublicationDateFilterOption}}
<td class="auk-u-text-nowrap">
{{#if row.publishBefore}}
{{!-- TODO We want to check if the publication is still ongoing, no warnings for published/withdrawn --}}
{{#if
(is-between (moment-subtract row.publishBefore 2 precision='days') row.publishBefore)
}}
<div class="auk-form-help-text--warning">
<WebComponents::AuIcon @name="alert-triangle"/>
{{moment-format row.publishBefore "DD-MM-YYYY"}}
</div>
{{else if (is-before row.publishBefore now)}}
<div class="auk-form-help-text--danger">
<WebComponents::AuIcon @name="alert-triangle"/>
{{moment-format row.publishBefore "DD-MM-YYYY"}}
</div>
{{else}}
Expand Down Expand Up @@ -261,11 +266,11 @@
(eq (await row.translationRequestsFinished) (await row.translationRequestsTotal))
}}
<WebComponents::AuStatusPill @status="done">
{{ await row.translationRequestsFinished }} / {{ await row.translationRequestsTotal }}
{{await row.translationRequestsFinished}} / {{await row.translationRequestsTotal}}
</WebComponents::AuStatusPill>
{{else}}
<WebComponents::AuStatusPill @status="in-progress">
{{ await row.translationRequestsFinished }} / {{ await row.translationRequestsTotal }}
{{await row.translationRequestsFinished}} / {{await row.translationRequestsTotal}}
</WebComponents::AuStatusPill>
{{/if}}
{{else}}
Expand All @@ -288,11 +293,11 @@
(eq (await row.publishpreviewRequestsFinished) (await row.publishpreviewRequestsTotal))
}}
<WebComponents::AuStatusPill @status="done">
{{ await row.publishpreviewRequestsFinished }} / {{ await row.publishpreviewRequestsTotal }}
{{await row.publishpreviewRequestsFinished}} / {{await row.publishpreviewRequestsTotal}}
</WebComponents::AuStatusPill>
{{else}}
<WebComponents::AuStatusPill @status="in-progress">
{{ await row.publishpreviewRequestsFinished }} / {{ await row.publishpreviewRequestsTotal }}
{{await row.publishpreviewRequestsFinished}} / {{await row.publishpreviewRequestsTotal}}
</WebComponents::AuStatusPill>
{{/if}}
{{else}}
Expand All @@ -310,6 +315,8 @@
{{t "priority-procedure"}}
</p>
</EmberTooltip>
{{else}}
{{t "dash"}}
{{/if}}
</td>
{{/if}}
Expand All @@ -323,6 +330,8 @@
{{row.remark}}
</p>
</EmberTooltip>
{{else}}
{{t "dash"}}
{{/if}}
</td>
{{/if}}
Expand Down
11 changes: 9 additions & 2 deletions app/pods/publications/publication/case/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,20 @@ export default class CaseRoute extends Route.extend(AuthenticatedRouteMixin) {
const publicationFlow = parentHash.publicationFlow;
const _case = await publicationFlow.get('case');
const contactPersons = await publicationFlow.get('contactPersons');
const organizations = await this.store.query('organization', {});
// TODO This is not ideal, there are currently +- 60 organizations that come from ACM-IDM, they don't have a name
// TODO need a better filter, add a boolean to model maybe ?
const organizations = await this.store.query('organization', {
page: {
size: 200,
},
});
const filteredOrganizations = organizations.filter((orgs) => orgs.name);
return hash({
publicationFlow,
case: _case,
contactPersons: contactPersons,
refreshAction: parentHash.refreshAction,
organizations: organizations.toArray(),
organizations: filteredOrganizations.toArray(),
});
}
async afterModel(model) {
Expand Down
2 changes: 1 addition & 1 deletion app/pods/publications/publication/case/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@
@search={{this.customPowerSelectSearchFunction}}
@options={{await this.allOrganizations}}
@selected={{this.selectedOrganizations}}
@noMatchesMessage={{t "search-organization"}}
@noMatchesMessage={{t "organizations-empty-result"}}
@placeholder={{t "search-organization"}}
@onchange={{this.selectOrganization}}
as |organization|>
Expand Down
12 changes: 10 additions & 2 deletions app/pods/publications/publication/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,13 @@ export default class PublicationController extends Controller {

@action
allowedTranslationDate(date) {
// If translateBefore has expired, show that date (input is empty without this)
const translateBefore = this.model.publicationFlow.get('translateBefore');
if (translateBefore && moment(translateBefore).isBefore(moment())) {
if (moment(date).isSame(translateBefore)) {
return true;
}
}
const end = moment(this.model.publicationFlow.get('publishBefore'));
if (moment(date).isSameOrBefore(end) && moment(date).isSameOrAfter(moment())) {
return true;
Expand All @@ -181,8 +188,9 @@ export default class PublicationController extends Controller {
allowedPublicationDate(date) {
const end = moment().add(360, 'days');
let startRange;
if (this.model.publicationFlow.get('translateBefore')) {
startRange = moment(this.model.publicationFlow.get('translateBefore'));
const translateBefore = this.model.publicationFlow.get('translateBefore');
if (translateBefore && moment(translateBefore).isSameOrAfter(moment())) {
startRange = moment(translateBefore);
} else {
startRange = moment();
}
Expand Down
9 changes: 8 additions & 1 deletion app/pods/publications/publication/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@
this.casePath
}}
</span>
<WebComponents::AuAbbreviatedText @text={{this.titleText}} @size="150" @custom="true" />
<WebComponents::AuAbbreviatedText
data-test-publication-detail-menu-short-title
@text={{this.titleText}}
@size="150"
@custom="true"
@customTextClass="auk-toolbar-complex__title"
>
</WebComponents::AuAbbreviatedText>
<WebComponents::AuTabs @reversed="true">
<WebComponents::AuTab @isHierarchicalBack="true" @route="publications" data-test-publication-case-nav-go-back></WebComponents::AuTab>
<WebComponents::AuTab @route="publications.publication.case" data-test-publication-case-nav-case>{{t "agendaitem-case"}}</WebComponents::AuTab>
Expand Down
10 changes: 1 addition & 9 deletions cypress/integration/e2e/propagatie-overheid.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,7 @@ context('Propagation to other graphs', () => {
cy.closeAgenda();

cy.openDetailOfAgendaitem(subcaseTitle1);
cy.get(agenda.agendaitemDecisionTab).click();
cy.get(agenda.addDecision).click();
cy.get(agenda.uploadDecisionFile).click();
cy.contains('Document opladen').click();
cy.get('.vl-modal-dialog').as('fileUploadDialog');

cy.get('@fileUploadDialog').within(() => {
cy.uploadFile(file.folder, file.fileName, file.fileExtension);
});
cy.addDocumentToTreatment(file);

cy.get(form.formSave).click();
cy.get(agenda.accessLevelPill).click();
Expand Down
3 changes: 2 additions & 1 deletion cypress/support/commands/document-commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ function addLinkedDocumentToAgendaitem(filenames) {

filenames.forEach((name) => {
cy.get(document.searchForLinkedDocumentsInput).type(name);
cy.wait(200);
cy.wait(1000);
cy.get('.vl-modal .data-table [data-test-vl-checkbox-label]').click({
force: true,
});
Expand Down Expand Up @@ -523,6 +523,7 @@ function deleteSinglePiece(fileName, indexToDelete) {
}).wait('@putRestoreAgendaitems', {
timeout: 20000,
});
cy.wait(2000); // TODO, wait for loadpieces to happen
cy.log('/deleteSinglePiece');
}

Expand Down
6 changes: 4 additions & 2 deletions translations/nl-be.json
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,7 @@
"organization": "Organisatie",
"add-organization": "Organisatie toevoegen",
"search-organization": "Zoek een organisatie",
"organizations-empty-result": "Geen organisaties gevonden",
"contacts": "Contactpersonen",
"add-contact-persons": "Contactpersonen toevoegen",
"no-added-contact-persons": "Er zijn nog geen contactpersonen toegevoegd",
Expand Down Expand Up @@ -752,7 +753,7 @@
"translation-mail-header": "Bericht",
"files": "Bijlages",
"no-translation-requests": "Er zijn nog geen vertalingsaanvragen.",
"translation-requests": "Vertalingsaanvragen.",
"translation-requests": "Vertalingsaanvragen",
"no-publishpreview-requests": "Er zijn nog geen drukproefaanvragen.",
"no-corrections": "Er zijn nog geen verbeteringen toegevoegd.",
"add-correction": "Verbetering toevoegen",
Expand Down Expand Up @@ -808,5 +809,6 @@
"publications-table-derived-publicationtype-info": "Wordt afgeleid op basis van de documenten binnen de publicatie",
"filter-plural": "Filteren",
"reset": "Reset",
"to-case": "Naar dossier"
"to-case": "Naar dossier",
"config": "Instelling"
}

0 comments on commit 26858d2

Please sign in to comment.