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

Updated Model.js #221

Merged
merged 3 commits into from
Jan 19, 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
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ Object {
</svg>
</div>
<input
accept="text/plain,application/pdf,image/jpeg,image/png,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,text/csv,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,audio/wav,audio/x-wav,audio/vnd.wave,.docx,.xlsx,.pptx"
accept="text/plain,application/pdf,image/jpeg,image/png,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,text/csv,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,audio/wav,audio/x-wav,audio/vnd.wave,image/jpeg,application/rtf,application/x-rtf,image/heic,video/quicktime,video/mp4,text/richtext,text/rtf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt,.csv,.jfif,.rtf,.heic,.mov,.mp4"
aria-label="Attach a file"
data-testid="customer-chat-file-select"
id="customer-chat-file-select-12344"
Expand Down Expand Up @@ -276,7 +276,7 @@ Object {
</svg>
</div>
<input
accept="text/plain,application/pdf,image/jpeg,image/png,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,text/csv,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,audio/wav,audio/x-wav,audio/vnd.wave,.docx,.xlsx,.pptx"
accept="text/plain,application/pdf,image/jpeg,image/png,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,text/csv,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,audio/wav,audio/x-wav,audio/vnd.wave,image/jpeg,application/rtf,application/x-rtf,image/heic,video/quicktime,video/mp4,text/richtext,text/rtf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt,.csv,.jfif,.rtf,.heic,.mov,.mp4"
aria-label="Attach a file"
data-testid="customer-chat-file-select"
id="customer-chat-file-select-12344"
Expand Down Expand Up @@ -567,7 +567,7 @@ Object {
</svg>
</div>
<input
accept="text/plain,application/pdf,image/jpeg,image/png,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,text/csv,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,audio/wav,audio/x-wav,audio/vnd.wave,.docx,.xlsx,.pptx"
accept="text/plain,application/pdf,image/jpeg,image/png,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,text/csv,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,audio/wav,audio/x-wav,audio/vnd.wave,image/jpeg,application/rtf,application/x-rtf,image/heic,video/quicktime,video/mp4,text/richtext,text/rtf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt,.csv,.jfif,.rtf,.heic,.mov,.mp4"
aria-label="Attach a file"
data-testid="customer-chat-file-select"
id="customer-chat-file-select-12344"
Expand Down Expand Up @@ -652,7 +652,7 @@ Object {
</svg>
</div>
<input
accept="text/plain,application/pdf,image/jpeg,image/png,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,text/csv,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,audio/wav,audio/x-wav,audio/vnd.wave,.docx,.xlsx,.pptx"
accept="text/plain,application/pdf,image/jpeg,image/png,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,text/csv,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,audio/wav,audio/x-wav,audio/vnd.wave,image/jpeg,application/rtf,application/x-rtf,image/heic,video/quicktime,video/mp4,text/richtext,text/rtf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt,.csv,.jfif,.rtf,.heic,.mov,.mp4"
aria-label="Attach a file"
data-testid="customer-chat-file-select"
id="customer-chat-file-select-12344"
Expand Down
35 changes: 33 additions & 2 deletions src/components/Chat/datamodel/Model.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,14 @@ export const ContentType = {
AUDIO_VND_WAVE: "audio/vnd.wave", //IE
INTERACTIVE_MESSAGE: "application/vnd.amazonaws.connect.message.interactive",
INTERACTIVE_RESPONSE: "application/vnd.amazonaws.connect.message.interactive.response",
},
VIDEO_QUICKTIME: "video/quicktime", // QuickTime file format (.mov)
RICH_TEXT: "text/richtext", // Rich text (.rtf)
TEXT_RTF: "text/rtf", // Rich text (.rtf)
RICH_TEST_FILE_RTF: "application/rtf", // Rich text (.rtf)
RICH_TEST_FILE_X_RTF: "application/x-rtf", // Rich text (.rtf)
VIDEO_MP4: "video/mp4", // MP4 Video (.mp4)
IMAGE_HEIC: "image/heic", // High Efficiency Image File (.heic)
}
};

ContentType.ATTACHMENT_CONTENT_TYPE = {
Expand All @@ -61,10 +68,34 @@ ContentType.ATTACHMENT_CONTENT_TYPE = {
WAV: ContentType.MESSAGE_CONTENT_TYPE.AUDIO_WAV,
X_WAV: ContentType.MESSAGE_CONTENT_TYPE.AUDIO_X_WAV,
VND_WAVE: ContentType.MESSAGE_CONTENT_TYPE.AUDIO_VND_WAVE,
JFIF: ContentType.MESSAGE_CONTENT_TYPE.IMAGE_JPG,
RTF: ContentType.MESSAGE_CONTENT_TYPE.RICH_TEST_FILE_RTF,
X_RTF: ContentType.MESSAGE_CONTENT_TYPE.RICH_TEST_FILE_X_RTF,
HEIC: ContentType.MESSAGE_CONTENT_TYPE.IMAGE_HEIC,
MOV: ContentType.MESSAGE_CONTENT_TYPE.VIDEO_QUICKTIME,
MP4: ContentType.MESSAGE_CONTENT_TYPE.VIDEO_MP4,
RICH_TEXT: ContentType.MESSAGE_CONTENT_TYPE.RICH_TEXT,
TEXT_RTF: ContentType.MESSAGE_CONTENT_TYPE.TEXT_RTF,
};

//OpenXML content types do not show up in custom files list unless file extension is explicitly provided
export const ATTACHMENT_ACCEPT_CONTENT_TYPES = [...Object.values(ContentType.ATTACHMENT_CONTENT_TYPE), ".docx", ".xlsx", ".pptx"];
export const ATTACHMENT_ACCEPT_CONTENT_TYPES = [
...Object.values(ContentType.ATTACHMENT_CONTENT_TYPE),
//For some browser + content type combinations, file extension must be explicitly provided for 'accept' attribute
".doc",
".docx",
".xls",
".xlsx",
".ppt",
".pptx",
".txt",
".csv",
".jfif",
".rtf",
".heic",
".mov",
".mp4"
];

export const InteractiveMessageType = {
LIST_PICKER: "ListPicker",
Expand Down
Loading