From 9b2ceb347a3371819fcad6bbe2268203afecaf4e Mon Sep 17 00:00:00 2001 From: "Stone, Avi (as206k)" Date: Thu, 12 Apr 2018 16:36:39 +0300 Subject: DCAE-D fe initial commit DCAE-D fe initial commit Change-Id: Ica8ccb7c7ef769c969664d1e168d205eb9fc67f2 Issue-ID: SDC-1218 Signed-off-by: Stone, Avi (as206k) --- public/src/app/bar-icons/bar-icons.component.ts | 47 +++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 public/src/app/bar-icons/bar-icons.component.ts (limited to 'public/src/app/bar-icons/bar-icons.component.ts') diff --git a/public/src/app/bar-icons/bar-icons.component.ts b/public/src/app/bar-icons/bar-icons.component.ts new file mode 100644 index 0000000..adf4b88 --- /dev/null +++ b/public/src/app/bar-icons/bar-icons.component.ts @@ -0,0 +1,47 @@ +import { Component, Input, ViewChild } from '@angular/core'; +import { Store } from '../store/store'; +import { includes } from 'lodash'; +import { NgForm } from '@angular/forms'; + +@Component({ + selector: 'app-bar-icons', + templateUrl: './bar-icons.component.html', + styleUrls: ['./bar-icons.component.scss'] +}) +export class BarIconsComponent { + configuration; + @Input() tabName: string; + @ViewChild('cdumpConfForm') cdumpConfForm: NgForm; + + constructor(public store: Store) {} + + onChange(e) { + this.store.cdumpIsDirty = true; + } + + isPropertyDdl(property) { + if (property.hasOwnProperty('constraints')) { + if ( + includes( + property.constraints[0].valid_values, + property.assignment.value + ) + ) { + return true; + } else { + return false; + } + } else { + return false; + } + } + + genrateBarTestId() { + return `${this.tabName}-bar-icon-container`; + } + + enableSetting() { + this.store.expandAdvancedSetting[this.store.tabIndex] = !this.store + .expandAdvancedSetting[this.store.tabIndex]; + } +} -- cgit 1.2.3-korg