Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions webpack/JobInvocationDetail/JobInvocationConstants.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export const STATUS = {
SUCCEEDED: 'succeeded',
FAILED: 'failed',
CANCELLED: 'cancelled',
RUNNING: 'running',
};

export const STATUS_UPPERCASE = {
Expand Down
12 changes: 7 additions & 5 deletions webpack/JobInvocationDetail/JobInvocationToolbarButtons.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ const JobInvocationToolbarButtons = ({ jobId, data }) => {
);
}, [jobId, reportTemplateJobId, templateInputId]);

const isCreateReportDisabled =
!canGenerateReportTemplates ||
task?.state === STATUS.RUNNING ||
task?.state === STATUS.PENDING ||
reportHref === undefined;

const onActionFocus = useCallback(() => {
const element = document.getElementById(
`toggle-split-button-action-primary-${jobId}`
Expand Down Expand Up @@ -280,11 +286,7 @@ const JobInvocationToolbarButtons = ({ jobId, data }) => {
className="button-create-report"
href={reportHref}
variant="secondary"
isDisabled={
!canGenerateReportTemplates ||
task?.state === STATUS.PENDING ||
reportHref === undefined
}
isDisabled={isCreateReportDisabled}
>
{__(`Create report`)}
</Button>
Expand Down
Loading
Loading