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: Hide page elements based on query param #3323

Merged
merged 2 commits into from
Oct 13, 2021

Conversation

eddieferrer
Copy link
Contributor

  • Hides global promo, nav menu and secondary menu if query param kivaAppReferral=true exists

GD-139

@eddieferrer
Copy link
Contributor Author

eddieferrer commented Oct 12, 2021

Used a local resolver. My other idea was to use a cookie. Not sure if there is a benefit to using either approach. I tested this and LGTM, it also prevents any flash of the header and works even when not logged in after auth0 redirect

@@ -113,7 +113,7 @@ export default {
},
methods: {
onOpen() {
this.$refs.mega.onOpen();
this.$refs?.mega?.onOpen?.();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

added optional chaining on these as I was getting an error when the header was hidden.

Copy link
Collaborator

Choose a reason for hiding this comment

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

💯

return Promise.all([
client.query({ query: hasEverLoggedInQuery }),
fetchAllExpSettings(config, client, {
query: _get(args, 'route.query'),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

_get refactor

* Hides global promo, nav menu and secondary menu if query param kivaAppReferral=true exists

GD-139
referralData = this.apollo.readQuery({
query: isKivaAppReferralQuery,
variables: {
kivaAppReferralQueryParam: this.$route?.query?.kivaAppReferral,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

send this query param as the variable. It is a string. We do the casting from string to Boolean in the local resolver.

@mcstover
Copy link
Collaborator

I think the local resolver option is good as it "should" persist for page transitions within the Ui app. I'm not really interested in setting something as persistent as a cookie for this task.

@eddieferrer
Copy link
Contributor Author

I think the local resolver option is good as it "should" persist for page transitions within the Ui app. I'm not really interested in setting something as persistent as a cookie for this task.

@mcstover This will not persist for page transitions

Copy link
Collaborator

@emuvente emuvente left a comment

Choose a reason for hiding this comment

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

nice 👍

@eddieferrer eddieferrer merged commit e0358b8 into master Oct 13, 2021
@eddieferrer eddieferrer deleted the GD-139_mobile_hide_page_elements branch October 13, 2021 19:20
@mcstover
Copy link
Collaborator

👍

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.

3 participants