Skip to content
Snippets Groups Projects
Commit 14f1ed19 authored by Hugo SUBTIL's avatar Hugo SUBTIL
Browse files

Merge branch 'fix/retours-tests' into 'V2.0'

fix: retours tests

See merge request web-et-numerique/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_client!351
parents 313334bf 6cbd03fa
No related branches found
No related tags found
4 merge requests!418V2.1.0,!400V2.0,!351fix: retours tests,!230V2.0
...@@ -187,11 +187,12 @@ export class Structure { ...@@ -187,11 +187,12 @@ export class Structure {
} }
public getLabelTypeStructure(): StructureTypeEnum | '' { public getLabelTypeStructure(): StructureTypeEnum | '' {
return StructureTypeEnum[this.structureType.value] || ''; if (this.structureType) return StructureTypeEnum[this.structureType.value] || '';
return '';
} }
public getTypeStructureIcon(): StructureCategoryIconEnum { public getTypeStructureIcon(): StructureCategoryIconEnum {
switch (this.structureType.category) { switch (this.structureType?.category) {
case StructureCategoryEnum.public: case StructureCategoryEnum.public:
return StructureCategoryIconEnum['public']; return StructureCategoryIconEnum['public'];
case StructureCategoryEnum.private: case StructureCategoryEnum.private:
......
...@@ -35,9 +35,6 @@ export class StructureService { ...@@ -35,9 +35,6 @@ export class StructureService {
public editStructure(structure: Partial<Structure>, structureId?: string): Observable<Structure> { public editStructure(structure: Partial<Structure>, structureId?: string): Observable<Structure> {
structure.updatedAt = new Date().toString(); structure.updatedAt = new Date().toString();
if (structure.dataShareConsentDate) {
structure.dataShareConsentDate = new Date().toString();
}
if (!structureId) structureId = structure._id; if (!structureId) structureId = structure._id;
delete structure._id; // id should not be provided for update delete structure._id; // id should not be provided for update
return this.http return this.http
......
...@@ -78,9 +78,17 @@ export class DataShareConsentComponent implements OnInit { ...@@ -78,9 +78,17 @@ export class DataShareConsentComponent implements OnInit {
this.submitted = true; this.submitted = true;
this.loading = true; this.loading = true;
for (let structure of this.dataConsentPendingStructures) { for (let structure of this.dataConsentPendingStructures) {
this.structureService.editStructure(structure).subscribe((_s: Structure) => {}); this.structureService
.editStructure(
{
dataShareConsentDate: structure.dataShareConsentDate,
},
structure._id
)
.subscribe((_s: Structure) => {
this.loading = false;
this.openned = false;
});
} }
this.loading = false;
this.openned = false;
} }
} }
...@@ -125,7 +125,7 @@ export class formUtils { ...@@ -125,7 +125,7 @@ export class formUtils {
handicaps: this.loadArrayForCheckbox(structure.categories.handicaps, false), handicaps: this.loadArrayForCheckbox(structure.categories.handicaps, false),
age: this.loadArrayForCheckbox(structure.categories.age, true), age: this.loadArrayForCheckbox(structure.categories.age, true),
languageAndIlliteracy: this.loadArrayForCheckbox(structure.categories.languageAndIlliteracy, false), languageAndIlliteracy: this.loadArrayForCheckbox(structure.categories.languageAndIlliteracy, false),
selfServiceMaterial: this.loadArrayForCheckbox(structure.categories.selfServiceMaterial, true), selfServiceMaterial: this.loadArrayForCheckbox(structure.categories.selfServiceMaterial, false),
publicOthers: this.loadArrayForCheckbox(structure.categories.publicOthers, false), publicOthers: this.loadArrayForCheckbox(structure.categories.publicOthers, false),
equipmentsAndServices: this.loadArrayForCheckbox(structure.categories.equipmentsServices, false), equipmentsAndServices: this.loadArrayForCheckbox(structure.categories.equipmentsServices, false),
baseSkills: new UntypedFormControl(structure.categories.baseSkills), baseSkills: new UntypedFormControl(structure.categories.baseSkills),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment