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

Change name for interne deployment #10302

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from

Conversation

Uriel-Sautron
Copy link
Contributor

@Uriel-Sautron Uriel-Sautron commented Jan 9, 2025

close #10281
For internal deployment we need to display the LMR and Horizon logos.

For test:

  • create a folder overrides at the front root
  • add in this folder the images you find here and overrides.json
// overrides.json
{
   "name": {
     "stdcm": "Last Minute Request",
     "digital_twin": "Horizon"
   },
 "icons": {
    "stdcm": {
      "light": "Logotype_LastMinuteRequest_light",
      "dark": "Logotype_LastMinuteRequest_dark"
    },
    "digital_twin": {
      "light": "Logotype_Horizon_light",
      "dark": "Logotype_Horizon_dark"
    }
  }
} 

@Uriel-Sautron Uriel-Sautron requested a review from a team as a code owner January 9, 2025 12:58
@github-actions github-actions bot added the area:front Work on Standard OSRD Interface modules label Jan 9, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jan 9, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.43%. Comparing base (ef6e28e) to head (9e3dc3d).
Report is 62 commits behind head on dev.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

❗ There is a different number of reports uploaded between BASE (ef6e28e) and HEAD (9e3dc3d). Click for more details.

HEAD has 6 uploads less than BASE
Flag BASE (ef6e28e) HEAD (9e3dc3d)
osrdyne 2 1
gateway 2 1
tests 2 1
front 2 0
editoast 2 1
Additional details and impacted files
@@             Coverage Diff             @@
##              dev   #10302       +/-   ##
===========================================
- Coverage   81.45%   67.43%   -14.03%     
===========================================
  Files        1058      366      -692     
  Lines      104235    37193    -67042     
  Branches      722        0      -722     
===========================================
- Hits        84907    25080    -59827     
+ Misses      19287    12113     -7174     
+ Partials       41        0       -41     
Flag Coverage Δ
editoast 73.62% <ø> (+<0.01%) ⬆️
front ?
gateway 2.18% <ø> (ø)
osrdyne 3.28% <ø> (ø)
railjson_generator 87.50% <ø> (ø)
tests 87.05% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@ElysaSrc ElysaSrc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR !

In my understanding of the front (which might get a bit rusty over time) I think we should reference directly only the files that are present in the code base (the default logo) and switch if the override file exists on the server and defines the fields on the json.

stdcmLogo: undefined,
stdcmPngLogo: defaultLogo,
});
const [isIntenalProd, setIsIntenalProd] = useState(false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should not name this internalProd, but "customizedDeployment", it seems more accurate.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -15,6 +16,7 @@ import type { SimulationReportSheetProps } from '../../types';
import { getStopDurationTime } from '../../utils/formatSimulationReportSheet';

const getSecondaryCode = ({ location }: StdcmPathStep) => location!.secondary_code;
const lmrLogoPath = '../../overrides/[email protected]';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not reference any override directly in terms of path, they are dynamically defined by the JSON.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@Uriel-Sautron Uriel-Sautron requested review from Yohh and ElysaSrc January 9, 2025 14:43
Copy link
Member

@ElysaSrc ElysaSrc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM, thanks !


const lmrLogoPath = `../../overrides/${icons.stdcm.light}.svg`;
const lmrPngLogoPath = `../../overrides/${icons.stdcm.light}@2x.png`;
const horizonFullLogoPath = `../../overrides/${icons.digital_twin.dark}.svg`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reasons to use ../../overrides vs /overrides ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:front Work on Standard OSRD Interface modules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Personnaliser les déploiements internes avec les nouveaux noms
4 participants