Fix check to restrict deletion for system deployed VFCs 40/128940/2
authorKrupaNagabhushan <krupa.nagabhushan@est.tech>
Thu, 28 Apr 2022 09:37:54 +0000 (10:37 +0100)
committerMichael Morris <michael.morris@est.tech>
Thu, 28 Apr 2022 12:27:55 +0000 (12:27 +0000)
Issue-ID: SDC-3986
Signed-off-by: KrupaNagabhushan <krupa.nagabhushan@est.tech>
Change-Id: I4d0f91640f6603c5029a88cb902c959bc8522455

catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java
catalog-ui/src/app/view-models/workspace/workspace-view.html

index e11dbb3..aa2ba31 100644 (file)
@@ -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);
index 21cebeb..6a5cd92 100644 (file)
@@ -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()"