-
Notifications
You must be signed in to change notification settings - Fork 51
Dont render credential modals inside td #3389
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
Conversation
…der-credential-modals-inside-td
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3389 +/- ##
==========================================
- Coverage 89.99% 89.98% -0.01%
==========================================
Files 368 369 +1
Lines 14458 14414 -44
==========================================
- Hits 13011 12971 -40
+ Misses 1447 1443 -4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@taylordowns2000 kindly take this for a spin when you find some time, just to double check that all actions are working as they were |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- when attempting to transfer to a user and the transfer fails (if they're not a member of all projects shared with that credential, for example) no feedback is shown to the user - please fix this
- does this prevent us from actually (and secretly) rendering and firing off Oauth requests for all credential modals when visiting the credentials list page?
![]()
Yes it does. Now it's only one oauth credential at a time and only when you click to edit. Wait, was it intended to fire for all at once? |
This is what we wanted. Great. For the transfer bug, I've followed up on Slack |
@taylordowns2000 I've created a separated issue to track the error message not showing in credential transfer form. This bug can be reproduced in main as well: #3402 |
The 'use LightningWeb, :live_component' already aliases LightningWeb.Components to Components, making the full module path redundant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @midigofrank!
Description
Problem: The credential modals were being rendered inside
<td>
elements, which violates HTML semantics and causes layout issues. Additionally, the credential tables and events were duplicated in different liveviews - the/credentials
page and the project settings pageSolution Overview:
The solution involves moving all the credential listing logic, modal state management, and event handling into a centralized component that is used in
/credentials
and project settings.Key Changes
1. Introduced
CredentialIndexComponent
(lib/lightning_web/live/credential_live/credential_index_component.ex
)/credentials
page and project settings pageactive_modal
state to control which modal is currently shown(new_credential, edit_credential, delete_credential, transfer_credential, new_oauth_client, edit_oauth_client, delete_oauth_client)
2. Standardized Modal Closing System
The main goal was that when you click Cancel or the X button on any credential modal, it should hide the modal and remove it from the DOM. This is achieved by having all modal close events target the
CredentialIndexComponent
.To make it easy to target the
CredentialIndexComponent
, I added 3 helper components:Components.Credentials.credentials_index_live_component/1
: Ensures that the livecomponent always uses the same ID.Components.Credentials.credential_modal/1
: A<.modal />
wrapper. By default targets theCredentialIndexComponent
byid
for close events.Components.Credentials.credential_modal_cancel_button
: It automatically targets theCredentialIndexComponent
byid
when clicked.Both the
credential_modal
andcredential_modal_cancel_button
have a defaulton_modal_close
assign that sendsclose_active_modal
events to theCredentialIndexComponent
, but this can be overridden for special cases such as in theWorkflow edit page
.Ensure you test all the actions,
create, edit, transfer, revoke transfer and delete
Closes #1588
Validation steps
This needs a lot of click testing on all the credential pages. Visit any of the
/credentials
,project settings
or even theworkflow edit page for adding a new credential
.Additional notes for the reviewer
ModalPortal
toLiveComponentPortal
for better clarity about its purpose. This component isn't used in the current PR but provides a foundation for future modal rendering improvements. The rename makes it clear that this is for rendering LiveComponents outside their normal DOM location:skip
. I have created a separate issue to track this: Fix OAuth Client tests #3391AI Usage
Please disclose how you've used AI in this work (it's cool, we just want to know!):
You can read more details in our Responsible AI Policy
Pre-submission checklist
:owner
,:admin
,:editor
,:viewer
)