aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsj108s <sj108s@us.att.com>2018-04-27 16:34:48 +0530
committersj108s <sj108s@us.att.com>2018-04-27 16:53:25 +0530
commitf50c51684b3dde7e9a3f4641f0fd5ee64cf45ff0 (patch)
treef0341382934c5580927f9e8d00c99e4c19932303
parent3b905ee77fec432d3e44088787c4a810ced52d3e (diff)
Fixed parsing of retrieved openstack ref data
Fixed parsing of retrieved data in case of openstack action and also fixed browser hang while syncing large template Issue-ID: APPC-867 Change-Id: I3058626cb5a21c01a9b261d470672db5d0f17926 Signed-off-by: sj108s <sj108s@us.att.com>
-rw-r--r--src/app/shared/services/mapping-editor.service.ts3
-rw-r--r--src/app/vnfs/build-artifacts/parameter-definitions/parameter.component.ts17
-rw-r--r--src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.component.ts44
3 files changed, 28 insertions, 36 deletions
diff --git a/src/app/shared/services/mapping-editor.service.ts b/src/app/shared/services/mapping-editor.service.ts
index fe70722..c27d95e 100644
--- a/src/app/shared/services/mapping-editor.service.ts
+++ b/src/app/shared/services/mapping-editor.service.ts
@@ -17,7 +17,6 @@ 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.
-ECOMP is a trademark and service mark of AT&T Intellectual Property.
============LICENSE_END============================================
*/
@@ -197,7 +196,7 @@ export class MappingEditorService {
if (value) {
var occurances = this.editor.findAll(value, {regExp: false});
var ranges = this.editor.getSelection().getAllRanges();
- if (ranges) {
+ if (ranges && occurances && occurances > 0) {
for (var r = 0; r < ranges.length; r++) {
let selectedRange: any = ranges[r];
diff --git a/src/app/vnfs/build-artifacts/parameter-definitions/parameter.component.ts b/src/app/vnfs/build-artifacts/parameter-definitions/parameter.component.ts
index 80269cb..3c95859 100644
--- a/src/app/vnfs/build-artifacts/parameter-definitions/parameter.component.ts
+++ b/src/app/vnfs/build-artifacts/parameter-definitions/parameter.component.ts
@@ -252,7 +252,7 @@ export class ParameterComponent implements OnInit {
this.displayParamObjects = [];
this.modelParamDefinitionObjects = [];
if (this.paramShareService.getSessionParamData() != undefined && this.paramShareService.getSessionParamData().length > 0) {
- this.displayParamObjects = this.paramShareService.getSessionParamData();
+ this.getPDFromSession();
} else {
this.getPD();
}
@@ -296,6 +296,21 @@ export class ParameterComponent implements OnInit {
}
+ public getPDFromSession() {
+
+ this.ngProgress.start();
+ return this.httpService.get({
+ url: 'testurl',
+ }).subscribe(data => {
+ this.displayParamObjects = this.paramShareService.getSessionParamData();
+ this.ngProgress.done();
+ },
+ error => {
+ this.displayParamObjects = this.paramShareService.getSessionParamData();
+ this.ngProgress.done();
+ });
+ }
+
//========================== End of NGInit() Method============================================
selectedNavItem(item: any) {
this.item = item;
diff --git a/src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.component.ts b/src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.component.ts
index 9c6f8df..14ccdbc 100644
--- a/src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.component.ts
+++ b/src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.component.ts
@@ -411,6 +411,7 @@ export class ReferenceDataformComponent implements OnInit {
if (this.referenceDataObject.action === 'OpenStack Actions') {
this.referenceDataObject['template'] = 'N';
this.referenceDataObject['artifact-list'] = [];
+ this.referenceDataObject['firstRowVmSpreadSheet']=this.firstArrayElement;
}
//detaching the object from the form and processing further
let newObj = $.extend(true, {}, this.referenceDataObject);
@@ -444,33 +445,7 @@ export class ReferenceDataformComponent implements OnInit {
}
upload(evt: any) {
- /* // console.log("This uploaded array==" + JSON.stringify(this.uploadedDataArray))
- // // console.log("This template data before==" + JSON.stringify(this.tempAllData))
- if (this.uploadedDataArray && this.uploadedDataArray != undefined && this.uploadedDataArray.length!=0) {
- /* for (var i = 0; i < this.uploadedDataArray.length; i++) {
- var action = this.uploadedDataArray[i][0];
- for (var j = 0; j < this.tempAllData.length; j++) {
- if (action === this.tempAllData[j].action) {
- this.tempAllData.splice(j);
- // console.log("This template data===" + this.tempAllData[j]);
- }
- }
- }
- if (this.tempAllData && this.tempAllData != undefined) {
- for (var i = 0; i < this.tempAllData.length; i++) {
- // alert(this.checkIfelementExistsInArray(this.tempAllData[i].action,this.actions))
- var result = this.checkIfelementExistsInArray(this.tempAllData[i].action, this.actions);
- if (this.tempAllData[i].action === "AllAction") result = true;
- if (!result) {
- // console.log("Removing VM action==" + this.tempAllData[i].action)
- this.tempAllData.splice(i, 1);
- }
-
- }
- }
- }
- // // console.log("This template data after==" + JSON.stringify(this.tempAllData))
- /* wire up file reader */
+ /* wire up file reader */
const target: DataTransfer = <DataTransfer>(evt.target);
//// console.log("filename========" + evt.target.files[0].name)
this.uploadFileName = evt.target.files[0].name;
@@ -785,6 +760,7 @@ export class ReferenceDataformComponent implements OnInit {
}*/
];
}
+ this.getArtifactsOpenStack();
if (this.referenceDataObject.template == null) {
this.referenceDataObject.template = 'Y';
}
@@ -1357,19 +1333,20 @@ export class ReferenceDataformComponent implements OnInit {
getArtifactsOpenStack() {
var array = []
var vnfcFunctionCodeArrayList = [];
- var vnfcSet = new Set();
+ var vnfcSetArray=[];
for (var i = 0; i < this.tempAllData.length; i++) {
if (!this.checkIfelementExistsInArray(this.tempAllData[i].action, this.actions) && (this.tempAllData[i].action != 'AllAction')) {
var vnfcFunctionCodeArray = this.tempAllData[i]["vnfc-function-code-list"]
- vnfcSet.add("Actions")
- for (var j = 0; j < vnfcFunctionCodeArray.length; j++) {
- vnfcSet.add(vnfcFunctionCodeArray[j])
- }
vnfcFunctionCodeArrayList.push([this.tempAllData[i].action].concat(this.tempAllData[i]["vnfc-function-code-list"]))
}
+ if(this.tempAllData[i].action==='OpenStack Actions')
+ {
+ vnfcSetArray=this.tempAllData[i]['firstRowVmSpreadSheet']
+ }
}
- var vnfcSetArray = Array.from(vnfcSet);
+ if(vnfcSetArray)
+ {
let vnfcSetArrayLen = vnfcSetArray.length;
for (let i = 0; i < vnfcFunctionCodeArrayList.length; i++) {
@@ -1388,5 +1365,6 @@ export class ReferenceDataformComponent implements OnInit {
}
this.firstArrayElement = vnfcSetArray;
this.remUploadedDataArray = vnfcFunctionCodeArrayList;
+ }
}
} \ No newline at end of file