From 44420be6f1d8a839816d9fa00f6b3b5f0adfdddc Mon Sep 17 00:00:00 2001 From: Jean Beaurepaire Date: Mon, 30 Dec 2024 16:02:15 +0100 Subject: [PATCH] fix: add uniqueOperation params for new departments api --- .../select/feeder/department-feeder.component.ts | 4 ++++ .../select/input/department-select-input.component.html | 7 ++++++- .../select/input/department-select-input.component.ts | 3 +-- packages/ng/department/service/department-v4.service.ts | 7 ++++++- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/packages/ng/department/select/feeder/department-feeder.component.ts b/packages/ng/department/select/feeder/department-feeder.component.ts index 233ac98d7d..9226be4d07 100644 --- a/packages/ng/department/select/feeder/department-feeder.component.ts +++ b/packages/ng/department/select/feeder/department-feeder.component.ts @@ -44,6 +44,10 @@ export class LuDepartmentFeederComponent extends ALuTreeOptionOperator
- +
diff --git a/packages/ng/department/select/input/department-select-input.component.ts b/packages/ng/department/select/input/department-select-input.component.ts index 85d8bc497d..434b899aa5 100644 --- a/packages/ng/department/select/input/department-select-input.component.ts +++ b/packages/ng/department/select/input/department-select-input.component.ts @@ -11,7 +11,6 @@ import { LuOptionComparer, LuTreeOptionItemComponent, LuTreeOptionPickerAdvancedComponent, - LuTreeOptionPickerComponent, LuTreeOptionSearcherComponent, LuTreeOptionSelectAllComponent, } from '@lucca-front/ng/option'; @@ -31,7 +30,6 @@ import { LU_DEPARTMENT_SELECT_INPUT_TRANSLATIONS } from './department-select-inp OverlayModule, A11yModule, LuInputClearerComponent, - LuTreeOptionPickerComponent, LuTreeOptionPickerAdvancedComponent, LuDepartmentFeederComponent, LuTreeOptionSearcherComponent, @@ -60,6 +58,7 @@ export class LuDepartmentSelectInputComponent< @Input() appInstanceId: number | string; @Input() operations: number[]; @Input() filters: string[] = []; + @Input() uniqueOperation: number; public intl = getIntl(LU_DEPARTMENT_SELECT_INPUT_TRANSLATIONS); diff --git a/packages/ng/department/service/department-v4.service.ts b/packages/ng/department/service/department-v4.service.ts index 61c0f52689..1a3aae29ef 100644 --- a/packages/ng/department/service/department-v4.service.ts +++ b/packages/ng/department/service/department-v4.service.ts @@ -29,6 +29,11 @@ export class LuDepartmentV4Service { this._operations = operations; } + protected _uniqueOperation: number; + set uniqueOperation(uniqueOperation: number) { + this._uniqueOperation = uniqueOperation; + } + constructor(private _http: HttpClient) {} getTrees() { @@ -40,7 +45,7 @@ export class LuDepartmentV4Service { >(`/api/v3/departments/scopedtree?fields=id,name&${[`appInstanceId=${this._appInstanceId}`, `operations=${this._operations.join(',')}`, this._filters.join(',')].filter((f) => !!f).join('&')}`) .pipe(map((response) => response.data)); } else { - call = this._http.get(`${this.api}/tree`); + call = this._http.get(`${this.api}/tree`, { params: { uniqueOperation: this.uniqueOperation } }); } return call.pipe(