Skip to content

Commit

Permalink
front: rename panel to sign and LPV to PSL
Browse files Browse the repository at this point in the history
  • Loading branch information
kmer2016 authored and clarani committed Oct 4, 2023
1 parent 7e60fdd commit cb78a63
Show file tree
Hide file tree
Showing 34 changed files with 619 additions and 626 deletions.
2 changes: 1 addition & 1 deletion front/public/locales/en/map-settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"showIGNCadastre": "Cadastre ©IGN",
"showOSM": "Map background OSM",
"showOSMtracksections": "OSM tracks",
"sncf_lpv": "Permanent speed limits",
"sncf_psl": "Permanent speed limits",
"speedlimits": "Speed limits",
"stops": "Stop signs",
"switches": "Switch",
Expand Down
30 changes: 15 additions & 15 deletions front/public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"catenaries": "Catenaries",
"detectors": "Detectors",
"errors": "Errors",
"lpv-lpv_panels": "Permanent speed limits",
"psl-psl_signs": "Permanent speed limits",
"routes": "Routes",
"signals": "Signals",
"switches": "Switches",
Expand Down Expand Up @@ -327,30 +327,30 @@
"reset-speed-section": "Cancel the current modifications"
},
"add-new-speed-limit": "Add new speed limit",
"add-panel": "Add a panel from {{panelType}} type",
"add-sign": "Add a sign from {{signType}} type",
"add-track-range": "Click to link to:",
"additional-speed-limit": "Additional speed limits",
"hovered-panel": "Panel {{panelType}}",
"hovered-sign": "Sign {{signType}}",
"label": "Speed section tool",
"main-speed-limit": "Default speed limit",
"move-range-extremity": "Click to move the end:",
"new-tag": "Composition code",
"panel-angle-geo": "Angle Geo",
"panel-angle-sch": "Angle Sch",
"panel-category": "Panel(s) {{panelType}}",
"panel-select": "Select",
"panel-remove": "Remove panel",
"panel-position": "Position",
"panel-track-id": "Track section id",
"panel-type": "Type",
"panel-side": "Side",
"panel-value": "Speed",
"panels-section-list": "Section panels list",
"sign-angle-geo": "Angle Geo",
"sign-angle-sch": "Angle Sch",
"sign-category": "Sign(s) {{signType}}",
"sign-select": "Select",
"sign-remove": "Remove sign",
"sign-position": "Position",
"sign-track-id": "Track section id",
"sign-type": "Type",
"sign-side": "Side",
"sign-value": "Speed",
"signs-section-list": "Section signs list",
"remove-track-range": "Click to detatch from:",
"save-existing-speed-section": "Save modifications",
"save-new-speed-section": "Save the new speed limit",
"speed-limits": "Speed limits",
"toggle-lpv": "Permanent speed limit"
"toggle-psl": "Permanent speed limit"
},
"range-edition": {
"edit-track-range-start": "Edit departure point",
Expand Down
2 changes: 1 addition & 1 deletion front/public/locales/fr/map-settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"showIGNCadastre": "Cadastre ©IGN",
"showOSM": "Fond de carte OSM",
"showOSMtracksections": "Voies OSM",
"sncf_lpv": "Limites permanentes de vitesse",
"sncf_psl": "Limites permanentes de vitesse",
"speedlimits": "Vitesses limites",
"stops": "Pancartes d'arrêt",
"switches": "Appareils de voie",
Expand Down
30 changes: 15 additions & 15 deletions front/public/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"catenaries": "Électrifications",
"detectors": "Détecteurs",
"errors": "Erreurs",
"lpv-lpv_panels": "Limites permanentes de vitesse",
"psl-psl_signs": "Limites permanentes de vitesse",
"routes": "Itinéraires",
"signals": "Signaux",
"switches": "Aiguillages",
Expand Down Expand Up @@ -327,30 +327,30 @@
"reset-speed-section": "Annuler les modifications en cours"
},
"add-new-speed-limit": "Ajouter une nouvelle limitation",
"add-panel": "Ajouter un panneau de type {{panelType}}",
"add-sign": "Ajouter un panneau de type {{signType}}",
"add-track-range": "Cliquer pour lier à :",
"additional-speed-limit": "Limitation de vitesse additionnelles",
"hovered-panel": "Panneau {{panelType}}",
"hovered-sign": "Panneau {{signType}}",
"label": "Outil \"Vitesse limite\"",
"main-speed-limit": "Limitation de vitesse par défaut",
"move-range-extremity": "Cliquer pour déplacer l'extrémité :",
"new-tag": "Code de composition",
"panel-angle-geo": "Angle Geo",
"panel-angle-sch": "Angle Sch",
"panel-category": "Panneau(x) {{panelType}}",
"panel-select": "Sélectionner",
"panel-remove": "Supprimer le panneau",
"panel-position": "Position",
"panel-track-id": "Track section id",
"panel-type": "Type",
"panel-side": "Côté",
"panel-value": "Vitesse",
"panels-section-list": "Liste des panneaux de la section",
"sign-angle-geo": "Angle Geo",
"sign-angle-sch": "Angle Sch",
"sign-category": "Panneau(x) {{signType}}",
"sign-select": "Sélectionner",
"sign-remove": "Supprimer le panneau",
"sign-position": "Position",
"sign-track-id": "Track section id",
"sign-type": "Type",
"sign-side": "Côté",
"sign-value": "Vitesse",
"signs-section-list": "Liste des panneaux de la section",
"remove-track-range": "Cliquer pour détacher de :",
"save-existing-speed-section": "Sauvegarder les modifications",
"save-new-speed-section": "Sauvegarder la nouvelle limite de vitesse",
"speed-limits": "Limitations de vitesses",
"toggle-lpv": "Limite permanente de vitesse"
"toggle-psl": "Limite permanente de vitesse"
},
"range-edition": {
"edit-track-range-start": "Modifier le point de départ",
Expand Down
6 changes: 3 additions & 3 deletions front/src/applications/editor/components/LayersModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import switchesIcon from 'assets/pictures/layersicons/switches.svg';
import detectorsIcon from 'assets/pictures/layersicons/detectors.svg';
import trackSectionsIcon from 'assets/pictures/layersicons/layer_adv.svg';
import signalsIcon from 'assets/pictures/layersicons/layer_signal.svg';
import lpvsIcon from 'assets/pictures/layersicons/layer_tivs.svg';
import pslsIcon from 'assets/pictures/layersicons/layer_tivs.svg';

import SwitchSNCF from 'common/BootstrapSNCF/SwitchSNCF/SwitchSNCF';
import { useModal, Modal } from 'common/BootstrapSNCF/ModalSNCF';
Expand All @@ -31,7 +31,7 @@ const LAYERS: Array<{ layers: LayerType[]; icon: string | JSX.Element }> = [
{ layers: ['detectors'], icon: detectorsIcon },
{ layers: ['switches'], icon: switchesIcon },
{ layers: ['speed_sections'], icon: <MdSpeed style={{ width: '20px' }} className="mx-2" /> },
{ layers: ['lpv', 'lpv_panels'], icon: lpvsIcon },
{ layers: ['psl', 'psl_signs'], icon: pslsIcon },
{ layers: ['catenaries'], icon: <GiElectric style={{ width: '20px' }} className="mx-2" /> },
{
layers: ['errors'],
Expand Down Expand Up @@ -69,7 +69,7 @@ const LayersModal: FC<LayersModalProps> = ({
() =>
selection
? mapKeys(
// TODO: ATM we don't know if a selected speed section should be considered as SpeedSection or LPV,
// TODO: ATM we don't know if a selected speed section should be considered as SpeedSection or PSL,
// which are two different layers.
mapValues(groupBy(selection, 'objType'), (values) => values.length),
(_values, key) => EDITOAST_TO_LAYER_DICT[key as EditoastType]
Expand Down
26 changes: 13 additions & 13 deletions front/src/applications/editor/tools/rangeEdition/components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ import {
CatenaryEntity,
EntityObjectOperationResult,
SpeedSectionEntity,
SpeedSectionLpvEntity,
SpeedSectionPslEntity,
} from '../../../../types';
import { NEW_ENTITY_ID } from '../../data/utils';
import { LoaderFill } from '../../../../common/Loader';
import EntitySumUp from '../../components/EntitySumUp';
import { save } from '../../../../reducers/editor';
import EditLPVSection from './speedSection/EditLPVSection';
import EditPSLSection from './speedSection/EditPSLSection';
import { ExtendedEditorContextType, PartialOrReducer } from '../editorContextTypes';
import { getPointAt, speedSectionIsLpv } from './utils';
import { getPointAt, speedSectionIsPsl } from './utils';
import SpeedSectionMetadataForm from './speedSection/SpeedSectionMetadataForm';
import CatenaryMetadataForm from './catenary/CatenaryMetadataForm';

Expand Down Expand Up @@ -211,7 +211,7 @@ export const RangeEditionLeftPanel: FC = () => {
>;
const isNew = entity.properties.id === NEW_ENTITY_ID;
const [isLoading, setIsLoading] = useState(false);
const isLPV = speedSectionIsLpv(entity as SpeedSectionEntity);
const isPSL = speedSectionIsPsl(entity as SpeedSectionEntity);

const infraID = useSelector(getInfraID);

Expand Down Expand Up @@ -308,19 +308,19 @@ export const RangeEditionLeftPanel: FC = () => {
<div className="d-flex">
<CheckboxRadioSNCF
type="checkbox"
id="is-lpv-checkbox"
name="is-lpv-checkbox"
checked={isLPV}
label={t('Editor.tools.speed-edition.toggle-lpv')}
id="is-psl-checkbox"
name="is-psl-checkbox"
checked={isPSL}
label={t('Editor.tools.speed-edition.toggle-psl')}
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
let newExtension: SpeedSectionEntity['properties']['extensions'] = {
lpv_sncf: null,
psl_sncf: null,
};
if (e.target.checked) {
const firstRange = (entity.properties?.track_ranges || [])[0];
if (!firstRange) return;
newExtension = {
lpv_sncf: initialEntity.properties?.extensions?.lpv_sncf || {
psl_sncf: initialEntity.properties?.extensions?.psl_sncf || {
announcement: [],
r: [],
z: {
Expand All @@ -339,9 +339,9 @@ export const RangeEditionLeftPanel: FC = () => {
}}
/>
</div>
{isLPV && (
<EditLPVSection
entity={entity as SpeedSectionLpvEntity}
{isPSL && (
<EditPSLSection
entity={entity as SpeedSectionPslEntity}
setState={
setState as (
stateOrReducer: PartialOrReducer<RangeEditionState<SpeedSectionEntity>>
Expand Down

This file was deleted.

Loading

0 comments on commit cb78a63

Please sign in to comment.