#### What type of PR is this?
/kind improvement
/area core
/milestone 2.3.x
#### What this PR does / why we need it:
Console 端创建回复不再需要审核
但需要注意的是目前无法区分是否为管理员,所以如果具有评论管理权限的用户在主题端登录回复还是需要审核。
#### Which issue(s) this PR fixes:
Fixes#3353
#### Special notes for your reviewer:
how to test it?
1. 在主题端创建评论和回复都需要审核
2. 在 console 端回复不需要审核
/cc @halo-dev/sig-halo
#### Does this PR introduce a user-facing change?
```release-note
Console 端创建回复不再需要审核
```
#### What type of PR is this?
/kind improvement
/area core
#### What this PR does / why we need it:
为系统默认用户添加系统保护 finalizer,避免被删除
how to test it?
```shell
curl -u username:password --basic 'http://localhost:8090/api/v1alpha1/users/ghost'
curl -u username:password --basic 'http://localhost:8090/api/v1alpha1/users/anonymousUser'
```
将看到
```json
"finalizers": [
"...",
"system-protection"
]
```
#### Which issue(s) this PR fixes:
Fixes #
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.3.x
#### What this PR does / why we need it:
对插件的静态资源(js, css) 增加 version 版本号,用于解决插件静态资源缓存的问题。另外同时也对插件 Logo 增加了版本号标识。
#### Which issue(s) this PR fixes:
Fixes#3205
#### Special notes for your reviewer:
验证 Console 端插件静态资源链接是否携带 `version={pluginVersion}` 。
特别的,对于 logo只会增加相对路径下的地址,绝对路径的地址将直接返回原始路径/值。
#### 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 improvement
#### What this PR does / why we need it:
修改评论和回复的创建时间字段。适配:https://github.com/halo-dev/halo/pull/3341
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3330
#### Special notes for your reviewer:
None
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind feature
/kind api-change
/area core
/milestone 2.3.x
#### What this PR does / why we need it:
获取用户信息的 API 响应体包含关联角色信息
- 新增 API `/apis/api.console.halo.run/v1alpha1/users/{name}`
- 修改了 API 的返回值类型 `/apis/api.console.halo.run/v1alpha1/users/-`
由于 API 响应体结构的改变,需要 Console 适配
#### Which issue(s) this PR fixes:
Fixes#3342
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo
#### Does this PR introduce a user-facing change?
```release-note
获取用户信息的 API 响应体包含关联角色信息
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.3.x
#### What this PR does / why we need it:
能通过注册 pattern 作为路由的就直接注册 pattern 以避免 Reconciler 还没结束而无法注册路由导致的访问问题。
1. 文章、标签、分类的 permalink 规则会记录在对应 extension 的 annotations 中为 `content.halo.run/permalink-pattern: some-pattern` ,当系统设置中路由规则改变时会刷一遍这些资源的 `content.halo.run/permalink-pattern` annotation。
3. 自定义页面的访问是通过 SinglePageRoute 控制,它会在 single page 添加、更新、删除时维护 quickRouteMap 的集合,在路由到它时直接通过 request path 查找 map key,找到则直接返回 HandleFunction。
4. 除了自定义页面外其他都是通过 ThemeCompositeRouterFunction 作为路由管理器,系统启动时文章等的 RouterFunction 会被生成并缓存到 cachedRouters 的一个 List 集合中,当路由规则改变会清理它重新赋值。
#### Which issue(s) this PR fixes:
Fixes#3254
#### Special notes for your reviewer:
how to test it?
1. 测试首页、文章、标签、分类、归档页、自定义页面和作者页等的访问。
6. 测试添加、删除资源和修改系统路由规则后上述资源的访问。
7. 测试分页路径如 /tags/slug/page/1 的访问。
/cc @halo-dev/sig-halo
#### Does this PR introduce a user-facing change?
```release-note
优化启动时页面长时间无法访问的问题
```
#### What type of PR is this?
/kind bug
#### What this PR does / why we need it:
修复新建分类和标签之后再次打开表单,别名显示为 undefined 的问题。
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3382
#### Special notes for your reviewer:
测试方式:
1. 新建分类或者标签,创建完成之后再次打开创建表单,检查别名是否还为 undefined。
#### Does this PR introduce a user-facing change?
```release-note
修复 Console 端新建分类和标签之后再次打开表单,别名显示为 undefined 的问题。
```
#### What type of PR is this?
/kind improvement
#### What this PR does / why we need it:
优化分类和标签管理页面自动刷新的条件,现在支持检测 `status.permalink` 是否已经生成完毕,如果没有会自动刷新列表。
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3376
#### Special notes for your reviewer:
测试方式:
1. 测试添加若干分类和标签,观测在没有生成 permalink 的情况下,是否会自动刷新列表。
#### Does this PR introduce a user-facing change?
```release-note
优化 Console 端分类和标签管理的自动刷新条件,支持检测固定链接是否已经生成。
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.3.x
#### What this PR does / why we need it:
用户被删除时关联到的用户返回 ghost 用户信息
#### Which issue(s) this PR fixes:
Fixes#3356
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo
#### Does this PR introduce a user-facing change?
```release-note
用户被删除时关联到的用户返回 ghost 用户信息
```
#### 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 cleanup
/area core
#### What this PR does / why we need it:
Upgrade to Spring Boot 3.0.3. See https://github.com/spring-projects/spring-boot/releases/tag/v3.0.3 for more.
#### Does this PR introduce a user-facing change?
```release-note
Upgrade to Spring Boot 3.0.3.
```
#### What type of PR is this?
/kind improvement
/area core
#### What this PR does / why we need it:
This PR mainly creates two things:
1. Create JsonExtension to represent any extension and make extension modification more convenient
2. Discard watch when we detect that the extension status is changed only. It's useful to prevent infinite loop of reconciler.
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3273
#### Special notes for your reviewer:
Try to install test plugin from [plugin-comment-widget.zip](https://github.com/halo-dev/halo/files/10799875/plugin-comment-widget.zip) before checking out this PR. You will get a infinite reconciliation loop.
Then, stop the process and checkout this PR and see the result.
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.3.x
/kind api-change
#### What this PR does / why we need it:
1. spec 中新增 creationTime
2. 旧数据的 spec.creationTime 默认等于 approvedTime
3. 按照 metadata.creationTimestamp 排序的使用 spec.creationTime 代替
how to test it?
1. 使用迁移插件迁移看评论和回复的排序是否正确
2. 使用评论插件创建评论和回复看顺序是否正确
#### Which issue(s) this PR fixes:
Fixes#3330
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo
#### Does this PR introduce a user-facing change?
```release-note
评论和回复新增创建时间以兼容迁移数据的排序
```
#### What type of PR is this?
/kind bug
/milestone 2.3.x
/area console
#### What this PR does / why we need it:
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3357
#### Special notes for your reviewer:
测试使用主题/插件自定义的元数据信息,是否能够在 console 中显示默认值。
#### 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. 测试附件管理页面的筛选、存储策略、分组等业务。
2. 测试附件选择模态框组件。
#### 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:
优化用户名的校验规则,目前采用 DNS 名称的规则,即:必须以字母(a-z或A-Z)开头,并包含字母数字字符(a-z,A-Z,0-9)和连字符(-)。每一段名称以字母结尾(a-z或A-Z)。名称以点(.)分隔
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3239
#### Screenshots:
#### Special notes for your reviewer:
测试方式:
1. 新建用户,检查用户名输入规则是否符合预期。
#### Does this PR introduce a user-facing change?
```release-note
优化 Console 端新建用户时,用户名的校验规则。
```
#### 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. 需要 `pnpm install`
2. 插件管理页面,安装若干插件。
3. 测试分页、条件筛选等逻辑是否正常。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind bug
#### What this PR does / why we need it:
系统默认初始化一个 ghost 用户,用于表示用户已删除。
#### Which issue(s) this PR fixes:
Fixes#3317
```release-note
NONE
```
#### What type of PR is this?
/kind feature
/milestone 2.3.x
#### What this PR does / why we need it:
#### Which issue(s) this PR fixes:
Fixes#3263
#### Special notes for your reviewer:
测试方法:
1. 使用超级管理员登录
2. 查看接口 /actuator/info 查看是否存在 database 字段。
#### Does this PR introduce a user-facing change?
```release-note
NONE
```
#### What type of PR is this?
/kind improvement
/area core
#### What this PR does / why we need it:
This PR refines problem detail of PluginAlreadyExistsException. Please note the new type `https://halo.run/probs/plugin-alreay-exists` and additional property `pluginName` of problem detail.
Meanwhile
- Before
```json
{
"type": "about:blank",
"title": "Plugin Already Exists Error",
"status": 400,
"detail": "Plugin PluginCommentWidget already exists.",
"instance": "/apis/api.console.halo.run/v1alpha1/plugins/install",
"requestId": "880fe8cd-5",
"timestamp": "2023-02-20T10:17:21.541104Z"
}
```
- After
```json
{
"type": "https://halo.run/probs/plugin-alreay-exists",
"title": "Plugin Already Exists Error",
"status": 400,
"detail": "Plugin PluginCommentWidget already exists.",
"instance": "/apis/api.console.halo.run/v1alpha1/plugins/install",
"pluginName": "PluginCommentWidget",
"requestId": "880fe8cd-5",
"timestamp": "2023-02-20T10:17:21.541104Z"
}
```
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3164
#### Special notes for your reviewer:
#### Does this PR introduce a user-facing change?
```release-note
优化插件重复安装错误提示。
```
What type of PR is this?
/kind bug
What this PR does / why we need it:
将ghost用户从用户列表隐藏。
Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3317
```release-note
NONE
```
<!-- Thanks for sending a pull request! Here are some tips for you:
1. 如果这是你的第一次,请阅读我们的贡献指南:<https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>。
1. If this is your first time, please read our contributor guidelines: <https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>.
2. 请根据你解决问题的类型为 Pull Request 添加合适的标签。
2. Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request.
3. 请确保你已经添加并运行了适当的测试。
3. Ensure you have added or ran the appropriate tests for your PR.
-->
#### What type of PR is this?
/kind feature
<!--
添加其中一个类别:
Add one of the following kinds:
/kind bug
/kind cleanup
/kind documentation
/kind feature
/kind improvement
适当添加其中一个或多个类别(可选):
Optionally add one or more of the following kinds if applicable:
/kind api-change
/kind deprecation
/kind failing-test
/kind flake
/kind regression
-->
#### What this PR does / why we need it:
#### Which issue(s) this PR fixes:
<!--
PR 合并时自动关闭 issue。
Automatically closes linked issue when PR is merged.
用法:`Fixes #<issue 号>`,或者 `Fixes (粘贴 issue 完整链接)`
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes#3188
#### Special notes for your reviewer:
测试方式:
1. 使用 prod 模式启动项目,使用超级管理员登陆
2. 访问 /actuator/logfile 查看是否有日志显示。
#### 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
NONE
```
#### What type of PR is this?
/kind bug
#### What this PR does / why we need it:
为后端用户管理提供更多筛选接口,包括关键词、角色、创建时间排序
#### Which issue(s) this PR fixes:
Fixes#3290
```release-note
NONE
```
#### What type of PR is this?
/kind improvement
#### 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:
将 https://github.com/halo-sigs/api-client 移动到 Console 的仓库进行管理。
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3302
#### Special notes for your reviewer:
测试方式:
1. 需要先 `pnpm install && pnpm build:packages`
2. 测试开发环境(pnpm dev)和构建之后(pnpm build)是否能够正常使用。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind bug
/area core
/milestone 2.3.x
#### What this PR does / why we need it:
1. 去掉原 TagReconciler 的 requeue 逻辑,来临时解决大量 tag 时 reconciler 空转导致 cpu 下不来的问题,参考: https://github.com/halo-dev/halo/issues/3311
2. 增加 TagRouteReconciler 在启动时注册路由
#### Which issue(s) this PR fixes:
Fixes#3321
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo
#### Does this PR introduce a user-facing change?
```release-note
修复 #3316 引入的 tags 标签的路由没有注册的问题
```
#### What type of PR is this?
/kind improvement
#### What this PR does / why we need it:
暂时禁用 Tag Reconciler 在启动的时候同步。(临时解决方案)
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3312
#### Does this PR introduce a user-facing change?
```release-note
禁用系统启动时同步标签文章数的功能
```