2 Copyright 2020 TATA ELXSI
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
8 http://www.apache.org/licenses/LICENSE-2.0
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.
16 Author: BARATH KUMAR R (barath.r@tataelxsi.co.in)
20 * @file Page for Operational View App actions Component
22 import { Component, Injector, Input, OnInit } from '@angular/core';
23 import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
24 import { URLPARAMS } from 'CommonModel';
25 import { isNullOrUndefined } from 'util';
28 * @Component takes OperationalViewAppActionsComponent.html as template url
31 selector: 'app-operational-view-app-actions',
32 templateUrl: './OperationalViewAppActionsComponent.html'
34 /** Exporting a class @exports OperationalViewAppActionsComponent */
35 export class OperationalViewAppActionsComponent implements OnInit {
36 /** Invoke service injectors @public */
37 public injector: Injector;
39 /** Get the actions data @public */
40 public actionsData: {}[];
42 /** Instance for active modal service @public */
43 public activeModal: NgbActiveModal;
45 /** Input contains component objects @private */
46 @Input() private params: URLPARAMS;
48 /** creates Operational view app actions component */
49 constructor(injector: Injector) {
50 this.injector = injector;
51 this.activeModal = this.injector.get(NgbActiveModal);
55 * Lifecyle Hooks the trigger before component is instantiate
57 public ngOnInit(): void {
58 this.actionsData = [];
59 if (!isNullOrUndefined(this.params.actions)) {
60 this.actionsData = Object.keys(this.params.actions).map((key: string): Object => (
63 description: this.params.actions[key]