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

Create osrd_nge and test project of communication with an iframe #7536

Closed
21 tasks done
Tracked by #7534 ...
louisgreiner opened this issue May 28, 2024 · 0 comments
Closed
21 tasks done
Tracked by #7534 ...

Create osrd_nge and test project of communication with an iframe #7536

louisgreiner opened this issue May 28, 2024 · 0 comments
Assignees
Labels
area:front Work on Standard OSRD Interface modules area:gateway kind:feature-task Work related to a feature epic module:operational-studies Multi-train simulation with structured studies management

Comments

@louisgreiner
Copy link
Contributor

louisgreiner commented May 28, 2024

1st step of meta #7535

Acceptance criteria

  • NGE is customizable according to OSRD needs (can run without back-end)
  • Only NGE workspace is displayed (not the project management and authentication menus)
  • osrd-nge is available as npm package
  • A test iframe proves the communication between osrd-nge and NGE

Implementation plan

  • DevOps:
    • (Angular) Create osrd-nge: a wrapper (Angular app) that embed a build of NGE with specific settings for OSRD use (standalone mode) (see POC)
    • Build and publish osrd-nge in npm
    • Import osrd-nge from npm and make the NGE build available within OSRD build
  • Implement in NGE (with the help of Adrian):
    • (Angular) Back-end separation if standalone flag (around version-control.service.ts)
    • (Angular) eventEmitter on trainrun actions (create, update, delete) (set environment.customElement)
    • (Angular) Enable / disable NGE UI elements (authentication and project management components) to keep only workspace (netzgrafik) and filters (see Angular ngIf) (set environment.disableBackend)
  • Implement in osrd-nge:
  • Create a test iframe project which logs all trainrun actions and has a timetable upload button using postMessages and eventListeners.

Description

NGE will be refacto to be customizable for the use of OSRD (= without back-end, aka standalone mode).

A minimalist Angular project, named osrd-nge, will embed the whole application NGE, named nge-app, with custom settings.

Concept diagram:

OSRD-NGE Concept diagram

DevOps / NGE deployment

Create osrd-nge, import nge-app to build it (see POC) and publish it in npm.

Don't forget to set nge-app with standalone flag.

Once it's done, import the build of osrd-nge from npm and build NGE for osrd-front.

Split front-end / back-end

Supported by Adrian, enable / disable functions and components in NGE front-end official repos, depending on the value of the standalone flag.

See version-control.service.ts (one of the back-end links should be there)

See Angular ngIf.

See POC of disabling NGE back-end, to be reproduced in NGE at a larger scale.

Communication through customElement

See current work

Payloads

See Trainrun data model and TrainrunSection data model

Create trainrun:

TrainrunSectionOperation {
    "type": "create",
    "trainrunSection": TrainrunSection
}

Update trainrun:

TrainrunOperation {
    "type": "update",
    "trainrun": Trainrun
}

Delete trainrun:

TrainrunOperation {
    "type": "delete",
    "trainrun": Trainrun
}

Resulting POC

The resulting test project should be enough preparation to ease next step of integration (front-end integration and OSRD to NGE communication, through osrd-nge)

Contacts: @louisgreiner (SNCF Réseau) - @aiAdrian (SBB CFF FFS)

Definition of ready

  • PO

    • Acceptance criteria are clear and understandable
  • Technical

    • If required documentation is available on osrd.fr
    • Implementation plan is detailed and validated by maintainers
  • General

    • WSJF values are filled
    • Validated by the PM
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 area:gateway kind:feature-task Work related to a feature epic module:operational-studies Multi-train simulation with structured studies management
Projects
None yet
Development

No branches or pull requests

3 participants