diff --git a/front/public/locales/en/infraEditor.json b/front/public/locales/en/infraEditor.json index 594d6ec8404..fbb0e1626d2 100644 --- a/front/public/locales/en/infraEditor.json +++ b/front/public/locales/en/infraEditor.json @@ -582,6 +582,18 @@ } } }, + "TrackSectionSourceExtension": { + "properties": { + "name": { + "title": "Source", + "description": "Name of the source" + }, + "id": { + "title": "Source ID", + "description": "ID of the element within the source" + } + } + }, "TvmSystem": { "properties": { "next_signaling_systems": { diff --git a/front/public/locales/en/translation.json b/front/public/locales/en/translation.json index 474fc6fcce5..632fbe36c3e 100644 --- a/front/public/locales/en/translation.json +++ b/front/public/locales/en/translation.json @@ -394,6 +394,7 @@ "of-type": "of type", "selection": "{{count}} item selected", "selection_plural": "{{count}} items selected", + "sources": "Sources", "title": "Select", "unselect": "Deselect" }, diff --git a/front/public/locales/fr/infraEditor.json b/front/public/locales/fr/infraEditor.json index dd0e38479a1..8a12f627804 100644 --- a/front/public/locales/fr/infraEditor.json +++ b/front/public/locales/fr/infraEditor.json @@ -582,6 +582,18 @@ } } }, + "TrackSectionSourceExtension": { + "properties": { + "name": { + "title": "Source", + "description": "Nom de la source" + }, + "id": { + "title": "Source ID", + "description": "Identifiant de l'élément dans la source" + } + } + }, "TvmSystem": { "properties": { "next_signaling_systems": { diff --git a/front/public/locales/fr/translation.json b/front/public/locales/fr/translation.json index 212b88fa0ad..486c3488388 100644 --- a/front/public/locales/fr/translation.json +++ b/front/public/locales/fr/translation.json @@ -377,6 +377,7 @@ "of-type": "de type", "selection": "{{count}} élément sélectionné", "selection_plural": "{{count}} éléments sélectionnés", + "sources": "Sources", "title": "Sélection", "unselect": "Désélectionner" }, diff --git a/front/src/applications/editor/components/EntitySumUp.tsx b/front/src/applications/editor/components/EntitySumUp.tsx index a42a3a91cfd..b6e746ea48c 100644 --- a/front/src/applications/editor/components/EntitySumUp.tsx +++ b/front/src/applications/editor/components/EntitySumUp.tsx @@ -1,4 +1,4 @@ -import React, { type FC, useEffect, useState } from 'react'; +import React, { type FC, useEffect, useState, Fragment } from 'react'; import cx from 'classnames'; import type { TFunction } from 'i18next'; @@ -113,6 +113,7 @@ function getSumUpContent( let text = ''; const subtexts: (string | JSX.Element)[] = []; const classes = { ...DEFAULT_CLASSES, ...(classesOverride || {}) }; + const sources: string[] = []; switch (entity.objType) { case 'TrackSection': { @@ -125,6 +126,10 @@ function getSumUpContent( text = trackSection.properties.id; } if (attrs.line_name) subtexts.unshift(attrs.line_name); + const source = trackSection.properties.extensions?.source; + if (source) { + sources.push(`${source.name} ${source.id}`); + } break; } // @ts-expect-error: Here we only deal with the installation_type, the rest is handled with BufferStop and Detector. @@ -280,6 +285,14 @@ function getSumUpContent( {s} ))} + {sources.length > 0 && ( +