Commit Graph

5201 Commits (3c785cb7c814b88d561198bf4885263c87dd2c21)

Author SHA1 Message Date
Ryan Wang bae53f59ea
fix: resolve issue with secret input saving additional data (#6196)
#### What type of PR is this?

/kind bug
/area ui
/milestone 2.17.x

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

修复 Secret Input 保存之后会多出 Secret Form 中数据的问题。

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

Fixes #6193 

#### Special notes for your reviewer:

测试方式:

1. 在保存 Secret 的表单选项前,打开一次编辑 Secret 的对话框。
2. 保存数据,检查内容是否多出了其他数据。

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

```release-note
None
```
2024-06-29 16:35:21 +00:00
guqing d2a03dc849
fix: incorrect post display when linking or unlinking hidden categories (#6204)
#### What type of PR is this?
/kind bug
/area core
/milestone 2.17.x

#### What this PR does / why we need it:
修复文章关联或取消关联隐藏分类后显示不正确的问题

#### Which issue(s) this PR fixes:
Fixes #6194
Fixes #6195

#### Does this PR introduce a user-facing change?
```release-note
修复文章关联或取消关联隐藏分类后显示不正确的问题
```
2024-06-28 13:51:00 +00:00
BugKing 2fe1b54f9d
Make front-end scripts compatible with Windows environment (#6202)
#### What type of PR is this?

/kind improvement

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

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


#### Special notes for your reviewer:

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

```release-note
None
```
2024-06-28 13:49:00 +00:00
Ryan Wang f0445f4e51
refactor: remove page cache feature (#6108)
#### What type of PR is this?

/area core
/kind api-change
/milestone 2.17.x

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

移除内置的页面静态缓存功能,后续将由 https://github.com/halo-sigs/plugin-page-cache 插件提供。

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

Fixes #5639 

#### Special notes for your reviewer:

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

```release-note
移除内置的页面静态缓存功能,后续由 https://github.com/halo-sigs/plugin-page-cache 插件提供。
```
2024-06-28 10:08:59 +00:00
guqing 4cafdb5a72
fix: breadcrumbs for hidden category can not be displayed (#6200)
#### What type of PR is this?
/kind bug
/area core
/area theme
/milestone 2.17.x

#### What this PR does / why we need it:
修复获取隐藏分类的面包屑路径不正确的问题

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

#### Does this PR introduce a user-facing change?
```release-note
修复获取隐藏分类的面包屑路径不正确的问题
```
2024-06-28 10:02:59 +00:00
Ryan Wang 80e1110da2
feat: restrict deletion of the primary menu (#6203)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.17.x

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

添加对菜单的限制,不能删除已经设置为主菜单的菜单。

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

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

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

```release-note
None
```
2024-06-28 08:18:59 +00:00
John Niang c7bf87b361
Rectify role templates about PAT and 2FA endpoints (#6201)
#### What type of PR is this?

/kind bug
/area core
/milestone 2.17.x

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

In PR <https://github.com/halo-dev/halo/pull/6130>, I changed the api group of PAT and 2FA endpoints, but I forgot to change the corresponding role templates. So other users except admin will encounter 403 error like <https://github.com/halo-dev/halo/issues/6199>.

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

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

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

```release-note
None
```
2024-06-28 07:24:58 +00:00
Ryan Wang 2ed117042a
refactor: translate extension point descriptions to simplified chinese (#6190)
#### What type of PR is this?

/area core
/kind improvement
/milestone 2.17.x

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

将扩展点定义和扩展点的描述文件改为简体中文。

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

```release-note
None
```
2024-06-28 04:08:57 +00:00
John Niang f936e131c4
Remove deprecated ExtensionComponentsFinder (#6185)
#### What type of PR is this?

/kind cleanup
/area core
/milestone 2.17.x

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

In <https://github.com/halo-dev/halo/pull/5386>, I marked ExtensionComponentsFinder as deprecated. Four months have passed, it's time to remove it.

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

```release-note
None
```
2024-06-28 02:40:57 +00:00
John Niang 0ddc4f8d42
Upgrade Lucene to 9.11.1 (#6188)
#### What type of PR is this?

/kind cleanup
/area core
/milestone 2.17.x

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

See https://github.com/apache/lucene/releases/tag/releases%2Flucene%2F9.11.1 for more.

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

```release-note
升级 Lucene 至 9.11.1
```
2024-06-28 01:58:58 +00:00
John Niang c524ee4340
Fix the unstable integration test of Lucene search engine (#6187)
#### What type of PR is this?

/kind failing-test
/area core
/milestone 2.17.x

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

This PR allows retrying to operate on posts when optimistic locking errors occur.

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

Fixes #6186 

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

```release-note
None
```
2024-06-28 01:56:58 +00:00
guqing 68d94f6653
refactor: optimize the extension watch parameters to always be of real type (#6180)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.17.x

#### What this PR does / why we need it:
优化触发 Extension Watch 方法(onAdd/onUpdate/onDelete)时的参数始终为真实类型避免使用时进行类型转换

#### Does this PR introduce a user-facing change?
```release-note
None
```
2024-06-27 10:16:54 +00:00
Ryan Wang fc35e69766
chore: add types path to ui-plugin-bunlder-kit package.json (#6169) 2024-06-27 18:13:57 +08:00
guqing 0cdd043d1f
feat: add method to find path of a specified node in a category tree (#6135)
#### What type of PR is this?
/kind feature
/area core
/milestone 2.17.x

#### What this PR does / why we need it:
为分类 Finder 提供获取指定节点的面包屑路径方法

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

#### Does this PR introduce a user-facing change?
```release-note
为分类 Finder 提供获取指定节点的面包屑路径方法
```
2024-06-27 10:13:05 +00:00
Ryan Wang bb0a3bc467
feat: add support for setting an owner for posts (#6178)
#### What type of PR is this?

/area ui
/kind feature
/milestone 2.17.x

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

支持手动为文章设置作者。

<img width="734" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/b91b1754-4f50-4333-8478-6735d5846847">


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

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

#### Special notes for your reviewer:

需要测试:

1. 打开任意文章的设置,在高级中设置作者并保存,观察是否成功。
2. 选择一批文章,点击批量设置,设置一个作者,观察是否设置成功。

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

```release-note
支持手动为文章设置作者。
```
2024-06-27 10:10:55 +00:00
Ryan Wang 9d478eecf9
feat: add secret select input (#6140)
#### What type of PR is this?

/area ui
/kind feature
/milestone 2.17.x

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

为 FormKit 添加 Secret 选择组件。

<img width="749" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/5100d7c0-89c0-48d3-9db5-7de67504686e">

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

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

#### Special notes for your reviewer:

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

```release-note
为 FormKit 添加 Secret 选择组件。
```
2024-06-27 10:08:55 +00:00
Takagi 0f6722a37e
pref: add the option to open a new window to the picture jump link (#6170)
#### What type of PR is this?

/kind improvement
/area editor
/milestone 2.17.x

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

为图片跳转链接增加在新窗口打开的选项。

#### How to test it?

测试新窗口打开是否正常可用。

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

Fixes #6109 

#### Does this PR introduce a user-facing change?
```release-note
默认编辑器图片跳转链接支持配置新窗口打开
```
2024-06-27 10:04:54 +00:00
Ryan Wang fc57978aa2
fix: text style in extension point definition page (#6179)
#### What type of PR is this?

/area ui
/kind bug
/milestone 2.17.0

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

修复插件扩展点设置页面标题的颜色问题。

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

```release-note
None
```
2024-06-27 09:48:55 +00:00
Ryan Wang 4d22bc3bbb
refactor: improve the content area width of the editor for low-resolution screens (#6175)
#### What type of PR is this?

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

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

优化文章编辑器内容区域在低分屏下的表现。

默认:

<img width="1898" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/bfca69e5-29cf-45d9-8757-0952fd2a129c">


小屏幕:

<img width="1043" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/88efbeed-fe0c-4b78-b435-f6352dbd8d27">


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

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

#### Special notes for your reviewer:

建议测试在各个屏幕下的表现。

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

```release-note
优化文章编辑器内容区域在低分屏下的表现。
```
2024-06-27 09:46:54 +00:00
Takagi ab14157def
pref: add folding function to code blocks (#6177)
#### What type of PR is this?

/kind improvement
/area editor
/milestone 2.17.x

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

为默认编辑器代码块增加折叠功能。

<img width="892" alt="image" src="https://github.com/halo-dev/halo/assets/31335418/8325cba9-08ce-4bd7-98b6-6bc28fe52daf">

#### How to test it?

测试折叠功能是否可用。
测试重新打开文章之后代码块是否仍旧处于折叠状态。

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

Fixes #6166

#### Does this PR introduce a user-facing change?
```release-note
为默认编辑器代码块增加折叠功能
```
2024-06-27 09:42:54 +00:00
John Niang 556e65a618
Fix the problem of enabling 2FA unexpectedly (#6174)
#### What type of PR is this?

/kind bug
/area core
/milestone 2.17.x

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

Some users encountered 2FA required issue after upgrading Halo 2.16, because they enabled 2FA but didn't configure TOTP before. The issue was introduced by <https://github.com/halo-dev/halo/pull/6005>.

This PR checks if TOTP configured to determine whether 2FA is required.

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

```release-note
修复在没有配置 TOTP 验证器的情况下仍被要求二步验证的问题
```
2024-06-27 09:40:54 +00:00
guqing 4d6450d065
fix: spelling errors in sorting criteria for query categories (#6173)
#### What type of PR is this?
/kind bug
/area core
/milestone 2.17.x

#### What this PR does / why we need it:
修复查询分类的排序条件拼写错误导致的错误

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

#### Does this PR introduce a user-facing change?
```release-note
修复查询分类的排序条件拼写错误导致的错误
```
2024-06-27 09:02:54 +00:00
Ryan Wang c59c61b251
fix: vue injection warn (#6168)
#### What type of PR is this?

/area ui
/kind bug
/milestone 2.17.x

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

Fix the vue injection warn in browser console

<img width="559" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/4160cbe4-fe8b-4b30-a1db-57d35d78e4f9">

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

```release-note
None 
```
2024-06-27 08:08:56 +00:00
Ryan Wang f277655e11
docs: update readme for api client package (#6167)
#### What type of PR is this?

/area ui
/kind documentation
/milestone 2.17.x

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

更新 `@halo-dev/api-client` 包的 readme。

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

```release-note
None
```
2024-06-27 07:16:54 +00:00
Takagi cc36ddaec5
pref: block-level content actively sets fakeSelection (#6162)
#### What type of PR is this?

/kind improvement
/area editor
/milestone 2.17.x

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

由于 RangeSelection 可能将一些并不想展示为模拟选中效果的节点进行了转换,因此将 RangeSelection 中模拟选中的效果,由默认的自动设置为 true,变为 false。

之后需要由节点自行设置 `fakeSelection: true` 后才会展示为模拟选中的效果,否则保持原本的选择样式。

#### How to test it?

测试使用 Mod-a 全选后,listItem 等节点是否会展示为模拟选中的效果。

#### Does this PR introduce a user-facing change?
```release-note
None
```
2024-06-27 07:14:55 +00:00
Ryan Wang 28e4ef0756
fix: clear extension definition options after switching extension points (#6165)
#### What type of PR is this?

/area ui
/kind bug
/milestone 2.17.x

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

修复在扩展点设置页面切换扩展点定义后,扩展定义的选项被清空的问题。

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

Fixes #6164 

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

```release-note
修复在扩展点设置页面切换扩展点定义后,扩展定义的选项被清空的问题。
```
2024-06-27 07:12:53 +00:00
John Niang 54cd1c82f4
Use top-level interface of session repository (#6160)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.17.x

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

Use top-level interface `org.springframework.session.ReactiveFindByIndexNameSessionRepository` for being compatible with other session repositories.

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

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

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

```release-note
None
```
2024-06-27 03:32:53 +00:00
John Niang 47157ddd3f
Fix the problem of not being able to autowire settingFetcher bean in plugin (#6156)
#### What type of PR is this?

/kind bug
/area core
/area plugin

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

The problem was introduced by PR <https://github.com/halo-dev/halo/pull/6141>. That PR wrongly registered `settingFetcher` singleton bean.

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

<img width="1920" alt="image" src="https://github.com/halo-dev/halo/assets/16865714/ecc67064-3506-49b8-8114-a145da549126">

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

```release-note
None
```
2024-06-26 15:46:50 +00:00
John Niang 632bb69dfe
Refactor search engine and improve document extensibility (#6082)
#### What type of PR is this?

/kind improvement
/kind api-change
/area core

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

See https://github.com/JohnNiang/halo/blob/refactor/search/docs/extension-points/search-engine.md for more

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

Fixes https://github.com/halo-dev/halo/issues/5202
Fixes https://github.com/halo-dev/halo/issues/5339
Fixes https://github.com/halo-dev/halo/issues/5613
Fixes https://github.com/halo-dev/halo/issues/5172
Fixes https://github.com/halo-dev/halo/issues/4796
Fixes https://github.com/halo-dev/halo/issues/5625
Fixes https://github.com/halo-dev/halo/issues/5805

#### Special notes for your reviewer:

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

```release-note
重构搜索引擎并提高可扩展性。
```
2024-06-26 15:22:51 +00:00
Ryan Wang 5eabce7544
feat: add management and view pages for extension points (#6137)
#### What type of PR is this?

/area ui
/kind feature
/milestone 2.17.x

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

添加扩展点的查看和设置页面。

<img width="1414" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/4dd4660f-540f-46b5-8250-b4f011ebaae6">

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

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

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

```release-note
添加系统扩展点的查看和设置页面。
```
2024-06-26 13:58:51 +00:00
Ryan Wang 49c4a917e1
fix: resolve style issues caused by changing the order of CSS imports (#6153)
#### What type of PR is this?

/area ui
/kind bug

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

修复 https://github.com/halo-dev/halo/pull/6152 中因为改动了 css 文件的导入顺序带来的样式问题。

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

```release-note
None
```
2024-06-26 11:36:50 +00:00
John Niang 1a0e20b8ab
Merge pull request #6116 from guqing/feature/6093
feat: support hide categories and posts from the list
2024-06-26 19:33:47 +08:00
Ryan Wang bc1033611e Refine UI for categories hiden 2024-06-26 19:25:10 +08:00
guqing 0196315228 feat: support hide categories and posts from the list 2024-06-26 19:24:47 +08:00
guqing 68d428aa29
refactor: enhance cache management in plugin setting config (#6141)
#### What type of PR is this?
/kind feature
/area plugin
/area core
/milestone 2.17.x

#### What this PR does / why we need it:
增强插件配置的缓存管理

1. 通过 SettingFetcher/ReactiveSettingFetcher 获取插件配置可以不在考虑获取数据的性能问题,当数据变更后会自动更新缓存
2. 现在你可以通过在插件中监听 `PluginConfigUpdatedEvent` 事件来做一些处理,它会在用户更改插件配置后被触发

#### Does this PR introduce a user-facing change?
```release-note
增强插件配置的缓存管理并支持通过监听 `PluginConfigUpdatedEvent` 事件做一些特殊处理
```
2024-06-26 11:20:51 +00:00
John Niang 59edade8bb
Merge pull request #6100 from guqing/feature/6023 2024-06-26 19:19:46 +08:00
Takagi 73798e86c6
feat: add gap cursor for top-level block nodes in default editor (#6103)
#### What type of PR is this?

/kind feature
/area editor
/milestone 2.17.x

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

目前想对块级节点进行换行是一件比较困难的事情,尤其是两个相邻的块级节点之间的想插入额外的一行时更加困难。间隙光标可以解决这一问题。

为默认编辑器的顶级块节点(pos.depth = 1)增加间隙光标的功能。当 NodeType 属性 `allowGapCursor` 为 true 时,将会在目标节点上启用间隙光标的功能。间隙光标将可能出现在目标节点的左上方与右下方。

<img width="909" alt="image" src="https://github.com/halo-dev/halo/assets/31335418/fbbdc8fe-59c9-4ae3-a7c8-97a90607c785">

已知问题:
1. 对于 inlineContent 的节点,点击生成间隙光标时,光标会先出现在对应的内容上,会出现闪动的问题。
2. 在间隙光标上使用组合输入(例如中文输入)时,首个字母会被新增至新的一行。
3. CodeBlock 无法使用间隙光标(CodeBlock 自身问题,待适配)
~~4. 首行空文本无法被删除(与 Gap Cursor 问题无关,待适配  Paragraph)~~
~~5. 删除文本上方有可以添加间隙光标的块级节点时,无法触发间隙光标的 Backspace 事件(同 4,属于 Paragraph 适配问题)~~

目前已经启用此功能的节点:

- 表格
- 分栏卡片
- CodeBlock (无法生效)

#### How to test it?

测试间隙光标是否能够在表格与分栏卡片上出现。
测试间隙光标出现后,输入文本、使用快捷键等操作是否符合逻辑。
测试使用方向键调整间隙光标位置。

#### Does this PR introduce a user-facing change?
```release-note
为默认编辑器的块级节点增加间隙光标的功能。
```
2024-06-26 11:18:50 +00:00
Ryan Wang 2c9d94f034 Refine UI for device managment 2024-06-26 18:53:24 +08:00
guqing 8d71fc3966 feat: add device management mechanism 2024-06-26 18:52:32 +08:00
Ryan Wang a93479dc34
chore: organize and fix imports (#6152)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.17.x

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

重新组织和固定 UI 部分代码的 imports 导入,防止后续因为 imports 的顺序造成不必要的 diff。

基于:https://github.com/halo-dev/halo/pull/6151

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

```release-note
None
```
2024-06-26 10:42:50 +00:00
Takagi 5aacd8a252
pref: editor iframe risk with src tag (#6150)
#### What type of PR is this?

/kind improvement
/area editor
/milestone 2.17.x

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

在用户设置 iframe 相关的 src 时,检测设置的链接是否符合白名单。如果不符合则不允许设置。

see https://github.com/ueberdosis/tiptap/pull/5160

#### How to test it?

测试在 iframe 中的 src 输入 `javascript: alert("1")` 时是否会触发 javascript

#### Does this PR introduce a user-facing change?
```release-note
处理默认编辑器中 iframe 标签的 src 属性可能存在的风险
```
2024-06-26 10:24:50 +00:00
Ryan Wang ed6a5e3898
chore: add vscode settings.json (#6151)
Signed-off-by: Ryan Wang <i@ryanc.cc>
2024-06-26 18:07:53 +08:00
Ryan Wang 2ae5d222d9
feat: add batch setting for partial post fields (#6142)
#### What type of PR is this?

/kind feature
/area ui
/milestone 2.17.x

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

支持批量为文章设置部分属性。

![image](https://github.com/halo-dev/halo/assets/21301288/cc4aa912-20ba-4b50-869b-705702f56d7d)

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

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

#### Special notes for your reviewer:

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

```release-note
支持批量为文章设置部分属性。
```
2024-06-26 09:58:50 +00:00
Takagi 5d5df7c7a9
feat: add dynamic list input (#6146)
#### What type of PR is this?

/kind feature
/area ui
/milestone 2.17.x

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

为 formkit 增加动态列表的 input。

使用方式:

```
- $formkit: list
  name: users
  label: Users
  addLabel: Add User
  min: 1
  max: 3
  itemType: string
  children:
    - $formkit: text
      index: "$index"
      validation: required
```

> [!NOTE]
> `list` 组件有且只有一个子节点,并且必须为子节点传递 `index` 属性。若想提供多个字段,则建议使用 `group` 组件包裹。

#### How to test it?

测试动态数组是否正常可用。保存的结果是否为 `{users: ["", ""]}`

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

Fixes #6098

#### Does this PR introduce a user-facing change?
```release-note
为 Formkit 增加动态列表的 input 组件 list
```
2024-06-26 09:48:49 +00:00
guqing ae6724a2b6
feat: implement persistent token based remember me mechanism (#6131)
#### What type of PR is this?
/kind feature
/area core
/milestone 2.17.x

#### What this PR does / why we need it:
新增基于持久化 Token 的 RememberMe 机制

本次更新引入了一种新的 RememberMe 机制,该机制基于持久化 Token,以增强安全性和管理灵活性。在此之前,RememberMe 功能通过以下方式生成 Token,并将其作为 cookie 发送回客户端:
```
 username + ":" + expiryTime + ":" + algorithmName + ":"
   + algorithmHex(username + ":" + expiryTime + ":" + password + ":" + key)
```
此方法的优点在于无需存储 Token 就可以进行验证,并且用户密码的更改会自动使 Token 失效。然而,它的主要缺点是缺乏管理能力,例如无法手动撤销 Token。

鉴于最新的设备管理需求(见 PR #6100),我们需要一种支持设备撤销(revoke)的机制。因此,我们采用了持久化 Token 的方式,并通过随机生成的方法来提高安全性,而不将用户名和密码直接签名在 Token 中。新的 Token 格式如下:
```
base64(tokenValue:series)
```
此更改将为系统带来更高的安全保障和更灵活的管理选项,特别是在需要高度控制和监管设备访问时。

#### Does this PR introduce a user-facing change?
```release-note
引入基于持久化 Token 的新 RememberMe 机制以增强安全性和管理灵活性,升级后需要重新登录
```
2024-06-26 08:40:49 +00:00
guqing 3f94cfc9a8
refactor: add list options for sync all synchronizer (#6145)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.17.x

#### What this PR does / why we need it:
为启动时同步添加 ListOptions 选项为后续保持 ExtensionMatcher 的纯粹做准备,后续将移除 ExtensionMatcher 中多余的方法声明,只保留 match 方法,最终的结果希望是
```java
@FunctionalInterface
public interface ExtensionMatcher {
    boolean match(Extension extension);
}
```
以前构建 Controller 的写法
```java
public Controller setupWith(ControllerBuilder builder) {
         return builder
            .extension(new Post())
            .onAddMatcher(DefaultExtensionMatcher.builder(client, Post.GVK)
                .fieldSelector(FieldSelector.of(
                    equal(Post.REQUIRE_SYNC_ON_STARTUP_INDEX_NAME, TRUE))
                )
                .build()
            )
           .build();
}
```
现在的写法
```java
public Controller setupWith(ControllerBuilder builder) {
        var post = new Post();
        return builder
            .extension(post)
            // 当有新数据添加时
            .onAddMatcher(extension -> "fake-post".equals(extension.getMetadata().getName()))
            // 使用 syncAllListOptions 作为启动时同步的查询条件过滤不需要的数据
            .syncAllListOptions(ListOptions.builder()
                .fieldQuery(equal(Post.REQUIRE_SYNC_ON_STARTUP_INDEX_NAME, TRUE))
                .build()
            )
            .build();
    }
```

#### Does this PR introduce a user-facing change?
```release-note
开发者相关:重构 ControllerBuilder 的匹配条件并增加 syncAllListOptions 作为启动时同步的查询条件
```
2024-06-26 06:50:50 +00:00
guqing 50f751dda2
refactor: add builder for list options (#6148)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.17.x

#### What this PR does / why we need it:
为 ListOptions 增加 Builder 以方便构建 ListOptions 对象,可以通过以下形式创建
```java
var listOptions = ListOptions.builder()
                .labelSelector()// 构建 LabelSelector
                .eq("key-1", "value-1")
                .notEq("key-2", "value-1")
                .exists("key-3")
                .end()// 结束构建 LabelSelector
                .fieldQuery(equal("spec.title", "fake-title"))  // 构建 FieldSelector
                .andQuery(equal("spec.slug", "fake-slug"))
                .orQuery(equal("spec.slug", "test"))
                .build();
```

#### Does this PR introduce a user-facing change?
```release-note
开发者相关:支持通过 Builder 来简化 ListOptions 的构建
```
2024-06-26 06:44:49 +00:00
Takagi ba2987b585
feat: range selection feature to default editor (#6117)
#### What type of PR is this?

/kind feature
/area editor
/milestone 2.17.x

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

为默认编辑器添加 `RangeSelection` 选择器。

<img width="989" alt="image" src="https://github.com/halo-dev/halo/assets/31335418/c976cf99-0d6e-4346-9b05-8b9b0dc95183">


它的功能基本与 TextSelection 相反,例如:

1. TextSelection 支持光标展示,RangeSelection 不允许空内容,即它并不支持光标。
2. TextSelection 会抛弃被选择的 Node 节点部分偏移量,而 RangeSelection 会扩展偏移量至 Node 节点结束。
3. TextSelection 支持 Text 而 RangeSelection 支持 Node 节点。

`RangeSelection` 可以用于范围选中块节点并进行操作,可用于全选内容并进行删除操作。

#### How to test it?

测试使用点击,拖拽,释放鼠标的操作,能否选中某些节点。
测试删除选中的节点。

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

Fixes #5194

#### Does this PR introduce a user-facing change?
```release-note
为默认编辑器添加 RangeSelection 选择器
```
2024-06-26 06:14:50 +00:00
Takagi c1ba566e08
fix: autosave content feature not working (#6147)
#### What type of PR is this?

/kind bug
/area ui
/milestone 2.17.x

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

解决自动保存失效的问题

#### How to test it?

测试文章、页面输入内容后,点击其他页面是否能够自动保存。

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

Fixes #6129 

#### Does this PR introduce a user-facing change?
```release-note
解决文章自动保存失效的问题
```
2024-06-26 06:10:49 +00:00
Ryan Wang 88db1976c8
refactor: hide move group button when no attachment groups are present (#6138)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.17.x

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

选择附件时,如果当前没有分组,改为不显示移动按钮。

<img width="385" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/2d805f29-ecea-4469-b305-e217bd17db8b">

<img width="497" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/34800eb1-8fae-42fa-b875-929a3d912967">


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

Fixes #6124 

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

```release-note
None
```
2024-06-26 04:26:49 +00:00