Skip to content

Commit dcfc0ab

Browse files
committed
front: fix date translations in study page
Signed-off-by: Alice Khoudli <[email protected]>
1 parent 1607654 commit dcfc0ab

File tree

7 files changed

+31
-31
lines changed

7 files changed

+31
-31
lines changed

front/public/locales/en/operationalStudies/study.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
"createScenario": "Create a scenario",
55
"dates": {
66
"creation": "Creation",
7-
"estimatedend": "Expected ending",
7+
"expectedEnd": "Expected end",
88
"modified": "Updated",
9-
"realend": "Real end",
10-
"start": "Started"
9+
"realEnd": "Real end",
10+
"start": "Start"
1111
},
1212
"deleteScenarios": "Delete",
1313
"deleteItems": "Delete",
@@ -58,7 +58,7 @@
5858
"studyDescription": "Description",
5959
"studyDescriptionInvalid": "The description for the study must not exceed 1024 characters",
6060
"studyDescriptionPlaceholder": "Short description of the study",
61-
"studyEstimatedEndDate": "Expected end date",
61+
"studyExpectedEndDate": "Expected end date",
6262
"studyModificationTitle": "Edit a study",
6363
"studyModifyButton": "Save",
6464
"studyName": "Study name",

front/public/locales/fr/operationalStudies/study.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"createScenario": "Créer un scénario",
55
"dates": {
66
"creation": "Création",
7-
"estimatedend": "Fin estimée",
7+
"expectedEnd": "Fin estimée",
88
"modified": "Modification",
9-
"realend": "Fin réelle",
9+
"realEnd": "Fin réelle",
1010
"start": "Début"
1111
},
1212
"confirmDeleteMessage": "Voulez-vous supprimer le scénario ?",
@@ -57,7 +57,7 @@
5757
"studyDescription": "Description",
5858
"studyDescriptionInvalid": "La description de l'étude ne doit pas dépasser 1024 caractères",
5959
"studyDescriptionPlaceholder": "Courte description de l'étude",
60-
"studyEstimatedEndDate": "Fin estimée",
60+
"studyExpectedEndDate": "Fin estimée",
6161
"studyModificationTitle": "Modifier une étude",
6262
"studyModifyButton": "Enregistrer",
6363
"studyName": "Nom de l'étude",

front/src/applications/operationalStudies/views/Study.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -232,14 +232,14 @@ const Study = () => {
232232
/>
233233
<DateBox
234234
date={study.expected_end_date ? new Date(study.expected_end_date) : null}
235-
className="estimatedend"
236-
translation="estimatedend"
235+
className="expected-end"
236+
translation="expectedEnd"
237237
withoutTime
238238
/>
239239
<DateBox
240240
date={study.actual_end_date ? new Date(study.actual_end_date) : null}
241-
className="realend"
242-
translation="realend"
241+
className="real-end"
242+
translation="realEnd"
243243
withoutTime
244244
/>
245245
<DateBox

front/src/modules/study/components/AddOrEditStudyModal.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -336,15 +336,15 @@ const AddOrEditStudyModal = ({ editionMode, study, scenarios }: AddOrEditStudyMo
336336
max={getEarliestDate(currentStudy?.expected_end_date, currentStudy?.actual_end_date)}
337337
/>
338338
<InputSNCF
339-
id="studyInputEstimatedEndDate"
339+
id="studyInputExpectedEndDate"
340340
type="date"
341-
name="studyInputEstimatedEndDate"
341+
name="studyInputExpectedEndDate"
342342
label={
343343
<div className="d-flex align-items-center">
344344
<span className="mr-2 text-warning">
345345
<RiCalendarLine />
346346
</span>
347-
{t('studyEstimatedEndDate')}
347+
{t('studyExpectedEndDate')}
348348
</div>
349349
}
350350
value={formatDateForInput(currentStudy?.expected_end_date)}

front/src/styles/scss/applications/operationalStudies/_study.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@
3636
&.start {
3737
border-color: var(--green);
3838
}
39-
&.estimatedend {
39+
&.expected-end {
4040
border-color: var(--yellow);
4141
}
42-
&.realend {
42+
&.real-end {
4343
border-color: var(--orange);
4444
}
4545
}

front/tests/003-study-management.spec.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ test.describe('Validate the Study creation workflow', () => {
4545
type: translations.studyCategories.flowRate, // Translated study type
4646
status: translations.studyStates.started, // Translated study status
4747
startDate: todayDateISO,
48-
estimatedEndDate: todayDateISO,
48+
expectedEndDate: todayDateISO,
4949
endDate: todayDateISO,
5050
serviceCode: studyData.service_code,
5151
businessCode: studyData.business_code,
@@ -60,7 +60,7 @@ test.describe('Validate the Study creation workflow', () => {
6060
type: translations.studyCategories.flowRate,
6161
status: translations.studyStates.started,
6262
startDate: expectedDate,
63-
estimatedEndDate: expectedDate,
63+
expectedEndDate: expectedDate,
6464
endDate: expectedDate,
6565
serviceCode: studyData.service_code,
6666
businessCode: studyData.business_code,
@@ -87,7 +87,7 @@ test.describe('Validate the Study creation workflow', () => {
8787
type: translations.studyCategories.operability,
8888
status: translations.studyStates.inProgress,
8989
startDate: tomorrowDateISO,
90-
estimatedEndDate: tomorrowDateISO,
90+
expectedEndDate: tomorrowDateISO,
9191
endDate: tomorrowDateISO,
9292
serviceCode: 'A1230',
9393
businessCode: 'B1230',
@@ -106,7 +106,7 @@ test.describe('Validate the Study creation workflow', () => {
106106
type: translations.studyCategories.operability,
107107
status: translations.studyStates.inProgress,
108108
startDate: expectedDate,
109-
estimatedEndDate: expectedDate,
109+
expectedEndDate: expectedDate,
110110
endDate: expectedDate,
111111
serviceCode: 'A1230',
112112
businessCode: 'B1230',

front/tests/pages/study-page-model.ts

+11-11
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ type StudyDetails = {
99
type: string;
1010
status: string;
1111
startDate: string;
12-
estimatedEndDate: string;
12+
expectedEndDate: string;
1313
endDate: string;
1414
serviceCode: string;
1515
businessCode: string;
@@ -50,7 +50,7 @@ class StudyPage extends CommonPage {
5050

5151
readonly studyStartDateInput: Locator;
5252

53-
readonly studyEstimatedEndDateInput: Locator;
53+
readonly studyExpectedEndDateInput: Locator;
5454

5555
readonly studyEndDateInput: Locator;
5656

@@ -68,7 +68,7 @@ class StudyPage extends CommonPage {
6868

6969
readonly startDate: Locator;
7070

71-
readonly estimatedEndDate: Locator;
71+
readonly expectedEndDate: Locator;
7272

7373
readonly realEndDate: Locator;
7474

@@ -91,7 +91,7 @@ class StudyPage extends CommonPage {
9191
);
9292
this.studyDescriptionInput = page.locator('#studyDescription');
9393
this.studyStartDateInput = page.locator('#studyInputStartDate');
94-
this.studyEstimatedEndDateInput = page.locator('#studyInputEstimatedEndDate');
94+
this.studyExpectedEndDateInput = page.locator('#studyInputExpectedEndDate');
9595
this.studyEndDateInput = page.locator('#studyInputRealEndDate');
9696
this.studyServiceCodeInput = page.locator('#studyInputServiceCode');
9797
this.studyBusinessCodeInput = page.locator('#studyInputBusinessCode');
@@ -103,11 +103,11 @@ class StudyPage extends CommonPage {
103103
this.startDate = page.locator(
104104
'.study-details-dates-date.start .study-details-dates-date-value'
105105
);
106-
this.estimatedEndDate = page.locator(
107-
'.study-details-dates-date.estimatedend .study-details-dates-date-value'
106+
this.expectedEndDate = page.locator(
107+
'.study-details-dates-date.expected-end .study-details-dates-date-value'
108108
);
109109
this.realEndDate = page.locator(
110-
'.study-details-dates-date.realend .study-details-dates-date-value'
110+
'.study-details-dates-date.real-end .study-details-dates-date-value'
111111
);
112112
}
113113

@@ -119,7 +119,7 @@ class StudyPage extends CommonPage {
119119
type,
120120
status,
121121
startDate,
122-
estimatedEndDate,
122+
expectedEndDate,
123123
endDate,
124124
serviceCode,
125125
businessCode,
@@ -131,7 +131,7 @@ class StudyPage extends CommonPage {
131131
await this.setStudyTypeByText(type);
132132
await this.setStudyStatusByText(status);
133133
await this.studyStartDateInput.fill(startDate);
134-
await this.studyEstimatedEndDateInput.fill(estimatedEndDate);
134+
await this.studyExpectedEndDateInput.fill(expectedEndDate);
135135
await this.studyEndDateInput.fill(endDate);
136136
await this.studyServiceCodeInput.fill(serviceCode);
137137
await this.studyBusinessCodeInput.fill(businessCode);
@@ -164,7 +164,7 @@ class StudyPage extends CommonPage {
164164
type,
165165
status,
166166
startDate,
167-
estimatedEndDate,
167+
expectedEndDate,
168168
endDate,
169169
serviceCode,
170170
businessCode,
@@ -176,7 +176,7 @@ class StudyPage extends CommonPage {
176176
await expect(this.studyEditionModal).not.toBeVisible();
177177
await expect(this.studyName).toHaveText(name);
178178
await expect(this.startDate).toHaveText(startDate);
179-
await expect(this.estimatedEndDate).toHaveText(estimatedEndDate);
179+
await expect(this.expectedEndDate).toHaveText(expectedEndDate);
180180
await expect(this.realEndDate).toHaveText(endDate);
181181
await expect(this.studyDescription).toHaveText(description);
182182
await expect(this.studyType).toHaveText(type);

0 commit comments

Comments
 (0)