aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/ng2/components/properties-table/list-property
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-ui/src/app/ng2/components/properties-table/list-property')
-rw-r--r--catalog-ui/src/app/ng2/components/properties-table/list-property/list-property.component.html33
-rw-r--r--catalog-ui/src/app/ng2/components/properties-table/list-property/list-property.component.less3
-rw-r--r--catalog-ui/src/app/ng2/components/properties-table/list-property/list-property.component.ts85
3 files changed, 0 insertions, 121 deletions
diff --git a/catalog-ui/src/app/ng2/components/properties-table/list-property/list-property.component.html b/catalog-ui/src/app/ng2/components/properties-table/list-property/list-property.component.html
deleted file mode 100644
index a251d33649..0000000000
--- a/catalog-ui/src/app/ng2/components/properties-table/list-property/list-property.component.html
+++ /dev/null
@@ -1,33 +0,0 @@
-<div class="add-data-row">
- <div class="sprite-new add-item-icon" (click)="addListItem()"></div>
-</div>
-<div *ngIf="property.schema.property.isSimpleType && property.valueObjectRef && property.valueObjectRef.length">
- <!--the ngFor runs on dummy array in the list array length and not on list array in order to prevent from page do the ngFor again when user changes an item-->
- <div class="simple-list-item" *ngFor="let item of getNumber(property.valueObjectRef); let i = index">
- <input class="value-input" [(ngModel)]="property.valueObjectRef[i]"
- type="property.schema.property.derivedFromSimpleTypeName || property.schema.property.type"
- (change)="propValueChanged()"/>
- <span class="delete-span sprite-new delete-item-icon" (click)="deleteListItem(i)"></span>
- </div>
-</div>
-<div class="test" *ngIf="property.schema.property.isDataType && property.childrenProperties && property.childrenProperties.length">
- <template ngFor let-item [ngForOf]="property.childrenProperties" let-i="index">
- <div class="table-inner-row" (click)="onChildPropertySelected(item)" [ngClass]="{'selected': selectedPropertyId === item.treeNodeId}">
- <div class="table-cell">{{item.name}}</div>
- <div class="table-cell">
- <span class="delete-span sprite-new delete-item-icon" (click)="deleteListItem(i)"></span>
- <span (click)="property.updateExpandedChildPropertyId(item.treeNodeId)">V</span>
- </div>
- </div>
- <div class="table-inner-row" *ngIf="property.expandedChildPropertyId == item.treeNodeId">
- <div class="inner-table-container">
- <properties-value-inner-table [property]="item"
- (selectChildProperty)="onChildPropertySelected($event)"
- [selectedPropertyId]="selectedPropertyId"
- [propertyNameSearchText]="propertyNameSearchText"
- (valueChanged)="propValueChanged()"></properties-value-inner-table>
- </div>
- </div>
- </template>
-
-</div>
diff --git a/catalog-ui/src/app/ng2/components/properties-table/list-property/list-property.component.less b/catalog-ui/src/app/ng2/components/properties-table/list-property/list-property.component.less
deleted file mode 100644
index 7c4d90a38d..0000000000
--- a/catalog-ui/src/app/ng2/components/properties-table/list-property/list-property.component.less
+++ /dev/null
@@ -1,3 +0,0 @@
-.simple-list-item{
- position: relative;
-}
diff --git a/catalog-ui/src/app/ng2/components/properties-table/list-property/list-property.component.ts b/catalog-ui/src/app/ng2/components/properties-table/list-property/list-property.component.ts
deleted file mode 100644
index 96f8c680a2..0000000000
--- a/catalog-ui/src/app/ng2/components/properties-table/list-property/list-property.component.ts
+++ /dev/null
@@ -1,85 +0,0 @@
-/**
- * Created by rc2122 on 4/23/2017.
- */
-import {Component, Input, Output, EventEmitter} from "@angular/core";
-import { PropertyFEModel} from "app/models";
-import {PropertiesService} from "app/ng2/services/properties.service";
-import { ContentAfterLastDotPipe } from "app/ng2/pipes/contentAfterLastDot.pipe";
-import {UUID} from "angular2-uuid";
-import {ComponentType} from "app/utils";
-
-@Component({
- selector: 'list-property',
- templateUrl: './list-property.component.html',
- styleUrls: ['../properties-value-inner-table/properties-value-inner-table.component.less', './list-property.component.less']
-})
-export class ListPropertyComponent {
-
- @Input() property: PropertyFEModel;
- @Input() selectedPropertyId: string;
- @Input() propertyNameSearchText:string;
-
- @Output() valueChanged: EventEmitter<any> = new EventEmitter<any>();
- @Output() selectChildProperty: EventEmitter<any> = new EventEmitter<PropertyFEModel>();
-
- constructor ( private propertiesService:PropertiesService, private contentAfterLastDotPipe:ContentAfterLastDotPipe ){
- }
-
- propValueChanged = () => {
- this.valueChanged.emit(this.property);
- };
-
- onChildPropertySelected = (property) => {
- this.selectChildProperty.emit(property);
- };
-
- getNumber = (valueObjectRef: any): Array<any> => {
- let num: number = (valueObjectRef) ? valueObjectRef.length : 0;
- return new Array(num);
- }
-
- createNewChildProperty = ():void => {
- let newProperty: PropertyFEModel = new PropertyFEModel(this.contentAfterLastDotPipe.transform(this.property.schema.property.type),
- this.property.schema.property.type,
- UUID.UUID(),
- this.property,
- this.property.valueObjectRef[this.property.childrenProperties.length]
- );
- this.propertiesService.createPropertiesTreeForProp(newProperty);
- this.property.childrenProperties.push(newProperty);
- }
-
- addListItem = ():void => {
- this.property.valueObjectRef = this.property.valueObjectRef || [];
- this.property.childrenProperties = this.property.childrenProperties || [];
- if (this.property.schema.property.isSimpleType){
- if( this.property.valueObjectRef.indexOf("") == -1 ) {//prevent insert multiple empty simple type items to list
- this.property.valueObjectRef.push("");
- }
- }else{
- this.property.valueObjectRef[this.property.childrenProperties.length] = {};
- this.property.childrenProperties = this.property.childrenProperties || [];
- this.createNewChildProperty();
- this.valueChanged.emit(this.property);
- }
- }
-
- deleteListItem = (indexInList:number):void => {
- this.property.valueObjectRef.splice(indexInList, 1);
- if(this.property.childrenProperties){
- this.property.childrenProperties.splice(indexInList, 1);
- }
- if (!this.property.valueObjectRef.length) {//only when user removes all items from list - put the default
- if ( this.property.defaultValue ) {
- angular.copy(JSON.parse(this.property.defaultValue), this.property.valueObjectRef);
- if (this.property.schema.property.isDataType){
- _.forEach(this.property.valueObjectRef, () => {
- this.createNewChildProperty();
- });
- }
- }
- }
- this.valueChanged.emit(this.property);
- }
-
-}