-
Notifications
You must be signed in to change notification settings - Fork 483
feat: add delete attachment group and policy support #695
feat: add delete attachment group and policy support #695
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
我认为删除分组时通过 reconciler 去删除分组下的附件可能会更可靠些,如果调用API去删除分组下面的附件,多时删除分组时将会导致页面卡死或崩溃。不过目前没有提供 Reconciler |
可以考虑在 Group 中加上 finalizer,如果删除 Group 则在 reconciler 中先删除其下的所有附件,再移除 finalizer。 如果需要让用户决定是否级联删除附件,可以在 Group 中加上 spec.cascadeDelete=false 字段。 |
赞同 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JohnNiang The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/lgtm |
…e#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 halo-dev#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 feature
/milestone 2.0
What this PR does / why we need it:
支持删除附件分组和存储策略。
删除策略的逻辑为:删除前会根据策略查询附件,如果有附件,则无法删除,否则可以删除。
删除附件的逻辑为:
删除并将附件移动至未分组
时,会在前端批量调用更新附件的接口,将所有附件的groupRef
置空。删除并同时删除附件
时,会在前端批量调用删除附件接口。Which issue(s) this PR fixes:
Fixes halo-dev/halo#2706
Special notes for your reviewer:
/cc @halo-dev/sig-halo-console
测试方式:
pnpm build:packages
删除并将附件移动至未分组
时,检查分组是否被删除,且里面的附件是否已经被移动到未分组。删除并同时删除附件
时,检查分组是否被删除,且里面的附件是否被删除。Does this PR introduce a user-facing change?