From 28fbfef18cc3b457f7020a70157ea7a4fff345d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thea=20Sch=C3=B6bl?= Date: Mon, 10 Oct 2022 12:44:56 +0000 Subject: [PATCH] fix: download events should respect selection fix: show indeterminate state for tree node when child is indeterminate --- cypress/integration/dashboard.spec.ts | 1 + .../data/chips/data/add-event-action-chip.component.ts | 5 ++++- src/app/modules/data/chips/tree-node.ts | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cypress/integration/dashboard.spec.ts b/cypress/integration/dashboard.spec.ts index 3461681f..2a1b570e 100644 --- a/cypress/integration/dashboard.spec.ts +++ b/cypress/integration/dashboard.spec.ts @@ -47,6 +47,7 @@ describe('dashboard', async function () { }), ); cy.wait('@search'); + cy.visit('/dashboard'); cy.get('.schedule-item-button').should('contain', 'UNIcert (Test)'); }); }); diff --git a/src/app/modules/data/chips/data/add-event-action-chip.component.ts b/src/app/modules/data/chips/data/add-event-action-chip.component.ts index fd917d09..cfce4eac 100644 --- a/src/app/modules/data/chips/data/add-event-action-chip.component.ts +++ b/src/app/modules/data/chips/data/add-event-action-chip.component.ts @@ -122,7 +122,10 @@ export class AddEventActionChipComponent implements OnDestroy { dismissAction: () => { modal.dismiss(); }, - dateSeries: this.selection.items, + dateSeries: this.selection.selection.children + .flatMap(it => it.children) + .filter(it => it.selected) + .map(it => it.item), }, }); diff --git a/src/app/modules/data/chips/tree-node.ts b/src/app/modules/data/chips/tree-node.ts index 07239bd4..2960272d 100644 --- a/src/app/modules/data/chips/tree-node.ts +++ b/src/app/modules/data/chips/tree-node.ts @@ -19,7 +19,7 @@ import {SCDateSeries} from '@openstapps/core'; export enum Selection { ON = 2, PARTIAL = 1, - OFF = 1, + OFF = 0, } /**