gitlab-org--gitlab-foss/app/assets/javascripts/jobs/store/state.js

35 lines
700 B
JavaScript
Raw Normal View History

import { isNewJobLogActive } from '../store/utils';
2018-09-03 03:49:52 -04:00
export default () => ({
jobEndpoint: null,
traceEndpoint: null,
// sidebar
isSidebarOpen: true,
2018-09-03 03:49:52 -04:00
isLoading: false,
hasError: false,
job: {},
// scroll buttons state
isScrollBottomDisabled: true,
isScrollTopDisabled: true,
2018-09-03 03:49:52 -04:00
// Used to check if we should keep the automatic scroll
isScrolledToBottomBeforeReceivingTrace: true,
2018-09-03 03:49:52 -04:00
trace: isNewJobLogActive() ? [] : '',
2018-09-03 03:49:52 -04:00
isTraceComplete: false,
traceSize: 0,
2018-09-03 03:49:52 -04:00
isTraceSizeVisible: false,
// used as a query parameter to fetch the trace
2018-09-03 03:49:52 -04:00
traceState: null,
// sidebar dropdown & list of jobs
2018-09-03 03:49:52 -04:00
isLoadingJobs: false,
selectedStage: '',
2018-09-03 03:49:52 -04:00
stages: [],
jobs: [],
});