Skip to content

Commit

Permalink
Merge branch 'development' into DES/enhancement/#732-vlc-refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
brenner-company committed Apr 23, 2021
2 parents 595ee9a + 59ccd85 commit 5c3e50e
Show file tree
Hide file tree
Showing 14 changed files with 63 additions and 50 deletions.
14 changes: 2 additions & 12 deletions app/components/agenda/agenda-detail/sidebar-item.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,13 @@
</pre>
</h4>
{{#if (not @agendaitem.aboutToDelete)}}
{{#unless @isActive}}
{{#if (not @agendaitem.isApproval)}}
{{#if @agendaitem.shortTitle}} {{!-- Avoid rendering the same thing twice if no "shortTitle" exists --}}
<pre class="auk-u-text-pre-line">
{{@agendaitem.title}}
</pre>
{{/if}}
{{/if}}
{{/unless}}
<div>

<div class="auk-u-flex auk-u-flex--justify-between">
<div class="auk-u-flex auk-u-flex--align-end vlc-agenda-detail-sidebar-item__icon">
{{#if @isNew}}
<span class="vlc-agenda-meta__recently-added">
<WebComponents::AuIcon @name="calendar-new" @size="small" />
<EmberTooltip @side="top" @tooltipClass="tooltip-custom">
<EmberTooltip @side="top-start" @tooltipClass="tooltip-custom">
<p>
{{t "added-agendaitem-text"}}
</p>
Expand All @@ -59,7 +49,7 @@
{{#if (not this.newsletterIsVisible)}}
<span class="vlc-agenda-meta__recently-added">
<WebComponents::AuIcon @name="not-visible" @size="small" />
<EmberTooltip @side="top" @tooltipClass="tooltip-custom">
<EmberTooltip @side="top-start" @tooltipClass="tooltip-custom">
<p>
{{t "not-visible-in-newsletter"}}
</p>
Expand Down
2 changes: 1 addition & 1 deletion app/components/agenda/agenda-header.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
hideOn="clickout click"
showOn="click"
animation="shift"
placement="bottom"
placement="bottom-end"
as |attacher|
}}
<ul class="vlc-dropdown-menu">
Expand Down
1 change: 1 addition & 0 deletions app/components/agenda/agenda-overview.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
@previousAgenda={{@previousAgenda}}
@showFormallyOkStatus={{this.isDesignAgenda}}
@isEditingFormallyOkStatus={{this.isEditingOverview}}
@showDragHandle={{this.isDraggingEnabled}}
/>
</li>
{{/each}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
{{#if (not this.newsletterIsVisible)}}
<div class="auk-icon auk-icon--default vlc-u-opacity-50 auk-u-ml-2 opacity-lighter">
<i class="ki ki-not-visible"></i>
<EmberTooltip @side="top" @tooltipClass="tooltip-custom">
<EmberTooltip @side="top-end" @tooltipClass="tooltip-custom">
<p>
{{t "not-visible-in-newsletter"}}
</p>
Expand Down Expand Up @@ -143,7 +143,7 @@
{{#if @isNew}}
<div class="auk-icon auk-icon--default vlc-agenda-item__icons--margin">
<i class="ki ki-calendar-new"></i>
<EmberTooltip @side="top" @tooltipClass="tooltip-custom">
<EmberTooltip @side="top-end" @tooltipClass="tooltip-custom">
<p>
{{t "added-agendaitem-text"}}
</p>
Expand Down
4 changes: 2 additions & 2 deletions app/components/subcases/subcase-item.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
{{#if (is-pending @subcase.approved)}}
<div class="auk-badge auk-badge--default auk-badge--medium"></div>
{{else if (await @subcase.approved)}}
<div class="auk-badge auk-badge--success auk-badge--default auk-badge--medium vlc-procedure-step__badge">
<div data-test-case-overview-subcase-approved class="auk-badge auk-badge--success auk-badge--default auk-badge--medium vlc-procedure-step__badge">
<div class="auk-icon auk-icon--default">
<i class="ki ki-check"></i>
</div>
</div>
{{else}}
<div class="auk-badge auk-badge--warning auk-badge--medium vlc-procedure-step__badge">
<div data-test-case-overview-subcase-not-approved class="auk-badge auk-badge--warning auk-badge--medium vlc-procedure-step__badge">
<div class="auk-icon auk-icon--default">
<i class="ki ki-sitemap"></i>
</div>
Expand Down
39 changes: 19 additions & 20 deletions app/models/subcase.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { alias } from '@ember/object/computed';
import ModelWithModifier from 'frontend-kaleidos/models/model-with-modifier';

const {
attr, hasMany, belongsTo, PromiseArray, PromiseObject,
attr, hasMany, belongsTo, PromiseArray,
} = DS;

export default ModelWithModifier.extend({
Expand Down Expand Up @@ -144,25 +144,24 @@ export default ModelWithModifier.extend({
return null;
}),

approved: computed('treatments', '[email protected]', function() {
return PromiseObject.create({
promise: this.get('treatments').then((treatments) => {
if (treatments && treatments.get('length') > 0) {
const treatmentIds = treatments.map((treatment) => treatment.get('id')).join(',');
const drcIds = ['56312c4b-9d2a-4735-b0b1-2ff14bb524fd', '9f342a88-9485-4a83-87d9-245ed4b504bf'].join(',');
return this.store.query('agenda-item-treatment', {
filter: {
id: treatmentIds,
'decision-result-code': {
id: drcIds,
},
},
include: 'decision-result-code',
}).then((treatments) => treatments.get('firstObject'));
}
return null;
}),
});
approved: computed('treatments', '[email protected]', async function() {
const meeting = await this.get('requestedForMeeting');
if (meeting.isFinal) {
const treatments = await this.get('treatments');
if (treatments && treatments.get('length') > 0) {
const treatmentIds = treatments.map((treatment) => treatment.get('id')).join(',');
const approvedTreatment = await this.store.queryOne('agenda-item-treatment', {
'filter[id]': treatmentIds,
'filter[decision-result-code][:uri:]': CONFIG.DECISION_RESULT_CODE_URIS.GOEDGEKEURD,
});
const acknowledgedTreatment = await this.store.queryOne('agenda-item-treatment', {
'filter[id]': treatmentIds,
'filter[decision-result-code][:uri:]': CONFIG.DECISION_RESULT_CODE_URIS.KENNISNAME,
});
return !!approvedTreatment || !!acknowledgedTreatment;
}
}
return false;
}),

subcasesFromCase: computed('case.subcases.@each', function() {
Expand Down
2 changes: 1 addition & 1 deletion app/pods/agenda/agendaitems/index/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default class AgendaitemsAgendaController extends Controller {
// reorderedAgendaitems includes all items on the whole page. We only want to re-order within one category (nota/announcement/...)
const reorderedAgendaitemsOfCategory = reorderedAgendaitems.filter((item) => item.showAsRemark === draggedAgendaItem.showAsRemark);
yield setAgendaitemsPriority(reorderedAgendaitemsOfCategory, true, true); // permissions guarded in template (and backend)
this.refresh();
this.send('reloadModel');
}

@task
Expand Down
3 changes: 0 additions & 3 deletions app/styles/app.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
@import 'ember-power-select';
@import 'ember-vo-webuniversum-data-table';
// TODO: Deze fix is om ervoor te zetten dat de variabelen voor de ember-rdfa-editor op voorhand gezet worden zodat ze niett overschreven worden door de !default
@import 'fixes/fix-ember-rdfa-editor';
@import 'ember-rdfa-editor';
/* ==========================================================================
CSS file for Digikan
========================================================================== */
Expand Down
4 changes: 4 additions & 0 deletions app/styles/custom-components/_vlc-rdfa-editor.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Import custom config before 'ember-rdfa-editor' to overwrite !default's
@import '../fixes/fix-ember-rdfa-editor';
@import 'ember-rdfa-editor';

.rdfa-editor {
height: 30rem;
border: .1rem solid #BFC8D1;
Expand Down
1 change: 1 addition & 0 deletions app/styles/fixes/_fix-ember-rdfa-editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ $say-paper-sidebar: false;
$say-editor-background: white;
$say-toolbar-background: white;
$say-editor-padding: 1rem;
$say-font: $base-font;
29 changes: 21 additions & 8 deletions cypress/integration/all-flaky-tests/subcase.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,7 @@ context('Subcase tests', () => {
cy.proposeSubcaseForAgenda(agendaDate);

const monthDutch = getTranslatedMonth(agendaDate.month());
const realmonth = agendaDate.month() + 1; // Js month start at 0.
const paddedMonth = realmonth < 10 ? `0${realmonth}` : realmonth;
const dateFormat = `${agendaDate.date()} ${monthDutch} ${agendaDate.year()}`;
const dateFormatDotted = `${agendaDate.date()}.${paddedMonth}.${agendaDate.year()}`;
const dateRegex = new RegExp(`.?${Cypress.moment(agendaDate).date()}.\\w+.${Cypress.moment(agendaDate).year()}`);

cy.get('.vlc-status-timeline > li').eq(0)
Expand All @@ -87,7 +84,9 @@ context('Subcase tests', () => {
cy.get(cases.subcaseMeetingPlannedStart).contains(/Ingediend voor de agenda van/);
cy.get(cases.subcaseMeetingPlannedStart).contains(dateRegex);
cy.get(agenda.subcase.agendaLink).contains(dateFormat);
cy.get(cases.subcaseDecidedOn).contains(dateFormatDotted);
// The "decided on" field was already filled in right after proposing for agenda for a long time
// this field has been changed to take in account if the relevant meeting is final to show this info
cy.get(cases.subcaseDecidedOn).contains('Nog niet beslist');
// Deze test volgt het al dan niet default "beslist" zijn van een beslissing.
// Default = beslist, assert dotted date; default = niet beslist: assert "nog niet beslist".
cy.get(cases.subcaseRequestedBy).contains(/Hilde Crevits/);
Expand Down Expand Up @@ -139,17 +138,16 @@ context('Subcase tests', () => {
cy.proposeSubcaseForAgenda(agendaDate);

const monthDutch = getTranslatedMonth(agendaDate.month());
const realmonth = agendaDate.month() + 1; // Js month start at 0.
const paddedMonth = realmonth < 10 ? `0${realmonth}` : realmonth;
const dateFormat = `${agendaDate.date()} ${monthDutch} ${agendaDate.year()}`;
const dateFormatDotted = `${agendaDate.date()}.${paddedMonth}.${agendaDate.year()}`;
const dateRegex = new RegExp(`.?${Cypress.moment(agendaDate).date()}.\\w+.${Cypress.moment(agendaDate).year()}`);

cy.get(cases.subcaseMeetingNumber);
cy.get(cases.subcaseMeetingPlannedStart).contains(/Ingediend voor de agenda van/);
cy.get(cases.subcaseMeetingPlannedStart).contains(dateRegex);
cy.get(agenda.subcase.agendaLink).contains(dateFormat);
cy.get(cases.subcaseDecidedOn).contains(dateFormatDotted);
// The "decided on" field was already filled in right after proposing for agenda for a long time
// this field has been changed to take in account if the relevant meeting is final to show this info
cy.get(cases.subcaseDecidedOn).contains('Nog niet beslist');
// Deze test volgt het al dan niet default "beslist" zijn van een beslissing.
// Default = beslist, assert dotted date; default = niet beslist: assert "nog niet beslist".
cy.get(cases.subcaseRequestedBy).contains(/Hilde Crevits/);
Expand Down Expand Up @@ -354,4 +352,19 @@ context('Subcase tests', () => {
cy.get(agenda.item.themes).contains('Wonen')
.should('not.exist');
});

it('After finalizing agenda, subcase info should change to the approved status', () => {
const realmonth = agendaDate.month() + 1; // Js month start at 0.
const paddedMonth = realmonth < 10 ? `0${realmonth}` : realmonth;
const dateFormatDotted = `${agendaDate.date()}.${paddedMonth}.${agendaDate.year()}`;

cy.openAgendaForDate(agendaDate);
cy.setAllItemsFormallyOk(5);
cy.approveAndCloseDesignAgenda(true);

cy.visit('/dossiers/5F02E3F87DE3FC0008000002/deeldossiers');
cy.get(cases.overviewSubcaseInfo.approved).should('have.length', 3);
cy.openSubcase(2);
cy.get(cases.subcaseDecidedOn).contains(dateFormatDotted);
});
});
5 changes: 5 additions & 0 deletions cypress/selectors/case.selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,10 @@ const selectors = {
subcaseRequestedBy: '[data-test-subcase-requested-by]',
subcaseMeetingNumber: '[data-test-meeting-number]',
subcaseMeetingPlannedStart: '[data-test-meeting-plannedStart]',

overviewSubcaseInfo: {
approved: '[data-test-case-overview-subcase-approved]',
notApproved: '[data-test-case-overview-subcase-not-approved]',
},
};
export default selectors;
3 changes: 3 additions & 0 deletions ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ module.exports = function (defaults) {
sassOptions: {
extension: 'scss',
sourceMapEmbed: process.env.DEPLOY_ENV !== 'production',
includePaths: [
'node_modules/@lblod/ember-rdfa-editor/app/styles/', // as a workaround for https://github.com/ember-cli/ember-cli/issues/8026#issuecomment-420245390
],
},
flatpickr: {
locales: ['nl'],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "frontend-kaleidos",
"version": "5.7.0",
"version": "5.9.0",
"private": true,
"description": "Small description for frontend-kaleidos goes here",
"repository": "",
Expand Down

0 comments on commit 5c3e50e

Please sign in to comment.