From b2c58102dd1c2789d1dc3581d973dbce00253c45 Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Tue, 10 Dec 2024 14:38:04 +0100 Subject: [PATCH] chore(unl-204): remove uses of toast text and confetti (#8941) As of PR #8935, we no longer support both text and title, and confetti has been removed. This PR: - removes `confetti` from the toast interface - merges `text` and `title` into `text` and updates its uses across the codebase. - readjusts the text where necessary. --- .../apiToken/ApiTokenDocs/ApiTokenDocs.tsx | 2 +- .../ConfirmToken/UserToken/UserToken.tsx | 4 ++-- .../admin/auth/GoogleAuth/GoogleAuth.tsx | 2 +- .../admin/auth/OidcAuth/OidcAuth.tsx | 2 +- .../admin/auth/PasswordAuth/PasswordAuth.tsx | 3 +-- .../admin/auth/SamlAuth/SamlAuth.tsx | 2 +- .../admin/auth/ScimSettings/ScimSettings.tsx | 2 +- .../admin/banners/BannerModal/BannerModal.tsx | 2 +- .../banners/BannersTable/BannersTable.tsx | 4 ++-- .../src/component/admin/cors/CorsForm.tsx | 2 +- .../admin/groups/CreateGroup/CreateGroup.tsx | 4 +--- .../admin/groups/EditGroup/EditGroup.tsx | 2 +- .../Group/EditGroupUsers/EditGroupUsers.tsx | 2 +- .../Group/RemoveGroupUser/RemoveGroupUser.tsx | 2 +- .../admin/groups/RemoveGroup/RemoveGroup.tsx | 2 +- .../src/component/admin/license/License.tsx | 2 +- .../admin/maintenance/MaintenanceToggle.tsx | 2 +- .../admin/roles/RoleModal/RoleModal.tsx | 2 +- .../admin/roles/RolesTable/RolesTable.tsx | 2 +- .../ServiceAccountModal.tsx | 2 +- .../ServiceAccountTokens.tsx | 4 ++-- .../ServiceAccountsTable.tsx | 2 +- .../admin/users/EditUser/EditUser.tsx | 2 +- .../InactiveUsersList/InactiveUsersList.tsx | 4 ++-- .../admin/users/LinkField/LinkField.tsx | 4 ++-- .../ChangePassword/ChangePassword.tsx | 3 +-- .../admin/users/UsersList/UsersList.tsx | 2 +- .../src/component/application/Application.tsx | 3 +-- .../ApplicationUpdate/ApplicationUpdate.tsx | 3 +-- .../ArchiveTable/ArchiveTable.test.tsx | 4 ++-- .../ArchivedFeatureDeleteConfirm.tsx | 5 +--- .../ArchivedFeatureReviveConfirm.tsx | 3 +-- .../Changes/Change/ChangeActions.tsx | 2 +- .../Changes/Change/EditChange.tsx | 2 +- .../ChangeRequestOverview.tsx | 6 ----- .../ChangeRequestTitle.tsx | 2 +- .../commandBar/CommandBarFeedback.tsx | 2 +- .../CopyApiTokenButton/CopyApiTokenButton.tsx | 2 +- .../RemoveApiTokenButton.tsx | 2 +- .../FeatureArchiveDialog.tsx | 11 +++------ .../FeatureStaleDialog/FeatureStaleDialog.tsx | 6 ++--- .../common/FormTemplate/FormTemplate.tsx | 6 ++--- .../common/ToastRenderer/Toast/Toast.tsx | 4 ++-- .../ContextList/ContextList/ContextList.tsx | 3 +-- .../CreateUnleashContext.tsx | 3 +-- .../context/EditContext/EditContext.tsx | 2 +- .../CreateEnvironment/CreateEnvironment.tsx | 3 +-- .../EditEnvironment/EditEnvironment.tsx | 2 +- .../EnvironmentActionCell.tsx | 10 ++++---- .../EnvironmentCloneModal.tsx | 2 +- .../Dependencies/useManageDependency.ts | 10 +++----- .../feature/EditFeature/EditFeature.tsx | 2 +- .../FeatureStrategyCreate.tsx | 6 ++--- .../FeatureStrategyEdit.tsx | 6 ++--- .../FeatureStrategyEmpty.tsx | 5 +--- .../FeatureReleasePlanCard.tsx | 2 +- .../FeatureToggleList/BulkDisableDialog.tsx | 6 ++--- .../FeatureToggleList/BulkEnableDialog.tsx | 6 ++--- .../EnvironmentAccordionBody.tsx | 5 ++-- .../CopyStrategyIconMenu.tsx | 3 +-- .../DialogStrategyRemove.tsx | 4 ++-- .../hooks/useEnableDisable.ts | 2 +- .../hooks/useSuggestEnableDisable.ts | 2 +- .../FeatureOverviewMetaData/DependencyRow.tsx | 5 ++-- .../FeatureOverviewMetaData.test.tsx | 2 +- .../OldDependencyRow.tsx | 5 ++-- .../FeatureOverviewMetaData/TagRow.tsx | 3 +-- .../FeatureOverviewSidePanelTags.tsx | 3 +-- .../ManageTagsDialog/ManageTagsDialog.tsx | 10 ++------ .../FeatureOverviewEnvironmentBody.tsx | 5 ++-- .../ReleasePlan/ReleasePlan.tsx | 4 ++-- .../FeatureSettingsProject.tsx | 2 +- .../FeatureEnvironmentVariants.tsx | 8 +++---- .../feature/FeatureView/FeatureView.tsx | 2 +- .../FeatureTypeForm/FeatureTypeForm.tsx | 2 +- .../feedback/FeedbackCES/FeedbackCESForm.tsx | 3 +-- .../feedbackNew/FeedbackComponent.tsx | 2 +- .../IntegrationDelete/IntegrationDelete.tsx | 3 +-- .../IntegrationForm/IntegrationForm.tsx | 5 ++-- .../IntegrationCardMenu.tsx | 8 +++---- .../onboarding/dialog/CodeRenderer.tsx | 2 +- .../Playground/AdvancedPlayground.tsx | 8 +++---- .../PlaygroundCodeFieldset.tsx | 2 +- .../ArchiveProject/ArchiveProjectDialogue.tsx | 3 +-- .../CreateProjectDialog.tsx | 4 +--- .../DeleteProject/DeleteProjectDialogue.tsx | 3 +-- .../Import/configure/ConfigurationStage.tsx | 4 ++-- .../Project/Import/import/ImportStage.tsx | 2 +- .../Import/validate/ValidationStage.tsx | 2 +- .../CreateFeatureDialog.tsx | 4 +--- .../src/component/project/Project/Project.tsx | 2 +- .../ActionsCell/ActionsCell.tsx | 2 +- .../useFeatureToggleSwitch.tsx | 6 ++--- .../ManageTags.tsx | 24 +++++++++---------- .../MoreActions.tsx | 2 -- .../ChangeRequestTable.tsx | 3 +-- .../ProjectActionsModal.tsx | 2 +- .../ProjectActionsTable.tsx | 4 ++-- .../EditDefaultStrategy.tsx | 3 +-- .../EditProject/UpdateEnterpriseSettings.tsx | 2 +- .../Settings/EditProject/UpdateProject.tsx | 2 +- .../ProjectAccessAssign.tsx | 2 +- .../ProjectAccessTable/ProjectAccessTable.tsx | 4 ++-- .../ProjectEnvironment/ProjectEnvironment.tsx | 9 +++---- .../ReviveProjectDialog.tsx | 3 +-- .../ReleasePlanTemplateCardMenu.tsx | 1 - .../CreateReleasePlanTemplate.tsx | 2 +- .../EditReleasePlanTemplate.tsx | 2 +- .../segments/CreateSegment/CreateSegment.tsx | 3 +-- .../segments/EditSegment/EditSegment.tsx | 2 +- .../RemoveSegmentButton.tsx | 2 +- .../SignalEndpointsFormURL.tsx | 2 +- .../SignalEndpointsTokens.tsx | 4 ++-- .../SignalEndpointsModal.tsx | 4 +--- .../SignalEndpointsTable.tsx | 6 ++--- .../CreateStrategy/CreateStrategy.tsx | 4 +--- .../strategies/EditStrategy/EditStrategy.tsx | 3 +-- .../StrategiesList/StrategiesList.tsx | 9 +++---- .../tags/CreateTagType/CreateTagType.tsx | 3 +-- .../tags/EditTagType/EditTagType.tsx | 2 +- .../tags/TagTypeList/TagTypeList.tsx | 2 +- frontend/src/component/user/HostedAuth.tsx | 3 +-- .../src/component/user/PasswordAuth.test.tsx | 4 ++-- frontend/src/component/user/PasswordAuth.tsx | 3 +-- .../user/Profile/PasswordTab/PasswordTab.tsx | 3 +-- .../DeletePersonalAPIToken.tsx | 2 +- .../ProductivityEmailSubscription.test.tsx | 2 +- .../ProductivityEmailSubscription.tsx | 4 ++-- frontend/src/contexts/UIContext.ts | 1 - .../useFavoriteFeaturesApi.ts | 4 ++-- .../useFavoriteProjectsApi.ts | 4 ++-- .../src/hooks/useChangeRequestAddStrategy.ts | 4 ++-- frontend/src/hooks/useChangeRequestToggle.ts | 2 +- frontend/src/hooks/useToast.tsx | 3 +-- frontend/src/interfaces/toast.ts | 4 +--- 135 files changed, 192 insertions(+), 293 deletions(-) diff --git a/frontend/src/component/admin/apiToken/ApiTokenDocs/ApiTokenDocs.tsx b/frontend/src/component/admin/apiToken/ApiTokenDocs/ApiTokenDocs.tsx index 471d99a27406..c5bb41f51cbe 100644 --- a/frontend/src/component/admin/apiToken/ApiTokenDocs/ApiTokenDocs.tsx +++ b/frontend/src/component/admin/apiToken/ApiTokenDocs/ApiTokenDocs.tsx @@ -22,7 +22,7 @@ export const ApiTokenDocs = () => { copy(url); setToastData({ type: 'success', - title: 'Copied to clipboard', + text: 'Copied to clipboard', }); }; diff --git a/frontend/src/component/admin/apiToken/ConfirmToken/UserToken/UserToken.tsx b/frontend/src/component/admin/apiToken/ConfirmToken/UserToken/UserToken.tsx index edc4f66e9074..8181aa3a315b 100644 --- a/frontend/src/component/admin/apiToken/ConfirmToken/UserToken/UserToken.tsx +++ b/frontend/src/component/admin/apiToken/ConfirmToken/UserToken/UserToken.tsx @@ -14,12 +14,12 @@ export const UserToken = ({ token }: IUserTokenProps) => { if (copy(token)) { setToastData({ type: 'success', - title: 'Token copied to clipboard', + text: 'Token copied to clipboard', }); } else setToastData({ type: 'error', - title: 'Could not copy token', + text: 'Could not copy token', }); }; diff --git a/frontend/src/component/admin/auth/GoogleAuth/GoogleAuth.tsx b/frontend/src/component/admin/auth/GoogleAuth/GoogleAuth.tsx index 333166b9c1e3..400f6b1420e0 100644 --- a/frontend/src/component/admin/auth/GoogleAuth/GoogleAuth.tsx +++ b/frontend/src/component/admin/auth/GoogleAuth/GoogleAuth.tsx @@ -59,7 +59,7 @@ export const GoogleAuth = () => { try { await updateSettings(removeEmptyStringFields(data)); setToastData({ - title: 'Settings stored', + text: 'Settings stored', type: 'success', }); } catch (error: unknown) { diff --git a/frontend/src/component/admin/auth/OidcAuth/OidcAuth.tsx b/frontend/src/component/admin/auth/OidcAuth/OidcAuth.tsx index b73bbf122355..514701e397d3 100644 --- a/frontend/src/component/admin/auth/OidcAuth/OidcAuth.tsx +++ b/frontend/src/component/admin/auth/OidcAuth/OidcAuth.tsx @@ -97,7 +97,7 @@ export const OidcAuth = () => { try { await updateSettings(removeEmptyStringFields(data)); setToastData({ - title: 'Settings stored', + text: 'Settings stored', type: 'success', }); } catch (error: unknown) { diff --git a/frontend/src/component/admin/auth/PasswordAuth/PasswordAuth.tsx b/frontend/src/component/admin/auth/PasswordAuth/PasswordAuth.tsx index ccaf9a10c1af..1360b75011c2 100644 --- a/frontend/src/component/admin/auth/PasswordAuth/PasswordAuth.tsx +++ b/frontend/src/component/admin/auth/PasswordAuth/PasswordAuth.tsx @@ -50,8 +50,7 @@ export const PasswordAuth = () => { await updateSettings(settings); refetch(); setToastData({ - title: 'Successfully saved', - text: 'Password authentication settings stored.', + text: 'Password authentication settings stored', autoHideDuration: 4000, type: 'success', show: true, diff --git a/frontend/src/component/admin/auth/SamlAuth/SamlAuth.tsx b/frontend/src/component/admin/auth/SamlAuth/SamlAuth.tsx index 5b43164b8d85..dc06e26ba276 100644 --- a/frontend/src/component/admin/auth/SamlAuth/SamlAuth.tsx +++ b/frontend/src/component/admin/auth/SamlAuth/SamlAuth.tsx @@ -88,7 +88,7 @@ export const SamlAuth = () => { try { await updateSettings(removeEmptyStringFields(data)); setToastData({ - title: 'Settings stored', + text: 'Settings stored', type: 'success', }); } catch (error: unknown) { diff --git a/frontend/src/component/admin/auth/ScimSettings/ScimSettings.tsx b/frontend/src/component/admin/auth/ScimSettings/ScimSettings.tsx index 3c709ffd3728..5efcee8330ea 100644 --- a/frontend/src/component/admin/auth/ScimSettings/ScimSettings.tsx +++ b/frontend/src/component/admin/auth/ScimSettings/ScimSettings.tsx @@ -58,7 +58,7 @@ export const ScimSettings = () => { } setToastData({ - title: 'Settings stored', + text: 'Settings stored', type: 'success', }); await refetch(); diff --git a/frontend/src/component/admin/banners/BannerModal/BannerModal.tsx b/frontend/src/component/admin/banners/BannerModal/BannerModal.tsx index d239352c7f55..712363f456d6 100644 --- a/frontend/src/component/admin/banners/BannerModal/BannerModal.tsx +++ b/frontend/src/component/admin/banners/BannerModal/BannerModal.tsx @@ -101,7 +101,7 @@ export const BannerModal = ({ banner, open, setOpen }: IBannerModalProps) => { await addBanner(payload); } setToastData({ - title: `Banner ${editing ? 'updated' : 'added'} successfully`, + text: `Banner ${editing ? 'updated' : 'added'} successfully`, type: 'success', }); refetch(); diff --git a/frontend/src/component/admin/banners/BannersTable/BannersTable.tsx b/frontend/src/component/admin/banners/BannersTable/BannersTable.tsx index c782e985196b..a301c671b9aa 100644 --- a/frontend/src/component/admin/banners/BannersTable/BannersTable.tsx +++ b/frontend/src/component/admin/banners/BannersTable/BannersTable.tsx @@ -42,7 +42,7 @@ export const BannersTable = () => { try { await toggleBanner(banner.id, enabled); setToastData({ - title: `"${banner.message}" has been ${ + text: `"${banner.message}" has been ${ enabled ? 'enabled' : 'disabled' }`, type: 'success', @@ -57,7 +57,7 @@ export const BannersTable = () => { try { await removeBanner(banner.id); setToastData({ - title: `"${banner.message}" has been deleted`, + text: `"${banner.message}" has been deleted`, type: 'success', }); refetch(); diff --git a/frontend/src/component/admin/cors/CorsForm.tsx b/frontend/src/component/admin/cors/CorsForm.tsx index b7a2f93285d2..c3885e8821c5 100644 --- a/frontend/src/component/admin/cors/CorsForm.tsx +++ b/frontend/src/component/admin/cors/CorsForm.tsx @@ -25,7 +25,7 @@ export const CorsForm = ({ frontendApiOrigins }: ICorsFormProps) => { event.preventDefault(); await setFrontendSettings(split); setValue(formatInputValue(split)); - setToastData({ title: 'Settings saved', type: 'success' }); + setToastData({ text: 'Settings saved', type: 'success' }); } catch (error) { setToastApiError(formatUnknownError(error)); } diff --git a/frontend/src/component/admin/groups/CreateGroup/CreateGroup.tsx b/frontend/src/component/admin/groups/CreateGroup/CreateGroup.tsx index 24c0354f14e8..b2750cfd3f5d 100644 --- a/frontend/src/component/admin/groups/CreateGroup/CreateGroup.tsx +++ b/frontend/src/component/admin/groups/CreateGroup/CreateGroup.tsx @@ -48,9 +48,7 @@ export const CreateGroup = () => { const group = await createGroup(payload); navigate(`/admin/groups/${group.id}`); setToastData({ - title: 'Group created successfully', - text: 'Now you can start using your group.', - confetti: true, + text: 'Group created successfully', type: 'success', }); } catch (error: unknown) { diff --git a/frontend/src/component/admin/groups/EditGroup/EditGroup.tsx b/frontend/src/component/admin/groups/EditGroup/EditGroup.tsx index 5785920229f7..5294d36f6591 100644 --- a/frontend/src/component/admin/groups/EditGroup/EditGroup.tsx +++ b/frontend/src/component/admin/groups/EditGroup/EditGroup.tsx @@ -90,7 +90,7 @@ export const EditGroup = ({ refetchGroups(); navigate(GO_BACK); setToastData({ - title: 'Group updated successfully', + text: 'Group updated successfully', type: 'success', }); } catch (error: unknown) { diff --git a/frontend/src/component/admin/groups/Group/EditGroupUsers/EditGroupUsers.tsx b/frontend/src/component/admin/groups/Group/EditGroupUsers/EditGroupUsers.tsx index 9fb06b7acefd..ca611fa24469 100644 --- a/frontend/src/component/admin/groups/Group/EditGroupUsers/EditGroupUsers.tsx +++ b/frontend/src/component/admin/groups/Group/EditGroupUsers/EditGroupUsers.tsx @@ -77,7 +77,7 @@ export const EditGroupUsers: FC = ({ refetchGroups(); setOpen(false); setToastData({ - title: 'Group users saved successfully', + text: 'Group users saved successfully', type: 'success', }); } catch (error: unknown) { diff --git a/frontend/src/component/admin/groups/Group/RemoveGroupUser/RemoveGroupUser.tsx b/frontend/src/component/admin/groups/Group/RemoveGroupUser/RemoveGroupUser.tsx index 6482eb97dee1..e758f711eb26 100644 --- a/frontend/src/component/admin/groups/Group/RemoveGroupUser/RemoveGroupUser.tsx +++ b/frontend/src/component/admin/groups/Group/RemoveGroupUser/RemoveGroupUser.tsx @@ -38,7 +38,7 @@ export const RemoveGroupUser: FC = ({ refetchGroup(); setOpen(false); setToastData({ - title: 'User removed from group successfully', + text: 'User removed from group successfully', type: 'success', }); } catch (error: unknown) { diff --git a/frontend/src/component/admin/groups/RemoveGroup/RemoveGroup.tsx b/frontend/src/component/admin/groups/RemoveGroup/RemoveGroup.tsx index 6b58ea2e6af8..5f09a2e7e8d8 100644 --- a/frontend/src/component/admin/groups/RemoveGroup/RemoveGroup.tsx +++ b/frontend/src/component/admin/groups/RemoveGroup/RemoveGroup.tsx @@ -31,7 +31,7 @@ export const RemoveGroup: FC = ({ setOpen(false); navigate('/admin/groups'); setToastData({ - title: 'Group removed successfully', + text: 'Group removed successfully', type: 'success', }); } catch (error: unknown) { diff --git a/frontend/src/component/admin/license/License.tsx b/frontend/src/component/admin/license/License.tsx index 40d4e2e2a3ab..f0b5f7b90e8e 100644 --- a/frontend/src/component/admin/license/License.tsx +++ b/frontend/src/component/admin/license/License.tsx @@ -58,7 +58,7 @@ export const License = () => { try { await updateLicenseKey(token); setToastData({ - title: 'License key updated', + text: 'License key updated', type: 'success', }); refetchLicense(); diff --git a/frontend/src/component/admin/maintenance/MaintenanceToggle.tsx b/frontend/src/component/admin/maintenance/MaintenanceToggle.tsx index a564a2052160..50c4d88160bf 100644 --- a/frontend/src/component/admin/maintenance/MaintenanceToggle.tsx +++ b/frontend/src/component/admin/maintenance/MaintenanceToggle.tsx @@ -45,7 +45,7 @@ export const MaintenanceToggle = () => { const updateEnabled = async () => { setToastData({ type: 'success', - title: `Maintenance mode has been successfully ${ + text: `Maintenance mode has been successfully ${ enabled ? 'disabled' : 'enabled' }`, }); diff --git a/frontend/src/component/admin/roles/RoleModal/RoleModal.tsx b/frontend/src/component/admin/roles/RoleModal/RoleModal.tsx index 6e3272ac7c13..14c050b9564c 100644 --- a/frontend/src/component/admin/roles/RoleModal/RoleModal.tsx +++ b/frontend/src/component/admin/roles/RoleModal/RoleModal.tsx @@ -96,7 +96,7 @@ export const RoleModal = ({ await addRole(payload); } setToastData({ - title: `Role ${editing ? 'updated' : 'added'} successfully`, + text: `Role ${editing ? 'updated' : 'added'} successfully`, type: 'success', }); refetch(); diff --git a/frontend/src/component/admin/roles/RolesTable/RolesTable.tsx b/frontend/src/component/admin/roles/RolesTable/RolesTable.tsx index aeb4ba46c32a..e6f56faa894f 100644 --- a/frontend/src/component/admin/roles/RolesTable/RolesTable.tsx +++ b/frontend/src/component/admin/roles/RolesTable/RolesTable.tsx @@ -52,7 +52,7 @@ export const RolesTable = ({ try { await removeRole(role.id); setToastData({ - title: `${role.name} has been deleted`, + text: `${role.name} has been deleted`, type: 'success', }); refetch(); diff --git a/frontend/src/component/admin/serviceAccounts/ServiceAccountsTable/ServiceAccountModal/ServiceAccountModal.tsx b/frontend/src/component/admin/serviceAccounts/ServiceAccountsTable/ServiceAccountModal/ServiceAccountModal.tsx index 5ead0bd51f80..f37a2d4804db 100644 --- a/frontend/src/component/admin/serviceAccounts/ServiceAccountsTable/ServiceAccountModal/ServiceAccountModal.tsx +++ b/frontend/src/component/admin/serviceAccounts/ServiceAccountsTable/ServiceAccountModal/ServiceAccountModal.tsx @@ -196,7 +196,7 @@ export const ServiceAccountModal = ({ } } setToastData({ - title: `Service account ${ + text: `Service account ${ editing ? 'updated' : 'added' } successfully`, type: 'success', diff --git a/frontend/src/component/admin/serviceAccounts/ServiceAccountsTable/ServiceAccountModal/ServiceAccountTokens/ServiceAccountTokens.tsx b/frontend/src/component/admin/serviceAccounts/ServiceAccountsTable/ServiceAccountModal/ServiceAccountTokens/ServiceAccountTokens.tsx index 44532adf57ac..f868fa8e5406 100644 --- a/frontend/src/component/admin/serviceAccounts/ServiceAccountsTable/ServiceAccountModal/ServiceAccountTokens/ServiceAccountTokens.tsx +++ b/frontend/src/component/admin/serviceAccounts/ServiceAccountsTable/ServiceAccountModal/ServiceAccountTokens/ServiceAccountTokens.tsx @@ -127,7 +127,7 @@ export const ServiceAccountTokens = ({ setNewToken(token); setTokenOpen(true); setToastData({ - title: 'Token created successfully', + text: 'Token created successfully', type: 'success', }); } catch (error: unknown) { @@ -146,7 +146,7 @@ export const ServiceAccountTokens = ({ refetchTokens(); setDeleteOpen(false); setToastData({ - title: 'Token deleted successfully', + text: 'Token deleted successfully', type: 'success', }); } catch (error: unknown) { diff --git a/frontend/src/component/admin/serviceAccounts/ServiceAccountsTable/ServiceAccountsTable.tsx b/frontend/src/component/admin/serviceAccounts/ServiceAccountsTable/ServiceAccountsTable.tsx index 56a5fa89ae73..9b59d52f97f9 100644 --- a/frontend/src/component/admin/serviceAccounts/ServiceAccountsTable/ServiceAccountsTable.tsx +++ b/frontend/src/component/admin/serviceAccounts/ServiceAccountsTable/ServiceAccountsTable.tsx @@ -48,7 +48,7 @@ export const ServiceAccountsTable = () => { try { await removeServiceAccount(serviceAccount.id); setToastData({ - title: `${serviceAccount.name} has been deleted`, + text: `${serviceAccount.name} has been deleted`, type: 'success', }); refetch(); diff --git a/frontend/src/component/admin/users/EditUser/EditUser.tsx b/frontend/src/component/admin/users/EditUser/EditUser.tsx index 289de304181c..683f9f926589 100644 --- a/frontend/src/component/admin/users/EditUser/EditUser.tsx +++ b/frontend/src/component/admin/users/EditUser/EditUser.tsx @@ -60,7 +60,7 @@ const EditUser = () => { refetch(); navigate('/admin/users'); setToastData({ - title: 'User information updated', + text: 'User information updated', type: 'success', }); } catch (error: unknown) { diff --git a/frontend/src/component/admin/users/InactiveUsersList/InactiveUsersList.tsx b/frontend/src/component/admin/users/InactiveUsersList/InactiveUsersList.tsx index beeaf06dbc4f..acc868bba829 100644 --- a/frontend/src/component/admin/users/InactiveUsersList/InactiveUsersList.tsx +++ b/frontend/src/component/admin/users/InactiveUsersList/InactiveUsersList.tsx @@ -71,7 +71,7 @@ export const InactiveUsersList = () => { try { await deleteInactiveUsers(inactiveUsers.map((i) => i.id)); setToastData({ - title: `Inactive users has been deleted`, + text: `Inactive users has been deleted`, type: 'success', }); setShowDelInactiveDialog(false); @@ -84,7 +84,7 @@ export const InactiveUsersList = () => { try { await removeUser(userId); setToastData({ - title: `User has been deleted`, + text: `User has been deleted`, type: 'success', }); refetchInactiveUsers(); diff --git a/frontend/src/component/admin/users/LinkField/LinkField.tsx b/frontend/src/component/admin/users/LinkField/LinkField.tsx index 68e4200f6aff..b52c20389d56 100644 --- a/frontend/src/component/admin/users/LinkField/LinkField.tsx +++ b/frontend/src/component/admin/users/LinkField/LinkField.tsx @@ -51,7 +51,7 @@ export const LinkField: FC = ({ const setError = () => setToastData({ type: 'error', - title: errorTitle, + text: errorTitle, }); const handleCopy = () => { @@ -61,7 +61,7 @@ export const LinkField: FC = ({ .then(() => { setToastData({ type: 'success', - title: successTitle, + text: successTitle, }); onCopy?.(); }) diff --git a/frontend/src/component/admin/users/UsersList/ChangePassword/ChangePassword.tsx b/frontend/src/component/admin/users/UsersList/ChangePassword/ChangePassword.tsx index 3534529650b0..991c60332b80 100644 --- a/frontend/src/component/admin/users/UsersList/ChangePassword/ChangePassword.tsx +++ b/frontend/src/component/admin/users/UsersList/ChangePassword/ChangePassword.tsx @@ -62,8 +62,7 @@ const ChangePassword = ({ setData({}); closeDialog(); setToastData({ - title: 'Password changed successfully', - text: 'The user can now sign in using the new password.', + text: 'Password changed successfully', type: 'success', }); } catch (error: unknown) { diff --git a/frontend/src/component/admin/users/UsersList/UsersList.tsx b/frontend/src/component/admin/users/UsersList/UsersList.tsx index 40b57a15c4d0..687e60f5588e 100644 --- a/frontend/src/component/admin/users/UsersList/UsersList.tsx +++ b/frontend/src/component/admin/users/UsersList/UsersList.tsx @@ -112,7 +112,7 @@ const UsersList = () => { try { await removeUser(user.id); setToastData({ - title: `${user.name} has been deleted`, + text: `${user.name} has been deleted`, type: 'success', }); refetch(); diff --git a/frontend/src/component/application/Application.tsx b/frontend/src/component/application/Application.tsx index 3a78bde15695..df9618063581 100644 --- a/frontend/src/component/application/Application.tsx +++ b/frontend/src/component/application/Application.tsx @@ -93,8 +93,7 @@ export const Application = () => { try { await deleteApplication(appName); setToastData({ - title: 'Deleted Successfully', - text: 'Application deleted successfully', + text: 'Deleted Successfully', type: 'success', }); navigate('/applications'); diff --git a/frontend/src/component/application/ApplicationUpdate/ApplicationUpdate.tsx b/frontend/src/component/application/ApplicationUpdate/ApplicationUpdate.tsx index 0ac2a0d25841..62c577948862 100644 --- a/frontend/src/component/application/ApplicationUpdate/ApplicationUpdate.tsx +++ b/frontend/src/component/application/ApplicationUpdate/ApplicationUpdate.tsx @@ -40,8 +40,7 @@ export const ApplicationUpdate = ({ application }: IApplicationUpdateProps) => { refetchApplication(); setToastData({ type: 'success', - title: 'Updated Successfully', - text: `${field} successfully updated`, + text: 'Updated Successfully', }); } catch (error: unknown) { setToastApiError(formatUnknownError(error)); diff --git a/frontend/src/component/archive/ArchiveTable/ArchiveTable.test.tsx b/frontend/src/component/archive/ArchiveTable/ArchiveTable.test.tsx index 10901aeaf9bd..010d4ee45a95 100644 --- a/frontend/src/component/archive/ArchiveTable/ArchiveTable.test.tsx +++ b/frontend/src/component/archive/ArchiveTable/ArchiveTable.test.tsx @@ -103,7 +103,7 @@ test('should show confirm dialog when reviving flag', async () => { }); fireEvent.click(reviveFlagsButton); - await screen.findByText("And we're back!"); + await screen.findByText('Feature flags revived'); }); test('should show confirm dialog when batch reviving flag', async () => { @@ -134,7 +134,7 @@ test('should show confirm dialog when batch reviving flag', async () => { }); fireEvent.click(reviveTogglesButton); - await screen.findByText("And we're back!"); + await screen.findByText('Feature flags revived'); }); test('should show info box when disableAllEnvsOnRevive flag is on', async () => { diff --git a/frontend/src/component/archive/ArchiveTable/ArchivedFeatureActionCell/ArchivedFeatureDeleteConfirm/ArchivedFeatureDeleteConfirm.tsx b/frontend/src/component/archive/ArchiveTable/ArchivedFeatureActionCell/ArchivedFeatureDeleteConfirm/ArchivedFeatureDeleteConfirm.tsx index 4793db7e6cc2..f9dc383f7d8e 100644 --- a/frontend/src/component/archive/ArchiveTable/ArchivedFeatureActionCell/ArchivedFeatureDeleteConfirm/ArchivedFeatureDeleteConfirm.tsx +++ b/frontend/src/component/archive/ArchiveTable/ArchivedFeatureActionCell/ArchivedFeatureDeleteConfirm/ArchivedFeatureDeleteConfirm.tsx @@ -49,10 +49,7 @@ export const ArchivedFeatureDeleteConfirm = ({ await refetch(); setToastData({ type: 'success', - title: `Feature ${singularOrPluralFlags} deleted`, - text: `You have successfully deleted the following feature ${singularOrPluralFlags}: ${deletedFeatures.join( - ', ', - )}.`, + text: `Feature ${singularOrPluralFlags} deleted`, }); } catch (error: unknown) { setToastApiError(formatUnknownError(error)); diff --git a/frontend/src/component/archive/ArchiveTable/ArchivedFeatureActionCell/ArchivedFeatureReviveConfirm/ArchivedFeatureReviveConfirm.tsx b/frontend/src/component/archive/ArchiveTable/ArchivedFeatureActionCell/ArchivedFeatureReviveConfirm/ArchivedFeatureReviveConfirm.tsx index 3a1cfeee66fb..a0e20998856c 100644 --- a/frontend/src/component/archive/ArchiveTable/ArchivedFeatureActionCell/ArchivedFeatureReviveConfirm/ArchivedFeatureReviveConfirm.tsx +++ b/frontend/src/component/archive/ArchiveTable/ArchivedFeatureActionCell/ArchivedFeatureReviveConfirm/ArchivedFeatureReviveConfirm.tsx @@ -39,8 +39,7 @@ export const ArchivedFeatureReviveConfirm = ({ await refetch(); setToastData({ type: 'success', - title: "And we're back!", - text: 'The feature flags have been revived.', + text: 'Feature flags revived', }); } catch (error: unknown) { setToastApiError(formatUnknownError(error)); diff --git a/frontend/src/component/changeRequest/ChangeRequest/Changes/Change/ChangeActions.tsx b/frontend/src/component/changeRequest/ChangeRequest/Changes/Change/ChangeActions.tsx index 82419141e6cd..3eecbfc62730 100644 --- a/frontend/src/component/changeRequest/ChangeRequest/Changes/Change/ChangeActions.tsx +++ b/frontend/src/component/changeRequest/ChangeRequest/Changes/Change/ChangeActions.tsx @@ -98,7 +98,7 @@ export const ChangeActions: FC<{ change.id, ); setToastData({ - title: 'Change discarded from change request draft.', + text: 'Change discarded from change request draft.', type: 'success', }); onRefetch?.(); diff --git a/frontend/src/component/changeRequest/ChangeRequest/Changes/Change/EditChange.tsx b/frontend/src/component/changeRequest/ChangeRequest/Changes/Change/EditChange.tsx index d6cf55842c32..79b19facbeeb 100644 --- a/frontend/src/component/changeRequest/ChangeRequest/Changes/Change/EditChange.tsx +++ b/frontend/src/component/changeRequest/ChangeRequest/Changes/Change/EditChange.tsx @@ -125,7 +125,7 @@ export const EditChange = ({ }); onSubmit(); setToastData({ - title: 'Change updated', + text: 'Change updated', type: 'success', }); } catch (error: unknown) { diff --git a/frontend/src/component/changeRequest/ChangeRequestOverview/ChangeRequestOverview.tsx b/frontend/src/component/changeRequest/ChangeRequestOverview/ChangeRequestOverview.tsx index 08d42c469dab..8c66df25d8c8 100644 --- a/frontend/src/component/changeRequest/ChangeRequestOverview/ChangeRequestOverview.tsx +++ b/frontend/src/component/changeRequest/ChangeRequestOverview/ChangeRequestOverview.tsx @@ -136,7 +136,6 @@ export const ChangeRequestOverview: FC = () => { refetchActionableChangeRequests(); setToastData({ type: 'success', - title: 'Success', text: 'Changes applied', }); } catch (error: unknown) { @@ -159,7 +158,6 @@ export const ChangeRequestOverview: FC = () => { refetchActionableChangeRequests(); setToastData({ type: 'success', - title: 'Success', text: 'Changes scheduled', }); } catch (error: unknown) { @@ -177,7 +175,6 @@ export const ChangeRequestOverview: FC = () => { await refetchChangeRequest(); setToastData({ type: 'success', - title: 'Success', text: 'Comment added', }); } catch (error: unknown) { @@ -199,7 +196,6 @@ export const ChangeRequestOverview: FC = () => { refetchActionableChangeRequests(); setToastData({ type: 'success', - title: 'Success', text: 'Changes cancelled', }); } catch (error: unknown) { @@ -221,7 +217,6 @@ export const ChangeRequestOverview: FC = () => { setToastData({ type: 'success', - title: 'Success', text: 'Changes rejected', }); refetchChangeRequestOpen(); @@ -244,7 +239,6 @@ export const ChangeRequestOverview: FC = () => { refetchChangeRequestOpen(); setToastData({ type: 'success', - title: 'Success', text: 'Changes approved', }); } catch (error: unknown) { diff --git a/frontend/src/component/changeRequest/ChangeRequestSidebar/EnvironmentChangeRequest/ChangeRequestTitle.tsx b/frontend/src/component/changeRequest/ChangeRequestSidebar/EnvironmentChangeRequest/ChangeRequestTitle.tsx index e740baca08ef..1dc9c13cffc8 100644 --- a/frontend/src/component/changeRequest/ChangeRequestSidebar/EnvironmentChangeRequest/ChangeRequestTitle.tsx +++ b/frontend/src/component/changeRequest/ChangeRequestSidebar/EnvironmentChangeRequest/ChangeRequestTitle.tsx @@ -49,7 +49,7 @@ export const ChangeRequestTitle: FC<{ ); setToastData({ type: 'success', - title: 'Change request title updated!', + text: 'Change request title updated!', }); } catch (error: unknown) { setToastApiError(formatUnknownError(error)); diff --git a/frontend/src/component/commandBar/CommandBarFeedback.tsx b/frontend/src/component/commandBar/CommandBarFeedback.tsx index 060ffe6d5c08..42ef28da65ff 100644 --- a/frontend/src/component/commandBar/CommandBarFeedback.tsx +++ b/frontend/src/component/commandBar/CommandBarFeedback.tsx @@ -44,7 +44,7 @@ export const CommandBarFeedback = ({ onSubmit }: ICommandBarFeedbackProps) => { }); onSubmit(); setToastData({ - title: 'Feedback sent', + text: 'Feedback sent', type: 'success', }); }; diff --git a/frontend/src/component/common/ApiTokenTable/CopyApiTokenButton/CopyApiTokenButton.tsx b/frontend/src/component/common/ApiTokenTable/CopyApiTokenButton/CopyApiTokenButton.tsx index ca5beb6fb679..efcb7ee2a6f3 100644 --- a/frontend/src/component/common/ApiTokenTable/CopyApiTokenButton/CopyApiTokenButton.tsx +++ b/frontend/src/component/common/ApiTokenTable/CopyApiTokenButton/CopyApiTokenButton.tsx @@ -23,7 +23,7 @@ export const CopyApiTokenButton = ({ if (copy(value)) { setToastData({ type: 'success', - title: `Token copied to clipboard`, + text: 'Token copied to clipboard', }); if (track && typeof track === 'function') { diff --git a/frontend/src/component/common/ApiTokenTable/RemoveApiTokenButton/RemoveApiTokenButton.tsx b/frontend/src/component/common/ApiTokenTable/RemoveApiTokenButton/RemoveApiTokenButton.tsx index 2bb622831dc3..fb66452125c6 100644 --- a/frontend/src/component/common/ApiTokenTable/RemoveApiTokenButton/RemoveApiTokenButton.tsx +++ b/frontend/src/component/common/ApiTokenTable/RemoveApiTokenButton/RemoveApiTokenButton.tsx @@ -34,7 +34,7 @@ export const RemoveApiTokenButton = ({ setToastData({ type: 'success', - title: 'API token removed', + text: 'API token removed', }); } catch (error: unknown) { setToastApiError(formatUnknownError(error)); diff --git a/frontend/src/component/common/FeatureArchiveDialog/FeatureArchiveDialog.tsx b/frontend/src/component/common/FeatureArchiveDialog/FeatureArchiveDialog.tsx index 8430a71ce071..11b79874b93c 100644 --- a/frontend/src/component/common/FeatureArchiveDialog/FeatureArchiveDialog.tsx +++ b/frontend/src/component/common/FeatureArchiveDialog/FeatureArchiveDialog.tsx @@ -238,11 +238,8 @@ const useArchiveAction = ({ ); refetchChangeRequests(); setToastData({ - text: isBulkArchive - ? 'Your archive feature flags changes have been added to change request' - : 'Your archive feature flag change has been added to change request', type: 'success', - title: isBulkArchive + text: isBulkArchive ? 'Changes added to a draft' : 'Change added to a draft', }); @@ -251,18 +248,16 @@ const useArchiveAction = ({ const archiveToggle = async () => { await archiveFeatureToggle(projectId, featureIds[0]); setToastData({ - text: 'Your feature flag has been archived', type: 'success', - title: 'Feature archived', + text: 'Feature flag archived', }); }; const archiveToggles = async () => { await archiveFeatures(projectId, featureIds); setToastData({ - text: 'Selected feature flags have been archived', type: 'success', - title: 'Features archived', + text: 'Feature flags archived', }); }; diff --git a/frontend/src/component/common/FeatureStaleDialog/FeatureStaleDialog.tsx b/frontend/src/component/common/FeatureStaleDialog/FeatureStaleDialog.tsx index 4eb2e750ad27..fcbdd34fa85e 100644 --- a/frontend/src/component/common/FeatureStaleDialog/FeatureStaleDialog.tsx +++ b/frontend/src/component/common/FeatureStaleDialog/FeatureStaleDialog.tsx @@ -50,14 +50,12 @@ export const FeatureStaleDialog = ({ if (isStale) { setToastData({ type: 'success', - title: "And we're back!", - text: 'The flag is no longer marked as stale.', + text: 'The flag is no longer marked as stale', }); } else { setToastData({ type: 'success', - title: 'A job well done.', - text: 'The flag has been marked as stale.', + text: 'The flag has been marked as stale', }); } }; diff --git a/frontend/src/component/common/FormTemplate/FormTemplate.tsx b/frontend/src/component/common/FormTemplate/FormTemplate.tsx index 34aa96b66d88..451f7d5823dd 100644 --- a/frontend/src/component/common/FormTemplate/FormTemplate.tsx +++ b/frontend/src/component/common/FormTemplate/FormTemplate.tsx @@ -259,16 +259,14 @@ const FormTemplate: React.FC = ({ if (formatApiCode !== undefined) { if (copy(formatApiCode())) { setToastData({ - title: 'Successfully copied the command', - text: 'The command should now be automatically copied to your clipboard', + text: 'Command copied', autoHideDuration: 6000, type: 'success', show: true, }); } else { setToastData({ - title: 'Could not copy the command', - text: 'Sorry, but we could not copy the command.', + text: 'Could not copy the command', autoHideDuration: 6000, type: 'error', show: true, diff --git a/frontend/src/component/common/ToastRenderer/Toast/Toast.tsx b/frontend/src/component/common/ToastRenderer/Toast/Toast.tsx index 9651009f0b04..e95e23d3d6de 100644 --- a/frontend/src/component/common/ToastRenderer/Toast/Toast.tsx +++ b/frontend/src/component/common/ToastRenderer/Toast/Toast.tsx @@ -7,7 +7,7 @@ import UIContext from 'contexts/UIContext'; import Close from '@mui/icons-material/Close'; import type { IToast } from 'interfaces/toast'; -const Toast = ({ title, type }: IToast) => { +const Toast = ({ text, type }: IToast) => { const { setToast } = useContext(UIContext); const { classes: styles } = useStyles(); @@ -20,7 +20,7 @@ const Toast = ({ title, type }: IToast) => {
-

{title}

+

{text}

{ refetchUnleashContext(); setToastData({ type: 'success', - title: 'Successfully deleted context', - text: 'Your context is now deleted', + text: 'Context field deleted', }); } catch (error) { setToastApiError(formatUnknownError(error)); diff --git a/frontend/src/component/context/CreateUnleashContext/CreateUnleashContext.tsx b/frontend/src/component/context/CreateUnleashContext/CreateUnleashContext.tsx index a6a042865dfb..cde1b4c2bc60 100644 --- a/frontend/src/component/context/CreateUnleashContext/CreateUnleashContext.tsx +++ b/frontend/src/component/context/CreateUnleashContext/CreateUnleashContext.tsx @@ -51,8 +51,7 @@ export const CreateUnleashContext = ({ await createContext(payload); refetchUnleashContext(); setToastData({ - title: 'Context created', - confetti: true, + text: 'Context field created', type: 'success', }); onSubmit(); diff --git a/frontend/src/component/context/EditContext/EditContext.tsx b/frontend/src/component/context/EditContext/EditContext.tsx index c7dbf5eaba5f..df53207f6f5a 100644 --- a/frontend/src/component/context/EditContext/EditContext.tsx +++ b/frontend/src/component/context/EditContext/EditContext.tsx @@ -63,7 +63,7 @@ export const EditContext = () => { refetch(); navigate('/context'); setToastData({ - title: 'Context information updated', + text: 'Context information updated', type: 'success', }); } catch (e: unknown) { diff --git a/frontend/src/component/environments/CreateEnvironment/CreateEnvironment.tsx b/frontend/src/component/environments/CreateEnvironment/CreateEnvironment.tsx index 621cdc0146e5..4b8912506a98 100644 --- a/frontend/src/component/environments/CreateEnvironment/CreateEnvironment.tsx +++ b/frontend/src/component/environments/CreateEnvironment/CreateEnvironment.tsx @@ -43,9 +43,8 @@ const CreateEnvironment = () => { await createEnvironment(payload); refetch(); setToastData({ - title: 'Environment created', + text: 'Environment created', type: 'success', - confetti: true, }); navigate('/environments'); } catch (error: unknown) { diff --git a/frontend/src/component/environments/EditEnvironment/EditEnvironment.tsx b/frontend/src/component/environments/EditEnvironment/EditEnvironment.tsx index 8a6d2d5a5cf8..7ad42f912699 100644 --- a/frontend/src/component/environments/EditEnvironment/EditEnvironment.tsx +++ b/frontend/src/component/environments/EditEnvironment/EditEnvironment.tsx @@ -49,7 +49,7 @@ const EditEnvironment = () => { navigate('/environments'); setToastData({ type: 'success', - title: 'Successfully updated environment.', + text: 'Successfully updated environment.', }); } catch (error: unknown) { setToastApiError(formatUnknownError(error)); diff --git a/frontend/src/component/environments/EnvironmentTable/EnvironmentActionCell/EnvironmentActionCell.tsx b/frontend/src/component/environments/EnvironmentTable/EnvironmentActionCell/EnvironmentActionCell.tsx index 9ddf3833ccaf..5d88fc883ba2 100644 --- a/frontend/src/component/environments/EnvironmentTable/EnvironmentActionCell/EnvironmentActionCell.tsx +++ b/frontend/src/component/environments/EnvironmentTable/EnvironmentActionCell/EnvironmentActionCell.tsx @@ -43,8 +43,7 @@ export const EnvironmentActionCell = ({ refetchPermissions(); setToastData({ type: 'success', - title: 'Environment deleted', - text: `You have successfully deleted the ${environment.name} environment.`, + text: `Environment deleted`, }); } catch (error: unknown) { setToastApiError(formatUnknownError(error)); @@ -60,13 +59,13 @@ export const EnvironmentActionCell = ({ await toggleEnvironmentOff(environment.name); setToastData({ type: 'success', - title: 'Environment deprecated successfully', + text: 'Environment deprecated', }); } else { await toggleEnvironmentOn(environment.name); setToastData({ type: 'success', - title: 'Environment undeprecated successfully', + text: 'Environment undeprecated', }); } } catch (error: unknown) { @@ -89,8 +88,7 @@ export const EnvironmentActionCell = ({ } else { setToastData({ type: 'error', - title: 'Environment limit reached', - text: `You have reached the maximum number of environments (${environmentLimit}). Please reach out if you need more.`, + text: `Environment limit (${environmentLimit}) reached`, }); } }} diff --git a/frontend/src/component/environments/EnvironmentTable/EnvironmentActionCell/EnvironmentCloneModal/EnvironmentCloneModal.tsx b/frontend/src/component/environments/EnvironmentTable/EnvironmentActionCell/EnvironmentCloneModal/EnvironmentCloneModal.tsx index 8076b468092e..6f7da59ace47 100644 --- a/frontend/src/component/environments/EnvironmentTable/EnvironmentActionCell/EnvironmentCloneModal/EnvironmentCloneModal.tsx +++ b/frontend/src/component/environments/EnvironmentTable/EnvironmentActionCell/EnvironmentCloneModal/EnvironmentCloneModal.tsx @@ -184,7 +184,7 @@ export const EnvironmentCloneModal = ({ newToken(token); } setToastData({ - title: 'Environment successfully cloned!', + text: 'Environment cloned', type: 'success', }); refetchEnvironments(); diff --git a/frontend/src/component/feature/Dependencies/useManageDependency.ts b/frontend/src/component/feature/Dependencies/useManageDependency.ts index 246b7f534231..08ffa4c08c69 100644 --- a/frontend/src/component/feature/Dependencies/useManageDependency.ts +++ b/frontend/src/component/feature/Dependencies/useManageDependency.ts @@ -63,12 +63,8 @@ export const useManageDependency = ( } void refetchChangeRequests(); setToastData({ - text: - actionType === 'addDependency' - ? `${featureId} will depend on ${parent}` - : `${featureId} dependency will be removed`, type: 'success', - title: 'Change added to a draft', + text: 'Change added to draft', }); }; @@ -95,7 +91,7 @@ export const useManageDependency = ( eventType: 'dependency removed', }, }); - setToastData({ title: 'Dependency removed', type: 'success' }); + setToastData({ text: 'Dependency removed', type: 'success' }); } else { await addDependency(featureId, { feature: parent, @@ -110,7 +106,7 @@ export const useManageDependency = ( eventType: 'dependency added', }, }); - setToastData({ title: 'Dependency added', type: 'success' }); + setToastData({ text: 'Dependency added', type: 'success' }); } } catch (error) { setToastApiError(formatUnknownError(error)); diff --git a/frontend/src/component/feature/EditFeature/EditFeature.tsx b/frontend/src/component/feature/EditFeature/EditFeature.tsx index d5cbfc12de1e..043018c58616 100644 --- a/frontend/src/component/feature/EditFeature/EditFeature.tsx +++ b/frontend/src/component/feature/EditFeature/EditFeature.tsx @@ -54,7 +54,7 @@ const EditFeature = () => { await patchFeatureFlag(project, featureId, patch); navigate(`/projects/${project}/features/${name}`); setToastData({ - title: 'Flag updated successfully', + text: 'Flag updated', type: 'success', }); } catch (error: unknown) { diff --git a/frontend/src/component/feature/FeatureStrategy/FeatureStrategyCreate/FeatureStrategyCreate.tsx b/frontend/src/component/feature/FeatureStrategy/FeatureStrategyCreate/FeatureStrategyCreate.tsx index 59b0b9607cc6..f743d7d5e922 100644 --- a/frontend/src/component/feature/FeatureStrategy/FeatureStrategyCreate/FeatureStrategyCreate.tsx +++ b/frontend/src/component/feature/FeatureStrategy/FeatureStrategyCreate/FeatureStrategyCreate.tsx @@ -150,9 +150,8 @@ export const FeatureStrategyCreate = () => { ); setToastData({ - title: 'Strategy created', + text: 'Strategy created', type: 'success', - confetti: true, }); }; @@ -164,9 +163,8 @@ export const FeatureStrategyCreate = () => { }); // FIXME: segments in change requests setToastData({ - title: 'Strategy added to draft', + text: 'Strategy added to draft', type: 'success', - confetti: true, }); refetchChangeRequests(); }; diff --git a/frontend/src/component/feature/FeatureStrategy/FeatureStrategyEdit/FeatureStrategyEdit.tsx b/frontend/src/component/feature/FeatureStrategy/FeatureStrategyEdit/FeatureStrategyEdit.tsx index 4719956bab30..cef2b718569e 100644 --- a/frontend/src/component/feature/FeatureStrategy/FeatureStrategyEdit/FeatureStrategyEdit.tsx +++ b/frontend/src/component/feature/FeatureStrategy/FeatureStrategyEdit/FeatureStrategyEdit.tsx @@ -209,9 +209,8 @@ export const FeatureStrategyEdit = () => { await refetchSavedStrategySegments(); setToastData({ - title: 'Strategy updated', + text: 'Strategy updated', type: 'success', - confetti: true, }); }; @@ -223,9 +222,8 @@ export const FeatureStrategyEdit = () => { }); // FIXME: segments in change requests setToastData({ - title: 'Change added to draft', + text: 'Change added to draft', type: 'success', - confetti: true, }); refetchChangeRequests(); }; diff --git a/frontend/src/component/feature/FeatureStrategy/FeatureStrategyEmpty/FeatureStrategyEmpty.tsx b/frontend/src/component/feature/FeatureStrategy/FeatureStrategyEmpty/FeatureStrategyEmpty.tsx index 41035391d592..8be9907cca60 100644 --- a/frontend/src/component/feature/FeatureStrategy/FeatureStrategyEmpty/FeatureStrategyEmpty.tsx +++ b/frontend/src/component/feature/FeatureStrategy/FeatureStrategyEmpty/FeatureStrategyEmpty.tsx @@ -78,10 +78,7 @@ export const FeatureStrategyEmpty = ({ refetchFeatureImmutable(); setToastData({ - title: multiple ? 'Strategies created' : 'Strategy created', - text: multiple - ? 'Successfully copied from another environment' - : 'Successfully created strategy', + text: multiple ? 'Strategies created' : 'Strategy created', type: 'success', }); }; diff --git a/frontend/src/component/feature/FeatureStrategy/FeatureStrategyMenu/FeatureReleasePlanCard/FeatureReleasePlanCard.tsx b/frontend/src/component/feature/FeatureStrategy/FeatureStrategyMenu/FeatureReleasePlanCard/FeatureReleasePlanCard.tsx index a635cb570c47..437c67baed47 100644 --- a/frontend/src/component/feature/FeatureStrategy/FeatureStrategyMenu/FeatureReleasePlanCard/FeatureReleasePlanCard.tsx +++ b/frontend/src/component/feature/FeatureStrategy/FeatureStrategyMenu/FeatureReleasePlanCard/FeatureReleasePlanCard.tsx @@ -75,7 +75,7 @@ export const FeatureReleasePlanCard = ({ ); setToastData({ type: 'success', - title: 'Release plan added', + text: 'Release plan added', }); refetch(); } catch (error: unknown) { diff --git a/frontend/src/component/feature/FeatureToggleList/BulkDisableDialog.tsx b/frontend/src/component/feature/FeatureToggleList/BulkDisableDialog.tsx index 8be537914a83..8386c5687bf6 100644 --- a/frontend/src/component/feature/FeatureToggleList/BulkDisableDialog.tsx +++ b/frontend/src/component/feature/FeatureToggleList/BulkDisableDialog.tsx @@ -73,9 +73,8 @@ export const BulkDisableDialog = ({ ); refetchChangeRequests(); setToastData({ - text: 'Your disabled feature flags changes have been added to change request', type: 'success', - title: 'Changes added to a draft', + text: 'Changes added to draft', }); } else { await bulkToggleFeaturesEnvironmentOff( @@ -84,9 +83,8 @@ export const BulkDisableDialog = ({ selected, ); setToastData({ - text: 'Your feature flags have been disabled', type: 'success', - title: 'Features disabled', + text: 'Feature flags disabled', }); } onClose(); diff --git a/frontend/src/component/feature/FeatureToggleList/BulkEnableDialog.tsx b/frontend/src/component/feature/FeatureToggleList/BulkEnableDialog.tsx index 29d748c0fc4a..690e6874de23 100644 --- a/frontend/src/component/feature/FeatureToggleList/BulkEnableDialog.tsx +++ b/frontend/src/component/feature/FeatureToggleList/BulkEnableDialog.tsx @@ -73,9 +73,8 @@ export const BulkEnableDialog = ({ ); refetchChangeRequests(); setToastData({ - text: 'Your enable feature flags changes have been added to change request', type: 'success', - title: 'Changes added to a draft', + text: 'Changes added to draft', }); } else { await bulkToggleFeaturesEnvironmentOn( @@ -84,9 +83,8 @@ export const BulkEnableDialog = ({ selected, ); setToastData({ - text: 'Your feature flags have been enabled', type: 'success', - title: 'Features enabled', + text: 'Feature flags enabled', }); } diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/EnvironmentAccordionBody.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/EnvironmentAccordionBody.tsx index 26b630d5df58..8c9da84eed1d 100644 --- a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/EnvironmentAccordionBody.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/EnvironmentAccordionBody.tsx @@ -111,7 +111,7 @@ const EnvironmentAccordionBody = ({ ); refetchFeature(); setToastData({ - title: 'Order of strategies updated', + text: 'Order of strategies updated', type: 'success', }); } catch (error: unknown) { @@ -129,9 +129,8 @@ const EnvironmentAccordionBody = ({ }); setToastData({ - title: 'Strategy execution order added to draft', + text: 'Strategy execution order added to draft', type: 'success', - confetti: true, }); refetchChangeRequests(); }; diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/CopyStrategyIconMenu/CopyStrategyIconMenu.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/CopyStrategyIconMenu/CopyStrategyIconMenu.tsx index 22bfd6ecdab6..53af5bbec3d6 100644 --- a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/CopyStrategyIconMenu/CopyStrategyIconMenu.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/CopyStrategyIconMenu/CopyStrategyIconMenu.tsx @@ -86,8 +86,7 @@ export const CopyStrategyIconMenu: VFC = ({ refetchFeature(); refetchFeatureImmutable(); setToastData({ - title: `Strategy created`, - text: `Successfully copied a strategy to ${targetEnvironment}`, + text: `Strategy copied to ${targetEnvironment}`, type: 'success', }); } catch (error) { diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/MenuStrategyRemove/DialogStrategyRemove.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/MenuStrategyRemove/DialogStrategyRemove.tsx index 68e4ee3d7a79..1f823a81f0a0 100644 --- a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/MenuStrategyRemove/DialogStrategyRemove.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/MenuStrategyRemove/DialogStrategyRemove.tsx @@ -194,7 +194,7 @@ const useOnRemove = ({ strategyId, ); setToastData({ - title: 'Strategy deleted', + text: 'Strategy deleted', type: 'success', }); refetchFeature(); @@ -227,7 +227,7 @@ const useOnSuggestRemove = ({ }, }); setToastData({ - title: 'Changes added to the draft!', + text: 'Changes added to draft', type: 'success', }); await refetchChangeRequests(); diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/MenuStrategyRemove/DisableEnableStrategyDialog/hooks/useEnableDisable.ts b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/MenuStrategyRemove/DisableEnableStrategyDialog/hooks/useEnableDisable.ts index c8134ffc4828..5c3f9b94a3a5 100644 --- a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/MenuStrategyRemove/DisableEnableStrategyDialog/hooks/useEnableDisable.ts +++ b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/MenuStrategyRemove/DisableEnableStrategyDialog/hooks/useEnableDisable.ts @@ -24,7 +24,7 @@ export const useEnableDisable = ({ !enabled, ); setToastData({ - title: `Strategy ${enabled ? 'enabled' : 'disabled'}`, + text: `Strategy ${enabled ? 'enabled' : 'disabled'}`, type: 'success', }); diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/MenuStrategyRemove/DisableEnableStrategyDialog/hooks/useSuggestEnableDisable.ts b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/MenuStrategyRemove/DisableEnableStrategyDialog/hooks/useSuggestEnableDisable.ts index 91592f514a0f..4268673f4c87 100644 --- a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/MenuStrategyRemove/DisableEnableStrategyDialog/hooks/useSuggestEnableDisable.ts +++ b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/MenuStrategyRemove/DisableEnableStrategyDialog/hooks/useSuggestEnableDisable.ts @@ -25,7 +25,7 @@ export const useSuggestEnableDisable = ({ }, }); setToastData({ - title: 'Changes added to the draft!', + text: 'Changes added to draft', type: 'success', }); await refetchChangeRequests(); diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewMetaData/DependencyRow.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewMetaData/DependencyRow.tsx index 2199d132516d..cb872ba5059f 100644 --- a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewMetaData/DependencyRow.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewMetaData/DependencyRow.tsx @@ -69,9 +69,8 @@ const useDeleteDependency = (project: string, featureId: string) => { }, }); setToastData({ - text: `${featureId} dependency will be removed`, type: 'success', - title: 'Change added to a draft', + text: 'Change added to draft', }); await refetchChangeRequests(); } else { @@ -81,7 +80,7 @@ const useDeleteDependency = (project: string, featureId: string) => { eventType: 'dependency removed', }, }); - setToastData({ title: 'Dependency removed', type: 'success' }); + setToastData({ text: 'Dependency removed', type: 'success' }); await refetchFeature(); } } catch (error) { diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewMetaData/FeatureOverviewMetaData.test.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewMetaData/FeatureOverviewMetaData.test.tsx index 994c0bc41469..de8bf01633de 100644 --- a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewMetaData/FeatureOverviewMetaData.test.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewMetaData/FeatureOverviewMetaData.test.tsx @@ -255,7 +255,7 @@ test('delete dependency with change request', async () => { const deleteButton = await screen.findByText('Delete'); fireEvent.click(deleteButton); - await screen.findByText('Change added to a draft'); + await screen.findByText('Change added to draft'); }); test('edit dependency', async () => { diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewMetaData/OldDependencyRow.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewMetaData/OldDependencyRow.tsx index b27acdf87907..556f6b555c22 100644 --- a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewMetaData/OldDependencyRow.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewMetaData/OldDependencyRow.tsx @@ -60,9 +60,8 @@ const useDeleteDependency = (project: string, featureId: string) => { }, }); setToastData({ - text: `${featureId} dependency will be removed`, type: 'success', - title: 'Change added to a draft', + text: 'Change added to draft', }); await refetchChangeRequests(); } else { @@ -72,7 +71,7 @@ const useDeleteDependency = (project: string, featureId: string) => { eventType: 'dependency removed', }, }); - setToastData({ title: 'Dependency removed', type: 'success' }); + setToastData({ text: 'Dependency removed', type: 'success' }); await refetchFeature(); } } catch (error) { diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewMetaData/TagRow.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewMetaData/TagRow.tsx index 583b771110e9..cd5d942c36fe 100644 --- a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewMetaData/TagRow.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewMetaData/TagRow.tsx @@ -92,8 +92,7 @@ export const TagRow = ({ feature }: IFeatureOverviewSidePanelTagsProps) => { refetch(); setToastData({ type: 'success', - title: 'Tag removed', - text: 'Successfully removed tag', + text: 'Tag removed', }); } catch (error: unknown) { setToastApiError(formatUnknownError(error)); diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewSidePanel/FeatureOverviewSidePanelTags/FeatureOverviewSidePanelTags.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewSidePanel/FeatureOverviewSidePanelTags/FeatureOverviewSidePanelTags.tsx index af22d2f70035..6a91257fd21a 100644 --- a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewSidePanel/FeatureOverviewSidePanelTags/FeatureOverviewSidePanelTags.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewSidePanel/FeatureOverviewSidePanelTags/FeatureOverviewSidePanelTags.tsx @@ -71,8 +71,7 @@ export const FeatureOverviewSidePanelTags = ({ refetch(); setToastData({ type: 'success', - title: 'Tag deleted', - text: 'Successfully deleted tag', + text: 'Tag deleted', }); } catch (error: unknown) { setToastApiError(formatUnknownError(error)); diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/ManageTagsDialog/ManageTagsDialog.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/ManageTagsDialog/ManageTagsDialog.tsx index df0a742e5105..caa89e9c9ab2 100644 --- a/frontend/src/component/feature/FeatureView/FeatureOverview/ManageTagsDialog/ManageTagsDialog.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureOverview/ManageTagsDialog/ManageTagsDialog.tsx @@ -10,7 +10,6 @@ import { Dialogue } from 'component/common/Dialogue/Dialogue'; import useFeatureApi from 'hooks/api/actions/useFeatureApi/useFeatureApi'; import useFeatureTags from 'hooks/api/getters/useFeatureTags/useFeatureTags'; import useToast from 'hooks/useToast'; -import { formatUnknownError } from 'utils/formatUnknownError'; import { useRequiredPathParam } from 'hooks/useRequiredPathParam'; import type { ITag, ITagType } from 'interfaces/tags'; import { type TagOption, TagsInput } from './TagsInput'; @@ -134,12 +133,9 @@ export const ManageTagsDialog = ({ open, setOpen }: IManageTagsProps) => { }); await refetch(); } catch (error: unknown) { - const message = formatUnknownError(error); setToastData({ type: 'error', - title: `Failed to add tag`, - text: message, - confetti: false, + text: 'Failed to add tag', }); } }; @@ -179,9 +175,7 @@ export const ManageTagsDialog = ({ open, setOpen }: IManageTagsProps) => { differenceCount > 0 && setToastData({ type: 'success', - title: `Updated tag${added.length > 1 ? 's' : ''} to flag`, - text: getToastText(added.length, removed.length), - confetti: true, + text: `Updated tag${added.length > 1 ? 's' : ''} to flag`, }); } setDifferenceCount(0); diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/NewFeatureOverviewEnvironment/FeatureOverviewEnvironmentBody.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/NewFeatureOverviewEnvironment/FeatureOverviewEnvironmentBody.tsx index 326720a1b237..b9f35c8ba265 100644 --- a/frontend/src/component/feature/FeatureView/FeatureOverview/NewFeatureOverviewEnvironment/FeatureOverviewEnvironmentBody.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureOverview/NewFeatureOverviewEnvironment/FeatureOverviewEnvironmentBody.tsx @@ -120,7 +120,7 @@ export const FeatureOverviewEnvironmentBody = ({ ); refetchFeature(); setToastData({ - title: 'Order of strategies updated', + text: 'Order of strategies updated', type: 'success', }); } catch (error: unknown) { @@ -138,9 +138,8 @@ export const FeatureOverviewEnvironmentBody = ({ }); setToastData({ - title: 'Strategy execution order added to draft', + text: 'Strategy execution order added to draft', type: 'success', - confetti: true, }); refetchChangeRequests(); }; diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/ReleasePlan/ReleasePlan.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/ReleasePlan/ReleasePlan.tsx index 64b4ed6869d0..07d95f170706 100644 --- a/frontend/src/component/feature/FeatureView/FeatureOverview/ReleasePlan/ReleasePlan.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureOverview/ReleasePlan/ReleasePlan.tsx @@ -101,7 +101,7 @@ export const ReleasePlan = ({ id, ); setToastData({ - title: `Release plan "${name}" has been removed from ${featureName} in ${environment}`, + text: `Release plan "${name}" has been removed from ${featureName} in ${environment}`, type: 'success', }); refetch(); @@ -121,7 +121,7 @@ export const ReleasePlan = ({ milestone.id, ); setToastData({ - title: `Milestone "${milestone.name}" has started`, + text: `Milestone "${milestone.name}" has started`, type: 'success', }); refetch(); diff --git a/frontend/src/component/feature/FeatureView/FeatureSettings/FeatureSettingsProject/FeatureSettingsProject.tsx b/frontend/src/component/feature/FeatureView/FeatureSettings/FeatureSettingsProject/FeatureSettingsProject.tsx index dedfffc27dbd..ef827e1151a1 100644 --- a/frontend/src/component/feature/FeatureView/FeatureSettings/FeatureSettingsProject/FeatureSettingsProject.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureSettings/FeatureSettingsProject/FeatureSettingsProject.tsx @@ -34,7 +34,7 @@ const FeatureSettingsProject = () => { if (project) { await changeFeatureProject(projectId, featureId, project); refetchFeature(); - setToastData({ title: 'Project changed', type: 'success' }); + setToastData({ text: 'Project changed', type: 'success' }); setShowConfirmDialog(false); navigate( `/projects/${project}/features/${featureId}/settings`, diff --git a/frontend/src/component/feature/FeatureView/FeatureVariants/FeatureEnvironmentVariants/FeatureEnvironmentVariants.tsx b/frontend/src/component/feature/FeatureView/FeatureVariants/FeatureEnvironmentVariants/FeatureEnvironmentVariants.tsx index c217b3cdfe1e..abf8c007028f 100644 --- a/frontend/src/component/feature/FeatureView/FeatureVariants/FeatureEnvironmentVariants/FeatureEnvironmentVariants.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureVariants/FeatureEnvironmentVariants/FeatureEnvironmentVariants.tsx @@ -117,7 +117,7 @@ export const FeatureEnvironmentVariants = () => { if (error) { setToastData({ type: 'error', - title: error, + text: error, }); return; } @@ -183,7 +183,7 @@ export const FeatureEnvironmentVariants = () => { pushTitle && draftTitle ? '. ' : '' }${draftTitle}`; setToastData({ - title, + text: title, type: 'success', }); } catch (error: unknown) { @@ -202,7 +202,7 @@ export const FeatureEnvironmentVariants = () => { await updateVariants(selectedEnvironment, updatedVariants); setModalOpen(false); setToastData({ - title: selectedEnvironment.crEnabled + text: selectedEnvironment.crEnabled ? `Variant changes added to draft` : 'Variants updated successfully', type: 'success', @@ -221,7 +221,7 @@ export const FeatureEnvironmentVariants = () => { const variants = fromEnvironment.variants ?? []; await updateVariants(toEnvironment, variants); setToastData({ - title: toEnvironment.crEnabled + text: toEnvironment.crEnabled ? 'Variants copy added to draft' : 'Variants copied successfully', type: 'success', diff --git a/frontend/src/component/feature/FeatureView/FeatureView.tsx b/frontend/src/component/feature/FeatureView/FeatureView.tsx index 2ea142a28324..b666ca989087 100644 --- a/frontend/src/component/feature/FeatureView/FeatureView.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureView.tsx @@ -224,7 +224,7 @@ export const FeatureView = () => { } catch (error: unknown) { setToastData({ type: 'error', - title: 'Could not copy feature name', + text: 'Could not copy feature name', }); } }; diff --git a/frontend/src/component/featureTypes/FeatureTypeEdit/FeatureTypeForm/FeatureTypeForm.tsx b/frontend/src/component/featureTypes/FeatureTypeEdit/FeatureTypeForm/FeatureTypeForm.tsx index 312867b5f314..5bd994bf3178 100644 --- a/frontend/src/component/featureTypes/FeatureTypeEdit/FeatureTypeForm/FeatureTypeForm.tsx +++ b/frontend/src/component/featureTypes/FeatureTypeEdit/FeatureTypeForm/FeatureTypeForm.tsx @@ -82,7 +82,7 @@ export const FeatureTypeForm: VFC = ({ await updateFeatureTypeLifetime(featureType.id, value); refetch(); setToastData({ - title: 'Feature type updated', + text: 'Feature type updated', type: 'success', }); navigate('/feature-toggle-type'); diff --git a/frontend/src/component/feedback/FeedbackCES/FeedbackCESForm.tsx b/frontend/src/component/feedback/FeedbackCES/FeedbackCESForm.tsx index c53a05575f64..e48988c4c464 100644 --- a/frontend/src/component/feedback/FeedbackCES/FeedbackCESForm.tsx +++ b/frontend/src/component/feedback/FeedbackCES/FeedbackCESForm.tsx @@ -77,8 +77,7 @@ export const FeedbackCESForm = ({ state, onClose }: IFeedbackCESFormProps) => { await sendFeedbackInput(form); setToastData({ type: 'success', - title: 'Feedback sent. Thank you!', - confetti: true, + text: 'Feedback sent. Thank you!', }); onClose(); } finally { diff --git a/frontend/src/component/feedbackNew/FeedbackComponent.tsx b/frontend/src/component/feedbackNew/FeedbackComponent.tsx index 9c49f2c0bd96..55d170a2fd66 100644 --- a/frontend/src/component/feedbackNew/FeedbackComponent.tsx +++ b/frontend/src/component/feedbackNew/FeedbackComponent.tsx @@ -260,7 +260,7 @@ export const FeedbackComponent = ({ } setToastData({ - title: toastTitle, + text: toastTitle, type: toastType, }); closeFeedback(); diff --git a/frontend/src/component/integrations/IntegrationForm/IntegrationDelete/IntegrationDelete.tsx b/frontend/src/component/integrations/IntegrationForm/IntegrationDelete/IntegrationDelete.tsx index 3c08991c5aee..6ab997986f6f 100644 --- a/frontend/src/component/integrations/IntegrationForm/IntegrationDelete/IntegrationDelete.tsx +++ b/frontend/src/component/integrations/IntegrationForm/IntegrationDelete/IntegrationDelete.tsx @@ -33,8 +33,7 @@ export const IntegrationDelete: VFC = ({ id }) => { refetchAddons(); setToastData({ type: 'success', - title: 'Success', - text: 'Deleted addon successfully', + text: 'Integration deleted', }); } catch (error: unknown) { setToastApiError(formatUnknownError(error)); diff --git a/frontend/src/component/integrations/IntegrationForm/IntegrationForm.tsx b/frontend/src/component/integrations/IntegrationForm/IntegrationForm.tsx index 8a025298a1b5..5942d714c61d 100644 --- a/frontend/src/component/integrations/IntegrationForm/IntegrationForm.tsx +++ b/frontend/src/component/integrations/IntegrationForm/IntegrationForm.tsx @@ -251,15 +251,14 @@ export const IntegrationForm: FC = ({ navigate('/integrations'); setToastData({ type: 'success', - title: 'Integration updated successfully', + text: 'Integration updated', }); } else { await createAddon(formValues as Omit); navigate('/integrations'); setToastData({ type: 'success', - confetti: true, - title: 'Integration created successfully', + text: 'Integration created', }); } } catch (error) { diff --git a/frontend/src/component/integrations/IntegrationList/IntegrationCard/IntegrationCardMenu/IntegrationCardMenu.tsx b/frontend/src/component/integrations/IntegrationList/IntegrationCard/IntegrationCardMenu/IntegrationCardMenu.tsx index 715fd38f7b0b..f83b911e9dd3 100644 --- a/frontend/src/component/integrations/IntegrationList/IntegrationCard/IntegrationCardMenu/IntegrationCardMenu.tsx +++ b/frontend/src/component/integrations/IntegrationList/IntegrationCard/IntegrationCardMenu/IntegrationCardMenu.tsx @@ -76,10 +76,9 @@ export const IntegrationCardMenu: VFC = ({ refetchAddons(); setToastData({ type: 'success', - title: 'Success', text: !addon.enabled - ? 'Integration is now enabled' - : 'Integration is now disabled', + ? 'Integration enabled' + : 'Integration disabled', }); } catch (error: unknown) { setToastApiError(formatUnknownError(error)); @@ -92,8 +91,7 @@ export const IntegrationCardMenu: VFC = ({ refetchAddons(); setToastData({ type: 'success', - title: 'Success', - text: 'Integration has been deleted', + text: 'Integration deleted', }); } catch (error: unknown) { setToastApiError(formatUnknownError(error)); diff --git a/frontend/src/component/onboarding/dialog/CodeRenderer.tsx b/frontend/src/component/onboarding/dialog/CodeRenderer.tsx index ab91c75eebaf..641e104327bb 100644 --- a/frontend/src/component/onboarding/dialog/CodeRenderer.tsx +++ b/frontend/src/component/onboarding/dialog/CodeRenderer.tsx @@ -62,7 +62,7 @@ const CopyBlock: FC<{ title: string; code: string }> = ({ title, code }) => { copy(data); setToastData({ type: 'success', - title: 'Copied to clipboard', + text: 'Copied to clipboard', }); }; const { setToastData } = useToast(); diff --git a/frontend/src/component/playground/Playground/AdvancedPlayground.tsx b/frontend/src/component/playground/Playground/AdvancedPlayground.tsx index 8068a6770c3e..f8c865d73e6a 100644 --- a/frontend/src/component/playground/Playground/AdvancedPlayground.tsx +++ b/frontend/src/component/playground/Playground/AdvancedPlayground.tsx @@ -150,7 +150,7 @@ export const AdvancedPlayground: FC<{ } catch (error) { setToastData({ type: 'error', - title: `Failed to parse URL parameters: ${formatUnknownError( + text: `Failed to parse URL parameters: ${formatUnknownError( error, )}`, }); @@ -233,14 +233,12 @@ export const AdvancedPlayground: FC<{ } else if (error instanceof SyntaxError) { setToastData({ type: 'error', - title: `Error parsing context: ${formatUnknownError( - error, - )}`, + text: `Error parsing context: ${formatUnknownError(error)}`, }); } else { setToastData({ type: 'error', - title: formatUnknownError(error), + text: formatUnknownError(error), }); } } diff --git a/frontend/src/component/playground/Playground/PlaygroundForm/PlaygroundCodeFieldset/PlaygroundCodeFieldset.tsx b/frontend/src/component/playground/Playground/PlaygroundForm/PlaygroundCodeFieldset/PlaygroundCodeFieldset.tsx index 8ac07e8d1a9b..8056f87b3d22 100644 --- a/frontend/src/component/playground/Playground/PlaygroundForm/PlaygroundCodeFieldset/PlaygroundCodeFieldset.tsx +++ b/frontend/src/component/playground/Playground/PlaygroundForm/PlaygroundCodeFieldset/PlaygroundCodeFieldset.tsx @@ -112,7 +112,7 @@ export const PlaygroundCodeFieldset: VFC = ({ } catch (error) { setToastData({ type: 'error', - title: `Error parsing context: ${formatUnknownError(error)}`, + text: `Error parsing context: ${formatUnknownError(error)}`, }); } }; diff --git a/frontend/src/component/project/Project/ArchiveProject/ArchiveProjectDialogue.tsx b/frontend/src/component/project/Project/ArchiveProject/ArchiveProjectDialogue.tsx index c6c46bbee603..9ad446296329 100644 --- a/frontend/src/component/project/Project/ArchiveProject/ArchiveProjectDialogue.tsx +++ b/frontend/src/component/project/Project/ArchiveProject/ArchiveProjectDialogue.tsx @@ -29,9 +29,8 @@ export const ArchiveProjectDialogue = ({ await archiveProject(project); refetchProjectOverview(); setToastData({ - title: 'Archived project', + text: 'Project archived', type: 'success', - text: 'Successfully archived project', }); onSuccess?.(); } catch (ex: unknown) { diff --git a/frontend/src/component/project/Project/CreateProject/NewCreateProjectForm/CreateProjectDialog.tsx b/frontend/src/component/project/Project/CreateProject/NewCreateProjectForm/CreateProjectDialog.tsx index 01d619f10b03..392de50f21fe 100644 --- a/frontend/src/component/project/Project/CreateProject/NewCreateProjectForm/CreateProjectDialog.tsx +++ b/frontend/src/component/project/Project/CreateProject/NewCreateProjectForm/CreateProjectDialog.tsx @@ -178,9 +178,7 @@ export const CreateProjectDialog = ({ refetchUser(); navigate(`/projects/${createdProject.id}`); setToastData({ - title: 'Project created', - text: 'Now you can add flags to this project', - confetti: true, + text: 'Project created', type: 'success', }); diff --git a/frontend/src/component/project/Project/DeleteProject/DeleteProjectDialogue.tsx b/frontend/src/component/project/Project/DeleteProject/DeleteProjectDialogue.tsx index e60ab000b642..6121db38c851 100644 --- a/frontend/src/component/project/Project/DeleteProject/DeleteProjectDialogue.tsx +++ b/frontend/src/component/project/Project/DeleteProject/DeleteProjectDialogue.tsx @@ -43,9 +43,8 @@ export const DeleteProjectDialogue = ({ refetchProjects(); refetchProjectArchive(); setToastData({ - title: 'Deleted project', + text: 'Project deleted', type: 'success', - text: 'Successfully deleted project', }); onSuccess?.(); } catch (ex: unknown) { diff --git a/frontend/src/component/project/Project/Import/configure/ConfigurationStage.tsx b/frontend/src/component/project/Project/Import/configure/ConfigurationStage.tsx index 77e485d8e979..892eb877952c 100644 --- a/frontend/src/component/project/Project/Import/configure/ConfigurationStage.tsx +++ b/frontend/src/component/project/Project/Import/configure/ConfigurationStage.tsx @@ -89,14 +89,14 @@ export const ImportArea: FC<{ setActiveTab('code'); setToastData({ type: 'success', - title: 'File uploaded', + text: 'File uploaded', }); }} onError={(error) => { setImportPayload(''); setToastData({ type: 'error', - title: error, + text: error, }); }} onDragStatusChange={setDragActive} diff --git a/frontend/src/component/project/Project/Import/import/ImportStage.tsx b/frontend/src/component/project/Project/Import/import/ImportStage.tsx index 1ea8fda8342c..0a39de3b5606 100644 --- a/frontend/src/component/project/Project/Import/import/ImportStage.tsx +++ b/frontend/src/component/project/Project/Import/import/ImportStage.tsx @@ -80,7 +80,7 @@ export const ImportStage: FC<{ .catch((error) => { setToastData({ type: 'error', - title: formatUnknownError(error), + text: formatUnknownError(error), }); }); }, []); diff --git a/frontend/src/component/project/Project/Import/validate/ValidationStage.tsx b/frontend/src/component/project/Project/Import/validate/ValidationStage.tsx index f2edb46bbc82..609d6ac11a30 100644 --- a/frontend/src/component/project/Project/Import/validate/ValidationStage.tsx +++ b/frontend/src/component/project/Project/Import/validate/ValidationStage.tsx @@ -124,7 +124,7 @@ export const ValidationStage: FC<{ setValidJSON(false); setToastData({ type: 'error', - title: formatUnknownError(error), + text: formatUnknownError(error), }); }); }, []); diff --git a/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFeatureTogglesHeader/CreateFeatureDialog.tsx b/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFeatureTogglesHeader/CreateFeatureDialog.tsx index 12abbcc15a75..689879f65003 100644 --- a/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFeatureTogglesHeader/CreateFeatureDialog.tsx +++ b/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFeatureTogglesHeader/CreateFeatureDialog.tsx @@ -164,9 +164,7 @@ const CreateFeatureDialogContent = ({ navigate(`/projects/${project}/features/${name}`); } setToastData({ - title: 'Flag created successfully', - text: 'Now you can start using your flag.', - confetti: true, + text: 'Flag created successfully', type: 'success', }); onClose(); diff --git a/frontend/src/component/project/Project/Project.tsx b/frontend/src/component/project/Project/Project.tsx index b0af6936d038..6607c3a05495 100644 --- a/frontend/src/component/project/Project/Project.tsx +++ b/frontend/src/component/project/Project/Project.tsx @@ -235,7 +235,7 @@ export const Project = () => { const text = created ? 'Project created' : 'Project updated'; setToastData({ type: 'success', - title: text, + text, }); } /* eslint-disable-next-line */ diff --git a/frontend/src/component/project/Project/ProjectFeatureToggles/ActionsCell/ActionsCell.tsx b/frontend/src/component/project/Project/ProjectFeatureToggles/ActionsCell/ActionsCell.tsx index 70dd62f8a769..36367cd99f75 100644 --- a/frontend/src/component/project/Project/ProjectFeatureToggles/ActionsCell/ActionsCell.tsx +++ b/frontend/src/component/project/Project/ProjectFeatureToggles/ActionsCell/ActionsCell.tsx @@ -81,7 +81,7 @@ export const ActionsCell: VFC = ({ } catch (error: unknown) { setToastData({ type: 'error', - title: 'Could not copy feature name', + text: 'Could not copy feature name', }); } }; diff --git a/frontend/src/component/project/Project/ProjectFeatureToggles/FeatureToggleSwitch/useFeatureToggleSwitch.tsx b/frontend/src/component/project/Project/ProjectFeatureToggles/FeatureToggleSwitch/useFeatureToggleSwitch.tsx index 74a568ad3152..92bd73d74ba6 100644 --- a/frontend/src/component/project/Project/ProjectFeatureToggles/FeatureToggleSwitch/useFeatureToggleSwitch.tsx +++ b/frontend/src/component/project/Project/ProjectFeatureToggles/FeatureToggleSwitch/useFeatureToggleSwitch.tsx @@ -170,8 +170,7 @@ export const useFeatureToggleSwitch: UseFeatureToggleSwitchType = ( setToastData({ type: 'success', - title: `Enabled in ${config.environmentName}`, - text: `${config.featureId} is now available in ${config.environmentName} based on its defined strategies.`, + text: `Enabled in ${config.environmentName}`, }); config.onSuccess?.(); } catch (error: unknown) { @@ -193,8 +192,7 @@ export const useFeatureToggleSwitch: UseFeatureToggleSwitchType = ( ); setToastData({ type: 'success', - title: `Disabled in ${config.environmentName}`, - text: `${config.featureId} is unavailable in ${config.environmentName} and its strategies will no longer have any effect.`, + text: `Disabled in ${config.environmentName}`, }); config.onSuccess?.(); } catch (error: unknown) { diff --git a/frontend/src/component/project/Project/ProjectFeatureToggles/ProjectFeaturesBatchActions/ManageTags.tsx b/frontend/src/component/project/Project/ProjectFeatureToggles/ProjectFeaturesBatchActions/ManageTags.tsx index 3db4578dd734..ef565f64477e 100644 --- a/frontend/src/component/project/Project/ProjectFeatureToggles/ProjectFeaturesBatchActions/ManageTags.tsx +++ b/frontend/src/component/project/Project/ProjectFeatureToggles/ProjectFeaturesBatchActions/ManageTags.tsx @@ -62,21 +62,19 @@ export const ManageTags: VFC = ({ const features = data.map(({ name }) => name); const payload = { features, tags: { addedTags, removedTags } }; try { - await bulkUpdateTags(payload, projectId); - const added = addedTags.length - ? `Added tags: ${addedTags - .map(({ type, value }) => `${type}:${value}`) - .join(', ')}.` - : ''; - const removed = removedTags.length - ? `Removed tags: ${removedTags - .map(({ type, value }) => `${type}:${value}`) - .join(', ')}.` - : ''; + console.log(addedTags, removedTags, features); + const toastText = [ + addedTags.length > 0 && + `added ${addedTags.length} tag${addedTags.length > 1 ? 's' : ''}`, + removedTags.length > 0 && + `removed ${removedTags.length} tag${removedTags.length > 1 ? 's' : ''}`, + ] + .filter(Boolean) + .join(' and '); + await bulkUpdateTags(payload, projectId); setToastData({ - title: 'Tags updated', - text: `${features.length} feature flags updated. ${added} ${removed}`, + text: toastText, type: 'success', autoHideDuration: 12000, }); diff --git a/frontend/src/component/project/Project/ProjectFeatureToggles/ProjectFeaturesBatchActions/MoreActions.tsx b/frontend/src/component/project/Project/ProjectFeatureToggles/ProjectFeaturesBatchActions/MoreActions.tsx index 88fa5c03937d..63117b1c3a0d 100644 --- a/frontend/src/component/project/Project/ProjectFeatureToggles/ProjectFeaturesBatchActions/MoreActions.tsx +++ b/frontend/src/component/project/Project/ProjectFeatureToggles/ProjectFeaturesBatchActions/MoreActions.tsx @@ -58,7 +58,6 @@ export const MoreActions: VFC = ({ await staleFeatures(projectId, selectedIds); onChange?.(); setToastData({ - title: 'State updated', text: 'Feature flags marked as stale', type: 'success', }); @@ -78,7 +77,6 @@ export const MoreActions: VFC = ({ await staleFeatures(projectId, selectedIds, false); onChange?.(); setToastData({ - title: 'State updated', text: 'Feature flags unmarked as stale', type: 'success', }); diff --git a/frontend/src/component/project/Project/ProjectSettings/ChangeRequestConfiguration/ChangeRequestTable.tsx b/frontend/src/component/project/Project/ProjectSettings/ChangeRequestConfiguration/ChangeRequestTable.tsx index 4322447a9d31..123444e5f795 100644 --- a/frontend/src/component/project/Project/ProjectSettings/ChangeRequestConfiguration/ChangeRequestTable.tsx +++ b/frontend/src/component/project/Project/ProjectSettings/ChangeRequestConfiguration/ChangeRequestTable.tsx @@ -96,8 +96,7 @@ export const ChangeRequestTable: VFC = () => { ); setToastData({ type: 'success', - title: 'Updated change request status', - text: 'Successfully updated change request status.', + text: 'Change request status updated', }); await refetchChangeRequestConfig(); } catch (error) { diff --git a/frontend/src/component/project/Project/ProjectSettings/ProjectActions/ProjectActionsTable/ProjectActionsModal/ProjectActionsModal.tsx b/frontend/src/component/project/Project/ProjectSettings/ProjectActions/ProjectActionsTable/ProjectActionsModal/ProjectActionsModal.tsx index 918cddbcb7b3..daa06356fecf 100644 --- a/frontend/src/component/project/Project/ProjectSettings/ProjectActions/ProjectActionsTable/ProjectActionsModal/ProjectActionsModal.tsx +++ b/frontend/src/component/project/Project/ProjectSettings/ProjectActions/ProjectActionsTable/ProjectActionsModal/ProjectActionsModal.tsx @@ -159,7 +159,7 @@ export const ProjectActionsModal = ({ await addActionSet(payload); } setToastData({ - title: `action ${editing ? 'updated' : 'added'} successfully`, + text: `action ${editing ? 'updated' : 'added'} successfully`, type: 'success', }); refetch(); diff --git a/frontend/src/component/project/Project/ProjectSettings/ProjectActions/ProjectActionsTable/ProjectActionsTable.tsx b/frontend/src/component/project/Project/ProjectSettings/ProjectActions/ProjectActionsTable/ProjectActionsTable.tsx index 49b58afab61d..8ab572aa264d 100644 --- a/frontend/src/component/project/Project/ProjectSettings/ProjectActions/ProjectActionsTable/ProjectActionsTable.tsx +++ b/frontend/src/component/project/Project/ProjectSettings/ProjectActions/ProjectActionsTable/ProjectActionsTable.tsx @@ -57,7 +57,7 @@ export const ProjectActionsTable = ({ try { await toggleActionSet(action.id, enabled); setToastData({ - title: `"${action.name}" has been ${ + text: `"${action.name}" has been ${ enabled ? 'enabled' : 'disabled' }`, type: 'success', @@ -72,7 +72,7 @@ export const ProjectActionsTable = ({ try { await removeActionSet(action.id); setToastData({ - title: `"${action.name}" has been deleted`, + text: `"${action.name}" has been deleted`, type: 'success', }); refetch(); diff --git a/frontend/src/component/project/Project/ProjectSettings/ProjectDefaultStrategySettings/ProjectEnvironment/ProjectEnvironmentDefaultStrategy/EditDefaultStrategy.tsx b/frontend/src/component/project/Project/ProjectSettings/ProjectDefaultStrategySettings/ProjectEnvironment/ProjectEnvironmentDefaultStrategy/EditDefaultStrategy.tsx index 34eaad10b8c6..1e6773bce8d7 100644 --- a/frontend/src/component/project/Project/ProjectSettings/ProjectDefaultStrategySettings/ProjectEnvironment/ProjectEnvironmentDefaultStrategy/EditDefaultStrategy.tsx +++ b/frontend/src/component/project/Project/ProjectSettings/ProjectDefaultStrategySettings/ProjectEnvironment/ProjectEnvironmentDefaultStrategy/EditDefaultStrategy.tsx @@ -107,9 +107,8 @@ const EditDefaultStrategy = () => { refetchSavedStrategySegments(); refetchProjectOverview(); setToastData({ - title: 'Default Strategy updated', + text: 'Default Strategy updated', type: 'success', - confetti: true, }); }; diff --git a/frontend/src/component/project/Project/ProjectSettings/Settings/EditProject/UpdateEnterpriseSettings.tsx b/frontend/src/component/project/Project/ProjectSettings/Settings/EditProject/UpdateEnterpriseSettings.tsx index 3a3dfb55ad9f..71c2f44e5c12 100644 --- a/frontend/src/component/project/Project/ProjectSettings/Settings/EditProject/UpdateEnterpriseSettings.tsx +++ b/frontend/src/component/project/Project/ProjectSettings/Settings/EditProject/UpdateEnterpriseSettings.tsx @@ -125,7 +125,7 @@ export const UpdateEnterpriseSettings = ({ await editProjectSettings(id, payload); refetch(); setToastData({ - title: 'Project information updated', + text: 'Project information updated', type: 'success', }); trackPattern(featureNamingPattern); diff --git a/frontend/src/component/project/Project/ProjectSettings/Settings/EditProject/UpdateProject.tsx b/frontend/src/component/project/Project/ProjectSettings/Settings/EditProject/UpdateProject.tsx index 38f067337b49..28e7594b31eb 100644 --- a/frontend/src/component/project/Project/ProjectSettings/Settings/EditProject/UpdateProject.tsx +++ b/frontend/src/component/project/Project/ProjectSettings/Settings/EditProject/UpdateProject.tsx @@ -94,7 +94,7 @@ export const UpdateProject = ({ project }: IUpdateProject) => { await editProject(id, payload); refetch(); setToastData({ - title: 'Project information updated', + text: 'Project information updated', type: 'success', }); if (projectStickiness !== DEFAULT_PROJECT_STICKINESS) { diff --git a/frontend/src/component/project/ProjectAccess/ProjectAccessAssign/ProjectAccessAssign.tsx b/frontend/src/component/project/ProjectAccess/ProjectAccessAssign/ProjectAccessAssign.tsx index 4246730b4fe6..87cc5b541758 100644 --- a/frontend/src/component/project/ProjectAccess/ProjectAccessAssign/ProjectAccessAssign.tsx +++ b/frontend/src/component/project/ProjectAccess/ProjectAccessAssign/ProjectAccessAssign.tsx @@ -233,7 +233,7 @@ export const ProjectAccessAssign = ({ refetchProjectAccess(); navigate(GO_BACK); setToastData({ - title: `${selectedOptions.length} ${ + text: `${selectedOptions.length} ${ selectedOptions.length === 1 ? 'access' : 'accesses' } ${!edit ? 'assigned' : 'edited'} successfully`, type: 'success', diff --git a/frontend/src/component/project/ProjectAccess/ProjectAccessTable/ProjectAccessTable.tsx b/frontend/src/component/project/ProjectAccess/ProjectAccessTable/ProjectAccessTable.tsx index df4b7aca4262..8ddbd9701b87 100644 --- a/frontend/src/component/project/ProjectAccess/ProjectAccessTable/ProjectAccessTable.tsx +++ b/frontend/src/component/project/ProjectAccess/ProjectAccessTable/ProjectAccessTable.tsx @@ -382,14 +382,14 @@ export const ProjectAccessTable: VFC = () => { refetchProjectAccess(); setToastData({ type: 'success', - title: `${ + text: `${ name || `The ${entityType}` } has been removed from project`, }); } catch (err: any) { setToastData({ type: 'error', - title: + text: err.message || `Server problems when removing ${entityType}.`, }); diff --git a/frontend/src/component/project/ProjectEnvironment/ProjectEnvironment.tsx b/frontend/src/component/project/ProjectEnvironment/ProjectEnvironment.tsx index 0e48ee527375..b86b5c23d4b5 100644 --- a/frontend/src/component/project/ProjectEnvironment/ProjectEnvironment.tsx +++ b/frontend/src/component/project/ProjectEnvironment/ProjectEnvironment.tsx @@ -111,8 +111,7 @@ const ProjectEnvironmentList = () => { return; } setToastData({ - title: 'One environment must be visible', - text: 'You must always have at least one visible environment per project', + text: 'At least one environment must be visible in the project', type: 'error', }); } else { @@ -120,8 +119,7 @@ const ProjectEnvironmentList = () => { await addEnvironmentToProject(projectId, env.name); refetch(); setToastData({ - title: 'Environment set as visible', - text: 'Environment successfully set as visible.', + text: 'Environment set as visible', type: 'success', }); } catch (error) { @@ -139,8 +137,7 @@ const ProjectEnvironmentList = () => { ); refetch(); setToastData({ - title: 'Environment set as hidden', - text: 'Environment successfully set as hidden.', + text: 'Environment hidden', type: 'success', }); } catch (e) { diff --git a/frontend/src/component/project/ProjectList/ReviveProjectDialog/ReviveProjectDialog.tsx b/frontend/src/component/project/ProjectList/ReviveProjectDialog/ReviveProjectDialog.tsx index 1889d846a72e..3463b38612d2 100644 --- a/frontend/src/component/project/ProjectList/ReviveProjectDialog/ReviveProjectDialog.tsx +++ b/frontend/src/component/project/ProjectList/ReviveProjectDialog/ReviveProjectDialog.tsx @@ -39,9 +39,8 @@ export const ReviveProjectDialog = ({ refetchProjectArchive(); navigate(`/projects/${id}`); setToastData({ - title: 'Revive project', + text: 'Project revived', type: 'success', - text: 'Successfully revived project', }); } catch (ex: unknown) { setToastApiError(formatUnknownError(ex)); diff --git a/frontend/src/component/releases/ReleaseManagement/ReleasePlanTemplateCardMenu.tsx b/frontend/src/component/releases/ReleaseManagement/ReleasePlanTemplateCardMenu.tsx index 8a30ad3822b8..2955cae0b370 100644 --- a/frontend/src/component/releases/ReleaseManagement/ReleasePlanTemplateCardMenu.tsx +++ b/frontend/src/component/releases/ReleaseManagement/ReleasePlanTemplateCardMenu.tsx @@ -30,7 +30,6 @@ export const ReleasePlanTemplateCardMenu = ({ refetch(); setToastData({ type: 'success', - title: 'Success', text: 'Release plan template deleted', }); } catch (error: unknown) { diff --git a/frontend/src/component/releases/ReleasePlanTemplate/CreateReleasePlanTemplate.tsx b/frontend/src/component/releases/ReleasePlanTemplate/CreateReleasePlanTemplate.tsx index 5b8993380577..76dbcf170b84 100644 --- a/frontend/src/component/releases/ReleasePlanTemplate/CreateReleasePlanTemplate.tsx +++ b/frontend/src/component/releases/ReleasePlanTemplate/CreateReleasePlanTemplate.tsx @@ -59,7 +59,7 @@ export const CreateReleasePlanTemplate = () => { scrollToTop(); setToastData({ type: 'success', - title: 'Release plan template created', + text: 'Release plan template created', }); navigate('/release-management'); } catch (error: unknown) { diff --git a/frontend/src/component/releases/ReleasePlanTemplate/EditReleasePlanTemplate.tsx b/frontend/src/component/releases/ReleasePlanTemplate/EditReleasePlanTemplate.tsx index 622fd7961d93..0ad70f8ffbe9 100644 --- a/frontend/src/component/releases/ReleasePlanTemplate/EditReleasePlanTemplate.tsx +++ b/frontend/src/component/releases/ReleasePlanTemplate/EditReleasePlanTemplate.tsx @@ -66,7 +66,7 @@ export const EditReleasePlanTemplate = () => { await refetch(); setToastData({ type: 'success', - title: 'Release plan template updated', + text: 'Release plan template updated', }); navigate('/release-management'); } catch (error: unknown) { diff --git a/frontend/src/component/segments/CreateSegment/CreateSegment.tsx b/frontend/src/component/segments/CreateSegment/CreateSegment.tsx index c90da91e5662..aa54cdfc61fd 100644 --- a/frontend/src/component/segments/CreateSegment/CreateSegment.tsx +++ b/frontend/src/component/segments/CreateSegment/CreateSegment.tsx @@ -76,8 +76,7 @@ export const CreateSegment = ({ modal }: ICreateSegmentProps) => { navigate('/segments/'); } setToastData({ - title: 'Segment created', - confetti: true, + text: 'Segment created', type: 'success', }); showFeedbackCES({ diff --git a/frontend/src/component/segments/EditSegment/EditSegment.tsx b/frontend/src/component/segments/EditSegment/EditSegment.tsx index dda355e03bec..797674b55f68 100644 --- a/frontend/src/component/segments/EditSegment/EditSegment.tsx +++ b/frontend/src/component/segments/EditSegment/EditSegment.tsx @@ -101,7 +101,7 @@ export const EditSegment = ({ modal }: IEditSegmentProps) => { navigate('/segments/'); } setToastData({ - title: `Segment ${ + text: `Segment ${ changeRequestEnv ? 'change added to draft' : 'updated' }`, type: 'success', diff --git a/frontend/src/component/segments/RemoveSegmentButton/RemoveSegmentButton.tsx b/frontend/src/component/segments/RemoveSegmentButton/RemoveSegmentButton.tsx index 5736680bc3a9..72df0a34b9df 100644 --- a/frontend/src/component/segments/RemoveSegmentButton/RemoveSegmentButton.tsx +++ b/frontend/src/component/segments/RemoveSegmentButton/RemoveSegmentButton.tsx @@ -32,7 +32,7 @@ export const RemoveSegmentButton = ({ segment }: IRemoveSegmentButtonProps) => { await refetchSegments(); setToastData({ type: 'success', - title: 'Successfully deleted segment', + text: 'Segment deleted', }); } catch (error: unknown) { setToastApiError(formatUnknownError(error)); diff --git a/frontend/src/component/signals/SignalEndpointsModal/SignalEndpointsForm/SignalEndpointsFormURL.tsx b/frontend/src/component/signals/SignalEndpointsModal/SignalEndpointsForm/SignalEndpointsFormURL.tsx index fb79ccdb9c1c..3c3ae30a7770 100644 --- a/frontend/src/component/signals/SignalEndpointsModal/SignalEndpointsForm/SignalEndpointsFormURL.tsx +++ b/frontend/src/component/signals/SignalEndpointsModal/SignalEndpointsForm/SignalEndpointsFormURL.tsx @@ -47,7 +47,7 @@ export const SignalEndpointsFormURL = ({ copy(url); setToastData({ type: 'success', - title: 'Copied to clipboard', + text: 'Copied to clipboard', }); }; diff --git a/frontend/src/component/signals/SignalEndpointsModal/SignalEndpointsForm/SignalEndpointsTokens/SignalEndpointsTokens.tsx b/frontend/src/component/signals/SignalEndpointsModal/SignalEndpointsForm/SignalEndpointsTokens/SignalEndpointsTokens.tsx index 26fc31799a77..37967cb401bf 100644 --- a/frontend/src/component/signals/SignalEndpointsModal/SignalEndpointsForm/SignalEndpointsTokens/SignalEndpointsTokens.tsx +++ b/frontend/src/component/signals/SignalEndpointsModal/SignalEndpointsForm/SignalEndpointsTokens/SignalEndpointsTokens.tsx @@ -115,7 +115,7 @@ export const SignalEndpointsTokens = ({ setNewToken(token); setTokenOpen(true); setToastData({ - title: 'Token created successfully', + text: 'Token created', type: 'success', }); } catch (error: unknown) { @@ -134,7 +134,7 @@ export const SignalEndpointsTokens = ({ refetchTokens(); setDeleteOpen(false); setToastData({ - title: 'Token deleted successfully', + text: 'Token deleted', type: 'success', }); } catch (error: unknown) { diff --git a/frontend/src/component/signals/SignalEndpointsModal/SignalEndpointsModal.tsx b/frontend/src/component/signals/SignalEndpointsModal/SignalEndpointsModal.tsx index 3f25780d2410..98a8e70641b3 100644 --- a/frontend/src/component/signals/SignalEndpointsModal/SignalEndpointsModal.tsx +++ b/frontend/src/component/signals/SignalEndpointsModal/SignalEndpointsModal.tsx @@ -132,9 +132,7 @@ export const SignalEndpointsModal = ({ } } setToastData({ - title: `Signal endpoint ${ - editing ? 'updated' : 'added' - } successfully`, + text: `Signal endpoint ${editing ? 'updated' : 'added'}`, type: 'success', }); refetch(); diff --git a/frontend/src/component/signals/SignalEndpointsTable/SignalEndpointsTable.tsx b/frontend/src/component/signals/SignalEndpointsTable/SignalEndpointsTable.tsx index d72f2d4c4db8..8aef83e80f55 100644 --- a/frontend/src/component/signals/SignalEndpointsTable/SignalEndpointsTable.tsx +++ b/frontend/src/component/signals/SignalEndpointsTable/SignalEndpointsTable.tsx @@ -68,7 +68,7 @@ export const SignalEndpointsTable = () => { try { await toggleSignalEndpoint(id, enabled); setToastData({ - title: `"${name}" has been ${enabled ? 'enabled' : 'disabled'}`, + text: `"${name}" ${enabled ? 'enabled' : 'disabled'}`, type: 'success', }); refetch(); @@ -81,7 +81,7 @@ export const SignalEndpointsTable = () => { try { await removeSignalEndpoint(id); setToastData({ - title: `"${name}" has been deleted`, + text: `"${name}" deleted`, type: 'success', }); refetch(); @@ -181,7 +181,7 @@ export const SignalEndpointsTable = () => { ); setToastData({ type: 'success', - title: 'Copied to clipboard', + text: 'Copied to clipboard', }); }} onOpenSignals={() => { diff --git a/frontend/src/component/strategies/CreateStrategy/CreateStrategy.tsx b/frontend/src/component/strategies/CreateStrategy/CreateStrategy.tsx index c9248b78f681..f890f3a0fae1 100644 --- a/frontend/src/component/strategies/CreateStrategy/CreateStrategy.tsx +++ b/frontend/src/component/strategies/CreateStrategy/CreateStrategy.tsx @@ -64,9 +64,7 @@ export const CreateStrategy = () => { refetchStrategies(); navigate(`/strategies/${strategyName}`); setToastData({ - title: 'Strategy created', - text: 'Successfully created strategy', - confetti: true, + text: 'Strategy created', type: 'success', }); } catch (e: unknown) { diff --git a/frontend/src/component/strategies/EditStrategy/EditStrategy.tsx b/frontend/src/component/strategies/EditStrategy/EditStrategy.tsx index 8c6eb4a3eb97..4fdaa953dfb7 100644 --- a/frontend/src/component/strategies/EditStrategy/EditStrategy.tsx +++ b/frontend/src/component/strategies/EditStrategy/EditStrategy.tsx @@ -50,8 +50,7 @@ export const EditStrategy = () => { navigate(`/strategies/${strategyName}`); setToastData({ type: 'success', - title: 'Success', - text: 'Successfully updated strategy', + text: 'Strategy updated', }); refetchStrategies(); } catch (error: unknown) { diff --git a/frontend/src/component/strategies/StrategiesList/StrategiesList.tsx b/frontend/src/component/strategies/StrategiesList/StrategiesList.tsx index 525bbefcc96f..b5354a73820f 100644 --- a/frontend/src/component/strategies/StrategiesList/StrategiesList.tsx +++ b/frontend/src/component/strategies/StrategiesList/StrategiesList.tsx @@ -182,8 +182,7 @@ export const StrategiesList = () => { refetchStrategies(); setToastData({ type: 'success', - title: 'Success', - text: 'Strategy reactivated successfully', + text: 'Strategy reactivated', }); } catch (error: unknown) { setToastApiError(formatUnknownError(error)); @@ -200,8 +199,7 @@ export const StrategiesList = () => { refetchStrategies(); setToastData({ type: 'success', - title: 'Success', - text: 'Strategy deprecated successfully', + text: 'Strategy deprecated', }); } catch (error: unknown) { setToastApiError(formatUnknownError(error)); @@ -230,8 +228,7 @@ export const StrategiesList = () => { refetchStrategies(); setToastData({ type: 'success', - title: 'Success', - text: 'Strategy deleted successfully', + text: 'Strategy deleted', }); } catch (error: unknown) { setToastApiError(formatUnknownError(error)); diff --git a/frontend/src/component/tags/CreateTagType/CreateTagType.tsx b/frontend/src/component/tags/CreateTagType/CreateTagType.tsx index bd772450486b..7f5d2ad9bd09 100644 --- a/frontend/src/component/tags/CreateTagType/CreateTagType.tsx +++ b/frontend/src/component/tags/CreateTagType/CreateTagType.tsx @@ -36,8 +36,7 @@ const CreateTagType = () => { await createTag(payload); navigate('/tag-types'); setToastData({ - title: 'Tag type created', - confetti: true, + text: 'Tag type created', type: 'success', }); } catch (error: unknown) { diff --git a/frontend/src/component/tags/EditTagType/EditTagType.tsx b/frontend/src/component/tags/EditTagType/EditTagType.tsx index 9aa989aec00f..4af677dffd74 100644 --- a/frontend/src/component/tags/EditTagType/EditTagType.tsx +++ b/frontend/src/component/tags/EditTagType/EditTagType.tsx @@ -37,7 +37,7 @@ const EditTagType = () => { await updateTagType(tagName, payload); navigate('/tag-types'); setToastData({ - title: 'Tag type updated', + text: 'Tag type updated', type: 'success', }); } catch (error: unknown) { diff --git a/frontend/src/component/tags/TagTypeList/TagTypeList.tsx b/frontend/src/component/tags/TagTypeList/TagTypeList.tsx index a1b467800ea1..a4ce5f25dc35 100644 --- a/frontend/src/component/tags/TagTypeList/TagTypeList.tsx +++ b/frontend/src/component/tags/TagTypeList/TagTypeList.tsx @@ -178,7 +178,7 @@ export const TagTypeList = () => { setToastData({ type: 'success', show: true, - title: 'Successfully deleted tag type.', + text: 'Tag type deleted', }); } } catch (error) { diff --git a/frontend/src/component/user/HostedAuth.tsx b/frontend/src/component/user/HostedAuth.tsx index 2cbe3ee86af0..c13421f7d0be 100644 --- a/frontend/src/component/user/HostedAuth.tsx +++ b/frontend/src/component/user/HostedAuth.tsx @@ -79,8 +79,7 @@ const HostedAuth: VFC = ({ authDetails, redirect }) => { if (data.deletedSessions && data.activeSessions) { setToastData({ type: 'success', - title: 'Maximum Session Limit Reached', - text: `You can have up to ${data.activeSessions} active sessions at a time. To enhance your account security, we’ve ended ${data.deletedSessions} session(s) on other browsers.`, + text: `Maximum session limit of ${data.activeSessions} reached`, }); } refetchUser(); diff --git a/frontend/src/component/user/PasswordAuth.test.tsx b/frontend/src/component/user/PasswordAuth.test.tsx index bffdda6539c5..33b84678249b 100644 --- a/frontend/src/component/user/PasswordAuth.test.tsx +++ b/frontend/src/component/user/PasswordAuth.test.tsx @@ -46,7 +46,7 @@ test('should show deleted stale sessions info for Password Auth', async () => { button.click(); - await screen.findByText('Maximum Session Limit Reached'); + await screen.findByText('Maximum session limit of 3 reached'); }); test('should show deleted stale sessions info for Hosted Auth', async () => { @@ -72,5 +72,5 @@ test('should show deleted stale sessions info for Hosted Auth', async () => { button.click(); - await screen.findByText('Maximum Session Limit Reached'); + await screen.findByText('Maximum session limit of 3 reached'); }); diff --git a/frontend/src/component/user/PasswordAuth.tsx b/frontend/src/component/user/PasswordAuth.tsx index 95bb12bfeacf..0d099d9d7629 100644 --- a/frontend/src/component/user/PasswordAuth.tsx +++ b/frontend/src/component/user/PasswordAuth.tsx @@ -78,8 +78,7 @@ const PasswordAuth: VFC = ({ authDetails, redirect }) => { if (data.deletedSessions && data.activeSessions) { setToastData({ type: 'success', - title: 'Maximum Session Limit Reached', - text: `You can have up to ${data.activeSessions} active sessions at a time. To enhance your account security, we’ve ended ${data.deletedSessions} session(s) on other browsers.`, + text: `Maximum session limit of ${data.activeSessions} reached`, }); } diff --git a/frontend/src/component/user/Profile/PasswordTab/PasswordTab.tsx b/frontend/src/component/user/Profile/PasswordTab/PasswordTab.tsx index 89b4d3f42c5f..60ae112d0df7 100644 --- a/frontend/src/component/user/Profile/PasswordTab/PasswordTab.tsx +++ b/frontend/src/component/user/Profile/PasswordTab/PasswordTab.tsx @@ -62,8 +62,7 @@ export const PasswordTab = () => { oldPassword, }); setToastData({ - title: 'Password changed successfully', - text: 'Now you can sign in using your new password.', + text: 'Password changed', type: 'success', }); } catch (error: unknown) { diff --git a/frontend/src/component/user/Profile/PersonalAPITokensTab/DeletePersonalAPIToken/DeletePersonalAPIToken.tsx b/frontend/src/component/user/Profile/PersonalAPITokensTab/DeletePersonalAPIToken/DeletePersonalAPIToken.tsx index b181ad14a2de..7b8418767eec 100644 --- a/frontend/src/component/user/Profile/PersonalAPITokensTab/DeletePersonalAPIToken/DeletePersonalAPIToken.tsx +++ b/frontend/src/component/user/Profile/PersonalAPITokensTab/DeletePersonalAPIToken/DeletePersonalAPIToken.tsx @@ -29,7 +29,7 @@ export const DeletePersonalAPIToken: FC = ({ refetchTokens(); setOpen(false); setToastData({ - title: 'Token deleted successfully', + text: 'Token deleted', type: 'success', }); } catch (error: unknown) { diff --git a/frontend/src/component/user/Profile/ProfileTab/ProductivityEmailSubscription.test.tsx b/frontend/src/component/user/Profile/ProfileTab/ProductivityEmailSubscription.test.tsx index 127266787cbc..a06615264e4e 100644 --- a/frontend/src/component/user/Profile/ProfileTab/ProductivityEmailSubscription.test.tsx +++ b/frontend/src/component/user/Profile/ProfileTab/ProductivityEmailSubscription.test.tsx @@ -100,6 +100,6 @@ test('handle error', async () => { checkbox.click(); - await screen.findByText('Something went wrong'); + await screen.findByText('user error'); expect(changed).toBe(true); }); diff --git a/frontend/src/component/user/Profile/ProfileTab/ProductivityEmailSubscription.tsx b/frontend/src/component/user/Profile/ProfileTab/ProductivityEmailSubscription.tsx index d2848eeaef67..ee81becf440d 100644 --- a/frontend/src/component/user/Profile/ProfileTab/ProductivityEmailSubscription.tsx +++ b/frontend/src/component/user/Profile/ProfileTab/ProductivityEmailSubscription.tsx @@ -28,7 +28,7 @@ export const ProductivityEmailSubscription: FC<{ if (status === 'subscribed') { await unsubscribe('productivity-report'); setToastData({ - title: 'Unsubscribed from productivity report', + text: 'Unsubscribed from productivity report', type: 'success', }); trackEvent('productivity-report', { @@ -39,7 +39,7 @@ export const ProductivityEmailSubscription: FC<{ } else { await subscribe('productivity-report'); setToastData({ - title: 'Subscribed to productivity report', + text: 'Subscribed to productivity report', type: 'success', }); trackEvent('productivity-report', { diff --git a/frontend/src/contexts/UIContext.ts b/frontend/src/contexts/UIContext.ts index aff3651bab62..a4374abb19b0 100644 --- a/frontend/src/contexts/UIContext.ts +++ b/frontend/src/contexts/UIContext.ts @@ -15,7 +15,6 @@ export type themeMode = 'light' | 'dark'; export const createEmptyToast = (): IToast => { return { type: 'success', - title: '', text: '', components: [], show: false, diff --git a/frontend/src/hooks/api/actions/useFavoriteFeaturesApi/useFavoriteFeaturesApi.ts b/frontend/src/hooks/api/actions/useFavoriteFeaturesApi/useFavoriteFeaturesApi.ts index ccf4ef094a7c..33714a3145ed 100644 --- a/frontend/src/hooks/api/actions/useFavoriteFeaturesApi/useFavoriteFeaturesApi.ts +++ b/frontend/src/hooks/api/actions/useFavoriteFeaturesApi/useFavoriteFeaturesApi.ts @@ -24,7 +24,7 @@ export const useFavoriteFeaturesApi = () => { await makeLightRequest(req.caller, req.id); setToastData({ - title: 'Feature flag added to favorites', + text: 'Feature flag added to favorites', type: 'success', }); trackEvent('favorite', { @@ -52,7 +52,7 @@ export const useFavoriteFeaturesApi = () => { await makeLightRequest(req.caller, req.id); setToastData({ - title: 'Feature flag removed from favorites', + text: 'Feature flag removed from favorites', type: 'success', }); trackEvent('favorite', { diff --git a/frontend/src/hooks/api/actions/useFavoriteProjectsApi/useFavoriteProjectsApi.ts b/frontend/src/hooks/api/actions/useFavoriteProjectsApi/useFavoriteProjectsApi.ts index 09ac4bbcfbb7..9fe76bde28f6 100644 --- a/frontend/src/hooks/api/actions/useFavoriteProjectsApi/useFavoriteProjectsApi.ts +++ b/frontend/src/hooks/api/actions/useFavoriteProjectsApi/useFavoriteProjectsApi.ts @@ -24,7 +24,7 @@ export const useFavoriteProjectsApi = () => { await makeLightRequest(req.caller, req.id); setToastData({ - title: 'Project added to favorites', + text: 'Project added to favorites', type: 'success', }); trackEvent('favorite', { @@ -52,7 +52,7 @@ export const useFavoriteProjectsApi = () => { await makeLightRequest(req.caller, req.id); setToastData({ - title: 'Project removed from favorites', + text: 'Project removed from favorites', type: 'success', }); trackEvent('favorite', { diff --git a/frontend/src/hooks/useChangeRequestAddStrategy.ts b/frontend/src/hooks/useChangeRequestAddStrategy.ts index 3fd7ffae8ddc..8ac280ec49fc 100644 --- a/frontend/src/hooks/useChangeRequestAddStrategy.ts +++ b/frontend/src/hooks/useChangeRequestAddStrategy.ts @@ -78,7 +78,7 @@ export const useChangeRequestAddStrategy = ( setChangeRequestDialogDetails({ isOpen: false }); setToastData({ type: 'success', - title: 'Changes added to the draft!', + text: 'Changes added to draft', }); } catch (error) { setToastApiError(formatUnknownError(error)); @@ -105,7 +105,7 @@ export const useChangeRequestAddStrategy = ( setChangeRequestDialogDetails({ isOpen: false }); setToastData({ type: 'success', - title: 'Changes added to the draft!', + text: 'Changes added to draft', }); } catch (error) { setToastApiError(formatUnknownError(error)); diff --git a/frontend/src/hooks/useChangeRequestToggle.ts b/frontend/src/hooks/useChangeRequestToggle.ts index 1e306d71bfeb..4cb0cfbdf703 100644 --- a/frontend/src/hooks/useChangeRequestToggle.ts +++ b/frontend/src/hooks/useChangeRequestToggle.ts @@ -62,7 +62,7 @@ export const useChangeRequestToggle = (project: string) => { })); setToastData({ type: 'success', - title: 'Changes added to the draft!', + text: 'Changes added to draft', }); } catch (error) { setToastApiError(formatUnknownError(error)); diff --git a/frontend/src/hooks/useToast.tsx b/frontend/src/hooks/useToast.tsx index ab75e949903d..bac077c7d4a6 100644 --- a/frontend/src/hooks/useToast.tsx +++ b/frontend/src/hooks/useToast.tsx @@ -14,8 +14,7 @@ const useToast = () => { const setToastApiError = useCallback( (text: string, overrides?: IToast) => { setToast({ - title: 'Something went wrong', - text, + text: text || 'Something went wrong.', type: 'error', show: true, autoHideDuration: 12000, diff --git a/frontend/src/interfaces/toast.ts b/frontend/src/interfaces/toast.ts index 8e93b9ebd8bd..4d955462dbaf 100644 --- a/frontend/src/interfaces/toast.ts +++ b/frontend/src/interfaces/toast.ts @@ -1,10 +1,8 @@ export interface IToast { type: 'success' | 'error'; - title: string; - text?: string; + text: string; components?: JSX.Element[]; show?: boolean; persist?: boolean; - confetti?: boolean; autoHideDuration?: number; }