halo-admin/packages/components
Ryan Wang eef8dc3d43
feat: add delete attachment group and policy support (#695)
#### 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
支持删除附件分组和存储策略。
```
2022-11-18 07:22:22 +00:00
..
src feat: add delete attachment group and policy support (#695) 2022-11-18 07:22:22 +00:00
.eslintrc.cjs chore: use pnpm's workspace feature to manage base components (#579) 2022-06-14 15:56:55 +08:00
env.d.ts chore: use pnpm's workspace feature to manage base components (#579) 2022-06-14 15:56:55 +08:00
histoire.config.ts chore: bump histoire version 2022-08-14 11:59:35 +08:00
package.json chore: bump dependencies (#689) 2022-11-17 02:38:22 +00:00
postcss.config.js chore: use pnpm's workspace feature to manage base components (#579) 2022-06-14 15:56:55 +08:00
prettier.config.js chore: use pnpm's workspace feature to manage base components (#579) 2022-06-14 15:56:55 +08:00
tailwind.config.js refactor: admin ui theme system 2022-07-14 11:38:13 +08:00
tsconfig.app.json feat: refine the configuration of unplugin-icons 2022-07-03 16:50:25 +08:00
tsconfig.json chore: use pnpm's workspace feature to manage base components (#579) 2022-06-14 15:56:55 +08:00
tsconfig.vite-config.json chore: use pnpm's workspace feature to manage base components (#579) 2022-06-14 15:56:55 +08:00
tsconfig.vitest.json chore: use pnpm's workspace feature to manage base components (#579) 2022-06-14 15:56:55 +08:00
vite.config.ts perf: refine user detail page 2022-09-27 16:47:13 +08:00