Merge pull request #658 from sbwalker/master

Allow scheduled jobs to set next execution date, fix issue in site settings where logo field was not being populated, fixed compositing issue where deleted modules were being rendered.
This commit is contained in:
Shaun Walker 2020-07-22 16:10:23 -04:00 committed by GitHub
commit fe1de2b243
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 33 additions and 8 deletions

View File

@ -63,10 +63,18 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="retention-log" HelpText="What items do you want in the retention log">Retention Log (Items): </Label> <Label For="retention" HelpText="Number of log entries to retain for this job">Retention Log (Items): </Label>
</td> </td>
<td> <td>
<input id="retention-log" class="form-control" @bind="@_retentionHistory" /> <input id="retention" class="form-control" @bind="@_retentionHistory" />
</td>
</tr>
<tr>
<td>
<Label For="next" HelpText="Next execution for this job.">Next Execution: </Label>
</td>
<td>
<input id="next" class="form-control" @bind="@_nextExecution" />
</td> </td>
</tr> </tr>
</table> </table>
@ -83,6 +91,7 @@
private string _startDate = string.Empty; private string _startDate = string.Empty;
private string _endDate = string.Empty; private string _endDate = string.Empty;
private string _retentionHistory = string.Empty; private string _retentionHistory = string.Empty;
private string _nextExecution = string.Empty;
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Host; public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Host;
@ -102,6 +111,7 @@
_startDate = (job.StartDate != null) ? job.StartDate.ToString() : string.Empty; _startDate = (job.StartDate != null) ? job.StartDate.ToString() : string.Empty;
_endDate = (job.EndDate != null) ? job.EndDate.ToString() : string.Empty; _endDate = (job.EndDate != null) ? job.EndDate.ToString() : string.Empty;
_retentionHistory = job.RetentionHistory.ToString(); _retentionHistory = job.RetentionHistory.ToString();
_nextExecution = job.NextExecution.ToString();
} }
} }
catch (Exception ex) catch (Exception ex)
@ -140,6 +150,15 @@
job.EndDate = DateTime.Parse(_endDate); job.EndDate = DateTime.Parse(_endDate);
} }
if (_nextExecution == string.Empty)
{
job.NextExecution = null;
}
else
{
job.NextExecution = DateTime.Parse(_nextExecution);
}
job.RetentionHistory = int.Parse(_retentionHistory); job.RetentionHistory = int.Parse(_retentionHistory);
try try

View File

@ -7,7 +7,7 @@
@inject IThemeService ThemeService @inject IThemeService ThemeService
@inject ISettingService SettingService @inject ISettingService SettingService
@if (_themes != null) @if (_initialized)
{ {
<table class="table table-borderless"> <table class="table table-borderless">
<tr> <tr>
@ -211,6 +211,7 @@
} }
@code { @code {
private bool _initialized = false;
private List<Theme> _themeList; private List<Theme> _themeList;
private List<ThemeControl> _themes = new List<ThemeControl>(); private List<ThemeControl> _themes = new List<ThemeControl>();
private List<ThemeControl> _layouts = new List<ThemeControl>(); private List<ThemeControl> _layouts = new List<ThemeControl>();
@ -318,6 +319,8 @@
_deletedby = site.DeletedBy; _deletedby = site.DeletedBy;
_deletedon = site.DeletedOn; _deletedon = site.DeletedOn;
_isdeleted = site.IsDeleted.ToString(); _isdeleted = site.IsDeleted.ToString();
_initialized = true;
} }
} }
catch (Exception ex) catch (Exception ex)

View File

@ -6,7 +6,7 @@
@inject IAliasService AliasService @inject IAliasService AliasService
@inject IThemeService ThemeService @inject IThemeService ThemeService
@if (_themes != null) @if (_initialized)
{ {
<table class="table table-borderless"> <table class="table table-borderless">
<tr> <tr>
@ -106,6 +106,7 @@
} }
@code { @code {
private bool _initialized = false;
private List<Theme> _themeList; private List<Theme> _themeList;
private List<ThemeControl> _themes = new List<ThemeControl>(); private List<ThemeControl> _themes = new List<ThemeControl>();
private List<ThemeControl> _layouts = new List<ThemeControl>(); private List<ThemeControl> _layouts = new List<ThemeControl>();
@ -163,6 +164,8 @@
_deletedby = site.DeletedBy; _deletedby = site.DeletedBy;
_deletedon = site.DeletedOn; _deletedon = site.DeletedOn;
_isdeleted = site.IsDeleted.ToString(); _isdeleted = site.IsDeleted.ToString();
_initialized = true;
} }
} }
catch (Exception ex) catch (Exception ex)

View File

@ -19,7 +19,7 @@
{ {
_moduleState = Module; // passed in from Pane component _moduleState = Module; // passed in from Pane component
string container = _moduleState.ContainerType; string container = _moduleState.ContainerType;
if (PageState.ModuleId != -1 && PageState.Action != "" && _moduleState.UseAdminContainer) if (PageState.ModuleId != -1 && _moduleState.UseAdminContainer)
{ {
container = Constants.DefaultAdminContainer; container = Constants.DefaultAdminContainer;
} }

View File

@ -39,12 +39,12 @@
DynamicComponent = builder => DynamicComponent = builder =>
{ {
if (PageState.ModuleId != -1 && PageState.Action != "") if (PageState.ModuleId != -1 && PageState.Action != Constants.DefaultAction)
{ {
if (Name.ToLower() == Constants.AdminPane.ToLower()) if (Name.ToLower() == Constants.AdminPane.ToLower())
{ {
Module module = PageState.Modules.FirstOrDefault(item => item.ModuleId == PageState.ModuleId); Module module = PageState.Modules.FirstOrDefault(item => item.ModuleId == PageState.ModuleId);
if (module != null) if (module != null && !module.IsDeleted)
{ {
var typename = module.ModuleType; var typename = module.ModuleType;
// check for core module actions component // check for core module actions component
@ -104,7 +104,7 @@
if (PageState.ModuleId != -1) if (PageState.ModuleId != -1)
{ {
Module module = PageState.Modules.FirstOrDefault(item => item.ModuleId == PageState.ModuleId); Module module = PageState.Modules.FirstOrDefault(item => item.ModuleId == PageState.ModuleId);
if (module != null && module.Pane.ToLower() == Name.ToLower()) if (module != null && module.Pane.ToLower() == Name.ToLower() && !module.IsDeleted)
{ {
// 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)) if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.View, module.Permissions))