diff --git a/src/actions/app.js b/src/actions/app.js index 324d71d..bac1943 100644 --- a/src/actions/app.js +++ b/src/actions/app.js @@ -1,4 +1,5 @@ import { UPDATE_NAV_STATE, LOG_IN } from './action-types'; +import { sendGevents } from '../utils/gevents'; export function updateState(flag) { @@ -8,7 +9,8 @@ export function updateState(flag) { }); } -export function login() { +export function login(action) { + sendGevents({ narrative: action, name: 'Login'}); return ({ type: LOG_IN, }); diff --git a/src/components/validate/validate-rules.js b/src/components/validate/validate-rules.js index 86f8a9f..8c79c9e 100644 --- a/src/components/validate/validate-rules.js +++ b/src/components/validate/validate-rules.js @@ -10,6 +10,7 @@ import * as Message from '../../constants/messages'; import { validateRuleset } from '../../validations/rule-validation'; import Loader from '../loader/loader'; import { ViewOutcomes } from '../attributes/view-attributes'; +import { sendGevents } from '../../utils/gevents'; class ValidateRules extends Component { @@ -65,6 +66,7 @@ class ValidateRules extends Component { }).catch((e) => { this.setState({loading: false, error: true, errorMessage: e.error, result: true, }); }); + sendGevents({ narrative: 'validate rules', name: 'Validate' }); } attributeItems = () => { diff --git a/src/containers/app/app-container.js b/src/containers/app/app-container.js index eea1130..84ef70a 100644 --- a/src/containers/app/app-container.js +++ b/src/containers/app/app-container.js @@ -8,6 +8,7 @@ import { updateRulesetIndex } from '../../actions/ruleset'; import { updateState } from '../../actions/app'; import { createHashHistory } from 'history'; import ApperanceContext from '../../context/apperance-context'; +import { sendGevents } from '../../utils/gevents'; class ApplicationContainer extends Component { @@ -21,6 +22,7 @@ class ApplicationContainer extends Component { const theme = { ...this.state.theme, background: value }; document.body.className = value; this.setState({ theme }); + sendGevents({ narrative: 'value', name: 'Theme' }); } this.state = {theme: { background: 'light', toggleBackground: this.toggleBackground }}; } diff --git a/src/containers/home/home-container.js b/src/containers/home/home-container.js index d7d12c9..7dbffb4 100644 --- a/src/containers/home/home-container.js +++ b/src/containers/home/home-container.js @@ -13,6 +13,7 @@ import Notification from '../../components/notification/notification'; import { RULE_AVAILABLE_UPLOAD, RULE_UPLOAD_ERROR } from '../../constants/messages'; import ApperanceContext from '../../context/apperance-context'; import { faCloudArrowUp } from '@fortawesome/free-solid-svg-icons' +import { sendGevents } from '../../utils/gevents'; function readFile(file, cb) { @@ -120,14 +121,14 @@ class HomeContainer extends Component { handleUpload() { if(this.state.ruleset.length > 0) { this.props.uploadRuleset(this.state.ruleset); - this.navigate('./ruleset'); + this.navigate('./ruleset', 'upload'); } } - navigate(location) { + navigate(location, action) { const history = createHashHistory(); - this.props.login(); - history.push(location); + this.props.login(action); + history.push(location); } render() { @@ -147,7 +148,7 @@ class HomeContainer extends Component {