Skip to content

Commit

Permalink
CORE-2027 Add more mime-types to the editable FileViewer check
Browse files Browse the repository at this point in the history
Moved some mime-types from the FileViewer `default` fall-through into
special handling check to allow editing of `application/` types.
  • Loading branch information
psarando committed Feb 1, 2025
1 parent 2b92cff commit b9593c8
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/components/data/viewers/FileViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,6 @@ export default function FileViewer(props) {
setViewerType(VIEWER_TYPE.DOCUMENT);
break;

case mimeTypes.X_SH:
case mimeTypes.X_RSRC:
case mimeTypes.X_PYTHON:
case mimeTypes.X_PERL:
case mimeTypes.X_WEB_MARKDOWN:
case mimeTypes.PLAIN:
case mimeTypes.PREVIEW:
default:
if (
infoTypes.CSV === infoType ||
Expand Down Expand Up @@ -271,10 +264,16 @@ export default function FileViewer(props) {
setViewerType(VIEWER_TYPE.PATH_LIST);
break;
} else {
// Special handling for text-based formats that don't use text/ prefix
// Special handling for text-based formats that may not use the `text/` prefix.
const viewableApplicationTypes = [
mimeTypes.JSON,
mimeTypes.XML,
mimeTypes.X_SH,
mimeTypes.X_RSRC,
mimeTypes.X_PYTHON,
mimeTypes.X_PERL,
mimeTypes.X_WEB_MARKDOWN,
mimeTypes.PREVIEW,
];

if (
Expand Down

0 comments on commit b9593c8

Please sign in to comment.