| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 1 | /* |
| 2 | Copyright 2020 TATA ELXSI |
| 3 | |
| 4 | Licensed under the Apache License, Version 2.0 (the 'License'); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | |
| 16 | Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.in), BARATH KUMAR R (barath.r@tataelxsi.co.in) |
| 17 | */ |
| 18 | /** |
| 19 | * @file VNF-instancesAction Component |
| 20 | */ |
| 21 | import { Component, Injector } from '@angular/core'; |
| 22 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; |
| 23 | import { ShowInfoComponent } from 'ShowInfoComponent'; |
| 24 | import { VNFInstanceData } from 'VNFInstanceModel'; |
| 25 | /** |
| 26 | * Creating component |
| 27 | * @Component takes VNFInstancesActionComponent.html as template url |
| 28 | */ |
| 29 | @Component({ |
| 30 | templateUrl: './VNFInstancesActionComponent.html', |
| 31 | styleUrls: ['./VNFInstancesActionComponent.scss'] |
| 32 | }) |
| 33 | /** Exporting a class @exports VNFInstancesActionComponent */ |
| 34 | export class VNFInstancesActionComponent { |
| 35 | /** To get the value from the vnfpackage via valuePrepareFunction default Property of ng-smarttable @public */ |
| 36 | public value: VNFInstanceData; |
| 37 | |
| 38 | /** Invoke service injectors @public */ |
| 39 | public injector: Injector; |
| 40 | |
| 41 | /** Instance of the modal service @private */ |
| 42 | private modalService: NgbModal; |
| 43 | |
| 44 | /** Contains instance ID @private */ |
| 45 | private instanceID: string; |
| 46 | |
| 47 | constructor(injector: Injector) { |
| 48 | this.injector = injector; |
| 49 | this.modalService = this.injector.get(NgbModal); |
| 50 | } |
| 51 | |
| 52 | /** |
| 53 | * Lifecyle Hooks the trigger before component is instantiate |
| 54 | */ |
| 55 | public ngOnInit(): void { |
| 56 | this.instanceID = this.value.identifier; |
| 57 | } |
| 58 | |
| 59 | /** Shows information using modalservice @public */ |
| 60 | public infoVNF(): void { |
| SANDHYA.JS | 0a34dfa | 2023-04-25 23:59:41 +0530 | [diff] [blame^] | 61 | // eslint-disable-next-line security/detect-non-literal-fs-filename |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 62 | this.modalService.open(ShowInfoComponent, { backdrop: 'static' }).componentInstance.params = { |
| 63 | id: this.instanceID, |
| 64 | page: 'vnf-instance', |
| 65 | titleName: 'INSTANCEDETAILS' |
| 66 | }; |
| 67 | } |
| 68 | } |