Skip to content

Conversation

@amy-corson-ibigroup
Copy link
Contributor

Description:
If there is an external "help" link supplied in the config, the "help" option inside the account dropdown will direct users to the external web address. An icon will also be added indicating the link is an external link.

image

PR Checklist:

  • Does the code follow accessibility standards (WCAG 2.1 AA Compliant)?
  • Are all languages supported (Internationalization/Localization)?
  • Are appropriate Typescript types implemented?

Copy link
Collaborator

@binh-dam-ibigroup binh-dam-ibigroup left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@miles-grant-ibigroup miles-grant-ibigroup left a comment

Choose a reason for hiding this comment

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

Works! Just a few nitpicks

lib/util/auth.js Outdated
url: '/help'
}
]
export const accountLinks = (config) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nitpick: can we refactor this to take in extraMenuItems instead of the entire config?

lib/util/auth.js Outdated
export const accountLinks = (config) => {
const helpLink =
config?.extraMenuItems.find((link) => link.id === 'help') || undefined
const helpLinkUrl = helpLink ? helpLink.href : '/help'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we inline this?

messageId: 'help',
// Add a target attribute if you need the link to open in a new window, etc.
// (supports the same values as <a target=... >).
// target: '_blank',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this supposed to be uncommented?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This exists in dev, but I think it's just a demonstration? Seems like weird behavior for this to open a new tab by default

Copy link
Collaborator

Choose a reason for hiding this comment

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

Good call. We can leave it commented out for now!

const mapStateToProps = (state) => {
return {
auth0Config: getAuth0Config(state.otp.config.persistence),
config: state.otp.config,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Once accountLinks is extracted this can be refactored to only extract the part of the config we need

Copy link
Collaborator

@miles-grant-ibigroup miles-grant-ibigroup left a comment

Choose a reason for hiding this comment

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

Looking good! Just one small crash fix and we should be good to go

auth0Config: getAuth0Config(state.otp.config.persistence),
config: state.otp.config,
configLanguages: state.otp.config.language,
extraMenuItems: state.otp.config.extraMenuItems,
Copy link
Collaborator

Choose a reason for hiding this comment

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

You need optional chaining here!

@amy-corson-ibigroup amy-corson-ibigroup merged commit 6d56ec3 into dev Jun 12, 2023
@amy-corson-ibigroup amy-corson-ibigroup deleted the support-ext-help-link branch June 12, 2023 17:42
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.

4 participants