Skip to content

Commit

Permalink
Add additional toast for D&D table actions (#5182)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpople authored Aug 14, 2024
1 parent 1d6aa2c commit f8f23a7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 18 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ The types of changes are:
- Added support for SSO Login with multiple providers (Fides Plus feature) [#5134](https://github.com/ethyca/fides/pull/5134)
- Adds user_read scope to approver role so that they can update their own password [#5178](https://github.com/ethyca/fides/pull/5178)
- Added PATCH endpoint for partially updating connection secrets [#5172](https://github.com/ethyca/fides/pull/5172)
- Add success toast on confirming classification in data discovery tables [#5182](https://github.com/ethyca/fides/pull/5182)

### Fixed
- Fixed the OAuth2 configuration for the Snap integration [#5158](https://github.com/ethyca/fides/pull/5158)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { DiffStatus, StagedResource } from "~/types/api";

import { MonitorOffIcon } from "../common/Icon/MonitorOffIcon";
import { MonitorOnIcon } from "../common/Icon/MonitorOnIcon";
import { TrashCanOutlineIcon } from "../common/Icon/TrashCanOutlineIcon";
import ActionButton from "./ActionButton";
import {
useConfirmResourceMutation,
Expand Down Expand Up @@ -59,8 +58,6 @@ const DetectionItemAction = ({ resource }: DetectionItemActionProps) => {
(childDiffStatus[DiffStatus.ADDITION] ||
childDiffStatus[DiffStatus.REMOVAL]);

const showRemoveAction = false;

return (
<HStack onClick={(e) => e.stopPropagation()}>
{showStartMonitoringAction && (
Expand Down Expand Up @@ -110,21 +107,10 @@ const DetectionItemAction = ({ resource }: DetectionItemActionProps) => {
staged_resource_urn: resource.urn,
monitor_config_id: resource.monitor_config_id!,
});
setIsProcessingAction(false);
}}
disabled={isProcessingAction}
/>
)}
{showRemoveAction && (
<ActionButton
title="Drop"
icon={<TrashCanOutlineIcon />}
onClick={async () => {
setIsProcessingAction(true);
await confirmResourceMutation({
staged_resource_urn: resource.urn,
monitor_config_id: resource.monitor_config_id!,
});
successAlert(
`These changes have been added to a Fides dataset. To view, navigate to "Manage datasets".`,
`Table changes confirmed`,
);
setIsProcessingAction(false);
}}
disabled={isProcessingAction}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ButtonSpinner, CheckIcon, HStack, ViewOffIcon } from "fidesui";
import { useState } from "react";

import { useAlert } from "~/features/common/hooks";
import { DiffStatus, StagedResource } from "~/types/api";

import ActionButton from "./ActionButton";
Expand All @@ -22,6 +23,8 @@ const DiscoveryItemActions = ({ resource }: DiscoveryItemActionsProps) => {

const [isProcessingAction, setIsProcessingAction] = useState(false);

const { successAlert } = useAlert();

const { diff_status: diffStatus, child_diff_statuses: childDiffStatus } =
resource;

Expand Down Expand Up @@ -56,6 +59,10 @@ const DiscoveryItemActions = ({ resource }: DiscoveryItemActionsProps) => {
await promoteResourceMutation({
staged_resource_urn: resource.urn,
});
successAlert(
`These changes have been added to a Fides dataset. To view, navigate to "Manage datasets".`,
`Table changes confirmed`,
);
setIsProcessingAction(false);
}}
disabled={isProcessingAction}
Expand Down

0 comments on commit f8f23a7

Please sign in to comment.