Merge pull request #1517 from rowyio/feat/auto-fill-table-id

ROWY-2110 fix broken table id prefill for table setup
This commit is contained in:
Shams
2024-01-02 04:06:49 -08:00
committed by GitHub
2 changed files with 3 additions and 6 deletions

View File

@@ -12,7 +12,7 @@ export interface ITableNameProps extends IShortTextComponentProps {
export default function TableName({ watchedField, ...props }: ITableNameProps) {
const {
field: { onChange, value },
field: { onChange },
useFormMethods: { control },
disabled,
} = props;
@@ -25,12 +25,9 @@ export default function TableName({ watchedField, ...props }: ITableNameProps) {
if (!touched && typeof watchedValue === "string" && !!watchedValue) {
// if table name field is not touched, and watched value is valid, set table name to watched value
onChange(startCase(watchedValue));
} else if (typeof value === "string") {
// otherwise if table name is valid, set watched value to table name
onChange(startCase(value.trim()));
}
}
}, [watchedValue, disabled, onChange, value]);
}, [watchedValue, disabled]);
return <ShortTextComponent {...props} />;
}

View File

@@ -213,7 +213,7 @@ export const tableSettings = (
name: "name",
label: "Table name",
required: true,
watchedField: "name",
watchedField: "collection",
assistiveText: "User-facing name for this table",
autoFocus: true,
gridCols: { xs: 12, sm: 6 },