maestrano/mno-enterprise-angular

View on GitHub
src/app/components/mno-app-install-btn/mno-app-install-btn.html

Summary

Maintainability
Test Coverage
<div class="btn-fluid-wrapper" ng-switch on="$ctrl.appInstallationStatus()">
  <div ng-switch-when="CONFLICT" class="message">
    <i class="fa fa-exclamation-triangle"></i>
    {{ 'mno_enterprise.templates.components.app_install_btn.conflicting_app' | translate }}
    <a ui-sref="home.marketplace.app({appId: $ctrl.conflictingApp.id})" ng-disabled="!$ctrl.canProvisionApp">{{$ctrl.conflictingApp.name}}</a>
  </div>
  <a ng-switch-when="INSTALLABLE" ng-click="!$ctrl.canProvisionApp || $ctrl.provisionApp()" ng-class="{disabled: $ctrl.isLoadingButton || !$ctrl.canProvisionApp}" class="btn btn-warning btn-promo btn-lg"
    uib-tooltip="{{$ctrl.canProvisionApp? '' : 'mno_enterprise.templates.components.app_install_btn.insufficient_privilege' | translate}}">
    <span ng-show="$ctrl.isLoadingButton"><i class="fa fa-spinner fa-pulse"></i></span>
    {{ 'mno_enterprise.templates.components.app_install_btn.start_app' | translate }}
  </a>
  <a ng-switch-when="INSTALLED_LAUNCH" ng-click="!$ctrl.canProvisionApp || $ctrl.launchAppInstance()" ng-class="{disabled: !$ctrl.canProvisionApp}" class="btn btn-warning btn-promo btn-lg"
     uib-tooltip="{{$ctrl.canProvisionApp? '' : 'mno_enterprise.templates.components.app_install_btn.insufficient_privilege' | translate}}">
    {{ 'mno_enterprise.templates.components.app_install_btn.launch_app' | translate }}
  </a>
  <a ng-switch-when="INSTALLED_CONNECT" ng-click="!$ctrl.canProvisionApp || $ctrl.connectAppInstance()" ng-class="{disabled: !$ctrl.canProvisionApp}" class="btn btn-warning btn-promo btn-lg"
     uib-tooltip="{{$ctrl.canProvisionApp? '' : 'mno_enterprise.templates.components.app_install_btn.insufficient_privilege' | translate}}">
    {{ 'mno_enterprise.templates.components.app_install_btn.connect_app' | translate }}
  </a>
</div>