Add networkId to event label
This commit is contained in:
@@ -561,6 +561,8 @@ export class FillOrder extends React.Component<FillOrderProps, FillOrderState> {
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
const networkName = constants.NETWORK_NAME_BY_ID[this.props.networkId];
|
||||||
|
const eventLabel = `${parsedOrder.taker.token.symbol}-${networkName}`;
|
||||||
try {
|
try {
|
||||||
const orderFilledAmount: BigNumber = await this.props.blockchain.fillOrderAsync(
|
const orderFilledAmount: BigNumber = await this.props.blockchain.fillOrderAsync(
|
||||||
signedOrder,
|
signedOrder,
|
||||||
@@ -569,7 +571,7 @@ export class FillOrder extends React.Component<FillOrderProps, FillOrderState> {
|
|||||||
ReactGA.event({
|
ReactGA.event({
|
||||||
category: 'Portal',
|
category: 'Portal',
|
||||||
action: 'Fill Order Success',
|
action: 'Fill Order Success',
|
||||||
label: parsedOrder.taker.token.symbol,
|
label: eventLabel,
|
||||||
value: parsedOrder.taker.amount,
|
value: parsedOrder.taker.amount,
|
||||||
});
|
});
|
||||||
// After fill completes, let's force fetch the token balances
|
// After fill completes, let's force fetch the token balances
|
||||||
@@ -588,7 +590,7 @@ export class FillOrder extends React.Component<FillOrderProps, FillOrderState> {
|
|||||||
ReactGA.event({
|
ReactGA.event({
|
||||||
category: 'Portal',
|
category: 'Portal',
|
||||||
action: 'Fill Order Failure',
|
action: 'Fill Order Failure',
|
||||||
label: parsedOrder.taker.token.symbol,
|
label: eventLabel,
|
||||||
value: parsedOrder.taker.amount,
|
value: parsedOrder.taker.amount,
|
||||||
});
|
});
|
||||||
const errMsg = `${err}`;
|
const errMsg = `${err}`;
|
||||||
@@ -658,6 +660,8 @@ export class FillOrder extends React.Component<FillOrderProps, FillOrderState> {
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
const networkName = constants.NETWORK_NAME_BY_ID[this.props.networkId];
|
||||||
|
const eventLabel = `${parsedOrder.maker.token.symbol}-${networkName}`;
|
||||||
try {
|
try {
|
||||||
await this.props.blockchain.cancelOrderAsync(signedOrder, availableTakerTokenAmount);
|
await this.props.blockchain.cancelOrderAsync(signedOrder, availableTakerTokenAmount);
|
||||||
this.setState({
|
this.setState({
|
||||||
@@ -669,7 +673,7 @@ export class FillOrder extends React.Component<FillOrderProps, FillOrderState> {
|
|||||||
ReactGA.event({
|
ReactGA.event({
|
||||||
category: 'Portal',
|
category: 'Portal',
|
||||||
action: 'Cancel Order Success',
|
action: 'Cancel Order Success',
|
||||||
label: parsedOrder.maker.token.symbol,
|
label: eventLabel,
|
||||||
value: parsedOrder.maker.amount,
|
value: parsedOrder.maker.amount,
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
@@ -684,7 +688,7 @@ export class FillOrder extends React.Component<FillOrderProps, FillOrderState> {
|
|||||||
ReactGA.event({
|
ReactGA.event({
|
||||||
category: 'Portal',
|
category: 'Portal',
|
||||||
action: 'Cancel Order Failure',
|
action: 'Cancel Order Failure',
|
||||||
label: parsedOrder.maker.token.symbol,
|
label: eventLabel,
|
||||||
value: parsedOrder.maker.amount,
|
value: parsedOrder.maker.amount,
|
||||||
});
|
});
|
||||||
globalErrMsg = 'Failed to cancel order, please refresh and try again';
|
globalErrMsg = 'Failed to cancel order, please refresh and try again';
|
||||||
|
@@ -30,6 +30,7 @@ import {
|
|||||||
TokenByAddress,
|
TokenByAddress,
|
||||||
} from 'ts/types';
|
} from 'ts/types';
|
||||||
import { colors } from 'ts/utils/colors';
|
import { colors } from 'ts/utils/colors';
|
||||||
|
import { constants } from 'ts/utils/constants';
|
||||||
import { errorReporter } from 'ts/utils/error_reporter';
|
import { errorReporter } from 'ts/utils/error_reporter';
|
||||||
import { utils } from 'ts/utils/utils';
|
import { utils } from 'ts/utils/utils';
|
||||||
|
|
||||||
@@ -262,10 +263,12 @@ export class GenerateOrderForm extends React.Component<GenerateOrderFormProps, G
|
|||||||
) {
|
) {
|
||||||
const didSignSuccessfully = await this._signTransactionAsync();
|
const didSignSuccessfully = await this._signTransactionAsync();
|
||||||
if (didSignSuccessfully) {
|
if (didSignSuccessfully) {
|
||||||
|
const networkName = constants.NETWORK_NAME_BY_ID[this.props.networkId];
|
||||||
|
const eventLabel = `${this.props.tokenByAddress[debitToken.address].symbol}-${networkName}`;
|
||||||
ReactGA.event({
|
ReactGA.event({
|
||||||
category: 'Portal',
|
category: 'Portal',
|
||||||
action: 'Sign Order Success',
|
action: 'Sign Order Success',
|
||||||
label: this.props.tokenByAddress[debitToken.address].symbol,
|
label: eventLabel,
|
||||||
value: debitToken.amount.toNumber(),
|
value: debitToken.amount.toNumber(),
|
||||||
});
|
});
|
||||||
this.setState({
|
this.setState({
|
||||||
|
@@ -6,12 +6,14 @@ import * as ReactGA from 'react-ga';
|
|||||||
import { Blockchain } from 'ts/blockchain';
|
import { Blockchain } from 'ts/blockchain';
|
||||||
import { Dispatcher } from 'ts/redux/dispatcher';
|
import { Dispatcher } from 'ts/redux/dispatcher';
|
||||||
import { BalanceErrs, Token, TokenState } from 'ts/types';
|
import { BalanceErrs, Token, TokenState } from 'ts/types';
|
||||||
|
import { constants } from 'ts/utils/constants';
|
||||||
import { errorReporter } from 'ts/utils/error_reporter';
|
import { errorReporter } from 'ts/utils/error_reporter';
|
||||||
import { utils } from 'ts/utils/utils';
|
import { utils } from 'ts/utils/utils';
|
||||||
|
|
||||||
const DEFAULT_ALLOWANCE_AMOUNT_IN_BASE_UNITS = new BigNumber(2).pow(256).minus(1);
|
const DEFAULT_ALLOWANCE_AMOUNT_IN_BASE_UNITS = new BigNumber(2).pow(256).minus(1);
|
||||||
|
|
||||||
interface AllowanceToggleProps {
|
interface AllowanceToggleProps {
|
||||||
|
networkId: number;
|
||||||
blockchain: Blockchain;
|
blockchain: Blockchain;
|
||||||
dispatcher: Dispatcher;
|
dispatcher: Dispatcher;
|
||||||
onErrorOccurred: (errType: BalanceErrs) => void;
|
onErrorOccurred: (errType: BalanceErrs) => void;
|
||||||
@@ -74,12 +76,14 @@ export class AllowanceToggle extends React.Component<AllowanceToggleProps, Allow
|
|||||||
if (!this._isAllowanceSet()) {
|
if (!this._isAllowanceSet()) {
|
||||||
newAllowanceAmountInBaseUnits = DEFAULT_ALLOWANCE_AMOUNT_IN_BASE_UNITS;
|
newAllowanceAmountInBaseUnits = DEFAULT_ALLOWANCE_AMOUNT_IN_BASE_UNITS;
|
||||||
}
|
}
|
||||||
|
const networkName = constants.NETWORK_NAME_BY_ID[this.props.networkId];
|
||||||
|
const eventLabel = `${this.props.token.symbol}-${networkName}`;
|
||||||
try {
|
try {
|
||||||
await this.props.blockchain.setProxyAllowanceAsync(this.props.token, newAllowanceAmountInBaseUnits);
|
await this.props.blockchain.setProxyAllowanceAsync(this.props.token, newAllowanceAmountInBaseUnits);
|
||||||
ReactGA.event({
|
ReactGA.event({
|
||||||
category: 'Portal',
|
category: 'Portal',
|
||||||
action: 'Set Allowance Success',
|
action: 'Set Allowance Success',
|
||||||
label: this.props.token.symbol,
|
label: eventLabel,
|
||||||
value: newAllowanceAmountInBaseUnits.toNumber(),
|
value: newAllowanceAmountInBaseUnits.toNumber(),
|
||||||
});
|
});
|
||||||
await this.props.refetchTokenStateAsync();
|
await this.props.refetchTokenStateAsync();
|
||||||
@@ -87,7 +91,7 @@ export class AllowanceToggle extends React.Component<AllowanceToggleProps, Allow
|
|||||||
ReactGA.event({
|
ReactGA.event({
|
||||||
category: 'Portal',
|
category: 'Portal',
|
||||||
action: 'Set Allowance Failure',
|
action: 'Set Allowance Failure',
|
||||||
label: this.props.token.symbol,
|
label: eventLabel,
|
||||||
value: newAllowanceAmountInBaseUnits.toNumber(),
|
value: newAllowanceAmountInBaseUnits.toNumber(),
|
||||||
});
|
});
|
||||||
this.setState({
|
this.setState({
|
||||||
|
@@ -392,6 +392,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
|
|||||||
</TableRowColumn>
|
</TableRowColumn>
|
||||||
<TableRowColumn>
|
<TableRowColumn>
|
||||||
<AllowanceToggle
|
<AllowanceToggle
|
||||||
|
networkId={this.props.networkId}
|
||||||
blockchain={this.props.blockchain}
|
blockchain={this.props.blockchain}
|
||||||
dispatcher={this.props.dispatcher}
|
dispatcher={this.props.dispatcher}
|
||||||
token={token}
|
token={token}
|
||||||
|
Reference in New Issue
Block a user