Skip to content

Commit

Permalink
feat: job control finished
Browse files Browse the repository at this point in the history
fix: added header

fix: remove info circle
  • Loading branch information
pbullhove committed Mar 11, 2024
1 parent 71e5063 commit f09b16f
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/dm-core-plugins/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export default ({
},
'@development-framework/dm-core-plugins/job': {
component: lazy(() =>
import('./job/JobControl').then((module) => ({
import('./job/JobControl/JobControl').then((module) => ({
default: module.JobControl,
}))
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,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'
Expand All @@ -33,8 +39,8 @@ import {
getVariant,
parseCronStringToCronValues,
parseCronValuesToCronString,
} from './common'
import { defaultCronValues, scheduleTemplate } from './templateEntities'
} from '../common'
import { defaultCronValues, scheduleTemplate } from '../templateEntities'

type TJobControlConfig = {
hideLogs?: boolean
Expand Down Expand Up @@ -168,8 +174,11 @@ export const JobControl = (props: IUIPlugin) => {

return (
<div className='dm-plugin-padding'>
<div className='flex-col border rounded-md bg-equinor-lightgray'>
<div className='p-2'>
<div className='flex-col border rounded-md bg-equinor-lightgray w-20'>
<div className='ps-2 pb-2'>
<div className='border-b flex justify-between items-center p-2'>
<Typography bold>Job Control</Typography>
</div>
{asCronJob && (
<div className='rounded-md p-2 bg-white border'>
<ConfigureRecurring
Expand All @@ -193,14 +202,20 @@ export const JobControl = (props: IUIPlugin) => {
</div>
)}
<JobButtonWrapper>
{getControlButton(status, remove, start, false, jobIsLoading)}
{!internalConfig.hideLogs && <JobLog logs={logs} error={error} />}
<Chip variant={getVariant(status)} data-testid={'jobStatus'}>
{status ?? 'Not registered'}
</Chip>
<div className='flex items-center'>
{getControlButton(status, remove, start, false, jobIsLoading)}
<div>
<p style={{ fontSize: '12px' }}>Status: </p>
<Chip variant={getVariant(status)} data-testid={'jobStatus'}>
{status ?? 'Not registered'}
</Chip>
</div>
{!internalConfig.hideLogs && <JobLog logs={logs} error={error} />}
</div>

{internalConfig.runnerTemplates &&
internalConfig.runnerTemplates.length > 0 && (
<div className={'flex flex-row items-center'}>
<div className={'flex flex-row items-center justify-end'}>
<Tooltip
title={`Change runner. Current: ${(
(asCronJob
Expand Down
Empty file.
3 changes: 3 additions & 0 deletions packages/dm-core-plugins/src/job/common.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,11 @@ export const JobButtonWrapper = styled.div`
padding-top: 0.5rem;
flex-direction: row;
align-items: center;
text-align: center;
gap: 8px;
padding-inline: 0.5rem;
margin-bottom: 0.5rem;
justify-content: space-between;
min-width: max-content;
`
export const getControlButton = (
Expand Down

0 comments on commit f09b16f

Please sign in to comment.