From d97434fa6be904640e86e0851dd496140501e6eb Mon Sep 17 00:00:00 2001 From: Mandy Date: Fri, 21 Jun 2024 15:03:51 +0800 Subject: [PATCH] ADM-952 [frontend] change to lower case (#1495) * ADM-935: [frontend] change Regular Calendar to regular calendar * ADM-935: [frontend] change Holiday to holiday in radio select --- README.md | 6 +++--- .../__tests__/constants/fileConfig/fileConfig.test.ts | 2 +- frontend/__tests__/fixtures.ts | 8 ++++---- frontend/e2e/fixtures/create-new/metrics-step.ts | 2 +- .../cycle-time-by-status/cycle-time-by-column-fixture.ts | 2 +- .../cycle-time-by-status/cycle-time-by-status-fixture.ts | 2 +- .../import-file/calculate-with-holiday-config-file.ts | 2 +- .../e2e/fixtures/import-file/multiple-done-config-file.ts | 2 +- .../fixtures/import-file/partial-metrics-show-chart.ts | 2 +- .../fixtures/import-file/partial-time-ranges-success.ts | 2 +- frontend/e2e/fixtures/import-file/unhappy-path-file.ts | 2 +- .../add-flag-as-block-config-file.template.json | 2 +- .../calculate-with-holiday-config-file.template.json | 2 +- .../charting-unhappy-path-config-file.template.json | 2 +- .../cycle-time-by-status-config-file.template.json | 2 +- .../input-files/hb-e2e-for-importing-file.template.json | 2 +- .../input-files/multiple-done-config-file.template.json | 2 +- .../input-files/partial-metrics-show-chart.template.json | 2 +- .../input-files/partial-time-ranges-success.template.json | 2 +- .../input-files/pipeline-no-org-config-file.template.json | 2 +- .../input-files/unhappy-path-config-file.template.json | 2 +- frontend/e2e/pages/metrics/config-step.ts | 6 +++--- frontend/src/constants/fileConfig.ts | 2 +- frontend/src/constants/resources.ts | 6 +++--- frontend/src/containers/ConfigStep/BasicInfo/index.tsx | 2 +- 25 files changed, 34 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index 94b50f2a05..62cc4f27f1 100644 --- a/README.md +++ b/README.md @@ -138,9 +138,9 @@ Note: Charts will be generated only by selecting at least 2 time periods. **Have three items of time period:** -1. **Regular Calendar:** If you select this item, it means all data will exclude the weekend. -2. **Calendar with Chinese Holiday:** If you select this item, it means all data will exclude the weekend and Chinese holiday. So if the time period you selected contains Chinese holiday, you need to select this item. -3. **Calendar with Vietnam Holiday:** If you select this item, it means all data will exclude the weekend and Vietnam holiday. So if the time period you selected contains Vietnam holiday, you need to select this item. +1. **Regular calendar:** If you select this item, it means all data will exclude the weekend. +2. **Calendar with Chinese holiday:** If you select this item, it means all data will exclude the weekend and Chinese holiday. So if the time period you selected contains Chinese holiday, you need to select this item. +3. **Calendar with Vietnam holiday:** If you select this item, it means all data will exclude the weekend and Vietnam holiday. So if the time period you selected contains Vietnam holiday, you need to select this item. All need to select which data you want to get, for now, we support seven metrics data (Image 3-3). Those seven metrics are `Deployment Frequency (DF)`, `Lead Time for changes (LTC)`, `Mean Time To Recover (MTTR)`, `Change Failure Rate (CFR)`, and `Velocity`, `Cycle time`, `Classification`, where diff --git a/frontend/__tests__/constants/fileConfig/fileConfig.test.ts b/frontend/__tests__/constants/fileConfig/fileConfig.test.ts index 98bcb55ee3..e76c7479bb 100644 --- a/frontend/__tests__/constants/fileConfig/fileConfig.test.ts +++ b/frontend/__tests__/constants/fileConfig/fileConfig.test.ts @@ -91,7 +91,7 @@ describe('#fileConfig', () => { ).toEqual(Calendar.Regular); }); - it('should convert calendarType Calendar with Chinese Holiday to CHINA', () => { + it('should convert calendarType Calendar with Chinese holiday to CHINA', () => { expect( convertToNewFileConfig({ ...BASIC_IMPORTED_OLD_CONFIG_FIXTURE, diff --git a/frontend/__tests__/fixtures.ts b/frontend/__tests__/fixtures.ts index 57532e622a..e2555ff759 100644 --- a/frontend/__tests__/fixtures.ts +++ b/frontend/__tests__/fixtures.ts @@ -14,11 +14,11 @@ export const ZERO = 0; export const OLD_REGULAR_CALENDAR_LABEL = 'Regular Calendar(Weekend Considered)'; -export const REGULAR_CALENDAR = 'Regular Calendar'; +export const REGULAR_CALENDAR = 'Regular calendar'; -export const CHINA_CALENDAR = 'Calendar with Chinese Holiday'; +export const CHINA_CALENDAR = 'Calendar with Chinese holiday'; -export const VIETNAM_CALENDAR = 'Calendar with Vietnam Holiday'; +export const VIETNAM_CALENDAR = 'Calendar with Vietnam holiday'; export const NEXT = 'Next'; @@ -249,7 +249,7 @@ export const IMPORTED_NEW_CONFIG_FIXTURE = { endDate: '2023-03-30T23:59:59.999+08:00', }, ], - calendarType: 'Calendar with Chinese Holiday', + calendarType: 'CN', board: { type: 'Jira', verifyToken: 'mockVerifyToken', diff --git a/frontend/e2e/fixtures/create-new/metrics-step.ts b/frontend/e2e/fixtures/create-new/metrics-step.ts index 432108488d..ab72a65bc6 100644 --- a/frontend/e2e/fixtures/create-new/metrics-step.ts +++ b/frontend/e2e/fixtures/create-new/metrics-step.ts @@ -116,7 +116,7 @@ export const modifiedConfig = { endDate: '2024-01-19T23:59:59.999+08:00', }, sortType: 'DEFAULT', - calendarType: 'Calendar with Chinese Holiday', + calendarType: 'CN', metrics: [ 'Velocity', 'Cycle time', diff --git a/frontend/e2e/fixtures/cycle-time-by-status/cycle-time-by-column-fixture.ts b/frontend/e2e/fixtures/cycle-time-by-status/cycle-time-by-column-fixture.ts index 864ef55cf0..e988039fba 100644 --- a/frontend/e2e/fixtures/cycle-time-by-status/cycle-time-by-column-fixture.ts +++ b/frontend/e2e/fixtures/cycle-time-by-status/cycle-time-by-column-fixture.ts @@ -4,7 +4,7 @@ export const cycleTimeByColumnFixture = { startDate: '2024-03-27T00:00:00.000+08:00', endDate: '2024-03-29T23:59:59.999+08:00', }, - calendarType: 'Calendar with Chinese Holiday', + calendarType: 'CN', metrics: [ 'All', 'Velocity', diff --git a/frontend/e2e/fixtures/cycle-time-by-status/cycle-time-by-status-fixture.ts b/frontend/e2e/fixtures/cycle-time-by-status/cycle-time-by-status-fixture.ts index 2aee68af5d..aa573281a6 100644 --- a/frontend/e2e/fixtures/cycle-time-by-status/cycle-time-by-status-fixture.ts +++ b/frontend/e2e/fixtures/cycle-time-by-status/cycle-time-by-status-fixture.ts @@ -4,7 +4,7 @@ export const cycleTimeByStatusFixture = { startDate: '2024-03-27T00:00:00.000+08:00', endDate: '2024-03-29T23:59:59.999+08:00', }, - calendarType: 'Calendar with Chinese Holiday', + calendarType: 'CN', metrics: [ 'All', 'Velocity', diff --git a/frontend/e2e/fixtures/import-file/calculate-with-holiday-config-file.ts b/frontend/e2e/fixtures/import-file/calculate-with-holiday-config-file.ts index 0233af4f6f..212695ba0f 100644 --- a/frontend/e2e/fixtures/import-file/calculate-with-holiday-config-file.ts +++ b/frontend/e2e/fixtures/import-file/calculate-with-holiday-config-file.ts @@ -4,7 +4,7 @@ export const calculateWithHolidayConfigFile = { startDate: '2024-06-07T00:00:00.000+08:00', endDate: '2024-06-14T23:59:59.999+08:00', }, - calendarType: 'Calendar with Chinese Holiday', + calendarType: 'CN', metrics: [ 'Velocity', 'Cycle time', diff --git a/frontend/e2e/fixtures/import-file/multiple-done-config-file.ts b/frontend/e2e/fixtures/import-file/multiple-done-config-file.ts index d196997cdd..17c7c59e97 100644 --- a/frontend/e2e/fixtures/import-file/multiple-done-config-file.ts +++ b/frontend/e2e/fixtures/import-file/multiple-done-config-file.ts @@ -14,7 +14,7 @@ export const importMultipleDoneProjectFromFile = { endDate: '2024-06-07T23:59:59.999+08:00', }, ], - calendarType: 'Calendar with Chinese Holiday', + calendarType: 'CN', metrics: [ 'All', 'Velocity', diff --git a/frontend/e2e/fixtures/import-file/partial-metrics-show-chart.ts b/frontend/e2e/fixtures/import-file/partial-metrics-show-chart.ts index 54616e19f2..20872816e5 100644 --- a/frontend/e2e/fixtures/import-file/partial-metrics-show-chart.ts +++ b/frontend/e2e/fixtures/import-file/partial-metrics-show-chart.ts @@ -14,7 +14,7 @@ export const partialMetricsShowChart = { endDate: '2024-01-19T23:59:59.999+08:00', }, ], - calendarType: 'Calendar with Chinese Holiday', + calendarType: 'CN', metrics: ['Velocity', 'Cycle time', 'Lead time for changes', 'Dev mean time to recovery'], board: { type: 'Jira', diff --git a/frontend/e2e/fixtures/import-file/partial-time-ranges-success.ts b/frontend/e2e/fixtures/import-file/partial-time-ranges-success.ts index 2f6cbe4a96..1b8b4d373f 100644 --- a/frontend/e2e/fixtures/import-file/partial-time-ranges-success.ts +++ b/frontend/e2e/fixtures/import-file/partial-time-ranges-success.ts @@ -14,7 +14,7 @@ export const partialTimeRangesSuccess = { endDate: '2024-01-19T23:59:59.999+08:00', }, ], - calendarType: 'Calendar with Chinese Holiday', + calendarType: 'CN', metrics: [ 'All', 'Velocity', diff --git a/frontend/e2e/fixtures/import-file/unhappy-path-file.ts b/frontend/e2e/fixtures/import-file/unhappy-path-file.ts index bdbc3cfac1..835eda73c7 100644 --- a/frontend/e2e/fixtures/import-file/unhappy-path-file.ts +++ b/frontend/e2e/fixtures/import-file/unhappy-path-file.ts @@ -4,7 +4,7 @@ export const importInputWrongProjectFromFile = { startDate: '2024-02-12T00:00:00.000+08:00', endDate: '2024-02-16T23:59:59.999+08:00', }, - calendarType: 'Calendar with Chinese Holiday', + calendarType: 'CN', metrics: [ 'Velocity', 'Cycle time', diff --git a/frontend/e2e/fixtures/input-files/add-flag-as-block-config-file.template.json b/frontend/e2e/fixtures/input-files/add-flag-as-block-config-file.template.json index d90d87d5ec..d9b584457b 100644 --- a/frontend/e2e/fixtures/input-files/add-flag-as-block-config-file.template.json +++ b/frontend/e2e/fixtures/input-files/add-flag-as-block-config-file.template.json @@ -4,7 +4,7 @@ "startDate": "2024-04-01T00:00:00.000+08:00", "endDate": "2024-04-09T23:59:59.999+08:00" }, - "calendarType": "Calendar with Chinese Holiday", + "calendarType": "CN", "metrics": ["Velocity", "Cycle time", "Classification", "Rework times"], "board": { "type": "Jira", diff --git a/frontend/e2e/fixtures/input-files/calculate-with-holiday-config-file.template.json b/frontend/e2e/fixtures/input-files/calculate-with-holiday-config-file.template.json index ece263a0f8..26ff02992e 100644 --- a/frontend/e2e/fixtures/input-files/calculate-with-holiday-config-file.template.json +++ b/frontend/e2e/fixtures/input-files/calculate-with-holiday-config-file.template.json @@ -6,7 +6,7 @@ "endDate": "2024-06-14T23:59:59.999+08:00" } ], - "calendarType": "Calendar with Chinese Holiday", + "calendarType": "CN", "metrics": [ "Velocity", "Cycle time", diff --git a/frontend/e2e/fixtures/input-files/charting-unhappy-path-config-file.template.json b/frontend/e2e/fixtures/input-files/charting-unhappy-path-config-file.template.json index 0849dc6b4f..651925a2ac 100644 --- a/frontend/e2e/fixtures/input-files/charting-unhappy-path-config-file.template.json +++ b/frontend/e2e/fixtures/input-files/charting-unhappy-path-config-file.template.json @@ -4,7 +4,7 @@ "startDate": "2024-06-03T00:00:00.000+08:00", "endDate": "2024-06-07T23:59:59.999+08:00" }, - "calendarType": "Calendar with Chinese Holiday", + "calendarType": "CN", "metrics": [ "Velocity", "Cycle time", diff --git a/frontend/e2e/fixtures/input-files/cycle-time-by-status-config-file.template.json b/frontend/e2e/fixtures/input-files/cycle-time-by-status-config-file.template.json index 6d6767018c..6db4baf27f 100644 --- a/frontend/e2e/fixtures/input-files/cycle-time-by-status-config-file.template.json +++ b/frontend/e2e/fixtures/input-files/cycle-time-by-status-config-file.template.json @@ -4,7 +4,7 @@ "startDate": "2024-03-27T00:00:00.000+08:00", "endDate": "2024-03-29T23:59:59.999+08:00" }, - "calendarType": "Calendar with Chinese Holiday", + "calendarType": "CN", "metrics": ["Velocity", "Cycle time", "Classification"], "board": { "type": "Jira", diff --git a/frontend/e2e/fixtures/input-files/hb-e2e-for-importing-file.template.json b/frontend/e2e/fixtures/input-files/hb-e2e-for-importing-file.template.json index 5aa6d01f40..6809806256 100644 --- a/frontend/e2e/fixtures/input-files/hb-e2e-for-importing-file.template.json +++ b/frontend/e2e/fixtures/input-files/hb-e2e-for-importing-file.template.json @@ -4,7 +4,7 @@ "startDate": "2024-06-03T00:00:00.000+08:00", "endDate": "2024-06-07T23:59:59.999+08:00" }, - "calendarType": "Calendar with Chinese Holiday", + "calendarType": "CN", "metrics": [ "All", "Velocity", diff --git a/frontend/e2e/fixtures/input-files/multiple-done-config-file.template.json b/frontend/e2e/fixtures/input-files/multiple-done-config-file.template.json index b64d3a99ec..70ad98f22b 100644 --- a/frontend/e2e/fixtures/input-files/multiple-done-config-file.template.json +++ b/frontend/e2e/fixtures/input-files/multiple-done-config-file.template.json @@ -14,7 +14,7 @@ "endDate": "2024-06-07T23:59:59.999+08:00" } ], - "calendarType": "Calendar with Chinese Holiday", + "calendarType": "CN", "metrics": [ "Velocity", "Cycle time", diff --git a/frontend/e2e/fixtures/input-files/partial-metrics-show-chart.template.json b/frontend/e2e/fixtures/input-files/partial-metrics-show-chart.template.json index d9111b1755..d841e1cef4 100644 --- a/frontend/e2e/fixtures/input-files/partial-metrics-show-chart.template.json +++ b/frontend/e2e/fixtures/input-files/partial-metrics-show-chart.template.json @@ -14,7 +14,7 @@ "endDate": "2013-01-10T23:59:59.999+08:00" } ], - "calendarType": "Calendar with Chinese Holiday", + "calendarType": "CN", "metrics": ["Velocity", "Cycle time", "Lead time for changes", "Dev mean time to recovery"], "board": { "type": "Jira", diff --git a/frontend/e2e/fixtures/input-files/partial-time-ranges-success.template.json b/frontend/e2e/fixtures/input-files/partial-time-ranges-success.template.json index 0bd2d3f708..b588d129be 100644 --- a/frontend/e2e/fixtures/input-files/partial-time-ranges-success.template.json +++ b/frontend/e2e/fixtures/input-files/partial-time-ranges-success.template.json @@ -14,7 +14,7 @@ "endDate": "2013-01-10T23:59:59.999+08:00" } ], - "calendarType": "Calendar with Chinese Holiday", + "calendarType": "CN", "metrics": [ "All", "Velocity", diff --git a/frontend/e2e/fixtures/input-files/pipeline-no-org-config-file.template.json b/frontend/e2e/fixtures/input-files/pipeline-no-org-config-file.template.json index 44c1be76eb..6dd5345cce 100644 --- a/frontend/e2e/fixtures/input-files/pipeline-no-org-config-file.template.json +++ b/frontend/e2e/fixtures/input-files/pipeline-no-org-config-file.template.json @@ -4,7 +4,7 @@ "startDate": "2024-06-03T00:00:00.000+08:00", "endDate": "2024-06-07T23:59:59.999+08:00" }, - "calendarType": "Calendar with Chinese Holiday", + "calendarType": "CN", "metrics": [ "All", "Velocity", diff --git a/frontend/e2e/fixtures/input-files/unhappy-path-config-file.template.json b/frontend/e2e/fixtures/input-files/unhappy-path-config-file.template.json index 1f6a5949ed..b02e242291 100644 --- a/frontend/e2e/fixtures/input-files/unhappy-path-config-file.template.json +++ b/frontend/e2e/fixtures/input-files/unhappy-path-config-file.template.json @@ -4,7 +4,7 @@ "startDate": "2024-05-01T00:00:00.000+08:00", "endDate": "2024-05-05T23:59:59.999+08:00" }, - "calendarType": "Calendar with Chinese Holiday", + "calendarType": "CN", "metrics": [ "Velocity", "Cycle time", diff --git a/frontend/e2e/pages/metrics/config-step.ts b/frontend/e2e/pages/metrics/config-step.ts index c99f28fbd1..03902d8af4 100644 --- a/frontend/e2e/pages/metrics/config-step.ts +++ b/frontend/e2e/pages/metrics/config-step.ts @@ -98,9 +98,9 @@ export class ConfigStep { this.page = page; this.stepTitle = page.getByText('Config'); this.projectNameInput = page.getByLabel('Project name *'); - this.regularCalendar = page.getByText('Regular Calendar'); - this.chineseCalendar = page.getByText('Calendar with Chinese Holiday'); - this.vietnamCalendar = page.getByText('Calendar with Vietnam Holiday'); + this.regularCalendar = page.getByText('Regular calendar'); + this.chineseCalendar = page.getByText('Calendar with Chinese holiday'); + this.vietnamCalendar = page.getByText('Calendar with Vietnam holiday'); this.basicInfoContainer = page.getByLabel('Basic information'); this.fromDateInput = this.basicInfoContainer.getByRole('textbox', { name: 'From' }); this.fromDateInputButton = page diff --git a/frontend/src/constants/fileConfig.ts b/frontend/src/constants/fileConfig.ts index 22e91fc191..23614925b2 100644 --- a/frontend/src/constants/fileConfig.ts +++ b/frontend/src/constants/fileConfig.ts @@ -170,7 +170,7 @@ export const convertToNewFileConfig = (fileConfig: OldFileConfig | NewFileConfig } if (fileConfig.calendarType === OLD_REGULAR_CALENDAR_LABEL) { fileConfig.calendarType = Calendar.Regular; - } else if (fileConfig.calendarType === CALENDAR_LABEL[Calendar.China]) { + } else if (fileConfig.calendarType?.toLocaleLowerCase() === CALENDAR_LABEL[Calendar.China].toLocaleLowerCase()) { fileConfig.calendarType = Calendar.China; } return { diff --git a/frontend/src/constants/resources.ts b/frontend/src/constants/resources.ts index 20b405bc28..7f88d935da 100644 --- a/frontend/src/constants/resources.ts +++ b/frontend/src/constants/resources.ts @@ -7,9 +7,9 @@ export enum Calendar { } export const CALENDAR_LABEL = { - [Calendar.Regular]: 'Regular Calendar', - [Calendar.China]: 'Calendar with Chinese Holiday', - [Calendar.Vietnam]: 'Calendar with Vietnam Holiday', + [Calendar.Regular]: 'Regular calendar', + [Calendar.China]: 'Calendar with Chinese holiday', + [Calendar.Vietnam]: 'Calendar with Vietnam holiday', }; export const OLD_REGULAR_CALENDAR_LABEL = 'Regular Calendar(Weekend Considered)'; diff --git a/frontend/src/containers/ConfigStep/BasicInfo/index.tsx b/frontend/src/containers/ConfigStep/BasicInfo/index.tsx index 3334bdba0f..fc5eb96742 100644 --- a/frontend/src/containers/ConfigStep/BasicInfo/index.tsx +++ b/frontend/src/containers/ConfigStep/BasicInfo/index.tsx @@ -46,7 +46,7 @@ const BasicInfo = () => { /> - Collection Date (Weekend Considered) + Collection date (Weekend considered)