Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional toast for D&D table actions #5182

Merged
merged 3 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
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)
- Added current version to the window.Fides object [#5173](https://github.com/ethyca/fides/pull/5173)
- Adds user_read scope to approver role so that they can update their own password [#5178](https://github.com/ethyca/fides/pull/5178)
- 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
Loading