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

[next] feat: Add spawnDialog function #6207

Merged
merged 2 commits into from
Nov 14, 2024
Merged

[next] feat: Add spawnDialog function #6207

merged 2 commits into from
Nov 14, 2024

Conversation

backportbot[bot]
Copy link

@backportbot backportbot bot commented Nov 11, 2024

Backport of #6195

Warning, This backport's changes differ from the original and might be incomplete ⚠️

Todo

  • Review and resolve any conflicts
  • Amend HEAD commit to remove the line stating to skip CI

Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@backportbot backportbot bot added enhancement New feature or request 3. to review Waiting for reviews feature: functions composables, functions, mixins and other non-components labels Nov 11, 2024
This allows to spawn a Vue dialog without the need of mounting the
component.
So it is possible to spawn a dialog directly from any JS code outside of
components (e.g. callback functions).

This method was originally taken from `@nextcloud/dialogs`,
but I think it should belong to this Vue components library.

Co-authored-by: Ferdinand Thiessen <[email protected]>
Co-authored-by: Grigorii K. Shartsev <[email protected]>
Signed-off-by: Ferdinand Thiessen <[email protected]>
@susnux susnux marked this pull request as ready for review November 11, 2024 19:55
@susnux
Copy link
Contributor

susnux commented Nov 11, 2024

The docs are a bit hacky but with Vue3 we do not have a global instance, and the styleguide registers all components in one app.
So here we need to access the registered (NcDialog) component, there are two ways:

  1. Add the component (like it is done) directly to the options.
  2. Pass the instance (appContext) to the spawnDialog method, this works (tested) but I think this should not be in the docs ;)

styleguide/global.requires.js Outdated Show resolved Hide resolved
package.json Show resolved Hide resolved
Signed-off-by: Ferdinand Thiessen <[email protected]>
@susnux susnux merged commit 1cd8309 into next Nov 14, 2024
20 checks passed
@susnux susnux deleted the backport/6195/next branch November 14, 2024 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews enhancement New feature or request feature: functions composables, functions, mixins and other non-components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants