From d88d864f413fac1140cf86f7756ea7cdaaf46081 Mon Sep 17 00:00:00 2001 From: Clement FERRERE Date: Tue, 1 Mar 2022 15:19:15 +0100 Subject: [PATCH 01/13] suppressions des Any --- src/app/services/collaborateur.service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/services/collaborateur.service.ts b/src/app/services/collaborateur.service.ts index 59fb016..c403ad3 100644 --- a/src/app/services/collaborateur.service.ts +++ b/src/app/services/collaborateur.service.ts @@ -32,10 +32,10 @@ export class CollaborateurService { return this.http.get(this.collaborateursUrl+"/"+id); } - updateCollaborateur(collaborateur : Collaborateur):Observable{ + updateCollaborateur(collaborateur : Collaborateur):Observable{ let body = JSON.stringify(collaborateur); this.log(`update collaborateur ${collaborateur.id}`) - return this.http.put(this.collaborateursUrl + "/" + collaborateur.id, body, this.httpOptions); + return this.http.put(this.collaborateursUrl + "/" + collaborateur.id, body, this.httpOptions); } deleteCollaborateur(collaborateur: Collaborateur) { -- 2.36.3 From 9b9f281cab519defb76507fcdba8e41cb5a83a82 Mon Sep 17 00:00:00 2001 From: Clement FERRERE Date: Tue, 1 Mar 2022 15:19:18 +0100 Subject: [PATCH 02/13] suppressions des Any --- src/app/services/agence.service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/services/agence.service.ts b/src/app/services/agence.service.ts index a96c8ea..f34ea19 100644 --- a/src/app/services/agence.service.ts +++ b/src/app/services/agence.service.ts @@ -31,10 +31,10 @@ export class AgenceService { return this.http.get(this.agencesUrl+"/"+id); } - updateAgence(agence : Agence):Observable{ + updateAgence(agence : Agence):Observable{ let body = JSON.stringify(agence); this.log(`update agence ${agence.id}`) - return this.http.put(this.agencesUrl + "/" + agence.id, body, this.httpOptions); + return this.http.put(this.agencesUrl + "/" + agence.id, body, this.httpOptions); } deleteAgence(agence: Agence) { -- 2.36.3 From 2d78247dc88523c749476baa256a3be3dae3f37c Mon Sep 17 00:00:00 2001 From: Clement FERRERE Date: Wed, 2 Mar 2022 10:03:21 +0100 Subject: [PATCH 03/13] =?UTF-8?q?r=C3=A9organisation=20globale=20+=20suppr?= =?UTF-8?q?ession=20des=20spec.ts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- angular.json | 16 ++++++++++ src/app/app-routing.module.ts | 10 +++--- src/app/app.module.ts | 12 +++---- .../agence-edit/agence-edit.component.css | 0 .../agence-edit/agence-edit.component.html | 0 .../agence-edit/agence-edit.component.ts | 4 +-- .../agence/agence.component.css | 0 .../agence/agence.component.html | 0 .../agence/agence.component.ts | 4 +-- .../collaborateur-edit.component.css | 0 .../collaborateur-edit.component.html | 0 .../collaborateur-edit.component.ts | 4 +-- .../collaborateur/collaborateur.component.css | 0 .../collaborateur.component.html | 0 .../collaborateur/collaborateur.component.ts | 4 +-- .../{ => components}/home/home.component.css | 0 .../{ => components}/home/home.component.html | 0 .../{ => components}/home/home.component.ts | 0 src/app/tests/agence-edit.component.spec.ts | 25 --------------- src/app/tests/agence.component.spec.ts | 25 --------------- src/app/tests/agence.service.spec.ts | 16 ---------- src/app/tests/app.component.spec.ts | 31 ------------------- .../collaborateur-edit.component.spec.ts | 25 --------------- src/app/tests/collaborateur.component.spec.ts | 25 --------------- src/app/tests/collaborateur.service.spec.ts | 16 ---------- src/app/tests/home.component.spec.ts | 25 --------------- src/app/tests/message.service.spec.ts | 16 ---------- src/app/tests/messages.component.spec.ts | 25 --------------- src/app/tests/test.ts | 25 --------------- 29 files changed, 35 insertions(+), 273 deletions(-) rename src/app/{ => components/agence}/agence-edit/agence-edit.component.css (100%) rename src/app/{ => components/agence}/agence-edit/agence-edit.component.html (100%) rename src/app/{ => components/agence}/agence-edit/agence-edit.component.ts (90%) rename src/app/{ => components}/agence/agence.component.css (100%) rename src/app/{ => components}/agence/agence.component.html (100%) rename src/app/{ => components}/agence/agence.component.ts (87%) rename src/app/{ => components/collaborateur}/collaborateur-edit/collaborateur-edit.component.css (100%) rename src/app/{ => components/collaborateur}/collaborateur-edit/collaborateur-edit.component.html (100%) rename src/app/{ => components/collaborateur}/collaborateur-edit/collaborateur-edit.component.ts (89%) rename src/app/{ => components}/collaborateur/collaborateur.component.css (100%) rename src/app/{ => components}/collaborateur/collaborateur.component.html (100%) rename src/app/{ => components}/collaborateur/collaborateur.component.ts (87%) rename src/app/{ => components}/home/home.component.css (100%) rename src/app/{ => components}/home/home.component.html (100%) rename src/app/{ => components}/home/home.component.ts (100%) delete mode 100644 src/app/tests/agence-edit.component.spec.ts delete mode 100644 src/app/tests/agence.component.spec.ts delete mode 100644 src/app/tests/agence.service.spec.ts delete mode 100644 src/app/tests/app.component.spec.ts delete mode 100644 src/app/tests/collaborateur-edit.component.spec.ts delete mode 100644 src/app/tests/collaborateur.component.spec.ts delete mode 100644 src/app/tests/collaborateur.service.spec.ts delete mode 100644 src/app/tests/home.component.spec.ts delete mode 100644 src/app/tests/message.service.spec.ts delete mode 100644 src/app/tests/messages.component.spec.ts delete mode 100644 src/app/tests/test.ts diff --git a/angular.json b/angular.json index 3dd9353..29ed2e1 100644 --- a/angular.json +++ b/angular.json @@ -8,6 +8,22 @@ "schematics": { "@schematics/angular:application": { "strict": true + }, + "@schematics/angular:component": { + "style": "scss", + "skipTests": true + }, + "@schematics/angular:class": { + "skipTests": true + }, + "@schematics/angular:directive": { + "skipTests": true + }, + "@schematics/angular:pipe": { + "skipTests": true + }, + "@schematics/angular:service": { + "skipTests": true } }, "root": "", diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 669ff1e..7c37b20 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -1,10 +1,10 @@ import {NgModule} from '@angular/core'; import {RouterModule,Routes} from "@angular/router"; -import {CollaborateurComponent} from "./collaborateur/collaborateur.component"; -import {CollaborateurEditComponent} from "./collaborateur-edit/collaborateur-edit.component"; -import {HomeComponent} from "./home/home.component"; -import {AgenceComponent} from "./agence/agence.component"; -import {AgenceEditComponent} from "./agence-edit/agence-edit.component"; +import {CollaborateurComponent} from "./components/collaborateur/collaborateur.component"; +import {CollaborateurEditComponent} from "./components/collaborateur/collaborateur-edit/collaborateur-edit.component"; +import {HomeComponent} from "./components/home/home.component"; +import {AgenceComponent} from "./components/agence/agence.component"; +import {AgenceEditComponent} from "./components/agence/agence-edit/agence-edit.component"; const routes : Routes = [ {path:'', redirectTo:'/home', pathMatch:'full'}, diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 4fca660..d4fc4e2 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -4,14 +4,14 @@ import {HttpClientModule} from "@angular/common/http"; import { AppComponent } from './app.component'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import {RouterModule} from "@angular/router"; -import { CollaborateurComponent } from './collaborateur/collaborateur.component'; -import { CollaborateurEditComponent } from './collaborateur-edit/collaborateur-edit.component'; +import { CollaborateurComponent } from './components/collaborateur/collaborateur.component'; +import { CollaborateurEditComponent } from './components/collaborateur/collaborateur-edit/collaborateur-edit.component'; import {FormsModule} from "@angular/forms"; import { MessagesComponent } from './messages/messages.component'; import { AppRoutingModule } from './app-routing.module'; -import { HomeComponent } from './home/home.component'; -import { AgenceComponent } from './agence/agence.component'; -import { AgenceEditComponent } from './agence-edit/agence-edit.component'; +import { HomeComponent } from './components/home/home.component'; +import { AgenceComponent } from './components/agence/agence.component'; +import { AgenceEditComponent } from './components/agence/agence-edit/agence-edit.component'; @NgModule({ declarations: [ @@ -21,7 +21,7 @@ import { AgenceEditComponent } from './agence-edit/agence-edit.component'; MessagesComponent, HomeComponent, AgenceComponent, - AgenceEditComponent, + AgenceEditComponent ], imports: [ BrowserModule, diff --git a/src/app/agence-edit/agence-edit.component.css b/src/app/components/agence/agence-edit/agence-edit.component.css similarity index 100% rename from src/app/agence-edit/agence-edit.component.css rename to src/app/components/agence/agence-edit/agence-edit.component.css diff --git a/src/app/agence-edit/agence-edit.component.html b/src/app/components/agence/agence-edit/agence-edit.component.html similarity index 100% rename from src/app/agence-edit/agence-edit.component.html rename to src/app/components/agence/agence-edit/agence-edit.component.html diff --git a/src/app/agence-edit/agence-edit.component.ts b/src/app/components/agence/agence-edit/agence-edit.component.ts similarity index 90% rename from src/app/agence-edit/agence-edit.component.ts rename to src/app/components/agence/agence-edit/agence-edit.component.ts index 7627bd4..6d5d940 100644 --- a/src/app/agence-edit/agence-edit.component.ts +++ b/src/app/components/agence/agence-edit/agence-edit.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit } from '@angular/core'; -import {Agence} from "../interfaces/agence"; +import {Agence} from "../../../interfaces/agence"; import {ActivatedRoute} from "@angular/router"; -import {AgenceService} from "../services/agence.service"; +import {AgenceService} from "../../../services/agence.service"; import {Location} from "@angular/common"; @Component({ diff --git a/src/app/agence/agence.component.css b/src/app/components/agence/agence.component.css similarity index 100% rename from src/app/agence/agence.component.css rename to src/app/components/agence/agence.component.css diff --git a/src/app/agence/agence.component.html b/src/app/components/agence/agence.component.html similarity index 100% rename from src/app/agence/agence.component.html rename to src/app/components/agence/agence.component.html diff --git a/src/app/agence/agence.component.ts b/src/app/components/agence/agence.component.ts similarity index 87% rename from src/app/agence/agence.component.ts rename to src/app/components/agence/agence.component.ts index 8b0ae6a..185a4f3 100644 --- a/src/app/agence/agence.component.ts +++ b/src/app/components/agence/agence.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit } from '@angular/core'; -import {Agence} from "../interfaces/agence"; +import {Agence} from "../../interfaces/agence"; import {HttpClient} from "@angular/common/http"; -import {AgenceService} from "../services/agence.service"; +import {AgenceService} from "../../services/agence.service"; @Component({ selector: 'app-agence', diff --git a/src/app/collaborateur-edit/collaborateur-edit.component.css b/src/app/components/collaborateur/collaborateur-edit/collaborateur-edit.component.css similarity index 100% rename from src/app/collaborateur-edit/collaborateur-edit.component.css rename to src/app/components/collaborateur/collaborateur-edit/collaborateur-edit.component.css diff --git a/src/app/collaborateur-edit/collaborateur-edit.component.html b/src/app/components/collaborateur/collaborateur-edit/collaborateur-edit.component.html similarity index 100% rename from src/app/collaborateur-edit/collaborateur-edit.component.html rename to src/app/components/collaborateur/collaborateur-edit/collaborateur-edit.component.html diff --git a/src/app/collaborateur-edit/collaborateur-edit.component.ts b/src/app/components/collaborateur/collaborateur-edit/collaborateur-edit.component.ts similarity index 89% rename from src/app/collaborateur-edit/collaborateur-edit.component.ts rename to src/app/components/collaborateur/collaborateur-edit/collaborateur-edit.component.ts index 5bc5f47..8f95de8 100644 --- a/src/app/collaborateur-edit/collaborateur-edit.component.ts +++ b/src/app/components/collaborateur/collaborateur-edit/collaborateur-edit.component.ts @@ -1,8 +1,8 @@ import {Component, OnInit} from '@angular/core'; -import {Collaborateur} from "../interfaces/collaborateur"; +import {Collaborateur} from "../../../interfaces/collaborateur"; import { ActivatedRoute } from '@angular/router'; import { Location } from '@angular/common'; -import { CollaborateurService} from "../services/collaborateur.service"; +import { CollaborateurService} from "../../../services/collaborateur.service"; @Component({ selector: 'app-collaborateur-edit', diff --git a/src/app/collaborateur/collaborateur.component.css b/src/app/components/collaborateur/collaborateur.component.css similarity index 100% rename from src/app/collaborateur/collaborateur.component.css rename to src/app/components/collaborateur/collaborateur.component.css diff --git a/src/app/collaborateur/collaborateur.component.html b/src/app/components/collaborateur/collaborateur.component.html similarity index 100% rename from src/app/collaborateur/collaborateur.component.html rename to src/app/components/collaborateur/collaborateur.component.html diff --git a/src/app/collaborateur/collaborateur.component.ts b/src/app/components/collaborateur/collaborateur.component.ts similarity index 87% rename from src/app/collaborateur/collaborateur.component.ts rename to src/app/components/collaborateur/collaborateur.component.ts index cf3378a..266740b 100644 --- a/src/app/collaborateur/collaborateur.component.ts +++ b/src/app/components/collaborateur/collaborateur.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit } from '@angular/core'; import {HttpClient} from "@angular/common/http"; -import {CollaborateurService} from "../services/collaborateur.service"; -import {Collaborateur} from "../interfaces/collaborateur"; +import {CollaborateurService} from "../../services/collaborateur.service"; +import {Collaborateur} from "../../interfaces/collaborateur"; @Component({ selector: 'app-collaborateur', diff --git a/src/app/home/home.component.css b/src/app/components/home/home.component.css similarity index 100% rename from src/app/home/home.component.css rename to src/app/components/home/home.component.css diff --git a/src/app/home/home.component.html b/src/app/components/home/home.component.html similarity index 100% rename from src/app/home/home.component.html rename to src/app/components/home/home.component.html diff --git a/src/app/home/home.component.ts b/src/app/components/home/home.component.ts similarity index 100% rename from src/app/home/home.component.ts rename to src/app/components/home/home.component.ts diff --git a/src/app/tests/agence-edit.component.spec.ts b/src/app/tests/agence-edit.component.spec.ts deleted file mode 100644 index 6823ad8..0000000 --- a/src/app/tests/agence-edit.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { AgenceEditComponent } from '../agence-edit/agence-edit.component'; - -describe('AgenceEditComponent', () => { - let component: AgenceEditComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ AgenceEditComponent ] - }) - .compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(AgenceEditComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/tests/agence.component.spec.ts b/src/app/tests/agence.component.spec.ts deleted file mode 100644 index afb5262..0000000 --- a/src/app/tests/agence.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { AgenceComponent } from '../agence/agence.component'; - -describe('AgenceComponent', () => { - let component: AgenceComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ AgenceComponent ] - }) - .compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(AgenceComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/tests/agence.service.spec.ts b/src/app/tests/agence.service.spec.ts deleted file mode 100644 index ad5a664..0000000 --- a/src/app/tests/agence.service.spec.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { TestBed } from '@angular/core/testing'; - -import { AgenceService } from '../services/agence.service'; - -describe('AgenceService', () => { - let service: AgenceService; - - beforeEach(() => { - TestBed.configureTestingModule({}); - service = TestBed.inject(AgenceService); - }); - - it('should be created', () => { - expect(service).toBeTruthy(); - }); -}); diff --git a/src/app/tests/app.component.spec.ts b/src/app/tests/app.component.spec.ts deleted file mode 100644 index 2fe07e5..0000000 --- a/src/app/tests/app.component.spec.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { TestBed } from '@angular/core/testing'; -import { AppComponent } from '../app.component'; - -describe('AppComponent', () => { - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ - AppComponent - ], - }).compileComponents(); - }); - - it('should create the app', () => { - const fixture = TestBed.createComponent(AppComponent); - const app = fixture.componentInstance; - expect(app).toBeTruthy(); - }); - - it(`should have as title 'Collaborateur-Epa-Front'`, () => { - const fixture = TestBed.createComponent(AppComponent); - const app = fixture.componentInstance; - expect(app.title).toEqual('Collaborateur-Epa-Front'); - }); - - it('should render title', () => { - const fixture = TestBed.createComponent(AppComponent); - fixture.detectChanges(); - const compiled = fixture.nativeElement; - expect(compiled.querySelector('.content span').textContent).toContain('Collaborateur-Epa-Front app is running!'); - }); -}); diff --git a/src/app/tests/collaborateur-edit.component.spec.ts b/src/app/tests/collaborateur-edit.component.spec.ts deleted file mode 100644 index 28fb9b4..0000000 --- a/src/app/tests/collaborateur-edit.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { CollaborateurEditComponent } from '../collaborateur-edit/collaborateur-edit.component'; - -describe('CollaborateurEditComponent', () => { - let component: CollaborateurEditComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ CollaborateurEditComponent ] - }) - .compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(CollaborateurEditComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/tests/collaborateur.component.spec.ts b/src/app/tests/collaborateur.component.spec.ts deleted file mode 100644 index af5ae30..0000000 --- a/src/app/tests/collaborateur.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { CollaborateurComponent } from '../collaborateur/collaborateur.component'; - -describe('CollaborateurComponent', () => { - let component: CollaborateurComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ CollaborateurComponent ] - }) - .compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(CollaborateurComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/tests/collaborateur.service.spec.ts b/src/app/tests/collaborateur.service.spec.ts deleted file mode 100644 index f182ad3..0000000 --- a/src/app/tests/collaborateur.service.spec.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { TestBed } from '@angular/core/testing'; - -import { CollaborateurService } from '../services/collaborateur.service'; - -describe('CollaborateurService', () => { - let service: CollaborateurService; - - beforeEach(() => { - TestBed.configureTestingModule({}); - service = TestBed.inject(CollaborateurService); - }); - - it('should be created', () => { - expect(service).toBeTruthy(); - }); -}); diff --git a/src/app/tests/home.component.spec.ts b/src/app/tests/home.component.spec.ts deleted file mode 100644 index c61ccfa..0000000 --- a/src/app/tests/home.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { HomeComponent } from '../home/home.component'; - -describe('HomeComponent', () => { - let component: HomeComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ HomeComponent ] - }) - .compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(HomeComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/tests/message.service.spec.ts b/src/app/tests/message.service.spec.ts deleted file mode 100644 index 899c75f..0000000 --- a/src/app/tests/message.service.spec.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { TestBed } from '@angular/core/testing'; - -import { MessageService } from '../services/message.service'; - -describe('MessageService', () => { - let service: MessageService; - - beforeEach(() => { - TestBed.configureTestingModule({}); - service = TestBed.inject(MessageService); - }); - - it('should be created', () => { - expect(service).toBeTruthy(); - }); -}); diff --git a/src/app/tests/messages.component.spec.ts b/src/app/tests/messages.component.spec.ts deleted file mode 100644 index 3d7a2bb..0000000 --- a/src/app/tests/messages.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { MessagesComponent } from '../messages/messages.component'; - -describe('MessagesComponent', () => { - let component: MessagesComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ MessagesComponent ] - }) - .compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(MessagesComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/tests/test.ts b/src/app/tests/test.ts deleted file mode 100644 index 2042356..0000000 --- a/src/app/tests/test.ts +++ /dev/null @@ -1,25 +0,0 @@ -// This file is required by karma.conf.js and loads recursively all the .spec and framework files - -import 'zone.js/testing'; -import { getTestBed } from '@angular/core/testing'; -import { - BrowserDynamicTestingModule, - platformBrowserDynamicTesting -} from '@angular/platform-browser-dynamic/testing'; - -declare const require: { - context(path: string, deep?: boolean, filter?: RegExp): { - keys(): string[]; - (id: string): T; - }; -}; - -// First, initialize the Angular testing environment. -getTestBed().initTestEnvironment( - BrowserDynamicTestingModule, - platformBrowserDynamicTesting() -); -// Then we find all the tests. -const context = require.context('./', true, /\.spec\.ts$/); -// And load the modules. -context.keys().map(context); -- 2.36.3 From eee87cf3b062bd3b54a10984aacd47bae7ebe4e3 Mon Sep 17 00:00:00 2001 From: Clement FERRERE Date: Wed, 2 Mar 2022 10:16:57 +0100 Subject: [PATCH 04/13] =?UTF-8?q?cr=C3=A9ation=20des=20fichiers=20routes?= =?UTF-8?q?=20et=20strings=20dans=20un=20dossier=20ressources?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/{ => ressources}/assets/icon_house.png | Bin src/ressources/routes/routes.ts | 5 +++++ src/ressources/strings/strings_fr.ts | 5 +++++ 3 files changed, 10 insertions(+) rename src/{ => ressources}/assets/icon_house.png (100%) create mode 100644 src/ressources/routes/routes.ts create mode 100644 src/ressources/strings/strings_fr.ts diff --git a/src/assets/icon_house.png b/src/ressources/assets/icon_house.png similarity index 100% rename from src/assets/icon_house.png rename to src/ressources/assets/icon_house.png diff --git a/src/ressources/routes/routes.ts b/src/ressources/routes/routes.ts new file mode 100644 index 0000000..1252e15 --- /dev/null +++ b/src/ressources/routes/routes.ts @@ -0,0 +1,5 @@ +import {Injectable} from "@angular/core"; +@Injectable() +export class Routes{ + +} diff --git a/src/ressources/strings/strings_fr.ts b/src/ressources/strings/strings_fr.ts new file mode 100644 index 0000000..992ecee --- /dev/null +++ b/src/ressources/strings/strings_fr.ts @@ -0,0 +1,5 @@ +import {Injectable} from "@angular/core"; +@Injectable() +export class Strings_fr{ + +} -- 2.36.3 From 8fbcff9b1768aeab394b3a7790449283a046f0f1 Mon Sep 17 00:00:00 2001 From: Clement FERRERE Date: Wed, 2 Mar 2022 10:29:46 +0100 Subject: [PATCH 05/13] Suppression du composant de debug "message" --- src/app/app.component.html | 4 ---- src/app/app.module.ts | 2 -- src/app/messages/messages.component.css | 17 ----------------- src/app/messages/messages.component.html | 11 ----------- src/app/messages/messages.component.ts | 16 ---------------- src/app/services/agence.service.ts | 13 +------------ src/app/services/collaborateur.service.ts | 13 +------------ src/app/services/message.service.ts | 20 -------------------- 8 files changed, 2 insertions(+), 94 deletions(-) delete mode 100644 src/app/messages/messages.component.css delete mode 100644 src/app/messages/messages.component.html delete mode 100644 src/app/messages/messages.component.ts delete mode 100644 src/app/services/message.service.ts diff --git a/src/app/app.component.html b/src/app/app.component.html index 787e796..bb7bb23 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -79,9 +79,5 @@ - - - - diff --git a/src/app/app.module.ts b/src/app/app.module.ts index d4fc4e2..24c7ee8 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -7,7 +7,6 @@ import {RouterModule} from "@angular/router"; import { CollaborateurComponent } from './components/collaborateur/collaborateur.component'; import { CollaborateurEditComponent } from './components/collaborateur/collaborateur-edit/collaborateur-edit.component'; import {FormsModule} from "@angular/forms"; -import { MessagesComponent } from './messages/messages.component'; import { AppRoutingModule } from './app-routing.module'; import { HomeComponent } from './components/home/home.component'; import { AgenceComponent } from './components/agence/agence.component'; @@ -18,7 +17,6 @@ import { AgenceEditComponent } from './components/agence/agence-edit/agence-edit AppComponent, CollaborateurComponent, CollaborateurEditComponent, - MessagesComponent, HomeComponent, AgenceComponent, AgenceEditComponent diff --git a/src/app/messages/messages.component.css b/src/app/messages/messages.component.css deleted file mode 100644 index 7c8fa51..0000000 --- a/src/app/messages/messages.component.css +++ /dev/null @@ -1,17 +0,0 @@ -button { - padding: 5px; - text-decoration: none; - margin: 2px; - display: inline-block; - background-color: #E77620; - color: white; - border-radius: 4px; -} -button:hover { - background-color: #42545C; -} -button:disabled { - background-color: #eee; - color: #ccc; - cursor: auto; -} diff --git a/src/app/messages/messages.component.html b/src/app/messages/messages.component.html deleted file mode 100644 index d7ac4b0..0000000 --- a/src/app/messages/messages.component.html +++ /dev/null @@ -1,11 +0,0 @@ -
- -

Messages

- - - -
- {{message}} -
- -
diff --git a/src/app/messages/messages.component.ts b/src/app/messages/messages.component.ts deleted file mode 100644 index d1f296a..0000000 --- a/src/app/messages/messages.component.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { MessageService} from "../services/message.service"; - -@Component({ - selector: 'app-messages', - templateUrl: './messages.component.html', - styleUrls: ['./messages.component.css'] -}) -export class MessagesComponent implements OnInit { - - constructor(public messageService : MessageService) { } - - ngOnInit(): void { - } - -} diff --git a/src/app/services/agence.service.ts b/src/app/services/agence.service.ts index f34ea19..2013dd3 100644 --- a/src/app/services/agence.service.ts +++ b/src/app/services/agence.service.ts @@ -1,6 +1,5 @@ import { Injectable } from '@angular/core'; import {HttpClient, HttpHeaders} from "@angular/common/http"; -import {MessageService} from "./message.service"; import {Observable} from "rxjs"; import {Agence} from "../interfaces/agence"; @@ -14,37 +13,27 @@ export class AgenceService { headers: new HttpHeaders({ 'Content-Type': 'application/json' }) }; - constructor(private http: HttpClient, - private messageService : MessageService) { } - - private log(message : string){ - this.messageService.add(`AgenceService : ${message}`) - } + constructor(private http: HttpClient) { } getAgences():Observable { - this.log('get all agences'); return this.http.get(this.agencesUrl); } getAgence(id : number):Observable{ - this.log(`get agence by id : ${id}`); return this.http.get(this.agencesUrl+"/"+id); } updateAgence(agence : Agence):Observable{ let body = JSON.stringify(agence); - this.log(`update agence ${agence.id}`) return this.http.put(this.agencesUrl + "/" + agence.id, body, this.httpOptions); } deleteAgence(agence: Agence) { - this.log(`delete agence ${agence.id}`) return this.http.delete(this.agencesUrl + "/" + agence.id); } addAgence(agence: Agence): Observable { let body = JSON.stringify(agence); - this.log(`add agence ${body}`); return this.http.post(this.agencesUrl, body, this.httpOptions); } } diff --git a/src/app/services/collaborateur.service.ts b/src/app/services/collaborateur.service.ts index c403ad3..3a93cd5 100644 --- a/src/app/services/collaborateur.service.ts +++ b/src/app/services/collaborateur.service.ts @@ -1,7 +1,6 @@ import {Collaborateur} from "../interfaces/collaborateur"; import {Injectable} from '@angular/core'; import {Observable} from "rxjs"; -import {MessageService} from "./message.service"; import {HttpClient, HttpHeaders} from "@angular/common/http"; @@ -15,37 +14,27 @@ export class CollaborateurService { headers: new HttpHeaders({ 'Content-Type': 'application/json' }) }; - constructor(private http: HttpClient, - private messageService : MessageService) { } - - private log(message : string){ - this.messageService.add(`CollaborateurService : ${message}`) - } + constructor(private http: HttpClient) { } getCollaborateurs():Observable { - this.log('get all collaborateurs'); return this.http.get(this.collaborateursUrl); } getCollaborateur(id : number):Observable{ - this.log(`get collaborateur by id : ${id}`); return this.http.get(this.collaborateursUrl+"/"+id); } updateCollaborateur(collaborateur : Collaborateur):Observable{ let body = JSON.stringify(collaborateur); - this.log(`update collaborateur ${collaborateur.id}`) return this.http.put(this.collaborateursUrl + "/" + collaborateur.id, body, this.httpOptions); } deleteCollaborateur(collaborateur: Collaborateur) { - this.log(`delete collaborateur ${collaborateur.id}`) return this.http.delete(this.collaborateursUrl + "/" + collaborateur.id); } addCollaborateur(collaborateur: Collaborateur): Observable { let body = JSON.stringify(collaborateur); - this.log(`add collaborateur ${body}`); return this.http.post(this.collaborateursUrl, body, this.httpOptions); } } diff --git a/src/app/services/message.service.ts b/src/app/services/message.service.ts deleted file mode 100644 index eef12a6..0000000 --- a/src/app/services/message.service.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { Injectable } from '@angular/core'; - -@Injectable({ - providedIn: 'root' -}) -export class MessageService { - - messages : string[] = []; - - add(message: string){ - this.messages.push(message) - } - - clear(){ - this.messages = []; - } - - constructor() { } - -} -- 2.36.3 From 2ed1eed328af47f0b7579315cf20eff82c9f5c92 Mon Sep 17 00:00:00 2001 From: Clement FERRERE Date: Wed, 2 Mar 2022 10:54:22 +0100 Subject: [PATCH 06/13] =?UTF-8?q?Factorisation=20du=20d=C3=A9tail=20des=20?= =?UTF-8?q?collaborateurs=20de=20la=20vue=20pour=20ajouter=20et=20pour=20?= =?UTF-8?q?=C3=A9diter=20dans=20le=20composant=20collaborateur-detail?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/app.module.ts | 4 +- .../collaborateur-detail.component.html | 40 ++++++++++++++++++ .../collaborateur-detail.component.scss | 9 ++++ .../collaborateur-detail.component.ts | 19 +++++++++ .../collaborateur-edit.component.html | 40 +----------------- .../collaborateur.component.html | 41 +------------------ 6 files changed, 73 insertions(+), 80 deletions(-) create mode 100644 src/app/components/collaborateur/collaborateur-detail/collaborateur-detail.component.html create mode 100644 src/app/components/collaborateur/collaborateur-detail/collaborateur-detail.component.scss create mode 100644 src/app/components/collaborateur/collaborateur-detail/collaborateur-detail.component.ts diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 24c7ee8..6c1d9a3 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -11,6 +11,7 @@ import { AppRoutingModule } from './app-routing.module'; import { HomeComponent } from './components/home/home.component'; import { AgenceComponent } from './components/agence/agence.component'; import { AgenceEditComponent } from './components/agence/agence-edit/agence-edit.component'; +import { CollaborateurDetailComponent } from './components/collaborateur/collaborateur-detail/collaborateur-detail.component'; @NgModule({ declarations: [ @@ -19,7 +20,8 @@ import { AgenceEditComponent } from './components/agence/agence-edit/agence-edit CollaborateurEditComponent, HomeComponent, AgenceComponent, - AgenceEditComponent + AgenceEditComponent, + CollaborateurDetailComponent ], imports: [ BrowserModule, diff --git a/src/app/components/collaborateur/collaborateur-detail/collaborateur-detail.component.html b/src/app/components/collaborateur/collaborateur-detail/collaborateur-detail.component.html new file mode 100644 index 0000000..8a3a5f0 --- /dev/null +++ b/src/app/components/collaborateur/collaborateur-detail/collaborateur-detail.component.html @@ -0,0 +1,40 @@ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/app/components/collaborateur/collaborateur-detail/collaborateur-detail.component.scss b/src/app/components/collaborateur/collaborateur-detail/collaborateur-detail.component.scss new file mode 100644 index 0000000..edcdf13 --- /dev/null +++ b/src/app/components/collaborateur/collaborateur-detail/collaborateur-detail.component.scss @@ -0,0 +1,9 @@ +label { + color: #435960; + font-weight: bold; +} +input { + font-size: 1em; + padding: .3rem; + margin: .5rem; +} diff --git a/src/app/components/collaborateur/collaborateur-detail/collaborateur-detail.component.ts b/src/app/components/collaborateur/collaborateur-detail/collaborateur-detail.component.ts new file mode 100644 index 0000000..ffc4c2d --- /dev/null +++ b/src/app/components/collaborateur/collaborateur-detail/collaborateur-detail.component.ts @@ -0,0 +1,19 @@ +import {Component, Input, OnInit} from '@angular/core'; +import {Collaborateur} from "../../../interfaces/collaborateur"; + +@Component({ + selector: 'app-collaborateur-detail', + templateUrl: './collaborateur-detail.component.html', + styleUrls: ['./collaborateur-detail.component.scss'] +}) +export class CollaborateurDetailComponent implements OnInit { + + @Input() + collaborateur: Collaborateur | undefined; + + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/src/app/components/collaborateur/collaborateur-edit/collaborateur-edit.component.html b/src/app/components/collaborateur/collaborateur-edit/collaborateur-edit.component.html index 5c2b183..626e1f6 100644 --- a/src/app/components/collaborateur/collaborateur-edit/collaborateur-edit.component.html +++ b/src/app/components/collaborateur/collaborateur-edit/collaborateur-edit.component.html @@ -3,46 +3,8 @@

{{collaborateur.name | uppercase}} {{collaborateur.firstName | uppercase}}

id : {{collaborateur.id}}
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ diff --git a/src/app/components/collaborateur/collaborateur.component.html b/src/app/components/collaborateur/collaborateur.component.html index 0191bff..5297512 100644 --- a/src/app/components/collaborateur/collaborateur.component.html +++ b/src/app/components/collaborateur/collaborateur.component.html @@ -14,46 +14,7 @@

Ajouter un collaborateur :

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ diff --git a/src/app/components/agence/agence.component.html b/src/app/components/agence/agence.component.html index a557dad..97ca12b 100644 --- a/src/app/components/agence/agence.component.html +++ b/src/app/components/agence/agence.component.html @@ -1,19 +1,19 @@
-

Agences

+

Agences

- +
- + - - + +
NameName
{{agence.name}} Modifier {{agence.name}} Modifier

Ajouter une agence :

-
+
diff --git a/src/app/components/collaborateur/collaborateur-detail/collaborateur-detail.component.html b/src/app/components/collaborateur/collaborateur-detail/collaborateur-detail.component.html index 5ac0241..ff5369e 100644 --- a/src/app/components/collaborateur/collaborateur-detail/collaborateur-detail.component.html +++ b/src/app/components/collaborateur/collaborateur-detail/collaborateur-detail.component.html @@ -1,4 +1,4 @@ -
+
Name
diff --git a/src/app/components/collaborateur/collaborateur.component.html b/src/app/components/collaborateur/collaborateur.component.html index 8e81e2e..21ef82a 100644 --- a/src/app/components/collaborateur/collaborateur.component.html +++ b/src/app/components/collaborateur/collaborateur.component.html @@ -1,19 +1,19 @@
-

Collaborateurs

+

Collaborateurs

-
-
+
+
- - - + + + - - - - + + + +
NameFirst NameApside MailNameFirst NameApside Mail
{{collaborateur.name}} {{collaborateur.firstName}} {{collaborateur.apsideMail}} Modifier {{collaborateur.name}} {{collaborateur.firstName}} {{collaborateur.apsideMail}} Modifier
diff --git a/src/styles.scss b/src/styles.scss index 8942e39..7b9838a 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -72,17 +72,15 @@ button:disabled { color: #fafafa; } -td { - align-content: center; - text-align: center; - +.spaced{ + padding : 0 25px; } .list { - padding: 0 30px; -} -th{ +} - text-align: center; +input{ + margin: 0; } + -- 2.36.3 From 66801bdd4b47c800b0534b783ad76ee1a6cea804 Mon Sep 17 00:00:00 2001 From: Clement FERRERE Date: Tue, 8 Mar 2022 14:18:37 +0100 Subject: [PATCH 13/13] Fix padding + fix home h1 -> h2 --- src/app/components/home/home.component.html | 2 +- src/styles.scss | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/components/home/home.component.html b/src/app/components/home/home.component.html index c36cdcf..18fdfe1 100644 --- a/src/app/components/home/home.component.html +++ b/src/app/components/home/home.component.html @@ -1,2 +1,2 @@ -

Services Collaborateurs EPA

+

Services Collaborateurs EPA

diff --git a/src/styles.scss b/src/styles.scss index 7b9838a..ab2785a 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -81,6 +81,6 @@ button:disabled { } input{ - margin: 0; + margin: 0 15px 0 0; } -- 2.36.3