Commit Graph

4792 Commits (e704e098079db0aa557cfdec64ea630023eb230b)

Author SHA1 Message Date
guqing e704e09807
refactor: optimize reply queries using index mechanisms (#5497)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.14.x

#### What this PR does / why we need it:
使用索引机制优化回复功能的查询以提高查询速度

#### Does this PR introduce a user-facing change?
```release-note
使用索引机制优化回复功能的查询以提高查询速度
```
2024-03-13 08:44:08 +00:00
John Niang 956f4ef3f3
Set source and target compatibility to Java 17 (#5499)
#### What type of PR is this?

/kind chore
/area core

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

I get the following errors when I develop Halo in JDK 21:

```bash
FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':application:bootRun'.
> Could not resolve all dependencies for configuration ':application:runtimeClasspath'.
   > Failed to calculate the value of task ':application:compileJava' property 'javaCompiler'.
      > No matching toolchains found for requested specification: {languageVersion=17, vendor=any, implementation=vendor-specific} for MAC_OS on aarch64.
         > No locally installed toolchains match and toolchain download repositories have not been configured.
```

This PR removes the Java toolchain configuration and adds source and target compatibility to Java 17, allowing developers to develop Halo in Java 17 or higher versions.

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

```release-note
None
```
2024-03-12 07:44:07 +00:00
guqing ed23914050
refactor: optimize the update method for the number of tag associated with posts (#5422)
#### What type of PR is this?
/kind improvement
/area core

#### What this PR does / why we need it:
优化标签关联的文章数量的更新方式以降低标签太多时对 CPU 的消耗

how to test it?
测试文章关联标签、取消关联、更新关联、删除文章到回收站、彻底删除文章时标签对应的文章可见文章数量和所有文章数量是否正确

#### Does this PR introduce a user-facing change?
```release-note
优化标签关联的文章数量的更新方式以降低标签太多时对 CPU 的消耗
```
2024-03-12 03:16:07 +00:00
Ryan Wang 014625ff0e
feat: attachments supports sorting by display name (#5494)
#### What type of PR is this?

/area ui
/kind feature
/milestone 2.14.0

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

附件管理的排序功能支持按照文件名排序。

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

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

#### Special notes for your reviewer:

测试方式:

1. 上传若干附件。
2. 测试根据文件名降序/升序功能是否符合预期。

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

```release-note
附件管理的排序功能支持按照文件名排序。
```
2024-03-11 08:58:08 +00:00
Ryan Wang b4729b9dab
feat: add download feature for attachment (#5496)
#### What type of PR is this?

/kind feature
/area ui
/milestone 2.14.0

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

附件支持下载。

<img width="471" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/97909ef8-8117-4ea9-aa15-73295a1b7b01">


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

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

#### Special notes for your reviewer:

测试方式:

1. 上传若干附件。
2. 测试下载功能是否符合预期。

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

```release-note
为附件添加下载功能
```
2024-03-11 08:28:08 +00:00
Ryan Wang 029eb952f1
fix: default sort policy of attachment groups (#5495)
#### What type of PR is this?

/area ui
/kind bug
/milestone 2.14.0

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

为附件分组设置默认排序规则(按照创建时间升序),和 2.13.0 版本之间保持一致。

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

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

#### Special notes for your reviewer:

测试方式:

1. 创建若干附件分组。
2. 观察排序是否符合预期。

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

```release-note
修复附件管理中的分组排序不固定的问题。
```
2024-03-11 07:42:08 +00:00
Ryan Wang 10d834d2ef
chore: bump overlayscrollbars version to 2.5.0 (#5471)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.14.x

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

升级 OverlayScrollbars 的依赖版本至 [2.5.0](https://github.com/KingSora/OverlayScrollbars/releases/tag/v2.5.0)

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

```release-note
升级 OverlayScrollbars 的依赖版本至 [2.5.0](https://github.com/KingSora/OverlayScrollbars/releases/tag/v2.5.0)。
```
2024-03-11 00:46:08 +00:00
guqing 20d80f8f65
refactor: using index mechanisms to optimize comment queries (#5453)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.14.x

#### What this PR does / why we need it:
使用索引机制优化评论数据查询以提高效率

how to test it?
- 测试 console 评论列表和筛选条件是否正确
- 测试主题端评论显示是否正确

#### Does this PR introduce a user-facing change?
```release-note
使用索引机制优化评论数据查询以提高效率
```
2024-03-08 13:32:06 +00:00
Takagi 92f2229460
pref: remove nofollow from the default editor link (#5477)
#### What type of PR is this?

/kind improvement
/area editor
/area ui
/milestone 2.14.x

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

将默认富文本编辑器中的链接中的 rel 属性由默认的 `noopener noreferrer nofollow` 属性改为 null,优化 SEO 。
 
#### How to test it?

查看使用默认富文本编辑器创建的链接,其 rel 属性是否不再是 `noopener noreferrer nofollow`

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

Fixes #5328 

#### Does this PR introduce a user-facing change?
```release-note
移除默认富文本编辑器中链接的 nofollow 等属性,优化 SEO。
```
2024-03-08 09:30:08 +00:00
John Niang a8627cbc2f
Upgrade PF4J to 3.11.0 (#5462)
#### What type of PR is this?

/kind cleanup
/area core

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

This PR upgrades Pf4j to [3.11.0](https://github.com/pf4j/pf4j/releases/tag/release-3.11.0) regularlly.

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

```release-note
升级依赖 PF4J 至 3.11.0
```
2024-03-07 06:45:06 +00:00
longjuan e52be2bf3b
chore: update the link to view notifications in the email template (#5459)
<!--  Thanks for sending a pull request!  Here are some tips for you:
1. 如果这是你的第一次,请阅读我们的贡献指南:<https://github.com/halo-dev/halo/blob/main/CONTRIBUTING.md>。
1. If this is your first time, please read our contributor guidelines: <https://github.com/halo-dev/halo/blob/main/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 bug
/area core
<!--
添加其中一个类别:
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 https://github.com/halo-dev/halo/issues/5458

#### Special notes for your reviewer:

#### 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
```
2024-03-07 02:35:06 +00:00
guqing 5281eb01bb
fix: query mismatch with non-intersecting OR and nested AND condition (#5452)
#### What type of PR is this?
/kind bug
/area core
/milestone 2.14.x

#### What this PR does / why we need it:
修复了索引查询使用含有 OR 条件嵌套 AND 条件时若匹配数据集间无交集导致的查询结果不正确的问题

如伪查询:`or(query, and(otherQuery1, otherQuery2))`
问题描述:当 `query` 匹配的结果与 `and(otherQuery1, otherQuery2)` 匹配的结果无交集时 and 会将自身不匹配的数据剔除导致 `query` 无法匹配到而出现缺少数据的问题


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

```release-note
None
```
2024-03-06 09:24:08 +00:00
Takagi 71d97b20c0
feat: add select all shortcut function to the table (#5443)
#### What type of PR is this?

/area editor
/area ui
/kind feature
/milestone 2.14.x

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

为默认富文本编辑器中的表格,增加全选快捷键。具体操作逻辑如下:

1. 当光标处于表格中单元格内时,按 `Mod + a` 全选快捷键后,若未选中当前单元格,则选中单元格。
2. 若其中包含有其他影响全选快捷键的组件,则以组件自身为准,例如代码块中的全选。
3. 若已经选中单元格,则再次按全选快捷键,选中整个表格。
4. 若已经选中表格,则再按全选快捷键不会触发其他全选事件。

#### How to test it?

按照操作逻辑测试全选快捷键逻辑是否无误。是否与其他快捷键产生冲突。

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

Fixes #5438 

#### Does this PR introduce a user-facing change?
```release-note
为富文本编辑器中的表格组件增加全选快捷键
```
2024-03-06 06:30:09 +00:00
John Niang 860f694385
Mark the security policy for version 1.x as unsupported (#5450)
#### What type of PR is this?

/kind cleanup

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

Not long ago, we announced the cessation of maintenance for 1.x at <https://www.halo.run/archives/halo-1.x-eol>. So we also need to to synchronize changes to security policies.

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

```release-note
None
```
2024-03-06 06:06:07 +00:00
John Niang 003d1f3db8
Prepare for developing 2.14 (#5448)
#### What type of PR is this?

/kind cleanup
/area core

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

Bump version to 2.14 to prepare for developing 2.14. This always happens after new version is released.

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

```release-note
None
```
2024-03-06 03:04:07 +00:00
Takagi 98523b2bd3
fix: error editing post when img component has file attribute (#5434)
#### What type of PR is this?

/kind bug
/area editor
/area ui
/milestone 2.14.x

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

使用默认编辑器时,当图片、视频中具有 `file` 属性时,进入编辑界面时会报错。此 PR 将不再从渲染后的 HTML 中获取 file 属性,并且在渲染 HTML 时,抛弃掉 file 属性用于解决这个问题。

#### How to test it?

测试图片上传、视频上传功能不受影响即可。

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

Fixes #5430 

#### Does this PR introduce a user-facing change?
```release-note
修复进入文章页面会偶现错误提示的问题
```
2024-03-05 07:20:09 +00:00
Takagi eef53ea81a
fix: rich text editor reuploads images or videos repeatedly during redraws (#5437)
#### What type of PR is this?

/area editor
/area ui
/kind bug
/milestone 2.14.x

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

在当前富文本编辑器中,当做出使图片、视频等组件需要重绘的事件时,会导致已经上传的文件重复上传。
本 PR 在上传完成后,将图片、视频组件 `file` 设置为空,用于解决此问题。

#### How to test it?

1. 使用复制、粘贴的方式在富文本编辑器中添加图片、视频
2. 将上传的图片、视频所处位置进行变更(需要向当前位置往后移动)。
3. 查看已上传的图片、视频是否会重复上传。

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

Fixes #5436 

#### Does this PR introduce a user-facing change?
```release-note
解决富文本编辑器中已上传的图片及视频会重复上传的问题
```
2024-03-05 07:16:07 +00:00
Ryan Wang 6ea7abeff2
chore: bump preset plugins version (#5423)
#### What type of PR is this?

/area core
/milestone 2.13.0
/kind improvement

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

更新预设插件的版本。

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

```release-note
None
```
2024-02-29 16:43:39 +00:00
Ryan Wang f5a9889b47
chore: bump formkit version to 1.5.x (#5395)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.13.x

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

升级 FormKit 的依赖版本至 1.5.x

Please see https://formkit.com/changelog#_150

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

```release-note
升级 FormKit 的依赖版本至 1.5.x
```
2024-02-29 09:57:39 +00:00
guqing 11114416fa
refactor: optimize notification and subscription query using index (#5414)
### What type of PR is this?
/kind improvement
/area core
/milestone 2.13.x

### What this PR does / why we need it:
使用索引机制优化通知和订阅查询以提高性能

how to test it
测试通知列表不报错即可

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

```release-note
使用索引机制优化通知和订阅查询以提高性能
```
2024-02-27 11:53:13 +00:00
John Niang d2f569699b
Check dependencies while installing and upgrading plugins (#5361)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.13.x

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

This PR checks dependencies while installing and upgrading plugins.

Steps to test:

1. Prepare a plugin with dependencies.

	```diff
	apiVersion: plugin.halo.run/v1alpha1
	kind: Plugin
	metadata:
	  name: a-plugin
	...
	+  pluginDependencies:
	+    app-store-integration: 1.*
	```
2. Build the plugin.
3. Try to uninstall `app-store` plugin.
4. Install `a-plugin`.
5. See the result

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

Fixes #5345 

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

```release-note
插件安装和更新时检查依赖是否合法
```
2024-02-27 10:51:13 +00:00
Ryan Wang 827030dd68
refactor: layout of login related page (#5413)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.13.0

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

优化登录相关页面的布局,修复在不同分辨率下的样式问题。

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

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

#### Special notes for your reviewer:

测试登录或者注册页面,任意放大或者缩小页面,观察页面样式是否正常。

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

```release-note
优化登录相关页面的布局,修复在不同分辨率下的样式问题。
```
2024-02-27 10:21:14 +00:00
Ryan Wang 2bfa20d316
chore: add help text for mustVerifyEmailOnRegistration option (#5410)
#### What type of PR is this?

/area core
/kind improvement
/milestone 2.13.0

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

为用户设置中 **注册需验证邮箱** 选项添加提示。

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

```release-note
None
```
2024-02-27 10:17:12 +00:00
guqing 7f4abbba09
refactor: only select the required index fields when build query index view (#5312)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.13.x

#### What this PR does / why we need it:
构建查询视图时只选择被使用到的索引字段
how to test it?
验证文章和附件列表的查询条件和排序条件不会报错即可

#### Does this PR introduce a user-facing change?
```release-note
优化查询视图构建只选择被使用到的索引字段构建查询视图
```
2024-02-27 09:21:12 +00:00
Ryan Wang dc350ae62c
fix: missing code validation label in signup form (#5409)
#### What type of PR is this?

/area ui
/kind bug
/milestone 2.13.0

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

修复注册表单中,验证码的验证提示文字无法显示表单项标题的问题。

before:

<img width="333" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/14f640ce-8e81-4dd4-84e5-d74ca4830a96">

after:

<img width="307" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/f4eb2c30-40b4-4275-bd20-a49771c4bc0f">

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

```release-note
None
```
2024-02-27 08:53:13 +00:00
guqing a15a9587b8
refactor: optimize user query using index (#5396)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.13.x

#### What this PR does / why we need it:
使用索引机制优化用户查询以提高性能

#### Does this PR introduce a user-facing change?
```release-note
使用索引机制优化用户查询以提高性能
```
2024-02-27 08:45:12 +00:00
Ryan Wang b176c497fb
chore: update issue template (#5407)
#### What type of PR is this?

/kind improvement

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

移除 issue 模板中的 **在线站点地址** 输入框,在正常情况下,系统信息中已经包含了外部访问地址。

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

```release-note
None
```
2024-02-27 04:02:13 +00:00
Takagi 3eb9d165bf
pref: refactor default editor video block upload logic (#5302)
#### What type of PR is this?

/kind improvement
/area console
/area editor
/milestone 2.13.x

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

重构默认编辑器视频组件。使其支持上传、取消上传、从附件库选择、替换等功能。

#### How to test it?

直接拖动、复制或选择文件上传一个视频,查看是否显示上传进度条,取消、重试功能是否正常

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

Fixes #5240 

#### Does this PR introduce a user-facing change?
```release-note
重构编辑器视频组件的上传逻辑,增加选择文件上传、上传进度条、取消、重试等机制。
```
2024-02-27 04:00:13 +00:00
John Niang b132597cac
Fix the problem of updating plugin extensions incorrectly (#5404)
#### What type of PR is this?

/kind bug
/area plugin
/area core
/milestone 2.13.x

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

Fix the problem of updating plugin extensions incorrectly.

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

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

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

```release-note
None
```
2024-02-26 08:36:11 +00:00
John Niang 348079d82e
Upgrade Spring Boot to 3.2.3 (#5402)
#### What type of PR is this?

/kind cleanup
/area core
/milestone 2.13.x

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

Upgrade Spring Boot to [3.2.3](https://github.com/spring-projects/spring-boot/releases/tag/v3.2.3).

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

```release-note
升级依赖 Spring Boot 至 3.2.3
```
2024-02-25 14:24:08 +00:00
John Niang b6edb0c4ca
Fix the problem of being unable to login when 2FA was enabled but TOTP was not configured (#5400)
#### What type of PR is this?

/kind bug
/area core
/milestone 2.13.x

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

This PR ignored `email verified` status while 2FA was enabled.

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

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

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

```release-note
修复开启两步验证但未配置 TOTP 可能无法登录的问题
```
2024-02-25 06:14:08 +00:00
guqing bf6bf8cd7c
refactor: add cache control for reverse proxy resources (#5392)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.13.x

#### What this PR does / why we need it:
为插件静态代理资源增加缓存控制以减少不必要的请求

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

#### Does this PR introduce a user-facing change?
```release-note
为插件静态代理资源增加缓存控制以减少不必要的请求
```
2024-02-23 09:30:41 +00:00
John Niang bbe79bac10
Provide extension points for authentication-related web filters (#5386)
#### What type of PR is this?

/kind feature
/area core
/area plugin
/milestone 2.13.x

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

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

This PR provides three extension points:

- FormLoginSecurityWebFilter
- AuthenticationSecurityWebFilter
- AnonymousAuthenticationSecurityWebFilter

which could be extended by plugins easily.

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

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

#### Special notes for your reviewer:

TBD.

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

```release-note
None
```
2024-02-23 09:04:40 +00:00
MashiroT 50fbe37be8
feat: add support for force verify email during user registration (#5320)
#### What type of PR is this?

/kind feature
/kind improvement
/area core
/area console
/kind api-change

#### What this PR does / why we need it:
增加对用户注册时必须验证邮箱的支持

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

Fixes #5016

#### Special notes for your reviewer:
`regRequireVerifyEmail` 为 `false` 时与现在的注册行为一致
为 `true` 时注册页显示验证码校验相关,注册成功后 `UserSpec.emailVerified` 即为 `true`
没有判断邮件通知是否开启,与现有的邮箱验证一致,如未开启则收不到邮件

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

```release-note
增加对用户注册时必须验证邮箱的支持
```
2024-02-22 09:44:06 +00:00
Ryan Wang 9e676712e4
chore: bump vue related packages version (#5384)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.13.x

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

升级 Vue 生态相关依赖至最新版本。

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

```release-note
升级 Vue 生态相关依赖至最新版本。
```
2024-02-22 03:12:07 +00:00
Ryan Wang 698bc30675
chore: bump axios version to 1.6.x (#5383)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.13.x

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

升级 Axios 依赖版本至 1.6.x

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

```release-note
升级 Axios 依赖版本至 1.6.x
```
2024-02-21 04:22:27 +00:00
Ryan Wang 14da9c919c
chore: bump tiptap version to 2.2.3 (#5382)
#### What type of PR is this?

/kind improvement
/area ui
/milestone 2.13.x

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

升级 Tiptap 依赖至 https://github.com/ueberdosis/tiptap/releases/tag/v2.2.3

- https://github.com/ueberdosis/tiptap/releases/tag/v2.2.0

#### Special notes for your reviewer:

测试方式:

1. `./gradlew :ui:build`
2. 测试编辑器的已有功能是否正常。
3. 安装若干已有编辑器插件,测试插件的功能是否正常。

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

```release-note
升级 Tiptap 依赖至 [2.2.3](https://github.com/ueberdosis/tiptap/releases/tag/v2.2.3)。
```
2024-02-21 03:40:28 +00:00
Takagi ca4f705f2d
fix: resolve the issue of text editing not being effective before the table (#5365)
#### What type of PR is this?

/kind bug
/area editor
/area console

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

在 #5191 中对表格新增了如果可以左右滚动时,则显示阴影的特性。而根据 `prosemirror` 的数据流处理策略,在 `decorations` 中,state 是 new EditorState,但通过 `this.editor.view` 获取到的 view 为 old EditorView,进而导致使用了最新的坐标,并且使用其坐标通过旧版本的 view 中获取 DOM 而产生的错误。

本 PR 使用 `NodeView` 而不是 `decorations` 来重新处理表格阴影。

#### How to test it?

在默认富文本编辑器中新建一个表格。在表格前使用拼音输入文本,查看此文本能否被输入。
同时查看表格阴影是否存在

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

Fixes #5352

#### Does this PR introduce a user-facing change?
```release-note
解决默认富文本编辑器表格前字符无法被编辑的问题。
```
2024-02-21 02:44:09 +00:00
Ryan Wang 50e954d297
fix: refine error message of the plugin already exists (#5376)
#### What type of PR is this?

/area core
/kind bug
/milestone 2.13.x

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

补全插件已存在错误提示的翻译。

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

```release-note
None
```
2024-02-20 15:34:08 +00:00
guqing 80e14e97d7
refactor: optimize old attachment query parameters using index (#5363)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.13.x

#### What this PR does / why we need it:
使用索引功能优化附件列表查询

#### Does this PR introduce a user-facing change?
```release-note
使用索引功能优化附件列表查询
```
2024-02-20 02:58:09 +00:00
John Niang 333422a0d4
Keep length of PAT stable (#5374)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.13.x

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

In fact, PAT is a JWT, which is very long. However, we put the claim `roles` into PAT, which will cause the length of PAT to increase as the `roles` information increases.

So, the current PR removes the claim `roles` from PAT, which ensures that the length of PAT becomes stable and we can update roles information for PAT at runtime.

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

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

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

```release-note
避免个人令牌长度随着角色信息增长
```
2024-02-20 02:48:08 +00:00
Takagi 27c98aec36
fix: fix the error when saving settings for posts in the uc (#5370)
#### What type of PR is this?

/kind bug
/area ui

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

在个人中心的文章功能中,点击设置时并不会重新获取最新的 Post 数据,进而导致点击保存时的 `version` 并非最新版本而报错。
此 PR 将在个人中心的文章页面点击设置时,额外增加一次获取最新的 Post 数据的请求,用于解决此问题。

#### How to test it?

1. 进入个人中心
2. 点击文章菜单
3. 点击右上角创建按钮
4. 在编辑器中随便输入内容
5. 点击保存
6. 修改文章的设置后点击保存。
7. 关闭设置框,再次打开设置框,然后点击保存。
8. 查看是否会出现无法保存的问题。

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

Fixes #5344 

#### Does this PR introduce a user-facing change?
```release-note
解决个人中心文章设置时报错的问题
```
2024-02-20 02:36:07 +00:00
Ryan Wang 45d8391885
fix: fail to fetch correct user avatar (#5369)
#### What type of PR is this?

/area ui
/kind bug
/milestone 2.13.x

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

修复 Console 中用户头像无法正确获取的问题。

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

Fixes #5368 

#### Special notes for your reviewer:

测试方式:

1. 创建若干用户,并为部分用户设置不同的头像。
2. 分别进入不同用户的个人资料页面,观察头像是否符合预期。

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

```release-note
修复 Console 中用户头像无法正确获取的问题。
```
2024-02-19 07:23:28 +00:00
John Niang 8156d9da8a
Move username-password authentication into security filter chain (#5348)
#### What type of PR is this?

/kind cleanup
/area core
/milestone 2.13.x

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

UsernamePasswordAuthenticator is a normal webfilter instead of authentication webfilter in security filter chain. There does not guarentee expected results due to different in execution order. So this PR changes UsernamePasswordAuthenticator to AuthenticationWebFilter for managing the filter by security filter chain.

By the way, these changes will not affect any plugins.

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

```release-note
None
```
2024-02-18 08:46:15 +00:00
John Niang 94a51aba4f
Bump pnpm/action-setup version to 3.0.0 (#5364)
#### What type of PR is this?

/kind cleanup
/area core

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

See https://github.com/halo-dev/halo/pull/5340#issuecomment-1950965406 for more.

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

```release-note
None
```
2024-02-18 08:40:15 +00:00
John Niang 07854c993f
Fix the problem of being unable to commit (#5362)
#### What type of PR is this?

/kind cleanup
/area core

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

The wrong `pre-commit` will prevent us from making a Git commit. The problem was caused by <https://github.com/halo-dev/halo/pull/5314>.

```bash
ui/.husky/pre-commit: line 4: cd: console: No such file or directory
husky - pre-commit hook exited with code 1 (error)
```

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

```release-note
None
```
2024-02-18 08:00:16 +00:00
John Niang 9178ad0e22
Refactor AdditionalWebFilter load (#5349)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.13.x

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

This PR creates AdditionalWebFilterChainProxy to call all additional filters instead of using SecurityWebFilterChain.

Please note that:
- the AdditionalWebFilterChainProxy should be executed before `org.springframework.security.web.server.WebFilterChainProxy`.
- I don't change `UsernamePasswordAuthenticator` because of <https://github.com/halo-dev/halo/pull/5348>. The authenticator should be in Security scope instead of a standalone webfilter.

See https://github.com/halo-dev/halo/issues/5300#issuecomment-1933436652 for more.

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

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

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

```release-note
None
```
2024-02-18 04:16:15 +00:00
owo caf3e66e8c
docs: update the branch name from `master` to `main` in contribution.md (#5359)
#### What type of PR is this?
/kind documentation


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

Prevent code contributors from being misled by outdated documentation(1.x).

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

Fixes #5358

#### Special notes for your reviewer:


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


```release-note
NONE
```
2024-02-17 08:00:15 +00:00
owo 05e2682c4d
Improve traditional Chinese translation (#5353)
#### What type of PR is this?
/kind improvement

#### What this PR does / why we need it:
Correct some simplified Chinese characters that were not replaced in the yaml file of traditional Chinese.

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

Fixes #3672

#### Special notes for your reviewer:
I have read the CONTRIBUTING file, but I'm not familiar with PR operations. If there's anything I can do to improve it, please let me know.

> By the way, the [contribution guidelines](https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md) provided in the PR template and README still use `master` as the main branch, which may cause some confusion for new contributors.

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


```release-note
NONE
```
2024-02-17 05:00:15 +00:00
Ryan Wang 8ce6ab6af2
chore: rename console to ui in some files (#5347)
#### What type of PR is this?

/area ui
/kind cleanup

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

Rename console to ui in some files,

Ref https://github.com/halo-dev/halo/pull/5314

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

```release-note
None
```
2024-02-07 14:40:08 +00:00