diff --git a/src/app/pages/data-entry/data-entry.component.css b/src/app/pages/data-entry/data-entry.component.css index 363d25b25b4731dba2e42d916baa764e6660d10f..69147fcdceff03ea341e25ff0f1c0fff91241c3d 100644 --- a/src/app/pages/data-entry/data-entry.component.css +++ b/src/app/pages/data-entry/data-entry.component.css @@ -21,7 +21,7 @@ } form { - height: 1000px; +height: 1200px; } diff --git a/src/app/pages/data-entry/data-entry.component.html b/src/app/pages/data-entry/data-entry.component.html index 7d89952b51d0f5306a55aec87d84a7ea5c2a2289..2887c5329c667e52597dbf48f955ff1ed6aba99f 100644 --- a/src/app/pages/data-entry/data-entry.component.html +++ b/src/app/pages/data-entry/data-entry.component.html @@ -21,7 +21,7 @@ <input type="text" id="Type-cp" aria-label="Type" matInput - [formControl]="myControl" + [formControl]="myControlTypeCP" [matAutocomplete]="autocp"> <mat-autocomplete autoActiveFirstOption #autocp="matAutocomplete"> <mat-option *ngFor="let option of filteredtypesCP | async" [value]="option"> @@ -33,8 +33,8 @@ <mat-form-field> <mat-label>Département</mat-label> <mat-select name="cp-departement" id="cp-departement" placeholder="Ex: 64"> - <mat-option *ngFor="let option of filteredDepartement | async" [value]="option"> - {{option}} + <mat-option *ngFor="let dep of filteredDepartement | async" [value]="dep"> + {{dep}} </mat-option> </mat-select> </mat-form-field> @@ -43,10 +43,10 @@ <mat-label>Thème</mat-label> <input matInput type="text" name="cp-theme" id="cp-theme" placeholder="Ex: Reseau" aria-label="Type" matInput - [formControl]="myControl" - [matAutocomplete]="autotheme" multiple> - <mat-autocomplete autoActiveFirstOption #autotheme="matAutocomplete"> - <mat-option *ngFor="let option of filteredTheme | async" [value]="option"> + [formControl]="myControlThemeCP" + [matAutocomplete]="autothemeCP" > + <mat-autocomplete autoActiveFirstOption #autothemeCP="matAutocomplete"> + <mat-option *ngFor="let option of filteredThemeCP | async" [value]="option"> {{option}} </mat-option> </mat-autocomplete> @@ -67,6 +67,13 @@ </mat-select> </mat-form-field> + <mat-form-field> + <mat-label>Description</mat-label> + <textarea matInput type="text" name="cp-description" id="cp-description"></textarea> + </mat-form-field> + + + <!-- Buttons Submit and cancel --> <button mat-raised-button (click)="addOptionCP()" type="submit" id="submit"><strong>Valider</strong></button> @@ -99,7 +106,7 @@ <input type="text" id="Type-retombe" aria-label="Type" matInput - [formControl]="myControl" + [formControl]="myControlTypeR" [matAutocomplete]="autoRetombe"> <mat-autocomplete autoActiveFirstOption #autoRetombe="matAutocomplete"> <mat-option *ngFor="let option of filteredtypesRetombe | async" [value]="option"> @@ -127,10 +134,10 @@ <mat-label>Thème</mat-label> <input matInput type="text" name="r-theme" id="r-theme" placeholder="Ex: Reseau" aria-label="Thème" aria-label="Type" matInput - [formControl]="myControl" - [matAutocomplete]="autotheme"> - <mat-autocomplete autoActiveFirstOption #autotheme="matAutocomplete"> - <mat-option *ngFor="let option of filteredTheme | async" [value]="option"> + [formControl]="myControlThemeR" + [matAutocomplete]="autothemeR"> + <mat-autocomplete autoActiveFirstOption #autothemeR="matAutocomplete"> + <mat-option *ngFor="let option of filteredThemeR | async" [value]="option"> {{option}} </mat-option> </mat-autocomplete> @@ -160,6 +167,10 @@ </mat-select> </mat-form-field> + <mat-form-field> + <mat-label>Description</mat-label> + <textarea matInput type="text" name="r-description" id="r-description"></textarea> + </mat-form-field> <!-- Buttons Submit and cancel --> <button mat-raised-button (click)="addOptiontypeRetombe()" type="submit" id="submit"><strong>Valider</strong></button> diff --git a/src/app/pages/data-entry/data-entry.component.ts b/src/app/pages/data-entry/data-entry.component.ts index 5536132cac2f19e8186064f29e33817f67db1996..8f6ec6236ff79c78a3ba5989bcaed191a6b220bf 100644 --- a/src/app/pages/data-entry/data-entry.component.ts +++ b/src/app/pages/data-entry/data-entry.component.ts @@ -22,33 +22,43 @@ interface journaux{ * Page to enter new articles */ export class DataEntryComponent implements OnInit { - myControl = new FormControl(); + myControlTypeCP = new FormControl(); + myControlTypeR = new FormControl(); + myControlDepartement = new FormControl(); + myControlThemeCP = new FormControl(); + myControlArticle = new FormControl(); + myControlRetombe = new FormControl(); + myControlThemeR = new FormControl(); //This is for type from retombé //types is a array of all types we have types_retombe: string[] = ['PQR', 'Radio', 'TV', 'Web']; filteredtypesRetombe: Observable<string[]>; ngOnInit() { - this.filteredtypesCP = this.myControl.valueChanges.pipe( + this.filteredtypesCP = this.myControlTypeCP.valueChanges.pipe( startWith(''), map(value =>this._filterCP(value)), ); - this.filteredtypesRetombe = this.myControl.valueChanges.pipe( + this.filteredtypesRetombe = this.myControlTypeR.valueChanges.pipe( startWith(''), map(value =>this._filtertypeRetombe(value)), ); - this.filteredDepartement = this.myControl.valueChanges.pipe( + this.filteredDepartement = this.myControlDepartement.valueChanges.pipe( startWith(''), map(value =>this._filterDepartement(value)), ); - this.filteredTheme = this.myControl.valueChanges.pipe( + this.filteredThemeCP = this.myControlThemeCP.valueChanges.pipe( startWith(''), - map(value =>this._filterTheme(value)), + map(value =>this._filterThemeCP(value)), ); - this.filteredArticle = this.myControl.valueChanges.pipe( + this.filteredThemeR = this.myControlThemeR.valueChanges.pipe( + startWith(''), + map(value =>this._filterThemeR(value)), + ); + this.filteredArticle = this.myControlArticle.valueChanges.pipe( startWith(''), map(value =>this._filterArticle(value)), ); - this.filteredRetombe = this.myControl.valueChanges.pipe( + this.filteredRetombe = this.myControlRetombe.valueChanges.pipe( startWith(''), map(value =>this._filterRetombe(value)), ); @@ -105,24 +115,45 @@ export class DataEntryComponent implements OnInit { //this is for Theme - theme: string[] = ['Partenariat','Sécurité','Transition écologique','RH','Crise climatique','Crise RH','Coupure','Linky','RSE']; - filteredTheme: Observable<string[]>; + themeCP: string[] = ['Partenariat','Sécurité','Transition écologique','RH','Crise climatique','Crise RH','Coupure','Linky','RSE']; + themeR: string[] = ['Partenariat','Sécurité','Transition écologique','RH','Crise climatique','Crise RH','Coupure','Linky','RSE']; + filteredThemeCP: Observable<string[]>; + filteredThemeR: Observable<string[]>; + + private _filterThemeCP(value: string): string[] { + const filterValue = value.toLowerCase(); + + return this.themeCP.filter(type => type.toLowerCase().indexOf(filterValue) === 0); + } + //fonction to add a types in array if it is not in + public addOptionThemeCP(){ + let value =<HTMLInputElement> document.querySelector("#cp-theme"); + + if(this.themeCP.indexOf(value.value)!==-1){ + //value is not in types + + } + else{ + this.themeCP.push(value.value) + } + } + - private _filterTheme(value: string): string[] { + private _filterThemeR(value: string): string[] { const filterValue = value.toLowerCase(); - return this.theme.filter(type => type.toLowerCase().indexOf(filterValue) === 0); + return this.themeR.filter(type => type.toLowerCase().indexOf(filterValue) === 0); } //fonction to add a types in array if it is not in - public addOptionTheme(){ + public addOptionThemeR(){ let value =<HTMLInputElement> document.querySelector("#r-theme"); - if(this.theme.indexOf(value.value)!==-1){ + if(this.themeR.indexOf(value.value)!==-1){ //value is not in types } else{ - this.theme.push(value.value) + this.themeR.push(value.value) } } diff --git a/src/app/toolbar/toolbar.component.css b/src/app/toolbar/toolbar.component.css index e190dcfcd7698ac780f9160a1324653379935491..eec5012327aafcfeeb013f5bb7b24cde3a672a9f 100644 --- a/src/app/toolbar/toolbar.component.css +++ b/src/app/toolbar/toolbar.component.css @@ -1,70 +1,47 @@ mat-grid-list { - width: 800px; + width: 90%; margin-top: 20px; - margin-left: 90px; - + margin-left: 5%; + margin-right: 5%; } /* Buttons */ -.logo{ - transform: scale(1.3); - -} - -.button-home { - background: url(../../assets/home_ico.png); - margin-left: 32px ; - width: 70px; - height: 70px; - color :black; - margin-top: 15px; - -} - - -.button-home:hover { - transform: scale(1.2); +.img-logo{ + transform: scale(1); + width: 90%; + height: 65%; } - -.button-graphics, .button-search , .button-settings{ +.button-graphics, .button-search , .button-settings, .button-home{ transform: scale(1.5); color: black; margin-top: 19px; } -.button-graphics :hover, .button-search :hover , .button-settings :hover { +.button-graphics :hover, .button-search :hover , .button-settings :hover, .button-home:hover { transform: scale(1.7); } -/* Vertical separator */ -.separator { - height: 30px; - border-left: 0.5px solid rgb(189, 189, 189); - float:right; - margin-right: -15px; -} - /* Horizontal separator */ .underline { border: 0.5px solid rgb(0,94,184); margin-top: -10px; - margin-left: 55px; - width: 800px; + margin-left: 0%; + width: 100%; } /* The whole toolbar div */ .body { - width: 90%; + width: 75%; margin: auto; height: 200px; } diff --git a/src/app/toolbar/toolbar.component.html b/src/app/toolbar/toolbar.component.html index 9614d396a2a37a6207a9565161fdbcab0ce1fd11..b5ed9b0c048908d604c50ff4c6e32b4124d39d5f 100644 --- a/src/app/toolbar/toolbar.component.html +++ b/src/app/toolbar/toolbar.component.html @@ -3,7 +3,7 @@ <div class="body"> <mat-grid-list cols="7" rowHeight="120px"> <mat-grid-tile class="logo" colspan="2"><img class="img-logo" src="../assets/enedis_img.png" alt="Logo Enedis"></mat-grid-tile> - <mat-grid-tile><a routerLink=''><button mat-icon-button title="Page d'accueil" class="button-home" ><div class="separator"></div> </button></a></mat-grid-tile> + <mat-grid-tile><a routerLink=''><button mat-icon-button title="Page d'accueil" class="button-home"><mat-icon>home</mat-icon> </button></a></mat-grid-tile> <mat-grid-tile> <a routerLink='/graphics'><button mat-icon-button title="Graphiques et statistiques" class="button-graphics" ><mat-icon>equalizer</mat-icon></button></a></mat-grid-tile> <mat-grid-tile><a routerLink='/data-entry'><button mat-icon-button title="Saisie de données" class="button-search" ><mat-icon>control_point</mat-icon></button></a></mat-grid-tile> <mat-grid-tile><a routerLink='/articles'><button mat-icon-button title="Recherche d'articles" class="button-search" ><mat-icon>search</mat-icon></button></a></mat-grid-tile>