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: confirmation before any action. #1599

Conversation

hemant-kr-meena
Copy link
Contributor

@hemant-kr-meena hemant-kr-meena commented Jun 22, 2024

⚡ PowerGrid - Pull Request

Welcome and thank you for your interest in contributing to our project!. You must use this template to submit a Pull Request or it will not be accepted.


Motivation

  • Bug fix
  • Enhancement
  • New feature
  • Breaking change

Description

Feature:
This PR adds a confirmation popup before executing any action via action buttons.
Purpose:
To prevent unintended actions and improve user experience by adding an extra layer of confirmation.

As we know we use macros for additional functionality to add id and trigger dispatch events. In the same way, we can add wire:confirm attribute to buttons.

Read more Livewire wire:confirm

Example:

  • Implemented simple confirmation using the following syntax:
Button::add('delete')->id()->confirm("Are you sure?")
  • Implemented confirmation prompts using the following syntax:
Button::add('delete')->id()->confirmPrompt("Are you sure you want to delete ?", "Confirm")

Result:

confirm confrim-prompt

Documentation

This PR requires Documentation update?

  • Yes
  • No
  • I have already submitted a Documentation pull request.

Copy link
Collaborator

@luanfreitasdev luanfreitasdev left a comment

Choose a reason for hiding this comment

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

resources/lang/en/datatable.php Outdated Show resolved Hide resolved
src/Components/Actions/Macros.php Outdated Show resolved Hide resolved
@hemant-kr-meena
Copy link
Contributor Author

hemant-kr-meena commented Jun 25, 2024

Thank you for your feedback. I will make the requested changes and submit a docs pull request to the docs repo within a few days.

@luanfreitasdev
Copy link
Collaborator

Thank you for this PR!

@hemant-kr-meena
Copy link
Contributor Author

Hi @luanfreitasdev, I marked all requested changes as resolved. But in PR it still shows that one change is requested. Why is this showing this?

Did I need to make any other changes regarding this PR?

@luanfreitasdev luanfreitasdev merged commit c0d2be2 into Power-Components:5.x Jul 4, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants