Refactoring (#314)

* Refactoring

* Refactoring

* Check for a valid email.

* Fixed missing character.

* Moved logic to  the Utilities class.

* Rename template .sql file

* Modified null and empty string check.

* Check for a valid email.

* Fixed missing character.

* Moved logic to  the Utilities class.

* Added Favicon support, Progressive Web App support, page title and url support, and private/public user registration options

* Refactoring

* Refactoring

* Check for a valid email.

* Moved logic to  the Utilities class.

Co-authored-by: Aubrey <aubrey.b@treskcow.tech>
Co-authored-by: MIchael Atwood <matwood@dragonmastery.com>
Co-authored-by: Shaun Walker <shaun.walker@siliqon.com>
This commit is contained in:
Hisham Bin Ateya
2020-03-31 17:21:05 +03:00
committed by GitHub
parent c9baa2bb56
commit 66ad089088
82 changed files with 958 additions and 829 deletions

View File

@ -12,6 +12,9 @@
</div>
@code {
private string _paneadminborder = "";
private string _panetitle = "";
[CascadingParameter]
protected PageState PageState { get; set; }
@ -20,9 +23,6 @@
RenderFragment DynamicComponent { get; set; }
string _paneadminborder = "";
string _panetitle = "";
protected override void OnParametersSet()
{
if (PageState.EditMode && !PageState.Page.EditMode && UserSecurity.IsAuthorized(PageState.User,PermissionNames.Edit, PageState.Page.Permissions) && Name != Constants.AdminPane)
@ -45,13 +45,14 @@
Module module = PageState.Modules.FirstOrDefault(item => item.ModuleId == PageState.ModuleId);
if (module != null)
{
string typename = module.ModuleType;
// check for core module actions component
var typename = module.ModuleType;
// check for core module actions component
if (Constants.DefaultModuleActions.Contains(PageState.Action))
{
typename = Constants.DefaultModuleActionsTemplate.Replace(Constants.ActionToken, PageState.Action);
}
Type moduleType = Type.GetType(typename);
var moduleType = Type.GetType(typename);
if (moduleType != null)
{
bool authorized = false;
@ -61,7 +62,6 @@
}
else
{
// verify security access level for this module control
switch (module.SecurityAccessLevel)
{
case SecurityAccessLevel.Anonymous:
@ -81,12 +81,14 @@
break;
}
}
if (authorized)
{
if (!Constants.DefaultModuleActions.Contains(PageState.Action) && module.ControlTitle != "")
{
module.Title = module.ControlTitle;
}
builder.OpenComponent(0, Type.GetType(Constants.ContainerComponent));
builder.AddAttribute(1, "Module", module);
builder.CloseComponent();
@ -94,7 +96,7 @@
}
else
{
// module control does not exist with name specified
// module control does not exist with name specified
}
}
}
@ -106,7 +108,7 @@
Module module = PageState.Modules.FirstOrDefault(item => item.ModuleId == PageState.ModuleId);
if (module != null && module.Pane.ToLower() == Name.ToLower())
{
// check if user is authorized to view module
// check if user is authorized to view module
if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.View, module.Permissions))
{
builder.OpenComponent(0, Type.GetType(Constants.ContainerComponent));
@ -119,7 +121,7 @@
{
foreach (Module module in PageState.Modules.Where(item => item.PageId == PageState.Page.PageId && item.Pane.ToLower() == Name.ToLower() && !item.IsDeleted).OrderBy(x => x.Order).ToArray())
{
// check if user is authorized to view module
// check if user is authorized to view module
if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.View, module.Permissions))
{
builder.OpenComponent(0, Type.GetType(Constants.ContainerComponent));