From ba171900a9db305a801907f20f5192af7b5d79cc Mon Sep 17 00:00:00 2001 From: mpetrov Date: Fri, 1 Nov 2024 12:32:43 +0200 Subject: [PATCH] Revert "Updated autocomplete for AssetService" This reverts commit 9a1c03ac5df3902796a7257fcf68524fae320ee6. --- .../models/ace/service-completion.models.ts | 102 ++++++++---------- 1 file changed, 42 insertions(+), 60 deletions(-) diff --git a/ui-ngx/src/app/shared/models/ace/service-completion.models.ts b/ui-ngx/src/app/shared/models/ace/service-completion.models.ts index 709d670e6b..5efc428194 100644 --- a/ui-ngx/src/app/shared/models/ace/service-completion.models.ts +++ b/ui-ngx/src/app/shared/models/ace/service-completion.models.ts @@ -102,10 +102,6 @@ export const customDialogComponentHref = 'Resource info'; -export const bulkImportResultHref = 'Bulk import result'; - -export const bulkImportRequestHref = 'Bulk import request'; - export const pageLinkArg: FunctionArg = { name: 'pageLink', type: 'PageLink', @@ -370,6 +366,27 @@ export const serviceCompletions: TbEditorCompletions = { meta: 'service', type: 'AssetService', children: { + getTenantAssetInfos: { + description: 'Get tenant assets', + meta: 'function', + args: [ + pageLinkArg, + {name: 'type', type: 'string', optional: true, description: 'Asset type'}, + requestConfigArg + ], + return: observablePageDataReturnType(assetInfoHref) + }, + getCustomerAssetInfos: { + description: 'Get customer assets', + meta: 'function', + args: [ + {name: 'customerId', type: 'string', description: 'Id of the customer'}, + pageLinkArg, + {name: 'type', type: 'string', optional: true, description: 'Asset type'}, + requestConfigArg + ], + return: observablePageDataReturnType(assetInfoHref) + }, getAsset: { description: 'Get asset by id', meta: 'function', @@ -397,80 +414,53 @@ export const serviceCompletions: TbEditorCompletions = { ], return: observableReturnType(assetInfoHref) }, - getTenantAssets: { - description: 'Get assets for the tenant, filtered by type if provided', - meta: 'function', - args: [ - pageLinkArg, - { name: 'type', type: 'string', description: 'Optional asset type filter' }, - requestConfigArg - ], - return: observablePageDataReturnType(assetHref) - }, - getCustomerAssets: { - description: 'Get assets for a specific customer, filtered by type if provided', - meta: 'function', - args: [ - { name: 'customerId', type: 'string', description: 'Customer ID' }, - pageLinkArg, - { name: 'type', type: 'string', description: 'Optional asset type filter' }, - requestConfigArg - ], - return: observablePageDataReturnType(assetHref) - }, - getUserAssets: { - description: 'Get assets associated with the user, filtered by type if provided', + saveAsset: { + description: 'Save asset', meta: 'function', args: [ - pageLinkArg, - { name: 'type', type: 'string', description: 'Optional asset type filter' }, + {name: 'asset', type: assetHref, description: 'Asset object to save'}, requestConfigArg ], - return: observablePageDataReturnType(assetHref) + return: observableReturnType(assetHref) }, - getAllAssetInfos: { - description: 'Get all asset information with optional customer inclusion', + deleteAsset: { + description: 'Delete asset by id', meta: 'function', args: [ - { name: 'includeCustomers', type: 'boolean', description: 'Whether to include customers in the result' }, - pageLinkArg, - { name: 'assetProfileId', type: 'string', description: 'Optional asset profile ID' }, + {name: 'assetId', type: 'string', description: 'Id of the asset'}, requestConfigArg ], - return: observablePageDataReturnType(assetInfoHref) + return: observableVoid() }, - getCustomerAssetInfos: { - description: 'Get customer asset information with optional customer inclusion', + getAssetTypes: { + description: 'Get all available assets types', meta: 'function', args: [ - { name: 'includeCustomers', type: 'boolean', description: 'Whether to include customers in the result' }, - { name: 'customerId', type: 'string', description: 'Customer ID' }, - pageLinkArg, - { name: 'assetProfileId', type: 'string', description: 'Optional asset profile ID' }, requestConfigArg ], - return: observablePageDataReturnType(assetInfoHref) + return: observableArrayReturnType('EntitySubtype') }, - bulkImportAssets: { - description: 'Bulk import assets with provided entities data', + makeAssetPublic: { + description: 'Make asset public (available from public dashboard)', meta: 'function', args: [ - { name: 'entitiesData', type: bulkImportRequestHref, description: 'Data for bulk importing assets' }, + {name: 'assetId', type: 'string', description: 'Id of the asset'}, requestConfigArg ], - return: observableReturnType(bulkImportResultHref) + return: observableReturnType(assetHref) }, - saveAsset: { - description: 'Save asset', + assignAssetToCustomer: { + description: 'Assign asset to specific customer', meta: 'function', args: [ - {name: 'asset', type: assetHref, description: 'Asset object to save'}, + {name: 'customerId', type: 'string', description: 'Id of the customer'}, + {name: 'assetId', type: 'string', description: 'Id of the asset'}, requestConfigArg ], return: observableReturnType(assetHref) }, - deleteAsset: { - description: 'Delete asset by id', + unassignAssetFromCustomer: { + description: 'Unassign asset from any customer', meta: 'function', args: [ {name: 'assetId', type: 'string', description: 'Id of the asset'}, @@ -478,14 +468,6 @@ export const serviceCompletions: TbEditorCompletions = { ], return: observableVoid() }, - getAssetTypes: { - description: 'Get all available assets types', - meta: 'function', - args: [ - requestConfigArg - ], - return: observableArrayReturnType('EntitySubtype') - }, findByQuery: { description: 'Find assets by search query', meta: 'function',