From 20e481af3dd1393b605290a514fff5970e66062e Mon Sep 17 00:00:00 2001 From: Shaun Walker Date: Tue, 24 Mar 2020 16:56:01 -0400 Subject: [PATCH] fixes to role management --- Oqtane.Client/Modules/Admin/Roles/Add.razor | 38 +++++++------------ Oqtane.Client/Modules/Admin/Roles/Edit.razor | 15 +------- Oqtane.Client/Modules/Admin/Roles/Index.razor | 4 +- .../Modules/Controls/ActionDialog.razor | 2 +- .../Modules/Controls/ActionLink.razor | 4 +- 5 files changed, 19 insertions(+), 44 deletions(-) diff --git a/Oqtane.Client/Modules/Admin/Roles/Add.razor b/Oqtane.Client/Modules/Admin/Roles/Add.razor index e908dd1c..65f346c5 100644 --- a/Oqtane.Client/Modules/Admin/Roles/Add.razor +++ b/Oqtane.Client/Modules/Admin/Roles/Add.razor @@ -6,37 +6,26 @@ - - - - - - - -
- + - +
- + - +
- + - -
- - - @@ -49,19 +38,18 @@ @code { public override SecurityAccessLevel SecurityAccessLevel { get { return SecurityAccessLevel.Admin; } } - string name = ""; - string description = ""; - string isautoassigned = "False"; - string issystem = "False"; + string _name = ""; + string _description = ""; + string _isautoassigned = "False"; private async Task SaveRole() { Role role = new Role(); role.SiteId = PageState.Page.SiteId; - role.Name = name; - role.Description = description; - role.IsAutoAssigned = (isautoassigned == null ? false : Boolean.Parse(isautoassigned)); - role.IsSystem = (issystem == null ? false : Boolean.Parse(issystem)); + role.Name = _name; + role.Description = _description; + role.IsAutoAssigned = (_isautoassigned == null ? false : Boolean.Parse(_isautoassigned)); + role.IsSystem = false; try { diff --git a/Oqtane.Client/Modules/Admin/Roles/Edit.razor b/Oqtane.Client/Modules/Admin/Roles/Edit.razor index ebbd5907..acea8de2 100644 --- a/Oqtane.Client/Modules/Admin/Roles/Edit.razor +++ b/Oqtane.Client/Modules/Admin/Roles/Edit.razor @@ -31,17 +31,6 @@
- - - -
Cancel @@ -53,7 +42,6 @@ string _name = ""; string _description = ""; string _isautoassigned = "False"; - string _issystem = "False"; protected override async Task OnInitializedAsync() { @@ -66,7 +54,6 @@ _name = role.Name; _description = role.Description; _isautoassigned = role.IsAutoAssigned.ToString(); - _issystem = role.IsSystem.ToString(); } } catch (Exception ex) @@ -82,7 +69,7 @@ role.Name = _name; role.Description = _description; role.IsAutoAssigned = (_isautoassigned != null && Boolean.Parse(_isautoassigned)); - role.IsSystem = (_issystem != null && Boolean.Parse(_issystem)); + role.IsSystem = false; try { diff --git a/Oqtane.Client/Modules/Admin/Roles/Index.razor b/Oqtane.Client/Modules/Admin/Roles/Index.razor index 29378752..01372e80 100644 --- a/Oqtane.Client/Modules/Admin/Roles/Index.razor +++ b/Oqtane.Client/Modules/Admin/Roles/Index.razor @@ -17,8 +17,8 @@ else Name - - + + @context.Name diff --git a/Oqtane.Client/Modules/Controls/ActionDialog.razor b/Oqtane.Client/Modules/Controls/ActionDialog.razor index 924112ac..a6522a07 100644 --- a/Oqtane.Client/Modules/Controls/ActionDialog.razor +++ b/Oqtane.Client/Modules/Controls/ActionDialog.razor @@ -30,7 +30,7 @@ { if (Disabled) { - + } else { diff --git a/Oqtane.Client/Modules/Controls/ActionLink.razor b/Oqtane.Client/Modules/Controls/ActionLink.razor index 7585952f..48b8116e 100644 --- a/Oqtane.Client/Modules/Controls/ActionLink.razor +++ b/Oqtane.Client/Modules/Controls/ActionLink.razor @@ -6,7 +6,7 @@ { if (Disabled) { - @((MarkupString)_iconSpan) @_text + } else { @@ -82,7 +82,7 @@ if (!string.IsNullOrEmpty(IconName)) { _iconSpan = $" "; - } + } _url = EditUrl(Action, _parameters); _authorized = IsAuthorized();