diff options
author | Swapnali Shadanan Pode <sp00501638@techmahindra.com> | 2019-02-20 16:19:26 +0530 |
---|---|---|
committer | Swapnali Shadanan Pode <sp00501638@techmahindra.com> | 2019-02-20 16:19:26 +0530 |
commit | 91042eec68393f5e23c764768460045b3cd45b49 (patch) | |
tree | 30db6ee4608aef2f9871423d98d77a70f52fa246 /cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/sources-template/sources-template.component.ts | |
parent | 9b666f1d50336a7acebca3644cdff7cc23985948 (diff) |
Adding new component sources-template
Change-Id: Id522f18c36b8c91f46837559ecbbcab27ad76152
Issue-ID: CCSDK-804
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.ts | 57 |
1 files changed, 57 insertions, 0 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 new file mode 100644 index 000000000..149008518 --- /dev/null +++ b/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/sources-template/sources-template.component.ts @@ -0,0 +1,57 @@ +/* +* ============LICENSE_START======================================================= +* ONAP : CDS +* ================================================================================ +* Copyright 2019 TechMahindra +*================================================================================= +* 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, OnInit } from '@angular/core'; +import {CdkDragDrop, moveItemInArray, transferArrayItem} from '@angular/cdk/drag-drop'; + +@Component({ + selector: 'app-sources-template', + templateUrl: './sources-template.component.html', + styleUrls: ['./sources-template.component.scss'] +}) +export class SourcesTemplateComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + + todo = [ + 'MDSAL' + ]; + + done = [ + 'INPUT', + 'DEFAULT', + 'DB', + 'NETBOX' + ]; + + drop(event: CdkDragDrop<string[]>) { + if (event.previousContainer === event.container) { + moveItemInArray(event.container.data, event.previousIndex, event.currentIndex); + } else { + transferArrayItem(event.previousContainer.data, + event.container.data, + event.previousIndex, + event.currentIndex); + } + } +} |