From 83b20d838023e0f34523ef4e9706bf27a4167a63 Mon Sep 17 00:00:00 2001 From: Milos <161627443+BEdev24@users.noreply.github.com> Date: Fri, 7 Feb 2025 11:05:00 +0100 Subject: [PATCH] develop - to staging (#539) * fix: Fixed VH button and add new member button positon * chore: small fix * feat: Changed position of the AddNewMember Button * feat/ipfs-volume * volume * feat: Changed title Latest Updates to Voting Updates * feat: Changed naming of latest updates to voting updates * fix/announce-cid-with-cronjob: Provided announcing cids with cronjob process (#528) * fix: announce cid with cronjob (#529) * fix/announce-cid-with-cronjob: Provided announcing cids with cronjob process * fix-announce-cid-with-cronjob: changed datastore to datastore-fs and added custom libp2p * fix/announce-cid-with-cronjob: resolved conflicts * fix: announce cid with cronjob (#531) * fix/announce-cid-with-cronjob: Provided announcing cids with cronjob process * fix-announce-cid-with-cronjob: changed datastore to datastore-fs and added custom libp2p * fix/announce-cid-with-cronjob: resolved conflicts * fix/announce-cid-with-cronjob: reverted old delegated routing url * fix/announc-cid-with-cronjob: added announce addresse * fix: announce cid with cronjob (#532) * fix/announce-cid-with-cronjob: Provided announcing cids with cronjob process * fix-announce-cid-with-cronjob: changed datastore to datastore-fs and added custom libp2p * fix/announce-cid-with-cronjob: resolved conflicts * fix/announce-cid-with-cronjob: reverted old delegated routing url * fix/announc-cid-with-cronjob: added announce addresse * fix/announce-cid-with-cronjob: reverted to circuit relay * feat: Paginate 7 members * feat: Added border to header dropdown menu * feat: Displayed full title on hover for truncated GA titles * feature/search-users-by-email: added option for search users by email (#536) * feat: Added missing indicator * chore: Changed Default Pagination Limit to 12 * fix/db-connection-with-ssl (#538) --------- Co-authored-by: MGukic Co-authored-by: MGukic <116276787+MGukic@users.noreply.github.com> Co-authored-by: nike-getto Co-authored-by: Sava Stanisic <100715230+nike-getto@users.noreply.github.com> --- backend/src/database/database.module.ts | 7 + .../util/pagination/user-pagination.config.ts | 2 +- .../src/components/atoms/MultipleSelect.tsx | 66 +- .../molecules/UserProfileButton.tsx | 22 +- .../organisms/UsersList/UsersListItem.tsx | 6 +- .../organisms/VotesTable/VotesTableRow.tsx | 45 +- frontend/src/lib/api.ts | 2 +- ipfs-service/.eslintrc.cjs | 25 + ipfs-service/example.env | 5 +- ipfs-service/package-lock.json | 2713 ++++++++--------- ipfs-service/package.json | 4 +- ipfs-service/src/app.controller.ts | 2 +- ipfs-service/src/app.module.ts | 19 +- ipfs-service/src/app.service.ts | 105 +- ipfs-service/src/bullmq/bullmq.module.ts | 34 +- .../src/constants/bullmq.constants.ts | 11 +- ipfs-service/src/dto/ipfs.dto.ts | 9 +- .../src/jobs/impl/provide-all-cids.job.ts | 25 + .../src/jobs/impl/prune-peer-store.job.ts | 3 +- ipfs-service/src/main.ts | 17 +- ipfs-service/src/mapper/ipfs.mapper.ts | 8 +- .../processors/provide-all-cids.processor.ts | 43 + .../processors/provide-to-dht.processor.ts | 16 +- .../processors/prune-peer-store.processor.ts | 15 +- .../producers/provide-all-cids.producer.ts | 34 + .../producers/provide-to-dht.producer.ts | 30 +- .../producers/prune-peer-store.producer.ts | 24 +- ipfs-service/tsconfig.json | 4 +- .../src/database/database.module.ts | 7 + 29 files changed, 1739 insertions(+), 1564 deletions(-) create mode 100644 ipfs-service/.eslintrc.cjs create mode 100644 ipfs-service/src/jobs/impl/provide-all-cids.job.ts create mode 100644 ipfs-service/src/queues/processors/provide-all-cids.processor.ts create mode 100644 ipfs-service/src/queues/producers/provide-all-cids.producer.ts 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 ( - +