-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PLAY-1490] Dialog disable rails - Remove duplicate data (#3646)
**What does this PR do?** A clear and concise description with your runway ticket url. Runway https://runway.powerhrg.com/backlog_items/PLAY-1490 The OG PR #3599 This was reverted because of multiple data declorations ```<%= pb_rails("button", props: { type: "button", data: {"close-dialog": "#{object.id}" }, id: object.cancel_button_id, variant: "link", data: cancel_loading}) do %>``` **But this is how it works** Adds a prop to the dialog kit that makes the buttons go into a "loading state" when pressed [screencast-127.0.0.1_3000-2024.08.15-14_05_54.webm](https://github.com/user-attachments/assets/6c9ec27b-d8a8-43cb-8443-fcb0865b2e94) **How to test?** Steps to confirm the desired behavior: 1. Go to https://pr3646.playbook.beta.gm.powerapp.cloud/kits/dialog/rails#loading 2. Click Open Dialog 3. click Okay 4. Notice the loading state of the buttons and admire how nice they communicate that something is loading and that you can't press the buttons again
- Loading branch information
1 parent
ff15779
commit 126b254
Showing
8 changed files
with
59 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
playbook/app/pb_kits/playbook/pb_dialog/docs/_dialog_loading.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<%= pb_rails("button", props: { text: "Open Dialog", data: {"open-dialog": "dialog-loading"} }) %> | ||
<%= pb_rails("dialog", props: { | ||
id:"dialog-loading", | ||
size: "sm", | ||
title: "Loading Exmaple", | ||
text: "Make a loading request?", | ||
cancel_button: "Cancel Button", | ||
cancel_button_id: "cancel-button-loading", | ||
confirm_button: "Okay", | ||
confirm_button_id: "confirm-button-loading", | ||
loading: true, | ||
}) %> |
3 changes: 3 additions & 0 deletions
3
playbook/app/pb_kits/playbook/pb_dialog/docs/_dialog_loading.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Pressing the "Okay" button will trigger a loading state where the button content is replaced by a spinner icon and both buttons are disabled. | ||
|
||
Currently, the loading state cannot be undone and will require a page refresh to reset the dialog. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters