diff --git a/backend/src/database/database.module.ts b/backend/src/database/database.module.ts index 513725e0..d5ecc3a9 100644 --- a/backend/src/database/database.module.ts +++ b/backend/src/database/database.module.ts @@ -12,6 +12,13 @@ import { TypeOrmModule } from '@nestjs/typeorm'; database: configService.getOrThrow('POSTGRES_DB'), username: configService.getOrThrow('POSTGRES_USERNAME'), password: configService.getOrThrow('POSTGRES_PASSWORD'), + ...(configService.get('POSTGRES_TLS') === 'false' + ? {} + : { + ssl: { + rejectUnauthorized: false, + }, + }), autoLoadEntities: true, }), inject: [ConfigService], diff --git a/backend/src/users/util/pagination/user-pagination.config.ts b/backend/src/users/util/pagination/user-pagination.config.ts index 79c03d76..ef30e642 100644 --- a/backend/src/users/util/pagination/user-pagination.config.ts +++ b/backend/src/users/util/pagination/user-pagination.config.ts @@ -3,6 +3,6 @@ import { User } from 'src/users/entities/user.entity'; export const USER_PAGINATION_CONFIG: PaginateConfig = { sortableColumns: ['name'], - searchableColumns: ['name'], + searchableColumns: ['name', 'email'], defaultSortBy: [['name', 'ASC']], }; diff --git a/frontend/src/components/atoms/MultipleSelect.tsx b/frontend/src/components/atoms/MultipleSelect.tsx index 9f134384..b50d2ade 100644 --- a/frontend/src/components/atoms/MultipleSelect.tsx +++ b/frontend/src/components/atoms/MultipleSelect.tsx @@ -41,9 +41,12 @@ export function MultipleSelect({ required, name, dataTestId, + value = [], }: MultipleSelectProps) { const theme = useTheme(); - const [selectedValue, setSelectedValue] = React.useState([]); + const [selectedValue, setSelectedValue] = React.useState( + Array.isArray(value) ? value : [value] + ); const handleChange = (event: SelectChangeEvent) => { const { @@ -54,9 +57,9 @@ export function MultipleSelect({ onChange(event); }; - const renderValue = () => { + const renderValue = (selected: string[]) => { if (!multiple) { - if (selectedValue.length === 0) { + if (selected.length === 0) { return ( ); } - const selectedOption = items.find( - (item) => item.value === selectedValue[0] + const selectedOption = items.find((item) => item.value === selected[0]); + const label = selectedOption?.label ?? ""; + return ( + + {label.length > 50 ? `${label.substring(0, 50)}...` : label} + ); - if (selectedOption) { - return ( - - {selectedOption.label} - - ); - } } + + if (selected.length === 0) { + return ( + + {placeholder} + + ); + } + + const selectedLabels = selected + .map( + (selectedItem) => + items.find((item) => item.value === selectedItem)?.label + ) + .filter(Boolean) as string[]; + + const combinedText = selectedLabels.join(", "); return ( - - {placeholder} + + {combinedText.length > 50 + ? `${combinedText.substring(0, 50)}...` + : combinedText} ); }; return ( - +