Commit 74b2d92d authored by Jose Vargas's avatar Jose Vargas

Update job log getters logic

parent a9b391ff
import { isEmpty, isString } from 'lodash';
import { isScrolledToBottom } from '~/lib/utils/scroll_utils';
export const headerTime = (state) => (state.job.started ? state.job.started : state.job.created_at);
export const headerTime = (state) => state.job.started ?? state.job.created_at;
export const hasForwardDeploymentFailure = (state) =>
state?.job?.failure_reason === 'forward_deployment_failure';
......@@ -28,11 +28,9 @@ export const hasEnvironment = (state) => !isEmpty(state.job.deployment_status);
export const hasTrace = (state) =>
state.job.has_trace || (!isEmpty(state.job.status) && state.job.status.group === 'running');
export const emptyStateIllustration = (state) =>
(state.job && state.job.status && state.job.status.illustration) || {};
export const emptyStateIllustration = (state) => state?.job?.status?.illustration || {};
export const emptyStateAction = (state) =>
(state.job && state.job.status && state.job.status.action) || null;
export const emptyStateAction = (state) => state?.job?.status?.action || null;
/**
* Shared runners limit is only rendered when
......@@ -48,4 +46,4 @@ export const shouldRenderSharedRunnerLimitWarning = (state) =>
export const isScrollingDown = (state) => isScrolledToBottom() && !state.isTraceComplete;
export const hasRunnersForProject = (state) =>
state.job.runners.available && !state.job.runners.online;
state?.job?.runners?.available && !state?.job?.runners?.online;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment