Skip to content

Commit

Permalink
Minor UI Fixes (#630)
Browse files Browse the repository at this point in the history
- Sets whitespace to nowrap  for create peer/mirror buttons
- Prevents drop modals from disappearing when clicking outside
- For multi-mirror shows a single flow now
- Sets snapshot parallel tables default to 4
  • Loading branch information
Amogh-Bharadwaj authored Nov 9, 2023
1 parent 319cde6 commit 4ea1647
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 7 deletions.
6 changes: 3 additions & 3 deletions ui/app/mirrors/create/helpers/cdc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ export const cdcSettings: MirrorSetting[] = [
stateHandler: (value, setter) =>
setter((curr: CDCConfig) => ({
...curr,
snapshotNumTablesInParallel: parseInt(value as string, 10) || 1,
snapshotNumTablesInParallel: parseInt(value as string, 10) || 4,
})),
tips: 'Specify the number of tables to sync perform initial load for, in parallel. The default value is 1.',
default: '1',
tips: 'Specify the number of tables to sync perform initial load for, in parallel. The default value is 4.',
default: '4',
type: 'number',
},
{
Expand Down
9 changes: 8 additions & 1 deletion ui/app/mirrors/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const stringifyConfig = (flowArray: any[]) => {

export default async function Mirrors() {
let mirrors = await prisma.flows.findMany({
distinct: 'name',
include: {
sourcePeer: true,
destinationPeer: true,
Expand Down Expand Up @@ -78,7 +79,13 @@ export default async function Mirrors() {
href={'/mirrors/create'}
variant='normalSolid'
>
<div style={{ display: 'flex', alignItems: 'center' }}>
<div
style={{
display: 'flex',
alignItems: 'center',
whiteSpace: 'nowrap',
}}
>
<Icon name='add' /> <Label>New mirror</Label>
</div>
</Button>
Expand Down
13 changes: 11 additions & 2 deletions ui/app/peers/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,17 @@ export default async function Peers() {
href={'/peers/create'}
variant='normalSolid'
>
<div style={{ display: 'flex', alignItems: 'center' }}>
<Icon name='add' /> <Label>New peer</Label>
<div
style={{
display: 'flex',
alignItems: 'center',
whiteSpace: 'nowrap',
}}
>
<Icon name='add' />
<Label style={{ marginLeft: '0.5rem', fontSize: 15 }}>
New peer
</Label>
</div>
</Button>
}
Expand Down
7 changes: 6 additions & 1 deletion ui/lib/Dialog/Dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ export function Dialog({
<RadixDialog.Root {...rootProps}>
<RadixDialog.Trigger asChild>{TriggerButton}</RadixDialog.Trigger>
<RadixDialog.Portal>
<DialogContent size={size}>{children}</DialogContent>
<DialogContent
onPointerDownOutside={(e) => e.preventDefault()}
size={size}
>
{children}
</DialogContent>
</RadixDialog.Portal>
</RadixDialog.Root>
);
Expand Down

0 comments on commit 4ea1647

Please sign in to comment.