From 7cc6bb4282ad092d85d5bd7116ca83081b0780a6 Mon Sep 17 00:00:00 2001 From: Bastien DUMONT <bdumont@grandlyon.com> Date: Fri, 9 Dec 2022 09:41:27 +0000 Subject: [PATCH] fix: retours canary 2.0.1 --- .vscode/settings.json | 3 +++ src/components/Challenge/challengeCard.scss | 4 ++-- src/components/Challenge/challengeCardDone.scss | 5 ++--- .../Challenge/challengeCardOnGoing.scss | 4 ++-- src/services/queryRunner.service.ts | 16 ++++++++++++---- 5 files changed, 21 insertions(+), 11 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index d18fa1229..ce5597bb6 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -41,6 +41,8 @@ "backoffice", "barchart", "CONSO", + "cozycloud", + "dacc", "Datachart", "Dataload", "Dataloads", @@ -68,6 +70,7 @@ "grdfgrandlyon", "Konnected", "konnector", + "konnectors", "luxon", "matomo", "Matomo", diff --git a/src/components/Challenge/challengeCard.scss b/src/components/Challenge/challengeCard.scss index 17ca524a3..8088fe285 100644 --- a/src/components/Challenge/challengeCard.scss +++ b/src/components/Challenge/challengeCard.scss @@ -1,7 +1,7 @@ @import '../../styles/base/color'; .slide { - margin: 1rem 1rem 1rem 0; + margin: 0 1rem 0 0; box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.55); border-radius: 4px; transition: all 300ms ease; @@ -19,7 +19,7 @@ width: 100%; height: inherit; box-sizing: border-box; - padding: 5% 10%; + padding: 1rem; transition: all 300ms ease; border-radius: 4px; } diff --git a/src/components/Challenge/challengeCardDone.scss b/src/components/Challenge/challengeCardDone.scss index 2a31e78e5..1b7fd3ba8 100644 --- a/src/components/Challenge/challengeCardDone.scss +++ b/src/components/Challenge/challengeCardDone.scss @@ -8,16 +8,14 @@ display: flex; flex-direction: column; justify-content: space-between; + gap: 1rem; align-items: center; - padding: 5% !important; .challengeName { - margin: 0.5rem 0rem; text-align: center; } .iconResult { display: flex; - margin: 1rem 0rem; @media all and(max-height: 700px) { width: 55%; margin: auto; @@ -45,6 +43,7 @@ } .review-btn { padding: 0.625rem; + margin: 0; border: 1px solid $grey-bright; } } diff --git a/src/components/Challenge/challengeCardOnGoing.scss b/src/components/Challenge/challengeCardOnGoing.scss index d86d01aca..ce9b54f8b 100644 --- a/src/components/Challenge/challengeCardOnGoing.scss +++ b/src/components/Challenge/challengeCardOnGoing.scss @@ -13,6 +13,7 @@ display: flex; flex-direction: column; justify-content: center; + gap: 1rem; } .titleBlock { position: absolute; @@ -33,8 +34,7 @@ background: $grey-linear-gradient-background; height: 24%; max-height: 90px; - margin: 0.5rem 0; - padding: 8%; + padding: 1rem; box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.55); border-radius: 4px; color: $grey-bright; diff --git a/src/services/queryRunner.service.ts b/src/services/queryRunner.service.ts index 5c5e91866..044708f40 100644 --- a/src/services/queryRunner.service.ts +++ b/src/services/queryRunner.service.ts @@ -106,9 +106,13 @@ export default class QueryRunner { return result } - private filterDataList(data: any, timePeriod: TimePeriod) { + private filterDataList( + data: any, + timePeriod: TimePeriod, + timeStep: TimeStep + ) { // increase timeperiod range because the last data for a day is actually stored the next day at 00:00 - if (timePeriod.endDate.day === timePeriod.startDate.day) { + if (timeStep === TimeStep.HALF_AN_HOUR) { timePeriod.startDate = timePeriod.startDate.plus({ minutes: 30 }) timePeriod.endDate = timePeriod.endDate.plus({ minutes: 30 }) } @@ -332,7 +336,7 @@ export default class QueryRunner { const result = await this.fetchData(query) if (result?.data) { - const filteredResult = this.filterDataList(result, timePeriod) + const filteredResult = this.filterDataList(result, timePeriod, timeStep) const mappedResult: Dataload[] = this.mapDataList( filteredResult, timeStep @@ -391,7 +395,11 @@ export default class QueryRunner { ) } if (result?.data) { - const filteredResult = this.filterDataList(result, maxTimePeriod) + const filteredResult = this.filterDataList( + result, + maxTimePeriod, + timeStep + ) const mappedResult = this.mapDataList(filteredResult, timeStep) if (withDate) { return mappedResult && mappedResult[0] && mappedResult[0] -- GitLab