diff options
author | Michael Lando <ml636r@att.com> | 2017-07-12 00:54:52 +0300 |
---|---|---|
committer | Michael Lando <ml636r@att.com> | 2017-07-12 01:55:12 +0300 |
commit | dd60339b06d252fcb1382aa97ab3d65b37dad021 (patch) | |
tree | c1551ce67cd77ca810ad5f579eb3617af86be85f /catalog-ui/src/app/ng2/pages/properties-assignment | |
parent | ab146a193c43e9be0e9efeac7bab2690a7ba2d33 (diff) |
[sdc] rebase update
Change-Id: I8f1fc7150975122dd9f3f4e653b9983064b399a6
Signed-off-by: Michael Lando <ml636r@att.com>
Diffstat (limited to 'catalog-ui/src/app/ng2/pages/properties-assignment')
4 files changed, 76 insertions, 13 deletions
diff --git a/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.module.ts b/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.module.ts index b14f3afd6b..1e09c9e4c6 100644 --- a/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.module.ts +++ b/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.module.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========================================================= + */ + import { NgModule } from "@angular/core"; import { PropertiesAssignmentComponent } from "./properties-assignment.page.component"; import { HierarchyNavigationComponent } from "./../../components/hierarchy-navigtion/hierarchy-navigation.component"; diff --git a/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.less b/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.less index 15244e5fa5..ab059b1240 100644 --- a/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.less +++ b/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.less @@ -16,7 +16,7 @@ .properties-assignment-page { height: 100%; - font-family: 'Open Sans', omnes-regular, sans-serif; + font-family: @font-opensans-regular; .main-content { display:flex; @@ -66,7 +66,7 @@ right: 100px; display:flex; flex-direction:row; - + .search-box { border: 1px solid @ng2-medium-gray; border-radius: 3px; @@ -102,6 +102,7 @@ .clear-filter{ cursor: pointer; color:#009fdb; + font-family: @font-opensans-medium-italic; text-decoration: underline; padding-right:10px; font-size:12px; diff --git a/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.ts b/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.ts index 3efe866479..30ba6c0755 100644 --- a/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.ts +++ b/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.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========================================================= + */ + import {Component, ViewChild, ElementRef, Renderer, Inject} from "@angular/core"; import { PropertiesService } from "../../services/properties.service"; import { HierarchyNavService } from "../../services/hierarchy-nav.service"; @@ -273,19 +293,21 @@ export class PropertiesAssignmentComponent { console.log("==>" + this.constructor.name + ": declareProperties"); let selectedProperties: InstanceBePropertiesMap = new InstanceBePropertiesMap(); - - let instancesNames = new KeysPipe().transform(this.instanceFePropertiesMap, []); - angular.forEach(instancesNames, (instanceName: string): void => { - selectedProperties[instanceName] = this.propertiesService.getCheckedProperties(this.instanceFePropertiesMap[instanceName]); - //selectedProperties[this.selectedInstanceData.uniqueId] = this.propertiesService.getCheckedProperties(this.properties); + let selectedInputs: InstanceBePropertiesMap = new InstanceBePropertiesMap(); + let instancesIds = new KeysPipe().transform(this.instanceFePropertiesMap, []); + + angular.forEach(instancesIds, (instanceId: string): void => { + let selectedInstanceData: ResourceInstance = this.instances.find(instance => instance.uniqueId == instanceId); + let originType: string = (selectedInstanceData) ? selectedInstanceData.originType : this.selectedInstanceType; + if (!this.isInput(originType)) { + selectedProperties[instanceId] = this.propertiesService.getCheckedProperties(this.instanceFePropertiesMap[instanceId]); + } else { + selectedInputs[instanceId] = this.propertiesService.getCheckedProperties(this.instanceFePropertiesMap[instanceId]); + } }); - let inputsToCreate: InstancePropertiesAPIMap; - if (!this.isInput(this.selectedInstanceType)) { - inputsToCreate = new InstancePropertiesAPIMap(null, selectedProperties); - } else { - inputsToCreate = new InstancePropertiesAPIMap(selectedProperties, null); - } + let inputsToCreate: InstancePropertiesAPIMap = new InstancePropertiesAPIMap(selectedInputs, selectedProperties); + this.componentServiceNg2 .createInput(this.component, inputsToCreate) .subscribe(response => { diff --git a/catalog-ui/src/app/ng2/pages/properties-assignment/properties.utils.ts b/catalog-ui/src/app/ng2/pages/properties-assignment/properties.utils.ts index bd629939be..a3507feb6f 100644 --- a/catalog-ui/src/app/ng2/pages/properties-assignment/properties.utils.ts +++ b/catalog-ui/src/app/ng2/pages/properties-assignment/properties.utils.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========================================================= + */ + import { Injectable } from '@angular/core'; import { DataTypeModel, PropertyFEModel, PropertyBEModel, InstanceBePropertiesMap, InstanceFePropertiesMap, SchemaProperty, DerivedFEProperty, DerivedFEPropertyMap, DerivedPropertyType, InputFEModel} from "app/models"; import { DataTypeService } from "app/ng2/services/data-type.service"; |