Skip to content

Commit

Permalink
fix(frontend): add transaction definition option in run card (#1865)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgeepc committed Jan 23, 2023
1 parent 9a4d476 commit 1be68c2
Showing 1 changed file with 3 additions and 25 deletions.
28 changes: 3 additions & 25 deletions web/src/components/RunCard/TransactionRunCard.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import {Dropdown, Menu, Tooltip} from 'antd';
import {Tooltip} from 'antd';
import {Link} from 'react-router-dom';

import TestState from 'components/TestState';
import TransactionRunActionsMenu from 'components/TransactionRunActionsMenu';
import {TestState as TestStateEnum} from 'constants/TestRun.constants';
import useDeleteResourceRun from 'hooks/useDeleteResourceRun';
import {ResourceType} from 'types/Resource.type';
import {TTestRun} from 'types/TestRun.types';
import {TTransactionRun} from 'types/TransactionRun.types';
import Date from 'utils/Date';
Expand All @@ -27,7 +26,6 @@ function getIcon(state: TTestRun['state']) {
}

const TransactionRunCard = ({run: {id: runId, createdAt, state, metadata, version}, transactionId, linkTo}: IProps) => {
const onDelete = useDeleteResourceRun({id: transactionId, type: ResourceType.Transaction});
const metadataName = metadata?.name;
const metadataBuildNumber = metadata?.buildNumber;
const metadataBranch = metadata?.branch;
Expand Down Expand Up @@ -65,27 +63,7 @@ const TransactionRunCard = ({run: {id: runId, createdAt, state, metadata, versio
)}

<div>
<span className="ant-dropdown-link" onClick={e => e.stopPropagation()} style={{textAlign: 'right'}}>
<Dropdown
overlay={
<Menu>
<Menu.Item
onClick={({domEvent}) => {
domEvent.stopPropagation();
onDelete(runId);
}}
key="delete"
>
Delete
</Menu.Item>
</Menu>
}
placement="bottomLeft"
trigger={['click']}
>
<S.ActionButton />
</Dropdown>
</span>
<TransactionRunActionsMenu runId={runId} transactionId={transactionId} transactionVersion={version} />
</div>
</S.Container>
</Link>
Expand Down

0 comments on commit 1be68c2

Please sign in to comment.