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

Feature Request: Add Basic Yes/No Prompt Support #1526

Open
executed opened this issue Dec 14, 2024 · 1 comment
Open

Feature Request: Add Basic Yes/No Prompt Support #1526

executed opened this issue Dec 14, 2024 · 1 comment
Labels
enhancement New feature or request question Further information is requested

Comments

@executed
Copy link

Context:

The Nextcloud Calendar app currently includes a simple Yes/No confirmation dialog when performing actions like emptying the trashbin. However, this functionality relies on a deprecated, custom internal implementation of a confirm dialog. Developers are now encouraged to use the nextcloud-libraries/nextcloud-dialogs library, but this library does not currently provide built-in support for a basic Yes/No confirmation prompt.

This lack of support limits the ability to integrate simple confirmation dialogs into Nextcloud Calendar or other apps in a clean and maintainable way.

Proposed Solution:

Enhance the nextcloud-libraries/nextcloud-dialogs library by adding support for basic Yes/No confirmation dialogs. This feature should:

Provide an API for simple confirmation prompts:

Allow developers to easily create a dialog with customizable text and "Yes"/"No" button labels.

Return a promise or similar mechanism to handle the user’s response (e.g., resolve with true for Yes, false for No).

Example API:

nextcloudDialogs.confirm({
message: "Are you sure you want to proceed?",
title: "Confirm Action",
confirmButton: "Yes",
cancelButton: "No"
}).then(result => {
if (result) {
// User clicked "Yes"
} else {
// User clicked "No"
}
});

Example Use Case:

In the Nextcloud Calendar app, when an action like deleting an event or emptying the trashbin is performed, a Yes/No confirmation dialog can be shown using the new API. This dialog would replace the current deprecated implementation, providing a cleaner and more future-proof solution.Other than that I'm currently working on another confirmation dialog when resizing/dropping calendar event that is part of recurring series should ask user "Update future events too?".

@susnux
Copy link
Contributor

susnux commented Jan 11, 2025

This lack of support limits the ability to integrate simple confirmation dialogs into Nextcloud Calendar or other apps in a clean and maintainable way.

Whats the problem with just using the dialog builder?
https://nextcloud-libraries.github.io/nextcloud-dialogs/classes/index.DialogBuilder.html

@susnux susnux added question Further information is requested enhancement New feature or request labels Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants