diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index a55bef829aeb70a9c5b6b60febe065a752dbf13d..18af143c57d75beb13c17a7cb8a8c12c826d7b9f 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -2,7 +2,6 @@ import { DataEntryComponent } from './pages/data-entry/data-entry.component'; import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; import { HomeComponent } from './pages/home/home.component'; -import { SettingsComponent } from './pages/settings/settings.component'; import { ArticlesComponent } from './pages/articles/articles.component'; import { GraphicsPageComponent } from './pages/graphics-page/graphics-page.component'; @@ -11,7 +10,6 @@ import { GraphicsPageComponent } from './pages/graphics-page/graphics-page.compo const routes: Routes = [ { path: '', component: HomeComponent }, { path: 'data-entry', component: DataEntryComponent }, - { path: 'settings', component: SettingsComponent}, { path: "articles", component: ArticlesComponent }, { path: "graphics", component: GraphicsPageComponent }, diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 10c6840b21364730f31b02ae0ffd6defec444ebd..e80fdd3c77a34b22281d23a17c9f3d04e37aa9e8 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,5 +1,5 @@ import { Component } from '@angular/core'; - +import { environment } from '../environments/environment'; @Component({ selector: 'app-root', diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 6fb84d182d0b4247f1c9e084668c3439d2c03459..deb5796227f1a49c71efd7d9a139d02586edd714 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -30,7 +30,6 @@ import { HttpClientModule } from '@angular/common/http'; //////////////////// Components declared \\\\\\\\\\\\\\\\\\\\ import { HomeComponent } from './pages/home/home.component'; -import { SettingsComponent } from './pages/settings/settings.component'; import { ArticlesComponent} from './pages/articles/articles.component'; import { DataEntryComponent } from './pages/data-entry/data-entry.component'; import { ToolbarComponent } from './toolbar/toolbar.component'; @@ -45,7 +44,6 @@ import { OverlayContainer } from '@angular/cdk/overlay'; ToolbarComponent, DataEntryComponent, HomeComponent, - SettingsComponent, ArticlesComponent, ], imports: [ diff --git a/src/app/pages/articles/articles.component.css b/src/app/pages/articles/articles.component.css index 0c612a2bf8a60fd803686ccb946cbba82475fa29..e2250b74bc7d4a2987f06a1c035e5e1b0f2491ee 100644 --- a/src/app/pages/articles/articles.component.css +++ b/src/app/pages/articles/articles.component.css @@ -29,8 +29,8 @@ form { position: relative; max-height: 600px; overflow: auto; - width: 180%; - margin-left: -40%; + width: 150%; + margin-left: -20%; } h1 { @@ -57,7 +57,6 @@ th { } - .button-return { background-color: rgb(0,94,184); border: 2px solid rgb(0,94,184); diff --git a/src/app/pages/articles/articles.component.ts b/src/app/pages/articles/articles.component.ts index 7483284393b00a5b1f297a756ce0f879e0c39446..8b37a4e3566c7a91c2ae0e3ed8bb9b9a93ca0b17 100644 --- a/src/app/pages/articles/articles.component.ts +++ b/src/app/pages/articles/articles.component.ts @@ -1,6 +1,7 @@ import { Component, Inject } from '@angular/core'; import { MatTableDataSource } from '@angular/material/table'; import { HttpClient } from "@angular/common/http"; +import { environment } from '../../../environments/environment'; // import { Observable } from 'rxjs'; /** @@ -65,7 +66,8 @@ export class ArticlesComponent { displayTable: String = ''; allTables = true; - readonly ROOT_URL = "http://localhost:3000"; + readonly ROOT_URL = environment.API_URL ?? "http://localhost:3000"; + constructor(private http: HttpClient) {} @@ -214,6 +216,7 @@ export class ArticlesComponent { //////////////////// Display new informations \\\\\\\\\\\\\\\\\\\\ + this.dataSourceArticles = new MatTableDataSource([article]); this.dataSourceImplications = new MatTableDataSource(article.associated); } diff --git a/src/app/pages/data-entry/data-entry.component.ts b/src/app/pages/data-entry/data-entry.component.ts index 988f8b30c723cd4c106710458eca54f6692014e8..6aa258baaeb41ecdaa7a5630b01b2f9ac17efbba 100644 --- a/src/app/pages/data-entry/data-entry.component.ts +++ b/src/app/pages/data-entry/data-entry.component.ts @@ -2,10 +2,12 @@ import {Component, OnInit} from '@angular/core'; import {FormControl} from '@angular/forms'; import {Observable} from 'rxjs'; import {map, startWith} from 'rxjs/operators'; +import { environment } from '../../../environments/environment'; -interface journaux{ + +interface Journaux{ name:string; dep:string } @@ -22,6 +24,9 @@ interface journaux{ * Page to enter new articles */ export class DataEntryComponent implements OnInit { + readonly ROOT_URL = environment.API_URL ?? "http://localhost:3000"; + + myControlTypeCP = new FormControl(); myControlTypeR = new FormControl(); myControlDepartement = new FormControl(); @@ -182,7 +187,7 @@ export class DataEntryComponent implements OnInit { } selectedValue: string; - journal: journaux[]= [{name:'Atomic Radio 40', dep:'40'},{name:'Atomic Radio 64', dep:'64'},{name:'Atomic Radio 65', dep:'65'}] + journal: Journaux[]= [{name:'Atomic Radio 40', dep:'40'},{name:'Atomic Radio 64', dep:'64'},{name:'Atomic Radio 65', dep:'65'}] /** * Empty inputs diff --git a/src/app/pages/graphics-page/graphics-page.component.ts b/src/app/pages/graphics-page/graphics-page.component.ts index d17e28f7c1ffb328b88870152ae136f7de6bd9f8..88fcf3b34fbe121d0bbaecece5845ddc864d654e 100644 --- a/src/app/pages/graphics-page/graphics-page.component.ts +++ b/src/app/pages/graphics-page/graphics-page.component.ts @@ -2,7 +2,7 @@ import { Component} from '@angular/core'; import {FormControl, FormGroupDirective, NgForm, Validators } from '@angular/forms'; import {ErrorStateMatcher} from '@angular/material/core'; import { HttpClient } from "@angular/common/http"; - +import { environment } from '../../../environments/environment'; /** Error when invalid control is dirty, touched, or submitted. */ export class MyErrorStateMatcher implements ErrorStateMatcher { @@ -24,7 +24,7 @@ export class MyErrorStateMatcher implements ErrorStateMatcher { * Page that displays graphics (Templates and custom) */ export class GraphicsPageComponent { - readonly ROOT_URL = "http://localhost:3000"; + readonly ROOT_URL = environment.API_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 diff --git a/src/app/pages/settings/settings.component.css b/src/app/pages/settings/settings.component.css deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/app/pages/settings/settings.component.html b/src/app/pages/settings/settings.component.html deleted file mode 100644 index 40193ff69697467e35bb8c3ea2560cfd8104537e..0000000000000000000000000000000000000000 --- a/src/app/pages/settings/settings.component.html +++ /dev/null @@ -1,7 +0,0 @@ -<body> - <h1>Settings page</h1> -</body> - -<!-- To do - Manage settings (modify data entry parameters => send to modify on db) .... ---> diff --git a/src/app/pages/settings/settings.component.spec.ts b/src/app/pages/settings/settings.component.spec.ts deleted file mode 100644 index a3a508b0eedd87c577f84c44a10a11d33bef545f..0000000000000000000000000000000000000000 --- a/src/app/pages/settings/settings.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { SettingsComponent } from './settings.component'; - -describe('SettingsComponent', () => { - let component: SettingsComponent; - let fixture: ComponentFixture<SettingsComponent>; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ SettingsComponent ] - }) - .compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(SettingsComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/pages/settings/settings.component.ts b/src/app/pages/settings/settings.component.ts deleted file mode 100644 index d2e51c29138b6eb4189fd570012a712a0ce3882a..0000000000000000000000000000000000000000 --- a/src/app/pages/settings/settings.component.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'app-settings', - templateUrl: './settings.component.html', - styleUrls: ['./settings.component.css'] -}) - - -/** - * Settings page - */ -export class SettingsComponent implements OnInit { - - constructor() { } - - ngOnInit(): void { - } - -} diff --git a/src/app/toolbar/toolbar.component.html b/src/app/toolbar/toolbar.component.html index b5ed9b0c048908d604c50ff4c6e32b4124d39d5f..0282d6d57668acea47f6bbe4e4be16ddacb805f4 100644 --- a/src/app/toolbar/toolbar.component.html +++ b/src/app/toolbar/toolbar.component.html @@ -1,13 +1,12 @@ <!-- Toolbar --> <div class="body"> - <mat-grid-list cols="7" rowHeight="120px"> + <mat-grid-list cols="6" 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"><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> - <mat-grid-tile><a routerLink="/settings"><button mat-icon-button title="Paramètres" class="button-settings" ><mat-icon>settings</mat-icon></button></a></mat-grid-tile> </mat-grid-list> <div class="underline"></div> </div> diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index 3612073bc31cd4c1f5d6cbb00318521e9a61bd8a..4ffb4bc56ac930351753036ee1b0dbb9c12b01b7 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -1,3 +1,5 @@ export const environment = { - production: true + production: true, + API_URL: 'https://localhost', + API_PORT: '3000' }; diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 7b4f817adb754769ca126a939d48ac4b0850489d..cc44dc0ebdbe3212829c0469daaf29219e745091 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -3,7 +3,9 @@ // The list of file replacements can be found in `angular.json`. export const environment = { - production: false + production: false, + API_URL: 'https://localhost', + API_PORT: '3000' }; /*