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
32 changes: 18 additions & 14 deletions src/Routes/Tables/Jobs/DownloadFlowinput.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import IDProvider from 'IDProvider';
import { Button, Alert } from 'antd';
import { useSelector } from 'react-redux';
import { selectors } from 'reducers';
Expand All @@ -11,20 +12,23 @@ const DownloadFlowinput = ({ keyValue }) => {
const { backendApiUrl } = useSelector(selectors.config);
return (
<LinkDownload>
<Button
onClick={() =>
fetchDownload(
`${backendApiUrl}/api/v1/exec/flowInput/${keyValue}?download=true`
)
}
type="link"
size="small">
<Alert
title="Click here to download flowInput"
type="info"
showIcon
/>{' '}
</Button>
<IDProvider dataTestId="jobs-download-flow-input">
<Button
onClick={() =>
fetchDownload(
`${backendApiUrl}/api/v1/exec/flowInput/${keyValue}?download=true`
)
}
type="link"
size="small"
>
<Alert
title="Click here to download flowInput"
type="info"
showIcon
/>{' '}
</Button>
</IDProvider>
</LinkDownload>
);
};
Expand Down
49 changes: 28 additions & 21 deletions src/Routes/Tables/Jobs/GraphTab/Details.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import PropTypes from 'prop-types';
import styled from 'styled-components';
import { BugOutlined, PlayCircleOutlined } from '@ant-design/icons';
import { Button, Empty, Tooltip } from 'antd';
import IDProvider from 'IDProvider';
import { FlexBox, JsonSwitch } from 'components/common';
import { useActions } from 'hooks';
import { useAlgorithmByVersion } from 'hooks/graphql';
Expand Down Expand Up @@ -73,22 +74,26 @@ const Details = ({ node, jobId, isDisabledBtnRunDebug = false }) => {
const extra = node ? (
<FlexBox.Auto>
<Tooltip title={`Run from node ${node.nodeName}`}>
<Button
key="run-node"
variant="outlined"
onClick={onRunNode}
icon={<PlayCircleOutlined />}
disabled={isDisabledBtnRunDebug}
/>
<IDProvider dataTestId="jobs-run-node" testIdSuffix={node.nodeName}>
<Button
key="run-node"
variant="outlined"
onClick={onRunNode}
icon={<PlayCircleOutlined />}
disabled={isDisabledBtnRunDebug}
/>
</IDProvider>
</Tooltip>
<Tooltip title={`Debug from node ${node.nodeName}`}>
<Button
key="debug-node"
variant="outlined"
onClick={onDebugNode}
icon={<BugOutlined />}
disabled={isDisabledBtnRunDebug}
/>
<IDProvider dataTestId="jobs-debug-node" testIdSuffix={node.nodeName}>
<Button
key="debug-node"
variant="outlined"
onClick={onDebugNode}
icon={<BugOutlined />}
disabled={isDisabledBtnRunDebug}
/>
</IDProvider>
</Tooltip>
</FlexBox.Auto>
) : null;
Expand Down Expand Up @@ -180,13 +185,15 @@ const Details = ({ node, jobId, isDisabledBtnRunDebug = false }) => {

return node ? (
<ContainerTabs>
<TabsLog
activeKey={selectTabbyKind}
onChange={handleTabChange}
items={TabsItemsJson}
defaultActiveKey={selectTabbyKind}
tabBarExtraContent={extra}
/>
<IDProvider dataTestId="jobs-node-details-tabs">
<TabsLog
activeKey={selectTabbyKind}
onChange={handleTabChange}
items={TabsItemsJson}
defaultActiveKey={selectTabbyKind}
tabBarExtraContent={extra}
/>
</IDProvider>
</ContainerTabs>
) : (
<Empty />
Expand Down
21 changes: 12 additions & 9 deletions src/Routes/Tables/Jobs/GraphTab/NodeInputOutput/DropdownNodes.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useEffect, useMemo } from 'react';
import { Select } from 'antd';
import IDProvider from 'IDProvider';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import { TitleStatus } from './getColumns';
Expand Down Expand Up @@ -93,15 +94,17 @@ const DropDownNodes = ({ nodes, selectNode, setSelectNode }) => {

return (
<BgStyle>
<DropdownStyle
onChange={onClickSelectNode}
value={selectNode[0]}
showSearch
options={items}
filterOption={filterOption}
listHeight={700}
virtual={false}
/>
<IDProvider dataTestId="jobs-node-selector">
<DropdownStyle
onChange={onClickSelectNode}
value={selectNode[0]}
showSearch
options={items}
filterOption={filterOption}
listHeight={700}
virtual={false}
/>
</IDProvider>
</BgStyle>
);
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useMemo, useState } from 'react';
import { Button, Checkbox, Space } from 'antd';
import IDProvider from 'IDProvider';
import { FilterOutlined } from '@ant-design/icons';
import BaseTag from 'components/BaseTag';
import { COLOR_TASK_STATUS } from 'styles/colors';
Expand Down Expand Up @@ -31,50 +32,60 @@ const FilterByStatusTable = ({
let numberfilterShow = 0;
return (
<Space>
<Button
type="primary"
onClick={() => onChange([])}
disabled={checkedValues.length === 0}
style={{
border: 0,
paddingLeft: '7px',
paddingRight: '7px',
background:
checkedValues.length === 0
? ''
: 'linear-gradient(to right,rgba(69,146,255,1) 0%,rgba(69,146,255,1) 28%, rgba(22,119,255,1)20%, rgba(22,119,255,1) 100%)',
}}>
<FilterOutlined /> Clear All
</Button>
<IDProvider dataTestId="jobs-clear-task-status-filters">
<Button
type="primary"
onClick={() => onChange([])}
disabled={checkedValues.length === 0}
style={{
border: 0,
paddingLeft: '7px',
paddingRight: '7px',
background:
checkedValues.length === 0
? ''
: 'linear-gradient(to right,rgba(69,146,255,1) 0%,rgba(69,146,255,1) 28%, rgba(22,119,255,1)20%, rgba(22,119,255,1) 100%)',
}}
>
<FilterOutlined /> Clear All
</Button>
</IDProvider>

{optionsWithCustomStyle.map(option => {
StatusCount[option.value] && numberfilterShow++;
return (
StatusCount[option.value] && (
<Checkbox
<IDProvider
key={option.value}
onChange={() => {
const currentIndex = checkedValues.indexOf(option.value);
const newChecked = [...checkedValues];
dataTestId="jobs-task-status-filter"
testIdSuffix={option.value}
>
<Checkbox
onChange={() => {
const currentIndex = checkedValues.indexOf(option.value);
const newChecked = [...checkedValues];

if (currentIndex === -1) {
newChecked.push(option.value);
} else {
newChecked.splice(currentIndex, 1);
}
if (currentIndex === -1) {
newChecked.push(option.value);
} else {
newChecked.splice(currentIndex, 1);
}

onChange(newChecked);
}}
checked={checkedValues.includes(option.value)}>
<BaseTag
isActiveLoader={false}
isError={!!DataTask?.error}
status={option.label}
colorMap={COLOR_TASK_STATUS}>
{StatusCount[option.value]}{' '}
{numberfilterShow <= 4 ? option.label : ''}
</BaseTag>
</Checkbox>
onChange(newChecked);
}}
checked={checkedValues.includes(option.value)}
>
<BaseTag
isActiveLoader={false}
isError={!!DataTask?.error}
status={option.label}
colorMap={COLOR_TASK_STATUS}
>
{StatusCount[option.value]}{' '}
{numberfilterShow <= 4 ? option.label : ''}
</BaseTag>
</Checkbox>
</IDProvider>
)
);
})}
Expand Down
39 changes: 23 additions & 16 deletions src/Routes/Tables/Jobs/GraphTab/NodeInputOutput/getColumns.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* eslint-disable react/destructuring-assignment */
/* eslint-disable jsx-a11y/control-has-associated-label */
import React, { useMemo } from 'react';
import IDProvider from 'IDProvider';
import dayjs from 'dayjs';
import { Ellipsis } from 'components/common';
import PropTypes from 'prop-types';
Expand Down Expand Up @@ -48,7 +49,8 @@ export const TitleStatus = (
: TASK_STATUS.FAILED_SCHEDULING
}
colorMap={COLOR_TASK_STATUS}
title={TASK_STATUS[keyStatus.toUpperCase()]}>
title={TASK_STATUS[keyStatus.toUpperCase()]}
>
{record[keyStatus]}
</BaseTag>
)
Expand Down Expand Up @@ -102,21 +104,26 @@ const Results = ({ record, url = null, algorithmName = '' }) => {

return (
<Tooltip placement="top" title="Download Results">
<Button
type="default"
disabled={!record.output}
shape="circle"
icon={<DownloadOutlined />}
onClick={() =>
fetchDownload(
`${url ?? ''}/storage/download/custom/${
record.output && record.output.path
}?ext=${record.downloadFileExt || ''}&namefile=${
downloadNameFile || ''
}`
)
}
/>
<IDProvider
dataTestId="jobs-download-node-results"
testIdSuffix={record.taskId}
>
<Button
type="default"
disabled={!record.output}
shape="circle"
icon={<DownloadOutlined />}
onClick={() =>
fetchDownload(
`${url ?? ''}/storage/download/custom/${
record.output && record.output.path
}?ext=${record.downloadFileExt || ''}&namefile=${
downloadNameFile || ''
}`
)
}
/>
</IDProvider>
</Tooltip>
);
};
Expand Down
21 changes: 13 additions & 8 deletions src/Routes/Tables/Jobs/GraphTab/NodeInputOutput/index.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import PropTypes from 'prop-types';
import IDProvider from 'IDProvider';
import { taskStatuses as TASK_STATUS } from '@hkube/consts';
import { removeNullUndefinedCleanDeep } from 'utils';
import React, { useCallback, useEffect, useMemo, useState } from 'react';
Expand Down Expand Up @@ -133,15 +134,19 @@ const NodeInputOutput = ({

const expandIcon = ({ expanded, onExpand, record }) =>
expanded ? (
<DownOutlined
onClick={e => onExpand(record, e)}
data-testid="versions-table-expandable"
/>
<IDProvider
dataTestId="jobs-collapse-task-details"
testIdSuffix={record.taskId}
>
<DownOutlined onClick={e => onExpand(record, e)} />
</IDProvider>
) : (
<RightOutlined
onClick={e => onExpand(record, e)}
data-testid="versions-table-expandable"
/>
<IDProvider
dataTestId="jobs-expand-task-details"
testIdSuffix={record.taskId}
>
<RightOutlined onClick={e => onExpand(record, e)} />
</IDProvider>
);

return (
Expand Down
Loading
Loading