Skip to content

Commit

Permalink
develop - to staging (#539)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
Co-authored-by: MGukic <[email protected]>
Co-authored-by: nike-getto <[email protected]>
Co-authored-by: Sava Stanisic <[email protected]>
  • Loading branch information
5 people authored Feb 7, 2025
1 parent da0c336 commit 83b20d8
Show file tree
Hide file tree
Showing 29 changed files with 1,739 additions and 1,564 deletions.
7 changes: 7 additions & 0 deletions backend/src/database/database.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import { User } from 'src/users/entities/user.entity';

export const USER_PAGINATION_CONFIG: PaginateConfig<User> = {
sortableColumns: ['name'],
searchableColumns: ['name'],
searchableColumns: ['name', 'email'],
defaultSortBy: [['name', 'ASC']],
};
66 changes: 39 additions & 27 deletions frontend/src/components/atoms/MultipleSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,12 @@ export function MultipleSelect({
required,
name,
dataTestId,
value = [],
}: MultipleSelectProps) {
const theme = useTheme();
const [selectedValue, setSelectedValue] = React.useState<string[]>([]);
const [selectedValue, setSelectedValue] = React.useState<string[]>(
Array.isArray(value) ? value : [value]
);

const handleChange = (event: SelectChangeEvent<typeof selectedValue>) => {
const {
Expand All @@ -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 (
<Typography
fontWeight={400}
Expand All @@ -67,37 +70,46 @@ export function MultipleSelect({
</Typography>
);
}
const selectedOption = items.find(
(item) => item.value === selectedValue[0]
const selectedOption = items.find((item) => item.value === selected[0]);
const label = selectedOption?.label ?? "";
return (
<Typography dataTestId={`${dataTestId}-item-selected`} variant="body2">
{label.length > 50 ? `${label.substring(0, 50)}...` : label}
</Typography>
);
if (selectedOption) {
return (
<Typography
dataTestId={`${dataTestId}-item-selected`}
variant="body2"
>
{selectedOption.label}
</Typography>
);
}
}

if (selected.length === 0) {
return (
<Typography
fontWeight={400}
variant="body1"
color={customPalette.inputPlaceholder}
>
{placeholder}
</Typography>
);
}

const selectedLabels = selected
.map(
(selectedItem) =>
items.find((item) => item.value === selectedItem)?.label
)
.filter(Boolean) as string[];

const combinedText = selectedLabels.join(", ");
return (
<Typography
fontWeight={400}
variant="body1"
color={customPalette.inputPlaceholder}
>
{placeholder}
<Typography dataTestId={`${dataTestId}-selected-values`} variant="body2">
{combinedText.length > 50
? `${combinedText.substring(0, 50)}...`
: combinedText}
</Typography>
);
};

return (
<FormControl
sx={{
width: "100%",
}}
>
<FormControl sx={{ width: "100%" }}>
<Select
name={name}
multiple={multiple}
Expand All @@ -106,7 +118,7 @@ export function MultipleSelect({
onChange={handleChange}
input={<Input />}
IconComponent={() => <img src={ICONS.arrowDown} />}
renderValue={renderValue}
renderValue={(selected) => renderValue(selected as string[])}
MenuProps={MenuProps}
required={required}
data-testid={`${dataTestId}--dropdown`}
Expand Down
22 changes: 15 additions & 7 deletions frontend/src/components/molecules/UserProfileButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,23 @@ import Menu from "@mui/material/Menu";
import { useTranslations } from "next-intl";
import * as React from "react";
import { Button } from "../atoms";
import theme from "@/theme";

export default function UserProfileButton({
user
user,
}: {
user: Pick<FetchUserData, "name" | "profile_photo_url">;
}) {
const { openModal } = useModal();
const t = useTranslations();

const [anchorEl, setAnchorEl] = React.useState<null | HTMLElement>(null);
const [menuWidth, setMenuWidth] = React.useState<number | null>(null);

const open = Boolean(anchorEl);
const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {
setAnchorEl(event.currentTarget);
setMenuWidth(event.currentTarget.offsetWidth);
};
const handleClose = () => {
setAnchorEl(null);
Expand All @@ -31,8 +35,8 @@ export default function UserProfileButton({
type: "signUpModal",
state: {
showCloseButton: true,
title: t("Modals.editProfile.headline")
}
title: t("Modals.editProfile.headline"),
},
});
handleClose();
};
Expand All @@ -41,8 +45,8 @@ export default function UserProfileButton({
openModal({
type: "signOutModal",
state: {
homeRedirectionPath: PATHS.home
}
homeRedirectionPath: PATHS.home,
},
});
};

Expand Down Expand Up @@ -87,10 +91,14 @@ export default function UserProfileButton({
open={open}
onClose={handleClose}
MenuListProps={{
"aria-labelledby": "basic-button"
"aria-labelledby": "basic-button",
}}
PaperProps={{
style: { boxShadow: "none" }
style: {
boxShadow: "none",
border: `1px solid ${theme.palette.primary.main}`,
minWidth: menuWidth || "auto",
},
}}
>
<Grid
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/organisms/UsersList/UsersListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
UserAvatar,
UserBasicInfo,
UserRole,
UserStatus
UserStatus,
} from "@/components/molecules";
import { UserStatus as UserStatusType } from "@atoms";
import { Box, Grid } from "@mui/material";
Expand All @@ -17,7 +17,7 @@ export function UsersListItem({
email,
role,
status,
profile_photo_url
profile_photo_url,
}: Pick<
UserListItem,
"id" | "name" | "email" | "role" | "status" | "profile_photo_url"
Expand Down Expand Up @@ -61,7 +61,7 @@ export function UsersListItem({
<Card
variant="default"
sx={{
padding: { xxs: 2, md: 3 }
padding: { xxs: 2, md: 3 },
}}
>
<Grid
Expand Down
45 changes: 29 additions & 16 deletions frontend/src/components/organisms/VotesTable/VotesTableRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { VotesTableI } from "@/lib/requests";
import { Button, OutlinedLightButton, Typography, VotePill } from "@atoms";
import { customPalette } from "@consts";
import { Card, TableDivider, UserAvatar, UserBasicInfo } from "@molecules";
import { Box, Grid, Stack } from "@mui/material";
import { Box, Grid, Stack, Tooltip } from "@mui/material";
import { formatDisplayDate, getProposalTypeLabel, truncateText } from "@utils";
import { useTranslations } from "next-intl";

Expand Down Expand Up @@ -78,22 +78,35 @@ export const VotesTableRow = ({
>
<Grid container gap={2} xxs={12} md={6} lg={5} xl={3} flexWrap="nowrap">
<TableDivider />
<Grid item>
<Typography
color={customPalette.neutralGray}
sx={{ marginBottom: 1 }}
variant="caption"
fontWeight={500}
>
{t("govAction")}
</Typography>
<Tooltip
title={
gov_action_proposal_title.length > 40
? gov_action_proposal_title
: ""
}
arrow
enterDelay={200}
enterNextDelay={200}
enterTouchDelay={0}
leaveDelay={0}
>
<Grid item>
<Typography
color={customPalette.neutralGray}
sx={{ marginBottom: 1 }}
variant="caption"
fontWeight={500}
>
{t("govAction")}
</Typography>

<Typography variant="caption">
{gov_action_proposal_title
? truncateText(gov_action_proposal_title, 40)
: t("notAvailable")}
</Typography>
</Grid>
<Typography variant="caption">
{gov_action_proposal_title
? truncateText(gov_action_proposal_title, 40)
: t("notAvailable")}
</Typography>
</Grid>
</Tooltip>
</Grid>
<Grid container gap={2} xxs={12} md={5} lg={5} xl={3} flexWrap="nowrap">
<TableDivider />
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {

import { getTranslations } from "next-intl/server";
const baseURL = process.env.NEXT_PUBLIC_API_URL || "http://localhost:1337";
const DEFAULT_PAGINATION_LIMIT = 6;
const DEFAULT_PAGINATION_LIMIT = 12;

/**
* Checks if the provided token is expired.
Expand Down
25 changes: 25 additions & 0 deletions ipfs-service/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
tsconfigRootDir: __dirname,
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
root: true,
env: {
node: true,
jest: true,
},
ignorePatterns: ['.eslintrc.js'],
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
};
5 changes: 4 additions & 1 deletion ipfs-service/example.env
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,7 @@ DHT_QUEUE_BACKOFF_TYPE=exponential
DHT_QUEUE_BACKOFF_DELAY=1000

MAX_PEERS=5000
PRUNE_PEER_STORE_INTERVAL=0 0 */12 * * * # every 12h
PRUNE_PEER_STORE_INTERVAL=0 0 */12 * * * # every 12h

PROVIDE_ALL_CIDS_PER_PAGE=5
PROVIDE_ALL_CIDS_INTERVAL=0 0 */12 * * * # every 12h
Loading

0 comments on commit 83b20d8

Please sign in to comment.