Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TAN-3218: fix out memory issue in development #9796

Merged
merged 8 commits into from
Jan 6, 2025
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const DesktopView = ({
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
mapView?.ui?.add(resetButtonRef?.current || '', 'top-right');
return;
} else if (inputType === 'point') {
} else {
// TODO: Fix this the next time the file is edited.
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
mapView?.ui?.add(resetButtonRef?.current || '', 'top-right');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const getVoteSubmissionDisabledExplanation = (
if (minBudgetRequiredNotReached) {
return formatMessage(messages.minBudgetNotReached, {
votesMinimum: minBudget.toLocaleString(),
currency,
currency: currency ?? '',
});
}
}
Expand Down Expand Up @@ -168,7 +168,7 @@ export const getVotesCounter = (
return formatMessage(messages.currencyLeft, {
budgetLeft: budgetLeft.toLocaleString(),
totalBudget: voting_max_total.toLocaleString(),
currency,
currency: currency ?? '',
});
}

Expand Down
18 changes: 11 additions & 7 deletions front/app/components/admin/SeatBasedBilling/SeatInfo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@ const SeatInfo = ({ seatType }: SeatInfoProps) => {
const { pathname } = useLocation();
const { data: appConfiguration } = useAppConfiguration();
const { data: seats } = useSeats();
const adminsAndMangersLink: RouteType =
// TODO: Fix this the next time the file is edited.
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
'/admin/users/admins' || '/admin/users/moderators';
const isOnAdminsAndManagersPage = pathname.includes(adminsAndMangersLink);
const adminsAndManagersLinks: RouteType[] = [
'/admin/users/admins',
'/admin/users/moderators',
];
const isOnAdminsOrManagersPage = adminsAndManagersLinks.some((link) =>
pathname.includes(link)
);

const maximumSeatNumbers: SeatNumbersType = {
admin:
Expand All @@ -71,6 +73,8 @@ const SeatInfo = ({ seatType }: SeatInfoProps) => {
.additional_moderators_number,
};
const additionalSeats = additionalSeatNumbers[seatType];
const linkTo =
seatType === 'admin' ? '/admin/users/admins' : '/admin/users/moderators';

// Maximum seat number being null means that there are unlimited seats so we don't show the seat info
if (isNil(maximumSeatNumber) || !seats) {
Expand Down Expand Up @@ -159,8 +163,8 @@ const SeatInfo = ({ seatType }: SeatInfoProps) => {
<Text fontSize="xl" my="4px" data-cy={`e2e-${seatType}-used-seats`}>
{usedSeats}
</Text>
{!isOnAdminsAndManagersPage && usedSeats > 0 && (
<StyledLink target="_blank" to={adminsAndMangersLink}>
{!isOnAdminsOrManagersPage && usedSeats > 0 && (
<StyledLink target="_blank" to={linkTo}>
<Text variant="bodyXs" my="0px" color="coolGrey600">
{formatMessage(messages.view)}
</Text>
Expand Down
9 changes: 7 additions & 2 deletions front/app/typings.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { MouseEvent, FC } from 'react';

import { WrappedComponentProps } from 'react-intl';
import { MessageDescriptor } from 'react-intl';
import { RouteType } from 'routes';
import { TableCellProps } from 'semantic-ui-react';

Expand All @@ -13,6 +13,8 @@ import {

import { TFieldName } from 'components/UI/Error';

import { FormatMessageValues } from 'utils/cl-intl/useIntl';

declare global {
interface Function {
displayName?: string;
Expand Down Expand Up @@ -158,4 +160,7 @@ export type Override<T, U> = Pick<T, Exclude<keyof T, keyof U>> & U;

export type Percentage = `${number}%`;

export type FormatMessage = WrappedComponentProps['intl']['formatMessage'];
export type FormatMessage = (
messageDescriptor: MessageDescriptor,
values?: FormatMessageValues
) => string;
5 changes: 2 additions & 3 deletions front/app/utils/actionTakingRules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,8 @@ const ideaPostingDisabledReason = (
disabledReason: backendReason,
authenticationRequirements: null,
};
// TODO: Fix this the next time the file is edited.
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
case 'user_not_permitted' || 'user_blocked':
case 'user_blocked':
case 'user_not_permitted':
return {
disabledReason: backendReason,
authenticationRequirements: null,
Expand Down
5 changes: 4 additions & 1 deletion front/internals/webpack/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,11 @@ const config = {
async: isDev,
typescript: {
configFile: path.join(process.cwd(), 'app/tsconfig.json'),
memoryLimit: 4096,
},
logger: { infrastructure: !!argv.json ? 'silent' : 'console' }, // silent when trying to profile the chunks sizes
logger: !!argv.json
? { error: () => {}, warn: () => {}, info: () => {} } // Silent when trying to profile the chunks sizes
: console, // Use the default `console` logger
}),

new CleanWebpackPlugin(),
Expand Down
Loading