summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--LICENSE11
-rw-r--r--LICENSE.TXT24
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/properties/FeatureSetsManager.kt82
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/properties/Features.java2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/properties/FeaturesTogglingConfiguration.java13
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/controller/creationDialogController.js7
-rw-r--r--vid-app-common/src/test/java/org/onap/vid/properties/FeatureSetsManagerTest.kt101
-rw-r--r--vid-app-common/src/test/resources/example.features.properties1
-rw-r--r--vid-automation/src/main/java/vid/automation/test/infra/Features.java1
-rw-r--r--vid-automation/src/main/java/vid/automation/test/sections/deploy/DeployModernUIBase.java4
-rw-r--r--vid-automation/src/main/java/vid/automation/test/test/BrowseASDCTest.java21
-rw-r--r--vid-webpack-master/cypress/integration/iFrames/browse-sdc.e2e.ts39
-rw-r--r--vid-webpack-master/cypress/integration/iFrames/service.popup.e2e.ts7
-rw-r--r--vid-webpack-master/cypress/support/jsonBuilders/mocks/aai.mock.ts15
-rw-r--r--vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/aaiGetModelsByServiceType.json58
-rw-r--r--vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/flags.cypress.json1
-rw-r--r--vid-webpack-master/src/app/shared/components/genericFormPopup/generic-form-popup.component.html6
-rw-r--r--vid-webpack-master/src/app/shared/components/genericFormPopup/generic-form-popup.component.ts2
-rw-r--r--vid-webpack-master/src/app/shared/services/featureFlag/feature-flags.service.ts1
19 files changed, 320 insertions, 76 deletions
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 000000000..2dbc8910c
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,11 @@
+Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License. \ No newline at end of file
diff --git a/LICENSE.TXT b/LICENSE.TXT
deleted file mode 100644
index f79fe7eb0..000000000
--- a/LICENSE.TXT
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * ============LICENSE_START==========================================
- * ===================================================================
- * Copyright © 2018 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END============================================
- *
- *
- */
-
-For the file /epsdk-app-onap/src/main/webapp/app/fusion/external/ebz/angular_js/angular-sanitize.js,
-to the extent that it contains code originating from Erik Arvidsson, that code is used under the Apache-2.0 license,
-as permitted by http://erik.eae.net/simplehtmlparser/simplehtmlparser.js. \ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/onap/vid/properties/FeatureSetsManager.kt b/vid-app-common/src/main/java/org/onap/vid/properties/FeatureSetsManager.kt
new file mode 100644
index 000000000..207bde7aa
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/properties/FeatureSetsManager.kt
@@ -0,0 +1,82 @@
+package org.onap.vid.properties
+
+import org.apache.commons.io.filefilter.WildcardFileFilter
+import org.springframework.web.context.request.RequestContextHolder.getRequestAttributes
+import org.springframework.web.context.request.ServletRequestAttributes
+import org.togglz.core.Feature
+import org.togglz.core.manager.FeatureManager
+import org.togglz.core.manager.FeatureManagerBuilder
+import org.togglz.core.repository.file.FileBasedStateRepository
+import java.io.File
+import java.io.FilenameFilter
+import javax.servlet.ServletContext
+import javax.servlet.http.HttpServletRequest
+
+
+private const val SLOW_RELOAD = 60_000
+private const val COOKIE_NAME = "features.set"
+
+class FeatureSetsManager(
+ private val defaultManager: FeatureManager,
+ private val nameProvider: AlternativeFeatureSetNameProvider,
+ private val servletContext: ServletContext
+) : FeatureManager by defaultManager {
+
+ override fun isActive(feature: Feature?): Boolean {
+ return resolvedFeatureManager().isActive(feature)
+ }
+
+ private fun resolvedFeatureManager(): FeatureManager {
+ return when (val alternativeFeatureSetName = nameProvider.alternativeFeatureSetName) {
+ null -> defaultManager
+ else -> allFeatureManagers.getValue(alternativeFeatureSetName)
+ }
+ }
+
+ internal val allFeatureManagers: Map<String, FeatureManager> by lazy {
+ allFeatureSetFiles().associateBy(
+ { it.name },
+ { newFeatureManager(it) }
+ ).withDefault { allFeaturesOff }
+ }
+
+ private val allFeaturesOff =
+ FeatureManagerBuilder().featureEnum(Features::class.java).build()
+
+ private fun newFeatureManager(file: File): FeatureManager {
+ return FeatureManagerBuilder()
+ .featureEnum(Features::class.java)
+ .stateRepository(FileBasedStateRepository(file, SLOW_RELOAD))
+ .build()
+ }
+
+ private fun allFeatureSetFiles(): Array<File> {
+ val dir = File(servletContext.getRealPath("/WEB-INF/conf/"))
+ val fileFilter: FilenameFilter = WildcardFileFilter("*.features.properties")
+
+ return dir.listFiles(fileFilter) ?: emptyArray()
+ }
+}
+
+interface AlternativeFeatureSetNameProvider {
+ val alternativeFeatureSetName: String?
+}
+
+class AlternativeFeatureSetNameFromCookie: AlternativeFeatureSetNameProvider {
+ override val alternativeFeatureSetName: String?
+ get() = valueFromCookie(currentHttpRequest())
+
+ internal fun valueFromCookie(httpServletRequest: HttpServletRequest?): String? {
+ return httpServletRequest
+ ?.cookies
+ ?.firstOrNull { it.name == COOKIE_NAME }
+ ?.value
+ }
+
+ internal fun currentHttpRequest(): HttpServletRequest? {
+ return when (val requestAttributes = getRequestAttributes()) {
+ is ServletRequestAttributes -> requestAttributes.request
+ else -> null
+ }
+ }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/properties/Features.java b/vid-app-common/src/main/java/org/onap/vid/properties/Features.java
index a42110337..8a944a9ab 100644
--- a/vid-app-common/src/main/java/org/onap/vid/properties/Features.java
+++ b/vid-app-common/src/main/java/org/onap/vid/properties/Features.java
@@ -81,9 +81,9 @@ public enum Features implements Feature {
FLAG_2002_IDENTIFY_INVARIANT_MACRO_UUID_BY_BACKEND,
FLAG_2004_INSTANTIATION_STATUS_FILTER,
FLAG_2004_CREATE_ANOTHER_INSTANCE_FROM_TEMPLATE,
- FLAG_2004_TEMP_BUTTON_TO_INSTANTIATION_STATUS_FILTER,
FLAG_2004_INSTANTIATION_TEMPLATES_POPUP,
FLAG_2002_UNLIMITED_MAX,
+
;
diff --git a/vid-app-common/src/main/java/org/onap/vid/properties/FeaturesTogglingConfiguration.java b/vid-app-common/src/main/java/org/onap/vid/properties/FeaturesTogglingConfiguration.java
index 4d4387d4e..96331b7c4 100644
--- a/vid-app-common/src/main/java/org/onap/vid/properties/FeaturesTogglingConfiguration.java
+++ b/vid-app-common/src/main/java/org/onap/vid/properties/FeaturesTogglingConfiguration.java
@@ -20,6 +20,8 @@
package org.onap.vid.properties;
+import java.io.File;
+import javax.servlet.ServletContext;
import org.apache.commons.lang3.StringUtils;
import org.springframework.context.ApplicationListener;
import org.springframework.context.annotation.Bean;
@@ -30,9 +32,6 @@ import org.togglz.core.manager.FeatureManagerBuilder;
import org.togglz.core.repository.file.FileBasedStateRepository;
import org.togglz.spring.listener.TogglzApplicationContextBinderApplicationListener;
-import javax.servlet.ServletContext;
-import java.io.File;
-
@Configuration
public class FeaturesTogglingConfiguration {
@Bean
@@ -52,11 +51,13 @@ public class FeaturesTogglingConfiguration {
filename = StringUtils.trimToNull(filename);
- return new FeatureManagerBuilder()
+ return new FeatureSetsManager(
+ new FeatureManagerBuilder()
.featureEnum(Features.class)
.stateRepository(new FileBasedStateRepository(
- new File(filename.startsWith("/")? filename : servletContext.getRealPath("/WEB-INF/conf/" + filename))
+ new File(filename.startsWith("/") ? filename : servletContext.getRealPath("/WEB-INF/conf/" + filename))
))
- .build();
+ .build(), new AlternativeFeatureSetNameFromCookie(), servletContext
+ );
}
}
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/creationDialogController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/creationDialogController.js
index 7b6d4af6c..a6f6cc69d 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/creationDialogController.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/creationDialogController.js
@@ -93,11 +93,14 @@ var creationDialogController = function (COMPONENT, FIELD, PARAMETER, $scope, $h
if (!$scope.shouldShowOldPopup()) {
+ let modelNameVersionId = request.modelNameVersionId ?
+ request.modelNameVersionId :
+ (DataService.getModelInfo(COMPONENT.SERVICE) ? DataService.getModelInfo(COMPONENT.SERVICE).modelNameVersionId : "");
if(DataService.getIsInstantiationTemplateExists()){
- $scope.url = COMPONENT.INSTANTIATION_TEMPLATES_IFRAME_URL + request.modelNameVersionId;
+ $scope.url = COMPONENT.INSTANTIATION_TEMPLATES_IFRAME_URL + modelNameVersionId;
window.addEventListener("message", receiveMessage, false);
}else {
- $scope.url = COMPONENT.SERVICE_POPUP_IFRAME_URL + request.modelNameVersionId + "&isCreate=true&r=" + Math.random();
+ $scope.url = COMPONENT.SERVICE_POPUP_IFRAME_URL + modelNameVersionId + "&isCreate=true&r=" + Math.random();
window.addEventListener("message", receiveMessage, false);
}
}
diff --git a/vid-app-common/src/test/java/org/onap/vid/properties/FeatureSetsManagerTest.kt b/vid-app-common/src/test/java/org/onap/vid/properties/FeatureSetsManagerTest.kt
new file mode 100644
index 000000000..9cf7aa662
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/properties/FeatureSetsManagerTest.kt
@@ -0,0 +1,101 @@
+package org.onap.vid.properties
+
+import org.hamcrest.CoreMatchers.*
+import org.hamcrest.MatcherAssert.assertThat
+import org.mockito.ArgumentMatchers.anyString
+import org.mockito.InjectMocks
+import org.mockito.Mock
+import org.mockito.Mockito.*
+import org.onap.vid.testUtils.TestUtils
+import org.springframework.web.context.request.RequestContextHolder
+import org.testng.annotations.BeforeMethod
+import org.testng.annotations.Test
+import org.togglz.core.manager.FeatureManager
+import javax.servlet.ServletContext
+import javax.servlet.http.Cookie
+import javax.servlet.http.HttpServletRequest
+import org.hamcrest.CoreMatchers.`is` as _is
+import org.mockito.Mockito.`when` as _when
+
+class FeatureSetsManagerTest {
+ @Mock
+ lateinit var defaultFeatureManager: FeatureManager
+ @Mock
+ lateinit var servletContext: ServletContext
+ @Mock
+ lateinit var alternativeFeatureSetNameProvider: AlternativeFeatureSetNameProvider
+ @InjectMocks
+ lateinit var featureSetsManager: FeatureSetsManager
+
+ private val alternativeFeatureSetNameFromCookie = AlternativeFeatureSetNameFromCookie()
+
+ @BeforeMethod
+ fun setUp() {
+ TestUtils.initMockitoMocks(this)
+ }
+
+ @Test
+ fun `isActive - without alternative features set name - delegates to default and no file loaded`() {
+ _when(defaultFeatureManager.isActive(Features.FLAG_1810_AAI_LOCAL_CACHE)).thenReturn(true)
+ _when(alternativeFeatureSetNameProvider.alternativeFeatureSetName).thenReturn(null)
+
+ assertThat(featureSetsManager.isActive(Features.FLAG_1810_AAI_LOCAL_CACHE), _is(true))
+
+ verifyZeroInteractions(servletContext) // implies no other file loaded
+ verify(defaultFeatureManager, times(1)).isActive(Features.FLAG_1810_AAI_LOCAL_CACHE)
+ }
+
+ @Test
+ fun `isActive - with alternative features set - brings flags from alternative`() {
+ _when(servletContext.getRealPath(anyString())).thenReturn(this.javaClass.getResource("/").path)
+ _when(alternativeFeatureSetNameProvider.alternativeFeatureSetName).thenReturn("example.features.properties")
+
+ assertThat(featureSetsManager.isActive(Features.FLAG_1810_AAI_LOCAL_CACHE), _is(true))
+ assertThat(featureSetsManager.isActive(Features.FLAG_1902_NEW_VIEW_EDIT), _is(false))
+ verifyZeroInteractions(defaultFeatureManager)
+ }
+
+ @Test
+ fun `isActive - with non-existing alternative features set - fallback is to all flags off`() {
+ _when(servletContext.getRealPath(anyString())).thenReturn(this.javaClass.getResource("/").path)
+ _when(alternativeFeatureSetNameProvider.alternativeFeatureSetName).thenReturn("non-existing")
+
+ assertThat(featureSetsManager, not(nullValue()))
+ assertThat(
+ featureSetsManager.features.map { featureSetsManager.isActive(it) },
+ not(hasItem(true))
+ )
+ }
+
+ @Test
+ fun `valueFromCookie - given no request - return null`() {
+ assertThat(alternativeFeatureSetNameFromCookie.valueFromCookie(null), _is(nullValue()))
+ }
+
+ @Test
+ fun `valueFromCookie - given request - return the correct cookie value`() {
+ val servletRequestMock = mock(HttpServletRequest::class.java)
+ _when(servletRequestMock.cookies).thenReturn(arrayOf(Cookie("features.set", "value")))
+
+ assertThat(alternativeFeatureSetNameFromCookie.valueFromCookie(servletRequestMock), _is("value"))
+ }
+
+ @Test
+ fun `valueFromCookie - given request without cookies - return null`() {
+ val servletRequestMock = mock(HttpServletRequest::class.java)
+ _when(servletRequestMock.cookies).thenReturn(emptyArray())
+
+ assertThat(alternativeFeatureSetNameFromCookie.valueFromCookie(servletRequestMock), _is(nullValue()))
+ }
+
+ @Test
+ fun `currentHttpRequest - when no current request - return null`() {
+ assertPrecondition()
+ assertThat(alternativeFeatureSetNameFromCookie.currentHttpRequest(), _is(nullValue()))
+ }
+
+ private fun assertPrecondition() {
+ assertThat("precondition for test not met: static RequestContextHolder.getRequestAttributes should be null",
+ RequestContextHolder.getRequestAttributes(), _is(nullValue()))
+ }
+}
diff --git a/vid-app-common/src/test/resources/example.features.properties b/vid-app-common/src/test/resources/example.features.properties
new file mode 100644
index 000000000..e8ac3eb65
--- /dev/null
+++ b/vid-app-common/src/test/resources/example.features.properties
@@ -0,0 +1 @@
+FLAG_1810_AAI_LOCAL_CACHE=true \ No newline at end of file
diff --git a/vid-automation/src/main/java/vid/automation/test/infra/Features.java b/vid-automation/src/main/java/vid/automation/test/infra/Features.java
index 9f132e8ab..6be6870c2 100644
--- a/vid-automation/src/main/java/vid/automation/test/infra/Features.java
+++ b/vid-automation/src/main/java/vid/automation/test/infra/Features.java
@@ -55,7 +55,6 @@ public enum Features implements Feature {
FLAG_2002_VFM_UPGRADE_ADDITIONAL_OPTIONS,
FLAG_2002_IDENTIFY_INVARIANT_MACRO_UUID_BY_BACKEND,
FLAG_2004_CREATE_ANOTHER_INSTANCE_FROM_TEMPLATE,
- FLAG_2004_TEMP_BUTTON_TO_INSTANTIATION_STATUS_FILTER,
FLAG_2002_UNLIMITED_MAX,
;
diff --git a/vid-automation/src/main/java/vid/automation/test/sections/deploy/DeployModernUIBase.java b/vid-automation/src/main/java/vid/automation/test/sections/deploy/DeployModernUIBase.java
index acddc1b11..0b8122cb6 100644
--- a/vid-automation/src/main/java/vid/automation/test/sections/deploy/DeployModernUIBase.java
+++ b/vid-automation/src/main/java/vid/automation/test/sections/deploy/DeployModernUIBase.java
@@ -53,8 +53,4 @@ public abstract class DeployModernUIBase extends DeployDialogBase {
GeneralUIUtils.clickOnElementByTestId(Constants.OwningEntity.PROJECT_SELECT_TEST_ID);
}
- public void clickPreviousInstantiationButton() {
- GeneralUIUtils.clickOnElementByTestIdWithoutWait("ShowPreviousInstancesButton");
- }
-
}
diff --git a/vid-automation/src/main/java/vid/automation/test/test/BrowseASDCTest.java b/vid-automation/src/main/java/vid/automation/test/test/BrowseASDCTest.java
index f6b883ac1..84dbf11a1 100644
--- a/vid-automation/src/main/java/vid/automation/test/test/BrowseASDCTest.java
+++ b/vid-automation/src/main/java/vid/automation/test/test/BrowseASDCTest.java
@@ -6,7 +6,6 @@ import static org.testng.Assert.assertFalse;
import static vid.automation.test.infra.Features.FLAG_1908_COLLECTION_RESOURCE_NEW_INSTANTIATION_UI;
import static vid.automation.test.infra.Features.FLAG_2002_ANY_ALACARTE_BESIDES_EXCLUDED_NEW_INSTANTIATION_UI;
import static vid.automation.test.infra.Features.FLAG_2002_IDENTIFY_INVARIANT_MACRO_UUID_BY_BACKEND;
-import static vid.automation.test.infra.Features.FLAG_2004_TEMP_BUTTON_TO_INSTANTIATION_STATUS_FILTER;
import static vid.automation.test.infra.Features.FLAG_5G_IN_NEW_INSTANTIATION_UI;
import static vid.automation.test.infra.Features.FLAG_NETWORK_TO_ASYNC_INSTANTIATION;
import static vid.automation.test.infra.Features.FLAG_SHOW_ORCHESTRATION_TYPE;
@@ -338,26 +337,6 @@ public class BrowseASDCTest extends CreateInstanceDialogBaseTest {
return deployMacroDialog;
}
- @Test
- @FeatureTogglingTest(FLAG_2004_TEMP_BUTTON_TO_INSTANTIATION_STATUS_FILTER)
- public void testClickPreviousInstantiationsInCreationDialog() {
- try {
- String serviceId = "2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd";
- DeployModernUIMacroDialog deployMacroDialog = getDeployModernUIMacroDialog(serviceId);
- deployMacroDialog.clickPreviousInstantiationButton();
-
- //exit form deploy dialog
- goOutFromIframe();
- //go into Instantiation Status page
- goToIframe();
-
- InstantiationStatusPage.verifyInstantiationStatusFilterValue(serviceId);
- }
- finally {
- goOutFromIframe();
- }
- }
-
private BrowseASDCPage registerSimulatorAndGoToBrowseSDC() {
SimulatorApi.registerExpectation(SimulatorApi.RegistrationStrategy.CLEAR_THEN_SET,
"ecompportal_getSessionSlotCheckInterval.json",
diff --git a/vid-webpack-master/cypress/integration/iFrames/browse-sdc.e2e.ts b/vid-webpack-master/cypress/integration/iFrames/browse-sdc.e2e.ts
index a71d9424e..b1671a4e5 100644
--- a/vid-webpack-master/cypress/integration/iFrames/browse-sdc.e2e.ts
+++ b/vid-webpack-master/cypress/integration/iFrames/browse-sdc.e2e.ts
@@ -98,6 +98,45 @@ describe('Browse SDC', function () {
});
});
+ it(`browse sdc open create new service instance flow`, function () {
+ const MACRO_FOR_NEW_FLOW_ID: string = '745d1bf1-9ed1-413f-8111-f1e984ad63fb';
+
+ cy.initGetAAISubDetails();
+
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/aaiGetModelsByServiceType.json').then((res) => {
+ jsonBuilderAndMock.basicJson(res,
+ Cypress.config('baseUrl') + '/aai_get_models_by_service_type/**',
+ 200,
+ 0,
+ 'aaiGetModelByServiceType');
+ });
+
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/bug616888/Dror_service1806_Macro1.json').then((res) => {
+ jsonBuilderAndMock.basicJson(res,
+ Cypress.config('baseUrl') + '/rest/models/services/' + MACRO_FOR_NEW_FLOW_ID,
+ 200,
+ 0,
+ 'MACRO_FOR_NEW_FLOW');
+ });
+
+ cy.get('span').contains('Create New Service Instance').click({force: true})
+ .selectDropdownOptionByText('subscriberName', 'SILVIA ROBBINS');
+ cy.get('button').contains('Submit').click({force: true});
+ cy.selectDropdownOptionByText('serviceType', 'TYLER SILVIA');
+ cy.get('button').contains('Submit').click({force: true});
+ cy.wait("@aaiGetModelByServiceType").then(() => {
+ cy.getElementByDataTestsId('deploy-' + MACRO_FOR_NEW_FLOW_ID).click({force: true});
+ cy.get('button').contains('Deploy').eq(0).click({force: true});
+ cy.get('iframe').then(function ($iframe) {
+ expect($iframe.attr('src')).to.contain(`app/ui/#/servicePopup?serviceModelId=74fa72dd-012b-49c3-800d-06b12bcaf1a0`);
+ });
+ });
+
+ cy.visit("welcome.htm"); //relaod page to not break the following tests
+
+ });
+
+
it(`browse sdc of service without instantiationType open aLaCarte popup`, function () {
const VERY_OLD_SERVICE_UUID: string = "09c476c7-91ae-44b8-a731-04d8d8fa3695";
const TEST_MOCKS_PATH = "cypress/support/jsonBuilders/mocks/jsons/bug_aLaCarteServiceWrongPopup/";
diff --git a/vid-webpack-master/cypress/integration/iFrames/service.popup.e2e.ts b/vid-webpack-master/cypress/integration/iFrames/service.popup.e2e.ts
index de29313a3..06f5a23b5 100644
--- a/vid-webpack-master/cypress/integration/iFrames/service.popup.e2e.ts
+++ b/vid-webpack-master/cypress/integration/iFrames/service.popup.e2e.ts
@@ -95,13 +95,6 @@ describe('Service popup', function () {
});
});
- it('when open service popup should show showPrevious button', () => {
- cy.openPopupIframe('/app/ui/#/servicePopup?serviceModelId=2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd&isCreate=true');
- cy.getElementByDataTestsId('ShowPreviousInstancesButton').contains('Previous Instantiation').click();
-
- })
-
-
});
});
diff --git a/vid-webpack-master/cypress/support/jsonBuilders/mocks/aai.mock.ts b/vid-webpack-master/cypress/support/jsonBuilders/mocks/aai.mock.ts
index ae60361c2..807a3bcda 100644
--- a/vid-webpack-master/cypress/support/jsonBuilders/mocks/aai.mock.ts
+++ b/vid-webpack-master/cypress/support/jsonBuilders/mocks/aai.mock.ts
@@ -9,6 +9,7 @@ declare namespace Cypress {
initActiveVPNs : typeof initActiveVPNs;
initGetAAISubDetails : typeof initGetAAISubDetails;
initAAIServices: typeof initAAIServices;
+ initGetModelByServiceType: typeof initGetModelByServiceType;
}
}
@@ -48,6 +49,19 @@ function initGetAAISubDetails(response? : JSON) : void {
});
}
+function initGetModelByServiceType(response? : JSON) : void {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/aaiSubDetails.json').then((res) => {
+ cy.server()
+ .route({
+ method: 'GET',
+ status: 200,
+ url: Cypress.config('baseUrl') + "/aai_get_models_by_service_type/**",
+ response: response ? response : res
+ }).as('aai-sub-details')
+ });
+}
+
+
function initAlaCarteService(response? : JSON) : void {
cy.readFile('cypress/support/jsonBuilders/mocks/jsons/a-la-carteService.json').then((res) => {
cy.server()
@@ -156,6 +170,7 @@ Cypress.Commands.add('initSearchVNFMemebers', initSearchVNFMemebers);
Cypress.Commands.add('initActiveNetworks', initActiveNetworks);
Cypress.Commands.add('initActiveVPNs', initActiveVPNs);
Cypress.Commands.add('initAAIServices', initAAIServices);
+Cypress.Commands.add('initGetModelByServiceType', initGetModelByServiceType);
diff --git a/vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/aaiGetModelsByServiceType.json b/vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/aaiGetModelsByServiceType.json
new file mode 100644
index 000000000..2540650ce
--- /dev/null
+++ b/vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/aaiGetModelsByServiceType.json
@@ -0,0 +1,58 @@
+{
+ "inventory-response-item": [
+ {
+ "service-subscription": {
+ "service-type": "TYLER SILVIA",
+ "resource-version": "1494001841964"
+ },
+ "extra-properties": {},
+ "inventory-response-items": {
+ "inventory-response-item":[
+ {
+ "model-name": "RG_11-18_vccf_srvc",
+ "service-instance": {
+ "service-instance-id": "b9769e8f-70aa-4b05-8988-64044aa63498",
+ "service-instance-name": "TestCharlie",
+ "model-invariant-id": "4af418a9-c2f5-4fae-a577-b69d6341eee8",
+ "model-version-id": "745d1bf1-9ed1-413f-8111-f1e984ad63fb",
+ "resource-version": "1494002070115"
+ },
+ "extra-properties": {
+ "extra-property": [
+ {
+ "property-name": "model-ver.model-description",
+ "property-value": "Service for vccf"
+ },
+ {
+ "property-name": "model-ver.model-version-id",
+ "property-value": "745d1bf1-9ed1-413f-8111-f1e984ad63fb"
+ },
+ {
+ "property-name": "model-ver.model-name",
+ "property-value": "RG_11-18_vccf_srvc"
+ },
+ {
+ "property-name": "model.model-type",
+ "property-value": "service"
+ },
+ {
+ "property-name": "model.model-invariant-id",
+ "property-value": "4af418a9-c2f5-4fae-a577-b69d6341eee8"
+ },
+ {
+ "property-name": "model.model-description"
+ },
+ {
+ "property-name": "model-ver.model-version",
+ "property-value": "1.0"
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ ]
+}
+
+
diff --git a/vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/flags.cypress.json b/vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/flags.cypress.json
index 531bad3b4..c7740207c 100644
--- a/vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/flags.cypress.json
+++ b/vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/flags.cypress.json
@@ -19,7 +19,6 @@
"FLAG_1911_INSTANTIATION_ORDER_BUTTON_IN_ASYNC_ALACARTE": false,
"FLAG_2002_VNF_PLATFORM_MULTI_SELECT" : true,
"FLAG_2002_VFM_UPGRADE_ADDITIONAL_OPTIONS": true,
- "FLAG_2004_TEMP_BUTTON_TO_INSTANTIATION_STATUS_FILTER": true,
"FLAG_2004_INSTANTIATION_STATUS_FILTER": true,
"FLAG_2004_INSTANTIATION_TEMPLATES_POPUP" : false,
"FLAG_2002_UNLIMITED_MAX" : true,
diff --git a/vid-webpack-master/src/app/shared/components/genericFormPopup/generic-form-popup.component.html b/vid-webpack-master/src/app/shared/components/genericFormPopup/generic-form-popup.component.html
index 6bb1ff156..031357403 100644
--- a/vid-webpack-master/src/app/shared/components/genericFormPopup/generic-form-popup.component.html
+++ b/vid-webpack-master/src/app/shared/components/genericFormPopup/generic-form-popup.component.html
@@ -61,12 +61,6 @@
(click)="openTemplateModal()"
><span>Template</span></button>
<button
- *ngIf="isShowPreviousInstantiationBtn"
- [attr.data-tests-id]="'ShowPreviousInstancesButton'"
- type="button" class="btn btn-success submit"
- (click)="formPopupDetails.onOtherAction(formPopupDetails.that, dynamicForm)"
- ><span>Previous Instantiation</span></button>
- <button
[attr.data-tests-id]="'cancelButton'"
type="button" class="btn btn-default cancel"
(click)="formPopupDetails.onCancel(formPopupDetails.that, dynamicForm); clearModalIsUpdateMode()"
diff --git a/vid-webpack-master/src/app/shared/components/genericFormPopup/generic-form-popup.component.ts b/vid-webpack-master/src/app/shared/components/genericFormPopup/generic-form-popup.component.ts
index 19ea9b9ee..7368dd698 100644
--- a/vid-webpack-master/src/app/shared/components/genericFormPopup/generic-form-popup.component.ts
+++ b/vid-webpack-master/src/app/shared/components/genericFormPopup/generic-form-popup.component.ts
@@ -47,7 +47,6 @@ export class GenericFormPopupComponent extends DialogComponent<PopupModel, boole
type: PopupType;
uuidData: UUIDData;
showTemplateBtn: boolean = false;
- isShowPreviousInstantiationBtn: boolean = false;
isUpdateMode: boolean;
node: ITreeNode = null;
hasGeneralApiError: boolean = false;
@@ -118,7 +117,6 @@ export class GenericFormPopupComponent extends DialogComponent<PopupModel, boole
};
this.showTemplateBtn = this._genericFormPopupService.shouldShowTemplateBtn(isInstantiationTemplateExists);
- this.isShowPreviousInstantiationBtn = !!this._store.getState().global.flags["FLAG_2004_TEMP_BUTTON_TO_INSTANTIATION_STATUS_FILTER"];
this.uuidData.popupService.closeDialogEvent.subscribe((that) => {
this.closeDialog(that);
diff --git a/vid-webpack-master/src/app/shared/services/featureFlag/feature-flags.service.ts b/vid-webpack-master/src/app/shared/services/featureFlag/feature-flags.service.ts
index cccade887..54fdc0cd9 100644
--- a/vid-webpack-master/src/app/shared/services/featureFlag/feature-flags.service.ts
+++ b/vid-webpack-master/src/app/shared/services/featureFlag/feature-flags.service.ts
@@ -15,7 +15,6 @@ export enum Features {
FLAG_2002_VFM_UPGRADE_ADDITIONAL_OPTIONS ='FLAG_2002_VFM_UPGRADE_ADDITIONAL_OPTIONS',
FLAG_2004_INSTANTIATION_STATUS_FILTER ='FLAG_2004_INSTANTIATION_STATUS_FILTER',
FLAG_2004_CREATE_ANOTHER_INSTANCE_FROM_TEMPLATE = 'FLAG_2004_CREATE_ANOTHER_INSTANCE_FROM_TEMPLATE',
- FLAG_2004_TEMP_BUTTON_TO_INSTANTIATION_STATUS_FILTER ='FLAG_2004_TEMP_BUTTON_TO_INSTANTIATION_STATUS_FILTER',
FLAG_2004_INSTANTIATION_TEMPLATES_POPUP = 'FLAG_2004_INSTANTIATION_TEMPLATES_POPUP'
}