Skip to content

Commit

Permalink
ZKUI-121: Increase the height for workflow table
Browse files Browse the repository at this point in the history
  • Loading branch information
ChengYanJin committed Mar 30, 2022
1 parent 5592508 commit a8f703a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
19 changes: 9 additions & 10 deletions src/react/databrowser/buckets/details/Workflow.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useHistory } from 'react-router';
import { useDispatch, useSelector } from 'react-redux';
import { useSelector } from 'react-redux';
import styled from 'styled-components';
import Table from '@scality/core-ui/dist/components/tablev2/Tablev2.component';
import { Button } from '@scality/core-ui/dist/next';
Expand All @@ -11,7 +11,6 @@ import { AppState } from '../../../../types/state';
import { makeWorkflows } from '../../../queries';
import { APIWorkflows } from '../../../../types/workflow';
import { NameLinkContaner } from '../../../ui-elements/NameLink';
import { push } from 'connected-react-router';

const TableAction = styled.div`
display: flex;
Expand All @@ -21,7 +20,6 @@ const TableAction = styled.div`

function Workflow({ bucketName }: { bucketName: string }) {
const history = useHistory();
const dispatch = useDispatch();
const accountName = useSelector(
(state: AppState) =>
state.auth.selectedAccount && state.auth.selectedAccount.userName,
Expand All @@ -34,9 +32,7 @@ function Workflow({ bucketName }: { bucketName: string }) {
const workflowName = value.value;
return (
<NameLinkContaner
onClick={() =>
dispatch(push(`/accounts/${accountName}/workflows/${id}`))
}
onClick={() => history.push(`/accounts/${accountName}/workflows/${id}`)}
>
{workflowName}
</NameLinkContaner>
Expand All @@ -47,7 +43,7 @@ function Workflow({ bucketName }: { bucketName: string }) {
Header: 'Rule name',
accessor: 'name',
cellStyle: {
minWidth: '18rem',
minWidth: '19rem',
},
Cell: (value) => nameCell(value),
},
Expand Down Expand Up @@ -97,18 +93,21 @@ function Workflow({ bucketName }: { bucketName: string }) {
</TableAction>

<Table.SingleSelectableContent
rowHeight="h40"
rowHeight="h48"
separationLineVariant="backgroundLevel2"
backgroundVariant="backgroundLevel4"
>
{(Rows) => (
<>
{status === 'loading' || status === 'idle'
? 'Loading workflow...'
? 'Loading rules...'
: ''}
{status === 'error'
? 'We failed to retrieve workflows, please retry later. If the error persists, please contact your support.'
? 'We failed to retrieve rules, please retry later. If the error persists, please contact your support.'
: ''}
{status === 'success' &&
!data?.length &&
'No rules found on this bucket.'}
{status === 'success' ? <Rows /> : ''}
</>
)}
Expand Down
1 change: 0 additions & 1 deletion src/react/ui-elements/Tabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ export const CustomTabs = styled(Tabs)`
flex: 1;
.sc-tabs-item-content {
padding: ${spacing.sp16};
overflow-y: auto;
}
`;
2 changes: 1 addition & 1 deletion src/react/workflow/WorkflowList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ function WorkflowList({ workflows, workflowId }: Props) {
</TableHeader>
</div>
<Table.SingleSelectableContent
rowHeight="h40"
rowHeight="h64"
separationLineVariant="backgroundLevel1"
backgroundVariant="backgroundLevel3"
selectedId={workflowId}
Expand Down

0 comments on commit a8f703a

Please sign in to comment.