import { connect } from 'react-redux'; import cn from 'classnames'; import withSiteIdRouter from 'HOCs/withSiteIdRouter'; import { ErrorDetails, IconButton, Icon, Loader } from 'UI'; import { sessions as sessionsRoute } from 'App/routes'; import { TYPES as EV_FILER_TYPES } from 'Types/filter/event'; import { UNRESOLVED, RESOLVED, IGNORED } from "Types/errorInfo"; import { addEvent } from 'Duck/filters'; import { resolve,unresolve,ignore, toggleFavorite } from "Duck/errors"; import { resentOrDate } from 'App/date'; import Divider from 'Components/Errors/ui/Divider'; import ErrorName from 'Components/Errors/ui/ErrorName'; import Label from 'Components/Errors/ui/Label'; import SharePopup from 'Shared/SharePopup' import SessionBar from './SessionBar'; @withSiteIdRouter @connect(state => ({ error: state.getIn([ "errors", "instance" ]), trace: state.getIn([ "errors", "instanceTrace" ]), sourcemapUploaded: state.getIn([ "errors", "sourcemapUploaded" ]), resolveToggleLoading: state.getIn(["errors", "resolve", "loading"]) || state.getIn(["errors", "unresolve", "loading"]), ignoreLoading: state.getIn([ "errors", "ignore", "loading" ]), toggleFavoriteLoading: state.getIn([ "errors", "toggleFavorite", "loading" ]), traceLoading: state.getIn([ "errors", "fetchTrace", "loading"]), }),{ resolve, unresolve, ignore, toggleFavorite, addEvent, }) export default class MainSection extends React.PureComponent { resolve = () => { const { error } = this.props; this.props.resolve(error.errorId) } unresolve = () => { const { error } = this.props; this.props.unresolve(error.errorId) } ignore = () => { const { error } = this.props; this.props.ignore(error.errorId) } bookmark = () => { const { error } = this.props; this.props.toggleFavorite(error.errorId); } findSessions = () => { this.props.addEvent({ type: EV_FILER_TYPES.CONSOLE, value: this.props.error.message, }, true); this.props.history.push(sessionsRoute()); } render() { const { error, trace, sourcemapUploaded, ignoreLoading, resolveToggleLoading, toggleFavoriteLoading, className, traceLoading, } = this.props; return (