diff options
Diffstat (limited to 'catalog-ui/src/app/ng2/components/dynamic-element/dynamic-element.component.ts')
-rw-r--r-- | catalog-ui/src/app/ng2/components/dynamic-element/dynamic-element.component.ts | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/catalog-ui/src/app/ng2/components/dynamic-element/dynamic-element.component.ts b/catalog-ui/src/app/ng2/components/dynamic-element/dynamic-element.component.ts index 84ac46c4cf..246258e44f 100644 --- a/catalog-ui/src/app/ng2/components/dynamic-element/dynamic-element.component.ts +++ b/catalog-ui/src/app/ng2/components/dynamic-element/dynamic-element.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, Compiler, EventEmitter, ViewContainerRef, ViewChild, Input, Output, ElementRef, ComponentRef, ComponentFactory, ComponentFactoryResolver } from '@angular/core' import { UiElementCheckBoxComponent } from './elements-ui/checkbox/ui-element-checkbox.component'; import { UiElementDropDownComponent, DropdownValue } from './elements-ui/dropdown/ui-element-dropdown.component'; @@ -24,6 +44,7 @@ export class DynamicElementComponent { @Input() type: any; @Input() name: string; @Input() readonly:boolean; + @Input() path:string;//optional param. used only for for subnetpoolid type value:any; // Two way binding for value (need to write the "Change" word like this) @@ -58,7 +79,11 @@ export class DynamicElementComponent { this.cmpRef.instance.pattern = this.validation.validationPatterns.integer; break; case 'string': - if (this.name.toUpperCase().indexOf("SUBNETPOOLID") !== -1) { + if (this.path && this.path.toUpperCase().indexOf("SUBNETPOOLID") !== -1) { + if(this.name.toUpperCase().indexOf("SUBNETPOOLID") == -1){//if it's an item of subnetpoolid list get the parent name + let pathArray = this.path.split("#"); + this.name = pathArray[pathArray.length - 2]; + } this.createComponent(UiElementPopoverInputComponent); } else { |