diff --git a/assets/images/categories-end-user-experience-preview-mobile@2x.png b/assets/images/categories-end-user-experience-preview-mobile@2x.png
deleted file mode 100644
index f303df6ccc..0000000000
Binary files a/assets/images/categories-end-user-experience-preview-mobile@2x.png and /dev/null differ
diff --git a/assets/images/preview-self-service-icon.png b/assets/images/preview-self-service-icon.png
deleted file mode 100644
index 5a7016da60..0000000000
Binary files a/assets/images/preview-self-service-icon.png and /dev/null differ
diff --git a/frontend/components/TableContainer/DataTable/SoftwareNameCell/SoftwareNameCell.tsx b/frontend/components/TableContainer/DataTable/SoftwareNameCell/SoftwareNameCell.tsx
index 8c1fd1ef0c..492d4f0720 100644
--- a/frontend/components/TableContainer/DataTable/SoftwareNameCell/SoftwareNameCell.tsx
+++ b/frontend/components/TableContainer/DataTable/SoftwareNameCell/SoftwareNameCell.tsx
@@ -158,6 +158,8 @@ interface ISoftwareNameCellProps {
iconUrl?: string | null;
isIosOrIpadosApp?: boolean;
isAndroidPlayStoreApp?: boolean;
+ /** Only used on Edit icon modal to render a preview of the chosen unsaved icon */
+ previewIcon?: JSX.Element;
}
const SoftwareNameCell = ({
@@ -173,8 +175,11 @@ const SoftwareNameCell = ({
iconUrl,
isIosOrIpadosApp = false,
isAndroidPlayStoreApp = false,
+ previewIcon,
}: ISoftwareNameCellProps) => {
- const icon = ;
+ const icon = previewIcon || (
+
+ );
// My device page > Software fake link as entire row opens a modal
if (pageContext === "deviceUser" && !isSelfService) {
return (
diff --git a/frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/EditIconModal/EditIconModal.tsx b/frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/EditIconModal/EditIconModal.tsx
index 6e5fc60a9b..9f86aea7eb 100644
--- a/frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/EditIconModal/EditIconModal.tsx
+++ b/frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/EditIconModal/EditIconModal.tsx
@@ -1,6 +1,8 @@
import React, { useContext, useEffect, useState, useCallback } from "react";
import { useQuery } from "react-query";
import { Tab, Tabs, TabList, TabPanel } from "react-tabs";
+import { noop } from "lodash";
+
import {
IAppStoreApp,
isIpadOrIphoneSoftwareSource,
@@ -10,6 +12,7 @@ import {
import { IInputFieldParseTarget } from "interfaces/form_field";
import { NotificationContext } from "context/notification";
+import { AppContext } from "context/app";
import { INotification } from "interfaces/notification";
import { getErrorReason } from "interfaces/errors";
import softwareAPI from "services/entities/software";
@@ -25,17 +28,14 @@ import Card from "components/Card";
import Button from "components/buttons/Button";
import SoftwareIcon from "pages/SoftwarePage/components/icons/SoftwareIcon";
import TableCount from "components/TableContainer/TableCount";
-import CardHeader from "components/CardHeader";
-import TooltipTruncatedText from "components/TooltipTruncatedText";
import Spinner from "components/Spinner";
import { isSafeImagePreviewUrl } from "pages/SoftwarePage/helpers";
import SoftwareDetailsSummary from "pages/SoftwarePage/components/cards/SoftwareDetailsSummary/SoftwareDetailsSummary";
-import { SELF_SERVICE_SUBHEADER } from "pages/hosts/details/cards/Software/SelfService/SelfService";
+import { BasicSoftwareTable } from "pages/SoftwarePage/components/modals/CategoriesEndUserExperienceModal/CategoriesEndUserExperienceModal";
+import SelfServicePreview from "pages/SoftwarePage/components/cards/SelfServicePreview";
import { TitleVersionsLastUpdatedInfo } from "../SoftwareSummaryCard/TitleVersionsTable/TitleVersionsTable";
-import PreviewSelfServiceIcon from "../../../../../assets/images/preview-self-service-icon.png";
-import PreviewSelfServiceMobileIcon from "../../../../../assets/images/preview-self-service-mobile-icon.png";
const baseClass = "edit-icon-modal";
@@ -152,6 +152,7 @@ const EditIconModal = ({
previewInfo,
}: IEditIconModalProps) => {
const { renderFlash, renderMultiFlash } = useContext(NotificationContext);
+ const { config } = useContext(AppContext);
const isSoftwarePackage = installerType === "package";
const isIosOrIpadosApp = isIpadOrIphoneSoftwareSource(
@@ -474,111 +475,82 @@ const EditIconModal = ({
);
};
- const renderPreviewSelfServiceCard = () => (
-
-
-
-
-
-
-
- {iconState.previewUrl &&
- isSafeImagePreviewUrl(iconState.previewUrl) ? (
-
- ) : (
- // Known limitation: we cannot see VPP app icons as the fallback when a custom icon
- // is set as VPP icon is not returned by the API if a custom icon is returned
-
- )}
-
-
-
-
-
-
-
- );
+ /**
+ * Preview matches preview in Edit Software modal > Categories End User Experience modal
+ * Non-mobile preview:
+ * - uses HTML/CSS instead for maintainability as the self-service UI changes
+ * - dynamic name/icon
+ *
+ * Mobile preview modal:
+ * - uses a screenshot
+ * - dynamic name/icon/version
+ */
- const renderPreviewSelfServiceMobileCard = () => (
-
-
-
-
-
- {iconState.previewUrl && isSafeImagePreviewUrl(iconState.previewUrl) ? (
+ const renderPreviewSelfServiceCard = () => (
+
+ iconState.previewUrl && isSafeImagePreviewUrl(iconState.previewUrl) ? (
) : (
- // Known limitation: we cannot see VPP app icons as the fallback when a custom icon
- // is set as VPP icon is not returned by the API if a custom icon is returned
- )}
-