aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-ui
diff options
context:
space:
mode:
authorshikha0203 <shivani.khare@est.tech>2023-03-09 10:21:30 +0000
committerVasyl Razinkov <vasyl.razinkov@est.tech>2023-03-09 22:24:59 +0000
commit4ec39782a9f8fe7188f38fc39953f277a8284618 (patch)
tree39a5e96408ad4349f2c01b9d2c5c4af7a405ac9a /catalog-ui
parent52b078ee0276fbda860d7acf9d29c5fb35542030 (diff)
Sort drop down lists in VFC requirements and capabilities
Issue-ID: SDC-4429 Signed-off-by: shikha0203 <shivani.khare@est.tech> Change-Id: I10c1f8cb6cd57e4c49b70d0a400a7aed068133b0
Diffstat (limited to 'catalog-ui')
-rw-r--r--catalog-ui/src/app/ng2/pages/workspace/req-and-capabilities/req-and-capabilities.service.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/catalog-ui/src/app/ng2/pages/workspace/req-and-capabilities/req-and-capabilities.service.ts b/catalog-ui/src/app/ng2/pages/workspace/req-and-capabilities/req-and-capabilities.service.ts
index e7b39c0a84..4421c2708b 100644
--- a/catalog-ui/src/app/ng2/pages/workspace/req-and-capabilities/req-and-capabilities.service.ts
+++ b/catalog-ui/src/app/ng2/pages/workspace/req-and-capabilities/req-and-capabilities.service.ts
@@ -41,16 +41,19 @@ export class ReqAndCapabilitiesService {
// -- COMMON for both --
this.capabilityTypesList = [];
let capabilityTypesResult = await this.toscaTypesServiceNg2.fetchCapabilityTypes(this.workspaceService.metadata.model);
- Object.keys(capabilityTypesResult).forEach(key => {this.capabilityTypesList.push(capabilityTypesResult[key])})
+ Object.keys(capabilityTypesResult).forEach(key => {this.capabilityTypesList.push(capabilityTypesResult[key])});
+ this.capabilityTypesList.sort((capabilityType1, capabilityType2) => capabilityType1.toscaPresentation.type.localeCompare(capabilityType2.toscaPresentation.type));
if (initInputsFor === 'INPUTS_FOR_REQUIREMENTS') {
this.relationshipTypesList = [];
let relationshipTypesResult = await this.toscaTypesServiceNg2.fetchRelationshipTypes(this.workspaceService.metadata.model);
Object.keys(relationshipTypesResult).forEach(key => {this.relationshipTypesList.push(relationshipTypesResult[key])});
+ this.relationshipTypesList.sort((relationship1,relationship2) => relationship1.toscaPresentation.type.localeCompare(relationship2.toscaPresentation.type));
this.nodeTypesList = [];
let nodeTypesResult = await this.toscaTypesServiceNg2.fetchNodeTypes(this.workspaceService.metadata.model);
- Object.keys(nodeTypesResult).forEach(key => {this.nodeTypesList.push(nodeTypesResult[key])})
+ Object.keys(nodeTypesResult).forEach(key => {this.nodeTypesList.push(nodeTypesResult[key])});
+ this.nodeTypesList.sort((node1,node2) => node1.componentMetadataDefinition.componentMetadataDataDefinition.toscaResourceName.localeCompare(node2.componentMetadataDefinition.componentMetadataDataDefinition.toscaResourceName));
}
}