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

Connects to #106. Google Analytics tag update. #118

Merged
merged 12 commits into from Apr 15, 2021

Conversation

jimmyzhen
Copy link
Contributor

@jimmyzhen jimmyzhen commented Mar 26, 2021

Key Changes

  1. Updated Google Analytics implementation by replacing the use of analytics.js with gtag.js
  2. Removed the no longer needed resource files associated with prior implementation of human meta-analysis
  3. Upgraded react-scripts dependency to latest version to address issue in which ESLint errors prevent app from compiling in development environment, as well as a vulnerability issue associated with its peer dependency immer
  4. Removed some ESLint rule overrides that were previously added to app compiling issue caused by ESLint errors
  5. Upgraded storybook dependencies to address a vulnerability issue associated with its peer dependency immer
  6. Upgraded a few other outdated dependencies

Technical Note

Use nvm to set node.js to v14.15.4

Steps to test

  1. git clone the repo and run yarn install at the repo's root directory.
  2. At the repo's root directory, create a .env file and add ESLINT_NO_DEV_ERRORS=true in the file (for references, see https://github.com/facebook/create-react-app/blob/master/docusaurus/docs/advanced-configuration.md and Upgrade eslint-webpack-plugin to fix opt-out flag facebook/create-react-app#10590).
  3. Run yarn inspect-branch, and expect to see ESLint warnings in the console (both in Terminal and browser) while the app can be successfully compiled and run.
  4. Now, run yarn audit and expect to see 0 vulnerabilities found in the output message.
  5. Next, open the frontend project in VS Code. Open some *.jsx files (e.g. releaseEntry.jsx) and expect to see some lines of code underlined (red wavy lines) - an indication that eslint and prettier are hinting fixes.
  6. Log into MoTrPAC's Google Analytics account and select the dev property.
  7. From its left-hand navbar, select Realtime > Content. Then try clicking through different pages on the local instance of the frontend app. Expect to see the pageviews being reported in real time in Google Analytics.
  8. From its left-hand navbar, select Realtime > Events. On the homepage of the local instance of the frontend app, try clicking on the 2 links. Expect to see the events being reported in real time in Google Analytics.
  9. Sign into the frontend app and go to the Releases page. Try downloading some files (hint: zipped phenotype files are smallest to download). Expect to see the events being reported in real time in Google Analytics.

Also fixed bug in which wrong release version number is passed to Google Analytics data download tracking event
…rors cause problems while compiling and building the app

ESLint errors didn't cause any issues prior to react-scripts v3.x. So the React team released this patch in response to that.

Also upgraded the storybook dependencies to address the vulnerability issue in its peer dependency.
…using app build problem in react-scripts v4.x
@ysyskim4
Copy link
Contributor

ysyskim4 commented Apr 6, 2021

@jimmyzhen Regarding step 5, can you please let me know what line are you referring to in the releaseEntry.jsx ? I searched for prettier text in the file, but did not see the text.

@jimmyzhen
Copy link
Contributor Author

@ysyskim4 Thank you for reviewing this PR. I will share a screenshot to explain what I meant.

Copy link
Contributor

@ysyskim4 ysyskim4 left a comment

Choose a reason for hiding this comment

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

Looks great. Thanks.

Copy link
Contributor

@cteng585 cteng585 left a comment

Choose a reason for hiding this comment

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

Everything works as described in the test steps.

@jimmyzhen jimmyzhen merged commit 7d2ab70 into dev Apr 15, 2021
@kilodalton kilodalton deleted the 106_JZ_Google_Analytics_Tag_Update branch April 30, 2021 20:59
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.

None yet

3 participants