-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from EyeSeeTea/master
Release 3.7.0
- Loading branch information
Showing
45 changed files
with
79,833 additions
and
70,681 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v16.14.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,9 @@ | ||
import React from "react"; | ||
import ReactGA from "react-ga"; | ||
import ReactDOM from "react-dom"; | ||
import "./index.css"; | ||
import reportWebVitals from "./reportWebVitals"; | ||
import App from "./webapp/pages/app/App"; | ||
|
||
const gaAppId = "UA-93698320-1"; //UA-93698320-4 for development UA-93698320-1 for production | ||
ReactGA.initialize(gaAppId, { | ||
debug: true, | ||
titleCase: false, | ||
useExistingGa: process.env.NODE_ENV !== "development", | ||
}); | ||
|
||
ReactDOM.render(<App />, document.getElementById("root")); | ||
|
||
reportWebVitals(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 17 additions & 40 deletions
57
app/assets/javascripts/3dbio_viewer/src/webapp/utils/analytics.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,21 @@ | ||
import ReactGA from "react-ga"; | ||
import _ from "lodash"; | ||
|
||
/* Non-redux GA analytics helpers. For Redux, check for example the <Citation> component. Steps: | ||
- Import action. | ||
- Create mapDispatchToProps. | ||
- Add dispatch props to Props type. | ||
- Use redux connect with mapDispatchToProps. | ||
- Call dispatcher from props. | ||
*/ | ||
|
||
type AnalyticsData = Event | PageView | OutboundLink; | ||
|
||
interface Event { | ||
type: "event"; | ||
category: string; | ||
action: string; | ||
label?: string; | ||
} | ||
|
||
interface PageView { | ||
type: "pageView"; | ||
path: string; | ||
declare global { | ||
interface Window { | ||
gtag?: (...args: []) => void; | ||
} | ||
} | ||
|
||
interface OutboundLink { | ||
type: "outboundLink"; | ||
label: string; | ||
} | ||
declare function gtag(type: "event", name: string, data?: object): void; | ||
|
||
export function sendAnalytics(data: AnalyticsData) { | ||
switch (data.type) { | ||
case "event": | ||
ReactGA.event({ category: data.category, action: data.action, label: data.label }); | ||
break; | ||
case "pageView": | ||
ReactGA.set({ page: data.path }); | ||
ReactGA.pageview(data.path); | ||
break; | ||
case "outboundLink": | ||
ReactGA.outboundLink({ label: data.label }, () => {}); | ||
break; | ||
} | ||
export function sendAnalytics(name: string, data?: object) { | ||
if (window.gtag !== undefined) | ||
gtag( | ||
"event", | ||
name, | ||
data && { | ||
...data, | ||
location_hash: window.location.hash, | ||
location_pathname: window.location.pathname, | ||
location_href: window.location.href, | ||
} | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v16.14.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.