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

LG-15248: Account Management no change available #11701

Draft
wants to merge 26 commits into
base: main
Choose a base branch
from

Conversation

jmdembe
Copy link
Contributor

@jmdembe jmdembe commented Jan 3, 2025

🎫 Ticket

Link to the relevant ticket:
LG-15248

🛠 Summary of changes

On the connected accounts screen, the "change" option is not shown when

  • all_emails is a requested_attribute; or
  • email does not exist on requested attribute

📜 Testing Plan

Before testing: Clone, setup, and start the identity-oidc-sinatra app and set feature_select_email_to_share_enabled to true

Default behavior:

  • In the identity-oidc-sinatra app, leave all options checked in requested_attributes
  • Once on the identity-idp app, follow all steps to create a new account
  • Once your email is confirmed, follow all steps to set up 2FA
  • After setup, you will be on the /account page. Click Your connected accounts on the left side of the page
  • Once on the connected accounts page, you will see "Example Sinatra App" as a connected account. Observe that the "change" link appears

Simulating missing email or present all_emails attribute

  • In the identity-oidc-sinatra app, either uncheck email or uncheck email and check all_emails
  • Once on the identity-idp app, follow all steps to create a new account
  • Once your email is confirmed, follow all steps to set up 2FA
  • After setup, you will be on the /account page. Click Your connected accounts on the left side of the page
  • Once on the connected accounts page, you will see "Example Sinatra App" as a connected account. Observe that the "change" does not appear

👀 Screenshots

If relevant, include a screenshot or screen capture of the changes.

When `email` is requested attribute
Screen.Recording.2025-01-08.at.1.46.46.PM.mov
When `all_emails` is a requested attribute
all.emails.no.change.link.mov
When `email` are not a requested attributehttps://github.com/user-attachments/assets/0f3b9cfe-ed76-48ca-8bc9-23e650bec4ea

@aduth aduth changed the title DRAFT: Account Management no change available DRAFT: LG-15248: Account Management no change available Jan 6, 2025
@jmdembe jmdembe force-pushed the jd-LG-15248-hide-change-button branch from 85db79e to 884b507 Compare January 8, 2025 17:33
@jmdembe jmdembe marked this pull request as ready for review January 8, 2025 19:32
@jmdembe jmdembe marked this pull request as draft January 8, 2025 19:38
@jmdembe jmdembe marked this pull request as ready for review January 9, 2025 21:25
@jmdembe jmdembe changed the title DRAFT: LG-15248: Account Management no change available LG-15248: Account Management no change available Jan 9, 2025
@jmdembe jmdembe requested a review from a team January 9, 2025 22:23
@@ -16,7 +18,15 @@ def show
sp_name: decorated_sp_session.sp_name,
user: current_user,
locked_for_session: pii_locked_for_session?(current_user),
change_email_available: change_email_available?,
Copy link
Member

Choose a reason for hiding this comment

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

To me, part of the benefit of having a presenter like this is to help keep controllers lean by moving the logic into the presenter class, but in this case we're using the presenter as a pass-through and having the logic in the controller.

Instead, I might have expected that we could pass a value which is more readily available (decorated_sp_session.requested_attributes or decorated_sp_session) and do the logic in the presenter.

)
end

def change_email_available?
if decorated_sp_session.requested_attributes.present?
Copy link
Member

Choose a reason for hiding this comment

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

This seems to be looking at the requested attribute for the current request, not for each connected application. We want the link to be available for any connection where the requested attribute includes email.

Comment on lines 20 to 22
<strong>
<%= identity.email_address&.email || t('account.connected_apps.email_not_selected') %>
</strong>
Copy link
Member

Choose a reason for hiding this comment

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

We also don't want to show the "selected" email if the connected application didn't request email.

From the ticket:

"No email selected" / selected email [...] are not shown

@jmdembe jmdembe marked this pull request as draft January 10, 2025 19:07
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.

2 participants