2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 import * as _ from "lodash";
22 import { Component, Inject, Input, Output, EventEmitter, SimpleChanges, OnChanges } from "@angular/core";
23 import { TranslateService } from './../../../../../shared/translator/translate.service';
24 import { Component as TopologyTemplate, ComponentInstance, IAppMenu } from "app/models";
25 import { GroupsService } from '../../../../../services/groups.service';
26 import { GroupInstance } from "app/models/graph/zones/group-instance";
29 selector: 'group-tabs',
30 templateUrl: './group-tabs.component.html'
32 export class GroupTabsComponent implements OnChanges {
34 @Input() topologyTemplate:TopologyTemplate;
35 @Input() selectedZoneInstanceType:string;
36 @Input() selectedZoneInstanceId:string;
37 @Input() isViewOnly: boolean;
38 @Output() isLoading: EventEmitter<boolean> = new EventEmitter<boolean>();
40 private group:GroupInstance;
42 constructor(private translateService:TranslateService,
43 private groupsService:GroupsService
47 ngOnChanges(changes: SimpleChanges): void {
51 private initGroup = ():void => {
52 this.isLoading.emit(true);
53 this.groupsService.getSpecificGroup(this.topologyTemplate.componentType, this.topologyTemplate.uniqueId, this.selectedZoneInstanceId).subscribe(
56 console.log(JSON.stringify(group));
58 error => console.log("Error getting group!"),
59 () => this.isLoading.emit(false)
63 private setIsLoading = (value) :void => {
64 this.isLoading.emit(value);