Commit Graph

4114 Commits (4ce5d0c2cfa05b310ea4de59636c5de392692525)

Author SHA1 Message Date
Ryan Wang 540a488d5b chore: release 2.0.0-rc.2 (halo-dev/console#728)
#### What type of PR is this?

/kind improvement

#### What this PR does / why we need it:

发布 Console 2.0.0-rc.2

#### Does this PR introduce a user-facing change?

```release-note
None
```
2022-11-28 15:14:18 +00:00
Ryan Wang d3060f61d3 perf: allow clicking on the link address of the data list (halo-dev/console#712)
#### What type of PR is this?

/kind improvement
/milestone 2.0

#### What this PR does / why we need it:

为部分包含了主题端路由的资源添加跳转按钮或者链接。

#### Screenshots:

<img width="618" alt="image" src="https://user-images.githubusercontent.com/21301288/203952290-6d04f192-de83-4d6e-b9cf-b89463034b12.png">


#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

#### Does this PR introduce a user-facing change?

```release-note
Console 端部分包含了主题端路由的数据列表添加跳转按钮或者链接。
```
2022-11-28 14:34:19 +00:00
Ryan Wang 20a55aa016 feat: support for opening login modal after login session expiration (halo-dev/console#715)
#### What type of PR is this?

/kind feature
/milestone 2.0

#### What this PR does / why we need it:

支持在登录会话失效之后打开登录弹窗,而不是直接跳转到登录页面,防止正在编辑的内容丢失。

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/2783

#### Screenshots:

<img width="541" alt="image" src="https://user-images.githubusercontent.com/21301288/204085654-5c90627b-fbbd-4b04-ac92-f75bab28a1b0.png">


#### Special notes for your reviewer:

测试方式:

1. 打开 Console 之后登录进入到控制台。
2. 重启 Halo 或者等待会话失效。
3. 随意切换控制台界面,观察是否打开了登录弹窗。
4. 重新登录,检查是否成功。

#### Does this PR introduce a user-facing change?

```release-note
Console 端支持在登录会话失效之后打开登录弹窗。
```
2022-11-28 14:30:19 +00:00
Ryan Wang 7d004e33d4 fix: the issue that role edit form cannot be submitted in the permission tab (halo-dev/console#717)
#### What type of PR is this?

/kind bug
/milestone 2.0-rc.2

#### What this PR does / why we need it:

修复在角色编辑时,如果在权限勾选界面,无法提交表单的问题。

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/2778

#### Special notes for your reviewer:

测试方式:

1. 编辑任意角色或者新建角色。
2. 在编辑弹框中切换到权限勾选界面。
3. 点击提交按钮,观察是否能够正常提交。

#### Does this PR introduce a user-facing change?

```release-note
修复在 Console 端角色编辑时,如果在权限勾选界面,无法提交表单的问题。
```
2022-11-28 14:20:18 +00:00
Ryan Wang 9fc27a01e6 fix: issue of uploading attachments to ungrouped group (halo-dev/console#716)
#### What type of PR is this?

/kind bug
/milestone 2.0-rc.2

#### What this PR does / why we need it:

修复选择未分组的分组时,上传附件会将分组设置为 `ungrouped` 的问题。

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/2777

#### Special notes for your reviewer:

测试方式:

1. 新建若干附件分组。
2. 切换到未分组,然后打开上传弹框,上传若干附件。
3. 检查所上传附件是否归为未分组。
4. 切换到其他分组,上传若干附件,检查所上传附件是否归为正确分组。

#### Does this PR introduce a user-facing change?

```release-note
修复在 Console 端选择未分组的分组时,上传附件会将分组设置为 `ungrouped` 的问题。
```
2022-11-28 14:00:18 +00:00
Ryan Wang 95ee267117 feat: set the approvedTime field during approve (halo-dev/console#713)
#### What type of PR is this?

/kind improvement
/milestone 2.0

#### What this PR does / why we need it:

评论或者回复审核时设置审核时间。适配:https://github.com/halo-dev/halo/pull/2746

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/2738

#### Special notes for your reviewer:

测试方式:

1. Halo 需要切换到 https://github.com/halo-dev/halo/issues/2738 分支。
2. Console 需要 `pnpm install`
3. 在主题端创建若干评论,然后去 Console 端审核通过,检查是否正常设置了审核时间。

#### Does this PR introduce a user-facing change?

```release-note
Console 端在评论或者回复审核时设置审核时间。
```
2022-11-28 13:28:18 +00:00
Ryan Wang 086155d6f8 feat: post list supports displaying the pinned status (halo-dev/console#720)
#### What type of PR is this?

/kind feature
/milestone 2.0.0-rc.2

#### What this PR does / why we need it:

支持在文章管理列表显示文章置顶标识。

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/2678

#### Screenshots:

<img width="330" alt="image" src="https://user-images.githubusercontent.com/21301288/204138598-9a9265b2-cc2d-4fe6-9059-a804de72ca44.png">

#### Special notes for your reviewer:

测试方式:

1. 创建若干文章。
2. 将部分文章设置为置顶。
3. 返回到列表检查是否有置顶标识。

#### Does this PR introduce a user-facing change?


```release-note
Console 端支持在文章管理列表显示文章置顶标识。
```
2022-11-28 13:10:18 +00:00
John Niang 5be038834e
Fix the problem that lucene crashes when searching for posts (#2791)
#### What type of PR is this?

/kind bug
/area core
/milestone 2.0.0-rc.2

#### What this PR does / why we need it:

This PR mainly refactor PostEventListener into PostEventReconciler to reconcile post events synchronously. After that, the concurrent issue will be gone.

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/2756
Fixes https://github.com/halo-dev/halo/issues/2757

#### Does this PR introduce a user-facing change?

```release-note
None
```
2022-11-28 11:28:19 +00:00
Ryan Wang a4a6ff42a6 perf: remove the list of users under role details (halo-dev/console#726)
#### What type of PR is this?

/kind improvement
/milestone 2.0.0-rc.2

#### What this PR does / why we need it:

移除角色详情页面的用户列表,当前后端暂不支持通过角色查询其下用户。

#### Special notes for your reviewer:

None

#### Does this PR introduce a user-facing change?


```release-note
None
```
2022-11-28 11:28:19 +00:00
Ryan Wang 99b2966ac1 fix: the issue that the menu is not updated after the menu item is deleted (halo-dev/console#725)
#### What type of PR is this?

/kind bug
/milestone 2.0.0-rc.2

#### What this PR does / why we need it:

修复当菜单项被删除时,没有更新菜单的问题。

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/2561

#### Special notes for your reviewer:

测试方式:

1. 创建一个菜单,添加若干个菜单项。
2. 删除部分菜单项,检查菜单下的菜单项个数是否正确。

#### Does this PR introduce a user-facing change?

```release-note
修复 Console 端当菜单项被删除时,没有更新菜单的问题。
```
2022-11-28 11:26:17 +00:00
Ryan Wang 23838d5236 perf: formkit post input type only queries the available (halo-dev/console#724)
#### What type of PR is this?

/kind improvement
/milestone 2.0.0-rc.2

#### What this PR does / why we need it:

FormKit 的文章和自定义页面选择器仅查询可用的文章或自定义页面。

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/2790

#### Special notes for your reviewer:

测试方式:

1. 创建若干文章和自定义页面,然后删除一部分,再将一部分设置为未发布。
2. 进入菜单管理新建菜单项,选择文章或者自定义页面类型。
3. 检查是否包含被删除或者未发布的文章和自定义页面。

#### Does this PR introduce a user-facing change?


```release-note
None
```
2022-11-28 11:24:21 +00:00
Ryan Wang 05b21c225f chore: bump @halo-dev/richtext-editor to support more features (halo-dev/console#722)
#### What type of PR is this?

/kind improvement
/milestone 2.0.0-rc.2

#### What this PR does / why we need it:

升级 `@halo-dev/richtext-editor`。

1. 支持在工具栏显示有序列表、无序列表、任务列表的按钮。
2. 为工具栏的按钮添加 tooltip 提示。
3. 在工具栏添加高亮文字的按钮。
4. 在快捷操作列表添加有序列表、无序列表、任务列表、表格、普通文本的操作项。
5. 修复编辑器文字过长导致的布局问题。 Fixes https://github.com/halo-dev/halo/issues/2722

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/2722

#### Screenshots:

<img width="1376" alt="image" src="https://user-images.githubusercontent.com/21301288/204190762-5fba0bc6-5f15-4283-881a-cc90abd754df.png">

#### Special notes for your reviewer:

测试方式:

1. 需要 `pnpm install`
2. 测试上述功能是否正常。

#### Does this PR introduce a user-facing change?

```release-note
Console 端编辑器的工具栏支持列表、文字高亮等功能。
```
2022-11-28 11:22:25 +00:00
Ryan Wang bf1ef171d0 feat: add support for automatic label color calculation for post tags (halo-dev/console#721)
#### What type of PR is this?

/kind feature
/milestone 2.0.0-rc.2

#### What this PR does / why we need it:

添加自动计算文章标签文字颜色的支持。在之前的版本中,因为引入 colorjs.io 导致在构建之后无法显示标签,目前 colorjs.io 已经修复此问题,此 PR 回归之前的支持。

- https://github.com/LeaVerou/color.js/releases/tag/v0.4.2
- https://github.com/LeaVerou/color.js/pull/239

#### Special notes for your reviewer:

测试方式:

1. 创建若干文章标签,设置不同的背景色,观察文字颜色是否会自动与背景颜色形成反差。
2. 使用 `pnpm build` 构建生产版本,在 Halo 的配置文件中配置 `halo.console.location` 到 Console 的 `dist` 目录。
3. 检查 Console 文章列表中的标签是否显示正常。

#### Does this PR introduce a user-facing change?


```release-note
Console 端添加自动计算文章标签文字颜色的支持。
```
2022-11-28 06:36:16 +00:00
BugKing 569cea4ab8
Refine configuration for dev profile (#2753)
#### What type of PR is this?

/kind improvement

#### What this PR does / why we need it:

1. 增加console代理配置,默认代理到`http://localhost:3000/`。
2. 增加用户名密码初始化配置。
3. 增加win profile,指定与dev profile中不同的r2dbc url,windows环境下调试时可以使用 `dev,win` profile。

#### Does this PR introduce a user-facing change?

```release-note
None
```
2022-11-28 06:26:16 +00:00
BugKing 00aa964fb3 perf: unify the copywriting style of confirms (halo-dev/console#723)
#### What type of PR is this?

/kind improvement
/milestone 2.0

#### What this PR does / why we need it:

修改了各个删除操作提示弹框的信息,统一了文本风格。
原本存在 `是否确认删除xxx?` 和 `确定删除xxx吗?` 两种风格,统一为后一种风格。

#### Does this PR introduce a user-facing change?

```release-note
优化 Console 端确认弹框的提示文案。
```
2022-11-28 06:20:17 +00:00
guqing de983a2e46
refactor: cannot reload when settingName is not configured before (#2745)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.0.0-rc.1
/kind api-change

#### What this PR does / why we need it:
- 修复 theme.yaml 之前没有配置过 settingName 会无法 reload 的问题
- 将 `/themes/{name}/reload-setting` 的 API 修改为 `/themes/{name}/reload`

#### Which issue(s) this PR fixes:

Fixes #2735

#### Special notes for your reviewer:
/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?

```release-note
修复 theme.yaml 之前没有配置过 settingName 会无法 reload 的问题
```
2022-11-28 03:00:17 +00:00
Ryan Wang c21b0fdfe8 chore: bump @halo-dev/api-client for reload theme api (halo-dev/console#711)
#### What type of PR is this?

/kind api-change
/milestone 2.0

#### What this PR does / why we need it:

升级 `@halo-dev/api-client` 以适配 https://github.com/halo-dev/halo/pull/2745

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/2735

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

测试方式:

1. Halo 需要切换到 https://github.com/halo-dev/halo/issues/2735 分支。
2. Console 需要 `pnpm install`
3. 安装一个主题,并尝试修改 `theme.yaml` 和 `settings.yaml`,然后再主题详情页面点击 `刷新设置表单` 的按钮,检查改动是否被更新。

#### Does this PR introduce a user-facing change?

```release-note
None
```
2022-11-28 02:50:17 +00:00
Ryan Wang 4f4f35c67f
chore: update issue templates for Halo 2.0 (#2788)
#### What type of PR is this?

/kind improvement

#### What this PR does / why we need it:

为 Halo 2.0 更新 issue 模板。

#### Special notes for your reviewer:

效果可以查看:

- https://github.com/ruibaby/halo/issues/new?assignees=&labels=bug&template=bug_report.zh.yml
- https://github.com/ruibaby/halo/issues/new?assignees=&labels=&template=feature_request.zh.yml

#### Does this PR introduce a user-facing change?

```release-note
None
```
2022-11-28 01:36:17 +00:00
Ryan Wang ff236810d9 chore: bump @halo-dev/richtext-editor version (halo-dev/console#719)
#### What type of PR is this?

/kind improvement
/milestone 2.0.0-rc.2

#### What this PR does / why we need it:

升级 `@halo-dev/richtext-editor` 版本以支持图片放大缩小、嵌入网页、表格。

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/2681

#### Screenshots:

<img width="1377" alt="image" src="https://user-images.githubusercontent.com/21301288/204129594-6b4c2b4e-4eb4-4cf5-b1ca-39097843fadf.png">
<img width="1375" alt="image" src="https://user-images.githubusercontent.com/21301288/204129660-e7c415eb-db70-405b-97cc-2ed05bcaa034.png">


#### Special notes for your reviewer:

测试方式:

1. 需要 `pnpm install`
2. 测试编辑器的图片放大缩小、嵌入网页、表格等功能。

#### Does this PR introduce a user-facing change?

```release-note
Console 端编辑器支持图片放大缩小、嵌入网页、表格。
```
2022-11-28 01:34:16 +00:00
Ryan Wang cedb351156 chore: add @Aanko to reviewer list (halo-dev/console#714)
#### What type of PR is this?

/kind improvement

#### What this PR does / why we need it:

将 @Aanko 添加到 Reviewer 列表。

#### Does this PR introduce a user-facing change?

```release-note
None
```
2022-11-26 02:56:10 +00:00
John Niang 145cfb88b7
Delegate ReactiveExtensionClient for default implementation of ExtensionClient (#2774)
#### What type of PR is this?

/kind bug
/kind cleanup
/area core

#### What this PR does / why we need it:

This PR fully delegates ReactiveExtensionClient for default implementation of ExtensionClient and remove old implementation, including its tests. The main reason I delegate is for keeping consistent about implementation of ExtensionClient.

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/2755

#### Special notes for your reviewer:

You can test full functions after starting Halo with current changes.

#### Does this PR introduce a user-facing change?

```release-note
None
```
2022-11-25 13:41:25 +00:00
guqing 21c18d4b9a
feat: add approvedTime for comment and reply (#2746)
#### What type of PR is this?
/kind feature
/milestone 2.0.0-rc.1
/kind api-change
/area core

#### What this PR does / why we need it:
评论和回复新增 approvedTime 属性
1. 此属性在创建时如果是不需要审核就公开的则会填充当前时间
2. 目前没有审核功能,审核是 Console 端去更新的 approved 字段,因此需要更新 approved 时判断有没有设置 approvedTime 没有则填充当前时间,后续有审核功能后则再由后端处理

#### Which issue(s) this PR fixes:

Fixes #2738

#### Special notes for your reviewer:
/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?

```release-note
评论和回复新增 approvedTime 属性
```
2022-11-25 13:33:25 +00:00
John Niang 0df7857ef8
Refactor reconcilers registration (#2737)
#### What type of PR is this?

/kind cleanup
/kind improvement
/area core
/milestone 2.0.0

#### What this PR does / why we need it:

This PR mainly refactors registration of reconcilers to register reconciler more convinient. After that, it is possible to reigster and start reconciler in plugin.

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/2305

#### Does this PR introduce a user-facing change?

```release-note
None
```
2022-11-25 11:13:09 +00:00
guqing 98db7c6aff
chore: upgrade to PF4J 3.8.0 (#2772)
#### What type of PR is this?
/kind improvement
/area core

#### What this PR does / why we need it:
see also https://github.com/pf4j/pf4j/compare/release-3.7.0...release-3.8.0

#### Which issue(s) this PR fixes:

Fixes #2771

#### Special notes for your reviewer:
/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?

```release-note
升级依赖 PF4J 至 3.8.0
```
2022-11-25 11:05:07 +00:00
John Niang 1b888dfb3e
Upgrade to Spring Boot 3.0.0 (#2768)
#### What type of PR is this?

/kind improvement
/area core

#### What this PR does / why we need it:

See https://github.com/halo-dev/halo/issues/2766 for more.

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/2766

#### Does this PR introduce a user-facing change?

```release-note
升级依赖 Spring Boot 至 3.0.0
```
2022-11-25 02:33:06 +00:00
John Niang 368d8f4ef4
Upgrade to SpringDoc OpenAPI 2.0.0 (#2769)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.0.0-rc.2

#### What this PR does / why we need it:

See https://github.com/halo-dev/halo/issues/2767 for more.

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/2767

#### Does this PR introduce a user-facing change?

```release-note
升级依赖 SpringDoc OpenAPI 至 2.0.0
```
2022-11-25 02:31:07 +00:00
Ryan Wang 5bf7851a1a
docs: update readme for Halo 2.0.0-rc.1 and new slogan (#2763)
#### What type of PR is this?

/kind documentation

#### What this PR does / why we need it:

为 Halo 2.0.0-rc.1 更新 README。

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo 

#### Does this PR introduce a user-facing change?

```release-note
None
```
2022-11-24 15:51:06 +00:00
Ryan Wang 48471b0b8d chore: release 2.0.0-rc.1 (halo-dev/console#710)
#### What type of PR is this?

/kind improvement
/milestone 2.0

#### What this PR does / why we need it:

修改版本号以发布 Console 2.0.0-rc.1

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

#### Does this PR introduce a user-facing change?

```release-note
None
```
2022-11-24 15:17:06 +00:00
Ryan Wang 210d5e8b3e perf: back to post list when post is first created (halo-dev/console#709)
#### What type of PR is this?

/kind improvement
/milestone 2.0

#### What this PR does / why we need it:

首次创建文章或者自定义页面时,跳转回管理列表,与编辑保持一致。

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

测试方式:创建一篇新的文章或自定义页面,点击发布,观察是否返回到了管理列表。

#### Does this PR introduce a user-facing change?

```release-note
None
```
2022-11-24 14:59:06 +00:00
guqing 16e4e46e40
fix: cannot be published successfully after post or single page unpublished (#2762)
#### What type of PR is this?
/kind bug
/area core
/milestone 2.0.0-rc.1

#### What this PR does / why we need it:
修复文章和自定义页面取消发布后无法再继续发布的问题

#### Special notes for yourd reviewer:
how to test it?
1. create a post and publsih it
2. unpublish it then republish
3. excepted to b published successfully

/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?
```release-note
None
```
2022-11-24 14:53:06 +00:00
Ryan Wang 73676ee815 fix: splash screen issue caused by refreshing the list at regular intervals (halo-dev/console#708)
#### What type of PR is this?

/kind bug
/milestone 2.0

#### What this PR does / why we need it:

修复因为 https://github.com/halo-dev/console/pull/703 中添加了 Loading 动画但是没有考虑到定时刷新列表导致页面闪动的问题。

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

测试方式:删除任意资源,检查列表定时刷新的时候是否出现 loading 状态。

#### Does this PR introduce a user-facing change?

```release-note
None
```
2022-11-24 14:51:07 +00:00
John Niang 12fd77f61f
Set mode of frame options to SAMEORIGIN (#2761)
#### What type of PR is this?

/kind bug
/area core

#### What this PR does / why we need it:

The problem https://github.com/halo-dev/halo/issues/2743 was introduced by https://github.com/halo-dev/halo/pull/2729. This Pr mainly resolves it by setting SAMEORIGIN mode for frame options.

![image](https://user-images.githubusercontent.com/16865714/203795956-6efec450-da5f-4222-884d-5a67cb113173.png)

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/2743

#### Special notes for your reviewer:

#### Does this PR introduce a user-facing change?

```release-note
None
```
2022-11-24 13:39:06 +00:00
guqing 61c7459ccf
refactor: check whether plugin has been loaded when startup (#2759)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.0.0-rc.1

#### What this PR does / why we need it:
插件以开发模式启动时加载插件需判断是否已经加载过

#### Which issue(s) this PR fixes:

Fixes #2758

#### Special notes for your reviewer:
how to test it?
1. 配置 `halo.plugin.fixed-plugin-path`
2. 以开发模式启动后重启几次不会出现  #2758 中描述的异常

/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?

```release-note
修复插件以开发模式启动时会出现插件已经加载过的异常
```
2022-11-24 13:37:06 +00:00
Ryan Wang e7ac73f0b6 chore: bump dependencies (halo-dev/console#707)
#### What type of PR is this?

/kind improvement
/milestone 2.0

#### What this PR does / why we need it:

升级所有依赖的 patch 版本。

#### Does this PR introduce a user-facing change?

```release-note
None
```
2022-11-24 13:29:06 +00:00
Ryan Wang 65919c3d30 feat: add query attachments by ungrouped parameter support (halo-dev/console#706)
#### What type of PR is this?

/kind feature
/milestone 2.0

#### What this PR does / why we need it:

附件管理支持通过参数筛选出未分组的附件。适配 https://github.com/halo-dev/halo/pull/2752

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/2451

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

测试方式:

1. Halo 需要切换到 https://github.com/halo-dev/halo/pull/2752 分支。
2. Console 需要 `pnpm install`
3. 上传若干未分组附件,然后切换到未分组的标签,检查是否查询正确。
4. 将部分附件移动至某个分组,在切换到未分组的标签,检查附件是否正确。

#### Does this PR introduce a user-facing change?


```release-note
附件管理支持未分组的筛选条件。
```
2022-11-24 13:17:05 +00:00
guqing a76ade8aa8
feat: add global error web exception handler (#2741)
#### What type of PR is this?
/kind feature
/milestone 2.0.0-rc.1
/area core

#### What this PR does / why we need it:
新增全局异常处理
参考文档:
- [web.reactive.webflux.error-handling](https://docs.spring.io/spring-boot/docs/3.0.0-RC2/reference/htmlsingle/#web.reactive.webflux.error-handling)
- [webflux-ann-rest-exceptions](https://docs.spring.io/spring-framework/docs/6.0.0-RC4/reference/html/web-reactive.html#webflux-ann-rest-exceptions)

发生异常时返回形如以下结构
```json
{
    "type": "about:blank",
    "title": "Not Found",
    "status": 404,
    "detail": "Hello not found test.",
    "instance": "/hello"
}
```
此结构遵循 [RFC 7807 Problem Details](https://www.rfc-editor.org/rfc/rfc7807.html)

#### Which issue(s) this PR fixes:

Fixes #2732

#### Special notes for your reviewer:
how to test it?
更新文章前把 title 字段删除,会出现校验异常 BadRequest

/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?

```release-note
新增全局异常处理
```
2022-11-24 12:45:07 +00:00
John Niang edfc9ac1e1
Ignore websocket protocol while proxying console (#2760)
#### What type of PR is this?

/kind feature
/area core

#### What this PR does / why we need it:

Ignore websocket protocol while proxying console. If we don't do this, console dev environment will crash with following error:

```bash
  VITE v3.2.4  ready in 1672 ms

  ➜  Local:   http://localhost:3000/console/                                                                           16:12:21
  ➜  Network: http://172.23.176.1:3000/console/                                                                        16:12:21
  ➜  Network: http://172.18.96.1:3000/console/                                                                         16:12:21
  ➜  Network: http://192.168.31.106:3000/console/                                                                      16:12:21
[vite-plugin-static-copy] Collected 8 items.                                                                           16:12:21
node:events:491
      throw er; // Unhandled 'error' event
      ^

RangeError: Invalid WebSocket frame: RSV1 must be clear
    at Receiver$1.getInfo (file:///C:/Users/johnn/workspaces/halo-dev/console/node_modules/.pnpm/vite@3.2.4_ajklay5k626t46b6fyghkbup3i/node_modules/vite/dist/node/chunks/dep-67e7f8ab.js:54186:14)
    at Receiver$1.startLoop (file:///C:/Users/johnn/workspaces/halo-dev/console/node_modules/.pnpm/vite@3.2.4_ajklay5k626t46b6fyghkbup3i/node_modules/vite/dist/node/chunks/dep-67e7f8ab.js:54133:22)
    at Receiver$1._write (file:///C:/Users/johnn/workspaces/halo-dev/console/node_modules/.pnpm/vite@3.2.4_ajklay5k626t46b6fyghkbup3i/node_modules/vite/dist/node/chunks/dep-67e7f8ab.js:54080:10)
    at writeOrBuffer (node:internal/streams/writable:392:12)
    at _write (node:internal/streams/writable:333:10)
    at Writable.write (node:internal/streams/writable:337:10)
    at Socket.socketOnData (file:///C:/Users/johnn/workspaces/halo-dev/console/node_modules/.pnpm/vite@3.2.4_ajklay5k626t46b6fyghkbup3i/node_modules/vite/dist/node/chunks/dep-67e7f8ab.js:56826:37)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:324:12)
    at readableAddChunk (node:internal/streams/readable:297:9)
    at Readable.push (node:internal/streams/readable:234:10)
    at TCP.onStreamRead (node:internal/stream_base_commons:190:23)
Emitted 'error' event on WebSocket$1 instance at:
    at Receiver$1.receiverOnError (file:///C:/Users/johnn/workspaces/halo-dev/console/node_modules/.pnpm/vite@3.2.4_ajklay5k626t46b6fyghkbup3i/node_modules/vite/dist/node/chunks/dep-67e7f8ab.js:56712:13)
    at Receiver$1.emit (node:events:513:28)
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  code: 'WS_ERR_UNEXPECTED_RSV_1',
  [Symbol(status-code)]: 1002
}

Node.js v18.12.1
 ELIFECYCLE  Command failed with exit code 1.
```

#### Special notes for your reviewer:

Steps to test:

1. Edit your application.yaml with console proxy configuration
2. Start Halo
3. Use non-Chromelike browser to request <http://localhost:8090>.
4. See the result

#### Does this PR introduce a user-facing change?

```release-note
None
```
2022-11-24 11:31:06 +00:00
John Niang f96ef7f1b3
Provide ungrouped query param to filter ungrouped attachments (#2752)
#### What type of PR is this?

/kind feature
/area core
/milestone 2.0.0-rc.1

#### What this PR does / why we need it:

Provide `ungrouped` query param to filter ungrouped attachments. Please note that we will ignore `group` query param when `ungropued` is `true`.

```bash
curl -X 'GET' \
  'http://localhost:8090/apis/api.console.halo.run/v1alpha1/attachments?ungrouped=true' \
  -H 'accept: */*'
```

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/2451

#### Does this PR introduce a user-facing change?

```release-note
None
```
2022-11-24 07:43:02 +00:00
Ryan Wang 831a071ebd perf: filter dropdown selector (halo-dev/console#704)
#### What type of PR is this?

/kind improvement
/milestone 2.0

#### What this PR does / why we need it:

优化文章管理的分类/标签/作者的筛选下拉框样式,以及支持搜索。

#### Screenshots:

<img width="525" alt="image" src="https://user-images.githubusercontent.com/21301288/203499340-b7c59b2f-9be8-4804-9e21-9c5bfbca99bc.png">


#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

测试方式:检查文章管理的分类 / 标签 / 作者筛选功能是否正常。

#### Does this PR introduce a user-facing change?

```release-note
优化文章管理的分类/标签/作者的筛选下拉框样式,以及支持搜索。
```
2022-11-24 05:51:01 +00:00
Ryan Wang 3f3147ce34 refactor: add loading states for data list (halo-dev/console#703)
#### What type of PR is this?

/kind improvement
/milestone 2.0

#### What this PR does / why we need it:

优化列表的加载,添加加载动画,解决加载完成之后界面闪动的问题。

#### Which issue(s) this PR fixes:

Ref https://github.com/halo-dev/halo/issues/2370

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

#### Does this PR introduce a user-facing change?

```release-note
优化列表的加载,添加加载动画,解决加载完成之后界面闪动的问题。
```
2022-11-24 03:46:10 +00:00
guqing b0c461b5f6
fix: inconsistent order of post for theme-side (#2742)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.0.0-rc.1

#### What this PR does / why we need it:
修复主题端文章列表排序不固定问题
#### Which issue(s) this PR fixes:

Fixes #2734

#### Special notes for your reviewer:
/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?

```release-note
修复主题端文章列表排序不固定问题
```
2022-11-23 09:21:30 +00:00
Ryan Wang c0877e2a9c refactor: managing logged-in user states with pinia (halo-dev/console#699)
#### What type of PR is this?

/kind improvement
/milestone 2.0

#### What this PR does / why we need it:

使用 Pinia 管理已授权用户信息,并提供判断是否是 `anonymousUser` 的方式。

适配 https://github.com/halo-dev/halo/pull/2729

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

测试流程:

1. Halo 需要切换到 https://github.com/halo-dev/halo/pull/2729 的分支。
2. 测试 Console 端的登录、退出等流程。

#### Does this PR introduce a user-facing change?

```release-note
None
```
2022-11-23 08:39:29 +00:00
Ryan Wang 7add4be116 perf: improve the list filter style and support clear all (halo-dev/console#702)
#### What type of PR is this?

/kind improvement
/milestone 2.0

#### What this PR does / why we need it:

优化 Console 数据列表的筛选标签样式,以及支持清空所有筛选条件。

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/2657

#### Screenshots:

<img width="1663" alt="image" src="https://user-images.githubusercontent.com/21301288/203353043-b5e7631f-cc02-4368-b770-42b53e1dbf78.png">

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

测试方式:

1. 测试文章、自定义页面、附件、插件、评论管理中的筛选功能。

#### Does this PR introduce a user-facing change?

```release-note
优化 Console 数据列表的筛选标签样式,以及支持清空所有筛选条件。
```
2022-11-23 04:59:28 +00:00
Ryan Wang c71d34153c perf: set maximum width for entity-field to prevent text overflow (halo-dev/console#700)
#### What type of PR is this?

/kind improvement
/milestone 2.0

#### What this PR does / why we need it:

为 `VEntityField` 组件设置最大宽度,防止内容过多导致 UI 异常。

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/2468

#### Screenshots:

<img width="534" alt="image" src="https://user-images.githubusercontent.com/21301288/203077107-55cbb951-5ea4-4699-8368-023c60ae9054.png">

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

测试方式:

1. Console 需要 `pnpm build:packages`
2. 新增任意资源,设置超长的内容,检查列表的样式是否异常。

#### Does this PR introduce a user-facing change?

```release-note
为 `VEntityField` 组件设置最大宽度,防止内容过多导致 UI 异常。
```
2022-11-23 04:57:31 +00:00
guqing 180548161a
feat: provides authentication and authorization expression dialects (#2729)
#### What type of PR is this?
/kind feature
/milestone 2.0.0-rc.1
/area core

#### What this PR does / why we need it:
主题端支持使用表达式方言获取登录状态和判断权限,例如:

获取当前登录用户名
```html
<div th:text="${#authentication.name}">
  The value of the "name" property of the authentication object should appear here.
</div>
```
关于判断登录状态我们并不推荐调用表达式 `${#authentication.isAuthenticated()}`,因为始终返回 `true`,使用以下几种属性表达式代替:
```html
<div sec:authorize="isAuthenticated()">
如果不是匿名用户你会看到我
</div>

<div sec:authorize="isFullyAuthenticated()">
如果不是匿名用户且不是 rememberMe 你会看到我
</div>
```
其他
```html
<div sec:authorize="isAnonymous()">
如果是匿名用户你会看到我
</div>
```
```html
<div sec:authorize="isRememberMe()">
如果是 rememberMe  你会看到我
</div>
```
更多请参考:
https://github.com/thymeleaf/thymeleaf-extras-springsecurity

Console 端判断是否登录需要改一下,目前所有未登录状态都属于一个叫 anonymousUser 的用户
#### Which issue(s) this PR fixes:

Fixes #2676

#### Special notes for your reviewer:
/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?
```release-note
主题端支持使用表达式方言获取登录状态和判断权限
```
2022-11-23 03:00:19 +00:00
Ryan Wang 939d5e691a perf: adding the necessary validation to the forms (halo-dev/console#701)
#### What type of PR is this?

/kind improvement
/milestone 2.0

#### What this PR does / why we need it:

完善 Console 中表单的验证规则。

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/2733

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

#### Does this PR introduce a user-facing change?

```release-note
完善 Console 中表单的验证规则。
```
2022-11-23 03:00:19 +00:00
John Niang 4c8a890c36
Change working directory to .halo2 (#2728)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.0.0

#### What this PR does / why we need it:

See https://github.com/halo-dev/halo/issues/2727 for more.

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/2727

#### Does this PR introduce a user-facing change?

```release-note
None
```
2022-11-21 07:14:28 +00:00
Ryan Wang 4bb0c22e66 feat: post editor page supports the parameter of returnToView (halo-dev/console#698)
#### What type of PR is this?

/kind feature
/milestone 2.0

#### What this PR does / why we need it:

文章和独立页面的编辑页面支持 `returnTo` 参数,用于指定发布完成之后的跳转地址。

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/2724

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

测试方式:

1. 选择任意文章进入编辑页面。
2. 在地址栏添加 `&returnTo=http://localhost:8090`
3. 发布文章,观察是否跳转到了 `http://localhost:8090`

#### Does this PR introduce a user-facing change?

```release-note
文章和独立页面的编辑页面支持 `returnTo` 参数。
```
2022-11-21 07:14:28 +00:00
John Niang 87ccd61ae5
Bump up springdoc-openapi (#2726)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.0.0

#### What this PR does / why we need it:

springdoc-openapi 2.0.0-RC2 fully supports Spring Boot 3.0.0-RC2 currently, please see https://github.com/springdoc/springdoc-openapi/releases/tag/v2.0.0-RC2 for more.

#### Does this PR introduce a user-facing change?

```release-note
升级依赖 SpringDoc OpenAPI 至 2.0.0-RC2
```
2022-11-21 05:44:27 +00:00
Ryan Wang 516db5ce28 chore: release 2.0.0-beta.2 (halo-dev/console#697)
#### What type of PR is this?

/kind improvement
/milestone 2.0

#### What this PR does / why we need it:

发布 Console 2.0.0-beta.2

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

#### Does this PR introduce a user-facing change?

```release-note
None
```
2022-11-18 13:36:23 +00:00