diff --git a/src/app/components/modules-diagram/modules-diagram.component.html b/src/app/components/modules-diagram/modules-diagram.component.html index 2eeab473b56d4df2c78ba1a6c46140663b3872e3..5ab3d189018ebde5028a9bb47b32e261203be66a 100644 --- a/src/app/components/modules-diagram/modules-diagram.component.html +++ b/src/app/components/modules-diagram/modules-diagram.component.html @@ -3,6 +3,11 @@ <mat-card-header> <mat-card-title> <h1>{{ uitextTitle }}</h1> + <div id="show-notes" *ngIf="hasNotes"> + <a routerLink="/properties"> + {{ uitextShowNotes }} + </a> + </div> </mat-card-title> </mat-card-header> diff --git a/src/app/components/modules-diagram/modules-diagram.component.scss b/src/app/components/modules-diagram/modules-diagram.component.scss index 81263dfb97a8f3a79b3a06f463ae43d0558897fb..edc2415905aa126b6b50123168e2534809d95c5a 100644 --- a/src/app/components/modules-diagram/modules-diagram.component.scss +++ b/src/app/components/modules-diagram/modules-diagram.component.scss @@ -7,3 +7,17 @@ a.show-debug { cursor: pointer; } + +mat-card-title { + + #show-notes { + font-size: 16px; + font-weight: normal; + margin-top: -8px; + + > a { + cursor: pointer; + font-size: .9em; + } + } +} diff --git a/src/app/components/modules-diagram/modules-diagram.component.ts b/src/app/components/modules-diagram/modules-diagram.component.ts index 7d0fcf91d0d37e394ae5296aea5ff24f0a338b0f..b701aeac988e740c29a50945eff8cc63718fb7bb 100644 --- a/src/app/components/modules-diagram/modules-diagram.component.ts +++ b/src/app/components/modules-diagram/modules-diagram.component.ts @@ -74,6 +74,10 @@ export class ModulesDiagramComponent implements AfterContentInit, AfterViewCheck return this.intlService.localizeText("INFO_DIAGRAM_CALCULATED_PARAM"); } + public get uitextShowNotes() { + return this.intlService.localizeText("INFO_DIAGRAM_SHOW_NOTES"); + } + public ngAfterViewChecked() { if (this.needsToInitSvgPanZoom) { this.initSvgPanZoom(); @@ -150,6 +154,10 @@ export class ModulesDiagramComponent implements AfterContentInit, AfterViewCheck return Session.getInstance().getNumberOfNubs() > 0; } + public get hasNotes(): boolean { + return !! Session.getInstance().documentation; + } + /** * Builds a Mermaid graph text definition */ diff --git a/src/locale/messages.en.json b/src/locale/messages.en.json index e8203692f76f17a10010144290f6cb7c499fab92..0137e4a7dccb81a89a99c1a8a6be03ec627c0c84 100644 --- a/src/locale/messages.en.json +++ b/src/locale/messages.en.json @@ -95,6 +95,7 @@ "INFO_DIAGRAM_TITLE": "Calculation modules diagram", "INFO_DIAGRAM_DRAWING_ERROR": "Error while drawing diagram", "INFO_DIAGRAM_CALCULATED_PARAM": "calculated parameter", + "INFO_DIAGRAM_SHOW_NOTES": "Show notes", "INFO_DIALOG_COMPUTED_VALUE_TITLE": "Edit initial value", "INFO_DIALOG_EDIT_PAB_INTERPOLATION_BOUNDS": "between %s and %s", "INFO_DIALOG_EDIT_PAB_N_DEVICES": "%s device(s)", diff --git a/src/locale/messages.fr.json b/src/locale/messages.fr.json index 03d3840647e70b6fabed195adaf1cc27b32a67f2..ae234aa6cf9f0e2d573c34ef1d496fced468c212 100644 --- a/src/locale/messages.fr.json +++ b/src/locale/messages.fr.json @@ -95,6 +95,7 @@ "INFO_DIAGRAM_TITLE": "Diagramme des modules de calcul", "INFO_DIAGRAM_DRAWING_ERROR": "Erreur lors du dessin du diagramme", "INFO_DIAGRAM_CALCULATED_PARAM": "paramètre calculé", + "INFO_DIAGRAM_SHOW_NOTES": "Voir les notes", "INFO_DIALOG_COMPUTED_VALUE_TITLE": "Modifier la valeur initiale", "INFO_DIALOG_EDIT_PAB_INTERPOLATION_BOUNDS": "entre %s et %s", "INFO_DIALOG_EDIT_PAB_N_DEVICES": "%s ouvrage(s)",