Repository navigation
Show the signed-in username and ORCID iD in the gallery top bar - #52
Merged
Merged
Conversation
Rendered only when /api/V2/me returns a user: the KBase username over the ORCID iD in compact form (iD icon, then the digits, linked to the record), with the user's avatar at the right. The block is taller than the logo and extends into the bar's padding, so the bar is 51px signed in and out. A username longer than the iD line ends in an ellipsis, with the full name as a tooltip.
A kbase_session cookie from another kbase.us site (a Google or Globus sign-in) can carry an account with no ORCID identity. The second line then reads "Link your ORCID iD" with the design system's external-link icon, opening the legacy account UI's linked-providers page. Also fixes the username rendering at zero width in that case: the rule that caps it to the iD line's width now applies only when a second line exists; a lone username gets a 190px maximum.
The link pointed at production's account UI on every deployment, so a CI user would link an ORCID in the wrong environment. legacyUiOrigin maps the auth origin the way kbase-ui does: kbase.us to narrative.kbase.us, any other origin to itself, and the dev proxy target when the origin is empty.
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.
When
/api/V2/mereturns a user, the right end of the gallery top bar shows the KBase username over the ORCID iD, with the user's avatar at the right. Signed out, nothing renders. The data comes from the existing/mequery:user, and the ORCID entry inidents.ORCID display guidelines
The iD uses the compact form from the ORCID iD display guidelines: the iD icon, then the 16 digits, linked to
https://orcid.org/<iD>. The icon is 16px, the guidelines' minimum for limited space. The icon sits with the digits only. The inline form (name, then icon) would present the KBase username as the ORCID record holder's name.No ORCID identity
A
kbase_sessioncookie is shared across.kbase.us, so a session from another KBase site signed in with Google or Globus reaches the gallery with no ORCID identity. The second line then reads "Link your ORCID iD" with the design system's external-link icon (ArrowSquareOut), linking to<ui origin>/account/providers, the legacy account UI's linked-providers page. The UI origin is derived fromAUTH_ORIGINthe way kbase-ui does it:https://kbase.usmaps tohttps://narrative.kbase.us, any other origin to itself (legacyUiOrigininsrc/config.ts). No iD icon is shown, since there is no iD.Layout
title. auth2 usernames are up to 100 characters (UserName.MAX_NAME_LENGTH).Checks
npm run lint,npm run format:check,npm run typecheck,npx vitest run --dir src: exit 0, 208 tests. New tests inportals.test.tsx: no identity block signed out; username and ORCID link signed in; the linking link when no ORCID identity exists.config.test.tscovers the origin mapping./mestubbed, at 1280px and 375px, fordlyon,jgreypy,gyjqp_pygmy,j_q_p_y_g,microbial_genomics_lab_2024, a 40-character name and a 100-character name: bar 51px, block 193px wide at the same position, no horizontal scroll, descenders intact.