nextcloud-libraries / nextcloud-libraries/nextcloud-vue

[RFC] Improve `spawnDialog` or add a new function

Open
#6,731 19 comments 1 reaction 1 assignee View on GitHub

A pull request for this has already been merged.

  • #6768 by @backportbot — merged
2. developing feature: functions
Dominant language
Vue
Stars
246
Forks
99
Avg merge
1d 20h
Merged PRs (30d)
103

Description

Problem

In the current implementation spawnDialog is designed to create a one-time "prompt" dialog:

But at the same time, it isn't convenient as a prompt, requiring to pass callback instead of returning a promise.

Proposals

  1. Instead of only calling callback - return promise
    • How to determine if it was closed or unmounted?
  2. Provide 2 functions:
    • One for one-time prompts returning a promise
    • One for mounting a dialog instance
  3. Return promise with additional properties

Additional problem

In the current API props argument is passed as dialog component props, but it includes container and appContext, which are not dialog props.

We can mix it and only fix the implementation, or separate dialog's props and spawnDialog's options (breaking change).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.