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

feat: osi list shows officials' name with email as fallback #137

Merged
merged 2 commits into from
Sep 17, 2024

Conversation

mathcolo
Copy link
Collaborator

Asana Task: 📐 Orbit: In-app view of completed sign-ins does not include official full name

Display officials' names in the list, with email address as fallback.

Checklist

  • Tests:
    • (x) Has tests
    • ( ) Doesn't need tests
    • ( ) Tests deferred (with justification)
  • Product/Design sign off:
    • (x) Okayed the plan for the feature (e.g. the design files, or the Asana task)
    • ( ) Reviewed the feature as implemented (e.g. on dev-green, or saw screenshots)
    • ( ) No review needed

@mathcolo mathcolo requested a review from a team as a code owner September 16, 2024 20:55
preload: [:signed_in_employee, :signed_in_by_user],
order_by: [desc: :signed_in_at]
join: u in assoc(si, :signed_in_by_user),
preload: [:signed_in_employee, signed_in_by_user: u],
Copy link
Member

Choose a reason for hiding this comment

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

suggestion (non-blocking): If you're already in here turning the preload for signed_in_by_user from the default (which uses a separate query - see here) to using an explicit join in the same query, it might be worth doing the same for signed_in_employee, thus turning this whole operation into a single query.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ah! thanks, I see you did that in #103. why is that not the default preload behavior, though? I guess because Ecto wants joins to remain explicit?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Member

@lemald lemald Sep 17, 2024

Choose a reason for hiding this comment

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

why is that not the default preload behavior, though?

I'm not sure - it's also possible that Ecto isn't able to generate the join statements fully programmatically in all cases or something? In any event it's just an interesting quirk to be aware of.

Copy link
Member

@lemald lemald left a comment

Choose a reason for hiding this comment

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

One suggestion for a further improvement you could make but overall looks good to me. 👍

@mathcolo mathcolo merged commit c21aa79 into main Sep 17, 2024
5 checks passed
@mathcolo mathcolo deleted the pim-show-official-name branch September 17, 2024 13:49
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