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=========================================================
20 /// <reference path="../../../../../references"/>
21 module Sdc.ViewModels {
24 interface IDistributionStatusModalViewModelScope {
25 distribution:Models.Distribution;
27 getStatusCount(distributionComponent:Array<Models.DistributionComponent>):any;
28 getUrlName(url:string):string;
29 modalDitributionStatus:ng.ui.bootstrap.IModalServiceInstance;
30 footerButtons: Array<any>;
34 export class DistributionStatusModalViewModel {
36 static '$inject' = ['$scope','$modalInstance', 'data'];
38 constructor(private $scope:IDistributionStatusModalViewModelScope,
39 private $modalInstance:ng.ui.bootstrap.IModalServiceInstance,
45 private initScope = ():void => {
46 this.$scope.distribution = this.data.distribution;
47 this.$scope.status = this.data.status;
48 this.$scope.modalDitributionStatus = this.$modalInstance;
50 this.$scope.getUrlName = (url:string):string =>{
51 let urlName:string = _.last(url.split('/'));
55 this.$scope.close = ():void => {
56 this.$modalInstance.close();
59 this.$scope.footerButtons = [
60 {'name': 'Close', 'css': 'blue', 'callback': this.$scope.close }