Merge pull request 'fix_vulnerabilities + opti et revue rapide' (#25) from fix_vulnerabilities into develop

Reviewed-on: Clement.Ferrere/Collaborateur_Epa_Front#25
develop
Clement.Ferrere 2 years ago
commit 7cf6584250
  1. 4
      Dockerfile
  2. 15982
      package-lock.json
  3. 28
      src/app/components/agence/agence-add/agence-add.component.ts
  4. 2
      src/app/components/agence/agence-edit/agence-edit.component.html
  5. 1
      src/app/components/agence/agence-edit/agence-edit.component.ts
  6. 2
      src/app/components/agence/agence.component.ts
  7. 1
      src/app/components/businessunit/businessunit.component.ts
  8. 9
      src/app/components/collaborateur/collaborateur-add/collaborateur-add.component.ts
  9. 2
      src/app/components/periode-essai/periode-essai-add/periode-essai-add.component.html

@ -1,5 +1,5 @@
# Stage 1 : Building the application
FROM node:16-alpine3.14 as build-step
FROM node:16-alpine3.15 as build-step
RUN mkdir -p /app
@ -12,7 +12,7 @@ RUN npm install
RUN npm run build --prod
# Stage 2 : Deploying the application on Nginx
FROM nginx:1.17.1-alpine
FROM nginx:1.23.1-alpine
RUN rm -rf /usr/share/nginx/html/* && rm -rf /etc/nginx/nginx.conf
COPY ./nginx.conf /etc/nginx/nginx.conf

15982
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -14,11 +14,8 @@ import {ToastrService} from "ngx-toastr";
})
export class AgenceAddComponent implements OnInit {
agences: Agence[] = [];
agence = {} as Agence;
businessUnits: Businessunit[] = [];
businessUnit = {} as Businessunit;
registerForm!: FormGroup;
submitted = false;
@ -36,7 +33,6 @@ export class AgenceAddComponent implements OnInit {
}
ngOnInit(): void {
this.getAgences();
this.getBusinessUnits();
this.registerForm = this.formBuilder.group({
name: ['', Validators.required],
@ -44,27 +40,11 @@ export class AgenceAddComponent implements OnInit {
});
}
getAgences(): void {
this.agenceService.getAgences()
.subscribe(agences => this.agences = agences);
}
getBusinessUnits() {
this.businessUnitService.getBusinessunits()
.subscribe(businessunits => this.businessUnits = businessunits);
}
add(agence: Agence): void {
this.agenceService.addAgence(agence)
.subscribe(agence => {
this.agences.push(agence);
this.showSuccess();
},
() => {
this.showError()
});
}
onSubmit() {
this.submitted = true;
@ -73,7 +53,13 @@ export class AgenceAddComponent implements OnInit {
}
this.agence.name = this.registerForm.value.name
this.agence.businessUnitId = this.registerForm.value.businessUnitId
this.add(this.agence)
this.agenceService.addAgence(this.agence)
.subscribe(() => {
this.showSuccess();
},
() => {
this.showError()
});
}
onReset() {

@ -33,7 +33,7 @@
<div>
<button type="submit">Sauvegarder les changements</button>
<button type="reset">Effacer</button>
<button type="button" (click)="goBack()">Retour</button>
<button (click)="goBack()" type="button">Retour</button>
</div>
</form>

@ -17,7 +17,6 @@ import {ToastrService} from "ngx-toastr";
})
export class AgenceEditComponent implements OnInit {
businessUnits: Businessunit[] = [];
businessUnit = {} as Businessunit;
agence = {} as Agence;
agenceObservable!: Observable<Agence>;

@ -12,9 +12,7 @@ import {BusinessunitService} from "../../services/businessunit.service";
})
export class AgenceComponent implements OnInit {
agences: Agence[] = [];
agence = {} as Agence;
businessUnits: Businessunit[] = [];
businessUnit = {} as Businessunit;
constructor(

@ -13,7 +13,6 @@ import {FormGroup} from "@angular/forms";
export class BusinessunitComponent implements OnInit {
businessunits: Businessunit[] = [];
businessunit = {} as Businessunit;
registerForm!: FormGroup;
submitted = false;

@ -18,11 +18,8 @@ export class CollaborateurAddComponent implements OnInit {
collaborateurs: Collaborateur[] = [];
collaborateur = {} as Collaborateur;
businessUnits: Businessunit[] = [];
businessUnit = {} as Businessunit;
errorValue: number = 0;
rDate: String = "";
bDate: String = "";
registerForm!: FormGroup;
submitted = false;
@ -56,12 +53,6 @@ export class CollaborateurAddComponent implements OnInit {
resignationDate: [],
businessUnitId: ['', Validators.required],
});
if (this.collaborateur.resignationDate) {
this.rDate = new Date(this.collaborateur.resignationDate).toISOString().split('T')[0];
}
if (this.collaborateur.birthDate) {
this.bDate = new Date(this.collaborateur.birthDate).toISOString().split('T')[0];
}
}
getCollaborateurs(): void {

@ -7,8 +7,6 @@
<select [ngClass]="{ 'is-invalid': submitted && f.collaborateurId.errors }" class="form-select"
formControlName="collaborateurId"
id="collaborateur-select">
<!--<option [defaultSelected]="collaborateur"
[ngValue]="collaborateur.id">{{collaborateur.name}} {{collaborateur.firstName}}</option>-->
<option *ngFor="let collaborateur of collaborateurs"
[ngValue]="collaborateur.id">{{collaborateur.name}} {{collaborateur.firstName}}</option>
</select>

Loading…
Cancel
Save