From 6d004fe2dc52c69e8f30a9717f5db0aa788898a2 Mon Sep 17 00:00:00 2001 From: mpetrov Date: Thu, 31 Oct 2024 16:51:00 +0200 Subject: [PATCH 1/5] Fixed sizing for codeblocks --- .../home/components/event/event-content-dialog.component.ts | 4 ++-- .../lib/home-page/getting-started-widget.component.scss | 2 +- ui-ngx/src/app/shared/components/markdown.component.scss | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/event/event-content-dialog.component.ts b/ui-ngx/src/app/modules/home/components/event/event-content-dialog.component.ts index 65b5be9b75..fb7b026914 100644 --- a/ui-ngx/src/app/modules/home/components/event/event-content-dialog.component.ts +++ b/ui-ngx/src/app/modules/home/components/event/event-content-dialog.component.ts @@ -139,14 +139,14 @@ export class EventContentDialogComponent extends DialogComponent 0) { const lines = content.split('\n'); - newHeight = 16 * lines.length + 16; + newHeight = 18 * lines.length + 16; let maxLineLength = 0; lines.forEach((row) => { const line = row.replace(/\t/g, ' ').replace(/\n/g, ''); const lineLength = line.length; maxLineLength = Math.max(maxLineLength, lineLength); }); - newWidth = 8 * maxLineLength + 16; + newWidth = 10 * maxLineLength + 16; } // newHeight = Math.min(400, newHeight); this.renderer.setStyle(editorElement, 'minHeight', newHeight.toString() + 'px'); diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/home-page/getting-started-widget.component.scss b/ui-ngx/src/app/modules/home/components/widget/lib/home-page/getting-started-widget.component.scss index 65eaf66c54..3e34cbdcd9 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/home-page/getting-started-widget.component.scss +++ b/ui-ngx/src/app/modules/home/components/widget/lib/home-page/getting-started-widget.component.scss @@ -118,7 +118,7 @@ padding: 0; pre[class*=language-] { margin: 0; - padding: 9px 38px 9px 16px; + padding: 10px 38px 10px 16px; background: rgba(0, 0, 0, 0.03); border-radius: 6px; border: none; diff --git a/ui-ngx/src/app/shared/components/markdown.component.scss b/ui-ngx/src/app/shared/components/markdown.component.scss index 0c5e310e07..c47a78011b 100644 --- a/ui-ngx/src/app/shared/components/markdown.component.scss +++ b/ui-ngx/src/app/shared/components/markdown.component.scss @@ -370,7 +370,7 @@ } &.line-numbers { - padding-left: 66px; + padding: 10px 16px 10px 66px; & > code { span.line-numbers-rows { From 9ec8617433405f482cb136718249714266b81679 Mon Sep 17 00:00:00 2001 From: mpetrov Date: Thu, 31 Oct 2024 16:51:28 +0200 Subject: [PATCH 2/5] Revert "Fixed sizing for codeblocks" This reverts commit 6d004fe2dc52c69e8f30a9717f5db0aa788898a2. --- .../home/components/event/event-content-dialog.component.ts | 4 ++-- .../lib/home-page/getting-started-widget.component.scss | 2 +- ui-ngx/src/app/shared/components/markdown.component.scss | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/event/event-content-dialog.component.ts b/ui-ngx/src/app/modules/home/components/event/event-content-dialog.component.ts index fb7b026914..65b5be9b75 100644 --- a/ui-ngx/src/app/modules/home/components/event/event-content-dialog.component.ts +++ b/ui-ngx/src/app/modules/home/components/event/event-content-dialog.component.ts @@ -139,14 +139,14 @@ export class EventContentDialogComponent extends DialogComponent 0) { const lines = content.split('\n'); - newHeight = 18 * lines.length + 16; + newHeight = 16 * lines.length + 16; let maxLineLength = 0; lines.forEach((row) => { const line = row.replace(/\t/g, ' ').replace(/\n/g, ''); const lineLength = line.length; maxLineLength = Math.max(maxLineLength, lineLength); }); - newWidth = 10 * maxLineLength + 16; + newWidth = 8 * maxLineLength + 16; } // newHeight = Math.min(400, newHeight); this.renderer.setStyle(editorElement, 'minHeight', newHeight.toString() + 'px'); diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/home-page/getting-started-widget.component.scss b/ui-ngx/src/app/modules/home/components/widget/lib/home-page/getting-started-widget.component.scss index 3e34cbdcd9..65eaf66c54 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/home-page/getting-started-widget.component.scss +++ b/ui-ngx/src/app/modules/home/components/widget/lib/home-page/getting-started-widget.component.scss @@ -118,7 +118,7 @@ padding: 0; pre[class*=language-] { margin: 0; - padding: 10px 38px 10px 16px; + padding: 9px 38px 9px 16px; background: rgba(0, 0, 0, 0.03); border-radius: 6px; border: none; diff --git a/ui-ngx/src/app/shared/components/markdown.component.scss b/ui-ngx/src/app/shared/components/markdown.component.scss index c47a78011b..0c5e310e07 100644 --- a/ui-ngx/src/app/shared/components/markdown.component.scss +++ b/ui-ngx/src/app/shared/components/markdown.component.scss @@ -370,7 +370,7 @@ } &.line-numbers { - padding: 10px 16px 10px 66px; + padding-left: 66px; & > code { span.line-numbers-rows { From 9a1c03ac5df3902796a7257fcf68524fae320ee6 Mon Sep 17 00:00:00 2001 From: mpetrov Date: Thu, 31 Oct 2024 18:05:37 +0200 Subject: [PATCH 3/5] Updated autocomplete for AssetService --- .../models/ace/service-completion.models.ts | 102 ++++++++++-------- 1 file changed, 60 insertions(+), 42 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 5efc428194..709d670e6b 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,6 +102,10 @@ 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', @@ -366,27 +370,6 @@ 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', @@ -414,53 +397,80 @@ export const serviceCompletions: TbEditorCompletions = { ], return: observableReturnType(assetInfoHref) }, - saveAsset: { - description: 'Save asset', + getTenantAssets: { + description: 'Get assets for the tenant, filtered by type if provided', meta: 'function', args: [ - {name: 'asset', type: assetHref, description: 'Asset object to save'}, + pageLinkArg, + { name: 'type', type: 'string', description: 'Optional asset type filter' }, requestConfigArg ], - return: observableReturnType(assetHref) + return: observablePageDataReturnType(assetHref) }, - deleteAsset: { - description: 'Delete asset by id', + getCustomerAssets: { + description: 'Get assets for a specific customer, filtered by type if provided', meta: 'function', args: [ - {name: 'assetId', type: 'string', description: 'Id of the asset'}, + { name: 'customerId', type: 'string', description: 'Customer ID' }, + pageLinkArg, + { name: 'type', type: 'string', description: 'Optional asset type filter' }, requestConfigArg ], - return: observableVoid() + return: observablePageDataReturnType(assetHref) }, - getAssetTypes: { - description: 'Get all available assets types', + getUserAssets: { + description: 'Get assets associated with the user, filtered by type if provided', meta: 'function', args: [ + pageLinkArg, + { name: 'type', type: 'string', description: 'Optional asset type filter' }, requestConfigArg ], - return: observableArrayReturnType('EntitySubtype') + return: observablePageDataReturnType(assetHref) }, - makeAssetPublic: { - description: 'Make asset public (available from public dashboard)', + getAllAssetInfos: { + description: 'Get all asset information with optional customer inclusion', meta: 'function', args: [ - {name: 'assetId', type: 'string', description: 'Id of the asset'}, + { name: 'includeCustomers', type: 'boolean', description: 'Whether to include customers in the result' }, + pageLinkArg, + { name: 'assetProfileId', type: 'string', description: 'Optional asset profile ID' }, requestConfigArg ], - return: observableReturnType(assetHref) + return: observablePageDataReturnType(assetInfoHref) }, - assignAssetToCustomer: { - description: 'Assign asset to specific customer', + getCustomerAssetInfos: { + description: 'Get customer asset information with optional customer inclusion', meta: 'function', args: [ - {name: 'customerId', type: 'string', description: 'Id of the customer'}, - {name: 'assetId', type: 'string', description: 'Id of the asset'}, + { 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) + }, + bulkImportAssets: { + description: 'Bulk import assets with provided entities data', + meta: 'function', + args: [ + { name: 'entitiesData', type: bulkImportRequestHref, description: 'Data for bulk importing assets' }, + requestConfigArg + ], + return: observableReturnType(bulkImportResultHref) + }, + saveAsset: { + description: 'Save asset', + meta: 'function', + args: [ + {name: 'asset', type: assetHref, description: 'Asset object to save'}, requestConfigArg ], return: observableReturnType(assetHref) }, - unassignAssetFromCustomer: { - description: 'Unassign asset from any customer', + deleteAsset: { + description: 'Delete asset by id', meta: 'function', args: [ {name: 'assetId', type: 'string', description: 'Id of the asset'}, @@ -468,6 +478,14 @@ 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', From ba171900a9db305a801907f20f5192af7b5d79cc Mon Sep 17 00:00:00 2001 From: mpetrov Date: Fri, 1 Nov 2024 12:32:43 +0200 Subject: [PATCH 4/5] 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', From fa110b4c613710a40eb6d0370de0193f2d6980bd Mon Sep 17 00:00:00 2001 From: mpetrov Date: Fri, 1 Nov 2024 12:33:15 +0200 Subject: [PATCH 5/5] Updated autocomplete for AssetService refactoring --- .../models/ace/service-completion.models.ts | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) 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 5efc428194..17e05427a1 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,6 +102,10 @@ 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', @@ -387,6 +391,67 @@ export const serviceCompletions: TbEditorCompletions = { ], return: observablePageDataReturnType(assetInfoHref) }, + getTenantAssetInfosByAssetProfileId: { + description: 'Get tenant asset infos by asset profile ID', + meta: 'function', + args: [ + pageLinkArg, + { name: 'assetProfileId', type: 'string', optional: true, description: 'ID of the asset profile' }, + requestConfigArg + ], + return: observablePageDataReturnType(assetInfoHref) + }, + getCustomerAssetInfosByAssetProfileId: { + description: 'Get customer asset infos by asset profile ID', + meta: 'function', + args: [ + { name: 'customerId', type: 'string', description: 'ID of the customer' }, + pageLinkArg, + { name: 'assetProfileId', type: 'string', optional: true, description: 'ID of the asset profile' }, + requestConfigArg + ], + return: observablePageDataReturnType(assetInfoHref) + }, + assignAssetToEdge: { + description: 'Assign an asset to an edge', + meta: 'function', + args: [ + { name: 'edgeId', type: 'string', description: 'ID of the edge' }, + { name: 'assetId', type: 'string', description: 'ID of the asset' }, + requestConfigArg + ], + return: observableReturnType(assetHref) + }, + unassignAssetFromEdge: { + description: 'Unassign an asset from an edge', + meta: 'function', + args: [ + { name: 'edgeId', type: 'string', description: 'ID of the edge' }, + { name: 'assetId', type: 'string', description: 'ID of the asset' }, + requestConfigArg + ], + return: observableVoid() + }, + getEdgeAssets: { + description: 'Get assets assigned to an edge', + meta: 'function', + args: [ + { name: 'edgeId', type: 'string', description: 'ID of the edge' }, + pageLinkArg, + { name: 'type', type: 'string', optional: true, description: 'Asset type' }, + requestConfigArg + ], + return: observablePageDataReturnType(assetInfoHref) + }, + bulkImportAssets: { + description: 'Bulk import assets with provided entities data', + meta: 'function', + args: [ + { name: 'entitiesData', type: bulkImportRequestHref, description: 'Data for bulk importing assets' }, + requestConfigArg + ], + return: observableReturnType(bulkImportResultHref) + }, getAsset: { description: 'Get asset by id', meta: 'function',