Refactor analytics code into folder.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
coverage/*
|
||||
dist/
|
||||
node_modules/
|
||||
src/segment.js
|
||||
src/analytics/segment.js
|
||||
|
||||
@@ -4,7 +4,7 @@ const path = require('path');
|
||||
|
||||
module.exports = {
|
||||
entry: {
|
||||
segment: path.resolve(__dirname, '../src/segment.js'),
|
||||
segment: path.resolve(__dirname, '../src/analytics/segment.js'),
|
||||
app: path.resolve(__dirname, '../src/index.jsx'),
|
||||
},
|
||||
output: {
|
||||
|
||||
@@ -13,7 +13,7 @@ module.exports = Merge.smart(commonConfig, {
|
||||
entry: [
|
||||
// enable react's custom hot dev client so we get errors reported in the browser
|
||||
require.resolve('react-dev-utils/webpackHotDevClient'),
|
||||
path.resolve(__dirname, '../src/segment.js'),
|
||||
path.resolve(__dirname, '../src/analytics/segment.js'),
|
||||
path.resolve(__dirname, '../src/index.jsx'),
|
||||
],
|
||||
module: {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import snakecaseKeys from 'snakecase-keys';
|
||||
import apiClient from './config/apiClient';
|
||||
import { configuration } from './config/environment';
|
||||
import apiClient from '../config/apiClient';
|
||||
import { configuration } from '../config/environment';
|
||||
|
||||
const eventLogApiBaseUrl = `${configuration.LMS_BASE_URL}/event`;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// The code in this file is from Segment's website, with the following update:
|
||||
// - Pulls the segment key from configuration.
|
||||
// https://segment.com/docs/sources/website/analytics.js/quickstart/
|
||||
import { configuration } from './config/environment';
|
||||
import { configuration } from '../config/environment';
|
||||
|
||||
(function(){
|
||||
|
||||
@@ -8,7 +8,7 @@ import SiteFooter from '@edx/frontend-component-footer';
|
||||
import { fetchUserAccount, UserAccountApiService } from '@edx/frontend-auth';
|
||||
|
||||
import apiClient from '../config/apiClient';
|
||||
import { handleTrackEvents } from '../analytics';
|
||||
import { handleTrackEvents } from '../analytics/analytics';
|
||||
import { getLocale, getMessages } from '../i18n/i18n-loader';
|
||||
import SiteHeader from './/SiteHeader';
|
||||
import ConnectedProfilePage from './ProfilePage';
|
||||
|
||||
@@ -2,7 +2,7 @@ import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Container, Row, Col } from 'reactstrap';
|
||||
import { connect } from 'react-redux';
|
||||
import { logEvent } from '../analytics';
|
||||
import { logEvent } from '../analytics/analytics';
|
||||
|
||||
// Actions
|
||||
import {
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Provider } from 'react-redux';
|
||||
import configureMockStore from 'redux-mock-store';
|
||||
import { IntlProvider } from 'react-intl';
|
||||
|
||||
import * as analytics from '../analytics';
|
||||
import * as analytics from '../analytics/analytics';
|
||||
import ConnectedProfilePage from './ProfilePage';
|
||||
import { initialState as initialProfilePageState } from '../reducers/ProfilePageReducer';
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import ReactDOM from 'react-dom';
|
||||
|
||||
import configureStore from './config/configureStore';
|
||||
import apiClient from './config/apiClient';
|
||||
import { identifyUser } from './analytics';
|
||||
import { identifyUser } from './analytics/analytics';
|
||||
|
||||
import './index.scss';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user