Skip to content

Commit af90e75

Browse files
committed
front: rename OperationalPointIdentifier to OperationalPointReference
1 parent 6b3e3c5 commit af90e75

File tree

5 files changed

+21
-21
lines changed

5 files changed

+21
-21
lines changed

front/public/locales/en/operational-studies.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@
152152
"project": "Project",
153153
"restore": "Restore to template"
154154
},
155-
"operationalPointIdentifier": "Operational point identifier",
155+
"OperationalPointReference": "Operational point reference",
156156
"pacedTrainAndTrainCount": "$t(main.pacedTrainCount, { 'count': {{pacedTrainCount}}, 'totalCount': {{totalPacedTrainCount}} }), $t(main.trainCount, { 'count': {{trainCount}}, 'totalCount': {{totalTrainScheduleCount}} }) selected",
157157
"pacedTrainCountSelected_one": "1/{{totalCount}} service selected",
158158
"pacedTrainCountSelected_other": "{{count}}/{{totalCount}} services selected",

front/public/locales/fr/operational-studies.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@
152152
"project": "Projeter",
153153
"restore": "Rétablir sur le modèle"
154154
},
155-
"operationalPointIdentifier": "Identifiant de point",
155+
"OperationalPointReference": "Référence de point",
156156
"pacedTrainAndTrainCount": "$t(main.pacedTrainCount, { 'count': {{pacedTrainCount}}, 'totalCount': {{totalPacedTrainCount}} }), $t(main.trainCount, { 'count': {{trainCount}}, 'totalCount': {{totalTrainScheduleCount}} }) sélectionnés",
157157
"pacedTrainCountSelected_one": "1/{{totalCount}} mission sélectionnée",
158158
"pacedTrainCountSelected_other": "{{count}}/{{totalCount}} missions sélectionnées",

front/src/applications/operationalStudies/helpers/TrainOpProjectionLazyLoader.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { isEmpty } from 'lodash';
22

33
import {
44
osrdEditoastApi,
5-
type OperationalPointIdentifier,
5+
type OperationalPointReference,
66
type PostPacedTrainOccupancyBlocksApiResponse,
77
type PostPacedTrainProjectPathOpApiResponse,
88
type PostTrainScheduleOccupancyBlocksApiResponse,
@@ -22,12 +22,12 @@ import TrainProjectionLazyLoaderAbstract, {
2222
type TrainProjectionLazyLoaderOptions,
2323
} from './TrainProjectionLazyLoaderAbstract';
2424
export default class TrainOpProjectionLazyLoader extends TrainProjectionLazyLoaderAbstract {
25-
readonly opRefs: OperationalPointIdentifier[];
25+
readonly opRefs: OperationalPointReference[];
2626

2727
readonly opDistances: number[];
2828

2929
constructor(
30-
opRefs: OperationalPointIdentifier[],
30+
opRefs: OperationalPointReference[],
3131
opDistances: number[],
3232
options: TrainProjectionLazyLoaderOptions
3333
) {

front/src/applications/operationalStudies/hooks/usePathProjection.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
type PathfindingResult,
1212
type OperationalPointPartReference,
1313
type PathProperties,
14-
type OperationalPointIdentifier,
14+
type OperationalPointReference,
1515
} from 'common/api/osrdEditoastApi';
1616
import { getExceptionFromOccurrenceId } from 'modules/timetableItem/helpers/pacedTrain';
1717
import type { TimetableItemId, TimetableItem } from 'reducers/osrdconf/types';
@@ -39,14 +39,14 @@ import { getStationFromOps } from '../utils';
3939
* Uses trigram --> UIC --> operational_point --> position-based fallbacks in priority order.
4040
*/
4141
const getVirtualOpName = (
42-
opId: OperationalPointIdentifier,
42+
opRef: OperationalPointReference,
4343
index: number,
4444
totalCount: number,
4545
t: TFunction<'operational-studies'>
4646
): string => {
47-
if (opId.type === 'trigram') return opId.trigram;
48-
if (opId.type === 'uic') return opId.uic.toString();
49-
if (opId.type === 'id') return t('main.operationalPointIdentifier');
47+
if (opRef.type === 'trigram') return opRef.trigram;
48+
if (opRef.type === 'uic') return opRef.uic.toString();
49+
if (opRef.type === 'id') return t('main.OperationalPointReference');
5050
if (index === 0) return t('main.requestedOrigin');
5151
if (index === totalCount - 1) return t('main.requestedDestination');
5252
return t('main.requestedPoint', { count: index + 1 });
@@ -59,29 +59,29 @@ const FALLBACK_DISTANCE_MM = 100_000_000;
5959
* Creates a virtual operational point with complete extensions when no infrastructure match is found.
6060
*/
6161
const createVirtualOp = (
62-
opId: OperationalPointIdentifier,
62+
opRef: OperationalPointReference,
6363
index: number,
6464
totalCount: number,
6565
position: number,
6666
weight: number,
6767
t: TFunction<'operational-studies'>
6868
): PathProperties['operational_points'][0] => {
69-
const virtualName = getVirtualOpName(opId, index, totalCount, t);
69+
const virtualName = getVirtualOpName(opRef, index, totalCount, t);
7070
const virtualId = `virtual_op_${virtualName}`;
7171

7272
return {
7373
id: virtualId,
7474
extensions: {
7575
identifier: {
7676
name: virtualName,
77-
uic: opId.type === 'uic' ? opId.uic : 0,
77+
uic: opRef.type === 'uic' ? opRef.uic : 0,
7878
},
7979
sncf: {
80-
ch: (opId.type !== 'id' && opId.secondary_code) || '',
80+
ch: (opRef.type !== 'id' && opRef.secondary_code) || '',
8181
ch_long_label: '',
8282
ch_short_label: '',
83-
ci: opId.type === 'uic' ? Number(formatUicToCi(opId.uic)) : 0,
84-
trigram: opId.type === 'trigram' ? opId.trigram : '',
83+
ci: opRef.type === 'uic' ? Number(formatUicToCi(opRef.uic)) : 0,
84+
trigram: opRef.type === 'trigram' ? opRef.trigram : '',
8585
},
8686
},
8787
part: { track: '', position: 0 },

front/src/applications/operationalStudies/utils.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { type Dictionary, isEqual } from 'lodash';
33

44
import type {
55
OperationalPoint,
6-
OperationalPointIdentifier,
6+
OperationalPointReference,
77
OperationalPointPartReference,
88
CorePathfindingResultSuccess,
99
PathItemLocation,
@@ -471,10 +471,10 @@ export const groupRoundTrips = (
471471
return { oneWays, roundTrips, others };
472472
};
473473

474-
export const getInvalidStepLabel = (opId: OperationalPointIdentifier) => {
475-
if (opId.type === 'uic') return opId.uic.toString();
476-
if (opId.type === 'trigram') return opId.trigram;
477-
return opId.operational_point;
474+
export const getInvalidStepLabel = (opRef: OperationalPointReference) => {
475+
if (opRef.type === 'uic') return opRef.uic.toString();
476+
if (opRef.type === 'trigram') return opRef.trigram;
477+
return opRef.operational_point;
478478
};
479479

480480
export const matchOpRefAndOp = (

0 commit comments

Comments
 (0)