Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This 'comments' branch added comments function for post #336

Open
wants to merge 37 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
3ee2908
Changes to OIDC
LinQiaoPorco Nov 22, 2021
ef10f13
Start for new
LinQiaoPorco Dec 15, 2021
3bfcde2
Add Roles to OIDC
LinQiaoPorco Dec 28, 2021
ffa0c11
Fail at Logout Redirect
LinQiaoPorco Dec 29, 2021
67f5573
Success with Logout in Controller, newly add author has error
LinQiaoPorco Dec 29, 2021
896fa81
Profile Bio Failure
LinQiaoPorco Jan 4, 2022
36e3f87
Success with OpenID
LinQiaoPorco Feb 6, 2022
09a3213
Login at any page finished
LinQiaoPorco Feb 16, 2022
86a3a7e
Add Comment 1st stage, Need test
LinQiaoPorco Feb 22, 2022
0897564
Start with Comment System
LinQiaoPorco Mar 3, 2022
924ee78
HttpClient Success
LinQiaoPorco Mar 5, 2022
40ca57a
To .net6
LinQiaoPorco Mar 7, 2022
e133e60
demo.yml
LinQiaoPorco Mar 7, 2022
b44912b
Start from 0 to import Editor
LinQiaoPorco Mar 11, 2022
45b77cf
EasyMDE issue: flash and disappear
LinQiaoPorco Apr 7, 2022
94c0042
Editor Success show
LinQiaoPorco Apr 10, 2022
ce9ed43
Separte Editor and Comment, upload have issues
LinQiaoPorco Apr 11, 2022
7a166c4
File Position Change
LinQiaoPorco Apr 13, 2022
836751c
Change POST from Razor to View did not help
LinQiaoPorco Apr 14, 2022
615def5
Async Refresh success
Apr 17, 2022
27c143e
Upload from cshtml
Apr 20, 2022
6426636
Cookie in Editor works!
LinQiaoPorco May 5, 2022
80bb322
Start with Comment Card Component
LinQiaoPorco May 11, 2022
a93eefd
Level 2 comment OK, Thumbup next
May 12, 2022
c4bb65e
Small changes
LinQiaoPorco May 13, 2022
a8e2a76
Format Error
LinQiaoPorco May 16, 2022
00cdb96
FakeEditor OK
May 16, 2022
0a4d4f3
Mess with Comment Editor
LinQiaoPorco May 18, 2022
bda9466
Comment OK, need study setEditorValue
LinQiaoPorco May 19, 2022
fc4a57b
setEditorValue OK
LinQiaoPorco May 19, 2022
8535b4f
OK with Thumbup
May 19, 2022
cdda5b2
Editor with Content is not steady
LinQiaoPorco May 23, 2022
6d84b2b
SyncMiddleware OK to sync, but need to do a short circut
May 28, 2022
4f87be5
OK to redirect to Chinese URI with encode
May 29, 2022
77ca2d1
Warning Modal OK
May 29, 2022
9bbc15a
Add badge to Author
LinQiaoPorco May 30, 2022
311bc8e
New Secret
LinQiaoPorco May 31, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 20 additions & 21 deletions .github/workflows/demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,28 @@ jobs:
deploy-demo:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]

- name: Checkout
uses: actions/[email protected]

- uses: actions/cache@v2
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
- uses: actions/cache@v2
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.x'
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: "6.0.x"

- name: Publish Blogifier
run: dotnet publish -c Release -o release --nologo
- name: Publish Blogifier
run: dotnet publish -c Release -o release --nologo

- name: Add .nojekyll file
run: touch release/.nojekyll
- name: Add .nojekyll file
run: touch release/.nojekyll

- name: Deploy
uses: JamesIves/[email protected]
with:
branch: demo
folder: release
- name: Deploy
uses: JamesIves/[email protected]
with:
branch: demo
folder: release
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ StyleCopReport.xml
*.svclog
*.scc


# Chutzpah Test files
_Chutzpah*

Expand Down Expand Up @@ -256,6 +257,9 @@ ServiceFabricBackup/
*.ldf
*.ndf

# SQLite SQL files
*.sql

# Business Intelligence projects
*.rdl.data
*.bim.layout
Expand Down Expand Up @@ -350,3 +354,6 @@ MigrationBackup/
.ionide/

.DS_Store

# Development json file shall ignore
src/Blogifier/appsettings.Development.json
6 changes: 6 additions & 0 deletions .vscode/iisexpress.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"port": 5089,
"path": "./",
"clr": "v4.0",
"protocol": "http"
}
1 change: 1 addition & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"version": "0.2.0",
"configurations": [

{
"name": "Launch and Debug Blazor WebAssembly App",
"type": "coreclr",
Expand Down
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"restructuredtext.pythonRecommendation.disabled": true,
"restructuredtext.languageServer.disabled": true,
"razor.disableBlazorDebugPrompt": true
}
5 changes: 5 additions & 0 deletions .vscode/solution-explorer/class.cs-template
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
namespace {{namespace}};

public class {{name}}
{
}
3 changes: 3 additions & 0 deletions .vscode/solution-explorer/class.ts-template
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export class {{name}} {

}
9 changes: 9 additions & 0 deletions .vscode/solution-explorer/class.vb-template
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Imports System

Namespace {{namespace}}

Public Class {{name}}

End Class

End Namespace
3 changes: 3 additions & 0 deletions .vscode/solution-explorer/default.ts-template
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {{name}} {

}
5 changes: 5 additions & 0 deletions .vscode/solution-explorer/enum.cs-template
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
namespace {{namespace}};

public enum {{name}}
{
}
5 changes: 5 additions & 0 deletions .vscode/solution-explorer/interface.cs-template
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
namespace {{namespace}};

public interface {{name}}
{
}
3 changes: 3 additions & 0 deletions .vscode/solution-explorer/interface.ts-template
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export interface {{name}} {

}
46 changes: 46 additions & 0 deletions .vscode/solution-explorer/template-list.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"templates": [
{
"name": "Class",
"extension": "cs",
"file": "./class.cs-template",
"parameters": "./template-parameters.js"
},
{
"name": "Interface",
"extension": "cs",
"file": "./interface.cs-template",
"parameters": "./template-parameters.js"
},
{
"name": "Enum",
"extension": "cs",
"file": "./enum.cs-template",
"parameters": "./template-parameters.js"
},
{
"name": "Class",
"extension": "ts",
"file": "./class.ts-template",
"parameters": "./template-parameters.js"
},
{
"name": "Interface",
"extension": "ts",
"file": "./interface.ts-template",
"parameters": "./template-parameters.js"
},
{
"name": "Default",
"extension": "ts",
"file": "./default.ts-template",
"parameters": "./template-parameters.js"
},
{
"name": "Class",
"extension": "vb",
"file": "./class.vb-template",
"parameters": "./template-parameters.js"
}
]
}
17 changes: 17 additions & 0 deletions .vscode/solution-explorer/template-parameters.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
var path = require("path");

module.exports = function(filename, projectPath, folderPath) {
var namespace = "Unknown";
if (projectPath) {
namespace = path.basename(projectPath, path.extname(projectPath));
if (folderPath) {
namespace += "." + folderPath.replace(path.dirname(projectPath), "").substring(1).replace(/[\\\/]/g, ".");
}
namespace = namespace.replace(/[\\\-]/g, "_");
}

return {
namespace: namespace,
name: path.basename(filename, path.extname(filename))
}
};
5 changes: 5 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"sdk": {
"version": "6.0.200"
}
}
4 changes: 4 additions & 0 deletions src/Blogifier.Admin/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"restructuredtext.pythonRecommendation.disabled": true,
"restructuredtext.languageServer.disabled": true
}
46 changes: 23 additions & 23 deletions src/Blogifier.Admin/BlogAuthenticationStateProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,32 @@
using System.Net.Http.Json;
using System.Security.Claims;
using System.Threading.Tasks;
using System;

namespace Blogifier.Admin
{
public class BlogAuthenticationStateProvider : AuthenticationStateProvider
{
private readonly HttpClient _httpClient;
public class BlogAuthenticationStateProvider : AuthenticationStateProvider
{
private readonly HttpClient _httpClient;

public BlogAuthenticationStateProvider(HttpClient httpClient)
{
_httpClient = httpClient;
}
public BlogAuthenticationStateProvider(HttpClient httpClient)
{
_httpClient = httpClient;
}

public override async Task<AuthenticationState> GetAuthenticationStateAsync()
{
Author author = await _httpClient.GetFromJsonAsync<Author>("api/author/getcurrent");
public override async Task<AuthenticationState> GetAuthenticationStateAsync()
{
Author author = await _httpClient.GetFromJsonAsync<Author>("api/author/getcurrent");
if (author != null && author.Email != null && author.IsAdmin)
{
var claim = new Claim(ClaimTypes.Name, author.Email);
var claimsIdentity = new ClaimsIdentity(new[] { claim }, "serverAuth");
var claimsPrincipal = new ClaimsPrincipal(claimsIdentity);

if (author != null && author.Email != null)
{
var claim = new Claim(ClaimTypes.Name, author.Email);
var claimsIdentity = new ClaimsIdentity(new[] { claim }, "serverAuth");
var claimsPrincipal = new ClaimsPrincipal(claimsIdentity);

return new AuthenticationState(claimsPrincipal);
}
else
return new AuthenticationState(new ClaimsPrincipal(new ClaimsIdentity()));
}
}
}
return new AuthenticationState(claimsPrincipal);
}
else
return new AuthenticationState(new ClaimsPrincipal(new ClaimsIdentity()));
}
}
}
13 changes: 7 additions & 6 deletions src/Blogifier.Admin/Blogifier.Admin.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Blazored.Typeahead" Version="4.6.0" />
<PackageReference Include="ChartJs.Blazor.Fork" Version="2.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="5.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="5.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="5.0.3" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="6.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="6.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.2" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="5.0.3" />
<PackageReference Include="System.Net.Http.Json" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="6.0.2" />
<PackageReference Include="System.Net.Http.Json" Version="6.0.0" />
<PackageReference Include="Sotsera.Blazor.Toaster" Version="3.0.0" />
</ItemGroup>
<ItemGroup>
Expand Down
Loading