Commit Graph

4262 Commits (d5f6dc2207bc154b8baf4cf4324fd5bbe4ae833d)

Author SHA1 Message Date
Ryan Wang 5c308993c6
feat: add required indicator for formkit label (#3824)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.5.x

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

为 FormKit 表单中包含了 required 验证的表单元素的 label 添加指示器(*),优化可访问性。

<img width="694" alt="image" src="https://user-images.githubusercontent.com/21301288/233822533-6a30b43e-738a-47f3-92c1-045d34cc1ba3.png">

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

Fixes #3823 

#### Special notes for your reviewer:

测试方式:

1. 检查 Console 端的表单中必填项的 label 是否添加了 * 即可。

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

```release-note
为 FormKit 表单中包含了 required 验证的表单元素的 label 添加指示器(*),优化可访问性。
```
2023-04-23 06:49:28 +00:00
Ryan Wang 629a620668
chore: set eslint max-warnings option and remove unused imports (#3822)
#### What type of PR is this?

/kind improvement
/area console

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

调整 ESLint 的执行参数,添加 max-warnings 为 0,意味着在提交或者运行 CI 的时候不再允许包含 warning 级别的检测。

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

```release-note
None
```
2023-04-23 04:37:33 +00:00
Ryan Wang 9e0fc8283f
feat: improve layout and styles of group formkit input (#3786)
#### What type of PR is this?

/kind feature
/area console
/milestone 2.5.x

Fixes #3734

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

为 FormKit 的 group 输入组件重构布局和样式。

before:

<img width="591" alt="image" src="https://user-images.githubusercontent.com/21301288/232968801-c15bfdcc-5bbe-493e-8a96-a7ff3442e52d.png">


after:

<img width="580" alt="image" src="https://user-images.githubusercontent.com/21301288/232968757-8892f386-3ff2-4147-b1f7-cbfbcfd5bc6e.png">

可以测试的 FormKit Schema:

```yaml
- $formkit: group
  name: author
  label: 作者
  children:
    - $formkit: text
      name: name
      label: 名称
    - $formkit: text
      name: email
      label: Email
```


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

```release-note
为 Console 端 FormKit 的 group 输入组件重构布局和样式。
```
2023-04-23 04:27:32 +00:00
Ryan Wang 61f4729d87
chore: bump tanstack query version and disable refetchOnWindowFocus option by default (#3771)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.5.x

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

升级 @tanstack/vue-query 的版本至 [v4.29.1](https://github.com/TanStack/query/releases/tag/v4.29.1),并默认将 `refetchOnWindowFocus` 选项设置为 false。此选项的作用是当窗口重新聚焦时,刷新当前页面请求的状态(重新请求接口),目前暂时不需要使用它。

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

```release-note
升级 Console 端 `@tanstack/vue-query` 依赖的版本至 [v4.29.1](https://github.com/TanStack/query/releases/tag/v4.29.1)
```
2023-04-23 03:37:56 +00:00
Ryan Wang c6f0ac7e71
fix: not reload page after upgrading a plugin (#3781)
#### What type of PR is this?

/kind bug
/area console
/milestone 2.5.x

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

修复升级插件之后没有自动刷新页面的问题,一般情况来说,升级插件之后需要重载插件 Console 部分的资源。

#### Special notes for your reviewer:

测试方式:

1. 以 deployment 模式启动 Halo
2. 测试升级插件之后是否有正常刷新页面

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

```release-note
修复 Console 端升级插件之后没有自动刷新页面的问题。
```
2023-04-23 03:37:39 +00:00
Ryan Wang eec1d0758e
feat: add description component (#3792)
#### What type of PR is this?

/kind feature
/area console
/milestone 2.5.0

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

为 Console 端添加 Description 组件。

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

Fixes #3790 

#### Special notes for your reviewer:

测试方式:

1. 检查主题管理、插件详情、认证方式详情页面的样式是否异常即可。

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


```release-note
为 Console 端添加 Description 组件。
```
2023-04-23 02:49:32 +00:00
Ryan Wang 676df239ea
fix: role templates in the plugin detail page is not loaded. (#3794)
#### What type of PR is this?

/kind bug
/area console
/milestone 2.5.x

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

修复插件页面中的角色模板在首次进入页面时,无法加载的问题。

<img width="984" alt="image" src="https://user-images.githubusercontent.com/21301288/233105675-8677b92b-e055-4b62-bfad-2947303ad901.png">


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

Fixes #3793 

#### Special notes for your reviewer:

测试方式:

1. 安装一个带有角色模板的插件,比如:https://github.com/halo-sigs/plugin-links
2. 进入插件详情页面,观察角色模板是否显示正确。

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

```release-note
修复 Console 端插件详情页面中角色模板无法正常加载的问题。
```
2023-04-22 03:07:41 +00:00
Ryan Wang 50832a09df
perf: close attachment upload modal after click complete button (#3784)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.5.x

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

支持在附件上传弹框中点击完成按钮关闭弹框。

<img width="647" alt="image" src="https://user-images.githubusercontent.com/21301288/232964793-d4e94e7a-fc81-4d1b-b0fc-b93d8f5bc537.png">

#### Special notes for your reviewer:

测试方式:

1. 测试上传完附件之后,点击完成按钮,观察是否关闭上传弹框即可。

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

```release-note
优化 Console 端上传附件的弹框,支持点击完成按钮以关闭弹框。
```
2023-04-21 12:33:41 +00:00
guqing f076fc5740
refactor: add validation for initializing super admin username (#3744)
#### What type of PR is this?
/kind improvement
/area core

#### What this PR does / why we need it:
对初始超级管理员用户名增加合法性校验

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

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

```release-note
对初始超级管理员用户名增加合法性校验
```
2023-04-21 03:20:12 +00:00
John Niang 11a5807682
Enable defining Reconciler in plugin (#3789)
#### What type of PR is this?

/kind feature
/area core
/area plugin

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

This PR adds reconciliation mechanism for plugin. After that, we could define a `Reconciler<Request>` like the following when developing plugin:

```java
@Slf4j
@Component
public class ApplicationReconciler implements Reconciler<Reconciler.Request> {

    @Override
    public Result reconcile(Request request) {
        log.info("Application {} changed.", request);
        return Result.doNotRetry();
    }

    @Override
    public Controller setupWith(ControllerBuilder builder) {
        return builder
            .extension(new Application())
            .workerCount(1)
            .build();
    }
}
```

You can reconcile any extensions as needed.

Meanwhile, all plugins will be stopped when Halo is shutting down.

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

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

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

```release-note
支持在插件中定义 Reconciler
```
2023-04-19 10:42:25 +00:00
Ryan Wang 7afb3b8687
feat: import zh_TW locale for uppy component (#3785)
#### What type of PR is this?

/kind feature
/area console
/milestone 2.5.x

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

为上传组件 Uppy 导入中文繁体的语言包。

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

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

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

```release-note
None
```
2023-04-19 10:40:24 +00:00
guqing 5477e30781
refactor: optimize the exception information (#3747)
#### What type of PR is this?
/kind improvement
/area core

#### What this PR does / why we need it:
优化异常信息
- 5xx 服务器内部错误不显示异常详情到页面,如主题模板表达式错误
- 访问 `GET /apis/api.halo.run/v1alpha1/comments` 提示 400 且不会打印异常堆栈
- 访问不存在的主题静态资源提示 404 且不会打印异常堆栈,如 `GET /themes/guqing-higan/assets/dist/style1.css`

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

#### Does this PR introduce a user-facing change?
```release-note
None
```
2023-04-19 10:26:24 +00:00
John Niang a94c0c7f85
Add property halo.use-absolute-permalink to control permalink generation (#3772)
#### What type of PR is this?

/kind improvement
/kind api-change
/area core
/milestone 2.5.x

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

Add property `halo.use-absolute-permalink`(default is `false`) to control permalink generation. Leave `halo.external-url` as `null` by default.

Meanwhile, I enhanced `ExternalUrlSupplier#getURL` to get URL from not only properties but only http request.

#### How to use it?

```yaml
halo:
  use-absolute-permalink: false
```

Or:

```yaml
halo:
  external-url: https://halo.run/
  use-absolute-permalink: false
```

Or:

```yaml
halo:
  external-url: https://halo.run/
  use-absolute-permalink: true
```

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

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

#### Special notes for your reviewer:

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

```release-note
新增是否生成相对地址的配置
```
2023-04-19 07:54:24 +00:00
Ryan Wang 762747624f
docs: update SECURITY.md for Halo 2.x (#3780)
#### What type of PR is this?

/kind documentation

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

更新 SECURITY.md 文档中支持的版本。

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

```release-note
None
```
2023-04-19 02:47:00 +00:00
Ryan Wang f87295e5c8
perf: reload page after active theme (#3779)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.5.x

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

在主题列表激活主题之后,自动刷新页面。

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

Fixes #3778 

#### Special notes for your reviewer:

测试方式:

1. 打开主题列表,选择任意主题激活,观察是否刷新页面。

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

```release-note
优化 Console 端激活主题的流程,支持激活后自动刷新页面
```
2023-04-19 02:23:00 +00:00
Ryan Wang 0fb3496aed
perf: automatically close the installation modal after installing the theme (#3777)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.5.x

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

优化安装主题和升级主题的流程,支持在升级或者安装之后自动关闭弹框以及刷新数据。

#### Special notes for your reviewer:

测试方式:

1. 测试升级或者安装新主题之后是否关闭弹框以及是否有提示即可。

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

```release-note
优化 Console 端安装和升级主题的流程,支持自动关闭安装弹框和显示反馈提示
```
2023-04-19 02:21:05 +00:00
Li 01f66cb3b6
fix: outline not displayed when first entering the editor. (#3773)
#### What type of PR is this?
/kind bug
/area console

#### What this PR does / why we need it:
为默认编辑器侦听器增加 `immediate` 属性,使其在创建之后立即执行,生成目录。

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

#### Special notes for your reviewer:
打开已经存在并且具有标题的文章/页面,查看大纲是否正常生成。

#### Does this PR introduce a user-facing change?
```release-note
修复文章/页面已有内容重新编辑时,无法立即显示大纲的问题。
```
2023-04-18 06:34:57 +00:00
Li 0c3e5a760a
fix: error occurred when switching tab in dashboard component. (#3770)
#### What type of PR is this?
/kind bug
/area console

#### What this PR does / why we need it:
修复 Console 端仪表盘添加组件时,切换标签页面报错的问题。

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

#### Does this PR introduce a user-facing change?
```release-note
修复 Console 端仪表盘添加组件时的报错问题。
```
2023-04-18 06:30:57 +00:00
John Niang ed14fcb5f4
Support publishing to maven central repository (#3767)
#### What type of PR is this?

/kind feature
/area core

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

Use Gradle plugin `maven-publish` to publish Halo modules(`platform.application`, `platform.plugin` and `api`) to Maven central repository.

```bash
# Try to publish to Maven local repository.
./gradlew publish
# Really publish to Maven central repository.
./gradlew -Prelease publish -PossrhUsername=username -PossrhPassword=password
```

Note that currently we only support manually publishing.

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

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

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

```release-note
None
```
2023-04-18 14:28:23 +08:00
hughding 8d2f081067
fix: signup form overlaps with locale form. (#3756)
#### What type of PR is this?
/kind improvement
/area console

#### What this PR does / why we need it:
此修改对登录、注册界面原有风格无影响。解决了1920*1080分辨率下,注册界面,“已有账号 立即登录”与“简体中文”文字重叠问题

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

#### Special notes for your reviewer:

#### Does this PR introduce a user-facing change?
```release-note
解决1920*1080分辨率下,注册界面,“已有账号 立即登录”与“简体中文”文字重叠问题
```
2023-04-18 03:57:28 +00:00
guqing 602b783506
refactor: allow users to modify their own annotations in metadata (#3739)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.5.x

#### What this PR does / why we need it:
允许用户修改自己的元数据信息

how to test it
使用 API 修改元数据 `PUT localhost:8090/apis/api.console.halo.run/v1alpha1/users/-`
1. 修改 annotations 中的 `"rbac.authorization.halo.run/role-names": "[\"super-role\",\"fake-role\"]"` 会被复原
2. 修改其他的 annotations 能正确修改,也能增加新的 annotation

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

Fixes #3544

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

```release-note
允许用户修改自己的元数据信息
```
2023-04-17 13:46:38 +00:00
Ryan Wang eb141e4966
refactor: use tanstack query to refactor menu related data fetching (#3714)
#### 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
Fixed https://github.com/halo-dev/halo/issues/3467

#### Special notes for your reviewer:

测试方式:

1. 创建若干菜单和菜单项,检查功能是否正常。

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

```release-note
修复 Console 端菜单项和菜单关联可能发现混乱的问题。
```
2023-04-16 15:12:13 +00:00
guqing 8755c24b11
feat: add an API for reloading plugin (#3749)
#### What type of PR is this?
/kind feature
/area core
/area plugin
/kind api-change
#### What this PR does / why we need it:
新增 reload 插件的 API

how to test it?
通过以下 API 测试是否可以在不重启 Halo 的情况下使新改动的插件代码生效
```shell
./gradlew clean build && curl -u your-name:your-password -X PUT http://127.0.0.1:8090/apis/api.console.halo.run/v1alpha1/plugins/{plugin-name}/reload
```
#### Which issue(s) this PR fixes:

Fixes #3748

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

```release-note
None
```
2023-04-14 09:36:49 +00:00
John Niang d760d4d362
Expose attachment service to plugin (#3740)
#### What type of PR is this?

/kind feature
/area core
/area plugin

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

This PR refactor AttachmentEndpoint by extracting `upload`, `delete`, `getPremalink` and `getSharedURL` logic in the endpoint into AttachmentService. Meanwhile, I expose the service to plugin, so that we can use the service in plugin conveniently.

#### Special notes for your reviewer:

Please confirm that those changes won't influence existing attachment features.

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

```release-note
None
```
2023-04-14 09:26:49 +00:00
guqing d1651aa671
fix: user page not found (#3736)
#### What type of PR is this?
/kind bug
/area core

#### What this PR does / why we need it:
修复作者页无法访问的问题

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

#### Does this PR introduce a user-facing change?
```release-note
修复作者页无法访问的问题
```
2023-04-14 08:12:47 +00:00
guqing d7bfbef149
refactor: excerpt as the meta description on the page of post and single page (#3745)
#### What type of PR is this?
/kind improvement
/area core
#### What this PR does / why we need it:
将文章摘要作为 meta description 以优化文章页的 SEO

how to test it?
查看文章页和自定义页面的 head 中是否具有 `<meta name="description" content="文章摘要"/>` 标签

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

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

```release-note
将文章摘要作为 meta description 以优化文章页的 SEO
```
2023-04-12 12:50:31 +00:00
guqing e4338c111e
fix: only users with an authenticated role are allowed to modify their profile (#3742)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.5.x

#### What this PR does / why we need it:
仅允许拥有 authenticated 角色的用户修改个人资料

how to test it?
用户在未登录时访问 `PUT /apis/api.console.halo.run/v1alpha1/users/-` 出现 401 状态码则符合预期,登录后则可以正常调用

#### Which issue(s) this PR fixes:
Fixes #3737
#### Does this PR introduce a user-facing change?
```release-note
None
```
2023-04-12 12:46:31 +00:00
John Niang 2bbdb96979
Fix the problem that generateing OpenAPI defined in Plugin may not work (#3729)
#### What type of PR is this?

/kind bug
/area core

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

- Use the class loader belonging to the parameter type when creating a generic class.
- Use full qualified class name when generating a generic class.

Before testing, you have to set property `springdoc.cache.disabled` to `true`.

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

Fixes #3728 

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

```release-note
None
```
2023-04-10 15:20:25 +00:00
Li cab3432d03
fix: repeated display of theme tabs. (#3727)
#### What type of PR is this?

/kind bug
/area console

#### What this PR does / why we need it:
获取主题配置时,重复添加了上次已经获取到的主题配置,导致重复显示。并同步修改了 plugin 中可能出现问题的位置。

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

Fixes #3726 

#### Special notes for your reviewer:
1. 打开 Console 端主题页面
2. 点击右上角预览页面
3. 关闭预览页面,选项卡无重复即为正常。


#### Does this PR introduce a user-facing change?
```release-note
修复 Console 端主题设置中,选项卡会重复显示的问题
```
2023-04-10 07:10:22 +00:00
John Niang 45313a529e
Enable mapper feature: accept case-insensitive enums (#3707)
#### What type of PR is this?

/kind improvement
/area core

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

After enabling this mapper feature, we could pass a enum value with any case in request body(JSON format).

See 39fdb63607/src/test/java/com/fasterxml/jackson/databind/deser/enums/EnumDeserializationTest.java (L22) for more.

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

```release-note
None
```
2023-04-09 13:44:15 +00:00
John Niang bfe8b3ba58
Set property server.forward-header-strategy to framework by default (#3709)
#### What type of PR is this?

/kind bug
/area core

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

Set property `server.forward-header-strategy` to `framework` to enable handling `X-Forwarded*` headers correctly.

By default, Spring won't handle `X-Forwarded*` headers. It doesn't work correctly if Halo is running back reverse proxy server.

Supported headers: <310344cf61/spring-web/src/main/java/org/springframework/web/server/adapter/ForwardedHeaderTransformer.java (L63-L69)>.

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

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

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

```release-note
解决反向代理后无法正确获取当前请求 URI 的问题
```
2023-04-07 09:30:21 +00:00
Ryan Wang b99222e176
fix: the setting form of the preview theme page may not be rendered (#3706)
#### What type of PR is this?

/kind bug

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

修复预览主题页面的设置表单可能因为接口请求速度导致无法正常渲染表单的问题。

<img width="1226" alt="image" src="https://user-images.githubusercontent.com/21301288/230562109-0858098f-c67e-4d93-bebd-a85400de9285.png">

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

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

#### Special notes for your reviewer:

测试方式:

1. 在主题管理页面点击预览按钮,检查设置表单是否可以正常渲染即可。

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

```release-note
修复 Console 端预览主题页面的设置表单可能出现无法渲染的问题。
```
2023-04-07 09:28:45 +00:00
John Niang dea87b200f
Add support defining custom endpoint in plugin (#3703)
#### What type of PR is this?

/kind feature
/area core
/area plugin

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

Including CustomEndpoint beans while building plugin router functions.

After that, we can define a CustomEndpoint in plugin like this:

```java
@Component
public class ApplicationEndpoint implements CustomEndpoint {

    @Override
    public RouterFunction<ServerResponse> endpoint() {
        return SpringdocRouteBuilder.route()
            .GET("/applications", request -> ServerResponse.ok().build(), builder -> {
                builder.operationId("ListV1Alpha1Applications");
            })
            .build();
    }

    @Override
    public GroupVersion groupVersion() {
        return CustomEndpoint.super.groupVersion();
    }
}
```

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

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

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

```release-note
None
```
2023-04-07 03:42:10 +00:00
Ryan Wang 9b8cec426f
fix: lost the activated theme settings when saving the system settings (#3691)
#### What type of PR is this?

/kind bug
/area console
/milestone 2.5.x

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

修复保存系统设置之后,启用主题的设置丢失,恢复为了默认主题。原因是因为在 https://github.com/halo-dev/halo/pull/3606 中使用了新的 useSettingFormConvert 方法,但这个方法未考虑到某些 ConfigMap 的分组并未在表单中定义,也就是数据转换方法是以表单的定义为基准,所以丢失了 `theme.active` 设置。

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

Fixes #3673 

#### Special notes for your reviewer:

测试方式:

1. 安装若干主题并启用。
2. 然后去系统设置修改任意数据并保存。
3. 检查主题是否被修改为默认主题。

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

```release-note
修复保存系统设置之后导致激活主题的设置值丢失,恢复为了默认主题的问题。
```
2023-04-05 15:50:16 +00:00
-Shiken- a466ee73c9
add zhTW locale (#3672)
#### What type of PR is this?

/kind feature
/area core

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

Add zhTW locale.

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

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

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

```release-note
提供繁体中文(TW)翻译
```
2023-04-03 15:58:16 +00:00
John Niang d8f4e478e2
Upgrade to SpringDoc OpenAPI 2.1.0 (#3687)
#### What type of PR is this?

/kind cleanup
/area core

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

Upgrade to SpringDoc OpenAPI 2.1.0. See https://github.com/springdoc/springdoc-openapi/releases/tag/v2.1.0 for more.

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

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

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

```release-note
升级 SpringDoc OpenAPI 至 2.1.0
```
2023-04-03 14:06:14 +00:00
John Niang 0973c64ad2
Move common classes related to theme into api module (#3686)
#### What type of PR is this?

/kind cleanup
/area core

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

Move common classes related to theme into api module.

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

```release-note
None
```
2023-04-03 08:06:13 +00:00
Ryan Wang a2516dbef4
chore: bump @halo-dev/richtext-editor version to resolve i18n issue (#3682)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.5.x
/cherry-pick release-2.4

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

升级 `@halo-dev/richtext-editor` 的版本以解决编辑器翻译不完整的问题。

see https://github.com/halo-sigs/richtext-editor/pull/7

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

```release-note
升级 `@halo-dev/richtext-editor` 的版本以解决编辑器部分文本翻译不完整的问题。
```
2023-04-03 04:38:12 +00:00
John Niang 36d50e75d3
Configure default external-url as slash (#3655)
#### What type of PR is this?

/kind improvement
/area core

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

Configure default external-url as slash. So that system will generate relative links for all permalinks.

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

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

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

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

```release-note
None
```
2023-04-03 03:50:13 +00:00
Ryan Wang ffeeaa231a
fix: radio value type is incorrect in the form defined by formkit schema (#3668)
#### What type of PR is this?

/kind bug
/area console
/milestone 2.5.x
/cherry-pick release-2.4

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

修复使用了 FormKit Schema 生成的表单中,Radio 输入类型如果值的类型定义为 boolean 类型,但得到的结果为 string 类型的问题。

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

Fixes #3666 

#### Special notes for your reviewer:

测试方式:

1. 安装一个主题设置使用了 Radio 输入类型的主题,比如 https://github.com/halo-dev/halo-theme-anatole
2. 测试保存其中包含了 Radio 输入类型的表单。
3. 刷新页面,检查值回显是否正确。

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

```release-note
修复 Console 端 FormKit Schema 生成的表单中,Radio 输入类型值类型为 boolean 但结果为 string 的问题。
```
2023-04-03 03:48:13 +00:00
John Niang 14d7175443
Fix the problem of ServerHttpResponse already committed after logging in (#3658)
#### What type of PR is this?

/kind bug
/area core

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

Move `defaultHandler#onAuthenticationSuccess` up to response write, or it will be executed always.

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

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

#### Special notes for your reviewer:

Try to login and see the log detail.

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

```release-note
修复登录成功或失败后报错的问题
```
2023-04-03 03:20:15 +00:00
Ryan Wang 03f7e583f6
fix: publish time of the post cannot be displayed back (#3671)
#### What type of PR is this?

/kind bug
/area console
/milestone 2.5.x
/cherry-pick release-2.4

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

修复文章设置中的发布时间无法回显导致重新保存时丢失发布时间的问题。

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

Fixes #3669 

#### Special notes for your reviewer:

测试方式:

1. 新建或者修改已有文章的设置。
2. 检查时间输入框的时间是否显示正确。
3. 检查保存之后时间是否显示正确。

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

```release-note
修复 Console 端文章设置中的发布时间无法回显导致重新保存时丢失发布时间的问题。
```
2023-04-03 03:12:14 +00:00
Ryan Wang 0b21758347
fix: route title i18n in global search is not compatible (#3665)
#### What type of PR is this?

/kind bug
/area console
/cherry-pick release-2.4

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

修复后台全局搜索中关于 Console 路由的文字没有适配 i18n 的问题。

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

Fixes #3664 

#### Special notes for your reviewer:

<img width="741" alt="image" src="https://user-images.githubusercontent.com/21301288/229279243-4b727cc7-1790-41b3-a170-4958ce1f65a8.png">

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

```release-note
修复后台全局搜索中关于 Console 路由的文字没有适配 i18n 的问题。
```
2023-04-03 03:08:14 +00:00
Ryan Wang f8e405c8ed
fix: attachment policy editing modal crashes when opened (#3663)
#### What type of PR is this?

/kind bug
/area console
/milestone 2.5.x

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

修复附件存储策略编辑表单无法正常渲染的问题。此问题原因为 Modal 组件使用了 OverlayScrollbars 库来模拟滚动条,但在初始化的时候由于 Body 没有任何子元素,所以导致异常。

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

Fixes #3662 

#### Special notes for your reviewer:

测试是否能够正常打开附件存储策略编辑表单即可。

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

```release-note
修复 Console 端附件存储策略编辑表单无法正常渲染的问题
```
2023-04-03 03:02:12 +00:00
John Niang d8e8139260
Bump up version to 2.5.0-SNAPSHOT (#3653)
#### What type of PR is this?

/kind cleanup
/area core

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

- Bump up version to 2.5.0-SNAPSHOT for next development
- Update README.md

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

```release-note
None
```
2023-04-02 15:52:11 +00:00
John Niang a215c3faeb
Upgrade to plugin-comment-widget 1.5.0 (#3649)
#### What type of PR is this?

/kind cleanup

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

Upgrade to plugin-comment-widget 1.5.0.

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

```release-note
None
```
2023-03-31 03:20:18 +00:00
Ryan Wang 74c543ec37
chore: bump console version to 2.4.0 (#3650)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.4.0

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

修改 Console 的版本号为 2.4.0。

修改 `@halo-dev/components` 的版本为 1.3.0

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

```release-note
None
```
2023-03-31 03:10:19 +00:00
Ryan Wang ff5a62b900
chore: generate api client (#3648)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.4.0

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

重新生成 api client。

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

```release-note
None
```
2023-03-31 03:00:20 +00:00
guqing a2d2d5443f
refactor: do not disable when auth provider deleted (#3644)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.4.0

#### What this PR does / why we need it:
移除 AuthProviderReconciler 中关于 authProvier 数据被删除时禁用它提供的登录方式的逻辑
当第三方登录插件如 plugin-oauth2 被停止时不应该从已启用的登录配置中移除 auth provider name,这会导致插件被停用在启用后需要重新启用登录方式。
之前之所以如此是想着去掉 system configmap 中的配置残余,虽然现在去掉了 Reconciler 但为了确保数据干净或许还得想其他办法来解决它,但目前不是重点也没有一个很好的办法,或许可以在插件中去做,比如当插件被卸载的生命周期方法中去更新 ConfigMap 中关于此项的配置。

#### Does this PR introduce a user-facing change?
```release-note
None
```
2023-03-31 02:12:15 +00:00
Ryan Wang 2d56aaeb93
refactor: re-design login-related form (#3608)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.4.x

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

重新设计登录页面的样式和用户体验。

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

Fixes #3572 

#### Special notes for your reviewer:

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

```release-note
优化 Console 端登录页面样式
```
2023-03-30 16:10:15 +00:00