Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADM-952 [frontend] change to lower case #1495

Merged
merged 2 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion frontend/__tests__/constants/fileConfig/fileConfig.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions frontend/__tests__/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion frontend/e2e/fixtures/create-new/metrics-step.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion frontend/e2e/fixtures/import-file/unhappy-path-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"endDate": "2024-06-14T23:59:59.999+08:00"
}
],
"calendarType": "Calendar with Chinese Holiday",
"calendarType": "CN",
"metrics": [
"Velocity",
"Cycle time",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"endDate": "2024-06-07T23:59:59.999+08:00"
}
],
"calendarType": "Calendar with Chinese Holiday",
"calendarType": "CN",
"metrics": [
"Velocity",
"Cycle time",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"endDate": "2013-01-10T23:59:59.999+08:00"
}
],
"calendarType": "Calendar with Chinese Holiday",
"calendarType": "CN",
"metrics": [
"All",
"Velocity",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions frontend/e2e/pages/metrics/config-step.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/constants/fileConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/constants/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)';
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/containers/ConfigStep/BasicInfo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const BasicInfo = () => {
/>

<FormControl required>
<CollectionDateLabel>Collection Date (Weekend Considered)</CollectionDateLabel>
<CollectionDateLabel>Collection date (Weekend considered)</CollectionDateLabel>
<Controller
name={'calendarType'}
control={control}
Expand Down
Loading