Skip to content

Commit af2c317

Browse files
authored
chore(cells): increment cells maximum file size to 500 MB [WPB-20876] (#19637)
* chore(cells): increment cells maximum file size to 500 MB * remove superfluous variable
1 parent 4afcf6f commit af2c317

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

src/script/Config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ const config = {
5050
/** 100 megabyte upload limit for organizations (team members) */
5151
MAXIMUM_ASSET_FILE_SIZE_TEAM: 100 * 1024 * 1024,
5252

53+
/** 500 megabyte upload limit when Cells is enabled */
54+
MAXIMUM_ASSET_FILE_SIZE_CELLS: 500 * 1024 * 1024,
55+
5356
/** 15 megabyte image upload limit */
5457
MAXIMUM_IMAGE_FILE_SIZE: 15 * 1024 * 1024,
5558

src/script/components/Conversation/Conversation.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -475,16 +475,17 @@ export const Conversation = ({
475475

476476
const isFileTabActive = activeTabIndex === 1;
477477

478+
const isCellsEnabled =
479+
Config.getConfig().FEATURE.ENABLE_CELLS && activeConversation?.cellsState() !== CONVERSATION_CELLS_STATE.DISABLED;
480+
478481
const {getRootProps, getInputProps, openAllFilesView, openImageFilesView, isDragAccept} = useFilesUploadDropzone({
479482
isTeam: inTeam,
480483
cellsRepository: repositories.cells,
481484
conversation: activeConversation,
485+
isCellsEnabled: isCellsEnabled,
482486
isDisabled: isFileTabActive,
483487
});
484488

485-
const isCellsEnabled =
486-
Config.getConfig().FEATURE.ENABLE_CELLS && activeConversation?.cellsState() !== CONVERSATION_CELLS_STATE.DISABLED;
487-
488489
return (
489490
<ConversationFileDropzone
490491
isDragAccept={isDragAccept}

src/script/components/Conversation/useFilesUploadDropzone/useFilesUploadDropzone.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ const logger = getLogger('FileDropzone');
4444

4545
interface UseFilesUploadDropzoneParams {
4646
isTeam: boolean;
47+
isCellsEnabled: boolean;
4748
isDisabled: boolean;
4849
cellsRepository: CellsRepository;
4950
conversation?: Pick<Conversation, 'id' | 'qualifiedId'>;
@@ -52,6 +53,7 @@ interface UseFilesUploadDropzoneParams {
5253
export const useFilesUploadDropzone = ({
5354
isTeam,
5455
isDisabled,
56+
isCellsEnabled,
5557
cellsRepository,
5658
conversation = {id: '', qualifiedId: {id: '', domain: ''}},
5759
}: UseFilesUploadDropzoneParams) => {
@@ -60,7 +62,9 @@ export const useFilesUploadDropzone = ({
6062

6163
const [accept, setAccept] = useState<Accept | undefined>(undefined);
6264

63-
const MAX_SIZE = isTeam ? CONFIG.MAXIMUM_ASSET_FILE_SIZE_TEAM : CONFIG.MAXIMUM_ASSET_FILE_SIZE_PERSONAL;
65+
const TEAM_MAX_SIZE = isCellsEnabled ? CONFIG.MAXIMUM_ASSET_FILE_SIZE_CELLS : CONFIG.MAXIMUM_ASSET_FILE_SIZE_TEAM;
66+
67+
const MAX_SIZE = isTeam ? TEAM_MAX_SIZE : CONFIG.MAXIMUM_ASSET_FILE_SIZE_PERSONAL;
6468

6569
const {getRootProps, getInputProps, open, isDragAccept} = useDropzone({
6670
maxSize: MAX_SIZE,

0 commit comments

Comments
 (0)