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

ENCD-5432 Use WalkMe test snippet on nonproduction hosts #3446

Merged
merged 1 commit into from
Jul 30, 2020

Conversation

forresttanaka
Copy link
Contributor

No description provided.

Copy link
Contributor

@zoldello zoldello left a comment

Choose a reason for hiding this comment

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

Code looks fine.

@@ -46,7 +46,7 @@ export default class Navigation extends React.Component {
/** ID of the currently dropped-down main navigation menu; '' if none */
openDropdown: '',
/** True if test warning banner visible; default depends on domain */
testWarning: !productionHost[url.parse(context.location_href).hostname],
testWarning: !isProductionHost(context.location_href),
Copy link
Contributor

Choose a reason for hiding this comment

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

This is easier to understand.

* @return True if code runs on production host
*/
export const isProductionHost = currentUrl => (
['www.encodeproject.org', 'encodeproject.org', 'www.encodedcc.org'].includes(url.parse(currentUrl).hostname)
Copy link
Contributor

Choose a reason for hiding this comment

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

Something in the back of my head is telling me this can be done with regex much better. Anyway, this is good as-is

@hitz hitz merged commit 91f0d5a into dev Jul 30, 2020
@hitz hitz deleted the ENCD-5432-walkme-test branch July 30, 2020 20:54
vsmalladi pushed a commit to utsw-bicf/pandiseased that referenced this pull request Jan 22, 2021
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