From f66b41ef379c63b2c20eb378e97007d1f4f380b1 Mon Sep 17 00:00:00 2001 From: Gabriel Hernandez Date: Fri, 18 Oct 2024 14:43:05 +0100 Subject: [PATCH] fix for downloading manual enrolment profile when device token is expired (#23004) relates to #22322 Makes a fix in the UI so that we show an error message when the device token is expired and the user tried to download the mdm enrollment profile. **Showing error when device token is expired and tried to download mdm enrollment profile** https://www.loom.com/share/6306dcf851c24d5f8916ecb2498288cb - [x] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. - [x] Manual QA for all new/changed functionality --- changes/22322-fix-issue-man-enrollment-device | 2 ++ .../details/DeviceUserPage/DeviceUserPage.tsx | 11 +++++- .../ManualEnrollMdmModal.tsx | 36 +++++++++++++------ .../ManualEnrollMdmModal/_styles.scss | 16 +-------- frontend/services/entities/mdm.ts | 5 +++ 5 files changed, 43 insertions(+), 27 deletions(-) create mode 100644 changes/22322-fix-issue-man-enrollment-device diff --git a/changes/22322-fix-issue-man-enrollment-device b/changes/22322-fix-issue-man-enrollment-device new file mode 100644 index 0000000000..c6caafb1b3 --- /dev/null +++ b/changes/22322-fix-issue-man-enrollment-device @@ -0,0 +1,2 @@ +- fix issue when trying to download the manual enrollment profile when device token is expired. We + now show an error for this case. diff --git a/frontend/pages/hosts/details/DeviceUserPage/DeviceUserPage.tsx b/frontend/pages/hosts/details/DeviceUserPage/DeviceUserPage.tsx index e75d125a91..53db103db7 100644 --- a/frontend/pages/hosts/details/DeviceUserPage/DeviceUserPage.tsx +++ b/frontend/pages/hosts/details/DeviceUserPage/DeviceUserPage.tsx @@ -23,6 +23,8 @@ import Spinner from "components/Spinner"; import Button from "components/buttons/Button"; import TabsWrapper from "components/TabsWrapper"; import Icon from "components/Icon/Icon"; +import FlashMessage from "components/FlashMessage"; + import { normalizeEmptyValues } from "utilities/helpers"; import PATHS from "router/paths"; import { @@ -87,7 +89,9 @@ const DeviceUserPage = ({ }: IDeviceUserPageProps): JSX.Element => { const deviceAuthToken = device_auth_token; - const { renderFlash } = useContext(NotificationContext); + const { renderFlash, notification, hideFlash } = useContext( + NotificationContext + ); const [isPremiumTier, setIsPremiumTier] = useState(false); const [showInfoModal, setShowInfoModal] = useState(false); @@ -477,6 +481,11 @@ const DeviceUserPage = ({ return (
+