diff --git a/Oqtane.Client/Modules/Admin/ModuleDefinitions/Create.razor b/Oqtane.Client/Modules/Admin/ModuleDefinitions/Create.razor index 40a9b1e2..30dda63a 100644 --- a/Oqtane.Client/Modules/Admin/ModuleDefinitions/Create.razor +++ b/Oqtane.Client/Modules/Admin/ModuleDefinitions/Create.razor @@ -89,7 +89,10 @@ protected override void OnInitialized() { - AddModuleMessage(Localizer["Info.Module.Development"], MessageType.Info); + if (!NavigationManager.BaseUri.Contains("localhost:")) + { + AddModuleMessage(Localizer["Info.Module.Development"], MessageType.Info); + } } protected override async Task OnParametersSetAsync() @@ -115,11 +118,18 @@ { if (IsValid(_owner) && IsValid(_module) && _owner != _module && _template != "-") { - var template = _templates.FirstOrDefault(item => item.Name == _template); - var moduleDefinition = new ModuleDefinition { Owner = _owner, Name = _module, Description = _description, Template = _template, Version = _reference, ModuleDefinitionName = template.Namespace }; - moduleDefinition = await ModuleDefinitionService.CreateModuleDefinitionAsync(moduleDefinition); - GetLocation(); - AddModuleMessage(string.Format(Localizer["Success.Module.Create"], NavigateUrl("admin/system")), MessageType.Success); + if (IsValidXML(_description)) + { + var template = _templates.FirstOrDefault(item => item.Name == _template); + var moduleDefinition = new ModuleDefinition { Owner = _owner, Name = _module, Description = _description, Template = _template, Version = _reference, ModuleDefinitionName = template.Namespace }; + moduleDefinition = await ModuleDefinitionService.CreateModuleDefinitionAsync(moduleDefinition); + GetLocation(); + AddModuleMessage(string.Format(Localizer["Success.Module.Create"], NavigateUrl("admin/system")), MessageType.Success); + } + else + { + AddModuleMessage(Localizer["Message.Require.ValidDescription"], MessageType.Warning); + } } else { @@ -143,6 +153,12 @@ return !string.IsNullOrEmpty(name) && name.ToLower() != "module" && !name.ToLower().Contains("oqtane") && Regex.IsMatch(name, "^[A-Za-z_][A-Za-z0-9_]*$"); } + private bool IsValidXML(string description) + { + // must contain letters, digits, or spaces + return Regex.IsMatch(description, "^[A-Za-z0-9 ]+$"); + } + private void TemplateChanged(ChangeEventArgs e) { _template = (string)e.Value; diff --git a/Oqtane.Client/Modules/Admin/Themes/Create.razor b/Oqtane.Client/Modules/Admin/Themes/Create.razor index 04fa0049..127a0415 100644 --- a/Oqtane.Client/Modules/Admin/Themes/Create.razor +++ b/Oqtane.Client/Modules/Admin/Themes/Create.razor @@ -80,7 +80,10 @@ protected override void OnInitialized() { - AddModuleMessage(Localizer["Info.Theme.CreatorIntent"], MessageType.Info); + if (!NavigationManager.BaseUri.Contains("localhost:")) + { + AddModuleMessage(Localizer["Info.Theme.CreatorIntent"], MessageType.Info); + } } protected override async Task OnParametersSetAsync() diff --git a/Oqtane.Client/Resources/Modules/Admin/ModuleCreator/Index.resx b/Oqtane.Client/Resources/Modules/Admin/ModuleCreator/Index.resx deleted file mode 100644 index 16000d3e..00000000 --- a/Oqtane.Client/Resources/Modules/Admin/ModuleCreator/Index.resx +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Template: - - - Select Template - - - Create Module - - - Activate Module - - - Please Note That The Module Creator Is Only Intended To Be Used In A Development Environment - - - Once You Have Compiled The Module And Restarted The Application You Can Activate The Module Below - - - The Source Code For Your Module Has Been Created At The Location Specified Below And Must Be Compiled In Order To Make It Functional. Once It Has Been Compiled You Must <a href={0}>Restart</a> Your Application To Apply These Changes. - - - You Must Provide A Valid Owner Name And Module Name ( ie. No Punctuation Or Spaces And The Values Cannot Be The Same ) And Choose A Template - - - Enter the name of the organization who is developing this module. It should not contain spaces or punctuation. - - - Enter a name for this module. It should not contain spaces or punctuation. - - - Enter a short description for the module - - - Select a module template. Templates are located in the wwwroot/Modules/Templates folder on the server. - - - Select a framework reference version - - - Location where the module will be created - - - Owner Name: - - - Module Name: - - - Description: - - - Framework Reference: - - - Location: - - \ No newline at end of file diff --git a/Oqtane.Client/Resources/Modules/Admin/ModuleDefinitions/Create.resx b/Oqtane.Client/Resources/Modules/Admin/ModuleDefinitions/Create.resx index 8ab77a00..cac13d97 100644 --- a/Oqtane.Client/Resources/Modules/Admin/ModuleDefinitions/Create.resx +++ b/Oqtane.Client/Resources/Modules/Admin/ModuleDefinitions/Create.resx @@ -132,6 +132,9 @@ You Must Provide A Valid Owner Name And Module Name ( ie. No Punctuation Or Spaces And The Values Cannot Be The Same ) And Choose A Template + + You Must Provide A Valid Description (ie. No Punctuation) + Enter the name of the organization who is developing this module. It should not contain spaces or punctuation. diff --git a/Oqtane.Client/Themes/Controls/Theme/LoginBase.cs b/Oqtane.Client/Themes/Controls/Theme/LoginBase.cs index 40f8ed4b..37d57547 100644 --- a/Oqtane.Client/Themes/Controls/Theme/LoginBase.cs +++ b/Oqtane.Client/Themes/Controls/Theme/LoginBase.cs @@ -21,8 +21,6 @@ namespace Oqtane.Themes.Controls [Inject] public IJSRuntime jsRuntime { get; set; } [Inject] public IServiceProvider ServiceProvider { get; set; } - private bool _allowsitelogin = true; - protected void LoginUser() { Route route = new Route(PageState.Uri.AbsoluteUri, PageState.Alias.Path);