-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
feat(module: confirm): support blocking to get the result of confirm #476
Conversation
components/modal/ModalRef.cs
Outdated
@@ -92,5 +92,8 @@ public async Task UpdateConfig(ConfirmOptions config) | |||
await _service?.Update(this); | |||
} | |||
|
|||
internal TaskCompletionSource<bool> TaskCompletionSource { get; set; } |
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.
此处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
}
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.
For the confirm component, there are only only two types of buttons: OK or Cancel
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.
Shall we put it in the generic ModalRef<T>
?
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.
如果是对于表单编辑关闭确认,就会存在“保存”,“不保存”,“取消”三个状态。
If it is to confirm the closing of the form editing, there will be three states of "Save", "Do not save" and "Cancel"。
d34b667
to
361fc7f
Compare
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. Thanks!
…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>
* 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>
* 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>
* 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>
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
💡 Background and solution
📝 Changelog
☑️ Self Check before Merge