Skip to content

Commit

Permalink
Minor UI improvements (#757)
Browse files Browse the repository at this point in the history
Fixes #751
  • Loading branch information
Amogh-Bharadwaj authored Dec 5, 2023
1 parent 11197a0 commit cd60e3f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
1 change: 1 addition & 0 deletions ui/app/mirrors/create/cdc/schemabox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ const SchemaBox = ({
}
action={
<Checkbox
style={{ cursor: 'pointer' }}
disabled={isPkey}
checked={
!row.exclude.find(
Expand Down
19 changes: 11 additions & 8 deletions ui/app/mirrors/create/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,17 @@ export const qrepSchema = z.object({
})
.max(255, 'Staging path must be less than 255 characters')
.optional(),
writeMode: z.object({
writeType: z
.number({ required_error: 'Write type is required' })
.int()
.min(0)
.max(2),
upsert_key_columns: z.array(z.string()).optional(),
}),
writeMode: z.object(
{
writeType: z
.number({ required_error: 'Write type is required' })
.int()
.min(0)
.max(2),
upsert_key_columns: z.array(z.string()).optional(),
},
{ required_error: 'Write mode is required' }
),
waitBetweenBatchesSeconds: z
.number({
invalid_type_error: 'Batch wait must be a number',
Expand Down
10 changes: 5 additions & 5 deletions ui/app/mirrors/edit/[mirrorId]/configValues.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { FlowConnectionConfigs, QRepSyncMode } from '@/grpc_generated/flow';

const syncModeToLabel = (mode: QRepSyncMode) => {
switch (mode) {
case QRepSyncMode.QREP_SYNC_MODE_STORAGE_AVRO:
switch (mode.toString()) {
case 'QREP_SYNC_MODE_STORAGE_AVRO':
return 'AVRO';
case QRepSyncMode.QREP_SYNC_MODE_MULTI_INSERT:
case 'QREP_SYNC_MODE_MULTI_INSERT':
return 'Copy with Binary';
default:
return 'AVRO';
Expand All @@ -29,11 +29,11 @@ const MirrorValues = (mirrorConfig: FlowConnectionConfigs | undefined) => {
label: 'Snapshot Parallel Tables',
},
{
value: `${syncModeToLabel(mirrorConfig?.cdcSyncMode!)} mode`,
value: `${syncModeToLabel(mirrorConfig?.cdcSyncMode!)}`,
label: 'CDC Sync Mode',
},
{
value: `${syncModeToLabel(mirrorConfig?.snapshotSyncMode!)} mode`,
value: `${syncModeToLabel(mirrorConfig?.snapshotSyncMode!)}`,
label: 'Snapshot Sync Mode',
},
{
Expand Down

0 comments on commit cd60e3f

Please sign in to comment.