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

feat(module: confirm): support blocking to get the result of confirm #476

Merged
merged 5 commits into from
Aug 22, 2020

Conversation

zxyao145
Copy link
Member

@zxyao145 zxyao145 commented Aug 8, 2020

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

🔗 Related issue link

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English support blocking to get the result of confirm
🇨🇳 Chinese 支持阻塞(非委托/回调)获取Confirm弹窗的结果

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • Changelog is provided or not needed

@@ -92,5 +92,8 @@ public async Task UpdateConfig(ConfirmOptions config)
await _service?.Update(this);
}

internal TaskCompletionSource<bool> TaskCompletionSource { get; set; }
Copy link
Member

Choose a reason for hiding this comment

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

此处bool修改成enum是否更好,便于将来的扩展。
Is it better to modify bool to enum here to facilitate future expansion.
Such as:

    public enum ConfirmResult
    {
        None = 0,
        OK = 1,
        Cancel = 2,
        Abort = 3,
        Retry = 4,
        Ignore = 5,
        Yes = 6,
        No = 7
    }

Copy link
Member Author

Choose a reason for hiding this comment

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

For the confirm component, there are only only two types of buttons: OK or Cancel

Copy link
Member

Choose a reason for hiding this comment

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

Shall we put it in the generic ModalRef<T> ?

Copy link
Member

Choose a reason for hiding this comment

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

如果是对于表单编辑关闭确认,就会存在“保存”,“不保存”,“取消”三个状态。
If it is to confirm the closing of the form editing, there will be three states of "Save", "Do not save" and "Cancel"。

@TimChen44
Copy link
Member

TimChen44 commented Aug 9, 2020

感谢 @zxyao145,你的方法很好,其余类似功能可以参考你的方法进行改进。
Thank @zxyao145 , your method is very good, other similar functions can refer to your method for improvement.

Copy link
Member

@ElderJames ElderJames left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@ElderJames ElderJames merged commit 37ef0f5 into ant-design-blazor:master Aug 22, 2020
@ElderJames ElderJames added this to the 0.3.0 - MILESTONE: August 2020 milestone Aug 22, 2020
@ElderJames ElderJames added this to In progress in 0.3.0 - MILESTONE: August 2020 via automation Aug 22, 2020
@ElderJames ElderJames moved this from In progress to Done in 0.3.0 - MILESTONE: August 2020 Aug 22, 2020
Zhuangkh pushed a commit to Zhuangkh/ant-design-blazor that referenced this pull request Sep 25, 2020
…ign-blazor#476)

* feat(module: confirm): support blocking to get the result of confirm

* refactor: change modalservice Confirm return value,add ConfirmAsync FUNC

* feat: add ConfirmService

* fix: button text

Co-authored-by: ElderJames <shunjiey@hotmail.com>
ElderJames added a commit that referenced this pull request Oct 15, 2020
* feat(module: confirm): support blocking to get the result of confirm

* refactor: change modalservice Confirm return value,add ConfirmAsync FUNC

* feat: add ConfirmService

* fix: button text

Co-authored-by: ElderJames <shunjiey@hotmail.com>
ElderJames added a commit that referenced this pull request Apr 23, 2022
* feat(module: confirm): support blocking to get the result of confirm

* refactor: change modalservice Confirm return value,add ConfirmAsync FUNC

* feat: add ConfirmService

* fix: button text

Co-authored-by: ElderJames <shunjiey@hotmail.com>
ElderJames added a commit that referenced this pull request Apr 30, 2022
* feat(module: confirm): support blocking to get the result of confirm

* refactor: change modalservice Confirm return value,add ConfirmAsync FUNC

* feat: add ConfirmService

* fix: button text

Co-authored-by: ElderJames <shunjiey@hotmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants