Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

DEVPROD-945: Fix toast text for clearing subscriptions #2130

Merged
merged 3 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useState } from "react";
import { useMutation } from "@apollo/client";
import Button, { Variant } from "@leafygreen-ui/button";
import pluralize from "pluralize";
import { usePreferencesAnalytics } from "analytics";
import { ConfirmationModal } from "components/ConfirmationModal";
import { useToastContext } from "context/toast";
Expand All @@ -23,9 +24,10 @@ export const ClearSubscriptions: React.FC = () => {
onCompleted: (result) => {
setShowModal(false);
dispatchToast.success(
`Successfully cleared ${result.clearMySubscriptions} subscription${
result.clearMySubscriptions !== 1 && "s"
}!`
`Successfully cleared ${result.clearMySubscriptions} ${pluralize(
"subscription",
result.clearMySubscriptions
)}.`
);
},
onError: (err) => {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/taskHistory/ColumnHeaders/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const ColumnHeaders: React.FC<ColumnHeadersProps> = ({
if (!buildVariantsForTaskName) {
reportError(
new Error("No build variants found for task name")
).severe();
).warning();
dispatchToast.error(`No build variants found for task: ${taskName}`);
}
},
Expand Down
6 changes: 4 additions & 2 deletions src/pages/variantHistory/ColumnHeaders.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ const ColumnHeaders: React.FC<ColumnHeadersProps> = ({
if (!taskNamesForBuildVariant) {
reportError(
new Error("No task names found for build variant")
).severe();
dispatchToast.error(`No tasks found for buildVariant: ${variantName}}`);
).warning();
dispatchToast.error(
`No tasks found for build variant: ${variantName}}`
);
}
},
});
Expand Down