Browse Source

implemented razor UI

pull/14514/head
malik masis 4 years ago
parent
commit
3d1ede910e
  1. 6
      modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/FeatureManagementModal.cshtml
  2. 29
      modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/feature-management-modal.js

6
modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/FeatureManagementModal.cshtml

@ -119,7 +119,11 @@
</abp-tabs> </abp-tabs>
</abp-modal-body> </abp-modal-body>
<abp-modal-footer buttons="@(AbpModalButtons.Cancel | AbpModalButtons.Save)"></abp-modal-footer> <abp-modal-footer>
<abp-button button-type="Primary" id="ResetToDefaults"><i class="fa fa-refresh"></i> @L["ResetToDefaults"]</abp-button>
<abp-button data-bs-dismiss="modal" button-type="Secondary">@L["Cancel"]</abp-button>
<abp-button button-type="Primary" type="submit"><i class="fa fa-check"></i> @L["Save"]</abp-button>
</abp-modal-footer>
} }
else else
{ {

29
modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/feature-management-modal.js

@ -2,9 +2,24 @@ var abp = abp || {};
(function ($) { (function ($) {
abp.modals = abp.modals || {}; abp.modals = abp.modals || {};
let l = abp.localization.getResource("FeatureManagement");
abp.modals.FeatureManagement = function () { abp.modals.FeatureManagement = function () {
abp.ResourceLoader.loadScript('/client-proxies/featureManagement-proxy.js');
$('#ResetToDefaults').click(function (e) {
abp.message.confirm('Are you sure to reset to defaults?')
.then(function (confirmed) {
if (confirmed) {
volo.abp.featureManagement.features.resetToDefault().then(function () {
abp.notify.success(l('Reseted'));
});
}
});
});
function checkParents($tab, $element, className) { function checkParents($tab, $element, className) {
var parentName = $element let parentName = $element
.closest(className) .closest(className)
.attr('data-parent-name'); .attr('data-parent-name');
@ -16,14 +31,14 @@ var abp = abp || {};
.filter('[data-feature-name="' + parentName + '"]') .filter('[data-feature-name="' + parentName + '"]')
.find('input[type="checkbox"]') .find('input[type="checkbox"]')
.each(function () { .each(function () {
var $parent = $(this); let $parent = $(this);
$parent.prop('checked', true); $parent.prop('checked', true);
checkParents($tab, $parent, className); checkParents($tab, $parent, className);
}); });
} }
function uncheckChildren($tab, $checkBox) { function uncheckChildren($tab, $checkBox) {
var featureName = $checkBox let featureName = $checkBox
.closest('.custom-checkbox') .closest('.custom-checkbox')
.attr('data-feature-name'); .attr('data-feature-name');
if (!featureName) { if (!featureName) {
@ -34,7 +49,7 @@ var abp = abp || {};
.filter('[data-parent-name="' + featureName + '"]') .filter('[data-parent-name="' + featureName + '"]')
.find('input[type="checkbox"]') .find('input[type="checkbox"]')
.each(function () { .each(function () {
var $child = $(this); let $child = $(this);
$child.prop('checked', false); $child.prop('checked', false);
uncheckChildren($tab, $child); uncheckChildren($tab, $child);
}); });
@ -42,10 +57,10 @@ var abp = abp || {};
this.initDom = function ($el) { this.initDom = function ($el) {
$el.find('.tab-pane').each(function () { $el.find('.tab-pane').each(function () {
var $tab = $(this); let $tab = $(this);
$tab.find('input[type="checkbox"]') $tab.find('input[type="checkbox"]')
.each(function () { .each(function () {
var $checkBox = $(this); let $checkBox = $(this);
$checkBox.change(function () { $checkBox.change(function () {
if ($checkBox.is(':checked')) { if ($checkBox.is(':checked')) {
checkParents($tab, $checkBox, '.custom-checkbox') checkParents($tab, $checkBox, '.custom-checkbox')
@ -57,7 +72,7 @@ var abp = abp || {};
$tab.find('.form-control') $tab.find('.form-control')
.each(function () { .each(function () {
var $element = $(this); let $element = $(this);
$element.change(function () { $element.change(function () {
checkParents($tab, $element, '.form-group') checkParents($tab, $element, '.form-group')
}); });

Loading…
Cancel
Save