fix Swashbuckle reference, fix folder issue in installationmanager, disabled blazor linking on build

This commit is contained in:
Shaun Walker 2019-09-26 18:02:47 -04:00
parent b2c44f970e
commit 00d8f17254
8 changed files with 274 additions and 267 deletions

View File

@ -47,7 +47,7 @@
<option value="<">Before</option>
<option value=">">After</option>
}
<option value=">>" selected>At End</option>
<option value=">>">At End</option>
</select>
@if (children != null && children.Count > 0 && (insert == "<" || insert == ">"))
{
@ -74,12 +74,12 @@
</tr>
<tr>
<td>
<label for="Name" class="control-label">Edit Mode? </label>
<label for="Name" class="control-label">Default Mode? </label>
</td>
<td>
<select class="form-control" @bind="@editmode">
<option value="True">Yes</option>
<option value="False">No</option>
<select class="form-control" @bind="@mode">
<option value="view">View Mode</option>
<option value="edit">Edit Mode</option>
</select>
</td>
</tr>
@ -145,7 +145,7 @@
List<Page> children;
int childid = -1;
string isnavigation = "True";
string editmode = "False";
string mode = "view";
string themetype = "";
string layouttype = "";
string icon = "";
@ -250,7 +250,7 @@
break;
}
page.IsNavigation = (isnavigation == null ? true : Boolean.Parse(isnavigation));
page.EditMode = (editmode == null ? true : Boolean.Parse(editmode));
page.EditMode = (mode == "edit" ? true : false);
page.ThemeType = themetype;
page.LayoutType = (layouttype == null ? "" : layouttype);
page.Icon = (icon == null ? "" : icon);

View File

@ -48,12 +48,12 @@
</tr>
<tr>
<td>
<label for="Name" class="control-label">Edit Mode? </label>
<label for="Name" class="control-label">Default Mode? </label>
</td>
<td>
<select class="form-control" @bind="@editmode" readonly>
<option value="True">Yes</option>
<option value="False">No</option>
<select class="form-control" @bind="@mode">
<option value="view">View Mode</option>
<option value="edit">Edit Mode</option>
</select>
</td>
</tr>
@ -119,7 +119,7 @@
string path;
string parentid = "";
string isnavigation;
string editmode;
string mode;
string themetype;
string layouttype;
string icon;
@ -145,7 +145,7 @@
name = page.Name;
path = page.Path;
isnavigation = page.IsNavigation.ToString();
editmode = page.EditMode.ToString();
mode = (page.EditMode) ? "edit" : "view";
themetype = page.ThemeType;
layouttype = page.LayoutType;
icon = page.Icon;

View File

@ -50,7 +50,7 @@
<select class="form-control" @bind="@insert">
@if (parentid == currentparentid)
{
<option value="">&lt;Maintain Current Location&gt;</option>
<option value="=">&lt;Maintain Current Location&gt;</option>
}
<option value="<<">To Beginning</option>
@if (children != null && children.Count > 0)
@ -58,7 +58,7 @@
<option value="<">Before</option>
<option value=">">After</option>
}
<option value=">>" selected>To End</option>
<option value=">>">To End</option>
</select>
@if (children != null && children.Count > 0 && (insert == "<" || insert == ">"))
{
@ -85,12 +85,12 @@
</tr>
<tr>
<td>
<label for="Name" class="control-label">Edit Mode? </label>
<label for="Name" class="control-label">Default Mode? </label>
</td>
<td>
<select class="form-control" @bind="@editmode">
<option value="True">Yes</option>
<option value="False">No</option>
<select class="form-control" @bind="@mode">
<option value="view">View Mode</option>
<option value="edit">Edit Mode</option>
</select>
</td>
</tr>
@ -157,11 +157,11 @@
string path;
string currentparentid;
string parentid;
string insert = "";
string insert = "=";
List<Page> children;
int childid = -1;
string isnavigation;
string editmode;
string mode;
string themetype;
string layouttype;
string icon;
@ -203,7 +203,7 @@
}
currentparentid = parentid;
isnavigation = page.IsNavigation.ToString();
editmode = page.EditMode.ToString();
mode = (page.EditMode) ? "edit" : "view";
themetype = page.ThemeType;
layouttype = page.LayoutType;
icon = page.Icon;
@ -235,7 +235,7 @@
}
if (parentid == currentparentid)
{
insert = "";
insert = "=";
}
else
{
@ -283,7 +283,7 @@
page.Path = parent.Path + "/" + Utilities.GetFriendlyUrl(path);
}
}
if (insert != "")
if (insert != "=")
{
Page child;
switch (insert)
@ -305,7 +305,7 @@
}
}
page.IsNavigation = (isnavigation == null ? true : Boolean.Parse(isnavigation));
page.EditMode = (editmode == null ? true : Boolean.Parse(editmode));
page.EditMode = (mode == "edit" ? true : false);
page.ThemeType = themetype;
page.LayoutType = (layouttype == null ? "" : layouttype);
page.Icon = (icon == null ? "" : icon);

View File

@ -3,6 +3,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<OutputType>Exe</OutputType>
<BlazorLinkOnBuild>false</BlazorLinkOnBuild>
<RestoreAdditionalProjectSources>
https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json;
https://dotnet.myget.org/F/blazor-dev/api/v3/index.json;

View File

@ -28,23 +28,21 @@ window.interop = {
return "";
}
},
addCSS: function (fileName) {
var head = document.head;
addCSS: function (id, url) {
if (document.getElementById(id) === null) {
var link = document.createElement("link");
link.id = id;
link.type = "text/css";
link.rel = "stylesheet";
link.href = fileName;
head.appendChild(link);
link.href = url;
document.head.appendChild(link);
}
},
removeCSS: function (filePattern) {
var head = document.head;
removeCSS: function (pattern) {
var links = document.getElementsByTagName("link");
for (var i = 0; i < links.length; i++) {
var link = links[i];
if (link.rel === 'stylesheet' && link.href.includes(filePattern)) {
head.removeChild(link);
if (links[i].id.includes(pattern)) {
document.head.removeChild(links[i]);
}
}
},

View File

@ -57,7 +57,12 @@ namespace Oqtane.Infrastructure
case ".svg":
case ".js":
case ".css":
entry.ExtractToFile(folder + "\\" + entry.FullName.Replace("wwwroot", name).Replace("/","\\"), true);
filename = folder + "\\" + entry.FullName.Replace("wwwroot", name).Replace("/", "\\");
if (!Directory.Exists(Path.GetDirectoryName(filename)))
{
Directory.CreateDirectory(Path.GetDirectoryName(filename));
}
entry.ExtractToFile(filename, true);
break;
}
}

View File

@ -276,6 +276,16 @@ namespace Oqtane.Server
// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
public void ConfigureServices(IServiceCollection services)
{
// register authorization services
services.AddAuthorizationCore(options =>
{
options.AddPolicy("ViewPage", policy => policy.Requirements.Add(new PermissionRequirement("Page", "View")));
options.AddPolicy("EditPage", policy => policy.Requirements.Add(new PermissionRequirement("Page", "Edit")));
options.AddPolicy("ViewModule", policy => policy.Requirements.Add(new PermissionRequirement("Module", "View")));
options.AddPolicy("EditModule", policy => policy.Requirements.Add(new PermissionRequirement("Module", "Edit")));
});
services.AddScoped<IAuthorizationHandler, PermissionHandler>();
services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
services.AddDbContext<MasterDBContext>(options =>
@ -307,15 +317,8 @@ namespace Oqtane.Server
options.User.RequireUniqueEmail = false;
});
// register authorization services
services.AddAuthorizationCore(options =>
{
options.AddPolicy("ViewPage", policy => policy.Requirements.Add(new PermissionRequirement("Page", "View")));
options.AddPolicy("EditPage", policy => policy.Requirements.Add(new PermissionRequirement("Page", "Edit")));
options.AddPolicy("ViewModule", policy => policy.Requirements.Add(new PermissionRequirement("Module", "View")));
options.AddPolicy("EditModule", policy => policy.Requirements.Add(new PermissionRequirement("Module", "Edit")));
});
services.AddScoped<IAuthorizationHandler, PermissionHandler>();
services.AddAuthentication(IdentityConstants.ApplicationScheme)
.AddCookie(IdentityConstants.ApplicationScheme);
services.ConfigureApplicationCookie(options =>
{

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB