Skip to content

Commit

Permalink
linter
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Corny committed Sep 26, 2024
1 parent 6859fff commit 1a28997
Showing 1 changed file with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class ZhHierarchySearchTableComponent implements OnInit {
private _zhService: ZhDataService,
private _toastr: ToastrService,
private _error: ErrorTranslatorService
) { }
) {}

get data() {
return this.form.controls['hierarchy'] as FormArray;
Expand All @@ -87,7 +87,7 @@ export class ZhHierarchySearchTableComponent implements OnInit {
this.fields = [];
this.notes = [];
})
.finally(() => { });
.finally(() => {});
}
}

Expand Down Expand Up @@ -119,7 +119,7 @@ export class ZhHierarchySearchTableComponent implements OnInit {
(item.rubrique == event && item.sousrubrique == null) ||
item.sousrubrique == event
);

// Creates kind of a Set to have unique objects
this.attributes = filteredNotes.filter(
(v, i, a) => a.findIndex((v2) => ['attribut'].every((k) => v2[k] === v[k])) === i
Expand All @@ -130,12 +130,12 @@ export class ZhHierarchySearchTableComponent implements OnInit {
if (this.attributes.length > 0) {
this.knowledges = this.getKnowledge(this.attributes[0]);
}

if (this.attributes.length > 0) {
this.localForm.controls["attributes"].setValue([this.attributes[0]]);
this.localForm.controls['attributes'].setValue([this.attributes[0]]);
}
if (this.knowledges.length > 0) {
this.localForm.controls["knowledges"].setValue([this.knowledges]);
this.localForm.controls['knowledges'].setValue([this.knowledges]);
}
}

Expand Down Expand Up @@ -170,18 +170,18 @@ export class ZhHierarchySearchTableComponent implements OnInit {
const form = this.initialForm();
form.patchValue(this.localForm.value);
this.data.push(form);
let knowledges_array = []
this.data.value.forEach(element => {
if ((element['knowledges'] !== null) && (!(Array.isArray(element['knowledges'])))) {
let knowledges_array = [];
this.data.value.forEach((element) => {
if (element['knowledges'] !== null && !Array.isArray(element['knowledges'])) {
// avoid object object in 'connaissance' column of the frontend table
knowledges_array.push(element['knowledges']);
element['knowledges'] = knowledges_array;
knowledges_array = []
knowledges_array = [];
}
})
}
});
}
this.reset();
};
}

onDeleteFilter(event) {
const item = this.getFilterIndex(event);
Expand Down

0 comments on commit 1a28997

Please sign in to comment.