halo-dev / halo

强大易用的开源建站工具。
https://www.halo.run
GNU General Public License v3.0
32.47k stars 9.45k forks source link

feat: tag and category add save and continue button #6223

Closed LonelySnowman closed 4 days ago

LonelySnowman commented 5 days ago

What type of PR is this?

/kind feature

What this PR does / why we need it:

文章分类和标签 Modal 添加 ”保存并继续添加” 按钮,便于连续添加。

Which issue(s) this PR fixes:

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

Special notes for your reviewer:

image

Does this PR introduce a user-facing change?

文章分类和标签的编辑表单支持保存并继续添加。
CLAassistant commented 5 days ago

CLA assistant check
All committers have signed the CLA.

codecov[bot] commented 4 days ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 58.05%. Comparing base (bc10336) to head (85c16cf). Report is 54 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #6223 +/- ## ============================================ + Coverage 54.51% 58.05% +3.54% - Complexity 3523 3757 +234 ============================================ Files 646 649 +3 Lines 21862 22022 +160 Branches 1528 1547 +19 ============================================ + Hits 11917 12785 +868 + Misses 9328 8618 -710 - Partials 617 619 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

ruibaby commented 4 days ago

感谢参与贡献,这里有两个体验的问题:

  1. 提交的时候两个按钮都会有加载状态,期望只显示一个。可以考虑在按钮的 loading 属性上也加上 keepAddingSubmit 条件。

    image
  2. 保存并继续添加 按钮建议放在提交旁边,如果三个按钮同时放在一起不好看,可以考虑将 取消 按钮放置在最右边,类似于:

    <div class="flex justify-between">
      <VSpace>
        <VButton>提交</VButton>
        <VButton>提交并继续添加</VButton>
      </VSpace>
      <VButtion>关闭</VButton>
    </div>
LonelySnowman commented 4 days ago

@ruibaby 在一个按钮 loading 过程中需要对另一个按钮禁用么,如果用户在一个按钮加载时又去触发另一个按钮会导致表单提交两次。

ruibaby commented 4 days ago

@ruibaby 在一个按钮 loading 过程中需要对另一个按钮禁用么,如果用户在一个按钮加载时又去触发另一个按钮会导致表单提交两次。

那可以直接给按钮的 disabled 属性设置 saving。

f2c-ci-robot[bot] commented 4 days ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ruibaby

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: - ~~[ui/OWNERS](https://github.com/halo-dev/halo/blob/main/ui/OWNERS)~~ [ruibaby] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment