Browse Source
Merge pull request #14547 from abpframework/fix-featuremanagement-delete
Change ResetToDefaultAsync to DeleteAsync
pull/14553/head
malik masis
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with
18 additions and
18 deletions
-
modules/feature-management/src/Volo.Abp.FeatureManagement.Application.Contracts/Volo/Abp/FeatureManagement/IFeatureAppService.cs
-
modules/feature-management/src/Volo.Abp.FeatureManagement.Application/Volo/Abp/FeatureManagement/FeatureAppService.cs
-
modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor/Components/FeatureManagementModal.razor
-
modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor/Components/FeatureManagementModal.razor.cs
-
modules/feature-management/src/Volo.Abp.FeatureManagement.HttpApi.Client/ClientProxies/FeaturesClientProxy.Generated.cs
-
modules/feature-management/src/Volo.Abp.FeatureManagement.HttpApi.Client/ClientProxies/featureManagement-generate-proxy.json
-
modules/feature-management/src/Volo.Abp.FeatureManagement.HttpApi/Volo/Abp/FeatureManagement/FeaturesController.cs
-
modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/feature-management-modal.js
-
modules/feature-management/src/Volo.Abp.FeatureManagement.Web/wwwroot/client-proxies/featureManagement-proxy.js
-
modules/feature-management/test/Volo.Abp.FeatureManagement.Application.Tests/Volo/Abp/FeatureManagement/FeatureAppService_Tests.cs
|
|
@ -10,5 +10,5 @@ public interface IFeatureAppService : IApplicationService |
|
|
|
|
|
|
|
|
Task UpdateAsync([NotNull] string providerName, string providerKey, UpdateFeaturesDto input); |
|
|
Task UpdateAsync([NotNull] string providerName, string providerKey, UpdateFeaturesDto input); |
|
|
|
|
|
|
|
|
Task ResetToDefaultAsync([NotNull] string providerName, string providerKey); |
|
|
Task DeleteAsync([NotNull] string providerName, string providerKey); |
|
|
} |
|
|
} |
|
|
|
|
|
@ -138,7 +138,7 @@ public class FeatureAppService : FeatureManagementAppServiceBase, IFeatureAppSer |
|
|
await AuthorizationService.CheckAsync(policyName); |
|
|
await AuthorizationService.CheckAsync(policyName); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public virtual async Task ResetToDefaultAsync([NotNull] string providerName, string providerKey) |
|
|
public virtual async Task DeleteAsync([NotNull] string providerName, string providerKey) |
|
|
{ |
|
|
{ |
|
|
await FeatureValueRepository.DeleteAsync(providerName, providerKey); |
|
|
await FeatureValueRepository.DeleteAsync(providerName, providerKey); |
|
|
} |
|
|
} |
|
|
|
|
|
@ -97,7 +97,7 @@ |
|
|
} |
|
|
} |
|
|
</ModalBody> |
|
|
</ModalBody> |
|
|
<ModalFooter> |
|
|
<ModalFooter> |
|
|
<Button Color="Color.Primary" Clicked="@(async () => await ResetToDefaultAsync(ProviderName,ProviderKey))">@L["ResetToDefault"]</Button> |
|
|
<Button Color="Color.Primary" Clicked="@(async () => await DeleteAsync(ProviderName,ProviderKey))">@L["ResetToDefault"]</Button> |
|
|
<Button Color="Color.Secondary" Clicked="CloseModal">@L["Cancel"]</Button> |
|
|
<Button Color="Color.Secondary" Clicked="CloseModal">@L["Cancel"]</Button> |
|
|
<Button Color="Color.Primary" Clicked="SaveAsync">@L["Save"]</Button> |
|
|
<Button Color="Color.Primary" Clicked="SaveAsync">@L["Save"]</Button> |
|
|
</ModalFooter> |
|
|
</ModalFooter> |
|
|
|
|
|
@ -114,13 +114,13 @@ public partial class FeatureManagementModal |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public virtual async Task ResetToDefaultAsync([NotNull] string providerName, string providerKey = null) |
|
|
public virtual async Task DeleteAsync([NotNull] string providerName, string providerKey = null) |
|
|
{ |
|
|
{ |
|
|
if (!await Message.Confirm(L["AreYouSureToResetToDefault"])) |
|
|
if (!await Message.Confirm(L["AreYouSureToResetToDefault"])) |
|
|
{ |
|
|
{ |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
await FeatureAppService.ResetToDefaultAsync(ProviderName, ProviderKey); |
|
|
await FeatureAppService.DeleteAsync(ProviderName, ProviderKey); |
|
|
await Message.Success(L["ResetedToDefault"]); |
|
|
await Message.Success(L["ResetedToDefault"]); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -34,9 +34,9 @@ public partial class FeaturesClientProxy : ClientProxyBase<IFeatureAppService>, |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public virtual async Task ResetToDefaultAsync(string providerName, string providerKey) |
|
|
public virtual async Task DeleteAsync(string providerName, string providerKey) |
|
|
{ |
|
|
{ |
|
|
await RequestAsync(nameof(ResetToDefaultAsync), new ClientProxyRequestTypeValue |
|
|
await RequestAsync(nameof(DeleteAsync), new ClientProxyRequestTypeValue |
|
|
{ |
|
|
{ |
|
|
{ typeof(string), providerName }, |
|
|
{ typeof(string), providerName }, |
|
|
{ typeof(string), providerKey } |
|
|
{ typeof(string), providerKey } |
|
|
|
|
|
@ -150,10 +150,10 @@ |
|
|
"allowAnonymous": null, |
|
|
"allowAnonymous": null, |
|
|
"implementFrom": "Volo.Abp.FeatureManagement.IFeatureAppService" |
|
|
"implementFrom": "Volo.Abp.FeatureManagement.IFeatureAppService" |
|
|
}, |
|
|
}, |
|
|
"ResetToDefaultAsyncByProviderNameAndProviderKey": { |
|
|
"DeleteAsyncByProviderNameAndProviderKey": { |
|
|
"uniqueName": "ResetToDefaultAsyncByProviderNameAndProviderKey", |
|
|
"uniqueName": "DeleteAsyncByProviderNameAndProviderKey", |
|
|
"name": "ResetToDefaultAsync", |
|
|
"name": "DeleteAsync", |
|
|
"httpMethod": null, |
|
|
"httpMethod": "DELETE", |
|
|
"url": "api/feature-management/features", |
|
|
"url": "api/feature-management/features", |
|
|
"supportedVersions": [], |
|
|
"supportedVersions": [], |
|
|
"parametersOnMethod": [ |
|
|
"parametersOnMethod": [ |
|
|
|
|
|
@ -28,9 +28,9 @@ public class FeaturesController : AbpControllerBase, IFeatureAppService |
|
|
return FeatureAppService.UpdateAsync(providerName, providerKey, input); |
|
|
return FeatureAppService.UpdateAsync(providerName, providerKey, input); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
[HttpPost] |
|
|
[HttpDelete] |
|
|
public Task ResetToDefaultAsync(string providerName, string providerKey) |
|
|
public virtual Task DeleteAsync(string providerName, string providerKey) |
|
|
{ |
|
|
{ |
|
|
return FeatureAppService.ResetToDefaultAsync(providerName, providerKey); |
|
|
return FeatureAppService.DeleteAsync(providerName, providerKey); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
@ -13,7 +13,7 @@ var abp = abp || {}; |
|
|
if (confirmed) { |
|
|
if (confirmed) { |
|
|
let providerName = $('#ProviderName').val(); |
|
|
let providerName = $('#ProviderName').val(); |
|
|
let prodiverKey = $('#ProviderKey').val(); |
|
|
let prodiverKey = $('#ProviderKey').val(); |
|
|
volo.abp.featureManagement.features.resetToDefault(providerName, prodiverKey).then(function () { |
|
|
volo.abp.featureManagement.features.delete(providerName, prodiverKey).then(function () { |
|
|
abp.notify.success(l('ResetedToDefault')); |
|
|
abp.notify.success(l('ResetedToDefault')); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
@ -27,10 +27,10 @@ |
|
|
}, ajaxParams)); |
|
|
}, ajaxParams)); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
volo.abp.featureManagement.features.resetToDefault = function(providerName, providerKey, ajaxParams) { |
|
|
volo.abp.featureManagement.features['delete'] = function(providerName, providerKey, ajaxParams) { |
|
|
return abp.ajax($.extend(true, { |
|
|
return abp.ajax($.extend(true, { |
|
|
url: abp.appPath + 'api/feature-management/features' + abp.utils.buildQueryString([{ name: 'providerName', value: providerName }, { name: 'providerKey', value: providerKey }]) + '', |
|
|
url: abp.appPath + 'api/feature-management/features' + abp.utils.buildQueryString([{ name: 'providerName', value: providerName }, { name: 'providerKey', value: providerKey }]) + '', |
|
|
type: 'POST', |
|
|
type: 'DELETE', |
|
|
dataType: null |
|
|
dataType: null |
|
|
}, ajaxParams)); |
|
|
}, ajaxParams)); |
|
|
}; |
|
|
}; |
|
|
|
|
|
@ -73,7 +73,7 @@ public class FeatureAppService_Tests : FeatureManagementApplicationTestBase |
|
|
{ |
|
|
{ |
|
|
Login(_testData.User1Id); |
|
|
Login(_testData.User1Id); |
|
|
var exception = await Record.ExceptionAsync(async () => |
|
|
var exception = await Record.ExceptionAsync(async () => |
|
|
await _featureAppService.ResetToDefaultAsync("test", "test")); |
|
|
await _featureAppService.DeleteAsync("test", "test")); |
|
|
Assert.Null(exception); |
|
|
Assert.Null(exception); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|