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

TASK 3266: Update file size to 15MB #67

Merged
merged 2 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions assets/application/js/documents.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
FILE INFO
-------------------
tags: ["Documents", "Application", "JS"]
version: 1.0.1
version: 1.0.2
name: Documents
type: JS Script
description: This is the JS script for the Documents step in APPLICATION form.
*/
if (window.jQuery) {
(function ($) {
const MAXIMUM_FILE_SIZE_IN_KB = 15360;
const MAXIMUM_FILE_SIZE_TEXT = '15MB';
const allowedMimeTypes = [
'text/csv',
'application/msword',
Expand Down Expand Up @@ -235,7 +236,7 @@ if (window.jQuery) {

let alertStr = '';
if (!isValidFileType && !isValidFileSize) {
alertStr = `Selected file(s) do not match the allowed file extensions and exceed file size limit of 10MB. Please upload a valid file size & file type of: ${allowedFileTypes.join(
alertStr = `Selected file(s) do not match the allowed file extensions and exceed file size limit of ${MAXIMUM_FILE_SIZE_TEXT}. Please upload a valid file size & file type of: ${allowedFileTypes.join(
', '
)}.`;
} else if (!isValidFileType) {
Expand All @@ -244,7 +245,7 @@ if (window.jQuery) {
)}.`;
} else if (!isValidFileSize) {
alertStr =
'Selected file(s) exceeds the allowed file upload limit of 10MB. Please upload a file with a size of 10MB or less.';
`Selected file(s) exceeds the allowed file upload limit of ${MAXIMUM_FILE_SIZE_TEXT}. Please upload a file with a size of ${MAXIMUM_FILE_SIZE_TEXT} or less.`;
}

if (alertStr) {
Expand Down
7 changes: 4 additions & 3 deletions assets/claim/js/documents.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
FILE INFO
-------------------
tags: ["Documents", "Claim", "JS"]
version: 1.0.1
version: 1.0.2
name: Documents
type: JS Script
description: This is the JS script for the Documents step in CLAIM form.
*/
if (window.jQuery) {
(function ($) {
var MAXIMUM_FILE_SIZE_IN_KB = 15360;
const MAXIMUM_FILE_SIZE_TEXT = '15MB';
var allowedMimeTypes = [
"text/csv",
"application/msword",
Expand Down Expand Up @@ -133,7 +134,7 @@ if (window.jQuery) {

let alertStr = "";
if (!isValidFileType && !isValidFileSize) {
alertStr = `Selected file(s) do not match the allowed file extensions and exceed file size limit of 10MB. Please upload a valid file size & file type of: ${allowedFileTypes.join(
alertStr = `Selected file(s) do not match the allowed file extensions and exceed file size limit of ${MAXIMUM_FILE_SIZE_TEXT}. Please upload a valid file size & file type of: ${allowedFileTypes.join(
", "
)}.`;
} else if (!isValidFileType) {
Expand All @@ -142,7 +143,7 @@ if (window.jQuery) {
)}.`;
} else if (!isValidFileSize) {
alertStr =
"Selected file(s) exceeds the allowed file upload limit of 10MB. Please upload a file with a size of 10MB or less.";
`Selected file(s) exceeds the allowed file upload limit of ${MAXIMUM_FILE_SIZE_TEXT}. Please upload a file with a size of ${MAXIMUM_FILE_SIZE_TEXT} or less.`;
}

if (alertStr) {
Expand Down
5 changes: 3 additions & 2 deletions powerpod/src/js/claim/documents.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Logger } from '../common/logger.js';
const logger = new Logger('claim/documents');

const MAXIMUM_FILE_SIZE_IN_KB = 15360;
const MAXIMUM_FILE_SIZE_TEXT = '15MB';
const ALLOWED_MIME_TYPES = [
'text/csv',
'application/msword',
Expand Down Expand Up @@ -128,7 +129,7 @@ function validateFileUpload(file) {

let alertStr = '';
if (!isValidFileType && !isValidFileSize) {
alertStr = `Selected file(s) do not match the allowed file extensions and exceed file size limit of 10MB. Please upload a valid file size & file type of: ${ALLOWED_FILE_TYPES.join(
alertStr = `Selected file(s) do not match the allowed file extensions and exceed file size limit of ${MAXIMUM_FILE_SIZE_TEXT}. Please upload a valid file size & file type of: ${ALLOWED_FILE_TYPES.join(
', '
)}.`;
} else if (!isValidFileType) {
Expand All @@ -137,7 +138,7 @@ function validateFileUpload(file) {
)}.`;
} else if (!isValidFileSize) {
alertStr =
'Selected file(s) exceeds the allowed file upload limit of 10MB. Please upload a file with a size of 10MB or less.';
`Selected file(s) exceeds the allowed file upload limit of ${MAXIMUM_FILE_SIZE_TEXT}. Please upload a file with a size of ${MAXIMUM_FILE_SIZE_TEXT} or less.`;
}

if (alertStr) {
Expand Down