diff --git a/package-lock.json b/package-lock.json index 1f27d7ce2a98fddff3f9ba102ee9948e4c4818b5..3448ef59af09bfbfdadc488567c4377a29838f2a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3499,6 +3499,8 @@ "integrity": "sha512-cOyGQgMdhnRYtW2xrJUNrNYDjEgwQ+BrE2y93Bwz3h4DJ6vJRLfupemU5N3pbYsUlBHJf0u1j1UGk+NLW4d97g==", "dev": true, "requires": { + "@angular/compiler": "9.0.0", + "@angular/core": "9.0.0", "app-root-path": "^3.0.0", "aria-query": "^3.0.0", "axobject-query": "2.0.2", @@ -3513,6 +3515,18 @@ "zone.js": "~0.10.3" }, "dependencies": { + "@angular/compiler": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-9.0.0.tgz", + "integrity": "sha512-ctjwuntPfZZT2mNj2NDIVu51t9cvbhl/16epc5xEwyzyDt76pX9UgwvY+MbXrf/C/FWwdtmNtfP698BKI+9leQ==", + "dev": true + }, + "@angular/core": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@angular/core/-/core-9.0.0.tgz", + "integrity": "sha512-6Pxgsrf0qF9iFFqmIcWmjJGkkCaCm6V5QNnxMy2KloO3SDq6QuMVRbN9RtC8Urmo25LP+eZ6ZgYqFYpdD8Hd9w==", + "dev": true + }, "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", diff --git a/src/app/pages/articles/articles.component.html b/src/app/pages/articles/articles.component.html index ba7e011b6ec2df5c7360e74f391d90ca6a539ee4..bec977e06b561906ad963405de6962e7e2d2c85b 100644 --- a/src/app/pages/articles/articles.component.html +++ b/src/app/pages/articles/articles.component.html @@ -121,7 +121,7 @@ <!-- Tonality --> <ng-container matColumnDef="tonality"> <th mat-header-cell *matHeaderCellDef>Tonalité</th> - <td mat-cell *matCellDef="let article" [style.background]="article.color">{{ article.tonality }}</td> + <td mat-cell *matCellDef="let article" [style.background]="article.color" style="padding-left: 5px;">{{ article.tonality }}</td> </ng-container> <!-- Link --> diff --git a/src/app/pages/articles/articles.component.ts b/src/app/pages/articles/articles.component.ts index 206dc0784892b35d251b46e167d8ed82c2632c9f..7483284393b00a5b1f297a756ce0f879e0c39446 100644 --- a/src/app/pages/articles/articles.component.ts +++ b/src/app/pages/articles/articles.component.ts @@ -65,7 +65,7 @@ export class ArticlesComponent { displayTable: String = ''; allTables = true; - readonly ROOT_URL = ''; + readonly ROOT_URL = "http://localhost:3000"; constructor(private http: HttpClient) {} diff --git a/src/app/pages/data-entry/data-entry.component.css b/src/app/pages/data-entry/data-entry.component.css index 8c244950eeb3b28c49750caf56f56bd79a9f7940..363d25b25b4731dba2e42d916baa764e6660d10f 100644 --- a/src/app/pages/data-entry/data-entry.component.css +++ b/src/app/pages/data-entry/data-entry.component.css @@ -11,7 +11,7 @@ } .mat-tab-label { -font-size: 21px; + font-size: 21px; } :host { @@ -21,62 +21,80 @@ font-size: 21px; } form { -height: 1000px; + height: 1000px; } .mat-datepicker { -margin-top: 50px; + margin-top: 50px; } +body { + margin-bottom: 60px; +} /* Mat-option tonalities */ #tonalitePositive { -background: rgb(147,201,14); -padding-left: 50px; + background: rgb(147,201,14); + padding-left: 50px; } #tonalitePositive:hover, #tonaliteNegative:hover { -transform: scale(1.1); + transform: scale(1.1); } #tonaliteNegative { -background: #EF426F; -padding-left: 50px; + background: #EF426F; + padding-left: 50px; } #submit, #cancel{ -font-size: 18px; -margin-top: 150px; -position: absolute; -border-radius: 8px; + font-size: 18px; + margin-top: 150px; + position: absolute; + border-radius: 8px; } /* Buttons cancel and submit */ #submit { -margin-left: -20%; -border: 2px solid rgb(147,201,14); + margin-left: -20%; + border: 2px solid rgb(147,201,14); + background-color: rgb(147,201,14); + color: white; } #cancel { -margin-left: -60%; -border: 2px solid rgb(0,94,184); + margin-left: -60%; + border: 2px solid rgb(0,94,184); + background-color: rgb(0,94,184); + color: white; } #cancel:hover, #submit:hover { transform: scale(1.2); } +#cancel:hover { + background-color: white; + color: rgb(0,94,184); +} + +#submit:hover { + background-color: white; + color: rgb(147,201,14); +} + + .example-form { -min-width: 150px; -max-width: 500px; -width: 100%; + min-width: 150px; + max-width: 500px; + width: 100%; } .example-full-width { -width: 100%; + width: 100%; } diff --git a/src/app/pages/data-entry/data-entry.component.html b/src/app/pages/data-entry/data-entry.component.html index d8da2dc6ac44173e7bfda75c5919acea364cde1b..7d89952b51d0f5306a55aec87d84a7ea5c2a2289 100644 --- a/src/app/pages/data-entry/data-entry.component.html +++ b/src/app/pages/data-entry/data-entry.component.html @@ -68,13 +68,9 @@ </mat-form-field> - - - - <!-- Buttons Submit and cancel --> - <button mat-raised-button (click)="addOptionCP()" [style.background]="backgroundSubmitButton" [style.color]="colorTextSubmit" (mouseenter)="setHover('submit')" (mouseleave)="setHover('submit')" type="submit" id="submit"><strong>Valider</strong></button> - <button mat-raised-button (click)="emptyInputs()" [style.background]="backgroundCancelButton" [style.color]="colorTextCancel" (mouseenter)="setHover('cancel')" (mouseleave)="setHover('cancel')" id="cancel"><strong>Annuler</strong></button> + <button mat-raised-button (click)="addOptionCP()" type="submit" id="submit"><strong>Valider</strong></button> + <button mat-raised-button (click)="emptyInputs()" id="cancel"><strong>Annuler</strong></button> </form> </mat-tab> @@ -83,7 +79,7 @@ <!-- Retombée tab --> <mat-tab label="Article"> - <form action=""> + <form action="" style="margin-bottom: 60px;"> <mat-form-field class="mat-datepicker"> <mat-label>Date de parution</mat-label> <input matInput [matDatepicker]="datepicker2" > @@ -166,8 +162,8 @@ <!-- Buttons Submit and cancel --> - <button mat-raised-button (click)="addOptiontypeRetombe()" [style.background]="backgroundSubmitButton" [style.color]="colorTextSubmit" (mouseenter)="setHover('submit')" (mouseleave)="setHover('submit')" type="submit" id="submit"><strong>Valider</strong></button> - <button mat-raised-button (click)="emptyInputs()" [style.background]="backgroundCancelButton" [style.color]="colorTextCancel" (mouseenter)="setHover('cancel')" (mouseleave)="setHover('cancel')" id="cancel"><strong> Annuler</strong></button> + <button mat-raised-button (click)="addOptiontypeRetombe()" type="submit" id="submit"><strong>Valider</strong></button> + <button mat-raised-button (click)="emptyInputs()" id="cancel"><strong> Annuler</strong></button> </form> </mat-tab> </mat-tab-group> diff --git a/src/app/pages/data-entry/data-entry.component.ts b/src/app/pages/data-entry/data-entry.component.ts index 294255b2b1aff6ef2a7a844c2e750045345d9677..5536132cac2f19e8186064f29e33817f67db1996 100644 --- a/src/app/pages/data-entry/data-entry.component.ts +++ b/src/app/pages/data-entry/data-entry.component.ts @@ -157,27 +157,19 @@ export class DataEntryComponent implements OnInit { * Empty inputs */ public emptyInputs() { - location.reload(); - } - - //////////////////// Buttons \\\\\\\\\\\\\\\\\\\\ - - backgroundCancelButton = "rgb(0,94,184)"; - backgroundSubmitButton = "rgb(147,201,14)"; - colorTextSubmit = "#FFFFFF"; - colorTextCancel = "#FFFFFF"; + const inputs = document.querySelectorAll("input"); + for (let i = 0; i < inputs.length; i++) { + if (inputs[i]) { + inputs[i].value = ''; + } + } + const sel = document.querySelectorAll("mat-select"); + for (let i = 0; i < sel.length; i++) { + if (sel[i]) { + sel[i].textContent = ''; + } + } - public setHover(button: string){ - if (button === "submit"){ - let color = this.backgroundSubmitButton; - this.backgroundSubmitButton = this.colorTextSubmit; - this.colorTextSubmit = color; - } - else if (button === "cancel"){ - let color = this.backgroundCancelButton; - this.backgroundCancelButton = this.colorTextCancel; - this.colorTextCancel = color; - } } diff --git a/src/app/pages/graphics-page/graphics-page.component.ts b/src/app/pages/graphics-page/graphics-page.component.ts index 91ee03dd5927dbd4c0398e374ea3f06eeb3aed2a..d17e28f7c1ffb328b88870152ae136f7de6bd9f8 100644 --- a/src/app/pages/graphics-page/graphics-page.component.ts +++ b/src/app/pages/graphics-page/graphics-page.component.ts @@ -1,7 +1,7 @@ import { Component} from '@angular/core'; -import { Router } from '@angular/router'; import {FormControl, FormGroupDirective, NgForm, Validators } from '@angular/forms'; import {ErrorStateMatcher} from '@angular/material/core'; +import { HttpClient } from "@angular/common/http"; /** Error when invalid control is dirty, touched, or submitted. */ @@ -24,6 +24,7 @@ export class MyErrorStateMatcher implements ErrorStateMatcher { * Page that displays graphics (Templates and custom) */ export class GraphicsPageComponent { + readonly ROOT_URL = "http://localhost:3000"; validate = false; //True when generate button is clicked on and informations entered are accurates errorOcc = false; //Doesn't display graphic if error, display an error message @@ -55,7 +56,7 @@ export class GraphicsPageComponent { - constructor(private router: Router) { } + constructor(private http: HttpClient) { }