livewire-powergrid icon indicating copy to clipboard operation
livewire-powergrid copied to clipboard

feat: confirmation before any action.

Open hemant-kr-meena opened this issue 1 year ago • 3 comments

⚡ 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
  • [x] 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?

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

hemant-kr-meena avatar Jun 22 '24 08:06 hemant-kr-meena

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.

hemant-kr-meena avatar Jun 25 '24 11:06 hemant-kr-meena

Thank you for this PR!

luanfreitasdev avatar Jun 25 '24 23:06 luanfreitasdev

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?

hemant-kr-meena avatar Jun 26 '24 12:06 hemant-kr-meena