From 65f868f11f7f1047872a6bd22ec9debc41f44b59 Mon Sep 17 00:00:00 2001 From: amentis Date: Fri, 19 Jul 2024 14:56:07 +0300 Subject: [PATCH] ui fix --- .../description-template-type.service.ts | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/frontend/src/app/core/services/description-template-type/description-template-type.service.ts b/frontend/src/app/core/services/description-template-type/description-template-type.service.ts index 8788a96a9..c7e2af63e 100644 --- a/frontend/src/app/core/services/description-template-type/description-template-type.service.ts +++ b/frontend/src/app/core/services/description-template-type/description-template-type.service.ts @@ -62,9 +62,9 @@ export class DescriptionTemplateTypeService { // // tslint:disable-next-line: member-ordering singleAutocompleteConfiguration: SingleAutoCompleteConfiguration = { - initialItems: (data?: any) => this.query(this.buildAutocompleteLookup()).pipe(map(x => x.items)), - filterFn: (searchQuery: string, data?: any) => this.query(this.buildAutocompleteLookup(searchQuery)).pipe(map(x => x.items)), - getSelectedItem: (selectedItem: any) => this.query(this.buildAutocompleteLookup(null, null, [selectedItem])).pipe(map(x => x.items[0])), + initialItems: (data?: any) => this.query(this.buildAutocompleteLookup([IsActive.Active])).pipe(map(x => x.items)), + filterFn: (searchQuery: string, data?: any) => this.query(this.buildAutocompleteLookup([IsActive.Active], searchQuery)).pipe(map(x => x.items)), + getSelectedItem: (selectedItem: any) => this.query(this.buildAutocompleteLookup([IsActive.Active, IsActive.Inactive], null, null, [selectedItem])).pipe(map(x => x.items[0])), displayFn: (item: DescriptionTemplateType) => item.name, titleFn: (item: DescriptionTemplateType) => item.name, valueAssign: (item: DescriptionTemplateType) => item.id, @@ -72,9 +72,9 @@ export class DescriptionTemplateTypeService { public getSingleAutocompleteConfiguration(statuses?: DescriptionTemplateTypeStatus[]): SingleAutoCompleteConfiguration { return { - initialItems: (data?: any) => this.query(this.buildAutocompleteLookup(null, null, null, statuses ? statuses: null)).pipe(map(x => x.items)), - filterFn: (searchQuery: string, data?: any) => this.query(this.buildAutocompleteLookup(searchQuery, null, null, statuses ? statuses: null)).pipe(map(x => x.items)), - getSelectedItem: (selectedItem: any) => this.query(this.buildAutocompleteLookup(null, null, [selectedItem])).pipe(map(x => x.items[0])), + initialItems: (data?: any) => this.query(this.buildAutocompleteLookup([IsActive.Active], null, null, null, statuses ? statuses: null)).pipe(map(x => x.items)), + filterFn: (searchQuery: string, data?: any) => this.query(this.buildAutocompleteLookup([IsActive.Active], searchQuery, null, null, statuses ? statuses: null)).pipe(map(x => x.items)), + getSelectedItem: (selectedItem: any) => this.query(this.buildAutocompleteLookup([IsActive.Active, IsActive.Inactive], null, null, [selectedItem])).pipe(map(x => x.items[0])), displayFn: (item: DescriptionTemplateType) => item.name, titleFn: (item: DescriptionTemplateType) => item.name, valueAssign: (item: DescriptionTemplateType) => item.id, @@ -83,9 +83,9 @@ export class DescriptionTemplateTypeService { // tslint:disable-next-line: member-ordering multipleAutocompleteConfiguration: MultipleAutoCompleteConfiguration = { - initialItems: (excludedItems: any[], data?: any) => this.query(this.buildAutocompleteLookup(null, excludedItems ? excludedItems : null)).pipe(map(x => x.items)), - filterFn: (searchQuery: string, excludedItems: any[]) => this.query(this.buildAutocompleteLookup(searchQuery, excludedItems)).pipe(map(x => x.items)), - getSelectedItems: (selectedItems: any[]) => this.query(this.buildAutocompleteLookup(null, null, selectedItems)).pipe(map(x => x.items)), + initialItems: (excludedItems: any[], data?: any) => this.query(this.buildAutocompleteLookup([IsActive.Active], null, excludedItems ? excludedItems : null)).pipe(map(x => x.items)), + filterFn: (searchQuery: string, excludedItems: any[]) => this.query(this.buildAutocompleteLookup([IsActive.Active], searchQuery, excludedItems)).pipe(map(x => x.items)), + getSelectedItems: (selectedItems: any[]) => this.query(this.buildAutocompleteLookup([IsActive.Active, IsActive.Inactive], null, null, selectedItems)).pipe(map(x => x.items)), displayFn: (item: DescriptionTemplateType) => item.name, titleFn: (item: DescriptionTemplateType) => item.name, valueAssign: (item: DescriptionTemplateType) => item.id, @@ -93,21 +93,21 @@ export class DescriptionTemplateTypeService { public getMultipleAutoCompleteSearchConfiguration(statuses?: DescriptionTemplateTypeStatus[]): MultipleAutoCompleteConfiguration { return { - initialItems: (excludedItems: any[], data?: any) => this.query(this.buildAutocompleteLookup(null, excludedItems ? excludedItems : null, null, statuses ? statuses: null)).pipe(map(x => x.items)), - filterFn: (searchQuery: string, excludedItems: any[]) => this.query(this.buildAutocompleteLookup(searchQuery, excludedItems, null, statuses ? statuses: null)).pipe(map(x => x.items)), - getSelectedItems: (selectedItems: any[]) => this.query(this.buildAutocompleteLookup(null, null, selectedItems)).pipe(map(x => x.items)), + initialItems: (excludedItems: any[], data?: any) => this.query(this.buildAutocompleteLookup([IsActive.Active], null, excludedItems ? excludedItems : null, null, statuses ? statuses: null)).pipe(map(x => x.items)), + filterFn: (searchQuery: string, excludedItems: any[]) => this.query(this.buildAutocompleteLookup([IsActive.Active], searchQuery, excludedItems, null, statuses ? statuses: null)).pipe(map(x => x.items)), + getSelectedItems: (selectedItems: any[]) => this.query(this.buildAutocompleteLookup([IsActive.Active, IsActive.Inactive], null, null, selectedItems)).pipe(map(x => x.items)), displayFn: (item: DescriptionTemplateType) => item.name, titleFn: (item: DescriptionTemplateType) => item.name, valueAssign: (item: DescriptionTemplateType) => item.id, }; } - private buildAutocompleteLookup(like?: string, excludedIds?: Guid[], ids?: Guid[], statuses?: DescriptionTemplateTypeStatus[]): DescriptionTemplateTypeLookup { + private buildAutocompleteLookup(isActive: IsActive[], like?: string, excludedIds?: Guid[], ids?: Guid[], statuses?: DescriptionTemplateTypeStatus[]): DescriptionTemplateTypeLookup { const lookup: DescriptionTemplateTypeLookup = new DescriptionTemplateTypeLookup(); lookup.page = { size: 100, offset: 0 }; if (excludedIds && excludedIds.length > 0) { lookup.excludedIds = excludedIds; } if (ids && ids.length > 0) { lookup.ids = ids; } - lookup.isActive = [IsActive.Active]; + lookup.isActive = isActive; lookup.statuses = statuses; lookup.project = { fields: [