Commit e16ea756 authored by Paul Legoût's avatar Paul Legoût
Browse files

Merge branch '19-remove-settings' into 'master'

remove settings page

Closes #19

See merge request !21
1 merge request!21remove settings page
Showing with 23 additions and 69 deletions
+23 -69
......@@ -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 },
......
import { Component } from '@angular/core';
import { environment } from '../environments/environment';
@Component({
selector: 'app-root',
......
......@@ -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: [
......
......@@ -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);
......
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);
}
......
......@@ -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
......
......@@ -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
......
<body>
<h1>Settings page</h1>
</body>
<!-- To do
Manage settings (modify data entry parameters => send to modify on db) ....
-->
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();
});
});
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 {
}
}
<!-- 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>
export const environment = {
production: true
production: true,
API_URL: 'https://localhost',
API_PORT: '3000'
};
......@@ -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'
};
/*
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment