#### What type of PR is this?
/kind bug
/area core
/milestone 2.3.x
#### What this PR does / why we need it:
修复文章和自定义页面缺失 name 模型属性导致的访问量无法计数问题
此为 2.3.0 引入的问题 see #3300
how to test it?
1. 切换文章的路由为不带 name 的规则
2. 访问文章看 `/apis/api.halo.run/v1alpha1/trackers/counter` API 是否有如下参数,且 name 值正确
```json
{
"group": "content.halo.run",
"plural": "posts",
"name": "335",
"hostname": "localhost",
"screen": "1920x1080",
"language": "zh-CN",
"url": "/?p=halo-150-released",
"referrer": "http://localhost:8090/?p=how-to-development-a-halo-plugin"
}
```
3. 观察文章访问量是否有增加
4. 重复上述 2、3 步骤检查自定义页面的访问量功能是否正确
#### Which issue(s) this PR fixes:
Fixes#3448
#### Does this PR introduce a user-facing change?
```release-note
修复文章和自定义页面缺失属性导致的访问量无法计数问题
```
#### What type of PR is this?
/kind bug
/area core
/milestone 2.3.x
#### What this PR does / why we need it:
修复使用邮箱评论时 `spec.creationTime` 没有填充导致排序不正确
how to test it?
1. 迁移数据,看是否 `spec.creationTime` 与 `spec.approvedTime` 相等
2. 使用邮箱评论看是否在 Console 评论列表排在第一位
#### Which issue(s) this PR fixes:
Fixes#3456
#### 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:
为 springdoc 添加 `writer-with-order-by-keys` 参数以固定 OpenAPI 中接口的参数顺序,防止重新生成 `api-client` 时因为参数顺序不同而造成不必要的 diff。
#### Special notes for your reviewer:
测试方式:
1. 反复执行 `make -C console api-client-gen`
2. 观察是否有产生 diff
#### 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:
Update Halo version to 2.4.0-SNAPSHOT for next development.
#### 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:
修复标签关联文章数量统计不正确的问题
1. 实现简要的 Indexer 可以通过 IndexFunc 来提取需要构建 indacates 的信息,比如对文章的标签和 labels 建立 indacates
2. Indexer 通过 Watch 文章数据来维护 Indicates 使其与数据库一致
3. TagReconciler 一分钟 requeue 一次,但直接通过 Indexer 获取文章名称来统计数量,无需 list 文章数据
how to test it?
1. 创建文章并绑定标签
2. 测试文章关联标签,关联多个标签、解除旧标签绑定等操作是否会在一分钟后在标签处正确显示文章数量
4. 查看主题端标签下文章数量统计是否正确
5. 重复上述操作多次
#### Which issue(s) this PR fixes:
Fixes#3311, #3312
#### 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
/area core
/milestone 2.3.x
#### What this PR does / why we need it:
修复初始化时自定义页面会发布失败的问题
#### Which issue(s) this PR fixes:
Fixes#3279
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/milestone 2.3.0
#### What this PR does / why we need it:
发布 2.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.3.x
#### What this PR does / why we need it:
修复主题 requires 版本匹配后依然显示 FAILED 状态的问题
how to test it?
1. 安装一个主题后更新主题的 requires 为不匹配系统版本号,此时主题 status 会提示版本号不匹配的错误
2. 再更新 requires 为正确的,phase 会从 FAILED 变为 READY
#### Which issue(s) this PR fixes:
Fixes#3326
#### Does this PR introduce a user-facing change?
```release-note
修复主题状态显示不正确的问题
```
#### What type of PR is this?
/kind cleanup
/area core
/milestone 2.3.x
#### What this PR does / why we need it:
移除 VisitLogWriter 的使用,不再记录访问日志,后续由 httptrace 去暴露指标
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/milestone 2.3.x
/kind feature
#### What this PR does / why we need it:
为访客端的评论和回复接口 聚合点赞数
#### Which issue(s) this PR fixes:
Fixes#3347
#### Special notes for your reviewer:
同步修改了 finder API 及 console 位置的接口
如何测试:
1. 调用接口 `/apis/api.halo.run/v1alpha1/trackers/upvote` 增加点赞数。
2. 使用 console 接口 `/apis/api.halo.run/v1alpha1/comments/{name}` 查看目标评论是否增加点赞数。
#### Does this PR introduce a user-facing change?
```release-note
访客端评论及回复列表支持返回点赞数据
```
#### What type of PR is this?
/kind bug
/area core
/milestone 2.3.x
#### What this PR does / why we need it:
修复文章列表分页配置取值错误的问题
此问题为 #3300 PR 引入,由于改动较大遗漏了这点没测试到。
how to test it?
修改文章设置中的大小,查看主题端分页是否符合预期:
包括首页,归档页,标签文章页,分类文章页。
<img width="575" alt="image" src="https://user-images.githubusercontent.com/38999863/221574440-eeec9c27-57ab-46d1-823f-7cc076fb2b54.png">
#### Which issue(s) this PR fixes:
Fixes#3411
#### 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 bug
/area core
/milestone 2.3.x
#### What this PR does / why we need it:
修复文章模板渲染丢失 template_id 参数导致无法代码注入的问题
how to test it?
测试 [plugin-highlightjs](https://github.com/halo-sigs/plugin-highlightjs) 插件功能是否正常,期望在 html head 插入 `/plugins/PluginHighlightJS/assets/static/highlight.min.js`
#### Which issue(s) this PR fixes:
Fixes#3403
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind documentation
#### What this PR does / why we need it:
修复 Docker 快速运行的 `halo.security.initializer.superadminusername` 参数。
#### 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和anonymousUser
#### Which issue(s) this PR fixes:
Fixes#3349
#### Does this PR introduce a user-facing change?
```release-note
修复仪表盘用户数显示错误问题
```
#### What type of PR is this?
/kind improvement
/milestone 2.3.x
#### What this PR does / why we need it:
发布 2.3.0-rc.1
#### 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:
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
```