diff --git a/packages/dm-core-plugins/src/job/JobControl/JobControl.tsx b/packages/dm-core-plugins/src/job/JobControl/JobControl.tsx index 97b09fe08..48e07ac8b 100644 --- a/packages/dm-core-plugins/src/job/JobControl/JobControl.tsx +++ b/packages/dm-core-plugins/src/job/JobControl/JobControl.tsx @@ -13,7 +13,13 @@ import { useDocument, useJob, } from '@development-framework/dm-core' -import { Button, Chip, Icon, Tooltip } from '@equinor/eds-core-react' +import { + Button, + Chip, + Icon, + Tooltip, + Typography, +} from '@equinor/eds-core-react' import { gear } from '@equinor/eds-icons' import { AxiosError } from 'axios' import _ from 'lodash' @@ -167,87 +173,91 @@ export const JobControl = (props: IUIPlugin) => { throw new Error(JSON.stringify(error || jobEntityError, null, 2)) return ( -
- {internalConfig.title &&

{config.title}

} - {asCronJob && ( -
- { - setSchedule(s) - setCronValues(parseCronStringToCronValues(s.cron)) - }} - cronValues={cronValues} - setCronValues={(c: TCronValues) => { - setSchedule({ - ...schedule, - cron: parseCronValuesToCronString(c), - }) - setCronValues(c) - }} - registered={status === JobStatus.Registered} - /> -
- )} - -
- {getControlButton(status, remove, start, false, jobIsLoading)} -
-

Status:

- - {status ?? 'Not registered'} - +
+
+ {internalConfig.title && ( + {config.title} + )} + {asCronJob && ( +
+ { + setSchedule(s) + setCronValues(parseCronStringToCronValues(s.cron)) + }} + cronValues={cronValues} + setCronValues={(c: TCronValues) => { + setSchedule({ + ...schedule, + cron: parseCronValuesToCronString(c), + }) + setCronValues(c) + }} + registered={status === JobStatus.Registered} + />
+ )} + +
+ {getControlButton(status, remove, start, false, jobIsLoading)} +
+

Status:

+ + {status ?? 'Not registered'} + +
- {!internalConfig.hideLogs && } -
- - {internalConfig.runnerTemplates && - internalConfig.runnerTemplates.length > 0 && ( -
- -
+ + {internalConfig.runnerTemplates && + internalConfig.runnerTemplates.length > 0 && ( +
+ - - - - - handleRunnerTemplateSelect(template) - } - onClose={() => setTemplateMenuIsOpen(false)} - isOpen={isTemplateMenuOpen} - title='Runner' - selected={templates.findIndex((template: TJobHandler) => - _.isEqual(template, jobEntity.runner) - )} - /> -
- )} -
- - {status === JobStatus.Running && progress !== null && ( -
- -
- )} + + + + handleRunnerTemplateSelect(template) + } + onClose={() => setTemplateMenuIsOpen(false)} + isOpen={isTemplateMenuOpen} + title='Runner' + selected={templates.findIndex((template: TJobHandler) => + _.isEqual(template, jobEntity.runner) + )} + /> +
+ )} + + + {status === JobStatus.Running && progress !== null && ( +
+ +
+ )} +
) } diff --git a/packages/dm-core-plugins/src/job/JobCreate.tsx b/packages/dm-core-plugins/src/job/JobCreate.tsx index 116d5c367..ee2487890 100644 --- a/packages/dm-core-plugins/src/job/JobCreate.tsx +++ b/packages/dm-core-plugins/src/job/JobCreate.tsx @@ -16,7 +16,13 @@ import { useDocument, useJob, } from '@development-framework/dm-core' -import { Button, Chip, Icon, Tooltip } from '@equinor/eds-core-react' +import { + Button, + Chip, + Icon, + Tooltip, + Typography, +} from '@equinor/eds-core-react' import { gear } from '@equinor/eds-icons' import { useEffect, useState } from 'react' @@ -166,75 +172,73 @@ export const JobCreate = (props: IUIPlugin & { config: TJobPluginConfig }) => { if (jobDocument.type === EBlueprint.RECURRING_JOB) setAsCronJob(true) }, [jobDocument]) return ( -
- {config.title &&

{config.title}

} - {config.recurring !== false && ( - { - setSchedule(s) - setCronValues(parseCronStringToCronValues(s.cron)) - }} - cronValues={cronValues} - setCronValues={(c: TCronValues) => { - setSchedule({ ...schedule, cron: parseCronValuesToCronString(c) }) - setCronValues(c) - }} - registered={status === JobStatus.Registered} - /> - )} - -
- {getControlButton( - status, - deregister, - createAndStartJob, - false, - jobIsLoading - )} -
-

Status:

- - {status ?? 'Not registered'} - -
- {!config.hideLogs && } -
- {config.jobTemplates.length > 1 && ( -
- - - - setSelectedTemplate(index)} - onClose={() => setTemplateMenuIsOpen(false)} - isOpen={isTemplateMenuOpen} - title='Job template' - selected={selectedTemplate} - /> +
+
+ {config.title && {config.title}} + {config.recurring !== false && ( + { + setSchedule(s) + setCronValues(parseCronStringToCronValues(s.cron)) + }} + cronValues={cronValues} + setCronValues={(c: TCronValues) => { + setSchedule({ ...schedule, cron: parseCronValuesToCronString(c) }) + setCronValues(c) + }} + registered={status === JobStatus.Registered} + /> + )} + +
+ {getControlButton( + status, + deregister, + createAndStartJob, + false, + jobIsLoading + )} +
+

Status:

+ + {status ?? 'Not registered'} + +
+ {!config.hideLogs && }
+ {config.jobTemplates.length > 1 && ( +
+ + + + setSelectedTemplate(index)} + onClose={() => setTemplateMenuIsOpen(false)} + isOpen={isTemplateMenuOpen} + title='Job template' + selected={selectedTemplate} + /> +
+ )} +
+ {status === JobStatus.Running && progress !== null && ( + )} - - {status === JobStatus.Running && progress !== null && ( - - )} +
) } diff --git a/packages/dm-core-plugins/src/job/common.tsx b/packages/dm-core-plugins/src/job/common.tsx index a10182dc8..9e5c4f90a 100644 --- a/packages/dm-core-plugins/src/job/common.tsx +++ b/packages/dm-core-plugins/src/job/common.tsx @@ -115,12 +115,8 @@ export const JobLog = (props: { } export const JobButtonWrapper = styled.div` display: flex; - padding-top: 0.5rem; flex-direction: row; align-items: center; - text-align: center; - padding-inline: 0.5rem; - margin-bottom: 0.5rem; justify-content: space-between; min-width: max-content; `