#### What type of PR is this?
/kind improvement
/area core
/milestone 2.5.x
#### What this PR does / why we need it:
允许用户修改自己的元数据信息
how to test it
使用 API 修改元数据 `PUT localhost:8090/apis/api.console.halo.run/v1alpha1/users/-`
1. 修改 annotations 中的 `"rbac.authorization.halo.run/role-names": "[\"super-role\",\"fake-role\"]"` 会被复原
2. 修改其他的 annotations 能正确修改,也能增加新的 annotation
#### Which issue(s) this PR fixes:
Fixes#3544
#### Does this PR introduce a user-facing change?
```release-note
允许用户修改自己的元数据信息
```
#### What type of PR is this?
/kind feature
/area core
/area plugin
/kind api-change
#### What this PR does / why we need it:
新增 reload 插件的 API
how to test it?
通过以下 API 测试是否可以在不重启 Halo 的情况下使新改动的插件代码生效
```shell
./gradlew clean build && curl -u your-name:your-password -X PUT http://127.0.0.1:8090/apis/api.console.halo.run/v1alpha1/plugins/{plugin-name}/reload
```
#### Which issue(s) this PR fixes:
Fixes#3748
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind feature
/area core
/area plugin
#### What this PR does / why we need it:
This PR refactor AttachmentEndpoint by extracting `upload`, `delete`, `getPremalink` and `getSharedURL` logic in the endpoint into AttachmentService. Meanwhile, I expose the service to plugin, so that we can use the service in plugin conveniently.
#### Special notes for your reviewer:
Please confirm that those changes won't influence existing attachment features.
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind bug
/area core
#### What this PR does / why we need it:
修复作者页无法访问的问题
#### Which issue(s) this PR fixes:
Fixes#3718
#### Does this PR introduce a user-facing change?
```release-note
修复作者页无法访问的问题
```
#### What type of PR is this?
/kind improvement
/area core
#### What this PR does / why we need it:
将文章摘要作为 meta description 以优化文章页的 SEO
how to test it?
查看文章页和自定义页面的 head 中是否具有 `<meta name="description" content="文章摘要"/>` 标签
#### Which issue(s) this PR fixes:
Fixes#2682
#### Does this PR introduce a user-facing change?
```release-note
将文章摘要作为 meta description 以优化文章页的 SEO
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.5.x
#### What this PR does / why we need it:
仅允许拥有 authenticated 角色的用户修改个人资料
how to test it?
用户在未登录时访问 `PUT /apis/api.console.halo.run/v1alpha1/users/-` 出现 401 状态码则符合预期,登录后则可以正常调用
#### Which issue(s) this PR fixes:
Fixes#3737
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind bug
/area core
#### What this PR does / why we need it:
- Use the class loader belonging to the parameter type when creating a generic class.
- Use full qualified class name when generating a generic class.
Before testing, you have to set property `springdoc.cache.disabled` to `true`.
#### Which issue(s) this PR fixes:
Fixes#3728
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind bug
/area console
#### What this PR does / why we need it:
获取主题配置时,重复添加了上次已经获取到的主题配置,导致重复显示。并同步修改了 plugin 中可能出现问题的位置。
#### Which issue(s) this PR fixes:
Fixes#3726
#### Special notes for your reviewer:
1. 打开 Console 端主题页面
2. 点击右上角预览页面
3. 关闭预览页面,选项卡无重复即为正常。
#### Does this PR introduce a user-facing change?
```release-note
修复 Console 端主题设置中,选项卡会重复显示的问题
```
#### What type of PR is this?
/kind bug
/area core
#### What this PR does / why we need it:
Set property `server.forward-header-strategy` to `framework` to enable handling `X-Forwarded*` headers correctly.
By default, Spring won't handle `X-Forwarded*` headers. It doesn't work correctly if Halo is running back reverse proxy server.
Supported headers: <310344cf61/spring-web/src/main/java/org/springframework/web/server/adapter/ForwardedHeaderTransformer.java (L63-L69)>.
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3670
#### Does this PR introduce a user-facing change?
```release-note
解决反向代理后无法正确获取当前请求 URI 的问题
```
#### What type of PR is this?
/kind feature
/area core
/area plugin
#### What this PR does / why we need it:
Including CustomEndpoint beans while building plugin router functions.
After that, we can define a CustomEndpoint in plugin like this:
```java
@Component
public class ApplicationEndpoint implements CustomEndpoint {
@Override
public RouterFunction<ServerResponse> endpoint() {
return SpringdocRouteBuilder.route()
.GET("/applications", request -> ServerResponse.ok().build(), builder -> {
builder.operationId("ListV1Alpha1Applications");
})
.build();
}
@Override
public GroupVersion groupVersion() {
return CustomEndpoint.super.groupVersion();
}
}
```
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3700
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind bug
/area console
/milestone 2.5.x
#### What this PR does / why we need it:
修复保存系统设置之后,启用主题的设置丢失,恢复为了默认主题。原因是因为在 https://github.com/halo-dev/halo/pull/3606 中使用了新的 useSettingFormConvert 方法,但这个方法未考虑到某些 ConfigMap 的分组并未在表单中定义,也就是数据转换方法是以表单的定义为基准,所以丢失了 `theme.active` 设置。
#### Which issue(s) this PR fixes:
Fixes#3673
#### Special notes for your reviewer:
测试方式:
1. 安装若干主题并启用。
2. 然后去系统设置修改任意数据并保存。
3. 检查主题是否被修改为默认主题。
#### Does this PR introduce a user-facing change?
```release-note
修复保存系统设置之后导致激活主题的设置值丢失,恢复为了默认主题的问题。
```
#### What type of PR is this?
/kind feature
/area core
#### What this PR does / why we need it:
Add zhTW locale.
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3346
#### Does this PR introduce a user-facing change?
```release-note
提供繁体中文(TW)翻译
```
#### What type of PR is this?
/kind cleanup
/area core
#### What this PR does / why we need it:
Move common classes related to theme into api module.
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/area console
/milestone 2.5.x
/cherry-pick release-2.4
#### What this PR does / why we need it:
升级 `@halo-dev/richtext-editor` 的版本以解决编辑器翻译不完整的问题。
see https://github.com/halo-sigs/richtext-editor/pull/7
#### Does this PR introduce a user-facing change?
```release-note
升级 `@halo-dev/richtext-editor` 的版本以解决编辑器部分文本翻译不完整的问题。
```
#### What type of PR is this?
/kind improvement
/area core
#### What this PR does / why we need it:
Configure default external-url as slash. So that system will generate relative links for all permalinks.
See https://github.com/halo-dev/halo/issues/3654 for more.
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3654
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind bug
/area console
/milestone 2.5.x
/cherry-pick release-2.4
#### What this PR does / why we need it:
修复使用了 FormKit Schema 生成的表单中,Radio 输入类型如果值的类型定义为 boolean 类型,但得到的结果为 string 类型的问题。
#### Which issue(s) this PR fixes:
Fixes#3666
#### Special notes for your reviewer:
测试方式:
1. 安装一个主题设置使用了 Radio 输入类型的主题,比如 https://github.com/halo-dev/halo-theme-anatole
2. 测试保存其中包含了 Radio 输入类型的表单。
3. 刷新页面,检查值回显是否正确。
#### Does this PR introduce a user-facing change?
```release-note
修复 Console 端 FormKit Schema 生成的表单中,Radio 输入类型值类型为 boolean 但结果为 string 的问题。
```
#### What type of PR is this?
/kind bug
/area core
#### What this PR does / why we need it:
Move `defaultHandler#onAuthenticationSuccess` up to response write, or it will be executed always.
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3553
#### Special notes for your reviewer:
Try to login and see the log detail.
#### Does this PR introduce a user-facing change?
```release-note
修复登录成功或失败后报错的问题
```
#### What type of PR is this?
/kind bug
/area console
/milestone 2.5.x
/cherry-pick release-2.4
#### What this PR does / why we need it:
修复文章设置中的发布时间无法回显导致重新保存时丢失发布时间的问题。
#### Which issue(s) this PR fixes:
Fixes#3669
#### Special notes for your reviewer:
测试方式:
1. 新建或者修改已有文章的设置。
2. 检查时间输入框的时间是否显示正确。
3. 检查保存之后时间是否显示正确。
#### Does this PR introduce a user-facing change?
```release-note
修复 Console 端文章设置中的发布时间无法回显导致重新保存时丢失发布时间的问题。
```
#### What type of PR is this?
/kind bug
/area console
/cherry-pick release-2.4
#### What this PR does / why we need it:
修复后台全局搜索中关于 Console 路由的文字没有适配 i18n 的问题。
#### Which issue(s) this PR fixes:
Fixes#3664
#### Special notes for your reviewer:
<img width="741" alt="image" src="https://user-images.githubusercontent.com/21301288/229279243-4b727cc7-1790-41b3-a170-4958ce1f65a8.png">
#### Does this PR introduce a user-facing change?
```release-note
修复后台全局搜索中关于 Console 路由的文字没有适配 i18n 的问题。
```
#### What type of PR is this?
/kind bug
/area console
/milestone 2.5.x
#### What this PR does / why we need it:
修复附件存储策略编辑表单无法正常渲染的问题。此问题原因为 Modal 组件使用了 OverlayScrollbars 库来模拟滚动条,但在初始化的时候由于 Body 没有任何子元素,所以导致异常。
#### Which issue(s) this PR fixes:
Fixes#3662
#### Special notes for your reviewer:
测试是否能够正常打开附件存储策略编辑表单即可。
#### Does this PR introduce a user-facing change?
```release-note
修复 Console 端附件存储策略编辑表单无法正常渲染的问题
```
#### What type of PR is this?
/kind cleanup
/area core
#### What this PR does / why we need it:
- Bump up version to 2.5.0-SNAPSHOT for next development
- Update README.md
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind cleanup
#### What this PR does / why we need it:
Upgrade to plugin-comment-widget 1.5.0.
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/area console
/milestone 2.4.0
#### What this PR does / why we need it:
修改 Console 的版本号为 2.4.0。
修改 `@halo-dev/components` 的版本为 1.3.0
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.4.0
#### What this PR does / why we need it:
重新生成 api client。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.4.0
#### What this PR does / why we need it:
移除 AuthProviderReconciler 中关于 authProvier 数据被删除时禁用它提供的登录方式的逻辑
当第三方登录插件如 plugin-oauth2 被停止时不应该从已启用的登录配置中移除 auth provider name,这会导致插件被停用在启用后需要重新启用登录方式。
之前之所以如此是想着去掉 system configmap 中的配置残余,虽然现在去掉了 Reconciler 但为了确保数据干净或许还得想其他办法来解决它,但目前不是重点也没有一个很好的办法,或许可以在插件中去做,比如当插件被卸载的生命周期方法中去更新 ConfigMap 中关于此项的配置。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/area console
/milestone 2.4.x
#### What this PR does / why we need it:
重新设计登录页面的样式和用户体验。
#### Which issue(s) this PR fixes:
Fixes#3572
#### Special notes for your reviewer:
#### Does this PR introduce a user-facing change?
```release-note
优化 Console 端登录页面样式
```
#### What type of PR is this?
/area core
/kind improvement
/milestone 2.4.0
#### What this PR does / why we need it:
将系统设置中的用户注册的默认角色输入框改为选择框。
<img width="575" alt="image" src="https://user-images.githubusercontent.com/21301288/228888394-8355b71e-7d18-46bf-b177-569fa7b311d6.png">
#### Special notes for your reviewer:
测试 `系统设置 -> 用户设置` 中的默认角色是否可以正常设置即可。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.4.0
#### What this PR does / why we need it:
当用户被删除时关联删除用户的绑定账号信息
how to test it?
1. 创建用户
2. 绑定账号
3. 使用管理员删除此用户并查看关联的 UserConnection 是否被删除
```shell
curl -u 'your-username:your-password' http://127.0.0.1:8090/apis/auth.halo.run/v1alpha1/userconnections | jq -r '.'
```
#### Which issue(s) this PR fixes:
Fixes#3639
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind feature
/area console
/milestone 2.4.0
#### What this PR does / why we need it:
添加角色选择的 FormKit 输入类型。
#### Which issue(s) this PR fixes:
Fixes#3637
#### Special notes for your reviewer:
测试方式:
1. 测试为用户分配角色,检查角色下拉框是否正常加载角色列表即可。
#### Does this PR introduce a user-facing change?
<!--
如果当前 Pull Request 的修改不会造成用户侧的任何变更,在 `release-note` 代码块儿中填写 `NONE`。
否则请填写用户侧能够理解的 Release Note。如果当前 Pull Request 包含破坏性更新(Break Change),
Release Note 需要以 `action required` 开头。
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
-->
```release-note
Console 端添加角色选择的 FormKit 输入类型。
```
#### What type of PR is this?
/kind improvement
/area console
/milestone 2.4.x
#### What this PR does / why we need it:
优化插件详情页面获取角色模板的条件,不查询 label 中带了 `halo.run/hidden` 的角色模板。
#### Special notes for your reviewer:
#### Does this PR introduce a user-facing change?
```release-note
优化 Console 端在插件详情页面上获取角色模板的条件
```
#### What type of PR is this?
/kind feature
/area core
/area console
/milestone 2.4.0
#### What this PR does / why we need it:
新增用户注册功能
#### Which issue(s) this PR fixes:
Fixes#2813
#### Special notes for your reviewer:
#### Does this PR introduce a user-facing change?
```release-note
新增用户注册功能
```
#### What type of PR is this?
/kind feature
/area core
/milestone 2.4.x
#### What this PR does / why we need it:
修复 Local 认证方式的开关初始化状态为关闭
#### Which issue(s) this PR fixes:
Fixes#3602
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind feature
/milestone 2.4.x
/area core
#### What this PR does / why we need it:
提供 ReactiveSettingFetcher 供插件获取配置
此 PR 基于原有的阻塞的 SettingFetcher 逻辑挪到 DefaultReactiveSettingFetcher 中并将阻塞的实现用 Reactive 得代理,不需要测试,单元测试过了即可。
可以尝试在插件中依赖注入 ReactiveSettingFetcher 看是否能正确注入
#### Which issue(s) this PR fixes:
Fixes#3620
#### Does this PR introduce a user-facing change?
```release-note
提供 ReactiveSettingFetcher 供插件获取配置
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.4.x
#### What this PR does / why we need it:
修复升级主题或插件时新增加的配置默认值没有更新的问题
how to test it?
1. 安装包含设置的主题后获取主题的 ConfigMap 并记下
2. 修改(增加/更新)主题的设置(Setting)的默认值,模拟更新主题
3. 期望默认值改变不会影响到之前已有的配置,对于新增加的配置的默认值会被合并到已有的 ConfigMap 中
#### Which issue(s) this PR fixes:
Fixes#3446
#### Does this PR introduce a user-facing change?
```release-note
修复升级主题或插件时新增加的配置默认值没有更新的问题
```
#### What type of PR is this?
/kind improvement
#### What this PR does / why we need it:
使用 [TanStack Query](https://github.com/TanStack/query) 重构系统设置表单的逻辑,移除无意义的重复请求。
#### Which issue(s) this PR fixes:
Ref https://github.com/halo-dev/halo/issues/3360
#### Special notes for your reviewer:
测试方式:
1. 测试系统设置的表单加载是否正常,以及保存之后重载配置是否正常。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind feature
/area console
/milestone 2.4.0
#### What this PR does / why we need it:
FormKit 和 Uppy 上传组件支持同步设置系统语言。
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3574
#### Special notes for your reviewer:
在不同语言的浏览器中测试表单的验证和上传组件的语言是否显示正确即可。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/area console
/milestone 2.4.0
#### What this PR does / why we need it:
优化左侧菜单栏边框阴影的样式。
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3629
#### Does this PR introduce a user-facing change?
```release-note
优化左侧菜单栏边框阴影的样式。
```
#### What type of PR is this?
/kind improvement
/area console
/milestone 2.4.x
#### What this PR does / why we need it:
重新在全局注册 FloatingDropdown 组件,因为在 https://github.com/halo-dev/halo/pull/3576 中移除之后,会导致插件无法正常加载 FloatingDropdown 组件,从而带来破坏更新。
#### Which issue(s) this PR fixes:
Fixes#3621
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind bug
/area console
/milestone 2.4.0
#### What this PR does / why we need it:
修复跳转页面之后无法固定菜单滚动位置的问题。
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3633
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind bug
/area console
/milestone 2.4.x
#### What this PR does / why we need it:
修复认证方式管理页面在加载时不显示加载状态的问题。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/area console
/milestone 2.4.x
#### What this PR does / why we need it:
升级 Console 依赖的所有 patch 版本,由于升级了 prettier 的版本,可能发生了规则改变,所以同时包含重新格式化后的文件。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/area console
/milestone 2.4.x
#### What this PR does / why we need it:
优化用户详情页面中认证方式的显示逻辑。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
#### What this PR does / why we need it:
使用 [TanStack Query](https://github.com/TanStack/query) 重构主题和插件设置表单的逻辑,移除无意义的重复请求。
#### Which issue(s) this PR fixes:
Ref https://github.com/halo-dev/halo/issues/3360
#### Special notes for your reviewer:
测试方式:
1. 安装若干带有设置表单的主题和插件。
2. 测试主题和插件的设置表单是否加载正常,以及保存设置后再重复加载的时候是否正常。
#### Does this PR introduce a user-facing change?
```release-note
None
```