- {intl.formatMessage(messages.subheading)}
-
-
-
+
+
- { currentView === 'card' && }
+ { currentView === 'card' && }
{ currentView === 'list' && }
diff --git a/src/files-and-uploads/data/utils.js b/src/files-and-uploads/data/utils.js
index 7236bcbc5b..ffa74fb87d 100644
--- a/src/files-and-uploads/data/utils.js
+++ b/src/files-and-uploads/data/utils.js
@@ -1,6 +1,11 @@
import { InsertDriveFile, Terminal, AudioFile } from '@edx/paragon/icons';
+import { ensureConfig, getConfig } from '@edx/frontend-platform';
import FILES_AND_UPLOAD_TYPE_FILTERS from './constant';
+ensureConfig([
+ 'STUDIO_BASE_URL',
+], 'Course Apps API service');
+
export const getWrapperType = (assets) => {
const assetsWithWraperType = [];
assets.forEach(asset => {
@@ -19,9 +24,9 @@ export const getWrapperType = (assets) => {
return assetsWithWraperType;
};
-export const getIcon = ({ thumbnail, wrapperType, externalUrl }) => {
+export const getSrc = ({ thumbnail, wrapperType, externalUrl }) => {
if (thumbnail) {
- return externalUrl;
+ return externalUrl || `${getConfig().STUDIO_BASE_URL}${thumbnail}`;
}
switch (wrapperType) {
case 'document':
diff --git a/src/files-and-uploads/table-components/GalleryCard.jsx b/src/files-and-uploads/table-components/GalleryCard.jsx
index d6ca2c637b..7d69de6d52 100644
--- a/src/files-and-uploads/table-components/GalleryCard.jsx
+++ b/src/files-and-uploads/table-components/GalleryCard.jsx
@@ -7,13 +7,14 @@ import {
useToggle,
Chip,
Truncate,
+ Image,
} from '@edx/paragon';
import {
MoreVert,
} from '@edx/paragon/icons';
import FileMenu from '../FileMenu';
import FileInfo from '../FileInfo';
-import { getIcon } from '../data/utils';
+import { getSrc } from '../data/utils';
const GalleryCard = ({
className,
@@ -29,9 +30,8 @@ const GalleryCard = ({
const { locked } = original;
handleLockedAsset(original.id, !locked);
};
- const icon = getIcon({
+ const src = getSrc({
thumbnail: original.thumbnail,
- externalUrl: original.externalUrl,
wrapperType: original.wrapperType,
});
@@ -55,11 +55,15 @@ const GalleryCard = ({
)}
/>
- {original.thumbnail ? (
-
- ) : (
-
- )}
+
{original.displayName}
diff --git a/src/files-and-uploads/table-components/ListCard.jsx b/src/files-and-uploads/table-components/ListCard.jsx
index d9467aa1f3..a2dd0cfab0 100644
--- a/src/files-and-uploads/table-components/ListCard.jsx
+++ b/src/files-and-uploads/table-components/ListCard.jsx
@@ -7,13 +7,14 @@ import {
useToggle,
Chip,
Truncate,
+ Image,
} from '@edx/paragon';
import {
MoreVert,
} from '@edx/paragon/icons';
import FileMenu from '../FileMenu';
import FileInfo from '../FileInfo';
-import { getIcon } from '../data/utils';
+import { getSrc } from '../data/utils';
const ListCard = ({
className,
@@ -29,9 +30,8 @@ const ListCard = ({
const { locked } = original;
handleLockedAsset(original.id, !locked);
};
- const icon = getIcon({
+ const src = getSrc({
thumbnail: original.thumbnail,
- externalUrl: original.externalUrl,
wrapperType: original.wrapperType,
});
@@ -42,11 +42,13 @@ const ListCard = ({
orientation="horizontal"
data-testid={`list-card-${original.id}`}
>
-
+
+ {intl.formatMessage(messages.errorAlertMessage, { message: errorMessages.upload })}
+
+
+ {intl.formatMessage(messages.errorAlertMessage, { message: errorMessages.delete })}
+
+
+ {intl.formatMessage(messages.errorAlertMessage, { message: errorMessages.lock })}
+
+
+
+
+ {original.thumbnail ? (
+
+ ) : (
+
+
+
+ )}
+
+
{original.thumbnail ? (
-
+
) : (
-
+
+
+
)}