From 6ecf11a2b2f11e268441ca3b9c23b0ae634afb18 Mon Sep 17 00:00:00 2001 From: "mathias.chouet" <mathias.chouet@irstea.fr> Date: Wed, 13 Feb 2019 15:14:11 +0100 Subject: [PATCH] =?UTF-8?q?Nouvelle=20pr=C3=A9sentation=20pour=20le=20log?= =?UTF-8?q?=20de=20calcul?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fixed-results.component.scss | 1 + .../log-entry/log-entry.component.html | 17 ++++++-------- .../log-entry/log-entry.component.scss | 13 +++++++++++ .../log-entry/log-entry.component.ts | 11 +++------ src/app/components/log/log.component.html | 7 ++---- src/app/components/log/log.component.scss | 22 ++++++++++++++++++ src/app/components/log/log.component.ts | 23 +++---------------- 7 files changed, 51 insertions(+), 43 deletions(-) create mode 100644 src/app/components/log-entry/log-entry.component.scss create mode 100644 src/app/components/log/log.component.scss diff --git a/src/app/components/fixedvar-results/fixed-results.component.scss b/src/app/components/fixedvar-results/fixed-results.component.scss index fe68aab1b..6884f3f37 100644 --- a/src/app/components/fixedvar-results/fixed-results.component.scss +++ b/src/app/components/fixedvar-results/fixed-results.component.scss @@ -5,6 +5,7 @@ .fixed-results-container { margin-top: 1em; border: solid #ccc 1px; + border-radius: 2px; } table.mat-table { diff --git a/src/app/components/log-entry/log-entry.component.html b/src/app/components/log-entry/log-entry.component.html index 4e725d2a8..666b2665e 100644 --- a/src/app/components/log-entry/log-entry.component.html +++ b/src/app/components/log-entry/log-entry.component.html @@ -1,11 +1,8 @@ <div class="entry"> - <div style="text-align: center;"> - <mat-icon *ngIf="levelInfo" style="color:green">check_circle</mat-icon> - <mat-icon *ngIf="levelWarning" style="color:orange">error_outline</mat-icon> - <mat-icon *ngIf="levelError" style="color:red">warning</mat-icon> - </div> - <div> - <!-- on utilise [innerHTML] pour que les codes HTML comme soient interprétés correctement --> - <span [innerHTML]="text"></span> - </div> -</div> \ No newline at end of file + <mat-icon *ngIf="levelInfo" style="color:green">check_circle</mat-icon> + <mat-icon *ngIf="levelWarning" style="color:orange">error_outline</mat-icon> + <mat-icon *ngIf="levelError" style="color:red">warning</mat-icon> + + <!-- on utilise [innerHTML] pour que les codes HTML comme soient interprétés correctement --> + <div class="entry-text" [innerHTML]="text"></div> +</div> diff --git a/src/app/components/log-entry/log-entry.component.scss b/src/app/components/log-entry/log-entry.component.scss new file mode 100644 index 000000000..ba2c18727 --- /dev/null +++ b/src/app/components/log-entry/log-entry.component.scss @@ -0,0 +1,13 @@ +.entry { + margin-top: 0.5em; + + mat-icon { + float: left; + } + + .entry-text { + padding-top: 4px; + padding-left: 32px; + margin-bottom: 12px; + } +} diff --git a/src/app/components/log-entry/log-entry.component.ts b/src/app/components/log-entry/log-entry.component.ts index 1e7fa254a..5bdc15e53 100644 --- a/src/app/components/log-entry/log-entry.component.ts +++ b/src/app/components/log-entry/log-entry.component.ts @@ -8,14 +8,9 @@ import { ApplicationSetupService } from "../../services/app-setup/app-setup.serv @Component({ selector: "log-entry", templateUrl: "./log-entry.component.html", - styles: [` - .entry { - margin-left: 1em; - margin-right: 1em; - margin-top: 0.5em; - margin-bottom: 0.5em; - } - `] + styleUrls: [ + "./log-entry.component.scss" + ] }) export class LogEntryComponent implements OnChanges { diff --git a/src/app/components/log/log.component.html b/src/app/components/log/log.component.html index c2c1364aa..4d3d0424a 100644 --- a/src/app/components/log/log.component.html +++ b/src/app/components/log/log.component.html @@ -2,10 +2,7 @@ <div class="hyd_log"> <!-- titre --> <div class="titre">{{ uitextTitreJournal }}</div> - <!-- entrées du journal --> - <ng-template ngFor let-m [ngForOf]="messages"> - <log-entry [_message]=m></log-entry> - </ng-template> + <log-entry *ngFor="let m of messages" [_message]="m"></log-entry> </div> -</div> \ No newline at end of file +</div> diff --git a/src/app/components/log/log.component.scss b/src/app/components/log/log.component.scss new file mode 100644 index 000000000..7dee1f923 --- /dev/null +++ b/src/app/components/log/log.component.scss @@ -0,0 +1,22 @@ +:host { + display: block; +} + +.hyd_log { + margin-top: 1em; + border: solid #ccc 1px; + border-radius: 2px; + padding: 1em; + padding-top : 1.3em; +} + +.titre { + background-color: white; + border: 1px solid #ccc; + border-radius: 2px; + float: left; + font-weight: bold; + margin-bottom: -1em; + margin-top: -2.3em; + padding: 0.2em 0.5em; +} diff --git a/src/app/components/log/log.component.ts b/src/app/components/log/log.component.ts index 83eb05fe0..bd710cb56 100644 --- a/src/app/components/log/log.component.ts +++ b/src/app/components/log/log.component.ts @@ -7,26 +7,9 @@ import { I18nService } from "../../services/internationalisation/internationalis @Component({ selector: "log", templateUrl: "./log.component.html", - styles: [` - .hyd_log { - border : 1px solid black; - margin : 1.8em 0; - padding-top : 1.3em; - border-radius: 10px; - } - .titre { - background-color: #00b0ff; - border: 1px solid black; - border-radius: 5px; - float: left; - font-size: 1.15em; - font-weight: bold; - margin-bottom: -1em; - margin-left: 0.5em; - margin-top: -2.3em; - padding: 0.2em 0.5em; - } - `] + styleUrls: [ + "./log.component.scss" + ] }) export class LogComponent { /** -- GitLab