diff options
author | KrupaNagabhushan <krupa.nagabhushan@est.tech> | 2022-04-28 10:37:54 +0100 |
---|---|---|
committer | Michael Morris <michael.morris@est.tech> | 2022-04-28 12:27:55 +0000 |
commit | 35164bca07a6f6ad62d502dcf99b30a89bab8f61 (patch) | |
tree | 2ee42eed06a29925aa8982f64a076cda44d5aefc | |
parent | cee79dd87db512691b7f3fde339635a1ca8632e7 (diff) |
Fix check to restrict deletion for system deployed VFCs
Issue-ID: SDC-3986
Signed-off-by: KrupaNagabhushan <krupa.nagabhushan@est.tech>
Change-Id: I4d0f91640f6603c5029a88cb902c959bc8522455
-rw-r--r-- | catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java | 8 | ||||
-rw-r--r-- | catalog-ui/src/app/view-models/workspace/workspace-view.html | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java index e11dbb3b67..aa2ba31385 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java @@ -4225,10 +4225,6 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { return componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponse(resourceStatus.right().value()), ""); } Resource resource = resourceStatus.left().value(); - if (isComponentSystemDeployed(resource)) { - throw new ByActionStatusComponentException(ActionStatus.CANNOT_DELETE_SYSTEM_DEPLOYED_RESOURCES, ComponentTypeEnum.RESOURCE.getValue(), - resource.getName()); - } StorageOperationStatus result = StorageOperationStatus.OK; lockComponent(resourceId, resource, "Mark resource to delete"); try { @@ -4270,6 +4266,10 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { componentException(resourceStatus.right().value()); } Resource resource = resourceStatus.left().value(); + if (isComponentSystemDeployed(resource)) { + throw new ByActionStatusComponentException(ActionStatus.CANNOT_DELETE_SYSTEM_DEPLOYED_RESOURCES, ComponentTypeEnum.RESOURCE.getValue(), + resource.getName()); + } if (Boolean.FALSE.equals(resource.isArchived())) { log.debug("The resource, {}, requested for delete has not been archived.", resourceId); throw new ComponentException(ActionStatus.COMPONENT_NOT_ARCHIVED, resourceId); diff --git a/catalog-ui/src/app/view-models/workspace/workspace-view.html b/catalog-ui/src/app/view-models/workspace/workspace-view.html index 21cebeb388..6a5cd924aa 100644 --- a/catalog-ui/src/app/view-models/workspace/workspace-view.html +++ b/catalog-ui/src/app/view-models/workspace/workspace-view.html @@ -94,7 +94,7 @@ ng-click="deleteArchivedComponent()" class="sprite-new delete-btn" data-tests-id="delete_archive_version" - sdc-smart-tooltip="Delete Service" + sdc-smart-tooltip="Delete Component" prevent-double-click>Delete</span> <span data-ng-click = "archiveComponent()" |