aboutsummaryrefslogtreecommitdiffstats
path: root/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/sources-template/sources-template.component.ts
diff options
context:
space:
mode:
authorSwapnali Shadanan Pode <sp00501638@techmahindra.com>2019-03-07 16:11:38 +0530
committerSwapnali Shadanan Pode <sp00501638@techmahindra.com>2019-03-07 16:11:38 +0530
commit7e06008a45d6767919fccdffb6d95e591a78a680 (patch)
treec3fa7196aa8bd1ddaa8bb8f16ae3133e5db54e35 /cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/sources-template/sources-template.component.ts
parent625bf17ee72370d15a90ad94d27ad649d658b96c (diff)
sources template changes
Change-Id: I394dbb4d538d57534b81d5a4884c1681f03d5577 Issue-ID: CCSDK-807 Signed-off-by: sp00501638 <sp00501638@techmahindra.com>
Diffstat (limited to 'cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/sources-template/sources-template.component.ts')
-rw-r--r--cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/sources-template/sources-template.component.ts49
1 files changed, 32 insertions, 17 deletions
diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/sources-template/sources-template.component.ts b/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/sources-template/sources-template.component.ts
index 149008518..8c6d99ca7 100644
--- a/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/sources-template/sources-template.component.ts
+++ b/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/sources-template/sources-template.component.ts
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* ONAP : CDS
* ================================================================================
-* Copyright 2019 TechMahindra
+* Copyright (C) 2019 TechMahindra
*=================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,7 +19,15 @@
*/
import { Component, OnInit } from '@angular/core';
-import {CdkDragDrop, moveItemInArray, transferArrayItem} from '@angular/cdk/drag-drop';
+import { CdkDragDrop, moveItemInArray, transferArrayItem } from '@angular/cdk/drag-drop';
+import { IResources } from 'src/app/common/core/store/models/resources.model';
+import { IResourcesState } from 'src/app/common/core/store/models/resourcesState.model';
+import { Observable } from 'rxjs';
+import { Store } from '@ngrx/store';
+import { IAppState } from '../../../../common/core/store/state/app.state';
+import { A11yModule } from '@angular/cdk/a11y';
+import { LoadResourcesSuccess } from 'src/app/common/core/store/actions/resources.action';
+import { ISourcesData } from 'src/app/common/core/store/models/sourcesData.model';
@Component({
selector: 'app-sources-template',
@@ -27,24 +35,31 @@ import {CdkDragDrop, moveItemInArray, transferArrayItem} from '@angular/cdk/drag
styleUrls: ['./sources-template.component.scss']
})
export class SourcesTemplateComponent implements OnInit {
+ rdState: Observable<IResourcesState>;
+ resources: IResources;
+ todo = [];
+ sources:ISourcesData;
+ sourcesOptions = [];
- constructor() { }
+ constructor(private store: Store<IAppState>) {
+ this.rdState = this.store.select('resources');
+ }
- ngOnInit() {
- }
+ ngOnInit() {
+ this.rdState.subscribe(
+ resourcesdata => {
+ var resourcesState: IResourcesState = { resources: resourcesdata.resources, isLoadSuccess: resourcesdata.isLoadSuccess, isSaveSuccess: resourcesdata.isSaveSuccess, isUpdateSuccess: resourcesdata.isUpdateSuccess };
+ this.sources = resourcesState.resources.sources;
+ for (let key in this.sources) {
+ if (this.sources.hasOwnProperty(key)) {
+ this.sourcesOptions.push(this.sources[key]);
+ }
+ }
+ console.log(this.sourcesOptions);
+ })
+ }
- todo = [
- 'MDSAL'
- ];
-
- done = [
- 'INPUT',
- 'DEFAULT',
- 'DB',
- 'NETBOX'
- ];
-
- drop(event: CdkDragDrop<string[]>) {
+ drop(event: CdkDragDrop<string[]>) {
if (event.previousContainer === event.container) {
moveItemInArray(event.container.data, event.previousIndex, event.currentIndex);
} else {