From d695a0db7aa9f6b1815f26875de8afd96335e030 Mon Sep 17 00:00:00 2001 From: JG Heithcock Date: Thu, 22 Jan 2026 14:00:18 -0800 Subject: [PATCH] MM-67111-Remove Cancel button on User Attributes page (#34945) Remove Cancel button on User Attribute page in System Console. --- .../components/admin_console/save_changes_panel.tsx | 12 +++++------- .../system_properties/system_properties.tsx | 7 +------ 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/webapp/channels/src/components/admin_console/save_changes_panel.tsx b/webapp/channels/src/components/admin_console/save_changes_panel.tsx index ad101911609..8f97d087e74 100644 --- a/webapp/channels/src/components/admin_console/save_changes_panel.tsx +++ b/webapp/channels/src/components/admin_console/save_changes_panel.tsx @@ -4,8 +4,6 @@ import React from 'react'; import {FormattedMessage, useIntl} from 'react-intl'; -import type {Either} from '@mattermost/types/utilities'; - import BlockableButton from 'components/admin_console/blockable_button'; import BlockableLink from 'components/admin_console/blockable_link'; import SaveButton from 'components/save_button'; @@ -17,11 +15,11 @@ type Props = { serverError?: JSX.Element | string; isDisabled?: boolean; savingMessage?: string; -} & Either<{ - cancelLink: string; -}, { - onCancel: () => void; -}>; +} & ( + | {cancelLink: string; onCancel?: never} + | {cancelLink?: never; onCancel: () => void} + | {cancelLink?: never; onCancel?: never} +); // allow a cancelLink or an onCancel handler, or neither const SaveChangesPanel = ({saveNeeded, onClick, saving, serverError, cancelLink, onCancel, isDisabled, savingMessage}: Props) => { const {formatMessage} = useIntl(); diff --git a/webapp/channels/src/components/admin_console/system_properties/system_properties.tsx b/webapp/channels/src/components/admin_console/system_properties/system_properties.tsx index 0dc72781b67..016afa9ba3b 100644 --- a/webapp/channels/src/components/admin_console/system_properties/system_properties.tsx +++ b/webapp/channels/src/components/admin_console/system_properties/system_properties.tsx @@ -34,14 +34,10 @@ export default function SystemProperties(props: Props) { userProperties.save(); }; - const handleCancel = () => { - userProperties.cancel(); - }; - useEffect(() => { // block nav when changes are pending dispatch(setNavigationBlocked(hasChanges)); - }, [hasChanges]); + }, [hasChanges, dispatch]); return (