add "new view/edit" button in the Instantiation Status page 36/106236/2
authorAlexey Sandler <alexey.sandler@intl.att.com>
Sun, 19 Apr 2020 17:32:42 +0000 (20:32 +0300)
committerAlexey Sandler <alexey.sandler@intl.att.com>
Sun, 19 Apr 2020 17:35:00 +0000 (20:35 +0300)
Issue-ID: VID-805
Signed-off-by: Alexey Sandler <alexey.sandler@intl.att.com>
Change-Id: I2883ce3ddb8e5eb7eb5eb405f9ae2aeb554252bc
Signed-off-by: Alexey Sandler <alexey.sandler@intl.att.com>
features.properties.md
vid-app-common/src/main/java/org/onap/vid/properties/Features.java
vid-webpack-master/cypress/integration/iFrames/instantiationStatus.e2e.ts
vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/flags.cypress.json
vid-webpack-master/src/app/instantiationStatus/instantiationStatus.component.service.ts
vid-webpack-master/src/app/instantiationStatus/instantiationStatus.component.ts
vid-webpack-master/src/app/shared/services/featureFlag/feature-flags.service.ts

index f6075a2..631b592 100644 (file)
   
   When toggled off, the only way to configure VID's value is by manually setting a value in the DB.
   See https://jira.onap.org/browse/VID-801 
+  
+  * FLAG_2006_NEW_VIEW_EDIT_BUTTON_IN_INSTANTIATION_STATUS
+  
+    When flag is true the "New view/edit" button will appear in context menu of chosen service in Instantiation Status window. 
+    The click on that button will open the service instance in drawing board (new screens).
  
  
  
\ No newline at end of file
index 91f787c..3b95700 100644 (file)
@@ -93,6 +93,7 @@ public enum Features implements Feature {
     FLAG_EXP_USE_FORMAT_PARAMETER_FOR_CM_DASHBOARD,
     FLAG_2006_NETWORK_LOB_MULTI_SELECT,
     FLAG_2006_VNF_LOB_MULTI_SELECT,
+    FLAG_2006_NEW_VIEW_EDIT_BUTTON_IN_INSTANTIATION_STATUS,
 
     FLAG_GUILIN_CONFIG_PORTAL_APP_PASSWORD,
 
index cf727b5..56a2491 100644 (file)
@@ -8,6 +8,7 @@ describe('Instantiation status', function () {
   var jsonBuilderInstantiationBuilder : JsonBuilder<AsyncInstantiationModel> = new JsonBuilder<AsyncInstantiationModel>();
   var asyncRes: Array<any>;
   const contextMenuCreateAnotherOne = 'context-menu-create-another-one';
+  const contextMenuNewViewEdit = 'context-menu-new-view-edit';
 
   beforeEach(() => {
       cy.clearSessionStorage();
@@ -133,4 +134,19 @@ describe('Instantiation status', function () {
     });
   });
 
+  it('clicking on new view edit, go to expected url', function () {
+    //see cypress/support/jsonBuilders/mocks/jsons/asyncInstantiation.json id:10
+    const jobId = '850dc7d2-5240-437f-9bcd-b1ed7dc339c1';
+    const serviceModelId = 'e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0';
+    const vidBaseUrl = `${Cypress.config().baseUrl}/serviceModels.htm`;
+    const serviceType = 'TYLER%20SILVIA';
+
+    cy.openIframe('app/ui/#/instantiationStatus');
+    clickOnTitleAndThenOnMenuWithJobId(jobId);
+    cy.get('.dropdown-menu').getElementByDataTestsId(contextMenuNewViewEdit).contains('New View/Edit');
+    cy.get('.dropdown-menu').getElementByDataTestsId(contextMenuNewViewEdit).click();
+    cy.location().should((location) => {
+      expect(location.toString()).to.eq(`${vidBaseUrl}#/servicePlanning/EDIT?serviceModelId=${serviceModelId}&serviceType=${serviceType}&jobId=${jobId}`);
+    });
+  });
 });
index 7c778c8..d60b375 100644 (file)
@@ -26,5 +26,6 @@
   "FLAG_2006_VFM_SDNC_PRELOAD_FILES" : true,
   "FLAG_2006_VFMODULE_TAKES_TENANT_AND_REGION_FROM_VNF": true,
   "FLAG_2006_NETWORK_PLATFORM_MULTI_SELECT" :true,
-  "FLAG_2006_NETWORK_LOB_MULTI_SELECT" : true
+  "FLAG_2006_NETWORK_LOB_MULTI_SELECT" : true,
+  "FLAG_2006_NEW_VIEW_EDIT_BUTTON_IN_INSTANTIATION_STATUS" : true
 }
index 3c45632..a644519 100644 (file)
@@ -189,6 +189,14 @@ export class InstantiationStatusComponentService {
   isRecreateVisible(): boolean {
     return this._featureFlagsService.getFlagState(Features.FLAG_2004_CREATE_ANOTHER_INSTANCE_FROM_TEMPLATE);
   }
+
+  isNewViewEditVisible(): boolean {
+    return this._featureFlagsService.getFlagState(Features.FLAG_2006_NEW_VIEW_EDIT_BUTTON_IN_INSTANTIATION_STATUS);
+  }
+
+  forwardToNewViewEdit(item: ServiceInfoModel): void {
+    this.navigateToNewViewEdit(item, DrawingBoardModes.EDIT);
+  }
 }
 
 
index f27faac..4dccb9e 100644 (file)
@@ -58,6 +58,14 @@ export class InstantiationStatusComponent implements OnInit {
       enabled: (item: ServiceInfoModel) =>  this.isOpenEnabled(item),
       visible: () =>  true,
     },
+    {
+      name: "New View/Edit",
+      dataTestId: "context-menu-new-view-edit",
+      className: "fa-pencil",
+      click: (item: ServiceInfoModel) => this.instantiationStatusComponentService.forwardToNewViewEdit(item),
+      enabled: () => true,
+      visible: () => this.instantiationStatusComponentService.isNewViewEditVisible(),
+    },
     {
       name: "Create another one",
       dataTestId: "context-menu-create-another-one",
index 78a2b1e..2a867ee 100644 (file)
@@ -21,6 +21,7 @@ export enum Features {
   FLAG_2006_USER_PERMISSIONS_BY_OWNING_ENTITY= 'FLAG_2006_USER_PERMISSIONS_BY_OWNING_ENTITY',
   FLAG_2006_VFMODULE_TAKES_TENANT_AND_REGION_FROM_VNF = 'FLAG_2006_VFMODULE_TAKES_TENANT_AND_REGION_FROM_VNF',
   FLAG_2006_VNF_LOB_MULTI_SELECT= 'FLAG_2006_VNF_LOB_MULTI_SELECT',
+  FLAG_2006_NEW_VIEW_EDIT_BUTTON_IN_INSTANTIATION_STATUS= 'FLAG_2006_NEW_VIEW_EDIT_BUTTON_IN_INSTANTIATION_STATUS',
 
 }