Skip to content

Commit

Permalink
Merge pull request #1050 from rocket-admin/backend_oracle_date_filter
Browse files Browse the repository at this point in the history
Add validation for default showing table to prevent selection and exclusion in connection properties setup
  • Loading branch information
Artuomka authored Feb 26, 2025
2 parents 7a296ff + 57f1190 commit 9a5f602
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ export async function validateCreateConnectionPropertiesDs(
errors.push(Messages.TABLE_WITH_NAME_NOT_EXISTS(hiddenTable));
}
}
if (hidden_tables.includes(default_showing_table)) {
errors.push(Messages.CANT_SHOW_TABLE_AND_EXCLUDE(default_showing_table));
}
}

if (default_showing_table && !tablesInConnection.includes(default_showing_table)) {
Expand Down
2 changes: 2 additions & 0 deletions backend/src/exceptions/text/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ export const Messages = {
'It seems like the value you entered for the unique field already exists in database. Please check your input and try again with a different value',
CANT_LIST_AND_EXCLUDE: (fieldName: string) =>
`You cannot select the same field ${fieldName ? fieldName : 'names'} to list and exclude`,
CANT_SHOW_TABLE_AND_EXCLUDE: (tableName: string) =>
`You cannot select the same table "${tableName}" to show by default and exclude`,
CANT_VIEW_AND_EXCLUDE: (fieldName: string) =>
`You cannot select the same field ${fieldName ? fieldName : 'names'} to view and exclude`,
CANT_ORDER_AND_EXCLUDE: `You cannot select the same field names to order and exclude`,
Expand Down

0 comments on commit 9a5f602

Please sign in to comment.