#### What type of PR is this?
/kind improvement
/milestone 2.0
#### What this PR does / why we need it:
优化文章和自定义页面的保存内容和发布逻辑。详情可查阅:https://github.com/halo-dev/halo/pull/2709
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo-console
测试流程:
1. Halo 需要切换到 https://github.com/halo-dev/halo/pull/2709 分支。
2. 测试文章和自定义页面的新建、更新内容,以及发布。
#### Does this PR introduce a user-facing change?
```release-note
优化文章和自定义页面的保存内容和发布逻辑。
```
#### What type of PR is this?
/kind feature
/milestone 2.0
#### What this PR does / why we need it:
支持删除附件分组和存储策略。
删除策略的逻辑为:删除前会根据策略查询附件,如果有附件,则无法删除,否则可以删除。
删除附件的逻辑为:
1. 选择`删除并将附件移动至未分组`时,会在前端批量调用更新附件的接口,将所有附件的 `groupRef` 置空。
2. 选择`删除并同时删除附件`时,会在前端批量调用删除附件接口。
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/2706
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo-console
测试方式:
1. 需要执行 `pnpm build:packages`
2. 创建若干存储策略,并在部分存储策略中上传附件,再对存储策略做删除处理,需要满足以下情况:
1. 已包含附件的策略会提示不允许删除。
2. 未包含附件的策略可以删除
3. 创建若干分组,并在部分分组中上传附件,再对分组做删除处理,需要满足以下情况:
1. 选择`删除并将附件移动至未分组`时,检查分组是否被删除,且里面的附件是否已经被移动到未分组。
2. 选择`删除并同时删除附件`时,检查分组是否被删除,且里面的附件是否被删除。
#### 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
支持删除附件分组和存储策略。
```
#### What type of PR is this?
/kind improvement
/milestone 2.0
#### What this PR does / why we need it:
使用 metadata.generateName 代替 uuid 为 metadata.name 生成值。
Ref https://github.com/halo-dev/halo/pull/2563
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo-console
测试方式:
1. 需要 `pnpm install`
2. 测试登录以及所有需要创建更新资源的业务模块。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind feature
/milestone 2.0
#### What this PR does / why we need it:
附件管理支持排序筛选,适配:https://github.com/halo-dev/halo/pull/2705
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/2627
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo-console
测试方式:
1. Halo 需要切换到 https://github.com/halo-dev/halo/pull/2705 分支。
2. Console 需要 `pnpm install`
3. 上传若干附件,检查排序筛选之后的结果是否符合预期。
#### Does this PR introduce a user-facing change?
```release-note
附件管理支持排序筛选
```
#### What type of PR is this?
/kind improvement
/milestone 2.0
#### What this PR does / why we need it:
更新所有依赖的修订版本。
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo-console
#### Does this PR introduce a user-facing change?
```release-note
更新所有依赖的修订版本。
```
#### What type of PR is this?
/kind improvement
/milestone 2.0
#### What this PR does / why we need it:
发布 Console 2.0.0-beta.1
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo-console
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/milestone 2.0
#### What this PR does / why we need it:
重构文章发布/取消发布/放入回收站的逻辑。适配 https://github.com/halo-dev/halo/pull/2675
#### Special notes for your reviewer:
测试方式:
1. Halo 需要切换到 https://github.com/halo-dev/halo/pull/2675 的分支。
2. Console 需要 `pnpm install`。
3. 测试文章发布/取消发布/放入回收站。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/milestone 2.0
#### What this PR does / why we need it:
重构文章和自定义页面的发布流程。
Ref https://github.com/halo-dev/halo/pull/2659
1. 修改文章、自定义页面标识发布状态的字段名。
2. 修改初始化页面中创建文章和自定义页面的逻辑,取消使用发布接口,改为直接将 `spec.publish` 设置为 `true`
3. 列表支持检测发布状态。
#### Special notes for your reviewer:
测试方式:
1. Halo 需要切换到 https://github.com/halo-dev/halo/pull/2659 分支。
2. Console 需要 `pnpm install && pnpm build:packages`
3. 测试文章和自定义页面的发布、保存等流程。需要完整测试整个流程。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
#### What this PR does / why we need it:
升级 `@halo-dev/richtext-editor`。重构编辑器的结构,目前可以在外部添加菜单项和指令,意味着可以被扩展。
添加 tiptap 拓展的方式:
```
pnpm install @tiptap/extension-character-count
```
然后在创建 Editor 实例的时候需要将拓展添加到 extensions 数组,如:
```ts
const editor = useEditor({
content: props.modelValue,
extensions: [
...
ExtensionCharacterCount,
],
});
```
最终如果要通过我们的插件机制来拓展编辑器,那么就需要对 extensions 提供可拓展点。
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo-console
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/milestone 2.0
#### What this PR does / why we need it:
重构获取系统初始化状态的方式,之前会在每个路由切换前获取,在一定程度上会导致路由切换时卡顿。此 PR 改为仅在首次加载页面的时候调用接口获取,并保留状态由 pinia 管理。
#### Special notes for your reviewer:
测试方式:
1. 需要使用未初始化的 Halo。
2. 测试在未初始化前是否会自动切换到初始化页面。
3. 测试初始化之后是否还会跳转到初始化页面。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/milestone 2.0
#### What this PR does / why we need it:
重构主题预览弹框,支持选择主题以及针对主题进行设置。
todolist:
- [x] 支持保存之后自动刷新预览区域。
- [x] 优化 Tabs 组件,支持横向滚动以解决设置项过多时,选项卡的样式问题。
#### Screenshots:
https://user-images.githubusercontent.com/21301288/200233823-fe317efe-536a-47a9-9495-efdde39be7ca.mp4
#### Special notes for your reviewer:
测试方式:
1. 需要先执行 `pnpm build:packages`
2. 进入主题管理,点击右上角的预览即可打开主题预览窗口
#### Does this PR introduce a user-facing change?
```release-note
重构主题预览弹框,支持选择主题以及针对主题进行设置。
```
#### What type of PR is this?
/kind improvement
/milestone 2.0
#### What this PR does / why we need it:
发布 Halo 2.0 第四个 alpha 版本的 Console 部分。
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo-console
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/milestone 2.0
#### What this PR does / why we need it:
修复一些因使用不当导致的 Vue warn。
#### Screenshots:
<img width="832" alt="image" src="https://user-images.githubusercontent.com/21301288/199663758-e29f48c4-0c33-4c78-913f-2364ce4b5fbe.png">
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo-console
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind feature
/milestone 2.0
#### What this PR does / why we need it:
支持管理已删除的文章和自定义页面,优化删除的逻辑。
Fixes https://github.com/halo-dev/halo/issues/2647
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo-console
测试方式:
1. Halo 需要切换到 https://github.com/halo-dev/halo/pull/2648
2. 测试文章和自定义页面的删除功能,以及回收站的管理功能。
#### Does this PR introduce a user-facing change?
```release-note
支持管理已删除的文章和自定义页面,优化删除的逻辑。
```
#### What type of PR is this?
/kind feature
/milestone 2.0
#### What this PR does / why we need it:
添加选择附件类型的 FormKit 输入框。
在 Vue 单组件中使用:
```vue
<script lang="ts" setup>
const logo = ref("")
</script>
<template>
<FormKit
v-model="logo"
label="Logo"
type="attachment"
validation="required"
/>
</template>
```
在 FormKit Schema 中使用(插件 / 主题设置表单定义):
```yaml
- $formkit: attachment
name: logo
label: Logo
```
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/2558
#### Screenshots:
<img width="671" alt="image" src="https://user-images.githubusercontent.com/21301288/198980581-ba90ec32-f205-4d03-8546-3c93238298e7.png">
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo-console
#### Does this PR introduce a user-facing change?
```release-note
添加选择附件类型的 FormKit 输入框。
```
#### What type of PR is this?
/milestone 2.0
#### What this PR does / why we need it:
发布 2.0.0-alpha.3
从此版本开始,`@halo-dev/console-shared` 包的版本与 Console 始终保持一致。
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo-console
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind bug
/milestone 2.0
#### What this PR does / why we need it:
修复在 `vite build` 之后无法加载 Logo 的问题。
#### Special notes for your reviewer:
测试方式:
1. `pnpm build`
2. `pnpm preview`
3. 检查登录页面的 Logo 是否正常加载。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/milestone 2.0
#### What this PR does / why we need it:
依赖升级。
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo-console
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/milestone 2.0
#### What this PR does / why we need it:
以 inline svg 的形式加载 Logo,解决因为加载 svg 文件导致的页面抖动问题。
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo-console
测试方式:检查登录页面、初始化页面、侧边菜单顶部的 Logo 是否加载正常。
#### Does this PR introduce a user-facing change?
```release-note
以 inline svg 的形式加载 Logo,解决因为加载 svg 文件导致的页面抖动问题。
```
#### What type of PR is this?
/kind feature
/milestone 2.0
#### What this PR does / why we need it:
优化部分数据列表的逻辑,支持在检测出有正在删除的数据时,自动定时刷新列表。
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo-console
测试方式:
1. 进入任意一个数据列表,比如文章。
2. 删除一个文章,观察是否有自动刷新列表。
3. 切换路由,检查自动刷新是否停止。
#### Does this PR introduce a user-facing change?
```release-note
优化部分数据列表的逻辑,支持在检测出有正在删除的数据时,自动定时刷新列表。
```
#### What type of PR is this?
/kind improvement
/milestone 2.0
#### What this PR does / why we need it:
修正关于 Attachment 组件和编辑器组件的参数错别字。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind documentation
#### What this PR does / why we need it:
更新 [Repobeats analytics](https://repobeats.axiom.co/) 的图片源,之前因为修改仓库名,导致 Repobeats analytics 的统计失效。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/milestone 2.0
#### What this PR does / why we need it:
移除在 Git Commit 之前运行单元测试和类型检查的步骤。因为目前 main 分支处于保护分支,无法直接推送代码。所以仅在 PR 中的 Action 来运行这两个步骤即可。
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo-console
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/milestone 2.0
#### What this PR does / why we need it:
插件和主题管理的 Logo 改为使用 `Avatar` 组件。
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo-console
测试方式:检查主题和插件相关的管理页面是否正常加载 Logo。
#### Does this PR introduce a user-facing change?
```release-note
插件和主题管理的 Logo 改为使用 `Avatar` 组件。
```
#### What type of PR is this?
/kind feature
/milestone 2.0
#### What this PR does / why we need it:
为部分功能数据列表添加刷新按钮。
#### Screenshots:
<img width="1664" alt="image" src="https://user-images.githubusercontent.com/21301288/197397277-353befe4-8c43-4326-9ad5-64d2888dc4a3.png">
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo-console
测试方式:
1. 需要 `pnpm build:packages`
2. 测试点击刷新按钮是否可以正常请求接口。
#### Does this PR introduce a user-facing change?
```release-note
为部分功能数据列表添加刷新按钮。
```
#### What type of PR is this?
/kind improvement
/milestone 2.0
#### What this PR does / why we need it:
发布 `@halo-dev/components` `@halo-dev/console-shared` 版本。
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo-console
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind api-change
/kind bug
#### What this PR does / why we need it:
更新 `@halo-dev/api-client` 以修复文章访问数据不正确的问题。
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo-console
#### Does this PR introduce a user-facing change?
```release-note
更新 `@halo-dev/api-client` 以修复文章访问数据不正确的问题。
```
#### What type of PR is this?
/kind feature
/milestone 2.0
#### What this PR does / why we need it:
Ref https://github.com/halo-dev/halo/issues/2526#issuecomment-1273094868
FormKit 文档:https://formkit.com/advanced/custom-inputs
通过扩展 FormKit 的自定义 Input,提供系统常用资源的选择组件。
目前提供如下类型:
- menuCheckbox
- menuRadio
- menuItemSelect
- postSelect
- categorySelect
- tagSelect
- singlePageSelect
- categoryCheckbox
- tagCheckbox
FormKit 组件的使用方式:
```vue
<FormKit
placeholder="请选择文章"
label="文章"
type="postSelect"
validation="required"
/>
```
FormKit Schema 的使用方式:
```yaml
- $formkit: menuRadio
name: menus
label: 底部菜单组
```
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/2526
#### Screenshots:
<!--
如果此 PR 有 UI 的改动,最好截图说明这个 PR 的改动。
If there are UI changes to this PR, it is best to take a screenshot to illustrate the changes to this PR.
eg.
Before:
![screenshot-before](https://user-images.githubusercontent.com/screenshot.png)
After:
![screenshot-after](https://user-images.githubusercontent.com/screenshot.png)
-->
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo-console
测试方式:
1. 检查后台文章设置弹框的选择分类和标签功能是否正常。
2. 检查后台添加菜单项的功能是否正常。
3. 使用主题或者插件定义 settings.yaml,使用上述任意 input 类型,检查得到的效果和值是否正常。
#### Does this PR introduce a user-facing change?
```release-note
通过扩展 FormKit 的自定义 Input,提供系统常用资源的选择组件。
```
#### What type of PR is this?
/kind feature
/milestone 2.0
#### What this PR does / why we need it:
为登录操作和加载插件资源添加异常提示。
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/2534
#### Screenshots:
<img width="650" alt="image" src="https://user-images.githubusercontent.com/21301288/196105634-ece58153-d9e0-450d-8068-8cda1bed8bcc.png">
<img width="634" alt="image" src="https://user-images.githubusercontent.com/21301288/196105704-e3a59808-8a33-456d-b668-13e891512353.png">
#### Special notes for your reviewer:
目前还没有处理全局的接口请求异常,需要后端修改异常返回结构。
/cc @halo-dev/sig-halo-console
#### 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
为登录操作和加载插件资源添加异常提示。
```
#### What type of PR is this?
/kind api-change
/kind improvement
/milestone 2.0
#### What this PR does / why we need it:
重构 Dialog 组件使用 API 的调用方式,改为与 Toast 组件一致。https://github.com/halo-dev/console/pull/644
同样的,使用此方式调用 Dialog 组件不限制在 Vue 组件。
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo-console
需要测试后台各个操作的会话框是否正常。
#### Does this PR introduce a user-facing change?
```release-note
重构 Dialog 组件使用 API 的调用方式。
```
#### What type of PR is this?
/kind improvement
/milestone 2.0
#### What this PR does / why we need it:
升级 `@halo-dev/api-client` 版本以适配 Attachment 资源的自定义 Endpoint。
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo-console
测试方式:
1. 需要 `pnpm install`。
2. 测试附件列表和上传的功能。
#### Does this PR introduce a user-facing change?
```release-note
None
```