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

[Bug] Fix link from Help Center to Agency Dashboards for production users #1068

Merged
merged 5 commits into from
Nov 21, 2023

Conversation

mxosman
Copy link
Contributor

@mxosman mxosman commented Nov 20, 2023

Description of the change

I noticed a bug when I was playing around with the Help Center in production specifically in the link to Agency Dashboards. I was taken to the staging URL which resulted in an error - instead of the production URL. For some reason the piece of logic that creates the URL based on the environment isn't picking up on the right environment. I suspect it is because when this component is mounted, the api.environment is first undefined until it is set - and since these components aren't observers they might not have been re-rendering when api.environment is set and have thus defaulted to the staging URL.

I tried to log the api.environment and deploy to playtesting with and without the observer and it logged staging for both - so my hunch might be off. But regardless, both components should be wrapped in an observer - so this change is necessary. I am curious to see when we deploy to prod if this fixes it. If not, I'll keep digging into this.

Screenshot 2023-11-20 at 11 28 27 AM

Related issues

Closes #1067

Checklists

Development

This box MUST be checked by the submitter prior to merging:

  • Double- and triple-checked that there is no Personally Identifiable Information (PII) being mistakenly added in this pull request

These boxes should be checked by the submitter prior to merging:

  • Tests have been written to cover the code changed/added as part of this pull request

Code review

These boxes should be checked by reviewers prior to merging:

  • This pull request has a descriptive title and information useful to a reviewer
  • This pull request has been moved out of a Draft state, has no "Work In Progress" label, and has assigned reviewers
  • Potential security implications or infrastructural changes have been considered, if relevant

import React, { PropsWithChildren } from "react";

import { useStore } from "../../stores";

export const LinkToPublisher: React.FC<
PropsWithChildren & { publisherPath: string }
> = ({ publisherPath, children }) => {
> = observer(({ publisherPath, children }) => {
Copy link
Contributor Author

@mxosman mxosman Nov 20, 2023

Choose a reason for hiding this comment

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

Wrapping these components with the observer higher-order component is the only change in this PR - the rest is prettier formatting.

@mxosman mxosman requested a review from a team November 21, 2023 17:14
@mxosman mxosman marked this pull request as ready for review November 21, 2023 17:14
@morden35
Copy link
Contributor

I tried to log the api.environment and deploy to playtesting with and without the observer and it logged staging for both - so my hunch might be off. But regardless, both components should be wrapped in an observer - so this change is necessary. I am curious to see when we deploy to prod if this fixes it. If not, I'll keep digging into this.

Yeah since playtesting links are technically staging, this makes sense. So hopefully this change is all that is needed once deployed to prod!

Copy link
Contributor

@morden35 morden35 left a comment

Choose a reason for hiding this comment

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

lgtm!

@mxosman
Copy link
Contributor Author

mxosman commented Nov 21, 2023

I tried to log the api.environment and deploy to playtesting with and without the observer and it logged staging for both - so my hunch might be off. But regardless, both components should be wrapped in an observer - so this change is necessary. I am curious to see when we deploy to prod if this fixes it. If not, I'll keep digging into this.

Yeah since playtesting links are technically staging, this makes sense. So hopefully this change is all that is needed once deployed to prod!

Thank you so much, Michelle! Yeah, I was hoping for the one without the observer to have logged twice - once undefined and the next one staging. 🤔 We shall find out next week!

@mxosman mxosman merged commit eebb2fc into main Nov 21, 2023
7 checks passed
@mxosman mxosman deleted the mahmoud/bug-link-to-dashboard branch November 21, 2023 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] The dashboard guides in production link to the dashboard staging URL instead of prod URL
2 participants