diff options
author | miriame <miriam.eini@amdocs.com> | 2018-01-02 15:35:55 +0200 |
---|---|---|
committer | Avi Gaffa <avi.gaffa@amdocs.com> | 2018-01-03 06:53:22 +0000 |
commit | d411d156ac1960f059eb94ec5d7da8fa1a9edb86 (patch) | |
tree | 84bf021cfd81d8a61feda7839267ef2257cf011f /openecomp-ui/src/sdc-app/onboarding/onboard/OnboardActionHelper.js | |
parent | 9d79007d2b36d5ae4a03581eeca1fcf6232b3b09 (diff) |
select item from workspace- skipping versions page
Change-Id: Iebd3bb33703c2d47265ba133f7b74ec961ba8b2f
Issue-ID: SDC-864
Signed-off-by: miriame <miriam.eini@amdocs.com>
Diffstat (limited to 'openecomp-ui/src/sdc-app/onboarding/onboard/OnboardActionHelper.js')
-rw-r--r-- | openecomp-ui/src/sdc-app/onboarding/onboard/OnboardActionHelper.js | 66 |
1 files changed, 65 insertions, 1 deletions
diff --git a/openecomp-ui/src/sdc-app/onboarding/onboard/OnboardActionHelper.js b/openecomp-ui/src/sdc-app/onboarding/onboard/OnboardActionHelper.js index 6ebb40878f..892056855f 100644 --- a/openecomp-ui/src/sdc-app/onboarding/onboard/OnboardActionHelper.js +++ b/openecomp-ui/src/sdc-app/onboarding/onboard/OnboardActionHelper.js @@ -13,7 +13,13 @@ * or implied. See the License for the specific language governing * permissions and limitations under the License. */ -import {actionTypes} from './OnboardConstants.js'; +import {tabsMapping, actionTypes} from './OnboardConstants.js'; +import ScreensHelper from 'sdc-app/common/helpers/ScreensHelper.js'; +import {enums, screenTypes} from 'sdc-app/onboarding/OnboardingConstants.js'; +import VersionsPageActionHelper from 'sdc-app/onboarding/versionsPage/VersionsPageActionHelper.js'; +import {catalogItemStatuses} from 'sdc-app/onboarding/onboard/onboardingCatalog/OnboardingCatalogConstants.js'; +import {itemTypes} from 'sdc-app/onboarding/versionsPage/VersionsPageConstants.js'; +import PermissionsActionHelper from 'sdc-app/onboarding/permissions/PermissionsActionHelper.js'; const OnboardActionHelper = { resetOnboardStore(dispatch) { @@ -39,6 +45,64 @@ const OnboardActionHelper = { type: actionTypes.CHANGE_SEARCH_VALUE, searchValue: '' }); + }, + + loadVLMScreen(dispatch, {id: licenseModelId, name}, users, tab) { + if (tab === tabsMapping.WORKSPACE) { + VersionsPageActionHelper.fetchVersions(dispatch, {itemId: licenseModelId, itemType: itemTypes.LICENSE_MODEL}).then(({results})=> { + results = results.filter((version) => version.status === catalogItemStatuses.DRAFT); + if (results.length !== 1) { + ScreensHelper.loadScreen(dispatch, { + screen: enums.SCREEN.VERSIONS_PAGE, screenType: screenTypes.LICENSE_MODEL, + props: {licenseModelId, licenseModel: {name}, usersList: users} + }); + } + else { + PermissionsActionHelper.fetchItemUsers(dispatch, {itemId: licenseModelId, allUsers: users}).then(() => + ScreensHelper.loadLandingScreen(dispatch, {screenType: screenTypes.LICENSE_MODEL, props: {licenseModelId, version: results[0]}}) + ); + } + }); + } + if (tab === tabsMapping.CATALOG) { + ScreensHelper.loadScreen(dispatch, { + screen: enums.SCREEN.VERSIONS_PAGE, screenType: screenTypes.LICENSE_MODEL, + props: {licenseModelId, licenseModel: {name}, usersList: users} + }); + } + }, + loadVSPScreen(dispatch, softwareProduct, users, tab) { + let {id: softwareProductId, vendorId: licenseModelId, licensingVersion, name} = softwareProduct; + if (tab === tabsMapping.WORKSPACE) { + VersionsPageActionHelper.fetchVersions(dispatch,{itemId: softwareProductId, itemType: itemTypes.SOFTWARE_PRODUCT}).then(({results})=> { + results = results.filter((version) => version.status === catalogItemStatuses.DRAFT); + if (results.length !== 1) { + ScreensHelper.loadScreen(dispatch, { + screen: enums.SCREEN.SOFTWARE_PRODUCT_VERSIONS_PAGE, screenType: screenTypes.SOFTWARE_PRODUCT, + props: { + softwareProductId, + softwareProduct: {name, vendorId: licenseModelId, licensingVersion}, + usersList: users + } + }); + } + else { + PermissionsActionHelper.fetchItemUsers(dispatch, {itemId: softwareProductId, allUsers: users}).then(() => + ScreensHelper.loadLandingScreen(dispatch, {screenType: screenTypes.SOFTWARE_PRODUCT, props: {softwareProductId, licenseModelId, version: results[0]}}) + ); + } + }); + } + if (tab === tabsMapping.CATALOG) { + ScreensHelper.loadScreen(dispatch, { + screen: enums.SCREEN.SOFTWARE_PRODUCT_VERSIONS_PAGE, screenType: screenTypes.SOFTWARE_PRODUCT, + props: { + softwareProductId, + softwareProduct: {name, vendorId: licenseModelId, licensingVersion}, + usersList: users + } + }); + } } }; |