Aller au contenu

Navigation in the application

Copy of sumaris-app/.agents/rules/navigation.md (rule written for AI coding agents, when navigating in the application (e.g. to test it, to reproduce a bug, or to write e2e tests), or when adding a new page/route). Do not edit here: run npm run site:sync-rules to update it.

The application follows the same navigation pattern for every kind of data:

  1. A side menu entry (ion-menu[side="start"]) opens a root table (e.g. "Marées" → trips table);
  2. A click on a row of the root table opens the editor (a page) of this data;
  3. The editor has tabs (mat-tab-group): the first tab holds the entity form, the other tabs hold the children tables;
  4. A click on a row of a child table opens the child editor (same pattern, recursively);
  5. Once an editor is opened, the side menu displays sub-items for it (the opened data, then its tabs), like a breadcrumb.

Menu entries are declared in src/app/app.module.ts (APP_MENU_ITEMS); routes in src/app/app-routing.module.ts, then in each module's *-routing.module.ts.

Programs

Most data (trips, observed locations, activity calendars...) belong to a program (column "Programme" of the root tables, td.mat-column-program). The program options (ProgramProperties, e.g. sumaris.landing.editor) change the editors that are used, the displayed tabs, the columns, etc. So the same menu entry can lead to different editors depending on the program (see the tables below).

To find the data of a program in a root table, use the filter panel (toolbar button filter_list_alt), then the program autocomplete field, then "Appliquer".

Read-only mode (data quality)

The quality state of a root data is shown in the "État" column (app-entity-quality-icon) and in the quality card of the editor (app-entity-quality-form):

State (FR / EN) Condition Editor
En cours de saisie / Modified no controlDate editable
Terminé / Completed controlDate set editable
Validé / Validated validationDate set readonly
Qualifié / Qualified qualificationDate set readonly
  • Only a validated data opens its editor in readonly mode (AppRootDataEntityEditor.canUserWrite() returns false once validationDate is set): all inputs are disabled, and the children tables are readonly too (the "add" button is disabled or hidden), as well as the child editors;
  • Validation is done from the quality card: button "Valider" (SUPERVISOR profile only), then "Dévalider" to revert;
  • Some referential editors also open in read mode, whatever the quality (e.g. the vessel page, that needs a click on an "edit" button).

Main routes

Menu (FR) Root table (path) Editor (path) Tabs (children)
Campagnes en mer /scientific-cruise (table only)
Marées /trips /trips/:tripId Marée, Engins, Opérations
Sorties /observations /observations/:observedLocationId Sortie, landings tab (see below)
Calendriers d'activité /activity-calendar /activity-calendar/:id Général, Navire, Calendrier, Métiers
Photos /photo/gallery (slideshow, in a modal)
Navires /vessels /vessels/:id
Programmes /referential/programs /referential/programs/:programId (SUPERVISOR profile)
Modèles d'IA /ai-models /ai-models/:id (/ai-models/new)
Téléchargements /extraction/data
Jeux de données /extraction/products /extraction/product/:productId (.../new)
Cartes /extraction/map
(none) /ichthyometer → /ichthyometer/ruler
Paramètres /settings

A new entity is opened with the new id (e.g. /trips/new), from the "add" button (+) of the root table toolbar.

Trips ("Marées")

  • /trips/:tripId → TripPage (tabs: "Marée", "Engins" = physical gears, "Opérations");
  • A click on an operation row opens the operation editor. The editor depends on the program:
    • /trips/:tripId/operation/:operationId → OperationPage (tabs: "Opération", "Capture", and sometimes "Tests de survie"...);
    • /trips/:tripId/operation/advanced/:operationId → AdvancedOperationPage (e.g. SIH-OBSMER: tabs "Opération", "Capture", "Captures accidentelles");
    • /trips/:tripId/operation/selectivity/:operationId → SelectivityOperationPage (e.g. APASE).
  • Physical gears are edited in a modal (no route).

Observed locations ("Sorties")

  • /observations/:observedLocationId → ObservedLocationPage (tabs: "Sortie", then a landings tab whose title depends on the program: "Navires observés", "Navires contrôlés", "Échantillonnages"...);
  • The landings tab contains a LandingsTable (or an AggregatedLandingsTable). The child editor depends on the program option sumaris.landing.editor:
sumaris.landing.editor Child route Editor Example program
landing (default) /observations/:id/landing/:landingId LandingPage
control /observations/:id/control/:landingId AuctionControlPage ADAP-CONTROLE
sampling /observations/:id/sampling/:landingId SamplingLandingPage SIH-OBSBIO
trip /observations/:id/trip/:tripId LandedTripPage SIH-OBSDEB
sale /observations/:id/sale/:saleId (or sale/new) SalePage SIH-OBSVENTES
  • For trip and sale editors, the landings table uses inline edition: a click on a row edits it in place, and the child editor is opened with a button at the end of the row ("Ouvrir la marée" / "Ouvrir la vente");
  • For aggregated landings (e.g. SIH-META-OBSDEB), a click on a row opens a modal (app-aggregated-landing-modal), without navigation.
  • Rows of the landings table may be grouped, with divider rows (tr.divider, e.g. "PETS", "Tirage au sort").

Test data (local pod)

The local pod test database contains, for each program:

Menu Program Data
Marées SIH-OBSMER 1 trip, with operations (advanced editor)
Marées ADAP-MER 1 trip, completed (Terminé)
Marées APASE 1 trip, validated (readonly), selectivity operation editor
Marées PIFIL 1 trip, with gears and operations
Marées SUMARiS 2 trips (one completed, with operations and survival tests)
Sorties SIH-OBSVENTES 3 observed locations (sales)
Sorties SIH-OBSDEB-IFREMER 1 observed location, without landings
Sorties SIH-OBSBIO 2 observed locations (sampling landings)
Sorties SIH-OBSDEB 1 observed location (landed trips)
Sorties SIH-META-OBSDEB 1 observed location (aggregated landings)
Sorties ADAP-CONTROLE 1 observed location, completed (auction controls)
Calendriers SIH-ACTIFLOT activity calendars for 2023 and 2024

Test users (admin, supervisor, observer) are declared in e2e/.environments.json.