feat(dashboard): prevent double submit, show payment instructions, add SEP-7 QR code - #833
Open
abahesther wants to merge 1 commit into
Open
abahesther wants to merge 1 commit into
abahesther wants to merge 1 commit into
Conversation
…d QR code - Issue StellarGateLabs#760: Disable submit button and show spinner while POST /payments is in flight; re-enable on error. Send Idempotency-Key header to prevent duplicate payment creation on retry. - Issue StellarGateLabs#761: After a successful payment creation show an instructions panel with destination, memo, amount, asset and expiry. Add copy buttons for destination, memo and payment ID (StellarGateLabs#698). Provide a 'Create another' action to reset the form without closing the dialog. - Issue StellarGateLabs#763: Render the SEP-7 web+stellar:pay URI as an inline SVG QR code in the instructions panel. Vendor a MIT-licensed minimal QR encoder under static/vendor/qrcode.js served from the dashboard router. Always include a text alternative containing the full URI for accessibility. Supporting changes: - Add buildSep7Uri() pure helper to format.js (SEP-7 / issue StellarGateLabs#762 dep) - Add static/dashboard-format.js re-export alias expected by test suite - Define MODULES, JS_ROUTES and DASHBOARD_STATE_JS constants in tests/dashboard_asset_tests.rs so the file compiles - Register /dashboard/vendor/qrcode.js and /dashboard/theme.js routes in src/api/mod.rs - Complete dashboard.js modal dialog wiring (openModal/closeModal/ dismissOnBackdrop/focusDetail/trapDetailFocus/keepFocusInDetail/ onDetailClosed) required by existing dashboard_asset_tests assertions - Update fetch() line pin in test to include body parameter Closes StellarGateLabs#760 Closes StellarGateLabs#761 Closes StellarGateLabs#763
|
@abahesther Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements three open issues assigned to @abahesther in a single PR.
#760 - Prevent double submission when creating a payment
Creating...spinner while POST /payments is in flightIdempotency-Keyheader (crypto.randomUUID) to prevent duplicates on retry#761 - Show payment instructions after creating a payment
navigator.clipboard.writeText) withCopiedconfirmation for destination, memo and payment ID (Dashboard: copy buttons for payment ID, memo and destination #698)Create anotheraction resets the form without closing the dialog#763 - QR code for the payment URI
web+stellar:payURI rendered as inline SVG QR code in the instructions panelstatic/vendor/qrcode.js, served as/dashboard/vendor/qrcode.js(no third-party requests, CSP-safe)Supporting changes
buildSep7Uri(payment)pure helper added toformat.jsstatic/dashboard-format.jsre-export alias added (expected by test suite)MODULES,JS_ROUTES,DASHBOARD_STATE_JSconstants defined intests/dashboard_asset_tests.rs/dashboard/vendor/qrcode.jsand/dashboard/theme.jsroutes registered insrc/api/mod.rsdashboard.js(all helpers required by existing test assertions)Validation
tests/dashboard_asset_tests.rsverified against source textCloses #760
Closes #761
Closes #763