Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: visible condition of modal component #5078

Merged
merged 4 commits into from Dec 29, 2023

Conversation

ruibaby
Copy link
Member

@ruibaby ruibaby commented Dec 19, 2023

What type of PR is this?

/area console
/kind improvement
/milestone 2.12.x

What this PR does / why we need it:

重构 UI 的 Modal 组件,支持通过 v-if 控制是否显示(渲染)。

example:

<script lang="ts" setup>
import { ref } from "vue"
const visible = ref(false)
const modal = ref()

function open() {
  visible.value = true
}

function close() {
  modal.value.close()
}
</script>

<template>
  <button @click="open">Open</button>
    <VModal v-if="visible" ref="modal" title="test">
      <button @click="close">Close</button>
    </VModal>
</template>

Which issue(s) this PR fixes:

Fixes #5077

Special notes for your reviewer:

测试方式:

  1. cd console && pnpm --filter "./packages/components" storybook
  2. 测试 Modal 组件在文档中是否工作正常。
  3. 启动 Console 或者 UC。
  4. 观察以前页面上的弹框是否工作正常。

Does this PR introduce a user-facing change?

重构 UI 的 Modal 组件,支持通过 v-if 控制是否显示(渲染)。

Signed-off-by: Ryan Wang <i@ryanc.cc>
@f2c-ci-robot f2c-ci-robot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. area/console Issues or PRs related to the Halo Console labels Dec 19, 2023
@f2c-ci-robot f2c-ci-robot bot added this to the 2.12.x milestone Dec 19, 2023
@f2c-ci-robot f2c-ci-robot bot added the kind/improvement Categorizes issue or PR as related to a improvement. label Dec 19, 2023
Copy link

codecov bot commented Dec 19, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (36ebc24) 55.91% compared to head (0b9fe5c) 55.91%.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #5078   +/-   ##
=========================================
  Coverage     55.91%   55.91%           
  Complexity     3032     3032           
=========================================
  Files           524      524           
  Lines         17826    17826           
  Branches       1329     1329           
=========================================
  Hits           9968     9968           
  Misses         7309     7309           
  Partials        549      549           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ruibaby
Copy link
Member Author

ruibaby commented Dec 29, 2023

ping @halo-dev/sig-halo-console

Copy link
Member

@guqing guqing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@f2c-ci-robot f2c-ci-robot bot added the lgtm Indicates that a PR is ready to be merged. label Dec 29, 2023
Copy link
Member

@JohnNiang JohnNiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

Copy link

f2c-ci-robot bot commented Dec 29, 2023

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@f2c-ci-robot f2c-ci-robot bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 29, 2023
@f2c-ci-robot f2c-ci-robot bot merged commit 44cb311 into halo-dev:main Dec 29, 2023
4 checks passed
@ruibaby ruibaby deleted the refactor/modal-components branch December 29, 2023 10:24
@JohnNiang JohnNiang modified the milestones: 2.12.x, 2.12.0 Jan 7, 2024
f2c-ci-robot bot pushed a commit to halo-dev/plugin-app-store that referenced this pull request Jan 24, 2024
在 Halo 2.12 中重构了 Modal 组件的显示控制方式,此 PR 用于简化 Modal 弹窗的显示逻辑。

See halo-dev/halo#5078

/kind improvement

```release-note
None
```
f2c-ci-robot bot pushed a commit that referenced this pull request Apr 12, 2024
#### What type of PR is this?

/kind bug
/area ui
/milestone 2.15.x

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

修复由于 modal 延迟 200ms 所导致的数据可能为空的问题。

See #5078 

#### How to test it?

反复点击并关闭附件库详情弹窗,查看是否会有空数据的问题

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

Fixes #5689 

#### Does this PR introduce a user-facing change?
```release-note
修复附件详情弹窗可能无法显示数据的问题
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/console Issues or PRs related to the Halo Console kind/improvement Categorizes issue or PR as related to a improvement. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

重构 UI 的 Modal 组件,使其支持渲染后打开
3 participants