refactor(ui): correct modal constructor signatures; avoids minification/mangling breaking everything
MODIFY
manager/ui/war/index.html
manager/ui/war/index.html
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
</head>
<body>
- <div ng-view></div>
+ <div ng-view ng-strict-di="true"></div>
</body>
</html>

MODIFY
manager/ui/war/plugins/api-manager/html/api/api_entity.include
manager/ui/war/plugins/api-manager/html/api/api_entity.include
</button>
<ul class="dropdown-menu" role="menu">
<li ng-repeat="apiVersion in versions">
- <a href="#"
- ng-click="setVersion( apiVersion )">{{ apiVersion.version }}</a>
+ <a ng-click="setVersion( apiVersion )">{{ apiVersion.version }}</a>
</li>
</ul>
</div>
ng-show="showCtxMenu"
style="list-style-type: none; padding-left: 10px; padding-top: 6px;">
<li class="dropdown">
- <a href="#"
- style="text-decoration: none;"
+ <a style="text-decoration: none;"
class="dropdown-toggle dropdown-cog"
data-toggle="dropdown">
<span class="fa fa-cog"></span>
<ul class="dropdown-menu">
<li>
<a class="api-delete"
- href="#"
ng-click="callDelete()"
apiman-i18n-key="delete">Delete API</a>
</li>
</div>
<div class="col-xs-3"
style="padding: 0;">
- <a href="#"
- ng-click="item.done ? return : isCollapsed = !isCollapsed"
+ <a ng-click="item.done ? return : isCollapsed = !isCollapsed"
ng-class="{'invisible-icon': item.done === true}"
title="What is this?">
<i class="fa fa-info-circle"></i>

MODIFY
manager/ui/war/plugins/api-manager/html/client/client_entity.include
manager/ui/war/plugins/api-manager/html/client/client_entity.include
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
- <li ng-repeat="clientVersion in versions"><a href="#" ng-click="setVersion( clientVersion )">{{ clientVersion.version }}</a></li>
+ <li ng-repeat="clientVersion in versions"><a ng-click="setVersion( clientVersion )">{{ clientVersion.version }}</a></li>
</ul>
</div>
<a apiman-permission="clientEdit" href="{{ pluginName }}/orgs/{{ org.id }}/clients/{{ client.id}}/{{ version.version }}/new-version" class="btn btn-primary apiman-entity-action" data-field="toNewClientVersion" apiman-i18n-key="new-version">New Version</a>
<ul class="client-app-menu pull-right"
style="list-style-type: none; padding-left: 10px; padding-top: 6px;">
<li class="dropdown">
- <a href="#"
- style="text-decoration: none;"
+ <a style="text-decoration: none;"
class="dropdown-toggle dropdown-cog"
data-toggle="dropdown">
<span class="fa fa-cog"></span>
<ul class="dropdown-menu">
<li>
<a class="client-app-delete"
- href="#"
ng-click="callDelete()"
apiman-i18n-key="delete-client-app">Delete Client App</a>
</li>

MODIFY
manager/ui/war/plugins/api-manager/html/headers/amg.include
manager/ui/war/plugins/api-manager/html/headers/amg.include
<div class="collapse navbar-collapse navbar-collapse-1">
<ul class="nav navbar-nav navbar-utility">
<li class="dropdown">
- <a href="#"
- class="dropdown-toggle"
+ <a class="dropdown-toggle"
data-toggle="dropdown">
<span class="pficon pficon-user"></span>
{{ username }}&nbsp;<b class="caret"></b>

MODIFY
manager/ui/war/plugins/api-manager/html/org/org_entity.include
manager/ui/war/plugins/api-manager/html/org/org_entity.include
ng-show="showCtxMenu"
style="list-style-type: none;">
<li class="dropdown">
- <a href="#"
+ <a
style="text-decoration: none;"
class="dropdown-toggle dropdown-cog"
data-toggle="dropdown">
<ul class="dropdown-menu">
<li>
<a class="org-delete"
- href="#"
ng-click="callDelete()"
apiman-i18n-key="delete-org">Delete Organization</a>
</li>

MODIFY
manager/ui/war/plugins/api-manager/html/plan/plan_entity.include
manager/ui/war/plugins/api-manager/html/plan/plan_entity.include
Version: {{ version.version }}<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
- <li ng-repeat="planVersion in versions"><a href="#" ng-click="setVersion( planVersion )">{{ planVersion.version }}</a></li>
+ <li ng-repeat="planVersion in versions"><a ng-click="setVersion( planVersion )">{{ planVersion.version }}</a></li>
</ul>
</div>
<a apiman-permission="planEdit" href="{{ pluginName }}/orgs/{{ org.id }}/plans/{{ plan.id }}/{{version.version}}/new-version" class="btn btn-primary apiman-entity-action" data-field="toNewPlanVersion" apiman-i18n-key="new-version">New Version</a>
<!-- Dropdown Cog -->
<ul class="plan-menu pull-right" style="list-style-type: none; padding-left: 10px; padding-top: 6px;" ng-hide="canNotDelete()">
<li class="dropdown">
- <a href="#"
- style="text-decoration: none;"
+ <a style="text-decoration: none;"
class="dropdown-toggle dropdown-cog"
data-toggle="dropdown">
<span class="fa fa-cog"></span>
<ul class="dropdown-menu">
<li>
<a class="plan-delete"
- href="#"
ng-click="callDelete()"
apiman-i18n-key="delete-plan">Delete Plan</a>
</li>

MODIFY
manager/ui/war/plugins/api-manager/ts/client/client-apis.ts
manager/ui/war/plugins/api-manager/ts/client/client-apis.ts
@@ -118,11 +118,10 @@ _module.controller('Apiman.ClientApisController',
});
}]);
+_module.controller('ClientApisModalCtrl',
+ ['$uibModalInstance', '$scope', 'api', 'apiKey',
+ function ($uibModalInstance, $scope, api, apiKey) {
- export var ClientApisModalCtrl = _module.controller('ClientApisModalCtrl', function ($scope,
- $uibModalInstance,
- api, apiKey) {
- $scope.api = api;
$scope.asQueryParam = api.httpEndpoint + '?apikey=' + apiKey;
if (api.httpEndpoint.indexOf('?') > -1) {
$scope.asQueryParam = api.httpEndpoint + '&apikey=' + apiKey;
@@ -159,4 +158,4 @@ _module.controller('Apiman.ClientApisController',
$scope.copyFail = function (err) {
//console.error('Error!', err);
};
- });
+ }]);

MODIFY
manager/ui/war/plugins/api-manager/ts/client/client-overview.ts
manager/ui/war/plugins/api-manager/ts/client/client-overview.ts
import {_module} from "../apimanPlugin";
+import "../directives";
_module.controller("Apiman.ClientOverviewController",
['$q', '$scope', '$location', 'PageLifecycle', 'ClientEntityLoader', '$routeParams', 'Configuration',

MODIFY
manager/ui/war/plugins/api-manager/ts/directives.ts
manager/ui/war/plugins/api-manager/ts/directives.ts
// @ts-nocheck
import {_module} from "./apimanPlugin";
+_module.factory('EntityStatusSvc',
+ ['$rootScope', 'Logger',
+ function($rootScope, Logger) {
+ var entity = null;
+ var entityType = null;
+
+ return {
+ setEntity: function(theEntity, type) {
+ Logger.debug('Setting the entity: {0} type={1}', theEntity, type);
+ entity = theEntity;
+ entityType = type;
+ },
+ getEntity: function() {
+ return entity;
+ },
+ getEntityStatus: function() {
+ if (entity) {
+ return entity.status;
+ }
+ },
+ getEntityType: function() {
+ if (!entity) {
+ Logger.debug('Entity is null!');
+ return 'n/a';
+ }
+ return entityType;
+ },
+ setEntityStatus: function(status) {
+ if (entity) {
+ entity.status = status;
+ }
+ },
+ isEntityDisabled: function() {
+ if (entity) {
+ if (entityType == 'client' || entityType == 'clients') {
+ return entity.status == 'Retired';
+ } else if (entityType == 'api' || entityType == 'apis') {
+ return entity.status == 'Retired';
+ } else {
+ return (entity.status !== 'Created' && entity.status !== 'Ready');
+ }
+ }
+ }
+ };
+ }]);
+
_module.directive('apimanActionBtn',
['Logger', function(Logger) {
return {
@@ -167,52 +213,6 @@ _module.directive('apimanStatus',
};
}]);
-_module.factory('EntityStatusSvc',
- ['$rootScope', 'Logger',
- function($rootScope, Logger) {
- var entity = null;
- var entityType = null;
-
- return {
- setEntity: function(theEntity, type) {
- Logger.debug('Setting the entity: {0} type={1}', theEntity, type);
- entity = theEntity;
- entityType = type;
- },
- getEntity: function() {
- return entity;
- },
- getEntityStatus: function() {
- if (entity) {
- return entity.status;
- }
- },
- getEntityType: function() {
- if (!entity) {
- Logger.debug('Entity is null!');
- return 'n/a';
- }
- return entityType;
- },
- setEntityStatus: function(status) {
- if (entity) {
- entity.status = status;
- }
- },
- isEntityDisabled: function() {
- if (entity) {
- if (entityType == 'client' || entityType == 'clients') {
- return entity.status == 'Retired';
- } else if (entityType == 'api' || entityType == 'apis') {
- return entity.status == 'Retired';
- } else {
- return (entity.status !== 'Created' && entity.status !== 'Ready');
- }
- }
- }
- };
- }]);
-
_module.directive('apimanEntityStatus',
['Logger', 'EntityStatusSvc',
function(Logger, EntityStatusSvc) {

MODIFY
manager/ui/war/plugins/api-manager/ts/modals.ts
manager/ui/war/plugins/api-manager/ts/modals.ts
@@ -122,6 +122,7 @@ _module.factory('Modals',
_module.controller('ModalClientAppDeleteCtrl',
+ ['$location', '$rootScope', '$scope', '$uibModalInstance', 'OrgSvcs', 'Configuration', 'PageLifecycle', 'client', 'params',
function ($location, $rootScope, $scope, $uibModalInstance, OrgSvcs, Configuration, PageLifecycle, client, params) {
$scope.confirmClientName = '';
@@ -165,7 +166,7 @@ _module.controller('ModalClientAppDeleteCtrl',
$scope.no = function () {
$uibModalInstance.dismiss('cancel');
};
- });
+ }]);
_module.controller('ModalSelectApiCtrl',
['$scope', '$uibModalInstance', 'ApimanSvcs', 'Logger', 'OrgSvcs', 'options',

MODIFY
manager/ui/war/plugins/api-manager/ts/org/org-sidebar.ts
manager/ui/war/plugins/api-manager/ts/org/org-sidebar.ts
import {_module} from "../apimanPlugin";
_module.controller("Apiman.OrgSidebarController",
-['Logger', '$uibModal', '$scope', 'OrgSvcs', 'Configuration', function (Logger, $uibModal, $scope, OrgSvcs, Configuration) {
+['Logger', '$uibModal', '$scope', 'OrgSvcs', 'Configuration',
+ function (Logger, $uibModal, $scope, OrgSvcs, Configuration) {
$scope.updateOrgDescription = function(updatedDescription) {
var updateOrganizationBean = {
description: updatedDescription
@@ -47,14 +48,9 @@ _module.controller("Apiman.OrgSidebarController",
};
}]);
-_module.controller('OrgDeleteModalCtrl', function ($location,
- $rootScope,
- $scope,
- $uibModalInstance,
- OrgSvcs,
- Configuration,
- PageLifecycle,
- org) {
+_module.controller('OrgDeleteModalCtrl',
+ ["$location", "$rootScope", "$scope", "$uibModalInstance", "OrgSvcs", "Configuration", "PageLifecycle", "org",
+ function ($location, $rootScope, $scope, $uibModalInstance, OrgSvcs, Configuration, PageLifecycle, org) {
$scope.confirmOrgName = '';
$scope.org = org;
@@ -95,4 +91,4 @@ _module.controller('OrgDeleteModalCtrl', function ($location,
$scope.no = function () {
$uibModalInstance.dismiss('cancel');
};
-});
+ }]);

refactor(ui): correct modal constructor signatures; avoids minification/mangling breaking everything