Commit Graph

4908 Commits (f24b08c7db748cb93f5af9bb83c0b1ee724e1041)

Author SHA1 Message Date
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
John Niang d2cee48946
Merge pull request #5341 from JohnNiang/chore/upgrade-to-openj9-21
Upgrade Halo runtime environment to JRE 21
2024-02-07 22:38:25 +08:00
John Niang fe3df4b2d7
Merge pull request #5340 from JohnNiang/chore/remove-warning-from-actions
Bump actions' versions for muting warning from GitHub workflow
2024-02-06 23:03:39 +08:00
John Niang 5fdf6c0af1 Upgrade to JDK/JRE 21 when building Docker image
Signed-off-by: John Niang <johnniang@foxmail.com>
2024-02-06 16:50:26 +08:00
John Niang 77a34c11d5 Bump actions' versions for muting warning from GitHub workflow
Signed-off-by: John Niang <johnniang@foxmail.com>
2024-02-06 15:57:26 +08:00
John Niang 2cf19a4581
Merge pull request #5314 from JohnNiang/refactor/console-as-subproject
Add Gradle build script for ui project
2024-02-06 14:22:58 +08:00
John Niang 0f9552d923 Do not execute :ui:build when application is not building
Signed-off-by: John Niang <johnniang@foxmail.com>
2024-02-06 10:37:14 +08:00
John Niang 29ec459eac Merge remote-tracking branch 'upstream/main' into refactor/console-as-subproject 2024-02-05 23:40:07 +08:00
guqing 7341f9de6c
chore: remove unnecessary indices build process for lucene on startup (#5332)
#### What type of PR is this?
/kind cleanup
/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-05 06:54:13 +00:00
guqing 06a44d05dc
fix: possible incorrect result set obtained by Gc synchronizer when sartup (#5325)
#### What type of PR is this?
/kind bug
/area core
/milestone 2.13.x

#### What this PR does / why we need it:
修复启动时 GcSynchronizer 没有精准过滤出所需数据导致内存占用会出现较高峰值的问题

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

#### Does this PR introduce a user-facing change?
```release-note
修复启动时 GcSynchronizer 没有精准过滤出所需数据导致内存占用会出现较高峰值的问题
```
2024-02-05 06:31:13 +00:00
guqing dcef5d4157
fix: failure in data query due to reconciler triggered by uncommitted transaction (#5323)
#### What type of PR is this?
/kind bugfix
/milestone 2.12.x
/area core

#### What this PR does / why we need it:
修复事务未提交便触发控制器执行可能导致数据状态不正确的问题

**how to test it?**
1. 测试如 #5315 的问题是否还存在
2. 测试添加重名自定义模型对象会抛出异常且数据被回滚

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

#### Does this PR introduce a user-facing change?
```release-note
修复事务未提交便触发控制器执行可能导致数据状态不正确的问题
```
2024-02-05 04:09:07 +00:00
John Niang a3772fab1b Add build script for ui project
Signed-off-by: John Niang <johnniang@foxmail.com>
2024-02-03 22:51:50 +08:00
John Niang 15f7fe2d4f Move folder console to ui 2024-02-02 22:22:51 +08:00
John Niang b4e196372d
Compatible with negative page number and size (#5311)
#### What type of PR is this?

/kind bug
/area core
/milestone 2.13.x

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

This PR makes Halo compatible with negative page number and size parameters to resolve <https://github.com/halo-dev/halo/issues/5298>.

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

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

#### Special notes for your reviewer:

Try to install [Hao theme](https://github.com/liuzhihang/halo-theme-hao/releases/tag/v1.4.7) and [Chirpy theme](https://github.com/AirboZH/halo-theme-chirpy/releases/tag/v1.3.3) and check the frontend pages.

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

```release-note
修复因限制分页参数导致部分主题页面无法正常渲染的问题。
```
2024-02-02 12:30:05 +00:00
John Niang 27db40f7f6
Support building Docker image with major version tag (#5304)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.13.x

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

This PR supports building Docker image with major version tag, e.g.: `halohub/halo:2`.

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

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

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

```release-note
None
```
2024-02-02 08:38:33 +00:00
John Niang 5b93667d8f
Prepare for 2.13.0 development (#5299)
#### What type of PR is this?

/kind cleanup
/area core

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

This PR bumps version to 2.13.0-SNAPSHOT and corrects links of Halo in README.md.

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

```release-note
None
```
2024-02-01 07:11:40 +00:00
Ryan Wang e85a55e416
feat: add supports for ui permissions of notification reason type (#5286)
#### What type of PR is this?

/kind feature
/area core
/area console
/milestone 2.12.x

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

为通知类型设置添加 UI 权限判断。

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

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

#### Special notes for your reviewer:

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

```release-note
为通知类型设置添加 UI 权限判断。
```
2024-01-31 12:11:25 +00:00
Takagi dff6522d43
fix: preserve white spaces when parsing the default editor (#5292)
#### What type of PR is this?

/kind bug
/area editor
/area console
/milestone 2.12.x

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

在默认富文本编辑器解析文本时,使其保留空白符。

see https://prosemirror.net/docs/ref/#model.ParseOptions.preserveWhitespace

#### How to test it?

1. 输入一串文字,在其开始、结束、内容中分别键入空白字符。
2. 保存内容
3. 刷新页面,查看空白字符是否保留。

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

Fixes #5260 

#### Does this PR introduce a user-facing change?
```release-note
解决默认富文本编辑器内容刷新后空白字符丢失的问题
```
2024-01-31 10:20:08 +00:00
John Niang 7543fb6346
Merge pull request #5291 from ruibaby/fix/pat-roles
fix: issue of non-template roles being displayed in personal token roles
2024-01-31 18:13:54 +08:00
John Niang e15923b2d4
Fix the problem of unable to enable/disable 2FA for non-admin users (#5290)
Signed-off-by: John Niang <johnniang@foxmail.com>
2024-01-31 15:44:41 +08:00
Ryan Wang 7e9f8128c3 fix: issue of non-template roles being displayed in personal token roles
Signed-off-by: Ryan Wang <i@ryanc.cc>
2024-01-31 15:42:57 +08:00
John Niang e8c6189cd0
Merge pull request #5282 from JohnNiang/chore/remove-sonar-scaning
Remove analyzing code step in test job
2024-01-30 16:55:49 +08:00
John Niang b4bf425a09 Remove analyzing code step in test job
Because we have enabled Automatic Analysis

Signed-off-by: John Niang <johnniang@foxmail.com>
2024-01-30 16:37:51 +08:00
John Niang c792cef52f
Merge pull request #5279 from guqing/bugfix/order-for-contributors
fix: the order of contributors for posts is not fixed
2024-01-30 16:27:07 +08:00
Ryan Wang 0b03ae075b
chore: change editor version to 2.12.0 (#5281)
#### What type of PR is this?

/area console
/kind improvement
/milestone 2.12.x

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

修改 `@halo-dev/richtext-editor` 的版本号,为发布 Halo 2.12 做准备。

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

```release-note
None
```
2024-01-30 07:53:54 +00:00
guqing a5b0e866bd fix: the order of contributors for posts is not fixed 2024-01-30 15:51:28 +08:00
Ryan Wang 831a19b86c
refactor: data fetching of dashboard widgets (#5280)
#### What type of PR is this?

/area console
/kind improvement
/milestone 2.12.x

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

重构 Console 仪表盘中小部件的数据获取方式。

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

```release-note
None
```
2024-01-30 07:36:20 +00:00
Ryan Wang a4e862cfc4
fix: current selected role templates will be clear after select a other role (#5276)
#### What type of PR is this?

/area console
/kind bug
/milestone 2.12.x

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

修复创建角色时,勾选某个角色模板导致已选角色模板被清空的问题。

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

Fixes #5275 

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

```release-note
None
```
2024-01-29 10:02:25 +00:00
guqing 2de03851c4
refactor: error prompt for inability to obtain avatar permalink when starting (#5269)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.12.x

#### What this PR does / why we need it:
优化启动时用户头像获取不到的错误提示

原因是在启动时用户被执行 reconcile 时使用的 plugin-s3 插件还没有启动所以无法获取到 permalink 需要重试

how to test it?
使用 plugin-s3 插件作为用户头像的存储策略然后上传头像测试此 PR 在启动时的异常提示是否输出为:
```
2024-01-29T11:53:13.674+08:00  WARN 31937 --- [rReconciler-t-1] r.h.a.c.e.reconciler.UserReconciler      : Failed to get avatar permalink for user [guqing] with attachment [460be0c4-b09f-4b25-ad93-e45f30331ec7], re-enqueuing...
```
#### Which issue(s) this PR fixes:
Fixes #5268

#### Does this PR introduce a user-facing change?
```release-note
优化启动时用户头像获取不到的错误提示
```
2024-01-29 09:52:25 +00:00
Takagi 6ee5503643
pref: adapt auto save functionality for articles in the uc (#5272)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.12.x

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

为个人中心的文章适配自动保存功能

#### How to test it?

新建一个空白文章,测试当失去焦点、切换路由,或者在页面等待 20S 后,是否会自动创建文章草稿。

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

Fixes #5036 

#### Does this PR introduce a user-facing change?
```release-note
为个人中心的文章适配自动保存功能
```
2024-01-29 09:32:25 +00:00
Ryan Wang e8a9f063f1
fix: pat can not be copied (#5274)
#### What type of PR is this?

/area console
/kind bug
/milestone 2.12.x

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

修复创建 PAT 之后,点击复制按钮无法复制 token 的问题。

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

Fixes #5273 

#### Special notes for your reviewer:

测试步骤:

1. 构建生产环境的 UC。
2. 创建 PAT,点击复制按钮,观察是否能够正常复制。

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

```release-note
修复创建 PAT 之后,点击复制按钮无法复制 token 的问题。
```
2024-01-29 09:25:12 +00:00
John Niang 47a1aa7631
Fix the problem of showing 500 error while containing special chars in excerpt (#5263)
#### What type of PR is this?

/kind bug
/area core
/milestone 2.12.0

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

This PR refactors building html meta by using `modelFactory#createStandaloneElementTag`.

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

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

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

#### Special notes for your reviewer:

Validate via <https://github.com/halo-dev/halo/issues/4755#issuecomment-1776391345>.

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

```release-note
修复摘要中包含特殊字符导致无法解析页面的问题
```
2024-01-29 08:58:48 +00:00
Ryan Wang 9137d50a31
chore: add vue dev tools (#5134)
#### What type of PR is this?

/area console
/kind improvement
/milestone 2.12.x

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

为 Console 和 UC 添加 Vue 社区新的 [Dev Tools](https://github.com/vuejs/devtools-next)。

可以不再需要依赖浏览器插件。

<img width="1920" alt="图片" src="https://github.com/halo-dev/halo/assets/21301288/8b0af197-b795-4ca2-ba4b-cb7895e1e409">
<img width="1920" alt="图片" src="https://github.com/halo-dev/halo/assets/21301288/e447c99d-a150-4f0d-9e50-b5fdddccf378">

#### Special notes for your reviewer:

后续也可以尝试为 Halo 的 UI 部分的插件机制适配 Dev Tools,参考:https://devtools-next.vuejs.org/plugins/api

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

```release-note
为 Console 和 UC 添加 Vue 社区新的 [Dev Tools](https://github.com/vuejs/devtools-next)。
```
2024-01-29 08:50:42 +00:00
Ryan Wang 192b238e37
fix: it cannot be re-uploaded when the user's avatar cannot be obtained (#5270)
#### What type of PR is this?

/area console
/kind bug
/milestone 2.12.x

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

修复当头像因为后端服务无法正常变更时,前端因为一直处于 refetch 状态导致无法重新上传的问题。

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

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

#### Special notes for your reviewer:

1. 使用 https://github.com/AirboZH/plugin-uposs 存储服务创建一个存储策略。
2. 用户设置中的头像存储位置改为此存储策略。
3. 上传头像,观测是否一直处于重新获取的状态。

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

```release-note
优化头像上传,防止因为后端服务异常导致无法重新上传。
```
2024-01-29 08:06:02 +00:00
Ryan Wang cf72cbccbd
fix: unable to request session keep-alive API when browser tabs are inactive (#5266)
#### What type of PR is this?

/area console
/kind bug
/milestone 2.12.x

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

修复当浏览器标签页不活跃时,文章编辑页面的 health 接口没有定时请求的问题。

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

Fixes #5265 

#### Special notes for your reviewer:

测试方式:

1. 可以在本地先将 refetchInterval 改为 1000 以方便测试。
2. 进入文章编辑页面。
3. 切换至其他标签页。
4. 返回之后查看浏览器开发者工具的 Network ,观察 health 接口是否有请求。

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

```release-note
修复当浏览器标签页不活跃时,文章编辑页面的 health 接口没有定时请求的问题。
```
2024-01-29 08:05:35 +00:00