aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/models/components/resource.ts
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-ui/src/app/models/components/resource.ts')
-rw-r--r--catalog-ui/src/app/models/components/resource.ts48
1 files changed, 36 insertions, 12 deletions
diff --git a/catalog-ui/src/app/models/components/resource.ts b/catalog-ui/src/app/models/components/resource.ts
index e594451e1a..cd839786c5 100644
--- a/catalog-ui/src/app/models/components/resource.ts
+++ b/catalog-ui/src/app/models/components/resource.ts
@@ -1,3 +1,23 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * 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=========================================================
+ */
+
/**
* Created by obarda on 2/3/2016.
*/
@@ -21,6 +41,7 @@ export class Resource extends Component {
public payloadData:string;
public payloadName:string;
public importedFile:FileUploadModel;
+ public resourceVendorModelNumber:string;
// Onboarding parameters
public csarUUID:string;
@@ -39,6 +60,7 @@ export class Resource extends Component {
this.resourceType = component.resourceType;
this.csarUUID = component.csarUUID;
this.csarVersion = component.csarVersion;
+ this.resourceVendorModelNumber = component.resourceVendorModelNumber;
this.filterTerm = this.name + ' ' + this.description + ' ' + (this.tags ? this.tags.toString() : '') + ' ' + this.version + ' ' + this.resourceType;
if (component.categories && component.categories[0] && component.categories[0].subcategories && component.categories[0].subcategories[0]) {
component.mainCategory = component.categories[0].name;
@@ -60,6 +82,7 @@ export class Resource extends Component {
this.csarUUID = componentMetadata.csarUUID;
this.csarVersion = componentMetadata.csarVersion;
this.derivedFrom = componentMetadata.derivedFrom;
+ this.resourceVendorModelNumber = componentMetadata.resourceVendorModelNumber;
this.setComponentDisplayData();
};
@@ -68,7 +91,7 @@ export class Resource extends Component {
};
public isComplex = ():boolean => {
- return this.resourceType === ResourceType.VF;
+ return this.resourceType === ResourceType.VF || this.resourceType === ResourceType.PNF || this.resourceType === ResourceType.CVFC;
};
public isVl = ():boolean => {
@@ -140,17 +163,18 @@ export class Resource extends Component {
};
public toJSON = ():any => {
- this.componentService = undefined;
- this.filterTerm = undefined;
- this.iconSprite = undefined;
- this.mainCategory = undefined;
- this.subCategory = undefined;
- this.selectedInstance = undefined;
- this.showMenu = undefined;
- this.$q = undefined;
- this.selectedCategory = undefined;
- this.importedFile = undefined;
- return this;
+ let temp = angular.copy(this);
+ temp.componentService = undefined;
+ temp.filterTerm = undefined;
+ temp.iconSprite = undefined;
+ temp.mainCategory = undefined;
+ temp.subCategory = undefined;
+ temp.selectedInstance = undefined;
+ temp.showMenu = undefined;
+ temp.$q = undefined;
+ temp.selectedCategory = undefined;
+ temp.importedFile = undefined;
+ return temp;
};
}