Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
static [Types.SUBMITTED](state, action) {
let forms = { ...state }
const { formId, data } = action
const form = forms[formId]
if (form) {
form.fetching = false
if (data.Success) {
analytics.event('contact', 'submitted')
form.submitted = true
form.valid = true
form.error = null
} else {
// Error has occured
form.submitted = false
form.valid = false
form.error = {
fields: data.FieldErrors,
ErrorText: data.ErrorText,
}
}
} else {
console.error('Redux (forms): Unknown formId')
}
return { ...state, ...forms }
doLogLastActivation = function() {
// cleanup
doLogLastActivation = null;
clearTimeout(doLogLastActivationTimeout);
// log the previous event
var timeSpentMs = Date.now() - scenarioHitMs;
analytics.event(analytics.E.SCROLL_SPY.ID, analytics.E.SCROLL_SPY.SCENARIO_DURATION, scenario, timeSpentMs);
// queue up a watchdog
doLogLastActivationTimeout = setTimeout(doLogLastActivation, 6 * 60 * 1000);
};
}
mapNavItem.click(function() {
var showMapping = !Preferences.get("showMapping");
analytics.event( "Show Mapping", {
label: showMapping ? "Enabled" : "Disabled"
});
Preferences.set("showMapping", showMapping);
Preferences.save();
});
switchToPercentage() {
analytics.event(
analytics.E.ROUND_CHART_BUTTON.ID,
analytics.E.ROUND_CHART_BUTTON.PERCENTAGE_VIEW,
SCROLLSPY_PROPS.id
);
actions.chart.selectMeasure('percentages');
},
.on('slideStop', function(slideEndValue) {
analytics.event(
analytics.E.SLIDER.ID,
analytics.E.SLIDER.SLIDE_STOP,
SCROLLSPY_PROPS.id,
Date.now() - slideStartMs,
{
startValue: slideStartValue,
endValue: slideEndValue
}
);
});
},
.on('slideStop', function(slideEndValue) {
analytics.event(
analytics.E.SLIDER.ID,
analytics.E.SLIDER.SLIDE_STOP,
SCROLLSPY_PROPS.id,
Date.now() - slideStartMs,
{
startValue: slideStartValue,
endValue: slideEndValue
}
);
});
},
redo.click(function() {
analytics.event("Redo");
codeMirror.redo();
refreshButtons();
});
codeMirror.on("change", refreshButtons);
switchToPercentages() {
analytics.event(
analytics.E.ROUND_CHART_BUTTON.ID,
analytics.E.ROUND_CHART_BUTTON.PERCENTAGE_VIEW,
SCROLLSPY_PROPS.id
);
actions.chart.selectMeasure('percentages');
},
switchToPercentage() {
analytics.event(
analytics.E.ROUND_CHART_BUTTON.ID,
analytics.E.ROUND_CHART_BUTTON.PERCENTAGE_VIEW,
SCROLLSPY_PROPS.id
);
actions.chart.selectMeasure('percentages');
},