diff options
author | Ofir Sonsino <os0695@att.com> | 2017-09-20 13:20:42 +0300 |
---|---|---|
committer | Ofir Sonsino <os0695@att.com> | 2017-09-20 13:37:03 +0300 |
commit | 9dfd7e28c1eb348fcb4a2de8c6faae2a01b34942 (patch) | |
tree | c273862f59b0b64c19ccfea5f59ab574071cb323 /vid-app-common/src/main/webapp | |
parent | c3722d135481cfab5978c84853d8229d1e7d9cb3 (diff) |
Global Read only role, Support VID specific Roles
Issue-ID: VID-46 , VID-47
Change-Id: Ib100d20ac40a65d39e27a6e2741b19a173a2b8ea
Signed-off-by: Ofir Sonsino <os0695@att.com>
Diffstat (limited to 'vid-app-common/src/main/webapp')
34 files changed, 3279 insertions, 2129 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 e7cbc486..f88ee9c3 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 @@ -50,7 +50,8 @@ appDS2.constant("COMPONENT", (function() { SDN_L3_BONDING : "SDN-L3-BONDING", SDN_ETHERNET_INTERNET : "SDN-ETHERNET-INTERNET", SERVICE : "service", - SERVICE_TYPE : "serviceType", + OLDVERSION : 'oldversion', + SERVICE_TYPE : "serviceType", SHOW_COMPONENT_DETAILS : "showComponentDetails", STATUS : "status", SUBSCRIBER_NAME : "subscriberName", @@ -65,9 +66,10 @@ appDS2.constant("COMPONENT", (function() { VNF_ROLE : "vnfRole", VNF_TYPE : "vnfType", VOLUME_GROUP : "volumeGroup", - - - // IDs + IS_PERMITTED: "is-permitted", + + + // IDs CIDR_MASK_1 : "255.255.255.000", //COMPONENT_LIST_NAMED_QUERY_ID : "ed0a0f5b-cf79-4784-88b2-911cd726cd3d", CUSTOMER_ID_1 : "icore9883749", @@ -96,7 +98,8 @@ appDS2.constant("COMPONENT", (function() { ASSIGN : "?r=", AAI_GET_SERVICE_INSTANCE_PATH : "aai_get_service_instance/", AAI_GET_SERVICES : "aai_get_services", - AAI_GET_SERVICES_BY_TYPE : "aai_get_models_by_service_type", + AAI_GET_AIC_ZONES :"aai_get_aic_zones", + 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_SUB_VIEWEDIT_PATH : "aai_sub_viewedit", @@ -128,8 +131,9 @@ appDS2.constant("COMPONENT", (function() { SUBDETAILS_SELECTEDSUBSCRIBER : "#subdetails?selectedSubscriber=", SUBSCRIBERNAME_SUB_PATH : "&subscriberName=", WELCOME_PATH : "welcome.htm", - - //Template Urls + IS_PERMITTED_SUB_PATH: "&isPermitted=", + + //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", diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/constants/fieldConstants.js b/vid-app-common/src/main/webapp/app/vid/scripts/constants/fieldConstants.js index 03ec788b..9d337fa1 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/constants/fieldConstants.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/constants/fieldConstants.js @@ -20,116 +20,122 @@ "use strict";
-appDS2.factory("FIELD", [ "PARAMETER", function(PARAMETER) {
+appDS2.factory("FIELD", ["PARAMETER", function (PARAMETER) {
/*
* ID values are typically used internally.
*/
var ID = {
- AVAILABLE_VOLUME_GROUP : "availableVolumeGroup",
- INSTANCE_NAME : "instanceName",
- LCP_REGION : "lcpRegion",
- LCP_REGION_TEXT : "lcpRegionText",
- PRODUCT_FAMILY : "productFamily",
- SERVICE_TYPE : "serviceType",
- SUBSCRIBER_NAME : "subscriberName",
- SUPPRESS_ROLLBACK : "suppressRollback",
- TENANT : "tenant",
- VNF_TARGETPROVSTATUS : "target",
-
- AAI_GET_FULL_SUBSCRIBERS : "aai_get_full_subscribers",
- AAI_REFRESH_FULL_SUBSCRIBERS : "aai_refresh_full_subscribers",
- AAI_GET_SERVICES : "aai_get_services",
- AAI_GET_SUBSCRIBERS : "aai_get_subscribers",
- AAI_GET_TENTANTS : "aai_get_tenants",
- AAI_REFRESH_SUBSCRIBERS : "aai_refresh_subscribers",
- AAI_SUB_DETAILS : "aai_sub_details",
- AAI_SUB_VIEWEDIT : "aai_sub_viewedit",
- ANGULAR_UI_TREE_COLLAPSEALL : "angular-ui-tree:collapse-all",
- ANGULAR_UI_TREE_EXPANDALL : "angular-ui-tree:expand-all",
- CATEGORY : "category",
- COLOR_8F8 : "#8F8",
- COLOR_F88 : "#F88",
- COLOR_NONE : "none",
- CUSTOMER : "customer",
- CUSTOMIZATION_UUID : "customizationUuid",
- DESCRIPTION : "description",
- GENERIC_VNF : "generic-vnf",
- GLOBAL_CUSTOMER_ID : "global-customer-id",
- GLOBAL_CUST_ID : "globalCustomerId",
- IN_MAINT : "in-maint",
- INVENTORY_RESPONSE_ITEMS : "inventory-response-items",
- INVENTORY_RESPONSE_ITEM : "inventory-response-item",
- L3_NETWORK : "l3-network",
- SUB_NET : "subnet",
- SUBNET_NAME : "subnet-name",
- SUBNET_ID : "subnet-id",
- GATEWAY_ADDRESS : "gateway-address",
- NETWORK_START_ADDRESS : "network-start-address",
- CIDR_MASK : "cidr-mask",
- MODEL_CUSTOMIZATION_ID : "model-customization-id",
- MODEL_CUSTOMIZATION_NAME : "modelCustomizationName",
- MODEL_INVARIANT_ID : "modelInvariantId",
- MODEL_INVAR_ID : "model-invariant-id",
- MODEL_NAME : "modelName",
- MODEL_NAME_VERSION_ID : "modelNameVersionId",
- MODEL_VERSION : "modelVersion",
- MODEL_VERSION_ID : "model-version-id",
- NETWORK_NAME : "network-name",
- NETWORK_ID : "network-id",
- NETWORK_TYPE : "network-type",
- NETWORKS : "networks",
- OPERATIONAL_STATUS : "operational-status",
- ORCHESTRATION_STATUS : "orchestration-status",
- PERCENT_PROGRESS : "precentProgress",
- PERSONA_MODEL_ID : "persona-model-id",
- PERSONA_MODEL_VERSION : "persona-model-version",
- PERSONA_MODEL_CUSTOMIZATION_ID : "persona-model-customization-id",
- PROV_STATUS : "prov-status",
- REQUEST : "request",
- REQUEST_ID : "requestId",
- REQUEST_LIST : "requestList",
- REQUEST_TYPE : "requestType",
- REQUEST_REFERENCES : "requestReferences",
- REQUEST_STATE : "requestState",
- REQUEST_STATUS : "requestStatus",
- RESOURCE_LINK : "resource-link",
- RESULT_DATA : "result-data",
- SERVICE_DESCRIPTION : "service-description",
- SERVICE_ID : "service-id",
- SERVICE_INSTANCE : "service-instance",
- SERVICE_INSTANCES : "service-instances",
- SERVICE_INSTANCE_ID : "service-instance-id",
- SERVICE_INSTANCE_NAME : "service-instance-name",
- SERVICE_SUBSCRIPTION : "service-subscription",
- SERVICE_SUBSCRIPTIONS : "service-subscriptions",
- SERVICETYPE : "service-type",
- STATUS_MESSAGE : "statusMessage",
- SUBNAME : "subscriber-name",
- TIMESTAMP : "timestamp",
- VF_MODULE : "vf-module",
- VF_MODULES : "vfModules",
- VF_MODULE_ID : "vf-module-id",
- VF_MODULE_NAME : "vf-module-name",
- VID : "VID",
- VNF_ID : "vnf-id",
- VNF_NAME : "vnf-name",
- VNF_TYPE : "vnf-type",
- VNFS : "vnfs",
- AVAILABLEVOLUMEGROUPS : "availableVolumeGroups",
- VOLUMEGROUPS : "volumeGroups",
- VOLUME_GROUP : "volume-group",
- VOLUME_GROUP_ID : "volume-group-id",
- VOLUME_GROUP_NAME : "volume-group-name",
- SDN_C_PRELOAD : "sdncPreload",
- UPLOAD_SUPPLEMENTORY_DATA_FILE : "uploadSupplementoryDataFile",
- SUPPLEMENTORY_DATA_FILE : "supplementoryDataFile"
+ AVAILABLE_VOLUME_GROUP: "availableVolumeGroup",
+ INSTANCE_NAME: "instanceName",
+ LCP_REGION: "lcpRegion",
+ LCP_REGION_TEXT: "lcpRegionText",
+ PRODUCT_FAMILY: "productFamily",
+ AIC_ZONES : "aic_zone",
+ SERVICE_TYPE: "serviceType",
+ SERVICE_ROLE: "serviceRole",
+ SUBSCRIBER_NAME: "subscriberName",
+ SUPPRESS_ROLLBACK: "suppressRollback",
+ TENANT: "tenant",
+ VNF_TARGETPROVSTATUS: "target",
+
+ AAI_GET_FULL_SUBSCRIBERS: "aai_get_full_subscribers",
+ AAI_REFRESH_FULL_SUBSCRIBERS: "aai_refresh_full_subscribers",
+ AAI_GET_SERVICES: "aai_get_services",
+ AAI_GET_SUBSCRIBERS: "aai_get_subscribers",
+ AAI_GET_TENTANTS: "aai_get_tenants",
+ AAI_REFRESH_SUBSCRIBERS: "aai_refresh_subscribers",
+ AAI_SUB_DETAILS: "aai_sub_details",
+ AAI_SUB_VIEWEDIT: "aai_sub_viewedit",
+ ANGULAR_UI_TREE_COLLAPSEALL: "angular-ui-tree:collapse-all",
+ ANGULAR_UI_TREE_EXPANDALL: "angular-ui-tree:expand-all",
+ CATEGORY: "category",
+ COLOR_8F8: "#8F8",
+ COLOR_F88: "#F88",
+ COLOR_NONE: "none",
+ CUSTOMER: "customer",
+ CUSTOMIZATION_UUID: "customizationUuid",
+ DESCRIPTION: "description",
+ GENERIC_VNF: "generic-vnf",
+ GLOBAL_CUSTOMER_ID: "global-customer-id",
+ GLOBAL_CUST_ID: "globalCustomerId",
+ IN_MAINT: "in-maint",
+ INVENTORY_RESPONSE_ITEMS: "inventory-response-items",
+ INVENTORY_RESPONSE_ITEM: "inventory-response-item",
+ L3_NETWORK: "l3-network",
+ SUB_NET: "subnet",
+ SUBNET_NAME: "subnet-name",
+ SUBNET_ID: "subnet-id",
+ GATEWAY_ADDRESS: "gateway-address",
+ NETWORK_START_ADDRESS: "network-start-address",
+ CIDR_MASK: "cidr-mask",
+ MODEL_CUSTOMIZATION_ID: "model-customization-id",
+ MODEL_CUSTOMIZATION_NAME: "modelCustomizationName",
+ MODEL_INVARIANT_ID: "modelInvariantId",
+ MODEL_INVAR_ID: "model-invariant-id",
+ MODEL_NAME: "modelName",
+ MODEL_NAME_VERSION_ID: "modelNameVersionId",
+ MODEL_VERSION: "modelVersion",
+ MODEL_VERSION_ID: "model-version-id",
+ NETWORK_NAME: "network-name",
+ NETWORK_ID: "network-id",
+ NETWORK_TYPE: "network-type",
+ NETWORKS: "networks",
+ OPERATIONAL_STATUS: "operational-status",
+ ORCHESTRATION_STATUS: "orchestration-status",
+ PERCENT_PROGRESS: "precentProgress",
+ PERSONA_MODEL_ID: "persona-model-id",
+ PERSONA_MODEL_VERSION: "persona-model-version",
+ PERSONA_MODEL_CUSTOMIZATION_ID: "persona-model-customization-id",
+ PROV_STATUS: "prov-status",
+ REQUEST: "request",
+ REQUEST_ID: "requestId",
+ REQUEST_LIST: "requestList",
+ REQUEST_TYPE: "requestType",
+ REQUEST_REFERENCES: "requestReferences",
+ REQUEST_STATE: "requestState",
+ REQUEST_STATUS: "requestStatus",
+ RESOURCE_LINK: "resource-link",
+ RESULT_DATA: "result-data",
+ SERVICE_DESCRIPTION: "service-description",
+ SERVICE_ID: "service-id",
+ SERVICE_INSTANCE: "service-instance",
+ SERVICE_INSTANCES: "service-instances",
+ SERVICE_INSTANCE_ID: "service-instance-id",
+ SERVICE_INSTANCE_NAME: "service-instance-name",
+ SERVICE_SUBSCRIPTION: "service-subscription",
+ SERVICE_SUBSCRIPTIONS: "service-subscriptions",
+ SERVICETYPE: "service-type",
+ STATUS_MESSAGE: "statusMessage",
+ SUBNAME: "subscriber-name",
+ IS_PERMITTED: "is-permitted",
+ TIMESTAMP: "timestamp",
+ VF_MODULE: "vf-module",
+ VF_MODULES: "vfModules",
+ VF_MODULE_ID: "vf-module-id",
+ VF_MODULE_NAME: "vf-module-name",
+ VID: "VID",
+ VNF_ID: "vnf-id",
+ VNF_NAME: "vnf-name",
+ VNF_TYPE: "vnf-type",
+ VNFS: "vnfs",
+ AVAILABLEVOLUMEGROUPS: "availableVolumeGroups",
+ VOLUMEGROUPS: "volumeGroups",
+ VOLUME_GROUP: "volume-group",
+ VOLUME_GROUP_ID: "volume-group-id",
+ VOLUME_GROUP_NAME: "volume-group-name",
+ SDN_C_PRELOAD: "sdncPreload",
+ UPLOAD_SUPPLEMENTORY_DATA_FILE: "uploadSupplementoryDataFile",
+ SUPPLEMENTORY_DATA_FILE: "supplementoryDataFile",
+ ZONE_ID:"zone-id",
+ ZONE_NAME:"zone-name",
+
};
var KEY = {
- LCP_REGION_TEXT : "AAIAIC25"
+ LCP_REGION_TEXT: "AAIAIC25"
};
-
+
/*
* NAME values are displayed on GUI pages.
*/
@@ -150,6 +156,7 @@ appDS2.factory("FIELD", [ "PARAMETER", function(PARAMETER) { MODEL_VNF_CODE: "NF Naming Code",
MODEL_CUSTOMIZATION_NAME: "Resource Name",
PRODUCT_FAMILY : "Product Family",
+ AIC_ZONES: "AIC Zone",
RESOURCE_DESCRIPTION : "Resource Description",
RESOURCE_NAME : "Resource Name",
SERVICE_CATEGORY : "Service Category",
@@ -163,9 +170,10 @@ appDS2.factory("FIELD", [ "PARAMETER", function(PARAMETER) { SERVICE_UUID : "Service UUID",
SERVICE_VERSION : "Service Version",
SUBSCRIBER_NAME : "Subscriber Name",
+ MOBILITY : "Mobility",
SUPPRESS_ROLLBACK : "Suppress Rollback on Failure",
SDN_C_PRELOAD : "SDN-C Pre-Load",
- UPLOAD_SUPPLEMENTORY_DATA_FILE : "Upload Supplementory Data file",
+ UPLOAD_SUPPLEMENTORY_DATA_FILE : "Upload Supplementary Data file",
SUPPLEMENTORY_DATA_FILE : "Supplementory Data file (JSON format)",
TENANT : "Tenant",
USER_SERVICE_INSTANCE_NAME : "User Service Instance Name",
@@ -189,74 +197,75 @@ appDS2.factory("FIELD", [ "PARAMETER", function(PARAMETER) { * PROMPT values are initial values displayed in select lists.
*/
var PROMPT = {
- AVAILABLE_VOLUME_GROUP : "Select Volume Group",
- DEFAULT_A : "A default",
- DEFAULT_B : "B default",
- LCP_REGION : "Select LCP Region",
- NO_SERVICE_INSTANCE : "No Service Instance Found",
- NO_SERVICE_SUB : "No Service Subscription Found",
- PRODUCT_FAMILY : "Select Product Family",
- REGION : "Please choose a region",
- SERVICE_TYPE : "Select Service Type",
- SUBSCRIBER_NAME : "Select Subscriber Name",
- TARGETPROVSTATUS : "Select Target Prov Status",
- TENANT : "Select Tenant Name",
- TEXT_INPUT : "Enter data",
- SELECT_SERVICE : "Select a service type",
- SELECT_SUB : "Select a subscriber name",
- FETCHING_SUBS : " Fetching subscriber list from A&AI",
- REFRESH_SUB_LIST : "Refreshing subscriber list from A&AI...",
- VAR_DESCRIPTION_A : "This variable is 'a'",
- VAR_DESCRIPTION_B : "This variable is 'b'",
-
+ AVAILABLE_VOLUME_GROUP: "Select Volume Group",
+ DEFAULT_A: "A default",
+ DEFAULT_B: "B default",
+ LCP_REGION: "Select LCP Region",
+ NO_SERVICE_INSTANCE: "No Service Instance Found",
+ NO_SERVICE_SUB: "No Service Subscription Found",
+ PRODUCT_FAMILY: "Select Product Family",
+ AIC_ZONES: "Select AIC Zone",
+ REGION: "Please choose a region",
+ SERVICE_TYPE: "Select Service Type",
+ SUBSCRIBER_NAME: "Select Subscriber Name",
+ TARGETPROVSTATUS: "Select Target Prov Status",
+ TENANT: "Select Tenant Name",
+ TEXT_INPUT: "Enter data",
+ SELECT_SERVICE: "Select a service type",
+ SELECT_SUB: "Select a subscriber name",
+ FETCHING_SUBS: " Fetching subscriber list from A&AI",
+ REFRESH_SUB_LIST: "Refreshing subscriber list from A&AI...",
+ VAR_DESCRIPTION_A: "This variable is 'a'",
+ VAR_DESCRIPTION_B: "This variable is 'b'",
+
};
-
+
var STATUS = {
- // Status
- ALL : "ALL",
- COMPLETE : "Complete",
- DONE : "Done",
- ERROR : "Error",
- FAILED : "Failed",
- FAILED_SERVICE_MODELS_ASDC : "Failed to get service models from SDC.",
- FETCHING_SERVICE_TYPES : "Fetching service types list from A&AI",
- FETCHING_SERVICE_CATALOG : "Fetching service catalog from AAI. Please wait.",
- FETCHING_SERVICE_CATALOG_ASDC : "Fetching service catalog from SDC. Please wait.",
- FETCHING_SUB_DETAILS : "Fetching subscriber details from A&AI for ",
- FETCHING_SERVICE_INST_DATA : "Fetching service instance data from A&AI for service-instance-id=",
- FETCHING_SUBSCRIBER_LIST_AAI : "Fetching subscriber list from A&AI...",
- IN_PROGRESS : "In Progress",
- IS_SUCCESSFUL : " isSuccessful: ",
- MSO_FAILURE : "msoFailure",
- NONE : "None",
- NOT_FOUND : "Not Found",
- NO_SERVICE_SUBSCRIPTION_FOUND : "No Service Subscription Found",
- SUBMITTING_REQUEST : "Submitting Request",
- SUCCESS_VNF_PROV_STATUS : "Successfully set the VNF's Prov_Status to ",
- UNLOCKED : "Unlocked",
-
+ // Status
+ ALL: "ALL",
+ COMPLETE: "Complete",
+ DONE: "Done",
+ ERROR: "Error",
+ FAILED: "Failed",
+ FAILED_SERVICE_MODELS_ASDC: "Failed to get service models from SDC.",
+ FETCHING_SERVICE_TYPES: "Fetching service types list from A&AI",
+ FETCHING_SERVICE_CATALOG: "Fetching service catalog from AAI. Please wait.",
+ FETCHING_SERVICE_CATALOG_ASDC: "Fetching service catalog from SDC. Please wait.",
+ FETCHING_SUB_DETAILS: "Fetching subscriber details from A&AI for ",
+ FETCHING_SERVICE_INST_DATA: "Fetching service instance data from A&AI for service-instance-id=",
+ FETCHING_SUBSCRIBER_LIST_AAI: "Fetching subscriber list from A&AI...",
+ IN_PROGRESS: "In Progress",
+ IS_SUCCESSFUL: " isSuccessful: ",
+ MSO_FAILURE: "msoFailure",
+ NONE: "None",
+ NOT_FOUND: "Not Found",
+ NO_SERVICE_SUBSCRIPTION_FOUND: "No Service Subscription Found",
+ SUBMITTING_REQUEST: "Submitting Request",
+ SUCCESS_VNF_PROV_STATUS: "Successfully set the VNF's Prov_Status to ",
+ UNLOCKED: "Unlocked",
+
};
-
+
var STYLE = {
- TABLE : "width: auto; margin: 0 auto; border-collapse: collapse; border: none;",
- NAME : "width: 220px; text-align: left; vertical-align: middle; font-weight: bold; padding: 3px 5px; border: none;",
- VALUE : "width: 400px; text-align: left; vertical-align: middle; padding: 3px 5px; border: none;",
- CHECKBOX_VALUE : "width: 400px; text-align: center; vertical-align: middle; padding: 3px 5px; border: none;",
- TEXT_INPUT : "height: 25px; padding: 2px 5px;",
- CHECKBOX_INPUT : "height: 18px; width: 18px; padding: 2px 5px;",
- SELECT : "height: 25px; padding: 2px; text-align: center;",
- REQUIRED_LABEL : "width: 25px; padding: 5px 10px 10px 5px;",
-
- DISABLED : "disabled",
- BTN_INACTIVE : "button--inactive",
- BTN_PRIMARY : "button--primary",
- BTN_TYPE : "btn-type",
- MSO_CTRL_BTN : "div[ng-controller=msoCommitController] button",
- PRIMARY : "primary",
- PROGRESS_BAR_INFO : "progress-bar progress-bar-info",
- PROGRESS_BAR_SUCCESS : "progress-bar progress-bar-success",
+ TABLE: "width: auto; margin: 0 auto; border-collapse: collapse; border: none;",
+ NAME: "width: 220px; text-align: left; vertical-align: middle; font-weight: bold; padding: 3px 5px; border: none;",
+ VALUE: "width: 400px; text-align: left; vertical-align: middle; padding: 3px 5px; border: none;",
+ CHECKBOX_VALUE: "width: 400px; text-align: center; vertical-align: middle; padding: 3px 5px; border: none;",
+ TEXT_INPUT: "height: 25px; padding: 2px 5px;",
+ CHECKBOX_INPUT: "height: 18px; width: 18px; padding: 2px 5px;",
+ SELECT: "height: 25px; padding: 2px; text-align: center;",
+ REQUIRED_LABEL: "width: 25px; padding: 5px 10px 10px 5px;",
+
+ DISABLED: "disabled",
+ BTN_INACTIVE: "button--inactive",
+ BTN_PRIMARY: "button--primary",
+ BTN_TYPE: "btn-type",
+ MSO_CTRL_BTN: "div[ng-controller=msoCommitController] button",
+ PRIMARY: "primary",
+ PROGRESS_BAR_INFO: "progress-bar progress-bar-info",
+ PROGRESS_BAR_SUCCESS: "progress-bar progress-bar-success",
}
-
+
var ERROR = {
AAI : "A&AI failure - see log below for details",
AAI_ERROR : "A&AI Error",
@@ -280,7 +289,8 @@ appDS2.factory("FIELD", [ "PARAMETER", function(PARAMETER) { SERVICE_INST_DNE : "That service instance does not exist. Please try again.",
SYSTEM_FAILURE : "System failure",
INVALID_DATA_FORMAT : 'Invalid data format.Please check your file content whether it is not in json or not.',
-
+ MISSING_FILE : 'Please Select JSON File.',
+
}
/*
@@ -289,143 +299,150 @@ appDS2.factory("FIELD", [ "PARAMETER", function(PARAMETER) { */
var PARAMETER = {
- AVAILABLE_VOLUME_GROUP : {
- name : NAME.AVAILABLE_VOLUME_GROUP,
- id : ID.AVAILABLE_VOLUME_GROUP,
- type : PARAMETER.SELECT,
- prompt : PROMPT.AVAILABLE_VOLUME_GROUP,
- isRequired : true
- },
- INSTANCE_NAME : {
- name : NAME.INSTANCE_NAME,
- id : ID.INSTANCE_NAME,
- isRequired : true
- },
- LCP_REGION : {
- name : NAME.LCP_REGION,
- id : ID.LCP_REGION,
- type : PARAMETER.SELECT,
- prompt : PROMPT.LCP_REGION,
- isRequired : true
- },
- VNF_TARGET_PROVSTATUS : {
- name : NAME.VNF_Target_Prov_Status,
- id : ID.VNF_TARGETPROVSTATUS,
- type : PARAMETER.SELECT,
- prompt : PROMPT.TARGETPROVSTATUS,
- isRequired : true
- },
- LCP_REGION_TEXT_HIDDEN : {
- id : ID.LCP_REGION_TEXT,
- isVisible : false
- },
- LCP_REGION_TEXT_VISIBLE : {
- name : NAME.LCP_REGION_TEXT,
- id : ID.LCP_REGION_TEXT,
- isRequired : true,
- isVisible : true
- },
- PRODUCT_FAMILY : {
- name : NAME.PRODUCT_FAMILY,
- id : ID.PRODUCT_FAMILY,
- type : PARAMETER.SELECT,
- prompt : PROMPT.PRODUCT_FAMILY,
- isRequired : true
- },
- SERVICE_TYPE : {
- name : NAME.SERVICE_TYPE,
- id : ID.SERVICE_TYPE,
- type : PARAMETER.SELECT,
- prompt : PROMPT.SERVICE_TYPE,
- isRequired : true
- },
- SERVICE_TYPE_DISABLED : {
- name : NAME.SERVICE_TYPE,
- id : ID.SERVICE_TYPE,
- type : PARAMETER.SELECT,
- isEnabled : false,
- isRequired : true
- },
- SUPPRESS_ROLLBACK : {
- name : NAME.SUPPRESS_ROLLBACK,
- id : ID.SUPPRESS_ROLLBACK,
- type : PARAMETER.BOOLEAN,
- value : false
- },
- SDN_C_PRELOAD_CHECKED : {
- name : NAME.SDN_C_PRELOAD,
- id : ID.SDN_C_PRELOAD,
- type : PARAMETER.CHECKBOX,
- value : true,
- isVisible:true,
- isRequired:false
- },
- SDN_C_PRELOAD_UNCHECKED : {
- name : NAME.SDN_C_PRELOAD,
- id : ID.SDN_C_PRELOAD,
- type : PARAMETER.CHECKBOX,
- value : false,
- isVisible:true,
- isRequired:false
- },
- UPLOAD_SUPPLEMENTORY_DATA_FILE_CHECKED : {
- name : NAME.UPLOAD_SUPPLEMENTORY_DATA_FILE,
- id : ID.UPLOAD_SUPPLEMENTORY_DATA_FILE,
- type : PARAMETER.CHECKBOX,
- value : true,
- isVisible:true,
- isRequired:false
- },
- UPLOAD_SUPPLEMENTORY_DATA_FILE_UNCHECKED : {
- name : NAME.UPLOAD_SUPPLEMENTORY_DATA_FILE,
- id : ID.UPLOAD_SUPPLEMENTORY_DATA_FILE,
- type : PARAMETER.CHECKBOX,
- value : false,
- isVisible:true,
- isRequired:false
- },
- SUPPLEMENTORY_DATA_FILE : {
- name : NAME.SUPPLEMENTORY_DATA_FILE,
- id : ID.SUPPLEMENTORY_DATA_FILE,
- type : PARAMETER.FILE,
- isRequired : false,
- isVisible : true,
- fileData:''
- },
+ AVAILABLE_VOLUME_GROUP: {
+ name: NAME.AVAILABLE_VOLUME_GROUP,
+ id: ID.AVAILABLE_VOLUME_GROUP,
+ type: PARAMETER.SELECT,
+ prompt: PROMPT.AVAILABLE_VOLUME_GROUP,
+ isRequired: true
+ },
+ INSTANCE_NAME: {
+ name: NAME.INSTANCE_NAME,
+ id: ID.INSTANCE_NAME,
+ isRequired: true
+ },
+ LCP_REGION: {
+ name: NAME.LCP_REGION,
+ id: ID.LCP_REGION,
+ type: PARAMETER.SELECT,
+ prompt: PROMPT.LCP_REGION,
+ isRequired: true
+ },
+ VNF_TARGET_PROVSTATUS: {
+ name: NAME.VNF_Target_Prov_Status,
+ id: ID.VNF_TARGETPROVSTATUS,
+ type: PARAMETER.SELECT,
+ prompt: PROMPT.TARGETPROVSTATUS,
+ isRequired: true
+ },
+ LCP_REGION_TEXT_HIDDEN: {
+ id: ID.LCP_REGION_TEXT,
+ isVisible: false
+ },
+ LCP_REGION_TEXT_VISIBLE: {
+ name: NAME.LCP_REGION_TEXT,
+ id: ID.LCP_REGION_TEXT,
+ isRequired: true,
+ isVisible: true
+ },
+ PRODUCT_FAMILY: {
+ name: NAME.PRODUCT_FAMILY,
+ id: ID.PRODUCT_FAMILY,
+ type: PARAMETER.SELECT,
+ prompt: PROMPT.PRODUCT_FAMILY,
+ isRequired: true
+ },
+ AIC_ZONES: {
+ name: NAME.AIC_ZONES,
+ id: ID.AIC_ZONES,
+ type: PARAMETER.SELECT,
+ prompt: PROMPT.AIC_ZONES,
+ isRequired: false
+ },
+ SERVICE_TYPE: {
+ name: NAME.SERVICE_TYPE,
+ id: ID.SERVICE_TYPE,
+ type: PARAMETER.SELECT,
+ prompt: PROMPT.SERVICE_TYPE,
+ isRequired: true
+ },
+ SERVICE_TYPE_DISABLED: {
+ name: NAME.SERVICE_TYPE,
+ id: ID.SERVICE_TYPE,
+ type: PARAMETER.SELECT,
+ isEnabled: false,
+ isRequired: true
+ },
+ SUPPRESS_ROLLBACK: {
+ name: NAME.SUPPRESS_ROLLBACK,
+ id: ID.SUPPRESS_ROLLBACK,
+ type: PARAMETER.BOOLEAN,
+ value: false
+ },
+ SDN_C_PRELOAD_CHECKED: {
+ name: NAME.SDN_C_PRELOAD,
+ id: ID.SDN_C_PRELOAD,
+ type: PARAMETER.CHECKBOX,
+ value: true,
+ isVisible: true,
+ isRequired: false
+ },
+ SDN_C_PRELOAD_UNCHECKED: {
+ name: NAME.SDN_C_PRELOAD,
+ id: ID.SDN_C_PRELOAD,
+ type: PARAMETER.CHECKBOX,
+ value: false,
+ isVisible: true,
+ isRequired: false
+ },
+ UPLOAD_SUPPLEMENTORY_DATA_FILE_CHECKED: {
+ name: NAME.UPLOAD_SUPPLEMENTORY_DATA_FILE,
+ id: ID.UPLOAD_SUPPLEMENTORY_DATA_FILE,
+ type: PARAMETER.CHECKBOX,
+ value: true,
+ isVisible: true,
+ isRequired: false
+ },
+ UPLOAD_SUPPLEMENTORY_DATA_FILE_UNCHECKED: {
+ name: NAME.UPLOAD_SUPPLEMENTORY_DATA_FILE,
+ id: ID.UPLOAD_SUPPLEMENTORY_DATA_FILE,
+ type: PARAMETER.CHECKBOX,
+ value: false,
+ isVisible: true,
+ isRequired: false
+ },
+ SUPPLEMENTORY_DATA_FILE: {
+ name: NAME.SUPPLEMENTORY_DATA_FILE,
+ id: ID.SUPPLEMENTORY_DATA_FILE,
+ type: PARAMETER.FILE,
+ isRequired: false,
+ isVisible: true,
+ fileData: ''
+ },
- SUBSCRIBER_NAME : {
- name : NAME.SUBSCRIBER_NAME,
- id : ID.SUBSCRIBER_NAME,
- type : PARAMETER.SELECT,
- prompt : PROMPT.SUBSCRIBER_NAME,
+ SUBSCRIBER_NAME: {
+ name: NAME.SUBSCRIBER_NAME,
+ id: ID.SUBSCRIBER_NAME,
+ type: PARAMETER.SELECT,
+ prompt: PROMPT.SUBSCRIBER_NAME,
isRequired : true,
isSingleOptionAutoSelected : false
- },
- TENANT_DISABLED : {
- name : NAME.TENANT,
- id : ID.TENANT,
- type : PARAMETER.SELECT,
- isEnabled : false,
- isRequired : true
- },
- TENANT_ENABLED : {
- name : NAME.TENANT,
- id : ID.TENANT,
- type : PARAMETER.SELECT,
- isEnabled : true,
- prompt : PROMPT.TENANT,
- isRequired : true
- }
+ },
+ TENANT_DISABLED: {
+ name: NAME.TENANT,
+ id: ID.TENANT,
+ type: PARAMETER.SELECT,
+ isEnabled: false,
+ isRequired: true
+ },
+ TENANT_ENABLED: {
+ name: NAME.TENANT,
+ id: ID.TENANT,
+ type: PARAMETER.SELECT,
+ isEnabled: true,
+ prompt: PROMPT.TENANT,
+ isRequired: true
+ }
};
return {
- ID : ID,
- KEY : KEY,
- NAME : NAME,
- PARAMETER : PARAMETER,
- PROMPT : PROMPT,
- STATUS : STATUS,
- STYLE : STYLE,
- ERROR : ERROR,
+ ID: ID,
+ KEY: KEY,
+ NAME: NAME,
+ PARAMETER: PARAMETER,
+ PROMPT: PROMPT,
+ STATUS: STATUS,
+ STYLE: STYLE,
+ ERROR: ERROR,
}
-} ]);
+}]);
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/constants/vidConfiguration.js b/vid-app-common/src/main/webapp/app/vid/scripts/constants/vidConfiguration.js index f5606616..4341a4ca 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/constants/vidConfiguration.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/constants/vidConfiguration.js @@ -91,7 +91,10 @@ appDS2.constant("VIDCONFIGURATION", (function() { *
*/
var COMPONENT_LIST_NAMED_QUERY_ID = "0367193e-c785-4d5f-9cb8-7bc89dc9ddb7";
- var MACRO_SERVICES = [];
+ var MACRO_SERVICES = ["93150ffa-00c6-4ea0-85f2-3536ca46ebd2",
+ "2b54297f-72e7-4a94-b451-72df88d0be0b",
+ "d27e42cf-087e-4d31-88ac-6c4b7585f800",
+ "ec0c4bab-c272-4dab-b087-875031bb0c9f","0311f998-9268-4fd6-bbba-afff15087b72"];
return {
ASDC_MODEL_STATUS : ASDC_MODEL_STATUS,
MSO_MAX_POLLS : MSO_MAX_POLLS,
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/InstantiationController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/InstantiationController.js index dcbf3e6e..b0fcb11e 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/InstantiationController.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/InstantiationController.js @@ -33,8 +33,9 @@ $scope.defaultBaseUrl = "";
$scope.responseTimeoutMsec = 60000;
$scope.properties = UtilityService.getProperties();
- $scope.init = function() {
+ $scope.isPermitted = $location.search().isPermitted;
+ $scope.init = function() {
/*
* These 2 statements should be included in non-test code.
*/
@@ -46,7 +47,7 @@ var polls = PropertyService.retrieveMsoMaxPolls();
PropertyService.setMsoMaxPolls(polls);
- PropertyService.setServerResponseTimeoutMsec(10000);
+ PropertyService.setServerResponseTimeoutMsec(30000);
/*
* Common parameters that shows an example of how the view edit screen
@@ -224,11 +225,17 @@ console.log("Removing Service " + $scope.service.instance.name);
- DataService.setALaCarte (true);
+ if ( $scope.isMacro() ) {
+ DataService.setALaCarte (false);
+ }
+ else {
+ DataService.setALaCarte (true);
+ }
+ DataService.setMacro($scope.isMacro());
DataService.setInventoryItem(serviceInstance);
DataService.setModelInfo(COMPONENT.SERVICE, {
- "modelInvariantId": serviceInstance[FIELD.ID.MODEL_INVAR_ID],
+ "modelInvariantId": $scope.service.model.service.invariantUuid,
"modelVersion": $scope.service.model.service.version,
"modelNameVersionId": $scope.service.model.service.uuid,
"modelName": $scope.service.model.service.name,
@@ -345,6 +352,9 @@ $scope.deleteVnf = function(serviceObject, vnf) {
+
+ debugger;
+
console.log("Removing VNF " + vnf.name);
var serviceInstance = serviceObject.object;
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceModelController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceModelController.js index dd2cf73f..731c2f2e 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceModelController.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceModelController.js @@ -39,8 +39,9 @@ $http.get(pathQuery)
.then(function successCallback(response) {
$scope.services = [];
- if (angular.isArray(response.data)) {
- $scope.services = response.data;
+ if (angular.isArray(response.data.services)) {
+ wholeData = response.data.services;
+ $scope.services = $scope.filterDataWithHigerVersion(wholeData);
$scope.viewPerPage=10;
$scope.totalPage=$scope.services.length/$scope.viewPerPage;
$scope.sortBy=COMPONENT.NAME;
@@ -56,11 +57,72 @@ $scope.error = true;
$scope.isSpinnerVisible = false;
}
+ $scope.deployButtonType = response.data.readOnly ? 'disabled' : 'primary';
}, function errorCallback(response) {
console.log("Error: " + response);
});
}
-
+ $scope.isFiltered=function(arr,obj){
+ var filtered = false;
+ if(arr.length>0){
+ for(var i=0;i<arr.length;i++){
+ if((arr[i].name == obj.name) && (obj.invariantUUID == arr[i].invariantUUID)){
+ filtered = true;
+ }
+ }
+ }
+ return filtered;
+ }
+ var wholeData=[];
+ $scope.filterDataWithHigerVersion = function(serviceData){
+ var fiterDataServices = [];
+ for(var i=0;i<serviceData.length;i++){
+ var higherVersion = serviceData[i];
+ if(!$scope.isFiltered(fiterDataServices,serviceData[i])){
+ for(var j=i;j<serviceData.length;j++){
+ if((serviceData[i].invariantUUID.trim() == serviceData[j].invariantUUID.trim()) && (serviceData[i].name.trim() == serviceData[j].name.trim()) && (parseFloat(serviceData[j].version.trim())>=parseFloat(serviceData[i].version.trim()))){
+ var data = $scope.isThisHigher(fiterDataServices,serviceData[j]);
+ if(data.isHigher){
+ fiterDataServices[data.index] = serviceData[j];
+ }
+ }
+ }
+ }
+ }
+ return fiterDataServices;
+ }
+
+ $scope.isThisHigher = function(arr,obj){
+ var returnObj = {
+ isHigher:false,
+ index:0
+ };
+ if(arr.length>0){
+ var isNotMatched = true;
+ for(var i=0;i<arr.length;i++){
+ if((arr[i].name == obj.name) && (arr[i].invariantUUID == obj.invariantUUID ) && (arr[i].version<obj.version) ){
+ isNotMatched = false;
+ returnObj = {
+ isHigher:true,
+ index:i
+ };
+ }
+ }
+ if(isNotMatched && !$scope.isFiltered(arr,obj)){
+ returnObj = {
+ isHigher:true,
+ index:arr.length
+ };
+ }
+ }else{
+ returnObj = {
+ isHigher:true,
+ index:0
+ }
+ }
+ return returnObj;
+ }
+
$scope.init = function() {
var msecs = PropertyService.retrieveMsoMaxPollingIntervalMsec();
PropertyService.setMsoMaxPollingIntervalMsec(msecs);
@@ -69,7 +131,7 @@ PropertyService.setMsoMaxPolls(polls);
//PropertyService.setMsoBaseUrl("testmso");
- PropertyService.setServerResponseTimeoutMsec(10000);
+ PropertyService.setServerResponseTimeoutMsec(30000);
}
$scope.prevPage = function() {
@@ -95,6 +157,8 @@ DataService.setModelInfo(COMPONENT.SERVICE, {
"modelInvariantId": serviceModel.service.invariantUuid,
"modelVersion": serviceModel.service.version,
+ "serviceType" : serviceModel.service.serviceType,
+ "serviceRole": serviceModel.service.serviceRole,
"modelNameVersionId": serviceModel.service.uuid,
"modelName": serviceModel.service.name,
"description": serviceModel.service.description,
@@ -121,6 +185,8 @@ "category":serviceModel.service.category,
"serviceEcompNaming": serviceModel.service.serviceEcompNaming,
"inputs": serviceModel.service.inputs,
+ "serviceType": serviceModel.service.serviceType,
+ "serviceRole": serviceModel.service.serviceRole,
"displayInputs": convertedAsdcModel.completeDisplayInputs
});
};
@@ -156,6 +222,27 @@ });
};
+ $scope.tableData=[];
+ var oldData=[];
+ $scope.loadPreviousVersionData=function(invariantUUID , name, version){
+ $scope.tableData =[];
+ oldData=[];
+ for(var i=0;i<wholeData.length;i++){
+ if(wholeData[i].invariantUUID == invariantUUID && wholeData[i].name == name && version!=wholeData[i].version){
+ oldData.push(wholeData[i]);
+ }
+ }
+ $scope.tableData = oldData;
+ $scope.createType = "Previous Version";
+ var broadcastType = "createTableComponent";
+ $scope.componentName = name;
+ $scope.$broadcast(broadcastType, {
+ componentId : COMPONENT.OLDVERSION,
+ callbackFunction : function(response) {
+ }
+ });
+ }
+
$scope.refreshSubs = function(subscriberId, serviceType, serviceInstanceId) {
$scope.status = FIELD.STATUS.FETCHING_SUBSCRIBER_LIST_AAI;
$scope.init();
@@ -206,14 +293,15 @@ }).then(function(response) {
angular.forEach(response.data, function(value, key) {
angular.forEach(value, function(subVal, key) {
- var newVal = { "id" : subVal[FIELD.ID.SERVICE_ID], "description" : subVal[FIELD.ID.SERVICE_DESCRIPTION] };
+ var newVal = { "id" : subVal[FIELD.ID.SERVICE_ID], "description" : subVal[FIELD.ID.SERVICE_DESCRIPTION] ,"isPermitted" : subVal[FIELD.ID.IS_PERMITTED] };
serviceIdList.push(newVal);
DataService.setServiceIdList(serviceIdList);
$location.search({
"subscriberId": subscriberId,
"serviceType": serviceType,
- "serviceInstanceId": serviceInstanceId
+ "serviceInstanceId": serviceInstanceId,
+ "isPermitted": newVal.isPermitted.toString()
});
$location.path(COMPONENT.INSTANTIATE_PATH);
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.js index eac79ed5..84d27a23 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.js @@ -20,106 +20,106 @@ "use strict";
-appDS2.controller("aaiSubscriberController", [ "COMPONENT", "FIELD", "PARAMETER", "DataService", "PropertyService", "$scope", "$http", "$timeout", "$location", "$log", "$route", "VIDCONFIGURATION", "UtilityService", "vidService","AaiService",
- function(COMPONENT, FIELD, PARAMETER, DataService, PropertyService, $scope, $http, $timeout, $location, $log, $route, VIDCONFIGURATION, UtilityService, vidService, AaiService) {
-
- $scope.showVnfDetails = function(vnf) {
- console.log("showVnfDetails");
- DataService.setVnfInstanceId(COMPONENT.VNF_INSTANCE_ID);
- DataService
- .setInventoryItem(aaiResult[FIELD.ID.INVENTORY_RESPONSE_ITEMS][FIELD.ID.INVENTORY_RESPONSE_ITEM][0]);
-
- $scope.$broadcast(COMPONENT.SHOW_COMPONENT_DETAILS, {
- componentId : COMPONENT.VNF,
- callbackFunction : callbackFunction
- });
- }
- $scope.popup = new Object();
-
-
- $scope.isPopupVisible = false;
- $scope.defaultBaseUrl = "";
- $scope.responseTimeoutMsec = 60000;
-
- $scope.serviceTypes=[ FIELD.PROMPT.SELECT_SERVICE, COMPONENT.UCPE_VMS, COMPONENT.SDN_L3_BONDING, COMPONENT.SDN_ETHERNET_INTERNET];
- $scope.defaultSubscriberName=[ FIELD.PROMPT.SELECT_SUB ];
-
- var callbackFunction = function(response) {
- alert(response);
- };
-
- $scope.getSubs = function() {
- $scope.init();
- $scope.fetchSubs(FIELD.PROMPT.FETCHING_SUBS);
- $scope.fetchServices();
-
- };
-
- $scope.cancelCreateSI = function(){
-
- window.location.href = COMPONENT.WELCOME_PATH;
-
- };
-
- $scope.getServiceTypes = function(globalCustomerId){
- DataService.setGlobalCustomerId(globalCustomerId);
- DataService.setServiceIdList($scope.customerList)
-
- if (globalCustomerId !== "" && globalCustomerId !== undefined ) {
- window.location.href = COMPONENT.SERVICE_TYPE_LIST_PATH + $scope.serviceTypeList;
- }
- }
-
- $scope.refreshServiceTypes = function(globalCustomerId){
- DataService.setGlobalCustomerId(globalCustomerId);
-
- $scope.getServiceTypesList();
- }
-
- $scope.subId="";
- $scope.createSubscriberName="";
- $scope.serviceTypeList={};
- $scope.custSubList=[];
- $scope.getServiceTypesList = function(){
- var notFound = true;
- var globalCustomerId = DataService.getGlobalCustomerId();
- $scope.custSubList = DataService.getServiceIdList();
- if(globalCustomerId !== "" && globalCustomerId !== undefined ){
- $scope.subId=globalCustomerId;
- $scope.init();
- $scope.status = FIELD.PROMPT.FETCHING_SERVICE_TYPES;
- DataService.setGlobalCustomerId(globalCustomerId);
-
- AaiService.getSubscriptionServiceTypeList(DataService
- .getGlobalCustomerId(), function(response) {
- notFound = false;
- $scope.setProgress(100); // done
- $scope.status = FIELD.STATUS.DONE;
- $scope.isSpinnerVisible = false;
- $scope.serviceTypeList = response;
- for(var i=0; i<$scope.custSubList.length;i++){
- if(globalCustomerId === $scope.custSubList[i].globalCustomerId){
- $scope.createSubscriberName = $scope.custSubList[i].subscriberName;
- }
- }
- }, function(response) { // failure
- $scope.showError(FIELD.ERROR.AAI);
- $scope.errorMsg = FIELD.ERROR.FETCHING_SERVICE_TYPES + response.status;
- $scope.errorDetails = response.data;
- });
- } else {
- alert(FIELD.ERROR.SELECT);
- }
-
- };
-
- $scope.subList = [];
- $scope.getAaiServiceModels = function(selectedServicetype,subName){
- DataService.setGlobalCustomerId(selectedServicetype);
- DataService.setServiceIdList($scope.serviceTypeList)
- DataService.setSubscriberName(subName);
-
- DataService.setSubscribers($scope.custSubList);
+appDS2.controller("aaiSubscriberController", ["COMPONENT", "FIELD", "PARAMETER", "DataService", "PropertyService", "$scope", "$http", "$timeout", "$location", "$log", "$route", "VIDCONFIGURATION", "UtilityService", "vidService", "AaiService",
+ function (COMPONENT, FIELD, PARAMETER, DataService, PropertyService, $scope, $http, $timeout, $location, $log, $route, VIDCONFIGURATION, UtilityService, vidService, AaiService) {
+
+ $scope.showVnfDetails = function (vnf) {
+ console.log("showVnfDetails");
+ DataService.setVnfInstanceId(COMPONENT.VNF_INSTANCE_ID);
+ DataService
+ .setInventoryItem(aaiResult[FIELD.ID.INVENTORY_RESPONSE_ITEMS][FIELD.ID.INVENTORY_RESPONSE_ITEM][0]);
+
+ $scope.$broadcast(COMPONENT.SHOW_COMPONENT_DETAILS, {
+ componentId: COMPONENT.VNF,
+ callbackFunction: callbackFunction
+ });
+ }
+ $scope.popup = new Object();
+
+
+ $scope.isPopupVisible = false;
+ $scope.defaultBaseUrl = "";
+ $scope.responseTimeoutMsec = 60000;
+
+ $scope.serviceTypes = [FIELD.PROMPT.SELECT_SERVICE, COMPONENT.UCPE_VMS, COMPONENT.SDN_L3_BONDING, COMPONENT.SDN_ETHERNET_INTERNET];
+ $scope.defaultSubscriberName = [FIELD.PROMPT.SELECT_SUB];
+
+ var callbackFunction = function (response) {
+ alert(response);
+ };
+
+ $scope.getSubs = function () {
+ $scope.init();
+ $scope.fetchSubs(FIELD.PROMPT.FETCHING_SUBS);
+ $scope.fetchServices();
+
+ };
+
+ $scope.cancelCreateSI = function () {
+
+ window.location.href = COMPONENT.WELCOME_PATH;
+
+ };
+
+ $scope.getServiceTypes = function (globalCustomerId) {
+ DataService.setGlobalCustomerId(globalCustomerId);
+ DataService.setServiceIdList($scope.customerList)
+
+ if (globalCustomerId !== "" && globalCustomerId !== undefined) {
+ window.location.href = COMPONENT.SERVICE_TYPE_LIST_PATH + $scope.serviceTypeList;
+ }
+ }
+
+ $scope.refreshServiceTypes = function (globalCustomerId) {
+ DataService.setGlobalCustomerId(globalCustomerId);
+
+ $scope.getServiceTypesList();
+ }
+
+ $scope.subId = "";
+ $scope.createSubscriberName = "";
+ $scope.serviceTypeList = {};
+ $scope.custSubList = [];
+ $scope.getServiceTypesList = function () {
+ var notFound = true;
+ var globalCustomerId = DataService.getGlobalCustomerId();
+ $scope.custSubList = DataService.getServiceIdList();
+ if (globalCustomerId !== "" && globalCustomerId !== undefined) {
+ $scope.subId = globalCustomerId;
+ $scope.init();
+ $scope.status = FIELD.PROMPT.FETCHING_SERVICE_TYPES;
+ DataService.setGlobalCustomerId(globalCustomerId);
+
+ AaiService.getSubscriptionServiceTypeList(DataService
+ .getGlobalCustomerId(), function (response) {
+ notFound = false;
+ $scope.setProgress(100); // done
+ $scope.status = FIELD.STATUS.DONE;
+ $scope.isSpinnerVisible = false;
+ $scope.serviceTypeList = response;
+ for (var i = 0; i < $scope.custSubList.length; i++) {
+ if (globalCustomerId === $scope.custSubList[i].globalCustomerId) {
+ $scope.createSubscriberName = $scope.custSubList[i].subscriberName;
+ }
+ }
+ }, function (response) { // failure
+ $scope.showError(FIELD.ERROR.AAI);
+ $scope.errorMsg = FIELD.ERROR.FETCHING_SERVICE_TYPES + response.status;
+ $scope.errorDetails = response.data;
+ });
+ } else {
+ alert(FIELD.ERROR.SELECT);
+ }
+
+ };
+
+ $scope.subList = [];
+ $scope.getAaiServiceModels = function (selectedServicetype, subName) {
+ DataService.setGlobalCustomerId(selectedServicetype);
+ DataService.setServiceIdList($scope.serviceTypeList)
+ DataService.setSubscriberName(subName);
+
+ DataService.setSubscribers($scope.custSubList);
if (selectedServicetype !== "" && selectedServicetype !== 'undefined') {
$location.path(COMPONENT.CREATE_INSTANCE_PATH);
@@ -136,28 +136,30 @@ appDS2.controller("aaiSubscriberController", [ "COMPONENT", "FIELD", "PARAMETER" $scope.custSubList = DataService.getSubscribers();
for(var i=0; i<$scope.serviceTypeList.length;i++){
if(parseInt(serviceTypeId) === i ){
- $scope.serviceTypeName = $scope.serviceTypeList[i];
+ $scope.serviceTypeName = $scope.serviceTypeList[i].name;
+ }
}
- };
+ ;
for(var i=0; i<$scope.custSubList.length;i++){
if($scope.createSubscriberName === $scope.custSubList[i].subscriberName){
globalCustomerId = $scope.custSubList[i].globalCustomerId;
globalCustId = globalCustomerId;
}
- };
-
+ }
+ ;
var pathQuery ="";
-
+
if(null !== globalCustomerId && "" !== globalCustomerId && undefined !== globalCustomerId
&& null !== serviceTypeId && "" !== serviceTypeId && undefined !== serviceTypeId){
pathQuery = COMPONENT.SERVICES_PATH +globalCustomerId+"/"+$scope.serviceTypeName;
}
-
+
var namedQueryId='6e806bc2-8f9b-4534-bb68-be91267ff6c8';
AaiService.getServiceModelsByServiceType(namedQueryId,globalCustomerId,$scope.serviceTypeName,function(response) { // success
$scope.services = [];
if (angular.isArray(response.data['inventory-response-item'])) {
- $scope.services = response.data['inventory-response-item'][0]['inventory-response-items']['inventory-response-item'];
+ wholeData = response.data['inventory-response-item'][0]['inventory-response-items']['inventory-response-item'];
+ $scope.services = $scope.filterDataWithHigerVersion(response.data['inventory-response-item'][0]['inventory-response-items']['inventory-response-item']);
$scope.serviceType = response.data['inventory-response-item'][0]['service-subscription']['service-type'];
$scope.viewPerPage=10;
$scope.totalPage=$scope.services.length/$scope.viewPerPage;
@@ -180,31 +182,32 @@ appDS2.controller("aaiSubscriberController", [ "COMPONENT", "FIELD", "PARAMETER" $scope.errorMsg = FIELD.ERROR.FETCHING_SERVICES+ response.status;
$scope.errorDetails = response.data;
});
-
+
};
-
+
var globalCustId;// This value will be assigned only on create new service instance screen-macro
$scope.createType = "a la carte";
$scope.deployService = function(service,hideServiceFields) {
hideServiceFields = hideServiceFields|| false;
var temp = service;
service.uuid = service['service-instance']['model-version-id'];
-
+
console.log("Instantiating ASDC service " + service.uuid);
-
+
$http.get('rest/models/services/' + service.uuid)
.then(function successCallback(getServiceResponse) {
getServiceResponse.data['service'].serviceTypeName =$scope.serviceTypeName ;
getServiceResponse.data['service'].createSubscriberName =$scope.createSubscriberName ;
var serviceModel = getServiceResponse.data;
DataService.setServiceName(serviceModel.service.name);
-
+
DataService.setModelInfo(COMPONENT.SERVICE, {
"modelInvariantId": serviceModel.service.invariantUuid,
"modelVersion": serviceModel.service.version,
"modelNameVersionId": serviceModel.service.uuid,
"modelName": serviceModel.service.name,
- "description": serviceModel.service.description,
+ "description": serviceModel.service.description,"serviceType": serviceModel.service.serviceType,
+ "serviceRole": serviceModel.service.serviceRole,
"category":serviceModel.service.category,
"serviceTypeName":serviceModel.service.serviceTypeName,
"createSubscriberName":serviceModel.service.createSubscriberName
@@ -238,21 +241,23 @@ appDS2.controller("aaiSubscriberController", [ "COMPONENT", "FIELD", "PARAMETER" "inputs": serviceModel.service.inputs,
"displayInputs": convertedAsdcModel.completeDisplayInputs,
"serviceTypeName":serviceModel.service.serviceTypeName,
- "createSubscriberName":serviceModel.service.createSubscriberName
- });
- };
-
+ "createSubscriberName":serviceModel.service.createSubscriberName,
+ "serviceType": serviceModel.service.serviceType,
+ "serviceRole": serviceModel.service.serviceRole
+ });}
+ ;
+
$scope.$broadcast(broadcastType, {
componentId : COMPONENT.SERVICE,
callbackFunction : function(response) {
if (response.isSuccessful) {
vidService.setModel(serviceModel);
-
+
var subscriberId = "Not Found";
var serviceType = "Not Found";
-
+
var serviceInstanceId = response.instanceId;
-
+
for (var i = 0; i < response.control.length; i++) {
if (response.control[i].id == "subscriberName") {
subscriberId = response.control[i].value;
@@ -260,645 +265,751 @@ appDS2.controller("aaiSubscriberController", [ "COMPONENT", "FIELD", "PARAMETER" serviceType = response.control[i].value;
}
}
-
-
+
+
$scope.refreshSubs(subscriberId,serviceType,serviceInstanceId);
-
+
}
}
});
-
+
}, function errorCallback(response) {
console.log("Error: " + response);
});
};
-
- $scope.cancelCreateSIType = function(){
-
- window.location.href = COMPONENT.SERVICE_MODLES_INSTANCES_SUBSCRIBERS_PATH;
-
+ $scope.isFiltered=function(arr,obj){
+ var filtered = false;
+ if(arr.length>0){
+ for(var i=0;i<arr.length;i++){
+ if(obj['extra-properties']['extra-property'] && (obj['extra-properties']['extra-property'][2]['property-value'] == arr[i]['extra-properties']['extra-property'][2]['property-value'])
+ && (obj['extra-properties']['extra-property'][4]['property-value'] == arr[i]['extra-properties']['extra-property'][4]['property-value'])){
+ filtered = true;
+ }
+ }
}
-
- $scope.fetchServices = function() {
- var serviceIdList = [];
-
- AaiService.getServices2(function(response) { // success
- DataService.setServiceIdList(response);
- }, function(response) { // failure
- $scope.showError(FIELD.ERROR.AAI);
- $scope.errorMsg = FIELD.ERROR.FETCHING_SERVICES + response.status;
- $scope.errorDetails = response.data;
- });
- }
-
- $scope.refreshSubs = function() {
- $scope.init();
- $scope.fetchSubs(FIELD.PROMPT.REFRESH_SUB_LIST);
- $scope.fetchServices();
- };
-
- $scope.fetchSubs = function(status) {
- $scope.status = status;
-
- AaiService.getSubList(function(response) { // sucesss
- $scope.setProgress(100); // done
- $scope.status = FIELD.STATUS.DONE;
- $scope.isSpinnerVisible = false;
- $scope.customerList = response;
- }, function(response) { // failure
- $scope.showError(FIELD.ERROR.AAI);
- $scope.errorMsg = FIELD.ERROR.AAI_FETCHING_CUST_DATA + response.status;
- $scope.errorDetails = response.data;
- });
- }
-
-
- $scope.getSubDetails = function(request) {
-
- $scope.init();
- $scope.selectedSubscriber = $location.search().selectedSubscriber;
- $scope.selectedServiceInstance = $location.search().selectedServiceInstance;
- $scope.status = FIELD.STATUS.FETCHING_SUB_DETAILS + $scope.selectedSubscriber;
-
- $scope.displayData = [];
- AaiService.getSubDetails($scope.selectedSubscriber, $scope.selectedServiceInstance, function(displayData, subscriberName) {
- $scope.displayData = displayData;
- $scope.viewPerPage=10;
- $scope.totalPage=$scope.displayData.length/$scope.viewPerPage;
- $scope.scrollViewPerPage=2;
- $scope.currentPage=1;
- $scope.searchCategory;
- $scope.searchString="";
- $scope.currentPageNum=1;
- $scope.defaultSort=COMPONENT.SUBSCRIBER_NAME;
- $scope.setProgress(100); // done
- $scope.status = FIELD.STATUS.DONE;
- $scope.isSpinnerVisible = false;
- $scope.subscriberName = subscriberName;
- }, function(response) {
- $scope.showError(FIELD.ERROR.AAI);
- $scope.errorMsg = FIELD.ERROR.AAI_FETCHING_CUST_DATA + response.status;
- $scope.errorDetails = response.data;
- });
- }
-
-
- $scope.$on(COMPONENT.MSO_DELETE_REQ, function(event, request) {
- // $log.debug("deleteInstance: request:");
- // $log.debug(request);
- $scope.init();
-
- $http.post($scope.baseUrl + request.url, {
- requestDetails: request.requestDetails
- },{
- timeout: $scope.responseTimeoutMsec
- }).then($scope.handleInitialResponse)
- ["catch"]($scope.handleServerError);
- });
-
- $scope.init = function() {
-
- //PropertyService.setAaiBaseUrl("testaai");
- //PropertyService.setAsdcBaseUrl("testasdc");
-
- // takes a default value, retrieves the prop value from the file system and sets it
- var msecs = PropertyService.retrieveMsoMaxPollingIntervalMsec();
- PropertyService.setMsoMaxPollingIntervalMsec(msecs);
-
- // takes a default value, retrieves the prop value from the file system and sets it
- var polls = PropertyService.retrieveMsoMaxPolls();
- PropertyService.setMsoMaxPolls(polls);
-
- //PropertyService.setMsoBaseUrl("testmso");
- PropertyService.setServerResponseTimeoutMsec();
-
- /*
- * Common parameters that would typically be set when the page is
- * displayed for a specific service instance id.
- */
-
- $scope.baseUrl = $scope.defaultBaseUrl;
-
- $scope.isSpinnerVisible = true;
- $scope.isProgressVisible = true;
- $scope.isPopupVisible = true;
- $scope.requestId = "";
- $scope.error = "";
- $scope.pollAttempts = 0;
- $scope.log = "";
- $scope.enableCloseButton(false);
- $scope.resetProgress();
- $scope.setProgress(2); // Show "a little" progress
- }
-
- $scope.getComponentList = function(event, request) {
-
- $scope.isSpinnerVisible = true;
- $scope.isProgressVisible = true;
- $scope.isPopupVisible = true;
- $scope.requestId = "";
- $scope.error = "";
- $scope.pollAttempts = 0;
- $scope.log = "";
-
- $scope.resetProgress();
- $scope.setProgress(2); // Show "a little" progress
-
- $scope.globalCustomerId = $location.search().subscriberId;
- $scope.serviceType = $location.search().serviceType;
- $scope.serviceInstanceId = $location.search().serviceInstanceId;
- $scope.subscriberName = $location.search().subscriberName;
-
- //$scope.getAsdcModel($location.search().modelUuid);
-
- $scope.namedQueryId = VIDCONFIGURATION.COMPONENT_LIST_NAMED_QUERY_ID;
- $scope.status = FIELD.STATUS.FETCHING_SERVICE_INST_DATA + $scope.serviceInstanceId;
-
- AaiService.runNamedQuery($scope.namedQueryId, $scope.globalCustomerId, $scope.serviceType, $scope.serviceInstanceId,
- function(response) { //success
- $scope.handleInitialResponseInventoryItems(response);
- $scope.setProgress(100); // done
- $scope.status = FIELD.STATUS.DONE;
- $scope.isSpinnerVisible = false;
- },
- function(response){ //failure
- $scope.showError(FIELD.ERROR.AAI);
- $scope.errorMsg = FIELD.ERROR.FETCHING_SERVICE_INSTANCE_DATA + response.status;
- $scope.errorDetails = response.data;
+ return filtered;
}
- );
-
- }
-
- $scope.handleServerError = function(response, status) {
- alert(response.statusText);
- }
-
- $scope.getAsdcModel = function(disData) {
-
- console.log ("disData"); console.log (JSON.stringify (disData, null, 4));
-
- if ( !(UtilityService.hasContents (disData.aaiModelVersionId)) ) {
- $scope.errorMsg = FIELD.ERROR.MODEL_VERSION_ID_MISSING;
- alert($scope.errorMsg);
- return;
- }
-
- // aaiModelVersionId is the model uuid
- var pathQuery = COMPONENT.SERVICES_PATH + disData.aaiModelVersionId;
- $http({
- method: 'GET',
- url: pathQuery
- }).then(function successCallback(response) {
- vidService.setModel(response.data);
- window.location.href = COMPONENT.INSTANTIATE_ROOT_PATH + disData.globalCustomerId + COMPONENT.SUBSCRIBERNAME_SUB_PATH + disData.subscriberName + COMPONENT.SERVICETYPE_SUB_PATH + disData.serviceType + COMPONENT.SERVICEINSTANCEID_SUB_PATH + disData.serviceInstanceId;
- console.log("aaiSubscriber getAsdcModel DONE!!!!");
- }, function errorCallback(response) {
- console.log("aaiSubscriber getAsdcModel - No matching model found matching the A&AI model version ID = " + disData.aaiModelVersionId);
- $scope.errorMsg = FIELD.ERROR.NO_MATCHING_MODEL_AAI + disData.aaiModelVersionId;
- alert($scope.errorMsg);
- });
-
- }
-
- $scope.getTenants = function(globalCustomerId) {
- $http.get(FIELD.ID.AAI_GET_TENTANTS + globalCustomerId)
- .then(function successCallback(response) {
- return response.data;
- //$location.path("/instantiate");
- }, function errorCallback(response) {
- //TODO
- });
- }
-
- $scope.handleInitialResponseInventoryItems = function(response) {
-
- $scope.inventoryResponseItemList = response.data[FIELD.ID.INVENTORY_RESPONSE_ITEM]; // get data from json
- console.log($scope.inventoryResponseItemList.toString());
-
- $scope.displayData = [];
- $scope.vnfs = [];
-
- $scope.counter = 100;
-
- $scope.subscriberName = "";
- // just look up the subscriber name in A&AI here...
- AaiService.getSubscriberName($scope.globalCustomerId, function(response) {
- $scope.subscriberName = response;
- DataService.setSubscriberName($scope.subscriberName);
-
- angular.forEach($scope.inventoryResponseItemList, function(inventoryResponseItem, key) {
-
- $scope.inventoryResponseItem = inventoryResponseItem;
-
- $scope.service.instance = {
- "name": $scope.inventoryResponseItem[FIELD.ID.SERVICE_INSTANCE][FIELD.ID.SERVICE_INSTANCE_NAME],
- "serviceInstanceId": $scope.serviceInstanceId,
- "serviceType": $scope.serviceType,
- "globalCustomerId": $scope.globalCustomerId,
- "subscriberName": $scope.subscriberName,
- "id": $scope.serviceInstanceId,
- "inputs": {
- "a": {
- "type": PARAMETER.STRING,
- "description": FIELD.PROMPT.VAR_DESCRIPTION_A,
- "default": FIELD.PROMPT.DEFAULT_A
- },
- "b": {
- "type": PARAMETER.STRING,
- "description": FIELD.PROMPT.VAR_DESCRIPTION_B,
- "default": FIELD.PROMPT.DEFAULT_B
- },
- },
- "object": $scope.inventoryResponseItem[FIELD.ID.SERVICE_INSTANCE],
- "vnfs": [],
- "networks": []
- }
-
- if (inventoryResponseItem[FIELD.ID.INVENTORY_RESPONSE_ITEMS] != null) {
-
- angular.forEach(inventoryResponseItem[FIELD.ID.INVENTORY_RESPONSE_ITEMS][FIELD.ID.INVENTORY_RESPONSE_ITEM], function(subInventoryResponseItem, key) {
- // i expect to find vnfs now
-
- if (subInventoryResponseItem[FIELD.ID.L3_NETWORK] != null) {
- var l3NetworkObject = subInventoryResponseItem[FIELD.ID.L3_NETWORK];
- var l3Network = { "id": $scope.counter++,
- "name": l3NetworkObject[FIELD.ID.NETWORK_NAME],
- "itemType": FIELD.ID.L3_NETWORK,
- "nodeId": l3NetworkObject[FIELD.ID.NETWORK_ID],
- "nodeType": l3NetworkObject[FIELD.ID.NETWORK_TYPE],
- "nodeStatus": l3NetworkObject[FIELD.ID.ORCHESTRATION_STATUS],
- "object": l3NetworkObject,
- "nodes": [],
- "subnets": []
- };
- if (subInventoryResponseItem[FIELD.ID.INVENTORY_RESPONSE_ITEMS] != null) {
- //console.log ("subInventoryResponseItem[FIELD.ID.INVENTORY_RESPONSE_ITEMS]=");
- //console.log (JSON.stringify (subInventoryResponseItem[FIELD.ID.INVENTORY_RESPONSE_ITEMS], null, 4 ));
- angular.forEach(subInventoryResponseItem[FIELD.ID.INVENTORY_RESPONSE_ITEMS][FIELD.ID.INVENTORY_RESPONSE_ITEM], function(subSubInventoryResponseItem, key) {
- //console.log (JSON.stringify (subSubInventoryResponseItem, null, 4 ));
- var subnet = {};
- var subnetObject;
- if (subSubInventoryResponseItem[FIELD.ID.SUB_NET] != null) {
- subnetObject = subSubInventoryResponseItem[FIELD.ID.SUB_NET];
- subnet = {
- "subnet-id": subnetObject[FIELD.ID.SUBNET_ID],
- "subnet-name": subnetObject[FIELD.ID.SUBNET_NAME],
- "gateway-address": subnetObject[FIELD.ID.GATEWAY_ADDRESS],
- "network-start-address": subnetObject[FIELD.ID.NETWORK_START_ADDRESS],
- "cidr-mask": subnetObject[FIELD.ID.CIDR_MASK]
- };
- l3Network.subnets.push(subnet);
- }
- });
+ var wholeData=[];
+ $scope.filterDataWithHigerVersion = function(serviceData){
+ var fiterDataServices = [];
+ for(var i=0;i<serviceData.length;i++){
+ var higherVersion = serviceData[i];
+ if(!$scope.isFiltered(fiterDataServices,serviceData[i])){
+ for(var j=i;j<serviceData.length;j++){
+ if(serviceData[i]['extra-properties']['extra-property'] && serviceData[j]['extra-properties']['extra-property'] && (serviceData[i]['extra-properties']['extra-property'][4]['property-value'] == serviceData[j]['extra-properties']['extra-property'][4]['property-value'])
+ && (serviceData[i]['extra-properties']['extra-property'][2]['property-value'] == serviceData[j]['extra-properties']['extra-property'][2]['property-value'])
+ && (parseFloat(serviceData[j]['extra-properties']['extra-property'][6]['property-value'])>=parseFloat(serviceData[i]['extra-properties']['extra-property'][6]['property-value']))){
+ var data = $scope.isThisHigher(fiterDataServices,serviceData[j]);
+ if(data.isHigher){
+ fiterDataServices[data.index] = serviceData[j];
}
- $scope.service.instance[FIELD.ID.NETWORKS].push(l3Network);
}
-
- if (subInventoryResponseItem[FIELD.ID.GENERIC_VNF] != null) {
- var genericVnfObject = subInventoryResponseItem[FIELD.ID.GENERIC_VNF];
-
- var genericVnf = {
- "name": genericVnfObject[FIELD.ID.VNF_NAME],
- "id": $scope.counter++,
- "itemType": COMPONENT.VNF,
- "nodeType": genericVnfObject[FIELD.ID.VNF_TYPE],
- "nodeId": genericVnfObject[FIELD.ID.VNF_ID],
- "nodeStatus": genericVnfObject[FIELD.ID.ORCHESTRATION_STATUS],
- "object": genericVnfObject,
- "vfModules": [],
- "volumeGroups": [],
- "availableVolumeGroups": []
- };
- $scope.service.instance[FIELD.ID.VNFS].push(genericVnf);
-
- // look for volume-groups
- if (subInventoryResponseItem[FIELD.ID.INVENTORY_RESPONSE_ITEMS] != null) {
- angular.forEach(subInventoryResponseItem[FIELD.ID.INVENTORY_RESPONSE_ITEMS][FIELD.ID.INVENTORY_RESPONSE_ITEM], function(vfmodules, key) {
-
- if (vfmodules[FIELD.ID.VOLUME_GROUP] != null) {
- var volumeGroupObject = vfmodules[FIELD.ID.VOLUME_GROUP];
- var volumeGroup = { "id": $scope.counter++,
- "name": volumeGroupObject[FIELD.ID.VOLUME_GROUP_NAME],
- "itemType": FIELD.ID.VOLUME_GROUP,
- "nodeId": volumeGroupObject[FIELD.ID.VOLUME_GROUP_ID],
- "nodeType": volumeGroupObject[FIELD.ID.VNF_TYPE],
- "nodeStatus": volumeGroupObject[FIELD.ID.ORCHESTRATION_STATUS],
- "object": volumeGroupObject,
- "nodes": []
- };
- genericVnf[FIELD.ID.VOLUMEGROUPS].push(volumeGroup);
- genericVnf[FIELD.ID.AVAILABLEVOLUMEGROUPS].push(volumeGroup);
- }
- });
- }
- // now we've loaded up the availableVolumeGroups, we can use it
- if (subInventoryResponseItem[FIELD.ID.INVENTORY_RESPONSE_ITEMS] != null) {
- angular.forEach(subInventoryResponseItem[FIELD.ID.INVENTORY_RESPONSE_ITEMS][FIELD.ID.INVENTORY_RESPONSE_ITEM], function(vfmodules, key) {
-
- if (vfmodules[FIELD.ID.VF_MODULE] != null) {
- var vfModuleObject = vfmodules[FIELD.ID.VF_MODULE];
- var vfModule = { "id": $scope.counter++,
- "name": vfModuleObject[FIELD.ID.VF_MODULE_NAME],
- "itemType": FIELD.ID.VF_MODULE,
- "nodeType": FIELD.ID.VF_MODULE,
- "nodeStatus": vfModuleObject[FIELD.ID.ORCHESTRATION_STATUS],
- "volumeGroups": [],
- "object": vfModuleObject,
- "networks": []
- };
- genericVnf[FIELD.ID.VF_MODULES].push(vfModule);
- if (vfmodules[FIELD.ID.INVENTORY_RESPONSE_ITEMS] != null) {
- angular.forEach(vfmodules[FIELD.ID.INVENTORY_RESPONSE_ITEMS][FIELD.ID.INVENTORY_RESPONSE_ITEM], function(networks, key) {
- if (networks[FIELD.ID.L3_NETWORK] != null) {
- var l3NetworkObject = networks[FIELD.ID.L3_NETWORK];
- var l3Network = { "id": $scope.counter++,
- "name": l3NetworkObject[FIELD.ID.NETWORK_NAME],
- "itemType": FIELD.ID.L3_NETWORK,
- "nodeId": l3NetworkObject[FIELD.ID.NETWORK_ID],
- "nodeType": l3NetworkObject[FIELD.ID.NETWORK_TYPE],
- "nodeStatus": l3NetworkObject[FIELD.ID.ORCHESTRATION_STATUS],
- "object": l3NetworkObject,
- "nodes": []
- };
- vfModule[FIELD.ID.NETWORKS].push(l3Network);
- }
- if (networks[FIELD.ID.VOLUME_GROUP] != null) {
- var volumeGroupObject = networks[FIELD.ID.VOLUME_GROUP];
-
- var volumeGroup = { "id": $scope.counter++,
- "name": volumeGroupObject[FIELD.ID.VOLUME_GROUP_NAME],
- "itemType": FIELD.ID.VOLUME_GROUP,
- "nodeId": volumeGroupObject[FIELD.ID.VOLUME_GROUP_ID],
- "nodeType": volumeGroupObject[FIELD.ID.VNF_TYPE],
- "nodeStatus": volumeGroupObject[FIELD.ID.ORCHESTRATION_STATUS],
- "object": volumeGroupObject,
- "nodes": []
- };
- var tmpVolGroup = [];
-
- angular.forEach(genericVnf[FIELD.ID.AVAILABLEVOLUMEGROUPS], function(avgroup, key) {
- if (avgroup.name != volumeGroup.name) {
- tmpVolGroup.push(avgroup);
- }
- });
-
- genericVnf[FIELD.ID.AVAILABLEVOLUMEGROUPS] = tmpVolGroup;
-
- vfModule[FIELD.ID.VOLUMEGROUPS].push(volumeGroup);
- }
-
- });
- }
- }
- });
- }
- }
- });
+ }
}
- });
- });
- }
-
- $scope.handleInitialResponse = function(response) {
- try {
- $scope.enableCloseButton(true);
- $scope.updateLog(response);
- if (response.data.status < 200 || response.data.status > 202) {
- $scope.showError(FIELD.ERROR.MSO);
- $scope.status = FIELD.ERROR.AAI_FETCHING_CUST_DATA + response.data.status;
-
- return;
}
-
- $scope.setProgress(100); // done
- $scope.status = FIELD.STATUS.DONE;
- $scope.isSpinnerVisible = false;
-
- $scope.customer = response.data.customer; // get data from json
-
- $scope.customerList = [];
-
- angular.forEach($scope.customer, function(subVal, subKey) {
- var cust = { "globalCustomerId": subVal[FIELD.ID.GLOBAL_CUSTOMER_ID], "subscriberName": subVal[FIELD.ID.SUBNAME] };
- $scope.customerList.push(cust);
- });
-
- } catch (error) {
- $scope.showContentError(error);
+ return fiterDataServices;
}
- }
-
- $scope.autoGetSubs = function() {
- /*
- * Optionally comment in / out one of these method calls (or add a similar
- * entry) to auto-invoke an entry when the test screen is redrawn.
- */
- $scope.getSubs();
-
- }
- $scope.updateLog = function(response) {
-// $scope.log = UtilityService.getCurrentTime() + " HTTP Status: " +
-// UtilityService.getHttpStatusText(response.data.status) + "\n" +
-// angular.toJson(response.data.entity, true) + "\n\n" + $scope.log;
-// UtilityService.checkUndefined("entity", response.data.entity);
-// UtilityService.checkUndefined("status", response.data.status);
- }
-
- $scope.handleServerError = function(response, status) {
- $scope.enableCloseButton(true);
- var message = UtilityService.getHttpErrorMessage(response);
- if (message != ""){
- message = " (" + message + ")";
- }
- $scope.showError(FIELD.ERROR.SYSTEM_ERROR + message);
- }
-
- $scope.showContentError = function(message) {
- // $log.debug(message);
- console.log(message);
- if (UtilityService.hasContents(message)) {
- $scope.showError("System failure (" + message + ")");
- } else {
- $scope.showError(FIELD.ERROR.SYSTEM_ERROR);
- }
- }
-
- $scope.showError = function(message) {
- $scope.isSpinnerVisible = false;
- $scope.isProgressVisible = false;
- $scope.error = message;
- $scope.status = FIELD.STATUS.ERROR;
- }
-
- $scope.close = function() {
- if ($scope.timer != undefined) {
- $timeout.cancel($scope.timer);
+ $scope.isThisHigher = function(arr,obj){
+ var returnObj = {
+ isHigher:false,
+ index:0
+ };
+ if(arr.length>0){
+ var isNotMatched = true;
+ for(var i=0;i<arr.length;i++){
+ if(arr[i]['extra-properties']['extra-property'] && (arr[i]['extra-properties']['extra-property'][2]['property-value'] == obj['extra-properties']['extra-property'][2]['property-value'])
+ && (arr[i]['extra-properties']['extra-property'][4]['property-value'] == obj['extra-properties']['extra-property'][4]['property-value'] )
+ && (arr[i]['extra-properties']['extra-property'][6]['property-value'] < obj['extra-properties']['extra-property'][6]['property-value']) ){
+ isNotMatched = false;
+ returnObj = {
+ isHigher:true,
+ index:i
+ };
+ }
+ }
+ if(isNotMatched && !$scope.isFiltered(arr,obj)){
+ returnObj = {
+ isHigher:true,
+ index:arr.length
+ };
+ }
+ }else{
+ returnObj = {
+ isHigher:true,
+ index:0
+ }
+ }
+ return returnObj;
}
- $scope.isPopupVisible = false;
- }
+ $scope.tableData=[];
+ var oldData=[];
+ $scope.loadPreviousVersionData=function(version,invariantUUID){
+ $scope.tableData =[];
+ oldData=[];
+ for(var i=0;i<wholeData.length;i++){
+ if(wholeData[i]['extra-properties']['extra-property'] && wholeData[i]['extra-properties']['extra-property'][4]['property-value'] == invariantUUID && version!=wholeData[i]['extra-properties']['extra-property'][6]['property-value']){
+ oldData.push(wholeData[i]);
+ }
+ }
+ $scope.tableData = oldData;
+ $scope.createType = "Previous Version";
+ var broadcastType = "createTableComponent";
+ $scope.componentName = invariantUUID;
+ $scope.$broadcast(broadcastType, {
+ componentId : COMPONENT.OLDVERSION,
+ callbackFunction : function(response) {
+ }
+ });
+ }
+ $scope.cancelCreateSIType = function(){
+
+ window.location.href = COMPONENT.SERVICE_MODLES_INSTANCES_SUBSCRIBERS_PATH;
+
+ }
+ $scope.fetchServices = function () {
+ var serviceIdList = [];
- /*
- * Consider converting the progress bar mechanism, the disabled button handling
- * and the following methods to generic Angular directive(s) and/or approach.
- */
+ AaiService.getServices2(function (response) { // success
+ DataService.setServiceIdList(response);
+ }, function (response) { // failure
+ $scope.showError(FIELD.ERROR.AAI);
+ $scope.errorMsg = FIELD.ERROR.FETCHING_SERVICES + response.status;
+ $scope.errorDetails = response.data;
+ });
+ }
+
+ $scope.refreshSubs = function () {
+ $scope.init();
+ $scope.fetchSubs(FIELD.PROMPT.REFRESH_SUB_LIST);
+ $scope.fetchServices();
+ };
+
+ $scope.fetchSubs = function (status) {
+ $scope.status = status;
+
+ AaiService.getSubList(function (response) { // sucesss
+ $scope.setProgress(100); // done
+ $scope.status = FIELD.STATUS.DONE;
+ $scope.isSpinnerVisible = false;
+ $scope.customerList = response;
+ }, function (response) { // failure
+ $scope.showError(FIELD.ERROR.AAI);
+ $scope.errorMsg = FIELD.ERROR.AAI_FETCHING_CUST_DATA + response.status;
+ $scope.errorDetails = response.data;
+ });
+ }
+
+ $scope.getPermitted = function (item) {
+ return item.isPermitted || item[FIELD.ID.IS_PERMITTED];
+
+ }
+
+
+ $scope.getSubDetails = function (request) {
+
+ $scope.init();
+ $scope.selectedSubscriber = $location.search().selectedSubscriber;
+ $scope.selectedServiceInstance = $location.search().selectedServiceInstance;
+ $scope.status = FIELD.STATUS.FETCHING_SUB_DETAILS + $scope.selectedSubscriber;
+
+ $scope.displayData = [];
+ AaiService.getSubDetails($scope.selectedSubscriber, $scope.selectedServiceInstance, function (displayData, subscriberName) {
+ $scope.displayData = displayData;
+ $scope.viewPerPage = 10;
+ $scope.totalPage = $scope.displayData.length / $scope.viewPerPage;
+ $scope.scrollViewPerPage = 2;
+ $scope.currentPage = 1;
+ $scope.searchCategory;
+ $scope.searchString = "";
+ $scope.currentPageNum = 1;
+ $scope.defaultSort = COMPONENT.SUBSCRIBER_NAME;
+ $scope.setProgress(100); // done
+ $scope.status = FIELD.STATUS.DONE;
+ $scope.isSpinnerVisible = false;
+ $scope.subscriberName = subscriberName;
+ }, function (response) {
+ $scope.showError(FIELD.ERROR.AAI);
+ $scope.errorMsg = FIELD.ERROR.AAI_FETCHING_CUST_DATA + response.status;
+ $scope.errorDetails = response.data;
+ });
+ }
+
+
+ $scope.$on(COMPONENT.MSO_DELETE_REQ, function (event, request) {
+ // $log.debug("deleteInstance: request:");
+ // $log.debug(request);
+ $scope.init();
+
+ $http.post($scope.baseUrl + request.url, {
+ requestDetails: request.requestDetails
+ }, {
+ timeout: $scope.responseTimeoutMsec
+ }).then($scope.handleInitialResponse)
+ ["catch"]($scope.handleServerError);
+ });
+
+ $scope.init = function () {
+
+ //PropertyService.setAaiBaseUrl("testaai");
+ //PropertyService.setAsdcBaseUrl("testasdc");
+
+ // takes a default value, retrieves the prop value from the file system and sets it
+ var msecs = PropertyService.retrieveMsoMaxPollingIntervalMsec();
+ PropertyService.setMsoMaxPollingIntervalMsec(msecs);
+
+ // takes a default value, retrieves the prop value from the file system and sets it
+ var polls = PropertyService.retrieveMsoMaxPolls();
+ PropertyService.setMsoMaxPolls(polls);
+
+ //PropertyService.setMsoBaseUrl("testmso");
+ PropertyService.setServerResponseTimeoutMsec();
+
+ /*
+ * Common parameters that would typically be set when the page is
+ * displayed for a specific service instance id.
+ */
+
+ $scope.baseUrl = $scope.defaultBaseUrl;
+
+ $scope.isSpinnerVisible = true;
+ $scope.isProgressVisible = true;
+ $scope.isPopupVisible = true;
+ $scope.requestId = "";
+ $scope.error = "";
+ $scope.pollAttempts = 0;
+ $scope.log = "";
+ $scope.enableCloseButton(false);
+ $scope.resetProgress();
+ $scope.setProgress(2); // Show "a little" progress
+ }
+
+ $scope.getComponentList = function (event, request) {
+
+ $scope.isSpinnerVisible = true;
+ $scope.isProgressVisible = true;
+ $scope.isPopupVisible = true;
+ $scope.requestId = "";
+ $scope.error = "";
+ $scope.pollAttempts = 0;
+ $scope.log = "";
+
+ $scope.resetProgress();
+ $scope.setProgress(2); // Show "a little" progress
+
+ $scope.globalCustomerId = $location.search().subscriberId;
+ $scope.serviceType = $location.search().serviceType;
+ $scope.serviceInstanceId = $location.search().serviceInstanceId;
+ $scope.subscriberName = $location.search().subscriberName;
+
+ //$scope.getAsdcModel($location.search().modelUuid);
+
+ $scope.namedQueryId = VIDCONFIGURATION.COMPONENT_LIST_NAMED_QUERY_ID;
+ $scope.status = FIELD.STATUS.FETCHING_SERVICE_INST_DATA + $scope.serviceInstanceId;
+
+ AaiService.runNamedQuery($scope.namedQueryId, $scope.globalCustomerId, $scope.serviceType, $scope.serviceInstanceId,
+ function (response) { //success
+ $scope.handleInitialResponseInventoryItems(response);
+ $scope.setProgress(100); // done
+ $scope.status = FIELD.STATUS.DONE;
+ $scope.isSpinnerVisible = false;
+ },
+ function (response) { //failure
+ $scope.showError(FIELD.ERROR.AAI);
+ $scope.errorMsg = FIELD.ERROR.FETCHING_SERVICE_INSTANCE_DATA + response.status;
+ $scope.errorDetails = response.data;
+ }
+ );
+
+ }
+
+ $scope.handleServerError = function (response, status) {
+ alert(response.statusText);
+ }
+
+ $scope.getAsdcModel = function (disData) {
+
+ console.log("disData");
+ console.log(JSON.stringify(disData, null, 4));
+
+ // if ( !(UtilityService.hasContents (disData.aaiModelVersionId)) ) {
+ // $scope.errorMsg = FIELD.ERROR.MODEL_VERSION_ID_MISSING;
+ // alert($scope.errorMsg);
+ // return;
+ // }
+
+ // aaiModelVersionId is the model uuid
+ var pathQuery = COMPONENT.SERVICES_PATH + disData.aaiModelVersionId;
+ $http({
+ method: 'GET',
+ url: pathQuery
+ }).then(function successCallback(response) {
+ vidService.setModel(response.data);
+ window.location.href =
+ COMPONENT.INSTANTIATE_ROOT_PATH + disData.globalCustomerId +
+ COMPONENT.SUBSCRIBERNAME_SUB_PATH + disData.subscriberName +
+ COMPONENT.SERVICETYPE_SUB_PATH + disData.serviceType +
+ COMPONENT.SERVICEINSTANCEID_SUB_PATH + disData.serviceInstanceId +
+ COMPONENT.IS_PERMITTED_SUB_PATH + disData.isPermitted;
+ console.log("aaiSubscriber getAsdcModel DONE!!!!");
+ }, function errorCallback(response) {
+ console.log("aaiSubscriber getAsdcModel - No matching model found matching the A&AI model version ID = " + disData.aaiModelVersionId);
+ $scope.errorMsg = FIELD.ERROR.NO_MATCHING_MODEL_AAI + disData.aaiModelVersionId;
+ alert($scope.errorMsg);
+ });
- $scope.enableCloseButton = function(isEnabled) {
- var selector = FIELD.STYLE.MSO_CTRL_BTN;
+ }
+
+ $scope.getTenants = function (globalCustomerId) {
+ $http.get(FIELD.ID.AAI_GET_TENTANTS + globalCustomerId)
+ .then(function successCallback(response) {
+ return response.data;
+ //$location.path("/instantiate");
+ }, function errorCallback(response) {
+ //TODO
+ });
+ }
+
+ $scope.handleInitialResponseInventoryItems = function (response) {
+
+ $scope.inventoryResponseItemList = response.data[FIELD.ID.INVENTORY_RESPONSE_ITEM]; // get data from json
+ console.log($scope.inventoryResponseItemList.toString());
+
+ $scope.displayData = [];
+ $scope.vnfs = [];
+
+ $scope.counter = 100;
+
+ $scope.subscriberName = "";
+ // just look up the subscriber name in A&AI here...
+ AaiService.getSubscriberName($scope.globalCustomerId, function (response) {
+ $scope.subscriberName = response;
+ DataService.setSubscriberName($scope.subscriberName);
+
+ angular.forEach($scope.inventoryResponseItemList, function (inventoryResponseItem, key) {
+
+ $scope.inventoryResponseItem = inventoryResponseItem;
+
+ $scope.service.instance = {
+ "name": $scope.inventoryResponseItem[FIELD.ID.SERVICE_INSTANCE][FIELD.ID.SERVICE_INSTANCE_NAME],
+ "serviceInstanceId": $scope.serviceInstanceId,
+ "serviceType": $scope.serviceType,
+ "globalCustomerId": $scope.globalCustomerId,
+ "subscriberName": $scope.subscriberName,
+ "id": $scope.serviceInstanceId,
+ "inputs": {
+ "a": {
+ "type": PARAMETER.STRING,
+ "description": FIELD.PROMPT.VAR_DESCRIPTION_A,
+ "default": FIELD.PROMPT.DEFAULT_A
+ },
+ "b": {
+ "type": PARAMETER.STRING,
+ "description": FIELD.PROMPT.VAR_DESCRIPTION_B,
+ "default": FIELD.PROMPT.DEFAULT_B
+ },
+ },
+ "object": $scope.inventoryResponseItem[FIELD.ID.SERVICE_INSTANCE],
+ "vnfs": [],
+ "networks": []
+ }
+
+ if (inventoryResponseItem[FIELD.ID.INVENTORY_RESPONSE_ITEMS] != null) {
+
+ angular.forEach(inventoryResponseItem[FIELD.ID.INVENTORY_RESPONSE_ITEMS][FIELD.ID.INVENTORY_RESPONSE_ITEM], function (subInventoryResponseItem, key) {
+ // i expect to find vnfs now
+
+ if (subInventoryResponseItem[FIELD.ID.L3_NETWORK] != null) {
+ var l3NetworkObject = subInventoryResponseItem[FIELD.ID.L3_NETWORK];
+ var l3Network = {
+ "id": $scope.counter++,
+ "name": l3NetworkObject[FIELD.ID.NETWORK_NAME],
+ "itemType": FIELD.ID.L3_NETWORK,
+ "nodeId": l3NetworkObject[FIELD.ID.NETWORK_ID],
+ "nodeType": l3NetworkObject[FIELD.ID.NETWORK_TYPE],
+ "nodeStatus": l3NetworkObject[FIELD.ID.ORCHESTRATION_STATUS],
+ "object": l3NetworkObject,
+ "nodes": [],
+ "subnets": []
+ };
+ if (subInventoryResponseItem[FIELD.ID.INVENTORY_RESPONSE_ITEMS] != null) {
+ //console.log ("subInventoryResponseItem[FIELD.ID.INVENTORY_RESPONSE_ITEMS]=");
+ //console.log (JSON.stringify (subInventoryResponseItem[FIELD.ID.INVENTORY_RESPONSE_ITEMS], null, 4 ));
+ angular.forEach(subInventoryResponseItem[FIELD.ID.INVENTORY_RESPONSE_ITEMS][FIELD.ID.INVENTORY_RESPONSE_ITEM], function (subSubInventoryResponseItem, key) {
+ //console.log (JSON.stringify (subSubInventoryResponseItem, null, 4 ));
+ var subnet = {};
+ var subnetObject;
+ if (subSubInventoryResponseItem[FIELD.ID.SUB_NET] != null) {
+ subnetObject = subSubInventoryResponseItem[FIELD.ID.SUB_NET];
+ subnet = {
+ "subnet-id": subnetObject[FIELD.ID.SUBNET_ID],
+ "subnet-name": subnetObject[FIELD.ID.SUBNET_NAME],
+ "gateway-address": subnetObject[FIELD.ID.GATEWAY_ADDRESS],
+ "network-start-address": subnetObject[FIELD.ID.NETWORK_START_ADDRESS],
+ "cidr-mask": subnetObject[FIELD.ID.CIDR_MASK]
+ };
+ l3Network.subnets.push(subnet);
+ }
+ });
+ }
+ $scope.service.instance[FIELD.ID.NETWORKS].push(l3Network);
+ }
+
+ if (subInventoryResponseItem[FIELD.ID.GENERIC_VNF] != null) {
+ var genericVnfObject = subInventoryResponseItem[FIELD.ID.GENERIC_VNF];
+
+ var genericVnf = {
+ "name": genericVnfObject[FIELD.ID.VNF_NAME],
+ "id": $scope.counter++,
+ "itemType": COMPONENT.VNF,
+ "nodeType": genericVnfObject[FIELD.ID.VNF_TYPE],
+ "nodeId": genericVnfObject[FIELD.ID.VNF_ID],
+ "nodeStatus": genericVnfObject[FIELD.ID.ORCHESTRATION_STATUS],
+ "object": genericVnfObject,
+ "vfModules": [],
+ "volumeGroups": [],
+ "availableVolumeGroups": []
+ };
+ $scope.service.instance[FIELD.ID.VNFS].push(genericVnf);
+
+ // look for volume-groups
+ if (subInventoryResponseItem[FIELD.ID.INVENTORY_RESPONSE_ITEMS] != null) {
+ angular.forEach(subInventoryResponseItem[FIELD.ID.INVENTORY_RESPONSE_ITEMS][FIELD.ID.INVENTORY_RESPONSE_ITEM], function (vfmodules, key) {
+
+ if (vfmodules[FIELD.ID.VOLUME_GROUP] != null) {
+ var volumeGroupObject = vfmodules[FIELD.ID.VOLUME_GROUP];
+ var volumeGroup = {
+ "id": $scope.counter++,
+ "name": volumeGroupObject[FIELD.ID.VOLUME_GROUP_NAME],
+ "itemType": FIELD.ID.VOLUME_GROUP,
+ "nodeId": volumeGroupObject[FIELD.ID.VOLUME_GROUP_ID],
+ "nodeType": volumeGroupObject[FIELD.ID.VNF_TYPE],
+ "nodeStatus": volumeGroupObject[FIELD.ID.ORCHESTRATION_STATUS],
+ "object": volumeGroupObject,
+ "nodes": []
+ };
+ genericVnf[FIELD.ID.VOLUMEGROUPS].push(volumeGroup);
+ genericVnf[FIELD.ID.AVAILABLEVOLUMEGROUPS].push(volumeGroup);
+ }
+ });
+ }
+ // now we've loaded up the availableVolumeGroups, we can use it
+ if (subInventoryResponseItem[FIELD.ID.INVENTORY_RESPONSE_ITEMS] != null) {
+ angular.forEach(subInventoryResponseItem[FIELD.ID.INVENTORY_RESPONSE_ITEMS][FIELD.ID.INVENTORY_RESPONSE_ITEM], function (vfmodules, key) {
+
+ if (vfmodules[FIELD.ID.VF_MODULE] != null) {
+ var vfModuleObject = vfmodules[FIELD.ID.VF_MODULE];
+ var vfModule = {
+ "id": $scope.counter++,
+ "name": vfModuleObject[FIELD.ID.VF_MODULE_NAME],
+ "itemType": FIELD.ID.VF_MODULE,
+ "nodeType": FIELD.ID.VF_MODULE,
+ "nodeStatus": vfModuleObject[FIELD.ID.ORCHESTRATION_STATUS],
+ "volumeGroups": [],
+ "object": vfModuleObject,
+ "networks": []
+ };
+ genericVnf[FIELD.ID.VF_MODULES].push(vfModule);
+ if (vfmodules[FIELD.ID.INVENTORY_RESPONSE_ITEMS] != null) {
+ angular.forEach(vfmodules[FIELD.ID.INVENTORY_RESPONSE_ITEMS][FIELD.ID.INVENTORY_RESPONSE_ITEM], function (networks, key) {
+ if (networks[FIELD.ID.L3_NETWORK] != null) {
+ var l3NetworkObject = networks[FIELD.ID.L3_NETWORK];
+ var l3Network = {
+ "id": $scope.counter++,
+ "name": l3NetworkObject[FIELD.ID.NETWORK_NAME],
+ "itemType": FIELD.ID.L3_NETWORK,
+ "nodeId": l3NetworkObject[FIELD.ID.NETWORK_ID],
+ "nodeType": l3NetworkObject[FIELD.ID.NETWORK_TYPE],
+ "nodeStatus": l3NetworkObject[FIELD.ID.ORCHESTRATION_STATUS],
+ "object": l3NetworkObject,
+ "nodes": []
+ };
+ vfModule[FIELD.ID.NETWORKS].push(l3Network);
+ }
+ if (networks[FIELD.ID.VOLUME_GROUP] != null) {
+ var volumeGroupObject = networks[FIELD.ID.VOLUME_GROUP];
+
+ var volumeGroup = {
+ "id": $scope.counter++,
+ "name": volumeGroupObject[FIELD.ID.VOLUME_GROUP_NAME],
+ "itemType": FIELD.ID.VOLUME_GROUP,
+ "nodeId": volumeGroupObject[FIELD.ID.VOLUME_GROUP_ID],
+ "nodeType": volumeGroupObject[FIELD.ID.VNF_TYPE],
+ "nodeStatus": volumeGroupObject[FIELD.ID.ORCHESTRATION_STATUS],
+ "object": volumeGroupObject,
+ "nodes": []
+ };
+ var tmpVolGroup = [];
+
+ angular.forEach(genericVnf[FIELD.ID.AVAILABLEVOLUMEGROUPS], function (avgroup, key) {
+ if (avgroup.name != volumeGroup.name) {
+ tmpVolGroup.push(avgroup);
+ }
+ });
+
+ genericVnf[FIELD.ID.AVAILABLEVOLUMEGROUPS] = tmpVolGroup;
+
+ vfModule[FIELD.ID.VOLUMEGROUPS].push(volumeGroup);
+ }
+
+ });
+ }
+ }
+ });
+ }
+ }
+ });
+ }
+ });
+ });
+ }
- $scope.isCloseEnabled = isEnabled;
+ $scope.handleInitialResponse = function (response) {
+ try {
+ $scope.enableCloseButton(true);
+ $scope.updateLog(response);
+ if (response.data.status < 200 || response.data.status > 202) {
+ $scope.showError(FIELD.ERROR.MSO);
+ $scope.status = FIELD.ERROR.AAI_FETCHING_CUST_DATA + response.data.status;
- if (isEnabled) {
- $(selector).addClass(FIELD.STYLE.BTN_PRIMARY).removeClass(FIELD.STYLE.BTN_INACTIVE).attr(FIELD.STYLE.BTN_TYPE, FIELD.STYLE.PRIMARY);
- } else {
- $(selector).removeClass(FIELD.STYLE.BTN_PRIMARY).addClass(FIELD.STYLE.BTN_INACTIVE).attr(FIELD.STYLE.BTN_TYPE, FIELD.STYLE.DISABLED);
- }
- }
+ return;
+ }
- $scope.resetProgress = function() {
- $scope.percentProgress = 0;
- $scope.progressClass = FIELD.STYLE.PROGRESS_BAR_INFO;
- }
+ $scope.setProgress(100); // done
+ $scope.status = FIELD.STATUS.DONE;
+ $scope.isSpinnerVisible = false;
- $scope.setProgress = function(percentProgress) {
- percentProgress = parseInt(percentProgress);
- if (percentProgress >= 100) {
- $scope.progressClass = FIELD.STYLE.PROGRESS_BAR_SUCCESS;
- }
+ $scope.customer = response.data.customer; // get data from json
- if (percentProgress < $scope.percentProgress) {
- return;
- }
+ $scope.customerList = [];
- $scope.percentProgress = percentProgress;
- $scope.progressWidth = {width: percentProgress + "%"};
- if (percentProgress >= 5) {
- $scope.progressText = percentProgress + " %";
- } else {
- // Hidden since color combination is barely visible when progress portion is narrow.
- $scope.progressText = "";
- }
- }
+ angular.forEach($scope.customer, function (subVal, subKey) {
+ var cust = {
+ "globalCustomerId": subVal[FIELD.ID.GLOBAL_CUSTOMER_ID],
+ "subscriberName": subVal[FIELD.ID.SUBNAME],
+ "isPermitted": subVal[FIELD.ID.IS_PERMITTED]
+ };
- $scope.reloadRoute = function() {
- $route.reload();
- }
+ $scope.customerList.push(cust);
+ });
- $scope.prevPage = function() {
- $scope.currentPage--;
- }
+ } catch (error) {
+ $scope.showContentError(error);
+ }
+ }
- $scope.nextPage = function() {
- $scope.currentPage++;
- }
- $scope.serviceInstanceses = [{"sinstance":FIELD.NAME.SERVICE_INSTANCE_Id},{"sinstance":FIELD.NAME.SERVICE_INSTANCE_NAME}]
- $scope.getSubscriberDet = function(selectedCustomer,selectedserviceinstancetype,selectedServiceInstance){
-
- var sintype =selectedserviceinstancetype;
- if (selectedServiceInstance != "" && selectedServiceInstance != undefined) {
- selectedServiceInstance.trim();
-
- // check with A&AI
- $http.get(COMPONENT.AAI_GET_SERVICE_INSTANCE_PATH + selectedServiceInstance+"/"+sintype + "?r=" + Math.random(), {
-
- },{
- timeout: $scope.responseTimeoutMsec
- }).then(function(response) {
- var notFound = true;
- if (angular.isArray(response.data[FIELD.ID.RESULT_DATA])) {
- var item = [];
- var urlParts = [];
- item = response.data[FIELD.ID.RESULT_DATA][0];
- var url = item[FIELD.ID.RESOURCE_LINK];
- var globalCustomerId = "";
- var serviceSubscription = "";
- // split it and find the customer Id and service-subscription
- urlParts = url.split("/");
- if (urlParts[7] === FIELD.ID.CUSTOMER) {
- globalCustomerId = urlParts[8];
- }
- if (urlParts[10] === FIELD.ID.SERVICE_SUBSCRIPTION) {
- serviceSubscription = urlParts[11];
- }
+ $scope.autoGetSubs = function () {
+ /*
+ * Optionally comment in / out one of these method calls (or add a similar
+ * entry) to auto-invoke an entry when the test screen is redrawn.
+ */
+ $scope.getSubs();
- if (globalCustomerId !== "") {
- notFound = false;
- window.location.href = COMPONENT.SELECTED_SERVICE_SUB_PATH + serviceSubscription + COMPONENT.SELECTEDSUBSCRIBER_SUB_PATH + globalCustomerId + COMPONENT.SELECTEDSERVICEINSTANCE_SUB_PATH + selectedServiceInstance;
- }
- }
- if (notFound) {
- alert(FIELD.ERROR.SERVICE_INST_DNE);
- }
- }); // add a failure callback...
- } else if (selectedCustomer != null) {
- window.location.href = COMPONENT.SELECTED_SUB_PATH + selectedCustomer;
- } else {
- alert(FIELD.ERROR.SELECT);
- }
- };
- }]).directive('restrictInput', function(){
-
- return {
-
- restrict: 'A',
- require: 'ngModel',
- link: function($scope, element, attr, ctrl){
- ctrl.$parsers.unshift(function(viewValue){
-
- var types = $scope.$eval(attr.restrictInput);
- if(!types.regex && types.type){
-
- switch(types.type){
- case 'Service Instance Name' : types.regex = '^[a-zA-Z0-9-_]*$'; break;
- default: types.regex= '';
- }
- }
- var reg = new RegExp(types.regex);
- if(reg.test(viewValue)){
- return viewValue;
- } else {
- var overrideValue = (reg.test(viewValue) ? viewValue : '');
- element.val(overrideValue);
- return overrideValue;
- }
- });
- }
- };
+ }
+ $scope.updateLog = function (response) {
+// $scope.log = UtilityService.getCurrentTime() + " HTTP Status: " +
+// UtilityService.getHttpStatusText(response.data.status) + "\n" +
+// angular.toJson(response.data.entity, true) + "\n\n" + $scope.log;
+// UtilityService.checkUndefined("entity", response.data.entity);
+// UtilityService.checkUndefined("status", response.data.status);
+ }
+
+ $scope.handleServerError = function (response, status) {
+ $scope.enableCloseButton(true);
+ var message = UtilityService.getHttpErrorMessage(response);
+ if (message != "") {
+ message = " (" + message + ")";
+ }
+ $scope.showError(FIELD.ERROR.SYSTEM_ERROR + message);
+ }
+
+ $scope.showContentError = function (message) {
+ // $log.debug(message);
+ console.log(message);
+ if (UtilityService.hasContents(message)) {
+ $scope.showError("System failure (" + message + ")");
+ } else {
+ $scope.showError(FIELD.ERROR.SYSTEM_ERROR);
+ }
+ }
+
+ $scope.showError = function (message) {
+ $scope.isSpinnerVisible = false;
+ $scope.isProgressVisible = false;
+ $scope.error = message;
+ $scope.status = FIELD.STATUS.ERROR;
+ }
+
+ $scope.close = function () {
+ if ($scope.timer != undefined) {
+ $timeout.cancel($scope.timer);
+ }
+ $scope.isPopupVisible = false;
+ }
+
+
+ /*
+ * Consider converting the progress bar mechanism, the disabled button handling
+ * and the following methods to generic Angular directive(s) and/or approach.
+ */
+
+ $scope.enableCloseButton = function (isEnabled) {
+ var selector = FIELD.STYLE.MSO_CTRL_BTN;
+
+ $scope.isCloseEnabled = isEnabled;
+
+ if (isEnabled) {
+ $(selector).addClass(FIELD.STYLE.BTN_PRIMARY).removeClass(FIELD.STYLE.BTN_INACTIVE).attr(FIELD.STYLE.BTN_TYPE, FIELD.STYLE.PRIMARY);
+ } else {
+ $(selector).removeClass(FIELD.STYLE.BTN_PRIMARY).addClass(FIELD.STYLE.BTN_INACTIVE).attr(FIELD.STYLE.BTN_TYPE, FIELD.STYLE.DISABLED);
+ }
+ }
+
+ $scope.resetProgress = function () {
+ $scope.percentProgress = 0;
+ $scope.progressClass = FIELD.STYLE.PROGRESS_BAR_INFO;
+ }
+
+ $scope.setProgress = function (percentProgress) {
+ percentProgress = parseInt(percentProgress);
+ if (percentProgress >= 100) {
+ $scope.progressClass = FIELD.STYLE.PROGRESS_BAR_SUCCESS;
+ }
+
+ if (percentProgress < $scope.percentProgress) {
+ return;
+ }
+
+ $scope.percentProgress = percentProgress;
+ $scope.progressWidth = {width: percentProgress + "%"};
+ if (percentProgress >= 5) {
+ $scope.progressText = percentProgress + " %";
+ } else {
+ // Hidden since color combination is barely visible when progress portion is narrow.
+ $scope.progressText = "";
+ }
+ }
+
+ $scope.reloadRoute = function () {
+ $route.reload();
+ }
+
+ $scope.prevPage = function () {
+ $scope.currentPage--;
+ }
+
+ $scope.nextPage = function () {
+ $scope.currentPage++;
+ }
+ $scope.serviceInstanceses = [{"sinstance": FIELD.NAME.SERVICE_INSTANCE_Id}, {"sinstance": FIELD.NAME.SERVICE_INSTANCE_NAME}]
+ $scope.getSubscriberDet = function (selectedCustomer, selectedserviceinstancetype, selectedServiceInstance) {
+
+ var sintype = selectedserviceinstancetype;
+ if (selectedServiceInstance != "" && selectedServiceInstance != undefined) {
+ selectedServiceInstance.trim();
+
+ // check with A&AI
+ $http.get(COMPONENT.AAI_GET_SERVICE_INSTANCE_PATH + selectedServiceInstance + "/" + sintype + "?r=" + Math.random(), {}, {
+ timeout: $scope.responseTimeoutMsec
+ }).then(function (response) {
+ var notFound = true;
+ if (angular.isArray(response.data[FIELD.ID.RESULT_DATA])) {
+ var item = [];
+ var urlParts = [];
+ item = response.data[FIELD.ID.RESULT_DATA][0];
+ var url = item[FIELD.ID.RESOURCE_LINK];
+ var globalCustomerId = "";
+ var serviceSubscription = "";
+ // split it and find the customer Id and service-subscription
+ urlParts = url.split("/");
+ if (urlParts[7] === FIELD.ID.CUSTOMER) {
+ globalCustomerId = urlParts[8];
+ }
+ if (urlParts[10] === FIELD.ID.SERVICE_SUBSCRIPTION) {
+ serviceSubscription = urlParts[11];
+ }
+
+ if (globalCustomerId !== "") {
+ notFound = false;
+ window.location.href = COMPONENT.SELECTED_SERVICE_SUB_PATH + serviceSubscription + COMPONENT.SELECTEDSUBSCRIBER_SUB_PATH + globalCustomerId + COMPONENT.SELECTEDSERVICEINSTANCE_SUB_PATH + selectedServiceInstance;
+ }
+ }
+ if (notFound) {
+ alert(FIELD.ERROR.SERVICE_INST_DNE);
+ }
+ }); // add a failure callback...
+ } else if (selectedCustomer != null) {
+ window.location.href = COMPONENT.SELECTED_SUB_PATH + selectedCustomer;
+ } else {
+ alert(FIELD.ERROR.SELECT);
+ }
+ };
+ }]).directive('restrictInput', function () {
+
+ return {
+
+ restrict: 'A',
+ require: 'ngModel',
+ link: function ($scope, element, attr, ctrl) {
+ ctrl.$parsers.unshift(function (viewValue) {
+
+ var types = $scope.$eval(attr.restrictInput);
+ if (!types.regex && types.type) {
+
+ switch (types.type) {
+ case 'Service Instance Name' :
+ types.regex = '^[a-zA-Z0-9-_]*$';
+ break;
+ default:
+ types.regex = '';
+ }
+ }
+ var reg = new RegExp(types.regex);
+ if (reg.test(viewValue)) {
+ return viewValue;
+ } else {
+ var overrideValue = (reg.test(viewValue) ? viewValue : '');
+ element.val(overrideValue);
+ return overrideValue;
+ }
});
+ }
+ };
+
+});
appDS2.controller('TreeCtrl', ['$scope', function ($scope) {
- $scope.remove = function (scope) {
- scope.remove();
- };
-
- $scope.toggle = function (scope) {
- scope.toggle();
- };
-
- $scope.moveLastToTheBeginning = function () {
- var a = $scope.data.pop();
- $scope.data.splice(0, 0, a);
- };
-
- $scope.newSubItem = function (scope) {
- var nodeData = scope.$modelValue;
- nodeData.nodes.push({
- id: nodeData.id * 10 + nodeData.nodes.length,
- title: nodeData.title + '.' + (nodeData.nodes.length + 1),
- nodes: []
- });
- };
-
- $scope.collapseAll = function () {
- $scope.$broadcast(FIELD.ID.ANGULAR_UI_TREE_COLLAPSEALL);
- };
-
- $scope.expandAll = function () {
- $scope.$broadcast(FIELD.ID.ANGULAR_UI_TREE_EXPANDALL);
- };
+ $scope.remove = function (scope) {
+ scope.remove();
+ };
+
+ $scope.toggle = function (scope) {
+ scope.toggle();
+ };
+
+ $scope.moveLastToTheBeginning = function () {
+ var a = $scope.data.pop();
+ $scope.data.splice(0, 0, a);
+ };
+
+ $scope.newSubItem = function (scope) {
+ var nodeData = scope.$modelValue;
+ nodeData.nodes.push({
+ id: nodeData.id * 10 + nodeData.nodes.length,
+ title: nodeData.title + '.' + (nodeData.nodes.length + 1),
+ nodes: []
+ });
+ };
+
+ $scope.collapseAll = function () {
+ $scope.$broadcast(FIELD.ID.ANGULAR_UI_TREE_COLLAPSEALL);
+ };
+
+ $scope.expandAll = function () {
+ $scope.$broadcast(FIELD.ID.ANGULAR_UI_TREE_EXPANDALL);
+ };
}]);
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 b400cc6e..3d8cba5c 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 @@ -111,16 +111,21 @@ var creationDialogController = function( COMPONENT, FIELD, PARAMETER, $scope, $h var isUploadAvailable = false;
var uploadIndex =0;
var paramList = $scope.userProvidedControl.getList();
-
+ var isAnyError = false;
for (var i = 0; i < paramList.length; i++) {
if (paramList[i].id === FIELD.ID.SUPPLEMENTORY_DATA_FILE) {
isUploadAvailable = true;
uploadIndex=i;
- break;
+ }
+ if (paramList[i].id === FIELD.ID.UPLOAD_SUPPLEMENTORY_DATA_FILE && paramList[i].value && document.getElementById(FIELD.ID.SUPPLEMENTORY_DATA_FILE).value=='' ) {
+ isAnyError = true;
}
}
- if(isUploadAvailable){
+ if(isUploadAvailable && isAnyError ){
+ showError(FIELD.ERROR.MISSING_DATA, FIELD.ERROR.MISSING_FILE);
+ return;
+ }else if(isUploadAvailable && document.getElementById(FIELD.ID.SUPPLEMENTORY_DATA_FILE).value!='' ){
var errorMsg = "";
var fileInput = document.getElementById(FIELD.ID.SUPPLEMENTORY_DATA_FILE);
var file = fileInput.files[0];
@@ -128,8 +133,7 @@ var creationDialogController = function( COMPONENT, FIELD, PARAMETER, $scope, $h reader.onload = function(e) {
try{
paramList[uploadIndex].value = JSON.parse(reader.result);
- FIELD.PARAMETER.SUPPLEMENTORY_DATA_FILE['value'] = JSON.stringify(paramList[uploadIndex].value);
- $scope.userProvidedControl.updateList([ FIELD.PARAMETER.SUPPLEMENTORY_DATA_FILE ]);
+ FIELD.PARAMETER.SUPPLEMENTORY_DATA_FILE['value'] = paramList[uploadIndex].value;
var instanceName = "";
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/deletionDialogController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/deletionDialogController.js index 137673d4..499a1ec0 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/deletionDialogController.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/deletionDialogController.js @@ -80,6 +80,10 @@ var deletionDialogController = function( COMPONENT, FIELD, $scope, $http, $timeo var requestDetails = DeletionService.getMsoRequestDetails($scope.userProvidedControl.getList());
+
+ if(DeletionService.isMacro === true){
+ requestDetails.requestParameters.aLaCarte = false;
+ }
$scope.isDialogVisible = false;
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/previousVersionContoller.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/previousVersionContoller.js new file mode 100644 index 00000000..eb0dac64 --- /dev/null +++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/previousVersionContoller.js @@ -0,0 +1,40 @@ +"use strict"; + +var previousVersionContoller = function( COMPONENT, FIELD, $scope, $http, $timeout, $log, + CreationService, UtilityService, DataService,VIDCONFIGURATION) { + $scope.isTableDialogVisible = false; + $scope.summaryControl = {}; + $scope.userProvidedControl = {}; + + var callbackFunction = undefined; + var componentId = undefined; + + $scope.$on("createTableComponent", function(event, request) { + + $scope.isTableSpinnerVisible = true; + $scope.isTableErrorVisible = false; + $scope.isTableDialogVisible = true; + $scope.popup.isTablePopUpVisible = true; + componentId = request.componentId; + CreationService.initializeComponent(request.componentId); + callbackFunction = request.callbackFunction; + CreationService.setHttpErrorHandler(function(response) { + showError("System failure", UtilityService + .getHttpErrorMessage(response)); + }); + $scope.isTableSpinnerVisible = false; + }); + + + $scope.cancelTable = function(){ + $scope.isTableDialogVisible = false; + $scope.popup.isTablePopUpVisible = false; + } + + +} + +app + .controller("previousVersionContoller", [ "COMPONENT", "FIELD", "$scope", "$http", + "$timeout", "$log", "CreationService", "UtilityService", "DataService","VIDCONFIGURATION", + previousVersionContoller ]); diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/previousVersionDialogController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/previousVersionDialogController.js new file mode 100644 index 00000000..d11f432e --- /dev/null +++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/previousVersionDialogController.js @@ -0,0 +1,40 @@ +"use strict"; + +var previousVersionDialogController = function( COMPONENT, FIELD, $scope, $http, $timeout, $log, + CreationService, UtilityService, DataService,VIDCONFIGURATION) { + $scope.isTableDialogVisible = false; + $scope.summaryControl = {}; + $scope.userProvidedControl = {}; + + var callbackFunction = undefined; + var componentId = undefined; + + $scope.$on("createTableComponent", function(event, request) { + + $scope.isTableSpinnerVisible = true; + $scope.isTableErrorVisible = false; + $scope.isTableDialogVisible = true; + $scope.popup.isTablePopUpVisible = true; + componentId = request.componentId; + CreationService.initializeComponent(request.componentId); + callbackFunction = request.callbackFunction; + CreationService.setHttpErrorHandler(function(response) { + showError("System failure", UtilityService + .getHttpErrorMessage(response)); + }); + $scope.isTableSpinnerVisible = false; + }); + + + $scope.cancelTable = function(){ + $scope.isTableDialogVisible = false; + $scope.popup.isTablePopUpVisible = false; + } + + +} + +app + .controller("previousVersionDialogController", [ "COMPONENT", "FIELD", "$scope", "$http", + "$timeout", "$log", "CreationService", "UtilityService", "DataService","VIDCONFIGURATION", + previousVersionDialogController ]); diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/statusDialogController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/statusDialogController.js index de156667..0d067ff1 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/statusDialogController.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/statusDialogController.js @@ -130,7 +130,7 @@ var statusDialogController = function(COMPONENT, FIELD, $scope, $http, $timeout, var polls = PropertyService.retrieveMsoMaxPolls();
PropertyService.setMsoMaxPolls(polls);
- PropertyService.setServerResponseTimeoutMsec(10000)
+ PropertyService.setServerResponseTimeoutMsec(30000);
$scope.isSpinnerVisible = true;
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/subscriberSearch.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/subscriberSearch.js index 06cbf058..029860f8 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/subscriberSearch.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/subscriberSearch.js @@ -64,7 +64,7 @@ appDS2.controller("aaiSubscriberSearchController", [ "$scope", "$timeout", "$log var polls = PropertyService.retrieveMsoMaxPolls();
PropertyService.setMsoMaxPolls(polls);
- PropertyService.setServerResponseTimeoutMsec(10000);
+ PropertyService.setServerResponseTimeoutMsec(30000);
// These two properties only added for testing
properties.msoDefaultBaseUrl = $scope.baseUrl;
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/directives/parameterBlockDirective.js b/vid-app-common/src/main/webapp/app/vid/scripts/directives/parameterBlockDirective.js index 69a0ae52..e57b43ec 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/directives/parameterBlockDirective.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/directives/parameterBlockDirective.js @@ -49,355 +49,377 @@ var parameterBlockDirective = function($log, PARAMETER, UtilityService) { var checkboxInputStyle = "height: 18px; width: 18px; padding: 2px 5px;";
var selectStyle = "height: 25px; padding: 2px; text-align: center;";
var requiredLabelStyle = "width: 25px; padding: 5px 10px 10px 5px;";
-
+
var getParameterHtml = function(parameter, editable) {
- var style = valueStyle;
- var attributeString = "";
- if (parameter.type === PARAMETER.BOOLEAN) {
- style = checkboxValueStyle;
- }
- if (UtilityService.hasContents(parameter.description)) {
- attributeString += " title=' " + parameter.description + " '";
- }
- var rowstyle='';
- if(parameter.type == 'file' && !parameter.isVisiblity){
- rowstyle = ' style="display:none;"';
- }
- var html = "<tr"+rowstyle+"><td style='" + nameStyle + "'" + attributeString + ">"
- + getNameHtml(parameter) + "</td><td style='" + style + "'>";
- if (editable === undefined) {
- if (UtilityService.hasContents(parameter.value)) {
- html += parameter.value;
- }
- } else {
- html += getValueHtml(parameter);
- }
- html += "</td></tr>";
- return html;
+ var style = valueStyle;
+ var attributeString = "";
+ if (parameter.type === PARAMETER.BOOLEAN) {
+ style = checkboxValueStyle;
+ }
+ if (UtilityService.hasContents(parameter.description)) {
+ attributeString += " title=' " + parameter.description + " '";
+ }
+ var rowstyle='';
+ if(parameter.type == 'file' && !parameter.isVisiblity){
+ rowstyle = ' style="display:none;"';
+ }
+ var html = "<tr"+rowstyle+"><td style='" + nameStyle + "'" + attributeString + ">"
+ + getNameHtml(parameter) + "</td>";
+ if (editable === undefined) {
+ if (UtilityService.hasContents(parameter.value)) {
+ html += "<td data-tests-id='" + getParameterName(parameter) + "' style='" + style + "'>" + parameter.value;
+ } else {
+ html += "<td data-tests-id='" + getParameterName(parameter) + "' style='" + style + "'>";
+ }
+ } else {
+ html += "<td style='" + style + "'>" + getValueHtml(parameter);
+ }
+ html += "</td></tr>";
+ return html;
};
var updateParameter = function(parameter, element, editable) {
- $(element).parent().parent().children("td").first().html(
- getNameHtml(parameter));
- if (editable === undefined) {
- $(element).html(parameter.value);
- } else {
- $(element).parent().html(getValueHtml(parameter));
- }
+ $(element).parent().parent().children("td").first().html(
+ getNameHtml(parameter));
+ if (editable === undefined) {
+ $(element).html(parameter.value);
+ } else {
+ $(element).parent().html(getValueHtml(parameter));
+ }
};
var getNameHtml = function(parameter) {
- if (parameter.isVisible === false) {
- return "";
- }
- var name = "";
- if (UtilityService.hasContents(parameter.name)) {
- name = parameter.name;
- } else {
- name = parameter.id;
- }
- var requiredLabel = "";
- if (parameter.isRequired) {
- requiredLabel = "<img src='app/vid/images/asterisk.png' style='"
- + requiredLabelStyle + "'></img>";
- }
- return name + ":" + requiredLabel;
+ if (parameter.isVisible === false) {
+ return "";
+ }
+ var name = getParameterName(parameter);
+
+ var requiredLabel = "";
+ if (parameter.isRequired) {
+ requiredLabel = "<img src='app/vid/images/asterisk.png' style='"
+ + requiredLabelStyle + "'></img>";
+ }
+ return name + ":" + requiredLabel;
};
+ var getParameterName = function(parameter) {
+ var name = "";
+ if (UtilityService.hasContents(parameter.name)) {
+ name = parameter.name;
+ } else {
+ name = parameter.id;
+ }
+ return name;
+ }
+
var getValueHtml = function(parameter) {
-
- var textInputPrompt = "Enter data";
- var attributeString = " parameter-id='" + parameter.id + "'";
- var additionalStyle = "";
- if (parameter.isEnabled === false) {
- attributeString += " disabled='disabled'";
- }
- if (parameter.isRequired) {
- attributeString += " is-required='true'";
- }
- if (UtilityService.hasContents(parameter.description)) {
- attributeString += " title=' " + parameter.description + " '";
- }
- if (UtilityService.hasContents(parameter.isReadOnly) && (parameter.isReadOnly === true)) {
- attributeString += " readonly";
- }
- if ( (UtilityService.hasContents(parameter.maxLength)) && (UtilityService.hasContents(parameter.minLength)) ) {
- attributeString += " pattern='.{" + parameter.minLength + "," + parameter.maxLength + "}' required";
- }
- else if (UtilityService.hasContents(parameter.maxLength)) {
- attributeString += " maxlength='" + parameter.maxLength + "'";
- }
- else if (UtilityService.hasContents(parameter.minLength)) {
- attributeString += " pattern='.{" + parameter.minLength + ",}'"
- }
- if (parameter.isVisible === false) {
- additionalStyle = " visibility: hidden;";
- }
-
- var name = "";
- if (UtilityService.hasContents(parameter.name)) {
- name = parameter.name;
- } else {
- name = parameter.id;
- }
- attributeString += " parameter-name='" + name + "'";
-
- if ( parameter.type === PARAMETER.MAP ) {
- textInputPrompt = "{<key1>: <value1>,\.\.\.,<keyN>: <valueN>}";
- }
-
- if ( parameter.type === PARAMETER.LIST ) {
- textInputPrompt = "[<value1>,\.\.\.,<valueN>]";
- }
-
- switch (parameter.type) {
- case PARAMETER.BOOLEAN:
- if (parameter.value) {
- return "<select" + attributeString + " style='" + selectStyle
- + additionalStyle + "'>" + "<option value=true>true</option>"
- + "<option value=false>false</option>";
- + "</select>";
- }else{
- return "<select" + attributeString + " style='" + selectStyle
- + additionalStyle + "'>" + "<option value=false>false</option>"
- + "<option value=true>true</option>"
- + "</select>";
- }
- break;
- case PARAMETER.CHECKBOX:
- if (parameter.value) {
- return "<input type='checkbox' "+attributeString+ " checked='checked' style='"+checkboxInputStyle+"'"
- + " value='true'/>";
- }else{
- return "<input type='checkbox' "+attributeString+ "' style='"+checkboxInputStyle+"'"
- + " value='false'/>";
- }
- break;
- case PARAMETER.FILE:
- return "<input type='file' "+attributeString+ " id='"+parameter.id+"' value='"+parameter.value+"'/>";
- break;
- case PARAMETER.NUMBER:
- var value=parameter.value;
- var parameterSpec = "<input type='number'" + attributeString + " style='" + textInputStyle + additionalStyle + "'";
-
- if ( UtilityService.hasContents(parameter.min) ) {
- parameterSpec += " min='" + parameter.min + "'";
- }
- if ( UtilityService.hasContents(parameter.max) ) {
- parameterSpec += " max='" + parameter.max + "'";
- }
- if (UtilityService.hasContents(value)) {
- parameterSpec += " value='" + value + "'";
- }
- parameterSpec += ">";
-
- /*if(!isNaN(value) && value.toString().index('.') != -1){
- //float
- return "<input type='text'" + attributeString + " style='"
- + textInputStyle + additionalStyle + "' only-integers" + value
- + "></input>";
- } else {
- //integer
- return "<input type='text'" + attributeString + " style='"
- + textInputStyle + additionalStyle + "' only-float" + value
- + "></input>";
- }*/
- return (parameterSpec);
- break;
- case PARAMETER.SELECT:
- if (UtilityService.hasContents(parameter.prompt)) {
- attributeString += " prompt='" + parameter.prompt + "'";
- }
- return "<select" + attributeString + " style='" + selectStyle
- + additionalStyle + "'>" + getOptionListHtml(parameter)
- + "</select>";
- break;
- case PARAMETER.STRING:
- default:
- var value = "";
- if (UtilityService.hasContents(parameter.value)) {
- value = " value='" + parameter.value + "'";
- }
- if (UtilityService.hasContents(parameter.prompt)) {
- attributeString += " placeholder='" + parameter.prompt + "'";
- } else if (textInputPrompt !== "") {
- attributeString += " placeholder='" + textInputPrompt + "'";
- }
- var finalString = "<input type='text'" + attributeString + " style='"
- + textInputStyle + additionalStyle + "'" + value
- + ">";
- return finalString;
- }
+
+ var textInputPrompt = "Enter data";
+ var attributeString = " data-tests-id='" + parameter.id +"' parameter-id='" + parameter.id + "'";
+ var additionalStyle = "";
+ if (parameter.isEnabled === false) {
+ attributeString += " disabled='disabled'";
+ }
+ if (parameter.isRequired) {
+ attributeString += " is-required='true'";
+ }
+ if (UtilityService.hasContents(parameter.description)) {
+ attributeString += " title=' " + parameter.description + " '";
+ }
+ if (UtilityService.hasContents(parameter.isReadOnly) && (parameter.isReadOnly === true)) {
+ attributeString += " readonly";
+ }
+ if ( (UtilityService.hasContents(parameter.maxLength)) && (UtilityService.hasContents(parameter.minLength)) ) {
+ attributeString += " pattern='.{" + parameter.minLength + "," + parameter.maxLength + "}' required";
+ }
+ else if (UtilityService.hasContents(parameter.maxLength)) {
+ attributeString += " maxlength='" + parameter.maxLength + "'";
+ }
+ else if (UtilityService.hasContents(parameter.minLength)) {
+ attributeString += " pattern='.{" + parameter.minLength + ",}'"
+ }
+ if (parameter.isVisible === false) {
+ additionalStyle = " visibility: hidden;";
+ }
+
+ var name = "";
+ if (UtilityService.hasContents(parameter.name)) {
+ name = parameter.name;
+ } else {
+ name = parameter.id;
+ }
+ attributeString += " parameter-name='" + name + "'";
+
+ if ( parameter.type === PARAMETER.MAP ) {
+ textInputPrompt = "{<key1>: <value1>,\.\.\.,<keyN>: <valueN>}";
+ }
+
+ if ( parameter.type === PARAMETER.LIST ) {
+ textInputPrompt = "[<value1>,\.\.\.,<valueN>]";
+ }
+
+ switch (parameter.type) {
+ case PARAMETER.BOOLEAN:
+ if (parameter.value) {
+ return "<select" + attributeString + " style='" + selectStyle
+ + additionalStyle + "'>" + "<option value=true>true</option>"
+ + "<option value=false>false</option>";
+ + "</select>";
+ }else{
+ return "<select" + attributeString + " style='" + selectStyle
+ + additionalStyle + "'>" + "<option value=false>false</option>"
+ + "<option value=true>true</option>"
+ + "</select>";
+ }
+ break;
+ case PARAMETER.CHECKBOX:
+ if (parameter.value) {
+ return "<input type='checkbox' "+attributeString+ " checked='checked' style='"+checkboxInputStyle+"'"
+ + " value='true'/>";
+ }else{
+ return "<input type='checkbox' "+attributeString+ "' style='"+checkboxInputStyle+"'"
+ + " value='false'/>";
+ }
+ break;
+ case PARAMETER.FILE:
+ return "<input type='file' "+attributeString+ " id='"+parameter.id+"' value='"+parameter.value+"'/>";
+ break;
+ case PARAMETER.NUMBER:
+ var value=parameter.value;
+ var parameterSpec = "<input type='number'" + attributeString + " style='" + textInputStyle + additionalStyle + "'";
+
+ if ( UtilityService.hasContents(parameter.min) ) {
+ parameterSpec += " min='" + parameter.min + "'";
+ }
+ if ( UtilityService.hasContents(parameter.max) ) {
+ parameterSpec += " max='" + parameter.max + "'";
+ }
+ if (UtilityService.hasContents(value)) {
+ parameterSpec += " value='" + value + "'";
+ }
+ parameterSpec += ">";
+
+ /*if(!isNaN(value) && value.toString().index('.') != -1){
+ //float
+ return "<input type='text'" + attributeString + " style='"
+ + textInputStyle + additionalStyle + "' only-integers" + value
+ + "></input>";
+ } else {
+ //integer
+ return "<input type='text'" + attributeString + " style='"
+ + textInputStyle + additionalStyle + "' only-float" + value
+ + "></input>";
+ }*/
+ return (parameterSpec);
+ break;
+ case PARAMETER.SELECT:
+ if (UtilityService.hasContents(parameter.prompt)) {
+ attributeString += " prompt='" + parameter.prompt + "'";
+ }
+ return "<select" + attributeString + " style='" + selectStyle
+ + additionalStyle + "'>" + getOptionListHtml(parameter)
+ + "</select>";
+ break;
+ case PARAMETER.STRING:
+ default:
+ var value = "";
+ if (UtilityService.hasContents(parameter.value)) {
+ value = " value='" + parameter.value + "'";
+ }
+ if (UtilityService.hasContents(parameter.prompt)) {
+ attributeString += " placeholder='" + parameter.prompt + "'";
+ } else if (textInputPrompt !== "") {
+ attributeString += " placeholder='" + textInputPrompt + "'";
+ }
+ var finalString = "<input type='text'" + attributeString + " style='"
+ + textInputStyle + additionalStyle + "'" + value
+ + ">";
+ return finalString;
+ }
};
-
-
+
+
var getBooleanListHtml = function(parameter){
- var html = "";
-
+ var html = "";
+
};
var getOptionListHtml = function(parameter) {
- var html = "";
+ var html = "";
- if (!angular.isArray(parameter.optionList)
- || parameter.optionList.length === 0) {
- return "";
- }
+ if (!angular.isArray(parameter.optionList)
+ || parameter.optionList.length === 0) {
+ return "";
+ }
- if (UtilityService.hasContents(parameter.prompt)) {
+ if (UtilityService.hasContents(parameter.prompt)) {
if (!(IS_SINGLE_OPTION_AUTO_SELECTED && parameter.optionList.length === 1) || !(parameter.isSingleOptionAutoSelected && parameter.optionList.length === 1)) {
- html += "<option value=''>" + parameter.prompt + "</option>";
- }
- }
-
- for (var i = 0; i < parameter.optionList.length; i++) {
- var option = parameter.optionList[i];
- var name = option.name;
- var value = "";
- if (option.id === undefined) {
- value = option.name;
- } else {
- if (name === undefined) {
- name = option.id;
- }
- value = option.id;
- }
- if (option.isDefault === undefined || option.isDefault === false ) {
- html += "<option value='" + value + "'>" + name + "</option>";
- }
- else {
- html += "<option value='" + value + "' selected>" + name + "</option>";
- }
- }
- return html;
+ html += "<option value=''>" + parameter.prompt + "</option>";
+ }
+ }
+
+ for (var i = 0; i < parameter.optionList.length; i++) {
+ var option = parameter.optionList[i];
+ var name = option.name;
+ var value = "";
+ if (option.id === undefined) {
+ value = option.name;
+ } else {
+ if (name === undefined) {
+ name = option.id;
+ }
+ value = option.id;
+ }
+ html += getOptionHtml(option.isPermitted, option.isDataLoading, value, name, parameter);
+ }
+ return html;
};
+ function getOptionHtml(isPermitted, isDefault, value, name, parameter) {
+ var html = "";
+ if (isDefault === undefined || isDefault === false ) {
+ if(isPermitted)
+ html = "<option class='" + parameter.id + "Option' value='" + value + "'>" + name + "</option>";
+ else {
+ html = "<option class='" + parameter.id + "Option' value='" + value + "' disabled>" + name + "</option>";
+ }
+ }
+ else {
+ if(isPermitted)
+ html = "<option class='" + parameter.id + "Option' value='" + value + "'>" + "' selected>" + name + "</option>";
+ else {
+ html = "<option class='" + parameter.id + "Option' value='" + value + "' disabled>" + "' selected>" + name + "</option>";
+ }
+ }
+ return html;
+ }
+
var getParameter = function(element, expectedId) {
- var id = $(element).attr("parameter-id");
- if (expectedId !== undefined && expectedId !== id) {
- return undefined;
- }
- var parameter = {
- id : id
- };
- if ($(element).prop("type") === "checkbox") {
- parameter.value = $(element).prop("checked");
- }else if ($(element).prop("type") === "file") {
- parameter.value = $('#'+id).attr("value");
-
- } else {
- if ($(element).prop("type") === "text") {
- $(element).val($(element).val().trim());
- }
- parameter.value = $(element).val();
- }
- if ($(element).prop("selectedIndex") === undefined) {
- parameter.selectedIndex = -1;
- } else {
- parameter.selectedIndex = $(element).prop("selectedIndex");
- if (UtilityService.hasContents($(element).attr("prompt"))) {
- parameter.selectedIndex--;
- }
- }
- return parameter;
+ var id = $(element).attr("parameter-id");
+ if (expectedId !== undefined && expectedId !== id) {
+ return undefined;
+ }
+ var parameter = {
+ id : id
+ };
+ if ($(element).prop("type") === "checkbox") {
+ parameter.value = $(element).prop("checked");
+ }else if ($(element).prop("type") === "file") {
+ parameter.value = $('#'+id).attr("value");
+
+ } else {
+ if ($(element).prop("type") === "text") {
+ $(element).val($(element).val().trim());
+ }
+ parameter.value = $(element).val();
+ }
+ if ($(element).prop("selectedIndex") === undefined) {
+ parameter.selectedIndex = -1;
+ } else {
+ parameter.selectedIndex = $(element).prop("selectedIndex");
+ if (UtilityService.hasContents($(element).attr("prompt"))) {
+ parameter.selectedIndex--;
+ }
+ }
+ return parameter;
};
var getRequiredField = function(element) {
- if ($(element).prop("type") === "text") {
- $(element).val($(element).val().trim());
- }
- if ($(element).val() === "" || $(element).val() === null) {
- return '"' + $(element).attr("parameter-name") + '"';
- } else {
- return "";
- }
+ if ($(element).prop("type") === "text") {
+ $(element).val($(element).val().trim());
+ }
+ if ($(element).val() === "" || $(element).val() === null) {
+ return '"' + $(element).attr("parameter-name") + '"';
+ } else {
+ return "";
+ }
};
var callback = function(element, scope) {
- scope.callback({
- id : $(element).attr("parameter-id")
- });
+ scope.callback({
+ id : $(element).attr("parameter-id")
+ });
};
return {
- restrict : "EA",
- replace : true,
- template : "<div><table style='" + tableStyle + "'></table></div>",
- scope : {
- control : "=",
- callback : "&"
- },
- link : function(scope, element, attrs) {
-
- var control = scope.control || {};
-
- control.setList = function(parameterList) {
- var html = "";
- for (var i = 0; i < parameterList.length; i++) {
- html += getParameterHtml(parameterList[i], attrs.editable);
- }
- element.html(html);
- element.find("input, select").bind("change", function() {
- callback(this, scope);
- });
- }
-
- control.updateList = function(parameterList) {
- element.find("input, select").each(
- function() {
- for (var i = 0; i < parameterList.length; i++) {
- if (parameterList[i].id === $(this).attr(
- "parameter-id")) {
- updateParameter(parameterList[i], this,
- attrs.editable);
- }
- }
- });
- element.find("input, select").bind("change", function() {
- callback(this, scope);
- });
- }
-
- control.getList = function(expectedId) {
- var parameterList = new Array();
- element.find("input, select").each(function() {
- var parameter = getParameter(this, expectedId);
- if (parameter !== undefined) {
- parameterList.push(parameter);
- }
- });
- return parameterList;
- }
-
- control.getRequiredFields = function() {
- var requiredFields = "";
- var count = 0;
- element.find("input, select").each(function() {
- if ($(this).attr("is-required") === "true") {
- var requiredField = getRequiredField(this);
- if (requiredField !== "") {
- if (++count == 1) {
- requiredFields = requiredField;
- }
- }
- }
- });
- if (--count <= 0) {
- return requiredFields;
- } else if (count == 1) {
- return requiredFields + " and 1 other field";
- } else {
- return requiredFields + " and " + count + " other fields";
- }
- }
- }
+ restrict : "EA",
+ replace : true,
+ template : "<div><table style='" + tableStyle + "'></table></div>",
+ scope : {
+ control : "=",
+ callback : "&"
+ },
+ link : function(scope, element, attrs) {
+
+ var control = scope.control || {};
+
+ control.setList = function(parameterList) {
+ var html = "";
+ for (var i = 0; i < parameterList.length; i++) {
+ html += getParameterHtml(parameterList[i], attrs.editable);
+ }
+ element.html(html);
+ element.find("input, select").bind("change", function() {
+ callback(this, scope);
+ });
+ }
+
+ control.updateList = function(parameterList) {
+ element.find("input, select").each(
+ function() {
+ for (var i = 0; i < parameterList.length; i++) {
+ if (parameterList[i].id === $(this).attr(
+ "parameter-id")) {
+ updateParameter(parameterList[i], this,
+ attrs.editable);
+ }
+ }
+ });
+ element.find("input, select").bind("change", function() {
+ callback(this, scope);
+ });
+ }
+
+ control.getList = function(expectedId) {
+ var parameterList = new Array();
+ element.find("input, select").each(function() {
+ var parameter = getParameter(this, expectedId);
+ if (parameter !== undefined) {
+ parameterList.push(parameter);
+ }
+ });
+ return parameterList;
+ }
+
+ control.getRequiredFields = function() {
+ var requiredFields = "";
+ var count = 0;
+ element.find("input, select").each(function() {
+ if ($(this).attr("is-required") === "true") {
+ var requiredField = getRequiredField(this);
+ if (requiredField !== "") {
+ if (++count == 1) {
+ requiredFields = requiredField;
+ }
+ }
+ }
+ });
+ if (--count <= 0) {
+ return requiredFields;
+ } else if (count == 1) {
+ return requiredFields + " and 1 other field";
+ } else {
+ return requiredFields + " and " + count + " other fields";
+ }
+ }
+ }
}
}
appDS2.directive('parameterBlock', [ "$log", "PARAMETER", "UtilityService",
- parameterBlockDirective ]);
+ parameterBlockDirective ]);
appDS2.directive('onlyIntegers', function () {
@@ -416,7 +438,7 @@ appDS2.directive('onlyIntegers', function () { } else if (event.which >= 96 && event.which <= 105) {
// numpad number
return true;
- }
+ }
// else if ([110, 190].indexOf(event.which) > -1) {
// // dot and numpad dot
// return true;
@@ -435,13 +457,13 @@ appDS2.directive('onlyFloat', function () { restrict: 'A',
link: function (scope, elm, attrs, ctrl) {
elm.on('keydown', function (event) {
- if ([110, 190].indexOf(event.which) > -1) {
+ if ([110, 190].indexOf(event.which) > -1) {
// dot and numpad dot
event.preventDefault();
return true;
}
else{
- return false;
+ return false;
}
});
}
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/directives/parameterBlockDirective.js.orig b/vid-app-common/src/main/webapp/app/vid/scripts/directives/parameterBlockDirective.js.orig new file mode 100644 index 00000000..0e937826 --- /dev/null +++ b/vid-app-common/src/main/webapp/app/vid/scripts/directives/parameterBlockDirective.js.orig @@ -0,0 +1,507 @@ +/*- + * ============LICENSE_START======================================================= + * VID + * ================================================================================ + * Copyright (C) 2017 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========================================================= + */ + +"use strict"; + +var parameterBlockDirective = function($log, PARAMETER, UtilityService) { + /* + * If "IS_SINGLE_OPTION_AUTO_SELECTED" is set to "true" ... + * + * IF these 3 conditions all exist: + * + * 1) The parameter type is PARAMETER.SELECT + * + * 2) AND the "prompt" attribute is set to a string. + * + * 3) AND the optionList" only contains a single entry + * + * THEN the "prompt" will not be displayed as an initial select option. + */ + + var IS_SINGLE_OPTION_AUTO_SELECTED = true; + + /* + * Optionally remove "nameStyle" and "valueStyle" "width" entries to set + * dynamic sizing. + */ + var tableStyle = "width: auto; margin: 0 auto; border-collapse: collapse; border: none;"; + var nameStyle = "width: 220px; text-align: left; vertical-align: middle; font-weight: bold; padding: 3px 5px; border: none;"; + var valueStyle = "width: 400px; text-align: left; vertical-align: middle; padding: 3px 5px; border: none;"; + var checkboxValueStyle = "width: 400px; text-align: center; vertical-align: middle; padding: 3px 5px; border: none;" + var textInputStyle = "height: 25px; padding: 2px 5px;"; + var checkboxInputStyle = "height: 18px; width: 18px; padding: 2px 5px;"; + var selectStyle = "height: 25px; padding: 2px; text-align: center;"; + var requiredLabelStyle = "width: 25px; padding: 5px 10px 10px 5px;"; + + + var getParameterHtml = function(parameter, editable) { + var style = valueStyle; + var attributeString = ""; + if (parameter.type === PARAMETER.BOOLEAN) { + style = checkboxValueStyle; + } + if (UtilityService.hasContents(parameter.description)) { + attributeString += " title=' " + parameter.description + " '"; + } + var rowstyle=''; + if(parameter.type == 'file' && !parameter.isVisiblity){ + rowstyle = ' style="display:none;"'; + } + var html = "<tr"+rowstyle+"><td style='" + nameStyle + "'" + attributeString + ">" + + getNameHtml(parameter) + "</td>"; + if (editable === undefined) { + if (UtilityService.hasContents(parameter.value)) { + html += "<td data-tests-id='" + getParameterName(parameter) + "' style='" + style + "'>" + parameter.value; + } else { + html += "<td data-tests-id='" + getParameterName(parameter) + "' style='" + style + "'>"; + } + } else { + html += "<td style='" + style + "'>" + getValueHtml(parameter); + } + html += "</td></tr>"; + return html; + }; + + var updateParameter = function(parameter, element, editable) { + $(element).parent().parent().children("td").first().html( + getNameHtml(parameter)); + if (editable === undefined) { + $(element).html(parameter.value); + } else { + $(element).parent().html(getValueHtml(parameter)); + } + }; + + var getNameHtml = function(parameter) { + if (parameter.isVisible === false) { + return ""; + } + var name = getParameterName(parameter); + + var requiredLabel = ""; + if (parameter.isRequired) { + requiredLabel = "<img src='app/vid/images/asterisk.png' style='" + + requiredLabelStyle + "'></img>"; + } + return name + ":" + requiredLabel; + }; + + var getParameterName = function(parameter) { + var name = ""; + if (UtilityService.hasContents(parameter.name)) { + name = parameter.name; + } else { + name = parameter.id; + } + return name; + } + + var getValueHtml = function(parameter) { + + var textInputPrompt = "Enter data"; + var attributeString = " data-tests-id='" + parameter.id +"' parameter-id='" + parameter.id + "'"; + var additionalStyle = ""; + if (parameter.isEnabled === false) { + attributeString += " disabled='disabled'"; + } + if (parameter.isRequired) { + attributeString += " is-required='true'"; + } + if (UtilityService.hasContents(parameter.description)) { + attributeString += " title=' " + parameter.description + " '"; + } + if (UtilityService.hasContents(parameter.isReadOnly) && (parameter.isReadOnly === true)) { + attributeString += " readonly"; + } + if ( (UtilityService.hasContents(parameter.maxLength)) && (UtilityService.hasContents(parameter.minLength)) ) { + attributeString += " pattern='.{" + parameter.minLength + "," + parameter.maxLength + "}' required"; + } + else if (UtilityService.hasContents(parameter.maxLength)) { + attributeString += " maxlength='" + parameter.maxLength + "'"; + } + else if (UtilityService.hasContents(parameter.minLength)) { + attributeString += " pattern='.{" + parameter.minLength + ",}'" + } + if (parameter.isVisible === false) { + additionalStyle = " visibility: hidden;"; + } + + var name = ""; + if (UtilityService.hasContents(parameter.name)) { + name = parameter.name; + } else { + name = parameter.id; + } + attributeString += " parameter-name='" + name + "'"; + + if ( parameter.type === PARAMETER.MAP ) { + textInputPrompt = "{<key1>: <value1>,\.\.\.,<keyN>: <valueN>}"; + } + + if ( parameter.type === PARAMETER.LIST ) { + textInputPrompt = "[<value1>,\.\.\.,<valueN>]"; + } + + switch (parameter.type) { + case PARAMETER.BOOLEAN: + if (parameter.value) { + return "<select" + attributeString + " style='" + selectStyle + + additionalStyle + "'>" + "<option value=true>true</option>" + + "<option value=false>false</option>"; + + "</select>"; + }else{ + return "<select" + attributeString + " style='" + selectStyle + + additionalStyle + "'>" + "<option value=false>false</option>" + + "<option value=true>true</option>" + + "</select>"; + } + break; + case PARAMETER.CHECKBOX: + if (parameter.value) { + return "<input type='checkbox' "+attributeString+ " checked='checked' style='"+checkboxInputStyle+"'" + + " value='true'/>"; + }else{ + return "<input type='checkbox' "+attributeString+ "' style='"+checkboxInputStyle+"'" + + " value='false'/>"; + } + break; + case PARAMETER.FILE: + return "<input type='file' "+attributeString+ " id='"+parameter.id+"' value='"+parameter.value+"'/>"; + break; + case PARAMETER.NUMBER: + var value=parameter.value; + var parameterSpec = "<input type='number'" + attributeString + " style='" + textInputStyle + additionalStyle + "'"; + + if ( UtilityService.hasContents(parameter.min) ) { + parameterSpec += " min='" + parameter.min + "'"; + } + if ( UtilityService.hasContents(parameter.max) ) { + parameterSpec += " max='" + parameter.max + "'"; + } + if (UtilityService.hasContents(value)) { + parameterSpec += " value='" + value + "'"; + } + parameterSpec += ">"; + + /*if(!isNaN(value) && value.toString().index('.') != -1){ + //float + return "<input type='text'" + attributeString + " style='" + + textInputStyle + additionalStyle + "' only-integers" + value + + "></input>"; + } else { + //integer + return "<input type='text'" + attributeString + " style='" + + textInputStyle + additionalStyle + "' only-float" + value + + "></input>"; + }*/ + return (parameterSpec); + break; + case PARAMETER.SELECT: + if (UtilityService.hasContents(parameter.prompt)) { + attributeString += " prompt='" + parameter.prompt + "'"; + } + return "<select" + attributeString + " style='" + selectStyle + + additionalStyle + "'>" + getOptionListHtml(parameter) + + "</select>"; + break; + case PARAMETER.STRING: + default: + var value = ""; + if (UtilityService.hasContents(parameter.value)) { + value = " value='" + parameter.value + "'"; + } + if (UtilityService.hasContents(parameter.prompt)) { + attributeString += " placeholder='" + parameter.prompt + "'"; + } else if (textInputPrompt !== "") { + attributeString += " placeholder='" + textInputPrompt + "'"; + } + var finalString = "<input type='text'" + attributeString + " style='" + + textInputStyle + additionalStyle + "'" + value + + ">"; + return finalString; + } + }; + + + var getBooleanListHtml = function(parameter){ + var html = ""; + + }; + + var getOptionListHtml = function(parameter) { + +<<<<<<< HEAD + var html = ""; + + if (!angular.isArray(parameter.optionList) + || parameter.optionList.length === 0) { + return ""; + } + + if (UtilityService.hasContents(parameter.prompt)) { + if (!(IS_SINGLE_OPTION_AUTO_SELECTED && parameter.optionList.length === 1) || !(parameter.isSingleOptionAutoSelected && parameter.optionList.length === 1)) { + html += "<option value=''>" + parameter.prompt + "</option>"; + } + } + + for (var i = 0; i < parameter.optionList.length; i++) { + var option = parameter.optionList[i]; + var name = option.name; + var value = ""; + if (option.id === undefined) { + value = option.name; + } else { + if (name === undefined) { + name = option.id; + } + value = option.id; + } + if (option.isDefault === undefined || option.isDefault === false ) { + html += "<option value='" + value + "'>" + name + "</option>"; + } + else { + html += "<option value='" + value + "' selected>" + name + "</option>"; + } + } + return html; +======= + var html = ""; + + if (!angular.isArray(parameter.optionList) + || parameter.optionList.length === 0) { + return ""; + } + + if (UtilityService.hasContents(parameter.prompt)) { + if (!(IS_SINGLE_OPTION_AUTO_SELECTED && parameter.optionList.length === 1)) { + html += "<option value=''>" + parameter.prompt + "</option>"; + } + } + + for (var i = 0; i < parameter.optionList.length; i++) { + var option = parameter.optionList[i]; + var name = option.name; + var value = ""; + if (option.id === undefined) { + value = option.name; + } else { + if (name === undefined) { + name = option.id; + } + value = option.id; + } + html += getOptionHtml(option.isPermitted, option.isDataLoading, value, name, parameter); + } + return html; +>>>>>>> 7e45cad... merge + }; + + function getOptionHtml(isPermitted, isDefault, value, name, parameter) { + var html = ""; + if (isDefault === undefined || isDefault === false ) { + if(isPermitted) + html = "<option class='" + parameter.id + "Option' value='" + value + "'>" + name + "</option>"; + else { + html = "<option class='" + parameter.id + "Option' value='" + value + "' disabled>" + name + "</option>"; + } + } + else { + if(isPermitted) + html = "<option class='" + parameter.id + "Option' value='" + value + "'>" + "' selected>" + name + "</option>"; + else { + html = "<option class='" + parameter.id + "Option' value='" + value + "' disabled>" + "' selected>" + name + "</option>"; + } + } + return html; + } + + var getParameter = function(element, expectedId) { + var id = $(element).attr("parameter-id"); + if (expectedId !== undefined && expectedId !== id) { + return undefined; + } + var parameter = { + id : id + }; + if ($(element).prop("type") === "checkbox") { + parameter.value = $(element).prop("checked"); + }else if ($(element).prop("type") === "file") { + parameter.value = $('#'+id).attr("value"); + + } else { + if ($(element).prop("type") === "text") { + $(element).val($(element).val().trim()); + } + parameter.value = $(element).val(); + } + if ($(element).prop("selectedIndex") === undefined) { + parameter.selectedIndex = -1; + } else { + parameter.selectedIndex = $(element).prop("selectedIndex"); + if (UtilityService.hasContents($(element).attr("prompt"))) { + parameter.selectedIndex--; + } + } + return parameter; + }; + + var getRequiredField = function(element) { + if ($(element).prop("type") === "text") { + $(element).val($(element).val().trim()); + } + if ($(element).val() === "" || $(element).val() === null) { + return '"' + $(element).attr("parameter-name") + '"'; + } else { + return ""; + } + }; + + var callback = function(element, scope) { + scope.callback({ + id : $(element).attr("parameter-id") + }); + }; + + return { + restrict : "EA", + replace : true, + template : "<div><table style='" + tableStyle + "'></table></div>", + scope : { + control : "=", + callback : "&" + }, + link : function(scope, element, attrs) { + + var control = scope.control || {}; + + control.setList = function(parameterList) { + var html = ""; + for (var i = 0; i < parameterList.length; i++) { + html += getParameterHtml(parameterList[i], attrs.editable); + } + element.html(html); + element.find("input, select").bind("change", function() { + callback(this, scope); + }); + } + + control.updateList = function(parameterList) { + element.find("input, select").each( + function() { + for (var i = 0; i < parameterList.length; i++) { + if (parameterList[i].id === $(this).attr( + "parameter-id")) { + updateParameter(parameterList[i], this, + attrs.editable); + } + } + }); + element.find("input, select").bind("change", function() { + callback(this, scope); + }); + } + + control.getList = function(expectedId) { + var parameterList = new Array(); + element.find("input, select").each(function() { + var parameter = getParameter(this, expectedId); + if (parameter !== undefined) { + parameterList.push(parameter); + } + }); + return parameterList; + } + + control.getRequiredFields = function() { + var requiredFields = ""; + var count = 0; + element.find("input, select").each(function() { + if ($(this).attr("is-required") === "true") { + var requiredField = getRequiredField(this); + if (requiredField !== "") { + if (++count == 1) { + requiredFields = requiredField; + } + } + } + }); + if (--count <= 0) { + return requiredFields; + } else if (count == 1) { + return requiredFields + " and 1 other field"; + } else { + return requiredFields + " and " + count + " other fields"; + } + } + } + } +} + +appDS2.directive('parameterBlock', [ "$log", "PARAMETER", "UtilityService", + parameterBlockDirective ]); + + +appDS2.directive('onlyIntegers', function () { + return { + restrict: 'A', + link: function (scope, elm, attrs, ctrl) { + elm.on('keydown', function (event) { + if(event.shiftKey){event.preventDefault(); return false;} + //console.log(event.which); + if ([8, 13, 27, 37, 38, 39, 40].indexOf(event.which) > -1) { + // backspace, enter, escape, arrows + return true; + } else if (event.which >= 49 && event.which <= 57) { + // numbers + return true; + } else if (event.which >= 96 && event.which <= 105) { + // numpad number + return true; + } + // else if ([110, 190].indexOf(event.which) > -1) { + // // dot and numpad dot + // return true; + // } + else { + event.preventDefault(); + return false; + } + }); + } + } +}); + +appDS2.directive('onlyFloat', function () { + return { + restrict: 'A', + link: function (scope, elm, attrs, ctrl) { + elm.on('keydown', function (event) { + if ([110, 190].indexOf(event.which) > -1) { + // dot and numpad dot + event.preventDefault(); + return true; + } + else{ + return false; + } + }); + } + } +}); diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/aaiService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/aaiService.js index ee99547b..09c70eb5 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/services/aaiService.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/aaiService.js @@ -20,339 +20,365 @@ "use strict";
-var AaiService = function($http, $log, PropertyService, UtilityService, COMPONENT, FIELD) {
+var AaiService = function ($http, $log, PropertyService, UtilityService, COMPONENT, FIELD) {
return {
- getSubscriberName : function(globalCustomerId,
- successCallbackFunction) {
- $log
- .debug("AaiService:getSubscriberName: globalCustomerId: "
- + globalCustomerId);
- $http.get(
- COMPONENT.AAI_SUB_DETAILS_PATH
- + globalCustomerId + COMPONENT.ASSIGN + Math.random(),
- {
- timeout : PropertyService
- .getServerResponseTimeoutMsec()
- }).then(function(response) {
- var subName = "";
- if (response.data) {
- subName = response.data[FIELD.ID.SUBNAME];
- }
- successCallbackFunction(subName);
- })["catch"]
- (UtilityService.runHttpErrorHandler);
- },
+ getSubscriberName: function (globalCustomerId,
+ successCallbackFunction) {
+ $log
+ .debug("AaiService:getSubscriberName: globalCustomerId: "
+ + globalCustomerId);
+ $http.get(
+ COMPONENT.AAI_SUB_DETAILS_PATH
+ + globalCustomerId + COMPONENT.ASSIGN + Math.random(),
+ {
+ timeout: PropertyService
+ .getServerResponseTimeoutMsec()
+ }).then(function (response) {
+ var subName = "";
+ if (response.data) {
+ subName = response.data[FIELD.ID.SUBNAME];
+ }
+ successCallbackFunction(subName);
+ })["catch"]
+ (UtilityService.runHttpErrorHandler);
+ },
-
- runNamedQuery : function (namedQueryId, globalCustomerId, serviceType, serviceInstanceId, successCallback, errorCallback) {
-
- var url = COMPONENT.AAI_SUB_VIEWEDIT_PATH +
- COMPONENT.FORWARD_SLASH + encodeURIComponent(namedQueryId) +
- COMPONENT.FORWARD_SLASH + encodeURIComponent(globalCustomerId) +
- COMPONENT.FORWARD_SLASH + encodeURIComponent(serviceType) +
- COMPONENT.FORWARD_SLASH + encodeURIComponent(serviceInstanceId);
- $http.get(url, {
- },{
- timeout : PropertyService.getServerResponseTimeoutMsec()
- }).then(function(response) {
- if (response.data != null) {
- successCallback(response);
- } else {
- errorCallback(response);
- }
- }, function(response) {
- errorCallback(response);
- });
- },
-
-
- getSubDetails : function(selectedSubscriber, selectedServiceInstance, successCallback, errorCallback) {
- var subscriber;
- var displayData;
- $http.get( COMPONENT.AAI_SUB_DETAILS_PATH + selectedSubscriber, {
+ runNamedQuery: function (namedQueryId, globalCustomerId, serviceType, serviceInstanceId, successCallback, errorCallback) {
- },{
- timeout : PropertyService.getServerResponseTimeoutMsec()
- }).then(function(response) {
- displayData = [];
- subscriber = response.data;
- var subscriberName = subscriber[FIELD.ID.SUBNAME];
- if (subscriber[FIELD.ID.SERVICE_SUBSCRIPTIONS] != null) {
- angular.forEach(subscriber[FIELD.ID.SERVICE_SUBSCRIPTIONS][FIELD.ID.SERVICE_SUBSCRIPTION], function(serviceSubscription, key) {
- var serviceInstanceId = [];
- var serviceType = "";
- if (serviceSubscription[FIELD.ID.SERVICETYPE] != null) {
- serviceType = serviceSubscription[FIELD.ID.SERVICETYPE];
- } else {
- serviceType = FIELD.PROMPT.NO_SERVICE_SUB;
- }
- if (serviceSubscription[FIELD.ID.SERVICE_INSTANCES] != null) {
- angular.forEach(serviceSubscription[FIELD.ID.SERVICE_INSTANCES][FIELD.ID.SERVICE_INSTANCE], function(instValue, instKey) {
- // put them together, i guess
- var inst = { "serviceInstanceId": instValue[FIELD.ID.SERVICE_INSTANCE_ID],
- "aaiModelInvariantId": instValue[FIELD.ID.MODEL_INVAR_ID],
- "aaiModelVersionId": instValue[FIELD.ID.MODEL_VERSION_ID],
- "serviceInstanceName": instValue[FIELD.ID.SERVICE_INSTANCE_NAME]
- };
- if (selectedServiceInstance != null) {
- if ((instValue[FIELD.ID.SERVICE_INSTANCE_ID] == selectedServiceInstance ) || (instValue[FIELD.ID.SERVICE_INSTANCE_NAME] == selectedServiceInstance)) {
- serviceInstanceId.push(inst);
- }
- } else {
- serviceInstanceId.push(inst);
- }
- });
- } else {
- if (serviceInstanceId == []) {
- serviceInstanceId = [ FIELD.PROMPT.NO_SERVICE_INSTANCE ];
- }
- }
- angular.forEach(serviceInstanceId, function(subVal, subKey) {
- displayData.push({
- globalCustomerId : selectedSubscriber,
- subscriberName : subscriberName,
- serviceType : serviceType,
- serviceInstanceId : subVal.serviceInstanceId,
- aaiModelInvariantId : subVal.aaiModelInvariantId,
- aaiModelVersionId
- : subVal.aaiModelVersionId,
- serviceInstanceName : subVal.serviceInstanceName
- });
- });
- });
- } else {
- displayData.push({
- globalCustomerId : selectedSubscriber,
- subscriberName : selectedSubscriberName,
- serviceType : FIELD.PROMPT.NO_SERVICE_SUB,
- serviceInstanceId : FIELD.PROMPT.NO_SERVICE_INSTANCE
- });
- }
- successCallback(displayData, subscriberName);
- }, function(response) {
- errorCallback(response);
- });
- },
- getSubList : function(successCallback, errorCallback ) {
+ var url = COMPONENT.AAI_SUB_VIEWEDIT_PATH +
+ COMPONENT.FORWARD_SLASH + encodeURIComponent(namedQueryId) +
+ COMPONENT.FORWARD_SLASH + encodeURIComponent(globalCustomerId) +
+ COMPONENT.FORWARD_SLASH + encodeURIComponent(serviceType) +
+ COMPONENT.FORWARD_SLASH + encodeURIComponent(serviceInstanceId);
+ $http.get(url, {}, {
+ timeout: PropertyService.getServerResponseTimeoutMsec()
+ }).then(function (response) {
+ if (response.data != null) {
+ successCallback(response);
+ } else {
+ errorCallback(response);
+ }
+ }, function (response) {
+ errorCallback(response);
+ });
+ },
- $http.get( FIELD.ID.AAI_GET_FULL_SUBSCRIBERS, {
- },{
- timeout : PropertyService.getServerResponseTimeoutMsec()
- }).then(function(response) {
- var customerList = [];
- if (response.data.customer != null) {
- angular.forEach(response.data.customer, function(subVal, subKey) {
- var cust = { "globalCustomerId": subVal[FIELD.ID.GLOBAL_CUSTOMER_ID], "subscriberName": subVal[FIELD.ID.SUBNAME] };
- customerList.push(cust);
- });
- successCallback(customerList);
- } else {
- errorCallback(response);
- }
- },function(response) {
- errorCallback(response);
- });
- },
-
- getServices2 : function(successCallback, errorCallback ) {
+ getSubDetails: function (selectedSubscriber, selectedServiceInstance, successCallback, errorCallback) {
+ var subscriber;
+ var displayData;
+ $http.get(COMPONENT.AAI_SUB_DETAILS_PATH + selectedSubscriber, {}, {
+ timeout: PropertyService.getServerResponseTimeoutMsec()
+ }).then(function (response) {
+ displayData = [];
+ subscriber = response.data;
+ var subscriberName = subscriber[FIELD.ID.SUBNAME];
+ if (subscriber[FIELD.ID.SERVICE_SUBSCRIPTIONS] != null) {
+ angular.forEach(subscriber[FIELD.ID.SERVICE_SUBSCRIPTIONS][FIELD.ID.SERVICE_SUBSCRIPTION], function (serviceSubscription, key) {
+ var serviceInstanceId = [];
+ var serviceType = "";
+ if (serviceSubscription[FIELD.ID.SERVICETYPE] != null) {
+ serviceType = serviceSubscription[FIELD.ID.SERVICETYPE];
+ } else {
+ serviceType = FIELD.PROMPT.NO_SERVICE_SUB;
+ }
+ if (serviceSubscription[FIELD.ID.SERVICE_INSTANCES] != null) {
+ angular.forEach(serviceSubscription[FIELD.ID.SERVICE_INSTANCES][FIELD.ID.SERVICE_INSTANCE], function (instValue, instKey) {
+ // put them together, i guess
+ var inst = {
+ "serviceInstanceId": instValue[FIELD.ID.SERVICE_INSTANCE_ID],
+ "aaiModelInvariantId": instValue[FIELD.ID.MODEL_INVAR_ID],
+ "aaiModelVersionId": instValue[FIELD.ID.MODEL_VERSION_ID],
+ "serviceInstanceName": instValue[FIELD.ID.SERVICE_INSTANCE_NAME]
+ };
+ if (selectedServiceInstance != null) {
+ if ((instValue[FIELD.ID.SERVICE_INSTANCE_ID] == selectedServiceInstance ) || (instValue[FIELD.ID.SERVICE_INSTANCE_NAME] == selectedServiceInstance)) {
+ serviceInstanceId.push(inst);
+ }
+ } else {
+ serviceInstanceId.push(inst);
+ }
+ });
+ } else {
+ if (serviceInstanceId == []) {
+ serviceInstanceId = [FIELD.PROMPT.NO_SERVICE_INSTANCE];
+ }
+ }
+ angular.forEach(serviceInstanceId, function (subVal, subKey) {
+ displayData.push({
+ globalCustomerId: selectedSubscriber,
+ subscriberName: subscriberName,
+ serviceType: serviceType,
+ serviceInstanceId: subVal.serviceInstanceId,
+ aaiModelInvariantId: subVal.aaiModelInvariantId,
+ aaiModelVersionId: subVal.aaiModelVersionId,
+ serviceInstanceName: subVal.serviceInstanceName,
+ isPermitted: serviceSubscription[FIELD.ID.IS_PERMITTED]
+ });
+ });
+ });
+ } else {
+ displayData.push({
+ globalCustomerId: selectedSubscriber,
+ subscriberName: selectedSubscriberName,
+ serviceType: FIELD.PROMPT.NO_SERVICE_SUB,
+ serviceInstanceId: FIELD.PROMPT.NO_SERVICE_INSTANCE
+ });
+ }
+ successCallback(displayData, subscriberName);
+ }, function (response) {
+ errorCallback(response);
+ });
+ },
+ getSubList: function (successCallback, errorCallback) {
- $http.get( FIELD.ID.AAI_GET_SERVICES, {
+ $http.get(FIELD.ID.AAI_GET_FULL_SUBSCRIBERS, {}, {
+ timeout: PropertyService.getServerResponseTimeoutMsec()
+ }).then(function (response) {
+ var customerList = [];
+ if (response.data.customer != null) {
+ angular.forEach(response.data.customer, function (subVal, subKey) {
+ var cust = {
+ "globalCustomerId": subVal[FIELD.ID.GLOBAL_CUSTOMER_ID],
+ "subscriberName": subVal[FIELD.ID.SUBNAME],
+ "isPermitted": subVal[FIELD.ID.IS_PERMITTED],
+ };
+ customerList.push(cust);
+ });
+ successCallback(customerList);
+ } else {
+ errorCallback(response);
+ }
+ }, function (response) {
+ errorCallback(response);
+ });
+ },
- },{
- timeout : PropertyService.getServerResponseTimeoutMsec()
- }).then(function(response) {
- var customerList = [];
- if (response.data != null) {
- var serviceIdList = [];
- angular.forEach(response.data, function(value, key) {
- angular.forEach(value, function(subVal, key) {
- var newVal = { "id" : subVal[FIELD.ID.SERVICE_ID], "description" : subVal[FIELD.ID.SERVICE_DESCRIPTION] };
- serviceIdList.push(newVal);
- });
- });
- successCallback(serviceIdList);
- } else {
- errorCallback(response);
- }
- },function(response) {
- errorCallback(response);
- });
- },
-
- getSubscriptionServiceTypeList : function(globalCustomerId,
- successCallbackFunction) {
- $log
- .debug("AaiService:getSubscriptionServiceTypeList: globalCustomerId: "
- + globalCustomerId);
- if ( UtilityService.hasContents(globalCustomerId) ) {
- $http.get(
- COMPONENT.AAI_SUB_DETAILS_PATH
- + globalCustomerId + COMPONENT.ASSIGN + Math.random(),
- {
- timeout : PropertyService
- .getServerResponseTimeoutMsec()
- }).then(function(response) {
- if (response.data && response.data[FIELD.ID.SERVICE_SUBSCRIPTIONS]) {
- var serviceTypes = [];
- var serviceSubscriptions = response.data[FIELD.ID.SERVICE_SUBSCRIPTIONS][FIELD.ID.SERVICE_SUBSCRIPTION];
-
- for (var i = 0; i < serviceSubscriptions.length; i++) {
- serviceTypes.push(serviceSubscriptions[i][FIELD.ID.SERVICETYPE]);
- }
- successCallbackFunction(serviceTypes);
- } else {
- successCallbackFunction([]);
- }
- })["catch"]
- (UtilityService.runHttpErrorHandler);
- }
- },
- getLcpCloudRegionTenantList : function(globalCustomerId, serviceType,
- successCallbackFunction) {
- $log
- .debug("AaiService:getLcpCloudRegionTenantList: globalCustomerId: "
- + globalCustomerId);
- var url = COMPONENT.AAI_GET_TENANTS
- + globalCustomerId + COMPONENT.FORWARD_SLASH + serviceType + COMPONENT.ASSIGN + Math.random();
-
- $http.get(url,
- {
- timeout : PropertyService
- .getServerResponseTimeoutMsec()
- }).then(function(response) {
- var lcpCloudRegionTenants = [];
- var aaiLcpCloudRegionTenants = response.data;
-
- lcpCloudRegionTenants.push({
- "cloudRegionId": "",
- "tenantName": FIELD.PROMPT.REGION,
- "tenantId": ""
- });
-
- for (var i = 0; i < aaiLcpCloudRegionTenants.length; i++) {
- lcpCloudRegionTenants.push({
- "cloudRegionId": aaiLcpCloudRegionTenants[i][COMPONENT.CLOUD_REGION_ID],
- "tenantName": aaiLcpCloudRegionTenants[i][COMPONENT.TENANT_NAME],
- "tenantId": aaiLcpCloudRegionTenants[i][COMPONENT.TENANT_ID]
- });
- }
-
- successCallbackFunction(lcpCloudRegionTenants);
- })["catch"]
- (UtilityService.runHttpErrorHandler);
- },
- getSubscribers : function(successCallbackFunction) {
- $log
- .debug("AaiService:getSubscribers");
- var url = FIELD.ID.AAI_GET_SUBSCRIBERS + COMPONENT.ASSIGN + Math.random();
-
- $http.get(url,
- {
- timeout : PropertyService
- .getServerResponseTimeoutMsec()
- }).then(function(response) {
- if (response.data) {
- successCallbackFunction(response.data.customer);
- } else {
- successCallbackFunction([]);
- }
- })["catch"]
- (UtilityService.runHttpErrorHandler);
- },
- getProvOptionsFromSystemProp : function(successCallbackFunction) {
- $log
- .debug("AaiService:getProvOptionsFromSystemProp");
- var url = COMPONENT.GET_SYSTEM_PROP_VNF_PROV_STATUS_PATH;
-
- $http.get(url,
- {
- timeout : PropertyService
- .getServerResponseTimeoutMsec()
- }).then(function(response) {
- if (response.data) {
- successCallbackFunction(response);
- } else {
- successCallbackFunction([]);
- }
- })["catch"]
- (UtilityService.runHttpErrorHandler);
- },
- getLoggedInUserID : function(successCallbackFunction) {
- $log
- .debug("AaiService:getLoggedInUserID");
- var url = COMPONENT.GET_USER_ID;
-
- $http.get(url,
- {
- timeout : PropertyService
- .getServerResponseTimeoutMsec()
- }).then(function(response) {
- if (response.data) {
- successCallbackFunction(response);
- } else {
- successCallbackFunction([]);
- }
- })["catch"]
- (UtilityService.runHttpErrorHandler);
- },
- getServices : function(successCallbackFunction) {
- $log
- .debug("AaiService:getServices");
- var url = COMPONENT.AAI_GET_SERVICES + COMPONENT.ASSIGN + Math.random();
-
- $http.get(url,
- {
- timeout : PropertyService
- .getServerResponseTimeoutMsec()
- }).then(function(response) {
- if (response.data) {
- successCallbackFunction(response);
- } else {
- successCallbackFunction([]);
- }
- })["catch"]
- (UtilityService.runHttpErrorHandler);
- },
- getServiceModels : function(globalCustomerId,serviceType,successCallbackFunction) {
- $log
- .debug("AaiService:getServices");
- var url = COMPONENT.AAI_GET_SERVICES + COMPONENT.FORWARD_SLASH+globalCustomerId+ COMPONENT.FORWARD_SLASH +serviceType+COMPONENT.ASSIGN + Math.random();
+ getServices2: function (successCallback, errorCallback) {
- $http.get(url,
- {
- timeout : PropertyService
- .getServerResponseTimeoutMsec()
- }).then(function(response) {
- if (response.data) {
- successCallbackFunction(response);
- } else {
- successCallbackFunction([]);
- }
- })["catch"]
- (UtilityService.runHttpErrorHandler);
-},
-getServiceModelsByServiceType : function(namedQueryId,globalCustomerId,serviceType,successCallbackFunction) {
- $log
- .debug("AaiService:getServiceModelsByServiceType");
- var url = COMPONENT.AAI_GET_SERVICES_BY_TYPE+COMPONENT.FORWARD_SLASH+namedQueryId+COMPONENT.FORWARD_SLASH+globalCustomerId+COMPONENT.FORWARD_SLASH +serviceType+COMPONENT.ASSIGN + Math.random();
-
- $http.get(url,
- {
- timeout : PropertyService
- .getServerResponseTimeoutMsec()
- }).then(function(response) {
- if (response.data) {
- successCallbackFunction(response);
- } else {
- successCallbackFunction([]);
- }
- })["catch"]
- (UtilityService.runHttpErrorHandler);
- }
+ $http.get(FIELD.ID.AAI_GET_SERVICES, {}, {
+ timeout: PropertyService.getServerResponseTimeoutMsec()
+ }).then(function (response) {
+ var customerList = [];
+ if (response.data != null) {
+ var serviceIdList = [];
+ angular.forEach(response.data, function (value, key) {
+ angular.forEach(value, function (subVal, key) {
+ var newVal = {
+ "id": subVal[FIELD.ID.SERVICE_ID],
+ "description": subVal[FIELD.ID.SERVICE_DESCRIPTION],
+ "isPermitted" : subVal[FIELD.ID.IS_PERMITTED]
+
+ };
+ serviceIdList.push(newVal);
+ });
+ });
+ successCallback(serviceIdList);
+ } else {
+ errorCallback(response);
+ }
+ }, function (response) {
+ errorCallback(response);
+ });
+ },
+
+ getSubscriptionServiceTypeList: function (globalCustomerId,
+ successCallbackFunction) {
+ $log
+ .debug("AaiService:getSubscriptionServiceTypeList: globalCustomerId: "
+ + globalCustomerId);
+ if (UtilityService.hasContents(globalCustomerId)) {
+ $http.get(
+ COMPONENT.AAI_SUB_DETAILS_PATH
+ + globalCustomerId + COMPONENT.ASSIGN + Math.random(),
+ {
+ timeout: PropertyService
+ .getServerResponseTimeoutMsec()
+ }).then(function (response) {
+ if (response.data && response.data[FIELD.ID.SERVICE_SUBSCRIPTIONS]) {
+ var serviceTypes = [];
+ var serviceSubscriptions = response.data[FIELD.ID.SERVICE_SUBSCRIPTIONS][FIELD.ID.SERVICE_SUBSCRIPTION];
+
+ for (var i = 0; i < serviceSubscriptions.length; i++) {
+ serviceTypes.push({
+ "name": serviceSubscriptions[i][FIELD.ID.SERVICETYPE],
+ "isPermitted": serviceSubscriptions[i][FIELD.ID.IS_PERMITTED],
+ "id": i
+ });
+ }
+ successCallbackFunction(serviceTypes);
+ } else {
+ successCallbackFunction([]);
+ }
+ })["catch"]
+ (UtilityService.runHttpErrorHandler);
+ }
+ },
+ getLcpCloudRegionTenantList: function (globalCustomerId, serviceType,
+ successCallbackFunction) {
+ $log
+ .debug("AaiService:getLcpCloudRegionTenantList: globalCustomerId: "
+ + globalCustomerId);
+ var url = COMPONENT.AAI_GET_TENANTS
+ + globalCustomerId + COMPONENT.FORWARD_SLASH + serviceType + COMPONENT.ASSIGN + Math.random();
+
+ $http.get(url,
+ {
+ timeout: PropertyService
+ .getServerResponseTimeoutMsec()
+ }).then(function (response) {
+ var lcpCloudRegionTenants = [];
+ var aaiLcpCloudRegionTenants = response.data;
+
+ lcpCloudRegionTenants.push({
+ "cloudRegionId": "",
+ "tenantName": FIELD.PROMPT.REGION,
+ "tenantId": ""
+ });
+
+ for (var i = 0; i < aaiLcpCloudRegionTenants.length; i++) {
+ lcpCloudRegionTenants.push({
+ "cloudRegionId": aaiLcpCloudRegionTenants[i][COMPONENT.CLOUD_REGION_ID],
+ "tenantName": aaiLcpCloudRegionTenants[i][COMPONENT.TENANT_NAME],
+ "tenantId": aaiLcpCloudRegionTenants[i][COMPONENT.TENANT_ID],
+ "isPermitted": aaiLcpCloudRegionTenants[i][COMPONENT.IS_PERMITTED]
+ });
+ }
+
+ successCallbackFunction(lcpCloudRegionTenants);
+ })["catch"]
+ (UtilityService.runHttpErrorHandler);
+ },
+ getSubscribers: function (successCallbackFunction) {
+ $log
+ .debug("AaiService:getSubscribers");
+ var url = FIELD.ID.AAI_GET_SUBSCRIBERS + COMPONENT.ASSIGN + Math.random();
+
+ $http.get(url,
+ {
+ timeout: PropertyService
+ .getServerResponseTimeoutMsec()
+ }).then(function (response) {
+ if (response.data) {
+ successCallbackFunction(response.data.customer);
+ } else {
+ successCallbackFunction([]);
+ }
+ })["catch"]
+ (UtilityService.runHttpErrorHandler);
+ },
+ getProvOptionsFromSystemProp: function (successCallbackFunction) {
+ $log
+ .debug("AaiService:getProvOptionsFromSystemProp");
+ var url = COMPONENT.GET_SYSTEM_PROP_VNF_PROV_STATUS_PATH;
+
+ $http.get(url,
+ {
+ timeout: PropertyService
+ .getServerResponseTimeoutMsec()
+ }).then(function (response) {
+ if (response.data) {
+ successCallbackFunction(response);
+ } else {
+ successCallbackFunction([]);
+ }
+ })["catch"]
+ (UtilityService.runHttpErrorHandler);
+ },
+ getLoggedInUserID: function (successCallbackFunction) {
+ $log
+ .debug("AaiService:getLoggedInUserID");
+ var url = COMPONENT.GET_USER_ID;
+
+ $http.get(url,
+ {
+ timeout: PropertyService
+ .getServerResponseTimeoutMsec()
+ }).then(function (response) {
+ if (response.data) {
+ successCallbackFunction(response);
+ } else {
+ successCallbackFunction([]);
+ }
+ })["catch"]
+ (UtilityService.runHttpErrorHandler);
+ },
+ getServices: function (successCallbackFunction) {
+ $log
+ .debug("AaiService:getServices");
+ var url = COMPONENT.AAI_GET_SERVICES + COMPONENT.ASSIGN + Math.random();
+
+ $http.get(url,
+ {
+ timeout: PropertyService
+ .getServerResponseTimeoutMsec()
+ }).then(function (response) {
+ if (response.data) {
+ successCallbackFunction(response);
+ } else {
+ successCallbackFunction([]);
+ }
+ })["catch"]
+ (UtilityService.runHttpErrorHandler);
+ },
+
+ getAicZones: function (successCallbackFunction) {
+ $log
+ .debug("getAicZones:getAicZones");
+ var url = COMPONENT.AAI_GET_AIC_ZONES + COMPONENT.ASSIGN + Math.random();
+
+ $http.get(url,
+ {
+ timeout: PropertyService
+ .getServerResponseTimeoutMsec()
+ }).then(function (response) {
+ if (response.data) {
+ successCallbackFunction(response);
+ } else {
+ successCallbackFunction([]);
+ }
+ })["catch"]
+ (UtilityService.runHttpErrorHandler);
+ },
+ getServiceModels: function (globalCustomerId, serviceType, successCallbackFunction) {
+ $log
+ .debug("AaiService:getServices");
+ var url = COMPONENT.AAI_GET_SERVICES + COMPONENT.FORWARD_SLASH + globalCustomerId + COMPONENT.FORWARD_SLASH + serviceType + COMPONENT.ASSIGN + Math.random();
+
+ $http.get(url,
+ {
+ timeout: PropertyService
+ .getServerResponseTimeoutMsec()
+ }).then(function (response) {
+ if (response.data) {
+ successCallbackFunction(response);
+ } else {
+ successCallbackFunction([]);
+ }
+ })["catch"]
+ (UtilityService.runHttpErrorHandler);
+ },
+ getServiceModelsByServiceType: function (namedQueryId, globalCustomerId, serviceType, successCallbackFunction) {
+ $log
+ .debug("AaiService:getServiceModelsByServiceType");
+ var url = COMPONENT.AAI_GET_SERVICES_BY_TYPE + COMPONENT.FORWARD_SLASH + namedQueryId + COMPONENT.FORWARD_SLASH + globalCustomerId + COMPONENT.FORWARD_SLASH + serviceType + COMPONENT.ASSIGN + Math.random();
+
+ $http.get(url,
+ {
+ timeout: PropertyService
+ .getServerResponseTimeoutMsec()
+ }).then(function (response) {
+ if (response.data) {
+ successCallbackFunction(response);
+ } else {
+ successCallbackFunction([]);
+ }
+ })["catch"]
+ (UtilityService.runHttpErrorHandler);
+ }
}
}
-appDS2.factory("AaiService", [ "$http", "$log", "PropertyService",
- "UtilityService", "COMPONENT", "FIELD", AaiService ]);
+appDS2.factory("AaiService", ["$http", "$log", "PropertyService",
+ "UtilityService", "COMPONENT", "FIELD", AaiService]);
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/componentService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/componentService.js index 391c6ba1..ea46dcb9 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/services/componentService.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/componentService.js @@ -30,7 +30,9 @@ var ComponentService = function($log, COMPONENT, UtilityService) { }, {
id : COMPONENT.SERVICE,
displayName : "Service Instance"
- }, {
+ }, {id : COMPONENT.OLDVERSION,
+ displayName : "Previous Version"
+ }, {
id : COMPONENT.VNF,
displayName : "Virtual Network Function"
}, {
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/creationService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/creationService.js index 11e61b3a..9309ce6c 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/services/creationService.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/creationService.js @@ -39,7 +39,7 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON getLoggedInUserID();
switch (_this.componentId) {
case COMPONENT.SERVICE:
- return [ getSubscribers, getServices ];
+ return [ getSubscribers, getServices,getAicZones ];
case COMPONENT.NETWORK:
return [ getLcpCloudRegionTenantList ];
case COMPONENT.VNF:
@@ -121,6 +121,13 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON .getModelInfo(_this.componentId)[FIELD.ID.DESCRIPTION]);
addToList(FIELD.NAME.SERVICE_CATEGORY, DataService
.getModelInfo(_this.componentId)[FIELD.ID.CATEGORY]);
+ if (DataService.getModelInfo(_this.componentId)[FIELD.ID.SERVICE_TYPE] != "null") {
+ addToList(FIELD.NAME.SERVICE_TYPE, DataService
+ .getModelInfo(_this.componentId)[FIELD.ID.SERVICE_TYPE]);
+ addToList(FIELD.NAME.SERVICE_ROLE, DataService
+ .getModelInfo(_this.componentId)[FIELD.ID.SERVICE_ROLE]);
+ }
+
break;
case COMPONENT.VF_MODULE:
addToList(FIELD.NAME.SUBSCRIBER_NAME, DataService
@@ -209,14 +216,18 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON if(!isInTop){
if (isUserProvidedNaming) {
parameterList = [ FIELD.PARAMETER.INSTANCE_NAME ];
-
+
}
parameterList = parameterList.concat([ getSubscribersParameter() ]);
parameterList = parameterList.concat([ getServiceId(),
FIELD.PARAMETER.SERVICE_TYPE,
FIELD.PARAMETER.LCP_REGION,
FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN,
- FIELD.PARAMETER.TENANT_DISABLED ]);
+ FIELD.PARAMETER.TENANT_DISABLED,
+ ]);
+ parameterList = parameterList.concat([ getAICZones() ]);
+
+
}else{
parameterList = parameterList.concat([ getServiceId(),
FIELD.PARAMETER.LCP_REGION,
@@ -263,23 +274,27 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON }
parameterList.push(FIELD.PARAMETER.SUPPRESS_ROLLBACK);
if(_this.componentId === COMPONENT.VF_MODULE ){
- parameterList.push({name: "SDN-C Pre-Load",
- id: "sdncPreload",
+ if(DataService.getSubscriberName() === FIELD.NAME.MOBILITY){
+ parameterList.push({name: FIELD.NAME.SDN_C_PRELOAD,
+ id: FIELD.ID.SDN_C_PRELOAD,
type: "checkbox",
isEnabled: true,
- isRequired: false
+ isRequired: false,
+ hideFieldAndLabel: true
}
);
- parameterList.push({name: "Upload Supplementory Data file",
- id: "uploadSupplementoryDataFile",
+ }
+ parameterList.push({name: FIELD.NAME.UPLOAD_SUPPLEMENTORY_DATA_FILE,
+ id: FIELD.ID.UPLOAD_SUPPLEMENTORY_DATA_FILE,
type: "checkbox",
isEnabled: true,
- isRequired: false
+ isRequired: false,
+ value:false
}
);
- parameterList.push({name: "Supplemetory file (JSON format)",
- id: "supplementoryDataFile",
+ parameterList.push({name: FIELD.NAME.SUPPLEMENTORY_DATA_FILE,
+ id: FIELD.ID.SUPPLEMENTORY_DATA_FILE,
type: "file",
isRequired: false,
isVisiblity: false
@@ -288,16 +303,16 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON }
if( VIDCONFIGURATION.UPLOAD_SUPPLEMENTARY_STATUS_CHECK_ENABLED && _this.componentId === COMPONENT.VOLUME_GROUP){
- parameterList.push({name: "Upload Supplementory Data file",
- id: "uploadSupplementoryDataFile",
+ parameterList.push({name: FIELD.NAME.UPLOAD_SUPPLEMENTORY_DATA_FILE,
+ id: FIELD.ID.UPLOAD_SUPPLEMENTORY_DATA_FILE,
type: "checkbox",
isEnabled: true,
isRequired: false
}
);
- parameterList.push({name: "Supplemetory file (JSON format)",
- id: "supplementoryDataFile",
+ parameterList.push({name: FIELD.NAME.SUPPLEMENTORY_DATA_FILE,
+ id: FIELD.ID.SUPPLEMENTORY_DATA_FILE,
type: "file",
isRequired: false,
isVisiblity: false
@@ -584,7 +599,12 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON break;
case COMPONENT.VF_MODULE:
- break;
+ requestDetails.requestParameters.usePreload = getValueFromList(
+ FIELD.ID.SDN_C_PRELOAD, parameterList);
+ if(_this.componentId == COMPONENT.VF_MODULE &&(requestDetails.requestParameters.usePreload== null || requestDetails.requestParameters.usePreload === '')){
+ requestDetails.requestParameters.usePreload = true;
+ }
+ break;
case COMPONENT.VOLUME_GROUP:
break;
}
@@ -716,12 +736,24 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON break;
case FIELD.ID.SUBSCRIBER_NAME:
break;
+ case FIELD.ID.SDN_C_PRELOAD:
+ break;
+ case FIELD.ID.UPLOAD_SUPPLEMENTORY_DATA_FILE:
+ break;
+ case FIELD.ID.SUPPLEMENTORY_DATA_FILE:
+ arbitraryParameters = FIELD.PARAMETER.SUPPLEMENTORY_DATA_FILE['value'];
+ arbitraryArray=arbitraryParameters;
+ FIELD.PARAMETER.SUPPLEMENTORY_DATA_FILE['value']=[];
+ break;
+
default:
- arbitraryParameters = {
- name : parameter.id,
- value : parameter.value
+ if (parameter.value != '') {
+ arbitraryParameters = {
+ name: parameter.id,
+ value: parameter.value
+ }
+ arbitraryArray.push(arbitraryParameters);
}
- arbitraryArray.push(arbitraryParameters);
}
}
return (arbitraryArray);
@@ -766,15 +798,40 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON var serviceIdList = [];
angular.forEach(response.data, function(value, key) {
angular.forEach(value, function(subVal, key) {
- var newVal = { "id" : subVal[FIELD.ID.SERVICE_ID], "description" : subVal[FIELD.ID.SERVICE_DESCRIPTION] };
+ var newVal = {
+ "id" : subVal[FIELD.ID.SERVICE_ID],
+ "description" : subVal[FIELD.ID.SERVICE_DESCRIPTION],
+ "isPermitted" : subVal[FIELD.ID.IS_PERMITTED],
+ };
serviceIdList.push(newVal);
DataService.setServiceIdList(serviceIdList);
});
});
-
+
UtilityService.startNextAsyncOperation();
});
};
+ var getAicZones = function() {
+ AaiService.getAicZones(function(response) {
+ var serviceIdList = [];
+ angular.forEach(response.data, function(value, key) {
+ angular.forEach(value, function(subVal, key) {
+ var newVal = {
+ "id" : subVal[FIELD.ID.ZONE_ID],
+ "name" : subVal[FIELD.ID.ZONE_NAME],
+ };
+ serviceIdList.push(newVal);
+ DataService.setAicZones(serviceIdList);
+ });
+ });
+
+ UtilityService.startNextAsyncOperation();
+ });
+
+ };
+
+
+
var getLcpCloudRegionTenantList = function() {
AaiService.getLcpCloudRegionTenantList(DataService
.getGlobalCustomerId(), DataService.getServiceType(), function(
@@ -802,7 +859,8 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON for (var i = 0; i < subscribers.length; i++) {
parameter.optionList.push({
id : subscribers[i][FIELD.ID.GLOBAL_CUSTOMER_ID],
- name : subscribers[i][FIELD.ID.SUBNAME]
+ name : subscribers[i][FIELD.ID.SUBNAME],
+ isPermitted : subscribers[i][FIELD.ID.IS_PERMITTED]
})
}
}
@@ -819,7 +877,8 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON for (var i = 0; i < serviceIdList.length; i++) {
parameter.optionList.push({
id : serviceIdList[i].id,
- name : serviceIdList[i].description
+ name : serviceIdList[i].description,
+ isPermitted : serviceIdList[i].isPermitted
});
}
}
@@ -827,6 +886,26 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON return parameter;
};
+ var getAICZones = function() {
+ var aicList = DataService.getAicZones();
+ var parameter = FIELD.PARAMETER.AIC_ZONES;
+ parameter.optionList = new Array();
+ if ( UtilityService.hasContents(aicList) ) {
+ // load them all
+ for (var i = 0; i < aicList.length; i++) {
+ parameter.optionList.push({
+ id : aicList[i].id,
+ name : aicList[i].name,
+ isPermitted : true
+
+ });
+ }
+ }
+
+ return parameter;
+ };
+
+
var getLcpRegion = function() {
var cloudRegionTenantList = DataService.getCloudRegionTenantList();
console.log ( "cloudRegionTenantList=");
@@ -838,14 +917,17 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON for (var i = 0; i < cloudRegionTenantList.length; i++) {
for (var j = 0; j < parameter.optionList.length; j++) {
if (parameter.optionList[j].id === cloudRegionTenantList[i].cloudRegionId) {
- break;
- }
+ parameter.optionList[j].isPermitted =
+ parameter.optionList[j].isPermitted || cloudRegionTenantList[i].isPermitted;
+ break;
+ }
}
if (j < parameter.optionList.length) {
continue;
}
parameter.optionList.push({
- id : cloudRegionTenantList[i].cloudRegionId
+ id : cloudRegionTenantList[i].cloudRegionId,
+ isPermitted : cloudRegionTenantList[i].isPermitted
});
}
}
@@ -862,8 +944,10 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON if (cloudRegionTenantList[i].cloudRegionId === cloudRegionId) {
parameter.optionList.push({
id : cloudRegionTenantList[i].tenantId,
- name : cloudRegionTenantList[i].tenantName
- });
+ name : cloudRegionTenantList[i].tenantName,
+ isPermitted : cloudRegionTenantList[i].isPermitted
+
+ });
}
}
}
@@ -878,7 +962,8 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON }
for (var i = 0; i < optionSimpleArray.length; i++) {
optionList.push({
- name : optionSimpleArray[i]
+ name : optionSimpleArray[i],
+ isPermitted :true,
});
}
parameter.optionList = optionList;
@@ -918,6 +1003,7 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON .updateList([ FIELD.PARAMETER.UPLOAD_SUPPLEMENTORY_DATA_FILE_CHECKED ]);
}else{
$('input[parameter-id="'+FIELD.ID.SUPPLEMENTORY_DATA_FILE+'"]').closest('tr').hide();
+ FIELD.PARAMETER.UPLOAD_SUPPLEMENTORY_DATA_FILE_CHECKED.value=false;
parameterListControl
.updateList([ FIELD.PARAMETER.UPLOAD_SUPPLEMENTORY_DATA_FILE_UNCHECKED ]);
}
@@ -959,9 +1045,11 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON for (var i = 0; i < response.length; i++) {
serviceTypeParameters.optionList.push({
- "id" : response[i],
- "name" : response[i]
- });
+ "id" : response[i].name,
+ "name" : response[i].name,
+ "isPermitted" :response[i].isPermitted
+
+ });
}
console.log ( "updateUserParameterList: service type parameters " );
console.log ( JSON.stringify (serviceTypeParameters, null, 4));
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/dataService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/dataService.js index bb5adad3..2d7fa6ca 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/services/dataService.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/dataService.js @@ -94,6 +94,12 @@ var DataService = function($log, DataService) { setServiceIdList : function(serviceIdList) {
_this.serviceIdList = serviceIdList;
},
+ setAicZones : function(aicZones) {
+ _this.aicZones = aicZones;
+ },
+ getAicZones : function(){
+ return _this.aicZones;
+ },
getServiceInstanceId : function() {
return _this.serviceInstanceId;
},
@@ -249,6 +255,15 @@ var DataService = function($log, DataService) { }
return _this.aLaCarte;
},
+ setMacro : function(aval) {
+ _this.macro = aval;
+ },
+ getMacro : function() {
+ if (_this.macro === undefined) {
+ return false;
+ }
+ return _this.macro;
+ },
getResources : function() {
return _this.resources;
},
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/deletionService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/deletionService.js index 62c2b19c..79282997 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/services/deletionService.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/deletionService.js @@ -380,15 +380,19 @@ var DeletionService = function($log, AaiService, AsdcService, DataService, for (var i = 0; i < cloudRegionTenantList.length; i++) {
for (var j = 0; j < parameter.optionList.length; j++) {
if (parameter.optionList[j].id === cloudRegionTenantList[i].cloudRegionId) {
- break;
+ parameter.optionList[j].isPermitted =
+ parameter.optionList[j].isPermitted || cloudRegionTenantList[i].isPermitted;
+ break;
}
}
if (j < parameter.optionList.length) {
continue;
}
parameter.optionList.push({
- id : cloudRegionTenantList[i].cloudRegionId
- });
+ id : cloudRegionTenantList[i].cloudRegionId,
+ isPermitted : cloudRegionTenantList[i].isPermitted
+
+ });
}
}
return parameter;
@@ -404,8 +408,9 @@ var DeletionService = function($log, AaiService, AsdcService, DataService, if (cloudRegionTenantList[i].cloudRegionId === cloudRegionId) {
parameter.optionList.push({
id : cloudRegionTenantList[i].tenantId,
- name : cloudRegionTenantList[i].tenantName
- });
+ name : cloudRegionTenantList[i].tenantName,
+ isPermitted : cloudRegionTenantList[i].isPermitted
+ });
}
}
}
@@ -465,8 +470,8 @@ var DeletionService = function($log, AaiService, AsdcService, DataService, for (var i = 0; i < response.length; i++) {
serviceTypeParameters.optionList.push({
- "id" : response[i],
- "name" : response[i]
+ "id" : response[i].name,
+ "name" : response[i].name
});
}
parameterListControl.updateList([ serviceTypeParameters ]);
@@ -493,7 +498,8 @@ var DeletionService = function($log, AaiService, AsdcService, DataService, },
updateUserParameterList : updateUserParameterList,
getMsoRequestDetails : getMsoRequestDetails,
- getMsoUrl : getMsoUrl
+ getMsoUrl : getMsoUrl,
+ isMacro : DataService.getMacro()
}
}
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/vnfService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/vnfService.js index 836279b9..3fc04ba0 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/services/vnfService.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/vnfService.js @@ -41,21 +41,42 @@ var VnfService = function($http, $log, VIDCONFIGURATION, FIELD, UtilityService) if ( ( UtilityService.hasContents ( vnfInstance.object[FIELD.ID.ORCHESTRATION_STATUS] ) ) &&
( UtilityService.hasContents ( vnfInstance.object[FIELD.ID.IN_MAINT] ) ) &&
( UtilityService.hasContents ( vnfInstance.object[FIELD.ID.PROV_STATUS] ) ) ) {
-
+
status.provStatus = vnfInstance.object[FIELD.ID.PROV_STATUS].toLowerCase();
+ console.log ("PROVSTATUS: " + vnfInstance.object[FIELD.ID.PROV_STATUS].toLowerCase());
+
status.orchestrationStatus = vnfInstance.object[FIELD.ID.ORCHESTRATION_STATUS].toLowerCase();
+ console.log ("ORCHESTRATION STATUS: " + vnfInstance.object[FIELD.ID.ORCHESTRATION_STATUS].toLowerCase());
+
status.inMaint = vnfInstance.object[FIELD.ID.IN_MAINT];
-
+ console.log ("IN MAINT: " + vnfInstance.object[FIELD.ID.IN_MAINT]);
+
if ( UtilityService.hasContents(vnfInstance.object[FIELD.ID.OPERATIONAL_STATUS]) ) {
status.operationalStatus = vnfInstance.object[FIELD.ID.OPERATIONAL_STATUS].toLowerCase();
}
-
- if ( UtilityService.arrayContains ( VIDCONFIGURATION.VNF_VALID_STATUS_LIST, status ) ) {
- return ("");
- }
- else {
- return (errorInvalidCombinationMsg);
- }
+ var i = VIDCONFIGURATION.VNF_VALID_STATUS_LIST.length;
+ if ( i > 0 ) {
+ while (i--) {
+ var item = VIDCONFIGURATION.VNF_VALID_STATUS_LIST[i];
+ if ( (item.provStatus === status.provStatus) && (item.inMaint === status.inMaint )
+ && (item.orchestrationStatus === status.orchestrationStatus) ) {
+ if (UtilityService.hasContents(vnfInstance.object[FIELD.ID.OPERATIONAL_STATUS])) {
+ if (status.operationalStatus === "") { status.operationalStatus = null }
+ if ( item.operationalStatus === status.operationalStatus ) {
+ return ("");
+ }
+ }
+ else {
+ // no contents
+ if ( item.operationalStatus === null ) {
+ return ("");
+ }
+ }
+ }
+ }
+ }
+
+ return (errorInvalidCombinationMsg);
}
else {
return (errorAaiStatusMsg);
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiGetSubs.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiGetSubs.htm index d22e3d91..c5c5ccaa 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiGetSubs.htm +++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiGetSubs.htm @@ -18,66 +18,85 @@ ============LICENSE_END=========================================================
-->
-<link rel="stylesheet" type="text/css" href="app/vid/styles/aaiGetSubs.css" />
-<link rel="stylesheet" type="text/css" href="app/vid/styles/aaiSubDetails.css" />
+<link rel="stylesheet" type="text/css" href="app/vid/styles/aaiGetSubs.css"/>
+<link rel="stylesheet" type="text/css" href="app/vid/styles/aaiSubDetails.css"/>
<script src="app/vid/scripts/controller/aaiSubscriberController.js"></script>
<div ng-controller="aaiSubscriberController" ng-cloak>
- <div>
- <div class="statusLine" ng-class="{true:'aaiVisible', false:'aaiHidden'}[isSpinnerVisible]">
- <img src="app/vid/images/spinner.gif"></img>
- <label>Status:</label><span class="status">{{status}}</span>
- </div>
+ <div>
+ <div class="statusLine" ng-class="{true:'aaiVisible', false:'aaiHidden'}[isSpinnerVisible]">
+ <img src="app/vid/images/spinner.gif"></img>
+ <label>Status:</label><span class="status">{{status}}</span>
+ </div>
- <div ng-if="errorMsg != null"><font color='red'>{{errorMsg}}<pre>{{errorDetails | json}}</pre></font></div>
-
- <h2 class="heading2"><center>Search Existing Service Instances</center></h2>
- <br>
- Please search by the Subscriber name or enter Service Instance Id or Service Instance Name below: <br><br>
-
- <table>
- <tr>
- <td style="width:30%">
- <div class="fn-ebz-container">
- <label class="fn-ebz-text-label">Subscriber Name:</label>
- </div>
- </td>
- <td style="width:30%" nowrap>
- <div class="fn-ebz-container" ng-init="autoGetSubs();">
- <select ng-model="selectedCustomer" ng-options="item.globalCustomerId as item.subscriberName for item in customerList | orderBy:'subscriberName'">
- <option value="">Select a subscriber</option></select>
- <a class="btn btn-primary" ng-click="refreshSubs();" ><span class="glyphicon glyphicon-refresh"></span></a>
- </div>
- </td>
-
- </tr>
- <tr>
- <td style="width:30%">
- <div class="fn-ebz-container">
- <select style="width: 250px;" ng-model="selectedserviceinstancetype" ng-options="stype.sinstance as stype.sinstance for stype in serviceInstanceses" >
- <option value="">Select a Service Instance</option>
- </select>
- </div>
- </td>
- <td style="width:60%">
- <div class="fn-ebz-container">
- <input type="text" style="width: 350px;" name="selectedServiceInstance" ng-model="selectedServiceInstance" restrict-input ="{type : selectedserviceinstancetype}" />
- </div>
- </td>
-
- </tr>
- <tr>
- <td>
- <td style="width:30%">
- <div>
- <button type="submit" class="btn btn-primary" size="small" ng-click="getSubscriberDet(selectedCustomer,selectedserviceinstancetype,selectedServiceInstance);">Submit</button></a>
- </div>
- </td>
- </td>
- </tr>
- </table>
-
-
- </div>
+ <div ng-if="errorMsg != null"><font color='red'>{{errorMsg}}
+ <pre>{{errorDetails | json}}</pre>
+ </font></div>
+
+ <h2 class="heading2">
+ <center>Search Existing Service Instances</center>
+ </h2>
+ <br>
+ Please search by the Subscriber name or enter Service Instance Id or Service Instance Name below: <br><br>
+
+ <table>
+ <tr>
+ <td style="width:30%">
+ <div class="fn-ebz-container">
+ <label class="fn-ebz-text-label">Subscriber Name:</label>
+ </div>
+ </td>
+ <td style="width:30%" nowrap>
+ <div class="fn-ebz-container" ng-init="autoGetSubs();">
+ <!--<select name="selectedCustomer" ng-model="selectedCustomer">-->
+ <!--<option ng-repeat="item in customerList" value="{{item.globalCustomerId}}" ng-disabled="getPermitted(item)">{{item.subscriberName}}</option>-->
+ <!--</select>-->
+ <select ng-model="selectedCustomer"
+ ng-options="item.globalCustomerId as item.subscriberName for item in customerList | orderBy:'subscriberName'">
+ <option value="">Select a subscriber</option>
+ </select>
+
+ <a class="btn btn-primary" ng-click="refreshSubs();"><span
+ class="glyphicon glyphicon-refresh"></span></a>
+ </div>
+ </td>
+
+ </tr>
+ <tr>
+ <td style="width:30%">
+ <div class="fn-ebz-container">
+ <select style="width: 250px;" ng-model="selectedserviceinstancetype"
+ ng-options="stype.sinstance as stype.sinstance for stype in serviceInstanceses">
+ <option value="">Select a Service Instance</option>
+ </select>
+ </div>
+ </td>
+ <td style="width:60%">
+ <div class="fn-ebz-container">
+ <input type="text" style="width: 350px;" name="selectedServiceInstance"
+ ng-model="selectedServiceInstance"
+ data-tests-id="searchForExistingInstancesText"
+ restrict-input="{type : selectedserviceinstancetype}"/>
+ </div>
+ </td>
+
+ </tr>
+ <tr>
+ <td>
+ <td style="width:30%">
+ <div>
+ <button type="submit" class="btn btn-primary" size="small"
+ ng-click="getSubscriberDet(selectedCustomer,selectedserviceinstancetype,selectedServiceInstance);">
+ Submit
+ </button>
+ </a>
+ </div>
+ </td>
+ </td>
+ </tr>
+ </table>
+
+
+ </div>
</div>
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiGetSubscriberList.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiGetSubscriberList.htm index 6a911be1..16357dde 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiGetSubscriberList.htm +++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiGetSubscriberList.htm @@ -42,8 +42,10 @@ </td>
<td style="width:80%" nowrap>
<div class="fn-ebz-container" ng-init="autoGetSubs();">
- <select ng-model="selectedCustomer" ng-options="item.globalCustomerId as item.subscriberName for item in customerList | orderBy:'subscriberName'">
- <option value="">Select Subscriber Name</option></select>
+ <select ng-model="selectedCustomer" data-tests-id="subscriberName">
+ <option value="">Select Subscriber Name</option>
+ <option ng-repeat="item in customerList | orderBy:'subscriberName'" ng-value="item.globalCustomerId" ng-disabled="!item.isPermitted" class="subscriberNameOption">{{item.subscriberName}}</option>
+ </select>
<a class="btn btn-primary" ng-click="refreshSubs();" ><span class="glyphicon glyphicon-refresh"></span></a>
</div>
</td>
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiServiceTypes.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiServiceTypes.htm index 6711bfaf..06a53c3e 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiServiceTypes.htm +++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiServiceTypes.htm @@ -41,7 +41,7 @@ </td>
<td style="width:80%" nowrap>
<div class="fn-ebz-container">
- <textarea style=" height: 15px width: 100% border: none resize: none overflow: hidden background-color: #ddd outline: none" ng-model="createSubscriberName">{{createSubscriberName}}</textarea>
+ <textarea style="height: 33px; width: 100%; border: none; resize: none; overflow: hidden; background-color: #ddd; outline: none;" ng-model="createSubscriberName" data-tests-id="selectedSubscriberName">{{createSubscriberName}}</textarea>
</div>
</td>
@@ -55,8 +55,10 @@ </td>
<td style="width:80%" nowrap>
<div class="fn-ebz-container" ng-init="getServiceTypesList()">
- <select ng-model="selectedServicetype" ng-options="key as value for (key , value) in serviceTypeList">
- <option value="">Select Service Type</option></select>
+ <select ng-model="selectedServicetype" data-tests-id="serviceType">
+ <option value="">Select Service Type</option>
+ <option ng-repeat="serviceType in serviceTypeList" class="serviceTypeOption" ng-value="serviceType.id" ng-disabled="!serviceType.isPermitted">{{serviceType.name}}</option>
+ </select>
<a class="btn btn-primary" ng-click="refreshServiceTypes(subId);" ><span class="glyphicon glyphicon-refresh"></span></a>
</div>
</td>
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiSubDetails.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiSubDetails.htm index 2426f152..3471fcb9 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiSubDetails.htm +++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiSubDetails.htm @@ -54,15 +54,14 @@ <tr>
<td att-table-body>
<div>
- <a alt="View/Edit" ng-click="getAsdcModel(disData);"> View/Edit </a>
+ <a alt="View/Edit" ng-click="getAsdcModel(disData);" data-tests-id="{{'view/edit-test-data-id-' + disData['serviceInstanceId']}}" ng-bind="disData.isPermitted ? 'View/Edit' : 'View'"></a>
</div>
- </td>
- <!-- <td att-table-body ><button type=button ng-click="getAsdcModel(disData);" att-button btn-type="primary" size="small">View/Edit</button></td> --->
+ </td>
<td att-table-body ng-bind="disData['globalCustomerId']"></td>
<td att-table-body ng-bind="disData['subscriberName']"></td>
<td att-table-body ng-bind="disData['serviceType']"></td>
<td att-table-body ng-bind="disData['serviceInstanceName']"></td>
- <td att-table-body ng-bind="disData['serviceInstanceId']"></td>
+ <td att-table-body data-tests-id="{{'instance-id-for-name-' + disData['serviceInstanceName']}}" ng-bind="disData['serviceInstanceId']"></td>
</tr>
</tbody>
</table>
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiSubViewEdit.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiSubViewEdit.htm index a7ea8336..40bd1488 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiSubViewEdit.htm +++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiSubViewEdit.htm @@ -20,128 +20,144 @@ <div ng-controller="aaiSubscriberController" ng-cloak>
- <div popup-window class="popupContents" ngx-show="{{popup.isVisible}}"
- ng-cloak>
- <div ng-include="'app/vid/scripts/view-models/creationDialog.htm'"></div>
- <div ng-include="'app/vid/scripts/view-models/deletionDialog.htm'"></div>
- <div ng-include="'app/vid/scripts/view-models/detailsDialog.htm'"></div>
- </div>
-
- <div>
- <div class="statusLine">
- <img src="app/vid/images/spinner.gif"
- ng-class="{true:'aaiVisible', false:'aaiHidden'}[isSpinnerVisible]"></img>
- <label>Status:</label><span class="status">{{status}}</span>
- </div>
-
- <h2 class="heading2">
- <center>VIEW/EDIT SERVICE INSTANCE <a class="btn btn-primary btn-xs pull-right" ng-click="reloadRoute();" ><span class="glyphicon glyphicon-refresh"></span></a></center>
- </h2>
- </center>
- </h2>
- <br>
-
-
- <center>
- <table border="1">
- <tr>
- <th style="text-align: center" width="33%">SUBSCRIBER:
- {{globalCustomerId}}</th>
- <th style="text-align: center" width="34%">SERVICE TYPE:
- {{serviceType}}</th>
- <th style="text-align: center" width="33%">SERVICE INSTANCE
- ID: {{serviceInstanceId}}</th>
- <tr>
- <tr>
- <td colspan='3' style="text-align: center">Service Instance
- Name: {{serviceInstanceName || "Not defined"}}
- </td>
- <tr>
- </table>
-
- </center>
-
-
- <br>
-
- <div ng-init="autoPopulateViewEdit();">
- <script type="text/ng-template" id="nodes_renderer.html">
- <div ui-tree-handle data-drag-enabled="false" class="tree-node tree-node-content">
- <a class="btn btn-success btn-xs" ng-if="node.nodes && node.nodes.length > 0" data-nodrag ng-click="toggle(this)"><span
- class="glyphicon"
- ng-class="{
+ <div popup-window class="popupContents" ngx-show="{{popup.isVisible}}"
+ ng-cloak>
+ <div ng-include="'app/vid/scripts/view-models/creationDialog.htm'"></div>
+ <div ng-include="'app/vid/scripts/view-models/deletionDialog.htm'"></div>
+ <div ng-include="'app/vid/scripts/view-models/detailsDialog.htm'"></div>
+ </div>
+
+ <div>
+ <div class="statusLine">
+ <img src="app/vid/images/spinner.gif"
+ ng-class="{true:'aaiVisible', false:'aaiHidden'}[isSpinnerVisible]"></img>
+ <label>Status:</label><span class="status">{{status}}</span>
+ </div>
+
+ <h2 class="heading2">
+ <center>VIEW/EDIT SERVICE INSTANCE <a class="btn btn-primary btn-xs pull-right"
+ ng-click="reloadRoute();"><span
+ class="glyphicon glyphicon-refresh"></span></a></center>
+ </h2>
+ </center>
+ </h2>
+ <br>
+
+
+ <center>
+ <table border="1">
+ <tr>
+ <th style="text-align: center" width="33%">SUBSCRIBER:
+ {{globalCustomerId}}
+ </th>
+ <th style="text-align: center" width="34%">SERVICE TYPE:
+ {{serviceType}}
+ </th>
+ <th style="text-align: center" width="33%">SERVICE INSTANCE
+ ID: {{serviceInstanceId}}
+ </th>
+ <tr>
+ <tr>
+ <td colspan='3' style="text-align: center">Service Instance
+ Name: {{serviceInstanceName || "Not defined"}}
+ </td>
+ <tr>
+ </table>
+
+ </center>
+
+
+ <br>
+
+ <div ng-init="autoPopulateViewEdit();">
+ <script type="text/ng-template" id="nodes_renderer.html">
+ <div ui-tree-handle data-drag-enabled="false" class="tree-node tree-node-content">
+ <a class="btn btn-success btn-xs" ng-if="node.nodes && node.nodes.length > 0" data-nodrag
+ ng-click="toggle(this)"><span
+ class="glyphicon"
+ ng-class="{
'glyphicon-chevron-right': collapsed,
'glyphicon-chevron-down': !collapsed
}"></span></a>
- <div class='btn'>{{node.nodeType}}</div><div class='btn'>{{node.nodeId}}</div><div class='btn'>{{node.nodeStatus}}</div>
-
- <a class="pull-right btn btn-danger btn-xs" ng-if="node.delete != false" data-nodrag ng-click="showVnfDetails(node);"><span class="glyphicon glyphicon-remove"></a>
- <a class="pull-right btn btn-primary btn-xs" ng-if="node.info != false" data-nodrag ng-click="showVnfDetails();"><span
- class="glyphicon glyphicon-zoom-in"></span></a>
-
- </div>
- <ol ui-tree-nodes ng-model="node.nodes" ng-class="{hidden: collapsed}">
- <li ng-repeat="node in node.nodes" ui-tree-node ng-include="'nodes_renderer.html'">
- </li>
- </ol>
-</script>
- <b>EXISTING</b>
- <div ng-controller="TreeCtrl">
- <div>
- <div ui-tree id="tree-root" >
- <ol ui-tree-nodes ng-model="treeList"">
- <li ng-repeat="node in treeList" ui-tree-node data-nodrag
- ng-include="'nodes_renderer.html'"></li>
- </ol>
- </div>
- </div>
-
- </div>
- <b>AVAILABLE</b>
-
- <script type="text/ng-template" id="nodes_renderer2.html">
- <div ui-tree-handle data-drag-enabled="false" class="tree-node tree-node-content" >
- <a class="btn btn-success btn-xs" ng-if="node.nodes && node.nodes.length > 0" data-nodrag ng-click="toggle(this)"><span
- class="glyphicon"
- ng-class="{
+ <div class='btn'>{{node.nodeType}}</div>
+ <div class='btn'>{{node.nodeId}}</div>
+ <div class='btn'>{{node.nodeStatus}}</div>
+
+ <a class="pull-right btn btn-danger btn-xs" ng-if="node.delete != false" data-nodrag
+ ng-click="showVnfDetails(node);"><span class="glyphicon glyphicon-remove"></a>
+ <a class="pull-right btn btn-primary btn-xs" ng-if="node.info != false" data-nodrag
+ ng-click="showVnfDetails();"><span
+ class="glyphicon glyphicon-zoom-in"></span></a>
+
+ </div>
+ <ol ui-tree-nodes ng-model="node.nodes" ng-class="{hidden: collapsed}">
+ <li ng-repeat="node in node.nodes" ui-tree-node ng-include="'nodes_renderer.html'">
+ </li>
+ </ol>
+ </script>
+ <b>EXISTING</b>
+ <div ng-controller="TreeCtrl">
+ <div>
+ <div ui-tree id="tree-root">
+ <ol ui-tree-nodes ng-model="treeList">
+ <li ng-repeat="node in treeList" ui-tree-node data-nodrag
+ ng-include="'nodes_renderer.html'"></li>
+ </ol>
+ </div>
+ </div>
+
+ </div>
+ <b>AVAILABLE</b>
+
+ <script type="text/ng-template" id="nodes_renderer2.html">
+ <div ui-tree-handle data-drag-enabled="false" class="tree-node tree-node-content">
+ <a class="btn btn-success btn-xs" ng-if="node.nodes && node.nodes.length > 0" data-nodrag
+ ng-click="toggle(this)"><span
+ class="glyphicon"
+ ng-class="{
'glyphicon-chevron-right': collapsed,
'glyphicon-chevron-down': !collapsed
}"></span></a>
- <div class='btn'>{{node.nodeType}}</div><div class='btn'>{{node.nodeId}}</div><div class='btn'>{{node.nodeStatus}}</div>
-
- <a class="pull-right btn btn-primary btn-xs" ng-if="node.delete != false" data-nodrag ng-click="callDelete(this)">
- <span class="glyphicon glyphicon-plus"></span>
- </a>
-
- <a class="pull-right btn btn-primary btn-xs" ng-if="node.info != false" data-nodrag ng-click="showInfoDialog(node.itemType, node.nodeId, node.nodeType);">
- <span class="glyphicon glyphicon-zoom-in"></span>
- </a>
-
- </div>
- <ol ui-tree-nodes ng-model="node.nodes" ng-class="{hidden: collapsed}">
- <li ng-repeat="node in node.nodes" ui-tree-node ng-include="'nodes_renderer2.html'">
- </li>
- </ol>
-</script>
-
- <div ng-controller="TreeCtrl">
- <div>
- <div ui-tree id="tree-root">
- <ol ui-tree-nodes ng-model="availableTreeList">
- <li ng-repeat="node in availableTreeList" ui-tree-node
- data-nodrag ng-include="'nodes_renderer2.html'"></li>
- </ol>
- </div>
- </div>
- </div>
- </div>
- <div>
-
- <button type="button" " att-button
- btn-type="primary" size="small">Show Details</button>
-
- <pre>
+ <div class='btn'>{{node.nodeType}}</div>
+ <div class='btn'>{{node.nodeId}}</div>
+ <div class='btn'>{{node.nodeStatus}}</div>
+
+ <a class="pull-right btn btn-primary btn-xs" ng-if="node.delete != false" data-nodrag
+ ng-click="callDelete(this)">
+ <span class="glyphicon glyphicon-plus"></span>
+ </a>
+
+ <a class="pull-right btn btn-primary btn-xs" ng-if="node.info != false" data-nodrag
+ ng-click="showInfoDialog(node.itemType, node.nodeId, node.nodeType);">
+ <span class="glyphicon glyphicon-zoom-in"></span>
+ </a>
+
+ </div>
+ <ol ui-tree-nodes ng-model="node.nodes" ng-class="{hidden: collapsed}">
+ <li ng-repeat="node in node.nodes" ui-tree-node ng-include="'nodes_renderer2.html'">
+ </li>
+ </ol>
+ </script>
+
+ <div ng-controller="TreeCtrl">
+ <div>
+ <div ui-tree id="tree-root">
+ <ol ui-tree-nodes ng-model="availableTreeList">
+ <li ng-repeat="node in availableTreeList" ui-tree-node
+ data-nodrag ng-include="'nodes_renderer2.html'"></li>
+ </ol>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div>
+
+ <button type="button"
+ " att-button
+ btn-type="primary" size="small">Show Details</button>
+
+ <pre>
{{inventoryResponseItem | json}}
</pre>
- </div>
- </div>
+ </div>
+ </div>
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/createInstanceServiceModels.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/createInstanceServiceModels.htm index 4d02ae80..0f694612 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/createInstanceServiceModels.htm +++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/createInstanceServiceModels.htm @@ -19,6 +19,9 @@ -->
<link rel="stylesheet" type="text/css" href="app/vid/styles/serviceModels.css" />
+<div popup-window class="popupContents" ngx-show="{{popup.isTablePopUpVisible}}" ng-cloak>
+ <div ng-include="'app/vid/scripts/view-models/previousVersion.htm'"/>
+</div>
<div popup-window class="popupContents" ngx-show="{{popup.isVisible}}" ng-cloak>
<div ng-include="'app/vid/scripts/view-models/creationDialog.htm'"/>
</div>
@@ -37,13 +40,13 @@ <tr>
<td >
- <div class="fn-ebz-container">
+ <div class="fn-ebz-container">
<label class="fn-ebz-text-label" >Subscriber Name :</label>
</div>
</td>
<td style="width:80%" nowrap>
<div class="fn-ebz-container">
- <textarea style=" height: 15px width: 100% border: none resize: none overflow: hidden background-color: #ddd outline: none" ng-model="createSubscriberName">{{createSubscriberName}}</textarea>
+ <textarea style="height: 33px; width: 100%; border: none; resize: none; overflow: hidden; background-color: #ddd; outline: none;" ng-model="createSubscriberName" data-tests-id="selectedSubscriberName">{{createSubscriberName}}</textarea>
</div>
</td>
@@ -57,7 +60,7 @@ </td>
<td style="width:80%" nowrap>
<div class="fn-ebz-container">
- <textarea style=" height: 15px width: 100% border: none resize: none overflow: hidden background-color: #ddd outline: none" ng-model="serviceTypeName">{{serviceTypeName}}</textarea>
+ <textarea style="height: 33px; width: 100%; border: none; resize: none; overflow: hidden; background-color: #ddd; outline: none;" ng-model="serviceTypeName" data-tests-id="selectedServiceTypeName">{{serviceTypeName}}</textarea>
</div>
</td>
@@ -68,7 +71,7 @@ <div class="fn-ebz-container">
Filter:
- <input class="fn-ebz-text" type="text" ng-model="searchString" size="20" style="width: 250px;">
+ <input class="fn-ebz-text" type="text" data-tests-id="browseFilter" ng-model="searchString" size="20" style="width: 250px;">
</div>
<!-- <h1 class="heading1" style="margin-top:20px;">Browse SDC Service Models</h1> -->
@@ -89,14 +92,19 @@ </thead>
<tbody att-table-row type="body" row-repeat="service in services">
<tr>
- <td att-table-body ><button type=button ng-click="deployService(service,true)" att-button btn-type="primary" size="small">Deploy</button></td>
+ <td att-table-body ><button type=button ng-click="deployService(service,true)" data-tests-id="deploy-{{service['extra-properties']['extra-property'][1]['property-value']}}" att-button btn-type="primary" size="small">Deploy</button></td>
<td att-table-body ng-bind="service['extra-properties']['extra-property'][2]['property-value']"></td>
<td att-table-body ng-bind="service['extra-properties']['extra-property'][0]['property-value']"></td>
<td att-table-body ng-bind="service['extra-properties']['extra-property'][3]['property-value']"></td>
<td att-table-body ng-bind="service['extra-properties']['extra-property'][1]['property-value']"></td>
<td att-table-body ng-bind="service['extra-properties']['extra-property'][4]['property-value']"></td>
<td att-table-body ng-bind="service['extra-properties']['extra-property'][6]['property-value']"></td>
- <td att-table-body ><button type=button ng-click="deploService(service)" att-button btn-type="primary" size="small">Previous Versions</button></td>
+ <td att-table-body ng-show="service['extra-properties']['extra-property'][6]['property-value'] > '1.0' ">
+ <button type=button ng-click="loadPreviousVersionData(service['extra-properties']['extra-property'][6]['property-value'],service['extra-properties']['extra-property'][4]['property-value'])" att-button btn-type="primary" size="small">
+ Previous Versions
+ </button>
+ </td>
+ <td att-table-body ng-show="service['extra-properties']['extra-property'][6]['property-value'] <= '1.0' "> </td>
</tr>
</tbody>
</table>
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/creationDialog.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/creationDialog.htm index ff79d707..4449285d 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/creationDialog.htm +++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/creationDialog.htm @@ -31,7 +31,7 @@ </div>
<div class="buttonRow">
- <button ngx-enabled="{{isConfirmEnabled}}" att-button size="small"
+ <button data-tests-id="confirmButton" ngx-enabled="{{isConfirmEnabled}}" att-button size="small"
ng-click="confirm();">Confirm</button>
<button type="button" ng-click="cancel();" att-button
btn-type="primary" size="small">Cancel</button>
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/instantiate.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/instantiate.htm index e4bb67ff..27622ff6 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/instantiate.htm +++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/instantiate.htm @@ -20,24 +20,24 @@ <div ng-controller="InstantiationController">
- <div popup-window class="popupContents" ngx-show="{{popup.isVisible}}"
- ng-cloak>
+ <div popup-window class="popupContents" ngx-show="{{popup.isVisible}}"
+ ng-cloak>
<div ng-include="'app/vid/scripts/view-models/creationDialog.htm'"></div>
<div ng-include="'app/vid/scripts/view-models/deletionDialog.htm'"></div>
<div ng-include="'app/vid/scripts/view-models/detailsDialog.htm'"></div>
<div ng-include="'app/vid/scripts/view-models/statusDialog.htm'"></div>
- </div>
+ </div>
<div ng-controller="aaiSubscriberController" ng-init="getComponentList() ">
- <div class="statusLine" ng-class="{true:'aaiVisible', false:'aaiHidden'}[isSpinnerVisible]">
+ <div class="statusLine" ng-class="{true:'aaiVisible', false:'aaiHidden'}[isSpinnerVisible]">
<img src="app/vid/images/spinner.gif"></img>
<label>Status:</label><span class="status">{{status}}</span>
- </div>
-
- <div ng-if="errorMsg != null"><font color='red'>{{errorMsg}}<pre>{{errorDetails | json}}</pre></font></div>
-
- <h1 class="heading1" style="margin-top: 20px;">View/Edit Service Instance</h1>
- <a class="btn btn-primary btn-xs pull-right" ng-click="reloadRoute();" ><span class="glyphicon glyphicon-refresh"></span></a>
-
+ </div>
+
+ <div ng-if="errorMsg != null"><font color='red'>{{errorMsg}}<pre>{{errorDetails | json}}</pre></font></div>
+
+ <h1 class="heading1" style="margin-top: 20px;">{{isPermitted == "true" ? "View/Edit" : "View"}} Service Instance</h1>
+ <a class="btn btn-primary btn-xs pull-right" ng-click="reloadRoute();" ><span class="glyphicon glyphicon-refresh"></span></a>
+
<br>
<center>
@@ -58,191 +58,191 @@ </table>
</center>
-
- <div ui-tree data-drag-enabled="false" data-nodrop-enabled="true" style="margin: 30px">
-
- <ol ui-tree-nodes="" ng-model="service" >
- <li ng-repeat="aService in [service]" ui-tree-node>
- <div ui-tree-handle class="tree-node tree-node-content">
- <a class="btn btn-success btn-xs" ng-if="(aService.instance.vnfs && aService.instance.vnfs.length > 0) || (aService.instance.networks && aService.instance.networks.length > 0)" data-nodrag ng-click="this.toggle()">
- <span class="glyphicon" ng-class="{'glyphicon-chevron-right': collapsed,'glyphicon-chevron-down': !collapsed}"></span>
- </a>
- SERVICE INSTANCE: {{aService.instance.name}}
- <a ng-if="((isMacro()) || ( ( isObjectEmpty(aService.instance.vnfs) && isObjectEmpty(aService.instance.networks) ) ))" class="pull-right btn btn-danger btn-xs" data-nodrag ng-click="deleteService(aService.instance);">
- <span class="glyphicon glyphicon-remove"></span>
- </a>
- <div class="pull-right btn-group" ng-if="aService.convertedModel.vnfs && (!(isObjectEmpty(aService.convertedModel.vnfs))) && (!(aService.convertedModel.isNewFlow))">
- <button type="button" class="btn btn-success btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
- Add VNF<span class="caret"></span>
- </button>
- <ul class="dropdown-menu" ng-model="aService.convertedModel.vnfs">
- <a role="menuitem" ng-repeat="(vnfUuid, vnf) in aService.convertedModel.vnfs" ng-click="addVnfInstance(vnf, aService.instance.vnfs)">{{vnf.modelCustomizationName}}</a>
-
- </ul>
- </div>
- <div class="pull-right btn-group" ng-if="aService.convertedModel.vnfs && (!(isObjectEmpty(aService.convertedModel.vnfs))) && (aService.convertedModel.isNewFlow)">
- <button type="button" class="btn btn-success btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
- Add VNF<span class="caret"></span>
- </button>
- <ul class="dropdown-menu" ng-model="aService.convertedModel.vnfs">
- <li role="menuitem" ng-repeat="(vnfUuid, vnf) in aService.convertedModel.vnfs">
- <a ng-click="addVnfInstance(vnf, aService.instance.vnfs)">{{vnf.modelCustomizationName}} {{vnf.nfType}} {{vnf.nfRole}} {{vnf.nfFunction}} {{vnf.nfCode}}</a>
- </li>
- </ul>
- </div>
- <!-- <div class="pull-right btn-group" ng-if="aService.model.networks && !equals(aService.model.networks, {})">-->
- <div class="pull-right btn-group" ng-if="aService.convertedModel.networks && (!(isObjectEmpty(aService.convertedModel.networks)))">
- <!--<div class="pull-right btn-group" ng-if="aService.model.networks">-->
- <button type="button" class="btn btn-success btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
- Add Network<span class="caret"></span>
- </button>
- <ul class="dropdown-menu" ng-model="aService.convertedModel.networks">
- <li ng-repeat="(networkUuid, network) in aService.convertedModel.networks">
- <a ng-click="addNetworkInstance(network, aService.instance.vnfs)">{{network.modelCustomizationName}}</a>
- </li>
- </ul>
- </div>
- <a class="pull-right btn btn-primary btn-xs" data-nodrag ng-click="describeService(aService.instance)" style="margin-right: 8px;">
- <span class="glyphicon glyphicon-info-sign"></span>
- </a>
- </div>
- <ol ui-tree-nodes="" ng-model="aService.instance.vnfs" ng-class="{hidden: collapsed}">
- <li ng-repeat="vnf in aService.instance.vnfs" ui-tree-node>
- <div ui-tree-handle class="tree-node tree-node-content">
- <a class="btn btn-success btn-xs" ng-if="(vnf.vfModules && vnf.vfModules.length > 0) || (vnf.volumeGroups && vnf.volumeGroups.length > 0)" data-nodrag ng-click="this.toggle()">
- <span class="glyphicon" ng-class="{'glyphicon-chevron-right': collapsed,'glyphicon-chevron-down': !collapsed}"></span>
- </a>
- VNF: {{vnf.name}} | TYPE: {{vnf.nodeType}} | ORCH STATUS: {{vnf.nodeStatus}}
- <a ng-if="(vnf.vfModules.length == 0) && (vnf.volumeGroups.length == 0)" class="pull-right btn btn-danger btn-xs" data-nodrag ng-click="deleteVnf(aService.instance, vnf)">
- <span class="glyphicon glyphicon-remove"></span>
- </a>
- <!-- <div class="pull-right btn-group" ng-if="aService.convertedModel.vnfs[vnf.object['model-invariant-id']][vnf.object['model-version-id']].vfModules">-->
- <div class="pull-right btn-group" ng-if="(hasVfModules(vnf.object) && (aService.convertedModel.isNewFlow))">
-
- <button type="button" class="btn btn-success btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
- Add VF-Module<span class="caret"></span>
- </button>
- <ul class="dropdown-menu" ng-model="vfModule" >
- <a ng-repeat="(vfModuleCustomizationUuid, vfModule) in aService.convertedModel.vnfs[vnf.object['model-customization-id']].vfModules" ng-click="addVfModuleInstance(vnf, vfModule)">{{vfModule.modelCustomizationName}} </a>
- </ul>
- </div>
-
-
- <div class="pull-right btn-group" ng-if="(hasVfModules(vnf.object) && (!(aService.convertedModel.isNewFlow)))">
-
- <button type="button" class="btn btn-success btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
- Add VF-Module<span class="caret"></span>
- </button>
- <ul class="dropdown-menu" ng-model="vnf">
- <a ng-repeat="(vfModuleUuid, vfModule) in aService.convertedModel.vnfs[vnf.object['model-version-id']].vfModules" ng-click="addVfModuleInstance(vnf, vfModule)">{{vfModule.modelCustomizationName}}</a>
- </li>
- </ul>
-
- </div>
-
- <div class="pull-right btn-group" ng-if="(hasVolumeGroups(vnf.object) && (aService.convertedModel.isNewFlow))">
-
- <button type="button" class="btn btn-success btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
- Add Volume Group<span class="caret"></span>
- </button>
- <ul class="dropdown-menu" ng-model="volumeGroup" >
- <a ng-repeat="(volumeGroupCustomizationUuid, volumeGroup) in aService.convertedModel.vnfs[vnf.object['model-customization-id']].volumeGroups" ng-click="addVolumeGroupInstance(vnf, volumeGroup)">{{volumeGroup.modelCustomizationName}}</a>
- </ul>
- </div>
-
- <div class="pull-right btn-group" ng-if="(hasVolumeGroups(vnf.object) && (!(aService.convertedModel.isNewFlow)))">
-
- <button type="button" class="btn btn-success btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
- Add Volume Group<span class="caret"></span>
- </button>
- <ul class="dropdown-menu" ng-model="vnf">
- <a ng-repeat="(volumeGroupUuid, volumeGroup) in aService.convertedModel.vnfs[vnf.object['model-version-id']].volumeGroups" ng-click="addVolumeGroupInstance(vnf, volumeGroup)">{{volumeGroup.modelCustomizationName}}</a>
- </li>
- </ul>
-
- </div>
-
- <!-- VID-374/378 - switching-off feature <a class="pull-right btn btn-primary btn-xs" data-nodrag ng-click="getStatusOfVnf(aService.instance, vnf)" style="margin-right: 8px;">
- <span class="glyphicon glyphicon-exclamation-sign"></span>
- </a> -->
- <a class="pull-right btn btn-primary btn-xs" data-nodrag ng-click="describeVnf(aService.instance, vnf)" style="margin-right: 8px;">
- <span class="glyphicon glyphicon-info-sign"></span>
- </a>
+
+ <div ui-tree data-drag-enabled="false" data-nodrop-enabled="true" style="margin: 30px">
+
+ <ol ui-tree-nodes="" ng-model="service" >
+ <li ng-repeat="aService in [service]" ui-tree-node>
+ <div ui-tree-handle class="tree-node tree-node-content">
+ <a class="btn btn-success btn-xs" ng-if="(aService.instance.vnfs && aService.instance.vnfs.length > 0) || (aService.instance.networks && aService.instance.networks.length > 0)" data-nodrag ng-click="this.toggle()">
+ <span class="glyphicon" ng-class="{'glyphicon-chevron-right': collapsed,'glyphicon-chevron-down': !collapsed}"></span>
+ </a>
+ SERVICE INSTANCE: {{aService.instance.name}}
+ <a ng-if="((isMacro()) || (isObjectEmpty(aService.instance.vnfs) && isObjectEmpty(aService.instance.networks))) && isPermitted" data-tests-id="deleteServiceButton" class="pull-right btn btn-danger btn-xs" data-nodrag ng-click="deleteService(aService.instance);">
+ <span class="glyphicon glyphicon-remove"></span>
+ </a>
+ <div class="pull-right btn-group" ng-if="aService.convertedModel.vnfs && !isObjectEmpty(aService.convertedModel.vnfs) && !aService.convertedModel.isNewFlow && isPermitted">
+ <button type="button" data-tests-id="addVNFButton" class="btn btn-success btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
+ Add VNF<span class="caret"></span>
+ </button>
+ <ul class="dropdown-menu" ng-model="aService.convertedModel.vnfs">
+ <a role="menuitem" ng-repeat="(vnfUuid, vnf) in aService.convertedModel.vnfs" data-tests-id="addVNFOption-{{vnf.modelCustomizationName}}" ng-click="addVnfInstance(vnf, aService.instance.vnfs)">{{vnf.modelCustomizationName}}</a>
+
+ </ul>
</div>
- <ol ui-tree-nodes="" ng-model="vnf.vfModules" ng-class="{hidden: collapsed}">
- <li ng-repeat="vfModule in vnf.vfModules" ui-tree-node>
- <div ui-tree-handle class="tree-node tree-node-content">
- <a class="btn btn-success btn-xs" ng-if="(vfModule.volumeGroups && vfModule.volumeGroups.length > 0)" data-nodrag ng-click="this.toggle()">
- <span class="glyphicon" ng-class="{'glyphicon-chevron-right': collapsed,'glyphicon-chevron-down': !collapsed}"></span>
- </a>
- VFMODULE: {{vfModule.name}} | TYPE: {{vfModule.nodeType}} | ORCH STATUS: {{vfModule.nodeStatus}}
- <!-- -->
- <a class="pull-right btn btn-danger btn-xs" data-nodrag ng-click="deleteVfModule(aService.instance, vfModule, vnf)">
- <span class="glyphicon glyphicon-remove"></span>
- </a>
- <div class="pull-right btn-group">
- <!-- <button type="button" class="btn btn-success btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
- Attach Volume Group<span class="caret"></span>
- </button>
- <ul class="dropdown-menu" ng-model="vnf.volumeGroups">
- <li ng-repeat="volumeGroup in vnf.availableVolumeGroups">
- <a ng-click="attachVolumeGroupInstance(vfModule, volumeGroup)">{{volumeGroup.name}}</a>
- </li>
- </ul> -->
- </div>
- <a class="pull-right btn btn-primary btn-xs" data-nodrag ng-click="describeVfModule(aService.instance, vfModule, vnf)" style="margin-right: 8px;">
- <span class="glyphicon glyphicon-info-sign"></span>
- </a>
+ <div class="pull-right btn-group" ng-if="aService.convertedModel.vnfs && !isObjectEmpty(aService.convertedModel.vnfs) && aService.convertedModel.isNewFlow && isPermitted">
+ <button type="button" data-tests-id="addVNFButton" class="btn btn-success btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
+ Add VNF<span class="caret"></span>
+ </button>
+ <ul class="dropdown-menu" ng-model="aService.convertedModel.vnfs" data-tests-id="addVnfsDropdown">
+ <li role="menuitem" ng-repeat="(vnfUuid, vnf) in aService.convertedModel.vnfs">
+ <a data-tests-id="addVNFOption-{{vnf.modelCustomizationName}}" ng-click="addVnfInstance(vnf, aService.instance.vnfs)">{{vnf.modelCustomizationName}} {{vnf.nfType}} {{vnf.nfRole}} {{vnf.nfFunction}} {{vnf.nfCode}}</a>
+ </li>
+ </ul>
+ </div>
+ <!-- <div class="pull-right btn-group" ng-if="aService.model.networks && !equals(aService.model.networks, {})">-->
+ <div class="pull-right btn-group" ng-if="aService.convertedModel.networks && (!(isObjectEmpty(aService.convertedModel.networks)))">
+ <!--<div class="pull-right btn-group" ng-if="aService.model.networks">-->
+ <button type="button" data-tests-id="addNetworkButton" class="btn btn-success btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
+ Add Network<span class="caret"></span>
+ </button>
+ <ul class="dropdown-menu" ng-model="aService.convertedModel.networks">
+ <li ng-repeat="(networkUuid, network) in aService.convertedModel.networks">
+ <a ng-click="addNetworkInstance(network, aService.instance.vnfs)">{{network.modelCustomizationName}}</a>
+ </li>
+ </ul>
+ </div>
+ <a class="pull-right btn btn-primary btn-xs" data-nodrag ng-click="describeService(aService.instance)" style="margin-right: 8px;">
+ <span class="glyphicon glyphicon-info-sign"></span>
+ </a>
+ </div>
+ <ol ui-tree-nodes="" ng-model="aService.instance.vnfs" ng-class="{hidden: collapsed}">
+ <li ng-repeat="vnf in aService.instance.vnfs" ui-tree-node>
+ <div ui-tree-handle class="tree-node tree-node-content">
+ <a class="btn btn-success btn-xs" ng-if="(vnf.vfModules && vnf.vfModules.length > 0) || (vnf.volumeGroups && vnf.volumeGroups.length > 0)" data-nodrag ng-click="this.toggle()">
+ <span class="glyphicon" ng-class="{'glyphicon-chevron-right': collapsed,'glyphicon-chevron-down': !collapsed}"></span>
+ </a>
+ VNF: {{vnf.name}} | TYPE: {{vnf.nodeType}} | ORCH STATUS: {{vnf.nodeStatus}}
+
+ <a ng-if="(vnf.vfModules.length == 0) && (vnf.volumeGroups.length == 0) && isPermitted" data-tests-id="deleteVNFButton" class="pull-right btn btn-danger btn-xs" data-nodrag ng-click="deleteVnf(aService.instance, vnf)">
+ <span class="glyphicon glyphicon-remove"></span>
+ </a>
+ <!-- <div class="pull-right btn-group" ng-if="aService.convertedModel.vnfs[vnf.object['model-invariant-id']][vnf.object['model-version-id']].vfModules">-->
+ <div class="pull-right btn-group" ng-if="(hasVfModules(vnf.object) && (aService.convertedModel.isNewFlow)) && isPermitted">
+
+ <button type="button" data-tests-id="addVFModuleButton" class="btn btn-success btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
+ Add VF-Module<span class="caret"></span>
+ </button>
+ <ul class="dropdown-menu" ng-model="vfModule" >
+ <a ng-repeat="(vfModuleCustomizationUuid, vfModule) in aService.convertedModel.vnfs[vnf.object['model-customization-id']].vfModules" data-tests-id="addVFModuleOption-{{vfModule.modelCustomizationName}}" ng-click="addVfModuleInstance(vnf, vfModule)">{{vfModule.modelCustomizationName}} </a>
+ </ul>
</div>
- <ol ui-tree-nodes="" ng-model="vfModule.volumeGroups" ng-class="{hidden: collapsed}">
- <li ng-repeat="volumeGroup in vfModule.volumeGroups" ui-tree-node>
- <div ui-tree-handle class="tree-node tree-node-content">
- VOLUME GROUP: {{volumeGroup.name}} | TYPE: {{volumeGroup.nodeType}} | ORCH STATUS: {{volumeGroup.nodeStatus}}
- <!-- <a class="pull-right btn btn-danger btn-xs" data-nodrag ng-click="deleteVolumeGroup(aService.instance, vnf, vfModule, volumeGroup)">
- <span class="glyphicon glyphicon-remove"></span>
- </a> -->
- <a class="pull-right btn btn-primary btn-xs" data-nodrag ng-click="describeVolumeGroup(aService.instance, vnf, volumeGroup)" style="margin-right: 8px;">
- <span class="glyphicon glyphicon-info-sign"></span>
- </a>
- </div>
- </li>
- </ol>
- </li>
- </ol>
- <ol ui-tree-nodes="" ng-model="vnf.availableVolumeGroups" ng-class="{hidden: collapsed}">
- <li ng-repeat="volumeGroup in vnf.availableVolumeGroups" ui-tree-node>
- <div ui-tree-handle class="tree-node tree-node-content">
- VOLUME GROUP: {{volumeGroup.name}} | TYPE: {{volumeGroup.nodeType}} | ORCH STATUS: {{volumeGroup.nodeStatus}}
- <a class="pull-right btn btn-danger btn-xs" data-nodrag ng-click="deleteVnfVolumeGroup(aService.instance, vnf, volumeGroup)">
- <span class="glyphicon glyphicon-remove"></span>
- </a>
- <a class="pull-right btn btn-primary btn-xs" data-nodrag ng-click="describeVolumeGroup(aService.instance, vnf, volumeGroup)" style="margin-right: 8px;">
- <span class="glyphicon glyphicon-info-sign"></span>
- </a>
+
+
+ <div class="pull-right btn-group" ng-if="(hasVfModules(vnf.object) && (!(aService.convertedModel.isNewFlow))) && isPermitted">
+
+ <button type="button" data-tests-id="addVFModuleButton" class="btn btn-success btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
+ Add VF-Module<span class="caret"></span>
+ </button>
+ <ul class="dropdown-menu" ng-model="vnf">
+ <a ng-repeat="(vfModuleUuid, vfModule) in aService.convertedModel.vnfs[vnf.object['model-version-id']].vfModules" data-tests-id="addVFModuleOption-{{vfModule.modelCustomizationName}}" ng-click="addVfModuleInstance(vnf, vfModule)">{{vfModule.modelCustomizationName}}</a>
+ </li>
+ </ul>
+
</div>
- </li>
- </ol>
- </li>
- </ol>
- <ol ui-tree-nodes="" ng-model="aService.instance.networks" ng-class="{hidden: collapsed}">
- <li ng-repeat="network in aService.instance.networks" ui-tree-node>
- <div ui-tree-handle class="tree-node tree-node-content">
- NETWORK: {{network.name}} | TYPE: {{network.nodeType}} | ORCH STATUS: {{network.nodeStatus}}
-
- <a class="pull-right btn btn-danger btn-xs" ng-if="(!isMacro())" data-nodrag ng-click="deleteNetwork(aService.instance, network)">
- <span class="glyphicon glyphicon-remove"></span>
- </a>
- <!-- <a class="pull-right btn btn-danger btn-xs" data-nodrag ng-click="deleteNetwork(aService.instance, network)">
- <span class="glyphicon glyphicon-remove"></span>
- </a>-->
- <a class="pull-right btn btn-primary btn-xs" data-nodrag ng-click="describeNetwork(aService.instance, network)" style="margin-right: 8px;">
- <span class="glyphicon glyphicon-info-sign"></span>
- </a>
- </div>
- </li>
- </ol>
- </li>
- </ol>
+
+ <div class="pull-right btn-group" ng-if="(hasVolumeGroups(vnf.object) && (aService.convertedModel.isNewFlow)) && isPermitted">
+ <button type="button" data-tests-id="addVolumeGroupButton" class="btn btn-success btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
+ Add Volume Group<span class="caret"></span>
+ </button>
+ <ul class="dropdown-menu" ng-model="volumeGroup" >
+ <a ng-repeat="(volumeGroupCustomizationUuid, volumeGroup) in aService.convertedModel.vnfs[vnf.object['model-customization-id']].volumeGroups" data-tests-id="addVolumeGroupOption-{{volumeGroup.modelCustomizationName}}" ng-click="addVolumeGroupInstance(vnf, volumeGroup)">{{volumeGroup.modelCustomizationName}}</a>
+ </ul>
+ </div>
+
+ <div class="pull-right btn-group" ng-if="(hasVolumeGroups(vnf.object) && (!(aService.convertedModel.isNewFlow))) && isPermitted">
+
+ <button type="button" data-tests-id="addVolumeGroupButton" class="btn btn-success btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
+ Add Volume Group<span class="caret"></span>
+ </button>
+ <ul class="dropdown-menu" ng-model="vnf">
+ <a ng-repeat="(volumeGroupUuid, volumeGroup) in aService.convertedModel.vnfs[vnf.object['model-version-id']].volumeGroups" data-tests-id="addVolumeGroupOption-{{volumeGroup.modelCustomizationName}}" ng-click="addVolumeGroupInstance(vnf, volumeGroup)">{{volumeGroup.modelCustomizationName}}</a>
+ </li>
+ </ul>
+
+ </div>
+
+ <!-- VID-374/378 - switching-off feature <a class="pull-right btn btn-primary btn-xs" data-nodrag ng-click="getStatusOfVnf(aService.instance, vnf)" style="margin-right: 8px;">
+ <span class="glyphicon glyphicon-exclamation-sign"></span>
+ </a> -->
+ <a class="pull-right btn btn-primary btn-xs" data-nodrag ng-click="describeVnf(aService.instance, vnf)" style="margin-right: 8px;">
+ <span class="glyphicon glyphicon-info-sign"></span>
+ </a>
+ </div>
+ <ol ui-tree-nodes="" ng-model="vnf.vfModules" ng-class="{hidden: collapsed}">
+ <li ng-repeat="vfModule in vnf.vfModules" ui-tree-node>
+ <div ui-tree-handle class="tree-node tree-node-content">
+ <a class="btn btn-success btn-xs" ng-if="(vfModule.volumeGroups && vfModule.volumeGroups.length > 0)" data-nodrag ng-click="this.toggle()">
+ <span class="glyphicon" ng-class="{'glyphicon-chevron-right': collapsed,'glyphicon-chevron-down': !collapsed}"></span>
+ </a>
+ VFMODULE: {{vfModule.name}} | TYPE: {{vfModule.nodeType}} | ORCH STATUS: {{vfModule.nodeStatus}}
+ <!-- -->
+ <a class="pull-right btn btn-danger btn-xs" ng-if="isPermitted" data-tests-id="deleteVFModuleButton" data-nodrag ng-click="deleteVfModule(aService.instance, vfModule, vnf)">
+ <span class="glyphicon glyphicon-remove"></span>
+ </a>
+ <div class="pull-right btn-group">
+ <!-- <button type="button" class="btn btn-success btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
+ Attach Volume Group<span class="caret"></span>
+ </button>
+ <ul class="dropdown-menu" ng-model="vnf.volumeGroups">
+ <li ng-repeat="volumeGroup in vnf.availableVolumeGroups">
+ <a ng-click="attachVolumeGroupInstance(vfModule, volumeGroup)">{{volumeGroup.name}}</a>
+ </li>
+ </ul> -->
+ </div>
+ <a class="pull-right btn btn-primary btn-xs" data-nodrag ng-click="describeVfModule(aService.instance, vfModule, vnf)" style="margin-right: 8px;">
+ <span class="glyphicon glyphicon-info-sign"></span>
+ </a>
+ </div>
+ <ol ui-tree-nodes="" ng-model="vfModule.volumeGroups" ng-class="{hidden: collapsed}">
+ <li ng-repeat="volumeGroup in vfModule.volumeGroups" ui-tree-node>
+ <div ui-tree-handle class="tree-node tree-node-content">
+ VOLUME GROUP: {{volumeGroup.name}} | TYPE: {{volumeGroup.nodeType}} | ORCH STATUS: {{volumeGroup.nodeStatus}}
+ <!-- <a class="pull-right btn btn-danger btn-xs" data-nodrag ng-click="deleteVolumeGroup(aService.instance, vnf, vfModule, volumeGroup)">
+ <span class="glyphicon glyphicon-remove"></span>
+ </a> -->
+ <a class="pull-right btn btn-primary btn-xs" data-nodrag ng-click="describeVolumeGroup(aService.instance, vnf, volumeGroup)" style="margin-right: 8px;">
+ <span class="glyphicon glyphicon-info-sign"></span>
+ </a>
+ </div>
+ </li>
+ </ol>
+ </li>
+ </ol>
+ <ol ui-tree-nodes="" ng-model="vnf.availableVolumeGroups" ng-class="{hidden: collapsed}">
+ <li ng-repeat="volumeGroup in vnf.availableVolumeGroups" ui-tree-node>
+ <div ui-tree-handle class="tree-node tree-node-content">
+ VOLUME GROUP: {{volumeGroup.name}} | TYPE: {{volumeGroup.nodeType}} | ORCH STATUS: {{volumeGroup.nodeStatus}}
+ <a class="pull-right btn btn-danger btn-xs" ng-if="isPermitted" data-tests-id="deleteVNFVolumeGroupButton" data-nodrag ng-click="deleteVnfVolumeGroup(aService.instance, vnf, volumeGroup)">
+ <span class="glyphicon glyphicon-remove"></span>
+ </a>
+ <a class="pull-right btn btn-primary btn-xs" data-nodrag ng-click="describeVolumeGroup(aService.instance, vnf, volumeGroup)" style="margin-right: 8px;">
+ <span class="glyphicon glyphicon-info-sign"></span>
+ </a>
+ </div>
+ </li>
+ </ol>
+ </li>
+ </ol>
+ <ol ui-tree-nodes="" ng-model="aService.instance.networks" ng-class="{hidden: collapsed}">
+ <li ng-repeat="network in aService.instance.networks" ui-tree-node>
+ <div ui-tree-handle class="tree-node tree-node-content">
+ NETWORK: {{network.name}} | TYPE: {{network.nodeType}} | ORCH STATUS: {{network.nodeStatus}}
+
+ <a class="pull-right btn btn-danger btn-xs" ng-if="!isMacro() && isPermitted" data-tests-id="deleteNetworkButton" data-nodrag ng-click="deleteNetwork(aService.instance, network)">
+ <span class="glyphicon glyphicon-remove"></span>
+ </a>
+ <!-- <a class="pull-right btn btn-danger btn-xs" data-nodrag ng-click="deleteNetwork(aService.instance, network)">
+ <span class="glyphicon glyphicon-remove"></span>
+ </a>-->
+ <a class="pull-right btn btn-primary btn-xs" data-nodrag ng-click="describeNetwork(aService.instance, network)" style="margin-right: 8px;">
+ <span class="glyphicon glyphicon-info-sign"></span>
+ </a>
+ </div>
+ </li>
+ </ol>
+ </li>
+ </ol>
</div>
</div>
</div>
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/msoCommit.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/msoCommit.htm index e3f415c4..48268248 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/msoCommit.htm +++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/msoCommit.htm @@ -41,7 +41,7 @@ <pre class="log">{{log}}</pre>
<div class="buttonRow">
- <button ngx-enabled="{{isCloseEnabled}}" att-button size="small"
+ <button data-tests-id="msoCommitDialogCloseButton" ngx-enabled="{{isCloseEnabled}}" att-button size="small"
ng-click="close();">Close</button>
</div>
</div>
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/previousVersion.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/previousVersion.htm new file mode 100644 index 00000000..dd604632 --- /dev/null +++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/previousVersion.htm @@ -0,0 +1,44 @@ +<div ng-controller="previousVersionContoller"> + + <div ng-show="isTableDialogVisible"> + <div class="titleLine"> + <img src="app/vid/images/spinner.gif" + ngx-visible="{{isTableSpinnerVisible}}"></img> + <h3>{{componentName}} - {{createType}}</h3> + </div> + + <div class="error" ng-show="isTableErrorVisible"> + <img src="app/vid/images/error.png"></img>{{error}} + </div> + <table att-table table-data="tableData" view-per-page="viewPerPage" current-page="currentPage" search-category="searchCategory" search-string="searchString" total-page="totalPage"> + <thead att-table-row type="header"> + <tr> + <th att-table-header key="action">Action</th> + <th att-table-header key="serviceInstanceName">Service Name</th> + <th att-table-header key="serviceDescription">Service Description</th> + <th att-table-header key="serviceType">Service Type</th> + <th att-table-header key="serviceUuid">Service UUID</th> + <th att-table-header key="serviceInvariantUuid">Service Invariant UUID</th> + <th att-table-header key="serviceVersion">Service Version</th> + </tr> + </thead> + <tbody att-table-row type="body" row-repeat="service in tableData"> + <tr> + <td att-table-body ><button type=button ng-click="deployService(service,true)" att-button btn-type="primary" size="small">Deploy</button></td> + <td att-table-body ng-bind="service['extra-properties']['extra-property'][2]['property-value']"></td> + <td att-table-body ng-bind="service['extra-properties']['extra-property'][0]['property-value']"></td> + <td att-table-body ng-bind="serviceType"></td> + <td att-table-body ng-bind="service['extra-properties']['extra-property'][1]['property-value']"></td> + <td att-table-body ng-bind="service['extra-properties']['extra-property'][4]['property-value']"></td> + <td att-table-body ng-bind="service['extra-properties']['extra-property'][6]['property-value']"></td> + </tr> + </tbody> + </table> + + + <div class="buttonRow"> + <button type="button" ng-click="cancelTable();" att-button + btn-type="primary" size="small">Cancel</button> + </div> + </div> +</div> diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/previousVersionDialog.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/previousVersionDialog.htm new file mode 100644 index 00000000..2912c70b --- /dev/null +++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/previousVersionDialog.htm @@ -0,0 +1,48 @@ +<div ng-controller="previousVersionDialogController"> + + <div ng-show="isTableDialogVisible"> + <div class="titleLine"> + <img src="app/vid/images/spinner.gif" + ngx-visible="{{isTableSpinnerVisible}}"></img> + <h3>{{componentName}} - {{createType}}</h3> + </div> + + <div class="error" ng-show="isTableErrorVisible"> + <img src="app/vid/images/error.png"></img>{{error}} + </div> + <table att-table table-data="tableData" view-per-page="viewPerPage" current-page="currentPage" search-category="searchCategory" search-string="searchString" total-page="totalPage"> + <thead att-table-row type="header"> + <tr> + <th att-table-header key="action">Action</th> + <th att-table-header key="uuid">UUID</th> + <th att-table-header key="invariantUUID">Invariant UUID</th> + <th att-table-header key="name">Name</th> + <th att-table-header key="version">Version</th> + <th att-table-header key="category">Category</th> + <th att-table-header key="distributionStatus">Distribution Status</th> + <th att-table-header key="lastUpdaterUserId">Last Updated By</th> + <th att-table-header key="toscaModelUrl">Tosca Model</th> + </tr> + </thead> + <tbody att-table-row type="body" row-repeat="row in tableData"> + <tr> + <td att-table-body ><button type=button ng-click="deployService(row)" att-button btn-type="{{deployButtonType}}" size="small">Deploy</button></td> + <td att-table-body ng-bind="row['uuid']"></td> + <td att-table-body ng-bind="row['invariantUUID']"></td> + <td att-table-body ng-bind="row['name']"></td> + <td att-table-body ng-bind="row['version']"></td> + <td att-table-body ng-bind="row['category']"></td> + <td att-table-body ng-bind="row['distributionStatus']"></td> + <td att-table-body ng-bind="row['lastUpdaterUserId']"></td> + <td att-table-body ng-bind="row['toscaModelUrl']"></td> + </tr> + </tbody> + </table> + + + <div class="buttonRow"> + <button type="button" ng-click="cancelTable();" att-button + btn-type="primary" size="small">Cancel</button> + </div> + </div> +</div> diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/serviceModels.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/serviceModels.htm index 00b8972f..3cba8719 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/serviceModels.htm +++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/serviceModels.htm @@ -19,6 +19,9 @@ -->
<link rel="stylesheet" type="text/css" href="app/vid/styles/serviceModels.css" />
+<div popup-window class="popupContents" ngx-show="{{popup.isTablePopUpVisible}}" ng-cloak>
+ <div ng-include="'app/vid/scripts/view-models/previousVersionDialog.htm'"/>
+</div>
<div popup-window class="popupContents" ngx-show="{{popup.isVisible}}" ng-cloak>
<div ng-include="'app/vid/scripts/view-models/creationDialog.htm'"/>
</div>
@@ -34,7 +37,7 @@ <div class="fn-ebz-container">
Filter:
- <input class="fn-ebz-text" type="text" ng-model="searchString" size="20" style="width: 250px;">
+ <input class="fn-ebz-text" data-tests-id="browseFilter" type="text" ng-model="searchString" size="20" style="width: 250px;">
</div>
<h1 class="heading1" style="margin-top:20px;">Browse SDC Service Models</h1>
@@ -57,7 +60,7 @@ </thead>
<tbody att-table-row type="body" row-repeat="service in services">
<tr>
- <td att-table-body ><button type=button ng-click="deployService(service)" att-button btn-type="primary" size="small">Deploy</button></td>
+ <td att-table-body ><button class="deploy-service-class" type=button data-tests-id="deploy-{{service['uuid']}}" ng-click="deployService(service)" att-button btn-type="{{deployButtonType}}" size="small">Deploy</button></td>
<td att-table-body ng-bind="service['uuid']"></td>
<td att-table-body ng-bind="service['invariantUUID']"></td>
<td att-table-body ng-bind="service['name']"></td>
@@ -66,7 +69,8 @@ <td att-table-body ng-bind="service['distributionStatus']"></td>
<td att-table-body ng-bind="service['lastUpdaterUserId']"></td>
<td att-table-body ng-bind="service['toscaModelUrl']"></td>
- <td att-table-body ><button type=button ng-click="deloyService(service)" att-button btn-type="primary" size="small">Previous Versions</button></td>
+ <td att-table-body ng-show="service['version'] > '1.0' "><button type=button ng-click="loadPreviousVersionData(service['invariantUUID'],service['name'],service['version'])" att-button btn-type="primary" size="small">Previous Versions</button></td>
+ <td att-table-body ng-show="service['version'] <= '1.0' "> </td>
</tr>
</tbody>
</table>
diff --git a/vid-app-common/src/main/webapp/app/vid/test/testMso.js b/vid-app-common/src/main/webapp/app/vid/test/testMso.js index 884ba8d8..f6ebed46 100755 --- a/vid-app-common/src/main/webapp/app/vid/test/testMso.js +++ b/vid-app-common/src/main/webapp/app/vid/test/testMso.js @@ -41,7 +41,7 @@ app.controller("testController", [ "$scope", "$timeout", "$cookieStore", "$log", setTestMsoMode($cookieStore.get(TEST_MODE_COOKIE));
PropertyService.setMsoMaxPollingIntervalMsec(1000);
PropertyService.setMsoMaxPolls(7);
- PropertyService.setServerResponseTimeoutMsec(10000);
+ PropertyService.setServerResponseTimeoutMsec(30000);
};
$scope.testMsoModeChanged = function() {
diff --git a/vid-app-common/src/main/webapp/app/vid/test/testViewEdit.js b/vid-app-common/src/main/webapp/app/vid/test/testViewEdit.js index 73da4db7..7ddc3dec 100755 --- a/vid-app-common/src/main/webapp/app/vid/test/testViewEdit.js +++ b/vid-app-common/src/main/webapp/app/vid/test/testViewEdit.js @@ -90,7 +90,7 @@ var testViewEditController = function(COMPONENT, DataService, PropertyService, PropertyService.setAsdcBaseUrl("testasdc");
PropertyService.setMsoMaxPollingIntervalMsec(1000);
PropertyService.setMsoMaxPolls(7);
- PropertyService.setServerResponseTimeoutMsec(10000);
+ PropertyService.setServerResponseTimeoutMsec(30000);
};
$scope.testMsoModeChanged = function() {
|