{"size": 1398, "ext": "js", "max_stars_repo_path": "src/webui/src/js/store/modules/views/workflows/sequences/loadInterpretations.js", "max_stars_repo_name": "Dabble-of-DevOps-Bio/ella", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/webui/src/js/store/modules/views/workflows/sequences/loadInterpretations.js", "max_issues_repo_name": "Dabble-of-DevOps-Bio/ella", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/webui/src/js/store/modules/views/workflows/sequences/loadInterpretations.js", "max_forks_repo_name": "Dabble-of-DevOps-Bio/ella", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 38.8333333333, "max_line_length": 100, "alphanum_fraction": 0.6409155937}
import { sequence } from 'cerebral'
import { set } from 'cerebral/operators'
import { props, state } from 'cerebral/tags'
import toast from '../../../../common/factories/toast'
import getInterpretations from '../actions/getInterpretations'
import copyInterpretationState from '../actions/copyInterpretationState'
import prepareStartMode from '../actions/prepareStartMode'
import loadInterpretationData from '../signals/loadInterpretationData'
import selectDefaultInterpretation from '../actions/selectDefaultInterpretation'
import getFilterConfigs from '../actions/getFilterConfigs'

export default sequence('loadInterpretations', [
    set(state`views.workflows.loaded`, false),
    getFilterConfigs,
    {
        error: [
            toast('error', props`message` ? props`message` : 'Failed to load filter configs', 30000)
        ],
        success: [
            set(state`views.workflows.data.filterconfigs`, props`result`),
            getInterpretations,
            {
                error: [toast('error', 'Failed to load interpretations', 30000)],
                success: [
                    set(state`views.workflows.data.interpretations`, props`result`),
                    selectDefaultInterpretation,
                    copyInterpretationState,

                    prepareStartMode,
                    loadInterpretationData
                ]
            }
        ]
    }
])
