feat: allow configuring attachment upload limit (#12835)
## Summary - add a configurable MAXIMUM_FILE_UPLOAD_SIZE installation setting and surface it through super admin and global config payloads - apply the configurable limit to attachment validations and shared upload helpers on dashboard and widget - introduce a reusable helper with unit tests for parsing the limit and extend attachment specs for configurability ------ [Codex Task](https://chatgpt.com/codex/tasks/task_e_6912644786b08326bc8dee9401af6d0a) --------- Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Co-authored-by: iamsivin <iamsivin@gmail.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { parseBoolean } from '@chatwoot/utils';
|
||||
import { resolveMaximumFileUploadSize } from 'shared/helpers/FileHelper';
|
||||
|
||||
const {
|
||||
API_CHANNEL_NAME: apiChannelName,
|
||||
@@ -11,6 +12,7 @@ const {
|
||||
DIRECT_UPLOADS_ENABLED: directUploadsEnabled,
|
||||
DISPLAY_MANIFEST: displayManifest,
|
||||
GIT_SHA: gitSha,
|
||||
MAXIMUM_FILE_UPLOAD_SIZE: maximumFileUploadSize,
|
||||
HCAPTCHA_SITE_KEY: hCaptchaSiteKey,
|
||||
INSTALLATION_NAME: installationName,
|
||||
LOGO_THUMBNAIL: logoThumbnail,
|
||||
@@ -37,6 +39,7 @@ const state = {
|
||||
disableUserProfileUpdate: parseBoolean(disableUserProfileUpdate),
|
||||
displayManifest,
|
||||
gitSha,
|
||||
maximumFileUploadSize: resolveMaximumFileUploadSize(maximumFileUploadSize),
|
||||
hCaptchaSiteKey,
|
||||
installationName,
|
||||
logo,
|
||||
|
||||
Reference in New Issue
Block a user