diff options
Diffstat (limited to 'vid-app-common/src/main/webapp/app')
4 files changed, 340 insertions, 218 deletions
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/constants/componentConstants.js b/vid-app-common/src/main/webapp/app/vid/scripts/constants/componentConstants.js index 077a78405..8ee2d062c 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/constants/componentConstants.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/constants/componentConstants.js @@ -21,239 +21,242 @@ "use strict"; appDS2 - .constant("_", window._) - .constant("COMPONENT", (function() { - return { - A_LA_CARTE : "a la carte", - CLOUD_REGION_ID : "cloudRegionID", - CLOUD_OWNER : "cloudOwner", - COMPONENT_STATUS : "ComponentStatus", - CREATE_COMPONENT : "createComponent", - IFRAME_DIALOG : "iframeDialog", - DELETE_RESUME_COMPONENT : "deleteResumeComponent", - DELETE:"Delete", - RESUME:"Resume", - ENTITY : "entity", - GET_COMPONENT_LIST : "getComponentList", - GET_SUBS : "getSubs", - GET_SUB_DETAILS : "getSubDetails", - GLOBAL_CUSTOMER_ID : "globalCustomerId", - MACRO : "Macro", - MODEL_NAME_IISBC : "Intercarrier Interconnect Session Border Controller", - MODEL_NAME_VISBCOAMNETWORK : "vIsbcOamNetwork", - MODEL_NAME_VISBCRTPEXPANSIONMODULE : "vIsbcRtpExpansionModule", - MODEL_NAME_VISBC : "vIsbc", - MODEL_NAME_WANBONDING : "WanBonding", - MODEL_VERSION_1 : "1", - MSO_CREATE_REQ : "createInstance", - MSO_DELETE_REQ : "deleteInstance", - MSO_CREATE_CONFIGURATION_REQ : 'createConfiguration', - MSO_DELETE_CONFIGURATION_REQ : 'deleteConfiguration', - MSO_CHANGE_CONFIG_STATUS_REQ: "changeConfigurationStatus", - MSO_CHANGE_PORT_STATUS_REQ: "changePortStatus", - MSO_CREATE_ENVIRONMENT: "createEnvironmentInstance", - MSO_DEACTIVATE_ENVIRONMENT: "deactivateEnvironmentInstance", - MSO_ACTIVATE_ENVIRONMENT: "activateEnvironmentInstance", - MSO_ACTIVATE_SERVICE_REQ: "activateServiceInstance", - MSO_DEACTIVATE_SERVICE_REQ: "deactivateServiceInstance", +.constant("_", window._) +.constant("COMPONENT", (function () { + return { + A_LA_CARTE: "a la carte", + CLOUD_REGION_ID: "cloudRegionID", + CLOUD_OWNER: "cloudOwner", + COMPONENT_STATUS: "ComponentStatus", + CREATE_COMPONENT: "createComponent", + IFRAME_DIALOG: "iframeDialog", + DELETE_RESUME_COMPONENT: "deleteResumeComponent", + DELETE: "Delete", + RESUME: "Resume", + ENTITY: "entity", + GET_COMPONENT_LIST: "getComponentList", + GET_SUBS: "getSubs", + GET_SUB_DETAILS: "getSubDetails", + GLOBAL_CUSTOMER_ID: "globalCustomerId", + MACRO: "Macro", + MODEL_NAME_IISBC: "Intercarrier Interconnect Session Border Controller", + MODEL_NAME_VISBCOAMNETWORK: "vIsbcOamNetwork", + MODEL_NAME_VISBCRTPEXPANSIONMODULE: "vIsbcRtpExpansionModule", + MODEL_NAME_VISBC: "vIsbc", + MODEL_NAME_WANBONDING: "WanBonding", + MODEL_VERSION_1: "1", + MSO_CREATE_REQ: "createInstance", + MSO_DELETE_REQ: "deleteInstance", + MSO_CREATE_CONFIGURATION_REQ: 'createConfiguration', + MSO_DELETE_CONFIGURATION_REQ: 'deleteConfiguration', + MSO_CHANGE_CONFIG_STATUS_REQ: "changeConfigurationStatus", + MSO_CHANGE_PORT_STATUS_REQ: "changePortStatus", + MSO_CREATE_ENVIRONMENT: "createEnvironmentInstance", + MSO_DEACTIVATE_ENVIRONMENT: "deactivateEnvironmentInstance", + MSO_ACTIVATE_ENVIRONMENT: "activateEnvironmentInstance", + MSO_ACTIVATE_SERVICE_REQ: "activateServiceInstance", + MSO_DEACTIVATE_SERVICE_REQ: "deactivateServiceInstance", MSO_ACTIVATE_FABRIC_CONFIGURATION_REQ: "activateFabricConfigurationInstance", MSO_DEACTIVATE_AND_CLOUD_DELETE: "deactivateAndCloudDelete", - NAME : "name", - NETWORK : "network", - CONFIGURATION : "configuration", - PORT: "port", - NETWORKS : "networks", - PRODUCT_NAME_TRINITY : "Trinity", - QUERY_SERVICE_INSTANCE : "queryServiceInstance", - REFRESH_PROPERTIES : "refreshProperties", - SDN_L3_BONDING : "SDN-L3-BONDING", - SDN_ETHERNET_INTERNET : "SDN-ETHERNET-INTERNET", - SERVICE : "service", - OLDVERSION : 'oldversion', - SERVICE_TYPE : "serviceType", - SHOW_COMPONENT_DETAILS : "showComponentDetails", - STATUS : "status", - SUBSCRIBER_NAME : "subscriberName", - TENANT_ID : "tenantID", - TENANT_NAME : "tenantName", - TRUE : "true", - UCPE_VMS : "uCPE-VMS", - VF_MODULE : "vfModule", - VNF : "vnf", - VNF_CODE : "vnfCode", - VNF_FUNCTION : "vnfFunction", - VNF_ROLE : "vnfRole", - VNF_TYPE : "vnfType", - VOLUME_GROUP : "volumeGroup", + NAME: "name", + NETWORK: "network", + CONFIGURATION: "configuration", + PORT: "port", + NETWORKS: "networks", + PRODUCT_NAME_TRINITY: "Trinity", + QUERY_SERVICE_INSTANCE: "queryServiceInstance", + REFRESH_PROPERTIES: "refreshProperties", + SDN_L3_BONDING: "SDN-L3-BONDING", + SDN_ETHERNET_INTERNET: "SDN-ETHERNET-INTERNET", + SERVICE: "service", + OLDVERSION: 'oldversion', + SERVICE_TYPE: "serviceType", + SHOW_COMPONENT_DETAILS: "showComponentDetails", + STATUS: "status", + SUBSCRIBER_NAME: "subscriberName", + TENANT_ID: "tenantID", + TENANT_NAME: "tenantName", + TRUE: "true", + UCPE_VMS: "uCPE-VMS", + VF_MODULE: "vfModule", + VNF: "vnf", + VNF_CODE: "vnfCode", + VNF_FUNCTION: "vnfFunction", + VNF_ROLE: "vnfRole", + VNF_TYPE: "vnfType", + VOLUME_GROUP: "volumeGroup", IS_PERMITTED: "is-permitted", - PNF : "pnf", - // IDs - CIDR_MASK_1 : "255.255.255.000", - //COMPONENT_LIST_NAMED_QUERY_ID : "ed0a0f5b-cf79-4784-88b2-911cd726cd3d", - CUSTOMER_ID_1 : "icore9883749", - DELETE_INSTANCE_ID_1 : "ff305d54-75b4-ff1b-fff1-eb6b9e5460ff", - GATEWAY_ADDRESS_1 : "10.10.125.1", - GLOBAL_SUBSCRIBER_ID_1 : "C12345", - INSTANCE_ID_1 : "ff305d54-75b4-431b-adb2-eb6b9e5ff000", - INSTANCE_ID_2 : "ff305d54-75b4-ff1b-adb2-eb6b9e5460ff", - INSTANCE_ID_3 : "ff305d54-75b4-ff1b-bdb2-eb6b9e5460ff", - MODEL_ID_1 : "sn5256d1-5a33-55df-13ab-12abad84e764", - MODEL_ID_2 : "ff5256d1-5a33-55df-aaaa-12abad84e7ff", - MODEL_ID_3 : "ff3514e3-5a33-55df-13ab-12abad84e7ff", - MODEL_ID_4 : "ff5256d1-5a33-55df-13ab-12abad84e7ff", - MODEL_ID_5 : "ff5256d1-5a33-55df-13ab-22abad84e7ff", - MODEL_NAME_VERSION_ID_1 : "ab6478e4-ea33-3346-ac12-ab121484a333", - MODEL_NAME_VERSION_ID_2 : "fe6478e4-ea33-3346-aaaa-ab121484a3fe", - MODEL_NAME_VERSION_ID_3 : "fe6985cd-ea33-3346-ac12-ab121484a3fe", - MODEL_NAME_VERSION_ID_4 : "fe6478e4-ea33-3346-ac12-ab121484a3fe", - MODEL_NAME_VERSION_ID_5 : "fe6478e4-ea33-3346-bc12-ab121484a3fe", - SERVICE_INSTANCE_ID_1 : "bc305d54-75b4-431b-adb2-eb6b9e546014", - SUBSCRIBER_NAME_GED12 : "General Electric Division 12", - VNF_INSTANCE_ID : "VNF_INSTANCE_ID_12345", - VPN_ID_1 : "1a2b3c4d5e6f", + PNF: "pnf", + // IDs + CIDR_MASK_1: "255.255.255.000", + //COMPONENT_LIST_NAMED_QUERY_ID : "ed0a0f5b-cf79-4784-88b2-911cd726cd3d", + CUSTOMER_ID_1: "icore9883749", + DELETE_INSTANCE_ID_1: "ff305d54-75b4-ff1b-fff1-eb6b9e5460ff", + GATEWAY_ADDRESS_1: "10.10.125.1", + GLOBAL_SUBSCRIBER_ID_1: "C12345", + INSTANCE_ID_1: "ff305d54-75b4-431b-adb2-eb6b9e5ff000", + INSTANCE_ID_2: "ff305d54-75b4-ff1b-adb2-eb6b9e5460ff", + INSTANCE_ID_3: "ff305d54-75b4-ff1b-bdb2-eb6b9e5460ff", + MODEL_ID_1: "sn5256d1-5a33-55df-13ab-12abad84e764", + MODEL_ID_2: "ff5256d1-5a33-55df-aaaa-12abad84e7ff", + MODEL_ID_3: "ff3514e3-5a33-55df-13ab-12abad84e7ff", + MODEL_ID_4: "ff5256d1-5a33-55df-13ab-12abad84e7ff", + MODEL_ID_5: "ff5256d1-5a33-55df-13ab-22abad84e7ff", + MODEL_NAME_VERSION_ID_1: "ab6478e4-ea33-3346-ac12-ab121484a333", + MODEL_NAME_VERSION_ID_2: "fe6478e4-ea33-3346-aaaa-ab121484a3fe", + MODEL_NAME_VERSION_ID_3: "fe6985cd-ea33-3346-ac12-ab121484a3fe", + MODEL_NAME_VERSION_ID_4: "fe6478e4-ea33-3346-ac12-ab121484a3fe", + MODEL_NAME_VERSION_ID_5: "fe6478e4-ea33-3346-bc12-ab121484a3fe", + SERVICE_INSTANCE_ID_1: "bc305d54-75b4-431b-adb2-eb6b9e546014", + SUBSCRIBER_NAME_GED12: "General Electric Division 12", + VNF_INSTANCE_ID: "VNF_INSTANCE_ID_12345", + VPN_ID_1: "1a2b3c4d5e6f", - // PATHS - CHANGE_MANAGEMENT_OPERATION_NO_SCHEDULER: "change-management/workflow/@vnfName", - GET_WORKFLOW: "change-management/get_vnf_workflow_relation", - GET_MSO_WORKFLOWS: "change-management/mso", - GET_SCHEDULER_CHANGE_MANAGEMENTS: "change-management/scheduler", - CANCEL_SCHEDULE_REQUEST: "change-management/scheduler/schedules", - ASSIGN : "?r=", - AAI_GET_SERVICE_INSTANCE_PATH : "aai_get_service_instance/", - AAI_GET_SERVICES : "aai_get_services", - AAI_GET_AIC_ZONES :"aai_get_aic_zones", - AAI_GET_AIC_ZONE_FOR_PNF :"aai_get_aic_zone_for_pnf/@globalCustomerId/@serviceType/@serviceInstanceId", - AAI_GET_SERVICES_BY_TYPE : "aai_get_models_by_service_type", - AAI_GET_TENANTS : "aai_get_tenants/", - AAI_SUB_DETAILS_PATH : "aai_sub_details/", - AAI_GET_VERSION_BY_INVARIANT_ID:"aai_get_version_by_invariant_id/", - AAI_GET_PORT_MIRRORING_CONFIGS_DATA : "aai_getPortMirroringConfigsData", - AAI_GET_PORT_MIRRORING_SOURCE_PORTS : "aai_getPortMirroringSourcePorts", - AAI_GET_PROVIDER_NETWORKS_ASSOCIATIONS : "aai/standardQuery/vlansByNetworks", - SEARCH_SERVICE_INSTANCES:"search_service_instances", + // PATHS + CHANGE_MANAGEMENT_OPERATION_NO_SCHEDULER: "change-management/workflow/@vnfName", + GET_WORKFLOW: "change-management/get_vnf_workflow_relation", + GET_SO_WORKFLOWS: "workflows-management/workflows", + GET_MSO_WORKFLOWS: "change-management/mso", + GET_SCHEDULER_CHANGE_MANAGEMENTS: "change-management/scheduler", + CANCEL_SCHEDULE_REQUEST: "change-management/scheduler/schedules", + ASSIGN: "?r=", + AAI_GET_SERVICE_INSTANCE_PATH: "aai_get_service_instance/", + AAI_GET_SERVICES: "aai_get_services", + AAI_GET_AIC_ZONES: "aai_get_aic_zones", + AAI_GET_AIC_ZONE_FOR_PNF: "aai_get_aic_zone_for_pnf/@globalCustomerId/@serviceType/@serviceInstanceId", + AAI_GET_SERVICES_BY_TYPE: "aai_get_models_by_service_type", + AAI_GET_TENANTS: "aai_get_tenants/", + AAI_SUB_DETAILS_PATH: "aai_sub_details/", + AAI_GET_VERSION_BY_INVARIANT_ID: "aai_get_version_by_invariant_id/", + AAI_GET_PORT_MIRRORING_CONFIGS_DATA: "aai_getPortMirroringConfigsData", + AAI_GET_PORT_MIRRORING_SOURCE_PORTS: "aai_getPortMirroringSourcePorts", + AAI_GET_PROVIDER_NETWORKS_ASSOCIATIONS: "aai/standardQuery/vlansByNetworks", + SEARCH_SERVICE_INSTANCES: "search_service_instances", AAI_GET_VNF_BY_CUSTOMERID_AND_SERVICETYPE: "get_vnf_data_by_globalid_and_service_type/", AAI_GET_SERVICES_BY_OWNING_ENTITY_ID: 'aai_get_services_by_owning_entity_id', - AAI_SUB_VIEWEDIT_PATH : "aai_sub_viewedit", - AAI_GET_VNF_INFO : "aai_get_vnf_information", - AAI_GET_PNF_INSTANCE: "aai_get_service_instance_pnfs", - AAI_GET_CR_INSTANCE: "aai_get_network_collection_details", - AAI_GET_VNF_INSTANCES_LIST: "aai_get_vnf_instances", - AAI_GET_PNF_INSTANCES_LIST: "aai_get_pnf_instances", - AAI_GET_BY_URI: "aai_get_by_uri/", - AAI_GET_CONFIGURATION: "aai_get_configuration/", - AAI_GET_HOMING_DATA: "aai_get_homing_by_vfmodule/@vnfInstanceId/@vfModuleId", + AAI_SUB_VIEWEDIT_PATH: "aai_sub_viewedit", + AAI_GET_VNF_INFO: "aai_get_vnf_information", + AAI_GET_PNF_INSTANCE: "aai_get_service_instance_pnfs", + AAI_GET_CR_INSTANCE: "aai_get_network_collection_details", + AAI_GET_VNF_INSTANCES_LIST: "aai_get_vnf_instances", + AAI_GET_PNF_INSTANCES_LIST: "aai_get_pnf_instances", + AAI_GET_BY_URI: "aai_get_by_uri/", + AAI_GET_CONFIGURATION: "aai_get_configuration/", + AAI_GET_HOMING_DATA: "aai_get_homing_by_vfmodule/@vnfInstanceId/@vfModuleId", AAI_GET_TEST_ENVIRONMENTS: "get_operational_environments?operationalEnvironmentType=", - GET_CATEGORY_PARAMETERS : "category_parameter", - PARAMETER_STANDARDIZATION_FAMILY: "PARAMETER_STANDARDIZATION", + GET_CATEGORY_PARAMETERS: "category_parameter", + PARAMETER_STANDARDIZATION_FAMILY: "PARAMETER_STANDARDIZATION", TENANT_ISOLATION_FAMILY: "TENANT_ISOLATION", - ASDC_GETMODEL_PATH : "asdc/getModel/", - CREATE_INSTANCE_PATH : "/models/services/createInstance", AAI_GET_PNF_BY_NAME : "aai_get_pnfs/pnf/", - //1710 scheduler contants - POST_CREATE_NEW_VNF_CHANGE:"post_create_new_vnf_change", - WORKFLOW: "workflow", - GET_TIME_SLOTS:"get_time_slots", - SUBMIT_VNF_CHANGE_TIMESLOTS:"submit_vnf_change_timeslots", - AAI_GET_INSTANCE_GROUPS_BY_VNF_INSTANCE_ID_PATH: 'aai_get_instance_groups_by_vnf_instance_id', + ASDC_GETMODEL_PATH: "asdc/getModel/", + CREATE_INSTANCE_PATH: "/models/services/createInstance", + AAI_GET_PNF_BY_NAME: "aai_get_pnfs/pnf/", + //1710 scheduler contants + POST_CREATE_NEW_VNF_CHANGE: "post_create_new_vnf_change", + WORKFLOW: "workflow", + GET_TIME_SLOTS: "get_time_slots", + SUBMIT_VNF_CHANGE_TIMESLOTS: "submit_vnf_change_timeslots", + AAI_GET_INSTANCE_GROUPS_BY_VNF_INSTANCE_ID_PATH: 'aai_get_instance_groups_by_vnf_instance_id', - FORWARD_SLASH : "/", - GET_SYSTEM_PROP_VNF_PROV_STATUS_PATH : "get_system_prop_vnf_prov_status", - GET_USER_ID : "getuserID", - INSTANTIATE_ROOT_PATH : "#/instantiate?subscriberId=", - INSTANTIATE_PATH : "/instantiate", - INVALID_STRING : "/INVALID_STRING/", - INVALID_STRING_MSO_CREATE_SVC_INSTANCE : "INVALID_STRING_mso_create_svc_instance", - MSO: "mso", - MSO_CREATE_NW_INSTANCE : "mso_create_nw_instance", - MSO_CREATE_NW_INSTANCE_PATH : "mso_create_nw_instance/", - MSO_CREATE_SVC_INSTANCE : "mso_create_svc_instance", - MSO_DELETE_SVC_INSTANCE_PATH : "mso_delete_svc_instance/", + FORWARD_SLASH: "/", + GET_SYSTEM_PROP_VNF_PROV_STATUS_PATH: "get_system_prop_vnf_prov_status", + GET_USER_ID: "getuserID", + INSTANTIATE_ROOT_PATH: "#/instantiate?subscriberId=", + INSTANTIATE_PATH: "/instantiate", + INVALID_STRING: "/INVALID_STRING/", + INVALID_STRING_MSO_CREATE_SVC_INSTANCE: "INVALID_STRING_mso_create_svc_instance", + MSO: "mso", + MSO_CREATE_NW_INSTANCE: "mso_create_nw_instance", + MSO_CREATE_NW_INSTANCE_PATH: "mso_create_nw_instance/", + MSO_CREATE_SVC_INSTANCE: "mso_create_svc_instance", + MSO_DELETE_SVC_INSTANCE_PATH: "mso_delete_svc_instance/", MSO_ACTIVATE_INSTANCE: "mso/mso_activate_service_instance/@serviceInstanceId", MSO_DEACTIVATE_INSTANCE: "mso/mso_deactivate_service_instance/@serviceInstanceId", MSO_ACTIVATE_FABRIC_CONFIGURATION_INSTANCE: "mso/mso_activate_fabric_configuration/@serviceInstanceId", - MSO_DEACTIVATE_AND_CLOUD_DELETE_INSTANCE: "mso/mso_vfmodule_soft_delete/@serviceInstanceId/@vnfInstanceId/@vfModuleInstanceId", - MSO_CREATE_REALATIONSHIP : "mso_add_relationship", - MSO_REMOVE_RELATIONSHIP: "mso_remove_relationship", - SELECTED_SERVICE_SUB_PATH : "#/instances/subdetails?", - SELECTED_SERVICE_INSTANCE_SUB_PATH : "serviceInstanceIdentifier=", - SELECTED_SUBSCRIBER_SUB_PATH : "subscriberId=", - OWNING_ENTITY_SUB_PATH : "owningEntity=", - PROJECT_SUB_PATH : "project=", - SERVICE_TYPE_LIST_PATH : "#/instances/serviceTypes?serviceTypeList=", - SERVICE_MODLES_INSTANCES_SUBSCRIBERS_PATH : 'serviceModels.htm#/instances/subscribers', - SERVICES_DIST_STATUS_PATH : "rest/models/services?distributionStatus=", - SERVICES_PATH : "rest/models/services/", - SERVICETYPE_SUB_PATH : "&serviceType=", - SERVICEINSTANCEID_SUB_PATH : "&serviceInstanceId=", - MODELVERSIONID_SUB_PATH : "&aaiModelVersionId=", - SERVICEMODELS_INSTANCES_SERVICES_PATH : "serviceModels.htm#/instances/services", - SERVICEMODELS_MODELS_SERVICES_PATH : "serviceModels.htm#/models/services", - SUBDETAILS_SELECTEDSUBSCRIBER : "#subdetails?selectedSubscriber=", - SUBSCRIBERNAME_SUB_PATH : "&subscriberName=", - WELCOME_PATH : "welcome.htm", + MSO_DEACTIVATE_AND_CLOUD_DELETE_INSTANCE: "mso/mso_vfmodule_soft_delete/@serviceInstanceId/@vnfInstanceId/@vfModuleInstanceId", + MSO_CREATE_REALATIONSHIP: "mso_add_relationship", + MSO_REMOVE_RELATIONSHIP: "mso_remove_relationship", + SELECTED_SERVICE_SUB_PATH: "#/instances/subdetails?", + SELECTED_SERVICE_INSTANCE_SUB_PATH: "serviceInstanceIdentifier=", + SELECTED_SUBSCRIBER_SUB_PATH: "subscriberId=", + OWNING_ENTITY_SUB_PATH: "owningEntity=", + PROJECT_SUB_PATH: "project=", + SERVICE_TYPE_LIST_PATH: "#/instances/serviceTypes?serviceTypeList=", + SERVICE_MODLES_INSTANCES_SUBSCRIBERS_PATH: 'serviceModels.htm#/instances/subscribers', + SERVICES_DIST_STATUS_PATH: "rest/models/services?distributionStatus=", + SERVICES_PATH: "rest/models/services/", + SERVICETYPE_SUB_PATH: "&serviceType=", + SERVICEINSTANCEID_SUB_PATH: "&serviceInstanceId=", + MODELVERSIONID_SUB_PATH: "&aaiModelVersionId=", + SERVICEMODELS_INSTANCES_SERVICES_PATH: "serviceModels.htm#/instances/services", + SERVICEMODELS_MODELS_SERVICES_PATH: "serviceModels.htm#/models/services", + SUBDETAILS_SELECTEDSUBSCRIBER: "#subdetails?selectedSubscriber=", + SUBSCRIBERNAME_SUB_PATH: "&subscriberName=", + WELCOME_PATH: "welcome.htm", IS_PERMITTED_SUB_PATH: "&isPermitted=", - SERVICE_POPUP_IFRAME_URL: "app/ui/#/servicePopup?serviceModelId=", - SUB_INTERFACE_POPUP_IFRAME_URL: "app/ui/#/vlan?", + SERVICE_POPUP_IFRAME_URL: "app/ui/#/servicePopup?serviceModelId=", + SUB_INTERFACE_POPUP_IFRAME_URL: "app/ui/#/vlan?", VERIFY_SERVICE_URL: "rest/models/services/verifyService", - //Test Environment Urls: - OPERATIONAL_ENVIRONMENT_CREATE : "operationalEnvironment/create", - OPERATIONAL_ENVIRONMENT_DEACTIVATE : "operationalEnvironment/deactivate?operationalEnvironment=", - OPERATIONAL_ENVIRONMENT_ACTIVATE : "operationalEnvironment/activate?operationalEnvironment=", - OPERATIONAL_ENVIRONMENT_STATUS : "operationalEnvironment/requestStatus?requestId=", + //Test Environment Urls: + OPERATIONAL_ENVIRONMENT_CREATE: "operationalEnvironment/create", + OPERATIONAL_ENVIRONMENT_DEACTIVATE: "operationalEnvironment/deactivate?operationalEnvironment=", + OPERATIONAL_ENVIRONMENT_ACTIVATE: "operationalEnvironment/activate?operationalEnvironment=", + OPERATIONAL_ENVIRONMENT_STATUS: "operationalEnvironment/requestStatus?requestId=", //Template Urls - AAI_GET_SUBS_URL : "app/vid/scripts/view-models/aaiGetSubs.htm", - AAI_GET_SUBSCRIBER_URL : "app/vid/scripts/view-models/aaiGetSubscriberList.htm", - AAI_SERVICE_TYPES_URL : "app/vid/scripts/view-models/aaiServiceTypes.htm", - AAI_SUB_DETAILS_URL : "app/vid/scripts/view-models/aaiSubDetails.htm", - CREATE_INSTANCE_SERVICE_MODELS_URL : "app/vid/scripts/view-models/createInstanceServiceModels.htm", - INSTANTIATE_URL : "app/vid/scripts/view-models/instantiate.htm", - SERVICE_MODELS : "app/vid/scripts/view-models/serviceModels.htm", + AAI_GET_SUBS_URL: "app/vid/scripts/view-models/aaiGetSubs.htm", + AAI_GET_SUBSCRIBER_URL: "app/vid/scripts/view-models/aaiGetSubscriberList.htm", + AAI_SERVICE_TYPES_URL: "app/vid/scripts/view-models/aaiServiceTypes.htm", + AAI_SUB_DETAILS_URL: "app/vid/scripts/view-models/aaiSubDetails.htm", + CREATE_INSTANCE_SERVICE_MODELS_URL: "app/vid/scripts/view-models/createInstanceServiceModels.htm", + INSTANTIATE_URL: "app/vid/scripts/view-models/instantiate.htm", + SERVICE_MODELS: "app/vid/scripts/view-models/serviceModels.htm", - ACTIVATE_SERVICE_STATUSES: ['created', 'pendingdelete', 'pending-delete', 'assigned'], + ACTIVATE_SERVICE_STATUSES: ['created', 'pendingdelete', 'pending-delete', + 'assigned'], - FULL_NAME_MAP : { - "model-invariant-id" : "Model ID", - "model-version-id" : "Model Version ID" - }, - PARTIAL_NAME_MAP : { - "id" : "ID", - "uuid" : "UUID", - "vfmodule" : "VF Module", - "vnf" : "VNF", - "volumegroup" : "Volume Group" - }, + FULL_NAME_MAP: { + "model-invariant-id": "Model ID", + "model-version-id": "Model Version ID" + }, + PARTIAL_NAME_MAP: { + "id": "ID", + "uuid": "UUID", + "vfmodule": "VF Module", + "vnf": "VNF", + "volumegroup": "Volume Group" + }, - MANUAL_TASKS: { - "retry": "retry", - "rollback": "rollback", - "abort": "abort", - "skip": "skip" - }, + MANUAL_TASKS: { + "retry": "retry", + "rollback": "rollback", + "abort": "abort", + "skip": "skip" + }, - WORKFLOWS: { - vnfConfigUpdate: "VNF Config Update", - vnfInPlace: "VNF In Place Software Update", - update: "update", - replace: "replace", - vnfScaleOut: "VNF Scale Out" - }, + WORKFLOWS: { + vnfConfigUpdate: "VNF Config Update", + vnfInPlace: "VNF In Place Software Update", + update: "update", + replace: "replace", + vnfScaleOut: "VNF Scale Out" + }, - FEATURE_FLAGS:{ - FLAG_ASYNC_INSTANTIATION : "FLAG_ASYNC_INSTANTIATION", - FLAG_NETWORK_TO_ASYNC_INSTANTIATION : "FLAG_NETWORK_TO_ASYNC_INSTANTIATION", - FLAG_ADD_MSO_TESTAPI_FIELD : "FLAG_ADD_MSO_TESTAPI_FIELD", - FLAG_COLLECTION_RESOURCE_SUPPORT : "FLAG_COLLECTION_RESOURCE_SUPPORT", - FLAG_SHOW_ASSIGNMENTS: "FLAG_SHOW_ASSIGNMENTS", - FLAG_SHOW_VERIFY_SERVICE: "FLAG_SHOW_VERIFY_SERVICE", - FLAG_PNP_INSTANTIATION: "FLAG_PNP_INSTANTIATION", - FLAG_DUPLICATE_VNF : "FLAG_DUPLICATE_VNF", - FLAG_FABRIC_CONFIGURATION_ASSIGNMENTS: "FLAG_FABRIC_CONFIGURATION_ASSIGNMENTS", - FLAG_PRESENT_PROVIDER_NETWORKS_ASSOCIATIONS: "FLAG_PRESENT_PROVIDER_NETWORKS_ASSOCIATIONS", - FLAG_1810_CR_ADD_CLOUD_OWNER_TO_MSO_REQUEST: "FLAG_1810_CR_ADD_CLOUD_OWNER_TO_MSO_REQUEST", - FLAG_1810_CR_LET_SELECTING_COLLECTOR_TYPE_UNCONDITIONALLY: "FLAG_1810_CR_LET_SELECTING_COLLECTOR_TYPE_UNCONDITIONALLY", - FLAG_1810_CR_SOFT_DELETE_ALACARTE_VF_MODULE: "FLAG_1810_CR_SOFT_DELETE_ALACARTE_VF_MODULE" + FEATURE_FLAGS: { + FLAG_ASYNC_INSTANTIATION: "FLAG_ASYNC_INSTANTIATION", + FLAG_NETWORK_TO_ASYNC_INSTANTIATION: "FLAG_NETWORK_TO_ASYNC_INSTANTIATION", + FLAG_ADD_MSO_TESTAPI_FIELD: "FLAG_ADD_MSO_TESTAPI_FIELD", + FLAG_COLLECTION_RESOURCE_SUPPORT: "FLAG_COLLECTION_RESOURCE_SUPPORT", + FLAG_SHOW_ASSIGNMENTS: "FLAG_SHOW_ASSIGNMENTS", + FLAG_SHOW_VERIFY_SERVICE: "FLAG_SHOW_VERIFY_SERVICE", + FLAG_PNP_INSTANTIATION: "FLAG_PNP_INSTANTIATION", + FLAG_DUPLICATE_VNF: "FLAG_DUPLICATE_VNF", + FLAG_FABRIC_CONFIGURATION_ASSIGNMENTS: "FLAG_FABRIC_CONFIGURATION_ASSIGNMENTS", + FLAG_PRESENT_PROVIDER_NETWORKS_ASSOCIATIONS: "FLAG_PRESENT_PROVIDER_NETWORKS_ASSOCIATIONS", + FLAG_1810_CR_ADD_CLOUD_OWNER_TO_MSO_REQUEST: "FLAG_1810_CR_ADD_CLOUD_OWNER_TO_MSO_REQUEST", + FLAG_1810_CR_LET_SELECTING_COLLECTOR_TYPE_UNCONDITIONALLY: "FLAG_1810_CR_LET_SELECTING_COLLECTOR_TYPE_UNCONDITIONALLY", + FLAG_1810_CR_SOFT_DELETE_ALACARTE_VF_MODULE: "FLAG_1810_CR_SOFT_DELETE_ALACARTE_VF_MODULE" } - }; + }; })()); diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js index 9a758cc73..11f5cd6e5 100644 --- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js @@ -617,13 +617,32 @@ }; vm.loadWorkFlows = function () { - changeManagementService.getWorkflows(vm.changeManagement.vnfNames) - .then(function(response) { - vm.workflows = response.data.workflows; - }) - .catch(function(error) { - $log.error(error); - }); + // Should be corrected when VID-397 will be closed. At the moment there is a need + // to merge local and remote workflows not to broke current functionality. + return vm.loadLocalWorkFlows() + .then(vm.loadRemoteWorkFlows) + .then(function () { + vm.workflows = vm.localWorkflows.concat(vm.remoteWorkflows.map(item => item.name)); + }); + }; + + vm.loadLocalWorkFlows = function () { + return changeManagementService.getWorkflows(vm.changeManagement.vnfNames) + .then(function (response) { + vm.localWorkflows = response.data.workflows || []; + }).catch(function (error) { + $log.error(error); + }); + }; + + vm.loadRemoteWorkFlows = function () { + let vnfNames = vm.changeManagement.vnfNames.map(vnfName => vnfName.name); + return changeManagementService.getSOWorkflows(vnfNames) + .then(function (response) { + vm.remoteWorkflows = response.data || []; + }).catch(function (error) { + $log.error(error); + }); }; //Must be $scope because we bind to the onchange of the html (cannot attached to vm variable). diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.test.js b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.test.js new file mode 100644 index 000000000..c4b940641 --- /dev/null +++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.test.js @@ -0,0 +1,91 @@ +require('./new-change-management.controller'); +const jestMock = require('jest-mock'); + +describe('Testing workFlows from SO', () => { + let $notNeeded; + let $controller; + let $changeManagementService; + beforeEach( + angular.mock.module('app') + ); + + beforeEach(inject(function (_$controller_) { + $notNeeded = jestMock.fn(); + // mock ChangeManagementService + $changeManagementService = jestMock.fn(); + $changeManagementService.getAllSDCServices = jestMock.fn(() => Promise.resolve([])); + + // mock q + $q = jestMock.fn(); + $defer = jestMock.fn(); + $q.defer = jestMock.fn(() => $defer); + $defer.promise = Promise.resolve({}); + // mock AaiService + $aaiService = jestMock.fn(); + $aaiService.getLoggedInUserID = jestMock.fn(); + $aaiService.getSubscribers = jestMock.fn(); + $controller = _$controller_('newChangeManagementModalController', { + $uibModalInstance: $notNeeded, + $uibModal: $notNeeded, + $q: $q, + AaiService: $aaiService, + changeManagementService: $changeManagementService, + Upload: $notNeeded, + $log: $notNeeded, + _: $notNeeded, + COMPONENT: $notNeeded, + VIDCONFIGURATION: $notNeeded, + DataService: $notNeeded, + featureFlags: $notNeeded, + $scope: $notNeeded, + }); + })); + + test('Verify load workflows from SO will call getSOWorkflow and return only names of workflows', () => { + // given + $controller.changeManagement.vnfNames = [{name: 'test1'}, {name: "test2"}]; + let getSOWorkflowsPromiseStub = Promise.resolve({"data": [{"id": "1", "name": "workflow 1"}, {"id": "2", "name": "workflow 2"}]}); + $changeManagementService.getSOWorkflows = () => getSOWorkflowsPromiseStub; + $controller.workflows = []; + // when + return $controller.loadRemoteWorkFlows() + .then(() => { + remoteWorkflows = $controller.remoteWorkflows.map(item => item.name) + expect(remoteWorkflows).toContain('workflow 1'); + expect(remoteWorkflows).toContain('workflow 2'); + } + ); + }); + + test('Verify load workflows will call load from SO and join workflow lists', () => { + // given + let getWorkflowsStub = Promise.resolve({"data": {"workflows": ["workflow 0"]}}); + let getSOWorkflowsPromiseStub = Promise.resolve({"data": [{"id": "1", "name": "workflow 1"}, {"id": "2", "name": "workflow 2"}]}); + + $controller.changeManagement.vnfNames = [{name: 'test1'}, {name: "test2"}]; + $changeManagementService.getWorkflows = () => getWorkflowsStub; + $changeManagementService.getSOWorkflows = () => getSOWorkflowsPromiseStub; + // when + return $controller.loadWorkFlows().then(() => { + expect($controller.workflows).toContain('workflow 0'); + expect($controller.workflows).toContain('workflow 1'); + expect($controller.workflows).toContain('workflow 2'); + }); + }); + + test('Verify broken SO workflows wont change content of local workflows', () => { + // given + let getWorkflowsStub = Promise.resolve({"data": {"workflows": ["workflow 0"]}}); + let getSOWorkflowsPromiseStub = Promise.reject(new Error("Broken SO workflows service.")); + + $controller.changeManagement.vnfNames = "any"; + $changeManagementService.getWorkflows = () => getWorkflowsStub; + $changeManagementService.getSOWorkflows = () => getSOWorkflowsPromiseStub; + // when + $controller.loadWorkFlows() + .then(() => { + expect($controller.workflows).toEqual(['workflow 0']); + }); + }); +}); + diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/change-management.service.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/change-management.service.js index 03e41b2c1..699868477 100644 --- a/vid-app-common/src/main/webapp/app/vid/scripts/services/change-management.service.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/change-management.service.js @@ -21,6 +21,15 @@ }); }; + this.getSOWorkflows = function (vnfNames) { + return $http.get(COMPONENT.GET_SO_WORKFLOWS, {params: {vnfName: vnfNames}}) + .success(function (response) { + return {data: response}; + }).catch(function () { + return {data: []}; + }); + }; + this.getMSOChangeManagements = function() { var deferred = $q.defer(); |