fix: refresh re-register / re-publish button after changes
MODIFY
manager/ui/war/plugins/api-manager/ts/api/api-def.ts
manager/ui/war/plugins/api-manager/ts/api/api-def.ts
@@ -12,7 +12,7 @@ module Apiman {
$scope.version = params.version;
$scope.showMetrics = Configuration.ui.metrics;
$scope.textAreaHeight = '100';
-
+ $scope.isEntityDisabled = EntityStatusSvc.isEntityDisabled;
$scope.typeOptions = [
{ "label" : "No API Definition", "value" : "None" },
{ "label" : "Swagger (JSON)", "value" : "SwaggerJSON" },
@@ -27,10 +27,14 @@ module Apiman {
}
});
};
-
selectType('None');
- $scope.isEntityDisabled = EntityStatusSvc.isEntityDisabled;
+ $scope.finishModification = function () {
+ $rootScope.isDirty = false;
+ $scope.saveButton.state = 'complete';
+ EntityStatusSvc.getEntity().modifiedOn = Date.now();
+ EntityStatusSvc.getEntity().modifiedBy = CurrentUser.getCurrentUser();
+ };
$scope.saveApi = function() {
console.log('$scope.selectedDefinitionType.value: ' + $scope.selectedDefinitionType.value);
@@ -38,11 +42,10 @@ module Apiman {
ApiDefinitionSvcs.updateApiDefinition(params.org, params.api, params.version,
$scope.updatedApiDefinition, $scope.selectedDefinitionType.value,
- function(definition) {
+ function() {
Logger.debug("Updated the api definition!");
$scope.apiDefinition = $scope.updatedApiDefinition;
- $rootScope.isDirty = false;
- $scope.saveButton.state = 'complete';
+ $scope.finishModification();
},
function(error) {
Logger.error("Error updating definition: {0}", error);
@@ -151,8 +154,7 @@ module Apiman {
function() {
Logger.debug("Updated the api definition!");
loadDefinition();
- $rootScope.isDirty = false;
- $scope.saveButton.state = 'complete';
+ $scope.finishModification();
},
function(error) {
Logger.error("Error updating definition: {0}", error);

MODIFY
manager/ui/war/plugins/api-manager/ts/api/api-policies.ts
manager/ui/war/plugins/api-manager/ts/api/api-policies.ts
@@ -68,8 +68,10 @@ module Apiman {
version: params.version,
policiesOrActivity: 'policies',
policyId: policy.id
- }, function(reply) {
+ }, function() {
removePolicy(policy);
+ EntityStatusSvc.getEntity().modifiedOn = Date.now();
+ EntityStatusSvc.getEntity().modifiedBy = CurrentUser.getCurrentUser();
}, PageLifecycle.handleError);
}, function () {
//console.log('Modal dismissed at: ' + new Date());

MODIFY
manager/ui/war/plugins/api-manager/ts/client/client-policies.ts
manager/ui/war/plugins/api-manager/ts/client/client-policies.ts
@@ -55,8 +55,18 @@ module Apiman {
});
modalInstance.result.then(function () {
- OrgSvcs.delete({ organizationId: params.org, entityType: 'clients', entityId: params.client, versionsOrActivity: 'versions', version: params.version, policiesOrActivity: 'policies', policyId: policy.id }, function(reply) {
+ OrgSvcs.delete({
+ organizationId: params.org,
+ entityType: 'clients',
+ entityId: params.client,
+ versionsOrActivity: 'versions',
+ version: params.version,
+ policiesOrActivity: 'policies',
+ policyId: policy.id
+ }, function() {
removePolicy(policy);
+ EntityStatusSvc.getEntity().modifiedOn = Date.now();
+ EntityStatusSvc.getEntity().modifiedBy = CurrentUser.getCurrentUser();
}, PageLifecycle.handleError);
}, function () {
//console.log('Modal dismissed at: ' + new Date());

fix: refresh re-register / re-publish button after changes (#1076)

Co-authored-by: BaGe <a9311c106335b4184e37fdbfcd5c512d>
Co-authored-by: Florian Volk <florian.volk@scheer-group.com>