Skip to content

Commit

Permalink
UI: Sort tables, spinner for button (#988)
Browse files Browse the repository at this point in the history
Spinner for create mirror button and sorts tables in schema
alphabetically
  • Loading branch information
Amogh-Bharadwaj authored Jan 4, 2024
1 parent d155028 commit 2e04bb3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
1 change: 0 additions & 1 deletion flow/cmd/peer_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ func (h *FlowRequestHandler) GetColumns(
ON
kcu.constraint_name = tc.constraint_name
AND kcu.constraint_schema = tc.constraint_schema
AND kcu.constraint_name = tc.constraint_name
WHERE
tc.constraint_type = 'PRIMARY KEY'
AND kcu.table_schema = $1
Expand Down
12 changes: 7 additions & 5 deletions ui/app/mirrors/create/cdc/schemabox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,13 @@ const SchemaBox = ({

const searchedTables = useMemo(() => {
const tableQueryLower = tableQuery.toLowerCase();
return rows.filter(
(row) =>
row.schema === schema &&
row.source.toLowerCase().includes(tableQueryLower)
);
return rows
.filter(
(row) =>
row.schema === schema &&
row.source.toLowerCase().includes(tableQueryLower)
)
.sort((a, b) => a.source.localeCompare(b.source));
}, [schema, rows, tableQuery]);

const schemaIsExpanded = useCallback(
Expand Down
10 changes: 9 additions & 1 deletion ui/app/mirrors/create/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { Icon } from '@/lib/Icon';
import { Label } from '@/lib/Label';
import { RowWithSelect, RowWithTextField } from '@/lib/Layout';
import { Panel } from '@/lib/Panel';
import { ProgressCircle } from '@/lib/ProgressCircle';
import { TextField } from '@/lib/TextField';
import { Divider } from '@tremor/react';
import Image from 'next/image';
Expand Down Expand Up @@ -219,6 +220,7 @@ export default function CreateMirrors() {
fontWeight: 'bold',
}}
variant='normalSolid'
disabled={loading}
onClick={() =>
mirrorType === 'CDC'
? handleCreateCDC(
Expand All @@ -240,7 +242,13 @@ export default function CreateMirrors() {
)
}
>
<Icon name='add' /> Create Mirror
{loading ? (
<ProgressCircle variant='determinate_progress_circle' />
) : (
<>
<Icon name='add' /> Create Mirror
</>
)}
</Button>
)}
</Panel>
Expand Down

0 comments on commit 2e04bb3

Please sign in to comment.