diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json index 04e75f8614..aa829b0319 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json @@ -446,7 +446,6 @@ "ExperienceYear": "Years of experience", "FullName": "Full name", "CompanySize": "Company size", - "Image": "Your profile picture", "TestimonialTitle": "Let's hear your testimonial", "TestimonialInfo": "What our customers say matters! Tell us about your experience with our product and service.", "Country": "Country", @@ -460,13 +459,14 @@ "SelectCountryPlaceholder": "Your country", "YouAreNotAuthorizedToWriteTestimonial": "To be able to write testimonial letter, you must be sign in.", "UnAuthorizeTestimonialInfo": "Your opinion matters! Log in to share it.", - "TheFileIsTooLargeForImage": "Your profile picture cannot be more than 1 MB", + "TheFileIsTooLargeForImage": "Your profile picture cannot be more than {0} MB", "ThisExtensionIsNotAllowedForImage": "This extension is not allowed.", "FileUploadError": "File upload error", - "TestimonialSend": "Thank you! We've received your testimonial. We'll review and take the next step soon.", + "TestimonialSend": "Thank you! We've received your testimonial.
We'll review and take the next step soon.", "Title": "Title", "TitlePlaceholder": "Software Developer, CTO etc.", - "Characters": "characters" + "Characters": "characters", + "Testimonial_YourProfilePicture": "Your profile picture (only {0})" } } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/DatePicker/AbpDatePickerBaseTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/DatePicker/AbpDatePickerBaseTagHelperService.cs index 9e03ec800c..2c2011ac1e 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/DatePicker/AbpDatePickerBaseTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/DatePicker/AbpDatePickerBaseTagHelperService.cs @@ -68,7 +68,6 @@ public abstract class AbpDatePickerBaseTagHelperService : AbpTagHelp protected readonly IAbpTagHelperLocalizer TagHelperLocalizer; protected virtual string TagName { get; set; } = "abp-date-picker"; protected IStringLocalizer L { get; } - protected InputTagHelper InputTagHelper { get; set; } protected abstract TagHelperOutput TagHelperOutput { get; set; } protected AbpDatePickerBaseTagHelperService(IJsonSerializer jsonSerializer, IHtmlGenerator generator, @@ -81,8 +80,6 @@ public abstract class AbpDatePickerBaseTagHelperService : AbpTagHelp ServiceProvider = serviceProvider; L = l; TagHelperLocalizer = tagHelperLocalizer; - - InputTagHelper = new InputTagHelper(Generator) { InputTypeName = "text" }; } protected virtual T? GetAttribute() where T : Attribute @@ -95,19 +92,7 @@ public abstract class AbpDatePickerBaseTagHelperService : AbpTagHelp public async override Task ProcessAsync(TagHelperContext context, TagHelperOutput output) { - TagHelperOutput = new TagHelperOutput("input", GetInputAttributes(context, output), (_, _) => Task.FromResult(new DefaultTagHelperContent())); - - InputTagHelper.ViewContext = TagHelper.ViewContext; - - if (!TagHelper.Name.IsNullOrEmpty()) - { - InputTagHelper.Name = TagHelper.Name; - } - - if (!TagHelper.Value.IsNullOrEmpty()) - { - InputTagHelper.Value = TagHelper.Value; - } + TagHelperOutput = TagHelperOutput = new TagHelperOutput("input", GetInputAttributes(context, output), (_, _) => Task.FromResult(new DefaultTagHelperContent())); AddDisabledAttribute(TagHelperOutput); AddAutoFocusAttribute(TagHelperOutput); @@ -131,7 +116,7 @@ public abstract class AbpDatePickerBaseTagHelperService : AbpTagHelp var labelContent = await GetLabelAsHtmlAsync(context, output, TagHelperOutput); var infoContent = GetInfoAsHtml(context, output, TagHelperOutput); - var validationContent = await GetValidationAsHtmlAsync(context, output); + var validationContent = await GetValidationAsHtmlAsync(context, TagHelperOutput); var inputGroup = new TagHelperOutput("div", new TagHelperAttributeList(new[] { new TagHelperAttribute("class", "input-group") }), @@ -270,12 +255,12 @@ public abstract class AbpDatePickerBaseTagHelperService : AbpTagHelp if (options.MinDate != null) { - attrList.Add("data-min-date", options.MinDate); + attrList.Add("data-min-date", options.MinDate?.ToString("O")); } if (options.MaxDate != null) { - attrList.Add("data-max-date", options.MaxDate); + attrList.Add("data-max-date", options.MaxDate?.ToString("O")); } if (options.MaxSpan != null) @@ -754,16 +739,37 @@ public abstract class AbpDatePickerBaseTagHelperService : AbpTagHelp }; } - protected abstract Task GetValidationAsHtmlAsync(TagHelperContext context, TagHelperOutput output); + protected virtual Task GetValidationAsHtmlAsync(TagHelperContext context, TagHelperOutput output) + { + var @for = GetModelExpression(); + if (@for == null) + { + return Task.FromResult(string.Empty); + } + + return GetValidationAsHtmlByInputAsync(context, output, @for); + } protected virtual async Task GetValidationAsHtmlByInputAsync(TagHelperContext context, TagHelperOutput output, - [NotNull]InputTagHelper inputTag) + [NotNull]ModelExpression @for) { var validationMessageTagHelper = - new ValidationMessageTagHelper(Generator) { For = inputTag.For, ViewContext = TagHelper.ViewContext }; + new ValidationMessageTagHelper(Generator) { For = @for, ViewContext = TagHelper.ViewContext }; - var attributeList = new TagHelperAttributeList { { "class", "text-danger col-auto" } }; + var attributeList = new TagHelperAttributeList { { "class", "text-danger" } }; + + if(!output.Attributes.TryGetAttribute("name", out var nameAttribute) || nameAttribute == null || nameAttribute.Value == null) + { + if (nameAttribute != null) + { + output.Attributes.Remove(nameAttribute); + } + nameAttribute = new TagHelperAttribute("name", "date_" + Guid.NewGuid().ToString("N")); + output.Attributes.Add(nameAttribute); + } + + attributeList.Add("data-valmsg-for", nameAttribute.Value); return await validationMessageTagHelper.RenderAsync(attributeList, context, Encoder, "span", TagMode.StartTagAndEndTag); diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/DatePicker/AbpDatePickerTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/DatePicker/AbpDatePickerTagHelperService.cs index d135d28667..a2abf7c368 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/DatePicker/AbpDatePickerTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/DatePicker/AbpDatePickerTagHelperService.cs @@ -77,11 +77,6 @@ public class AbpDatePickerTagHelperService : AbpDatePickerBaseTagHelperService GetValidationAsHtmlAsync(TagHelperContext context, TagHelperOutput output) - { - return DateTagHelper != null ? await GetValidationAsHtmlByInputAsync(context, output, DateTagHelper) : string.Empty; - } - protected override string GetExtraInputHtml(TagHelperContext context, TagHelperOutput output) { return DateTagHelperOutput?.Render(Encoder)!; diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/DatePicker/AbpDateRangePickerTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/DatePicker/AbpDateRangePickerTagHelperService.cs index 3c2b8aaa03..f21c2a1507 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/DatePicker/AbpDateRangePickerTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/DatePicker/AbpDateRangePickerTagHelperService.cs @@ -112,23 +112,6 @@ public class AbpDateRangePickerTagHelperService : AbpDatePickerBaseTagHelperServ protected override ModelExpression? GetModelExpression() { - return TagHelper.AspForStart; - } - - protected async override Task GetValidationAsHtmlAsync(TagHelperContext context, TagHelperOutput output) - { - var validationHtml = string.Empty; - - if (StartDateTagHelper != null) - { - validationHtml += await GetValidationAsHtmlByInputAsync(context, output, StartDateTagHelper); - } - - if (EndDateTagHelper != null) - { - validationHtml += await GetValidationAsHtmlByInputAsync(context, output, EndDateTagHelper); - } - - return validationHtml; + return TagHelper.AspForStart ?? TagHelper.AspForEnd; } } \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/date-range-picker/date-range-picker-extensions.js b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/date-range-picker/date-range-picker-extensions.js index b5d2dec80d..f45f0b1ff8 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/date-range-picker/date-range-picker-extensions.js +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/date-range-picker/date-range-picker-extensions.js @@ -205,7 +205,7 @@ var today = moment(); $dateRangePicker.setStartDate(today); $dateRangePicker.setEndDate(today); - + if(options.singleDatePicker && options.autoApply){ $dateRangePicker.clickApply(); }else{ @@ -366,6 +366,14 @@ }); } + if (options.maxDate){ + options.maxDate = convertToMoment(options.maxDate, options); + } + + if (options.minDate){ + options.minDate = convertToMoment(options.minDate, options); + } + if (typeof options.template !== 'string' && !(options.template instanceof $)) options.template = '
' + @@ -433,13 +441,13 @@ return ''; } - + function createInitialAbpDate(date, options) { date = convertToMoment(date, options, undefined, options.isUtc); if (options.isUtc) { date = date.local(); } - + return AbpDate(date, options); } @@ -468,8 +476,9 @@ var singleOpenAndClearButton = options.singleOpenAndClearButton && $clearButton.length > 0 && $openButton.length > 0; var startDate = createInitialAbpDate(options.startDate || options.date || (options.autoUpdateInput ? new Date() : undefined), options); + var oldStartDate = AbpDate(undefined, options); - + var endDate = createInitialAbpDate(options.endDate || (options.autoUpdateInput ? new Date() : undefined), options); var oldEndDate = AbpDate(undefined, options); @@ -544,6 +553,10 @@ triggerDateChange($input, startDate, isDateRangePickerTrigger); } } + + if(isTrigger || isInputTrigger || isDateRangePickerTrigger){ + triggerValidation(); + } } function setDataDates(date, $selfInput, prefix){ @@ -553,6 +566,25 @@ $input.data(prefix + 'date', date); } + function triggerValidation() { + checkValidity($startDateInput); + checkValidity($endDateInput); + checkValidity($dateInput); + checkValidity($input); + } + + function checkValidity($selfInput) { + if (!$selfInput) { + return; + } + + if($selfInput.closest('form').length === 0) { + return; + } + + $selfInput.valid(); + } + function triggerDateChange($selfInput, value, isDateRangePickerTrigger) { $selfInput.trigger('change'); if(isDateRangePickerTrigger !== false){ @@ -583,7 +615,7 @@ }else{ picker.setStartDate(convertToMoment(startDate, options, options.inputDateFormat)); } - + if(singleDatePicker){ picker.setEndDate(picker.startDate); }else if(isEmptyDate(endDate, options)){ diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ChangeThemeStep.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ChangeThemeStep.cs index b6408fb3e2..4a88ada34a 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ChangeThemeStep.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ChangeThemeStep.cs @@ -372,7 +372,7 @@ public class ChangeThemeStep : ProjectBuildPipelineStep return; } - lines[lineIndex] = lines[lineIndex].Replace(lines[lineIndex], $"\t"); + lines[lineIndex] = lines[lineIndex].Replace(lines[lineIndex], $"\t\t\n"); file.SetLines(lines); } @@ -568,7 +568,7 @@ public class ChangeThemeStep : ProjectBuildPipelineStep private static void ChangeThemeToBasicForMvcProjects(ProjectBuildContext context, string defaultThemeName) { var projectNames = new[] -{ + { ".Web", ".HttpApi.Host", ".AuthServer", ".Web.Public", ".Web.Public.Host", "" //for app-nolayers-mvc }; @@ -608,45 +608,46 @@ public class ChangeThemeStep : ProjectBuildPipelineStep { var projects = new Dictionary { - {"Blazor", "MyProjectNameBlazorModule"}, - {"Blazor.Server.Tiered", "MyProjectNameBlazorModule"}, - {"Blazor.Server", "MyProjectNameModule"}, - {"Blazor.Server.Mongo", "MyProjectNameModule"} + {".Blazor", "MyProjectNameBlazorModule"}, + {".Blazor.Server.Tiered", "MyProjectNameBlazorModule"}, + {".Blazor.Server", "MyProjectNameModule"}, + {"Blazor.Server.Mongo", "MyProjectNameModule"}, + {"", ""} //for app-nolayers blazor-server }; foreach (var project in projects) { ReplacePackageReferenceWithProjectReference( context, - $"/MyCompanyName.MyProjectName.{project.Key}/MyCompanyName.MyProjectName.{project.Key}.csproj", - $"Volo.Abp.AspNetCore.Components.Server.{defaultThemeName}Theme", - @"..\..\..\..\..\modules\basic-theme\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj" + $"/MyCompanyName.MyProjectName{project.Key}/MyCompanyName.MyProjectName{project.Key}.csproj", + $"Volo.Abp.AspNetCore.Components.Server.{defaultThemeName}", + @"..\..\..\..\..\modules\basic-theme\src\Volo.Abp.AspNetCore.Components.Server.BasicTheme\Volo.Abp.AspNetCore.Components.Server.BasicTheme.csproj" ); ReplacePackageReferenceWithProjectReference( context, - $"/MyCompanyName.MyProjectName.{project.Key}/MyCompanyName.MyProjectName.{project.Key}.csproj", + $"/MyCompanyName.MyProjectName{project.Key}/MyCompanyName.MyProjectName{project.Key}.csproj", $"Volo.Abp.AspNetCore.Mvc.UI.Theme.{defaultThemeName}", - @"..\..\..\..\..\modules\basic-theme\src\Volo.Abp.AspNetCore.Components.Server.BasicTheme\Volo.Abp.AspNetCore.Components.Server.BasicTheme.csproj" + @"..\..\..\..\..\modules\basic-theme\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj" ); ReplaceAllKeywords( context, - $"/MyCompanyName.MyProjectName.{project.Key}/Pages/_Host.cshtml", + $"/Pages/_Host.cshtml", $"{defaultThemeName}Theme.Components", Basic ); ReplaceAllKeywords( context, - $"/MyCompanyName.MyProjectName.{project.Key}/{project.Value}.cs", + $"/MyCompanyName.MyProjectName{project.Key}/{project.Value}.cs", defaultThemeName, - Basic + Basic + "Theme" ); ReplaceAllKeywords( context, - $"/MyCompanyName.MyProjectName.{project.Key}/Pages/_Host.cshtml", + $"/Pages/_Host.cshtml", defaultThemeName, Basic ); @@ -682,7 +683,7 @@ public class ChangeThemeStep : ProjectBuildPipelineStep ReplaceAllKeywords( context, - $"/MyCompanyName.MyProjectName.{projectName}/Pages/_Host.cshtml", + $"/Pages/_Host.cshtml", LeptonX, Lepton ); @@ -731,7 +732,7 @@ public class ChangeThemeStep : ProjectBuildPipelineStep ReplaceAllKeywords( context, - $"/MyCompanyName.MyProjectName.{projectName}/Pages/_Host.cshtml", + $"/Pages/_Host.cshtml", LeptonX, Lepton ); diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppNoLayersTemplateBase.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppNoLayersTemplateBase.cs index 7bbba5c733..8b9df09ca5 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppNoLayersTemplateBase.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppNoLayersTemplateBase.cs @@ -346,6 +346,7 @@ public abstract class AppNoLayersTemplateBase : TemplateInfo var blazorServerUiPackageName = isProTemplate ? "@volo/aspnetcore.components.server.leptonxtheme" : "@abp/aspnetcore.components.server.leptonxlitetheme"; var blazorServerPackageJsonFilePaths = new List { + "/MyCompanyName.MyProjectName/package.json", "/MyCompanyName.MyProjectName.Blazor/package.json", "/MyCompanyName.MyProjectName.Blazor.Server.Mongo/package.json" }; diff --git a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/ApplicationMenuExtensions.cs b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/ApplicationMenuExtensions.cs index 5a755f187a..c8ba277ccc 100644 --- a/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/ApplicationMenuExtensions.cs +++ b/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/ApplicationMenuExtensions.cs @@ -115,6 +115,11 @@ public static class ApplicationMenuExtensions return menuWithGroups; } + public static ApplicationMenuItem UseComponent(this ApplicationMenuItem applicationMenuItem) + { + return applicationMenuItem.UseComponent(typeof(TComponent)); + } + public static ApplicationMenuItem UseComponent(this ApplicationMenuItem applicationMenuItem, Type componentType) { return applicationMenuItem.WithCustomData(CustomDataComponentKey, componentType); diff --git a/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Menu/Default.cshtml b/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Menu/Default.cshtml index f146878b0f..19471fecfd 100644 --- a/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Menu/Default.cshtml +++ b/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Menu/Default.cshtml @@ -6,9 +6,15 @@ var cssClass = string.IsNullOrEmpty(menuItem.CssClass) ? string.Empty : menuItem.CssClass; var disabled = menuItem.IsDisabled ? "disabled" : string.Empty; var url = string.IsNullOrEmpty(menuItem.Url) ? "#" : Url.IsLocalUrl(menuItem.Url) ? Url.Content(menuItem.Url.EnsureStartsWith('~')) : menuItem.Url; + var customComponentType = menuItem.GetComponentTypeOrDefault(); + if (menuItem.IsLeaf) { - if (menuItem.Url != null) + if (customComponentType != null) + { + @(await Component.InvokeAsync(customComponentType)) + } + else if (menuItem.Url != null) { } diff --git a/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Menu/_MenuItem.cshtml b/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Menu/_MenuItem.cshtml index 2dc72b8e58..1b5a4badbb 100644 --- a/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Menu/_MenuItem.cshtml +++ b/modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Menu/_MenuItem.cshtml @@ -5,10 +5,16 @@ var cssClass = string.IsNullOrEmpty(Model.CssClass) ? string.Empty : Model.CssClass; var disabled = Model.IsDisabled ? "disabled" : string.Empty; var url = string.IsNullOrEmpty(Model.Url) ? "#" : Url.IsLocalUrl(Model.Url) ? Url.Content(Model.Url.EnsureStartsWith('~')) : Model.Url; + var customComponentType = Model.GetComponentTypeOrDefault(); + } @if (Model.IsLeaf) { - if (Model.Url != null) + if (customComponentType != null) + { + @(await Component.InvokeAsync(customComponentType)) + } + else if (Model.Url != null) { @if (Model.Icon != null) @@ -25,20 +31,27 @@ else { } diff --git a/modules/permission-management/src/Volo.Abp.PermissionManagement.Blazor/Components/PermissionManagementModal.razor.cs b/modules/permission-management/src/Volo.Abp.PermissionManagement.Blazor/Components/PermissionManagementModal.razor.cs index 8a5c82e734..4a55b75df8 100644 --- a/modules/permission-management/src/Volo.Abp.PermissionManagement.Blazor/Components/PermissionManagementModal.razor.cs +++ b/modules/permission-management/src/Volo.Abp.PermissionManagement.Blazor/Components/PermissionManagementModal.razor.cs @@ -17,7 +17,7 @@ public partial class PermissionManagementModal [Inject] protected ICurrentApplicationConfigurationCacheResetService CurrentApplicationConfigurationCacheResetService { get; set; } [Inject] protected IOptions LocalizationOptions { get; set; } - + protected Modal _modal; protected string _providerName; @@ -71,7 +71,7 @@ public partial class PermissionManagementModal } } } - + protected Dictionary _permissionDepths = new Dictionary(); public PermissionManagementModal() @@ -137,7 +137,7 @@ public partial class PermissionManagementModal { try { - + var updateDto = new UpdatePermissionsDto { Permissions = _groups @@ -145,7 +145,7 @@ public partial class PermissionManagementModal .Select(p => new UpdatePermissionDto { IsGranted = p.IsGranted, Name = p.Name }) .ToArray() }; - + if (!updateDto.Permissions.Any(x => x.IsGranted)) { if (!await Message.Confirm(L["SaveWithoutAnyPermissionsWarningMessage"].Value)) @@ -182,7 +182,7 @@ public partial class PermissionManagementModal } } } - + protected virtual int GetPermissionDepthOrDefault(string name) { return _permissionDepths.GetValueOrDefault(name, 0); @@ -207,7 +207,7 @@ public partial class PermissionManagementModal { SetParentPermissionGrant(permissionGroup, permission); } - else if (value == false) + else { var childPermissions = GetChildPermissions(permissionGroup, permission); @@ -229,7 +229,7 @@ public partial class PermissionManagementModal SetPermissionGrant(parentPermission, true); SetParentPermissionGrant(permissionGroup, parentPermission); - + } private void SetPermissionGrant(PermissionGrantInfoDto permission, bool value) @@ -260,7 +260,25 @@ public partial class PermissionManagementModal protected List GetChildPermissions(PermissionGroupDto permissionGroup, PermissionGrantInfoDto permission) { - return permissionGroup.Permissions.Where(x => x.Name.StartsWith(permission.Name)).ToList(); + var childPermissions = new List(); + GetChildPermissions(childPermissions, permissionGroup.Permissions, permission); + return childPermissions; + } + + protected void GetChildPermissions(List allChildPermissions, List permissions, PermissionGrantInfoDto permission) + { + var childPermissions = permissions.Where(x => x.ParentName == permission.Name).ToList(); + if (childPermissions.Count == 0) + { + return; + } + + allChildPermissions.AddRange(childPermissions); + + foreach (var childPermission in childPermissions) + { + GetChildPermissions(allChildPermissions, permissions, childPermission); + } } protected bool IsDisabledPermission(PermissionGrantInfoDto permissionGrantInfo) diff --git a/npm/publish-mvc.ps1 b/npm/publish-mvc.ps1 index ee12fc67c3..c9737baeda 100644 --- a/npm/publish-mvc.ps1 +++ b/npm/publish-mvc.ps1 @@ -25,7 +25,7 @@ if ($IsPrerelease) { } $commands = ( - "npm run lerna -- version $Version --yes --no-commit-hooks --skip-git --force-publish", + "npm run lerna -- version $Version --yes --no-commit-hooks --no-git-tag-version --no-push --force-publish", "yarn replace-with-tilde", "cd scripts", "yarn install",