From ff76b5ed0aa91d5fdf9dc4f95e8b20f91ed9d072 Mon Sep 17 00:00:00 2001 From: "Sonsino, Ofir (os0695)" Date: Tue, 10 Jul 2018 15:57:37 +0300 Subject: New Angular UI from 1806 Change-Id: I39c160db0e0a6ec2e587ccf007ee1b23c6a08666 Issue-ID: VID-208 Signed-off-by: Sonsino, Ofir (os0695) --- .../components/form-async/form-async.component.ts | 80 ++++++++++++++++++++++ .../components/form-async/form-async.style.scss | 15 ++++ .../components/form-async/form-async.template.html | 67 ++++++++++++++++++ 3 files changed, 162 insertions(+) create mode 100644 vid-webpack-master/src/app/components/form-async/form-async.component.ts create mode 100644 vid-webpack-master/src/app/components/form-async/form-async.style.scss create mode 100644 vid-webpack-master/src/app/components/form-async/form-async.template.html (limited to 'vid-webpack-master/src/app/components/form-async') diff --git a/vid-webpack-master/src/app/components/form-async/form-async.component.ts b/vid-webpack-master/src/app/components/form-async/form-async.component.ts new file mode 100644 index 000000000..e71c4446b --- /dev/null +++ b/vid-webpack-master/src/app/components/form-async/form-async.component.ts @@ -0,0 +1,80 @@ +import {Component, Input, OnInit, ViewChild} from '@angular/core'; +import { NgRedux, select } from '@angular-redux/store'; +import { Observable } from "rxjs/Observable"; +import { updateProductFamilies } from "../../service.actions"; +import { AppState } from "../../store/reducers"; +import { + loadProductFamiliesAction, loadLcpTenant, loadAicZones, + loadCategoryParameters +} from '../../services/aaiService/aai.actions'; +import { LcpRegionsAndTenants } from "../../shared/models/lcpRegionsAndTenants"; +import {NgForm} from "@angular/forms"; +import {SelectOption} from "../../shared/models/selectOption"; +import {VNFModel} from "../../shared/models/vnfModel"; + +@Component({ + selector: "formasync", + templateUrl: "form-async.template.html", + styleUrls: ["form-async.style.scss"], + +}) + +export class formasync implements OnInit { + + constructor(private store: NgRedux) { } + + @ViewChild('form') form: NgForm; + + @Input() + set model(model: VNFModel) { + if (model) { + this.isUserProvidedNaming = model.isUserProvidedNaming; + } + }; + + @select(['service', 'productFamilies']) + readonly productFamilies: Observable; + + @select(['service', 'lcpRegionsAndTenants']) + readonly lcpRegionsAndTenants: Observable; + + @select(['service', 'lcpRegionsAndTenants', 'lcpRegionList']) + readonly lcpRegions: Observable; + + @select(['service', 'aicZones']) + readonly aicZones: Observable; + + @select(['service', 'categoryParameters', 'platformList']) + readonly platformList: Observable; + + @select(['service', 'categoryParameters', 'lineOfBusinessList']) + readonly lineOfBusinessList: Observable; + + rollbackOnFailure = [ + new SelectOption({id: 'true', name: 'Rollback'}), + new SelectOption({id: 'false', name: 'Don\'t Rollback'}) + ]; + tenants = []; + + serviceInstance: any = { + rollback:'true' + }; + + isUserProvidedNaming: boolean = false; + + onLcpSelect(newValue: string) { + let value: LcpRegionsAndTenants = undefined; + this.lcpRegionsAndTenants.subscribe(data => value = data); + this.tenants = value.lcpRegionsTenantsMap[newValue]; + } + + ngOnInit() { + this.store.dispatch(loadProductFamiliesAction()); + this.store.dispatch(loadLcpTenant()); + this.store.dispatch(loadAicZones()); + this.store.dispatch(loadCategoryParameters()); + } +} + + + diff --git a/vid-webpack-master/src/app/components/form-async/form-async.style.scss b/vid-webpack-master/src/app/components/form-async/form-async.style.scss new file mode 100644 index 000000000..e6c89bcae --- /dev/null +++ b/vid-webpack-master/src/app/components/form-async/form-async.style.scss @@ -0,0 +1,15 @@ +.form-wrapper{ + width:640px; + padding-left: 50px; + padding-top: 50px; + .details-item{ + padding-bottom: 30px; + } + .details-item { + select { + font-family: OpenSans-Italic; + font-size: 14px; + color: #959595 !important; + } + } +} diff --git a/vid-webpack-master/src/app/components/form-async/form-async.template.html b/vid-webpack-master/src/app/components/form-async/form-async.template.html new file mode 100644 index 000000000..c63a7bee6 --- /dev/null +++ b/vid-webpack-master/src/app/components/form-async/form-async.template.html @@ -0,0 +1,67 @@ +
+
+
+ + +
+ +
+ + +
+ +
+ + +
+
+ + +
+ +
+ + +
+
+ + +
+ +
+ + +
+
+ + +
+
+ +
+ -- cgit 1.2.3-korg