Skip to content

Commit

Permalink
sort tables, spinner for button
Browse files Browse the repository at this point in the history
  • Loading branch information
Amogh-Bharadwaj committed Jan 4, 2024
1 parent d155028 commit a35d007
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
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 a35d007

Please sign in to comment.