Fixed issue where Page Url expansion script for 1.0.4 was not implemented properly - it was not tagged as an embedded resource.

This commit is contained in:
Shaun Walker 2020-10-21 08:01:17 -04:00
parent fc7000394f
commit 0ef04e81ff
6 changed files with 66 additions and 18 deletions

View File

@ -1,4 +1,4 @@
@namespace Oqtane.Modules.Admin.Profiles
@namespace Oqtane.Modules.Admin.Profiles
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject IProfileService ProfileService
@ -6,7 +6,7 @@
<table class="table table-borderless">
<tr>
<td>
<Label For="name" HelpText="The name of this field">Name: </Label>
<Label For="name" HelpText="The name of this profile item">Name: </Label>
</td>
<td>
<input id="name" class="form-control" @bind="@_name" />
@ -14,7 +14,7 @@
</tr>
<tr>
<td>
<Label For="title" HelpText="The title of the field">Title: </Label>
<Label For="title" HelpText="The title of the profile item to display to the user">Title: </Label>
</td>
<td>
<input id="title" class="form-control" @bind="@_title" />
@ -22,7 +22,7 @@
</tr>
<tr>
<td>
<Label For="description" HelpText="What the profile field is">Description: </Label>
<Label For="description" HelpText="The help text displayed to the user for this profile item">Description: </Label>
</td>
<td>
<textarea id="description" class="form-control" @bind="@_description" rows="5"></textarea>
@ -30,7 +30,7 @@
</tr>
<tr>
<td>
<Label For="category" HelpText="What larger category does this field belong to">Category: </Label>
<Label For="category" HelpText="The category of this profile item (for grouping)">Category: </Label>
</td>
<td>
<input id="category" class="form-control" @bind="@_category" />
@ -38,7 +38,7 @@
</tr>
<tr>
<td>
<Label For="order" HelpText="What place is this field in a larger category list">Order: </Label>
<Label For="order" HelpText="The index order of where this profile item should be displayed">Order: </Label>
</td>
<td>
<input id="order" class="form-control" @bind="@_vieworder" />
@ -46,7 +46,7 @@
</tr>
<tr>
<td>
<Label For="length" HelpText="What is the max amount of characters should this field accept">Length: </Label>
<Label For="length" HelpText="The max number of characters this profile item should accept (enter zero for unlimited)">Length: </Label>
</td>
<td>
<input id="length" class="form-control" @bind="@_maxlength" />
@ -54,7 +54,7 @@
</tr>
<tr>
<td>
<Label For="defaultVal" HelpText="What value do you want this field to start with">Default Value: </Label>
<Label For="defaultVal" HelpText="The default value for this profile item">Default Value: </Label>
</td>
<td>
<input id="defaultVal" class="form-control" @bind="@_defaultvalue" />
@ -62,7 +62,15 @@
</tr>
<tr>
<td>
<Label For="required" HelpText="Is a user required to input something into this field?">Required? </Label>
<Label For="options" HelpText="A comma delimited list of options the user can select from">Options: </Label>
</td>
<td>
<input id="options" class="form-control" @bind="@_options" />
</td>
</tr>
<tr>
<td>
<Label For="required" HelpText="Should a user be required to provide a value for this profile item?">Required? </Label>
</td>
<td>
<select id="required" class="form-control" @bind="@_isrequired">
@ -73,7 +81,7 @@
</tr>
<tr>
<td>
<Label For="private" HelpText="Is this field private?">Private? </Label>
<Label For="private" HelpText="Should this profile item be visible to all users?">Private? </Label>
</td>
<td>
<select id="private" class="form-control" @bind="@_isprivate">
@ -95,6 +103,7 @@
private string _vieworder = "0";
private string _maxlength = "0";
private string _defaultvalue = string.Empty;
private string _options = string.Empty;
private string _isrequired = "False";
private string _isprivate = "False";
@ -119,6 +128,7 @@
_vieworder = profile.ViewOrder.ToString();
_maxlength = profile.MaxLength.ToString();
_defaultvalue = profile.DefaultValue;
_options = profile.Options;
_isrequired = profile.IsRequired.ToString();
_isprivate = profile.IsPrivate.ToString();
}
@ -153,6 +163,7 @@
profile.ViewOrder = int.Parse(_vieworder);
profile.MaxLength = int.Parse(_maxlength);
profile.DefaultValue = _defaultvalue;
profile.Options = _options;
profile.IsRequired = (_isrequired == null ? false : Boolean.Parse(_isrequired));
profile.IsPrivate = (_isprivate == null ? false : Boolean.Parse(_isprivate));
if (_profileid != -1)

View File

@ -1,4 +1,4 @@
@namespace Oqtane.Modules.Admin.UserProfile
@namespace Oqtane.Modules.Admin.UserProfile
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject IUserService UserService
@ -95,13 +95,32 @@ else
<Label For="@p.Name" HelpText="@p.Description">@p.Title</Label>
</td>
<td>
@if (p.IsRequired)
@if (!string.IsNullOrEmpty(p.Options))
{
<input id="@p.Name" class="form-control" maxlength="@p.MaxLength" value="@GetProfileValue(p.Name, p.DefaultValue)" required @onchange="@(e => ProfileChanged(e, p.Name))" />
<select id="@p.Name" class="form-control" @onchange="@(e => ProfileChanged(e, p.Name))">
@foreach (var option in p.Options.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
{
@if(GetProfileValue(p.Name, "") == option || (GetProfileValue(p.Name, "") == "" && p.DefaultValue == option))
{
<option value="@option" selected>@option</option>
}
else
{
<option value="@option">@option</option>
}
}
</select>
}
else
{
<input id="@p.Name" class="form-control" maxlength="@p.MaxLength" value="@GetProfileValue(p.Name, p.DefaultValue)" @onchange="@(e => ProfileChanged(e, p.Name))" />
@if (p.IsRequired)
{
<input id="@p.Name" class="form-control" maxlength="@p.MaxLength" value="@GetProfileValue(p.Name, p.DefaultValue)" required @onchange="@(e => ProfileChanged(e, p.Name))" />
}
else
{
<input id="@p.Name" class="form-control" maxlength="@p.MaxLength" value="@GetProfileValue(p.Name, p.DefaultValue)" @onchange="@(e => ProfileChanged(e, p.Name))" />
}
}
</td>
</tr>

View File

@ -33,6 +33,7 @@
<EmbeddedResource Include="Scripts\Tenant.01.00.01.00.sql" />
<EmbeddedResource Include="Scripts\Tenant.01.00.01.01.sql" />
<EmbeddedResource Include="Scripts\Tenant.01.00.02.01.sql" />
<EmbeddedResource Include="Scripts\Tenant.02.00.00.01.sql" />
<EmbeddedResource Include="Modules\HtmlText\Scripts\HtmlText.1.0.0.sql" />
<EmbeddedResource Include="Modules\HtmlText\Scripts\HtmlText.Uninstall.sql" />
</ItemGroup>
@ -59,6 +60,9 @@
<UpgradeFiles Include="$(ProjectDir)bin\Release\netcoreapp3.1\Oqtane.Upgrade.runtimeconfig.json" />
<TemplateFiles Include="$(ProjectDir)wwwroot\Modules\Templates\**\*.*" />
</ItemGroup>
<ItemGroup>
<None Remove="Scripts\Tenant.02.00.00.01.sql" />
</ItemGroup>
<Target Name="AddPayloadsFolder" AfterTargets="Publish">
<Copy SourceFiles="@(UpgradeFiles)" DestinationFiles="@(UpgradeFiles->'$(PublishDir)%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="false" />
<Copy SourceFiles="@(TemplateFiles)" DestinationFiles="@(TemplateFiles->'$(PublishDir)wwwroot\Modules\Templates\%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="false" />

View File

@ -1,3 +0,0 @@
ALTER TABLE [dbo].[Page]
ALTER COLUMN [Path] [nvarchar](256) NOT NULL
GO

View File

@ -0,0 +1,16 @@
/*
Version 2.0.0 Tenant migration script
*/
ALTER TABLE [dbo].[Page]
ALTER COLUMN [Path] [nvarchar](256) NOT NULL
GO
ALTER TABLE [dbo].[Profile] ADD
[Options] [nvarchar](2000) NULL
GO
UPDATE [dbo].[Profile] SET Options = ''
GO

View File

@ -1,4 +1,4 @@
using System;
using System;
namespace Oqtane.Models
{
@ -15,6 +15,7 @@ namespace Oqtane.Models
public string DefaultValue { get; set; }
public bool IsRequired { get; set; }
public bool IsPrivate { get; set; }
public string Options { get; set; }
public string CreatedBy { get; set; }
public DateTime CreatedOn { get; set; }