From 8b0405ea06b186f4ac05b264097e031b8104816d Mon Sep 17 00:00:00 2001 From: Lucano Vera Date: Thu, 22 Aug 2024 13:57:12 -0300 Subject: [PATCH 01/23] PROD-2323 WIP --- .../src/features/common/DataTabsHeader.tsx | 7 ++++- .../DetectionResultFilterTabs.tsx | 26 ++++++++++++++++ .../hooks/useDetectionResultsFilterTabs.tsx | 30 +++++++++++++++++++ .../tables/DetectionResultTable.tsx | 10 +++++++ 4 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 clients/admin-ui/src/features/data-discovery-and-detection/DetectionResultFilterTabs.tsx create mode 100644 clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultsFilterTabs.tsx diff --git a/clients/admin-ui/src/features/common/DataTabsHeader.tsx b/clients/admin-ui/src/features/common/DataTabsHeader.tsx index 7cbdb96150f..da64be93e55 100644 --- a/clients/admin-ui/src/features/common/DataTabsHeader.tsx +++ b/clients/admin-ui/src/features/common/DataTabsHeader.tsx @@ -5,15 +5,20 @@ import { FidesTab, TabData, TabListBorder } from "~/features/common/DataTabs"; interface DataTabsHeaderProps { data: Pick[]; border?: TabListBorder; + borderWidth?: TabsProps["borderSize"]; } const DataTabsHeader = ({ data, border = "partial", + borderWidth = 2, ...other }: DataTabsHeaderProps & Omit) => ( - + {data.map((tab) => ( void; + tabs: { label: string }[]; +} + +const DetectionResultFilterTabs = ({ + tabs, + onChange, + tabIndex, +}: DetectionResultFilterTabsProps) => { + return ( + + ); +}; +export default DetectionResultFilterTabs; diff --git a/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultsFilterTabs.tsx b/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultsFilterTabs.tsx new file mode 100644 index 00000000000..c3fbfeee523 --- /dev/null +++ b/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultsFilterTabs.tsx @@ -0,0 +1,30 @@ +import { useState } from "react"; + +import { DiffStatus } from "~/types/api"; + +const useDetectionResultFilterTabs = () => { + const [tabIndex, setTabIndex] = useState(0); + + const tabs = [ + { + label: "Action Required", + filters: [DiffStatus.ADDITION, DiffStatus.REMOVAL], + }, + { + label: "Monitored", + filters: [DiffStatus.MONITORED], + }, + { + label: "Unmonitored", + filters: [DiffStatus.MUTED], + }, + ]; + + return { + tabs, + tabIndex, + setTabIndex, + activeDiffFilters: tabs[tabIndex].filters, + }; +}; +export default useDetectionResultFilterTabs; diff --git a/clients/admin-ui/src/features/data-discovery-and-detection/tables/DetectionResultTable.tsx b/clients/admin-ui/src/features/data-discovery-and-detection/tables/DetectionResultTable.tsx index fd3e74886f3..d9b34ff186c 100644 --- a/clients/admin-ui/src/features/data-discovery-and-detection/tables/DetectionResultTable.tsx +++ b/clients/admin-ui/src/features/data-discovery-and-detection/tables/DetectionResultTable.tsx @@ -18,8 +18,10 @@ import { TableSkeletonLoader, useServerSidePagination, } from "~/features/common/table/v2"; +import DetectionResultFilterTabs from "~/features/data-discovery-and-detection/DetectionResultFilterTabs"; import { useGetMonitorResultsQuery } from "~/features/data-discovery-and-detection/discovery-detection.slice"; import useDetectionResultColumns from "~/features/data-discovery-and-detection/hooks/useDetectionResultColumns"; +import useDetectionResultFilterTabs from "~/features/data-discovery-and-detection/hooks/useDetectionResultsFilterTabs"; import useDiscoveryRoutes from "~/features/data-discovery-and-detection/hooks/useDiscoveryRoutes"; import IconLegendTooltip from "~/features/data-discovery-and-detection/IndicatorLegend"; import { StagedResourceType } from "~/features/data-discovery-and-detection/types/StagedResourceType"; @@ -70,6 +72,9 @@ const DetectionResultTable = ({ resourceUrn }: MonitorResultTableProps) => { router.query?.showFullSchema === "true" || false, ); + const { tabs, setTabIndex, tabIndex, activeDiffFilters } = + useDetectionResultFilterTabs(); + const diffStatusFilter: DiffStatus[] = [ DiffStatus.ADDITION, DiffStatus.REMOVAL, @@ -161,6 +166,11 @@ const DetectionResultTable = ({ resourceUrn }: MonitorResultTableProps) => { return ( <> + Date: Mon, 26 Aug 2024 11:17:20 -0300 Subject: [PATCH 02/23] PROD-2323 WIP --- .../DetectionResultFilterTabs.tsx | 12 ++-- .../hooks/useDetectionResultsFilterTabs.tsx | 20 ++++--- .../hooks/useDiscoveryRoutes.tsx | 6 +- .../tables/DetectionResultTable.tsx | 58 +++++-------------- 4 files changed, 36 insertions(+), 60 deletions(-) diff --git a/clients/admin-ui/src/features/data-discovery-and-detection/DetectionResultFilterTabs.tsx b/clients/admin-ui/src/features/data-discovery-and-detection/DetectionResultFilterTabs.tsx index 89f07726894..6a15deb5704 100644 --- a/clients/admin-ui/src/features/data-discovery-and-detection/DetectionResultFilterTabs.tsx +++ b/clients/admin-ui/src/features/data-discovery-and-detection/DetectionResultFilterTabs.tsx @@ -1,24 +1,24 @@ import DataTabsHeader from "~/features/common/DataTabsHeader"; interface DetectionResultFilterTabsProps { - tabIndex: number; + filterTabIndex: number; onChange: (index: number) => void; - tabs: { label: string }[]; + filterTabs: { label: string }[]; } const DetectionResultFilterTabs = ({ - tabs, + filterTabs, onChange, - tabIndex, + filterTabIndex, }: DetectionResultFilterTabsProps) => { return ( ); diff --git a/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultsFilterTabs.tsx b/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultsFilterTabs.tsx index c3fbfeee523..85681745acb 100644 --- a/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultsFilterTabs.tsx +++ b/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultsFilterTabs.tsx @@ -2,10 +2,16 @@ import { useState } from "react"; import { DiffStatus } from "~/types/api"; -const useDetectionResultFilterTabs = () => { - const [tabIndex, setTabIndex] = useState(0); +interface DetectionResultFilterTabsProps { + initialFilterTabIndex?: number; +} - const tabs = [ +const useDetectionResultFilterTabs = ({ + initialFilterTabIndex = 0, +}: DetectionResultFilterTabsProps) => { + const [filterTabIndex, setFilterTabIndex] = useState(initialFilterTabIndex); + + const filterTabs = [ { label: "Action Required", filters: [DiffStatus.ADDITION, DiffStatus.REMOVAL], @@ -21,10 +27,10 @@ const useDetectionResultFilterTabs = () => { ]; return { - tabs, - tabIndex, - setTabIndex, - activeDiffFilters: tabs[tabIndex].filters, + filterTabs, + filterTabIndex, + setFilterTabIndex, + activeDiffFilters: filterTabs[filterTabIndex].filters, }; }; export default useDetectionResultFilterTabs; diff --git a/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDiscoveryRoutes.tsx b/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDiscoveryRoutes.tsx index f29452d15ea..5c02b89828f 100644 --- a/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDiscoveryRoutes.tsx +++ b/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDiscoveryRoutes.tsx @@ -12,16 +12,16 @@ const useDiscoveryRoutes = () => { const navigateToDetectionResults = ({ resourceUrn, - showFullSchema = false, + filterTabIndex, }: { resourceUrn: string; - showFullSchema?: boolean; + filterTabIndex?: number; }) => { router.push({ pathname: DATA_DETECTION_ROUTE_DETAIL, query: { resourceUrn, - showFullSchema, + filterTabIndex, }, }); }; diff --git a/clients/admin-ui/src/features/data-discovery-and-detection/tables/DetectionResultTable.tsx b/clients/admin-ui/src/features/data-discovery-and-detection/tables/DetectionResultTable.tsx index d9b34ff186c..5c2b34b8d97 100644 --- a/clients/admin-ui/src/features/data-discovery-and-detection/tables/DetectionResultTable.tsx +++ b/clients/admin-ui/src/features/data-discovery-and-detection/tables/DetectionResultTable.tsx @@ -7,7 +7,7 @@ import { getGroupedRowModel, useReactTable, } from "@tanstack/react-table"; -import { Box, Flex, Switch, Text, VStack } from "fidesui"; +import { Box, Flex, Text, VStack } from "fidesui"; import { useRouter } from "next/router"; import { useEffect, useMemo, useState } from "react"; @@ -28,7 +28,7 @@ import { StagedResourceType } from "~/features/data-discovery-and-detection/type import { findResourceType } from "~/features/data-discovery-and-detection/utils/findResourceType"; import getResourceRowName from "~/features/data-discovery-and-detection/utils/getResourceRowName"; import isNestedField from "~/features/data-discovery-and-detection/utils/isNestedField"; -import { DiffStatus, StagedResource } from "~/types/api"; +import { StagedResource } from "~/types/api"; import { SearchInput } from "../SearchInput"; @@ -68,30 +68,12 @@ const DetectionResultTable = ({ resourceUrn }: MonitorResultTableProps) => { const router = useRouter(); const [searchQuery, setSearchQuery] = useState(""); - const [isShowingFullSchema, setIsShowingFullSchema] = useState( - router.query?.showFullSchema === "true" || false, - ); - - const { tabs, setTabIndex, tabIndex, activeDiffFilters } = - useDetectionResultFilterTabs(); - - const diffStatusFilter: DiffStatus[] = [ - DiffStatus.ADDITION, - DiffStatus.REMOVAL, - ]; - if (isShowingFullSchema) { - diffStatusFilter.push(DiffStatus.MONITORED); - diffStatusFilter.push(DiffStatus.MUTED); - } - - const childDiffStatusFilter: DiffStatus[] = [ - DiffStatus.ADDITION, - DiffStatus.REMOVAL, - ]; - if (isShowingFullSchema) { - childDiffStatusFilter.push(DiffStatus.MONITORED); - childDiffStatusFilter.push(DiffStatus.MUTED); - } + const { filterTabs, setFilterTabIndex, filterTabIndex, activeDiffFilters } = + useDetectionResultFilterTabs({ + initialFilterTabIndex: router.query?.filterTabIndex + ? Number(router.query?.filterTabIndex) + : undefined, + }); const { PAGE_SIZES, @@ -115,8 +97,8 @@ const DetectionResultTable = ({ resourceUrn }: MonitorResultTableProps) => { staged_resource_urn: resourceUrn, page: pageIndex, size: pageSize, - child_diff_status: childDiffStatusFilter, - diff_status: diffStatusFilter, + child_diff_status: activeDiffFilters, + diff_status: activeDiffFilters, search: searchQuery, }); @@ -144,7 +126,7 @@ const DetectionResultTable = ({ resourceUrn }: MonitorResultTableProps) => { const handleRowClicked = (row: StagedResource) => navigateToDetectionResults({ resourceUrn: row.urn, - showFullSchema: isShowingFullSchema, + filterTabIndex, }); const getRowIsClickable = (row: StagedResource) => @@ -167,9 +149,9 @@ const DetectionResultTable = ({ resourceUrn }: MonitorResultTableProps) => { return ( <> { - - setIsShowingFullSchema(!isShowingFullSchema)} - colorScheme="purple" - data-testid="full-schema-toggle" - /> - - Show full schema - - Date: Mon, 26 Aug 2024 17:08:59 -0300 Subject: [PATCH 03/23] PROD-2323 WIP --- .../hooks/useDetectionResultsFilterTabs.tsx | 8 ++--- .../hooks/useDiscoveryResultsFilterTabs.tsx | 36 +++++++++++++++++++ 2 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDiscoveryResultsFilterTabs.tsx diff --git a/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultsFilterTabs.tsx b/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultsFilterTabs.tsx index 85681745acb..8f2f8c3f5ef 100644 --- a/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultsFilterTabs.tsx +++ b/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultsFilterTabs.tsx @@ -2,13 +2,13 @@ import { useState } from "react"; import { DiffStatus } from "~/types/api"; -interface DetectionResultFilterTabsProps { +interface DetectionResultFiltersTabsProps { initialFilterTabIndex?: number; } -const useDetectionResultFilterTabs = ({ +const useDetectionResultsFilterTabs = ({ initialFilterTabIndex = 0, -}: DetectionResultFilterTabsProps) => { +}: DetectionResultFiltersTabsProps) => { const [filterTabIndex, setFilterTabIndex] = useState(initialFilterTabIndex); const filterTabs = [ @@ -33,4 +33,4 @@ const useDetectionResultFilterTabs = ({ activeDiffFilters: filterTabs[filterTabIndex].filters, }; }; -export default useDetectionResultFilterTabs; +export default useDetectionResultsFilterTabs; diff --git a/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDiscoveryResultsFilterTabs.tsx b/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDiscoveryResultsFilterTabs.tsx new file mode 100644 index 00000000000..53907e318c0 --- /dev/null +++ b/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDiscoveryResultsFilterTabs.tsx @@ -0,0 +1,36 @@ +import { useState } from "react"; + +import { DiffStatus } from "~/types/api"; + +interface DiscoveryResultsFilterTabsProps { + initialFilterTabIndex?: number; +} + +const useDiscoveryResultsFilterTabs = ({ + initialFilterTabIndex = 0, +}: DiscoveryResultsFilterTabsProps) => { + const [filterTabIndex, setFilterTabIndex] = useState(initialFilterTabIndex); + + const filterTabs = [ + { + label: "Action Required", + filters: [DiffStatus.ADDITION, DiffStatus.REMOVAL], + }, + { + label: "Classifying", + filters: [DiffStatus.MONITORED], + }, + { + label: "Unmonitored", + filters: [DiffStatus.MUTED], + }, + ]; + + return { + filterTabs, + filterTabIndex, + setFilterTabIndex, + activeDiffFilters: filterTabs[filterTabIndex].filters, + }; +}; +export default useDiscoveryResultsFilterTabs; From eccf6400d3bf3bd6821a0f7e6b8fd6e768f5edec Mon Sep 17 00:00:00 2001 From: Lucano Vera Date: Mon, 26 Aug 2024 17:28:58 -0300 Subject: [PATCH 04/23] PROD-2658 Fix pagination not being reset --- .../common/table/v2/PaginationBar.tsx | 9 +++++-- .../DetectionResultFilterTabs.tsx | 26 +++++++++++++++++++ .../tables/DetectionResultTable.tsx | 5 ++++ .../tables/DiscoveryResultTable.tsx | 5 ++++ 4 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 clients/admin-ui/src/features/data-discovery-and-detection/DetectionResultFilterTabs.tsx diff --git a/clients/admin-ui/src/features/common/table/v2/PaginationBar.tsx b/clients/admin-ui/src/features/common/table/v2/PaginationBar.tsx index 764d41aa06c..71936ca9a11 100644 --- a/clients/admin-ui/src/features/common/table/v2/PaginationBar.tsx +++ b/clients/admin-ui/src/features/common/table/v2/PaginationBar.tsx @@ -43,7 +43,7 @@ export const useClientSidePagination = ( export const useServerSidePagination = () => { const defaultPageIndex = 1; - const [pageSize, setPageSize] = useState(PAGE_SIZES[0]); + const [pageSize, setPageSizeState] = useState(PAGE_SIZES[0]); const [pageIndex, setPageIndex] = useState(defaultPageIndex); const [totalPages, setTotalPages] = useState(); const onPreviousPageClick = useCallback(() => { @@ -62,8 +62,13 @@ export const useServerSidePagination = () => { (pageIndex - 1) * pageSize === 0 ? 1 : (pageIndex - 1) * pageSize; const endRange = (pageIndex - 1) * pageSize + pageSize; - const resetPageIndexToDefault = () => { + const resetPageIndexToDefault = useCallback(() => { setPageIndex(defaultPageIndex); + }, []); + + const setPageSize = (newPageSize: Updater) => { + setPageSizeState(newPageSize); + resetPageIndexToDefault(); }; return { diff --git a/clients/admin-ui/src/features/data-discovery-and-detection/DetectionResultFilterTabs.tsx b/clients/admin-ui/src/features/data-discovery-and-detection/DetectionResultFilterTabs.tsx new file mode 100644 index 00000000000..6a15deb5704 --- /dev/null +++ b/clients/admin-ui/src/features/data-discovery-and-detection/DetectionResultFilterTabs.tsx @@ -0,0 +1,26 @@ +import DataTabsHeader from "~/features/common/DataTabsHeader"; + +interface DetectionResultFilterTabsProps { + filterTabIndex: number; + onChange: (index: number) => void; + filterTabs: { label: string }[]; +} + +const DetectionResultFilterTabs = ({ + filterTabs, + onChange, + filterTabIndex, +}: DetectionResultFilterTabsProps) => { + return ( + + ); +}; +export default DetectionResultFilterTabs; diff --git a/clients/admin-ui/src/features/data-discovery-and-detection/tables/DetectionResultTable.tsx b/clients/admin-ui/src/features/data-discovery-and-detection/tables/DetectionResultTable.tsx index fd3e74886f3..43e144b138c 100644 --- a/clients/admin-ui/src/features/data-discovery-and-detection/tables/DetectionResultTable.tsx +++ b/clients/admin-ui/src/features/data-discovery-and-detection/tables/DetectionResultTable.tsx @@ -100,8 +100,13 @@ const DetectionResultTable = ({ resourceUrn }: MonitorResultTableProps) => { endRange, pageIndex, setTotalPages, + resetPageIndexToDefault, } = useServerSidePagination(); + useEffect(() => { + resetPageIndexToDefault(); + }, [resourceUrn, searchQuery, resetPageIndexToDefault]); + const { isFetching, isLoading, diff --git a/clients/admin-ui/src/features/data-discovery-and-detection/tables/DiscoveryResultTable.tsx b/clients/admin-ui/src/features/data-discovery-and-detection/tables/DiscoveryResultTable.tsx index 882961973db..80fb7520bad 100644 --- a/clients/admin-ui/src/features/data-discovery-and-detection/tables/DiscoveryResultTable.tsx +++ b/clients/admin-ui/src/features/data-discovery-and-detection/tables/DiscoveryResultTable.tsx @@ -94,8 +94,13 @@ const DiscoveryResultTable = ({ resourceUrn }: MonitorResultTableProps) => { endRange, pageIndex, setTotalPages, + resetPageIndexToDefault, } = useServerSidePagination(); + useEffect(() => { + resetPageIndexToDefault(); + }, [resourceUrn, searchQuery, resetPageIndexToDefault]); + const { isFetching, isLoading, From cac7a2dc2c15b741806f6fc527e5db69e05fae0a Mon Sep 17 00:00:00 2001 From: Lucano Vera Date: Mon, 26 Aug 2024 17:35:02 -0300 Subject: [PATCH 05/23] Update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 659a75b8c3e..a395b2cea0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,9 @@ The types of changes are: ### Developer Experience - Sourcemaps are now working for fides-js in debug mode [#5222](https://github.com/ethyca/fides/pull/5222) +### Fixed +- Fix bug where Data Detection & Discovery table pagination fails to reset after navigating or searching [#5234](https://github.com/ethyca/fides/pull/5234) + ## [2.43.1](https://github.com/ethyca/fides/compare/2.43.0...2.43.1) ### Added From 661e38c3577a7cbca0cfa2a053b486a698848a9b Mon Sep 17 00:00:00 2001 From: Lucano Vera Date: Mon, 26 Aug 2024 17:36:14 -0300 Subject: [PATCH 06/23] PROD-2658 code update --- .../src/features/common/table/v2/PaginationBar.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/clients/admin-ui/src/features/common/table/v2/PaginationBar.tsx b/clients/admin-ui/src/features/common/table/v2/PaginationBar.tsx index 71936ca9a11..f7b970ead49 100644 --- a/clients/admin-ui/src/features/common/table/v2/PaginationBar.tsx +++ b/clients/admin-ui/src/features/common/table/v2/PaginationBar.tsx @@ -43,7 +43,7 @@ export const useClientSidePagination = ( export const useServerSidePagination = () => { const defaultPageIndex = 1; - const [pageSize, setPageSizeState] = useState(PAGE_SIZES[0]); + const [pageSize, setPageSize] = useState(PAGE_SIZES[0]); const [pageIndex, setPageIndex] = useState(defaultPageIndex); const [totalPages, setTotalPages] = useState(); const onPreviousPageClick = useCallback(() => { @@ -66,8 +66,8 @@ export const useServerSidePagination = () => { setPageIndex(defaultPageIndex); }, []); - const setPageSize = (newPageSize: Updater) => { - setPageSizeState(newPageSize); + const updatePageSize = (newPageSize: Updater) => { + setPageSize(newPageSize); resetPageIndexToDefault(); }; @@ -77,7 +77,7 @@ export const useServerSidePagination = () => { onNextPageClick, isNextPageDisabled, pageSize, - setPageSize, + setPageSize: updatePageSize, PAGE_SIZES, startRange, endRange, From 4774e15e8c3fa894931387dd99407d7b7eabe7fa Mon Sep 17 00:00:00 2001 From: Lucano Vera Date: Mon, 26 Aug 2024 17:38:46 -0300 Subject: [PATCH 07/23] Revert file commited accidentaly --- .../DetectionResultFilterTabs.tsx | 26 ------------------- 1 file changed, 26 deletions(-) delete mode 100644 clients/admin-ui/src/features/data-discovery-and-detection/DetectionResultFilterTabs.tsx diff --git a/clients/admin-ui/src/features/data-discovery-and-detection/DetectionResultFilterTabs.tsx b/clients/admin-ui/src/features/data-discovery-and-detection/DetectionResultFilterTabs.tsx deleted file mode 100644 index 6a15deb5704..00000000000 --- a/clients/admin-ui/src/features/data-discovery-and-detection/DetectionResultFilterTabs.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import DataTabsHeader from "~/features/common/DataTabsHeader"; - -interface DetectionResultFilterTabsProps { - filterTabIndex: number; - onChange: (index: number) => void; - filterTabs: { label: string }[]; -} - -const DetectionResultFilterTabs = ({ - filterTabs, - onChange, - filterTabIndex, -}: DetectionResultFilterTabsProps) => { - return ( - - ); -}; -export default DetectionResultFilterTabs; From 956ecb8a6cd546e60c5b9cc2ea31e19870b2b795 Mon Sep 17 00:00:00 2001 From: Lucano Vera Date: Tue, 27 Aug 2024 10:29:26 -0300 Subject: [PATCH 08/23] PROD-2323 Make change type icon be monitored when the active tab is monited. Do the same for unmonitored. --- .../hooks/useDetectionResultColumns.tsx | 10 ++++++++- .../hooks/useDetectionResultsFilterTabs.tsx | 5 +++++ .../tables/DetectionResultTable.tsx | 22 +++++++++++++------ 3 files changed, 29 insertions(+), 8 deletions(-) diff --git a/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultColumns.tsx b/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultColumns.tsx index fda31fd7c11..f90a9c09ede 100644 --- a/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultColumns.tsx +++ b/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultColumns.tsx @@ -7,14 +7,17 @@ import FieldDataTypeCell from "~/features/data-discovery-and-detection/tables/ce import ResultStatusBadgeCell from "~/features/data-discovery-and-detection/tables/cells/ResultStatusBadgeCell"; import ResultStatusCell from "~/features/data-discovery-and-detection/tables/cells/ResultStatusCell"; import { DiscoveryMonitorItem } from "~/features/data-discovery-and-detection/types/DiscoveryMonitorItem"; +import { ResourceChangeType } from "~/features/data-discovery-and-detection/types/ResourceChangeType"; import { StagedResourceType } from "~/features/data-discovery-and-detection/types/StagedResourceType"; import findProjectFromUrn from "../utils/findProjectFromUrn"; const useDetectionResultColumns = ({ resourceType, + iconChangeTypeOverride, }: { resourceType?: StagedResourceType; + iconChangeTypeOverride?: ResourceChangeType; }) => { const columnHelper = createColumnHelper(); @@ -28,7 +31,12 @@ const useDetectionResultColumns = ({ const columns = [ columnHelper.accessor((row) => row.name, { id: "name", - cell: (props) => , + cell: (props) => ( + + ), header: (props) => , }), columnHelper.accessor((row) => row.urn, { diff --git a/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultsFilterTabs.tsx b/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultsFilterTabs.tsx index 8f2f8c3f5ef..9cd3f3adbe5 100644 --- a/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultsFilterTabs.tsx +++ b/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultsFilterTabs.tsx @@ -1,5 +1,6 @@ import { useState } from "react"; +import { ResourceChangeType } from "~/features/data-discovery-and-detection/types/ResourceChangeType"; import { DiffStatus } from "~/types/api"; interface DetectionResultFiltersTabsProps { @@ -19,10 +20,12 @@ const useDetectionResultsFilterTabs = ({ { label: "Monitored", filters: [DiffStatus.MONITORED], + actionTypeIconOverride: ResourceChangeType.MONITORED, }, { label: "Unmonitored", filters: [DiffStatus.MUTED], + actionTypeIconOverride: ResourceChangeType.MUTED, }, ]; @@ -31,6 +34,8 @@ const useDetectionResultsFilterTabs = ({ filterTabIndex, setFilterTabIndex, activeDiffFilters: filterTabs[filterTabIndex].filters, + activeActionTypeIconOverride: + filterTabs[filterTabIndex].actionTypeIconOverride, }; }; export default useDetectionResultsFilterTabs; diff --git a/clients/admin-ui/src/features/data-discovery-and-detection/tables/DetectionResultTable.tsx b/clients/admin-ui/src/features/data-discovery-and-detection/tables/DetectionResultTable.tsx index f2c7b6edb07..edde45a215d 100644 --- a/clients/admin-ui/src/features/data-discovery-and-detection/tables/DetectionResultTable.tsx +++ b/clients/admin-ui/src/features/data-discovery-and-detection/tables/DetectionResultTable.tsx @@ -68,12 +68,17 @@ const DetectionResultTable = ({ resourceUrn }: MonitorResultTableProps) => { const router = useRouter(); const [searchQuery, setSearchQuery] = useState(""); - const { filterTabs, setFilterTabIndex, filterTabIndex, activeDiffFilters } = - useDetectionResultFilterTabs({ - initialFilterTabIndex: router.query?.filterTabIndex - ? Number(router.query?.filterTabIndex) - : undefined, - }); + const { + filterTabs, + setFilterTabIndex, + filterTabIndex, + activeDiffFilters, + activeActionTypeIconOverride, + } = useDetectionResultFilterTabs({ + initialFilterTabIndex: router.query?.filterTabIndex + ? Number(router.query?.filterTabIndex) + : undefined, + }); const { PAGE_SIZES, @@ -109,7 +114,10 @@ const DetectionResultTable = ({ resourceUrn }: MonitorResultTableProps) => { const resourceType = findResourceType(resources?.items[0]); - const { columns } = useDetectionResultColumns({ resourceType }); + const { columns } = useDetectionResultColumns({ + resourceType, + iconChangeTypeOverride: activeActionTypeIconOverride, + }); const { items: data, From bc844636f9c3fa54d7fc7785088469a495a26ef8 Mon Sep 17 00:00:00 2001 From: Lucano Vera Date: Tue, 27 Aug 2024 10:52:36 -0300 Subject: [PATCH 09/23] PROD_2323 Match the activity icon to the filter tab --- .../hooks/useDetectionResultColumns.tsx | 24 ++++++++++++++++--- .../hooks/useDetectionResultsFilterTabs.tsx | 5 ++++ .../tables/DetectionResultTable.tsx | 22 +++++++++++------ 3 files changed, 41 insertions(+), 10 deletions(-) diff --git a/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultColumns.tsx b/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultColumns.tsx index fda31fd7c11..1a3bee8db5b 100644 --- a/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultColumns.tsx +++ b/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultColumns.tsx @@ -7,14 +7,17 @@ import FieldDataTypeCell from "~/features/data-discovery-and-detection/tables/ce import ResultStatusBadgeCell from "~/features/data-discovery-and-detection/tables/cells/ResultStatusBadgeCell"; import ResultStatusCell from "~/features/data-discovery-and-detection/tables/cells/ResultStatusCell"; import { DiscoveryMonitorItem } from "~/features/data-discovery-and-detection/types/DiscoveryMonitorItem"; +import { ResourceChangeType } from "~/features/data-discovery-and-detection/types/ResourceChangeType"; import { StagedResourceType } from "~/features/data-discovery-and-detection/types/StagedResourceType"; import findProjectFromUrn from "../utils/findProjectFromUrn"; const useDetectionResultColumns = ({ resourceType, + iconChangeTypeOverride, }: { resourceType?: StagedResourceType; + iconChangeTypeOverride?: ResourceChangeType; }) => { const columnHelper = createColumnHelper(); @@ -28,7 +31,12 @@ const useDetectionResultColumns = ({ const columns = [ columnHelper.accessor((row) => row.name, { id: "name", - cell: (props) => , + cell: (props) => ( + + ), header: (props) => , }), columnHelper.accessor((row) => row.urn, { @@ -73,7 +81,12 @@ const useDetectionResultColumns = ({ const columns = [ columnHelper.accessor((row) => row.name, { id: "name", - cell: (props) => , + cell: (props) => ( + + ), header: (props) => , }), columnHelper.accessor((row) => row.description, { @@ -111,7 +124,12 @@ const useDetectionResultColumns = ({ const columns = [ columnHelper.accessor((row) => row.name, { id: "name", - cell: (props) => , + cell: (props) => ( + + ), header: (props) => , }), columnHelper.accessor((row) => row.source_data_type, { diff --git a/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultsFilterTabs.tsx b/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultsFilterTabs.tsx index 8f2f8c3f5ef..9cd3f3adbe5 100644 --- a/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultsFilterTabs.tsx +++ b/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultsFilterTabs.tsx @@ -1,5 +1,6 @@ import { useState } from "react"; +import { ResourceChangeType } from "~/features/data-discovery-and-detection/types/ResourceChangeType"; import { DiffStatus } from "~/types/api"; interface DetectionResultFiltersTabsProps { @@ -19,10 +20,12 @@ const useDetectionResultsFilterTabs = ({ { label: "Monitored", filters: [DiffStatus.MONITORED], + actionTypeIconOverride: ResourceChangeType.MONITORED, }, { label: "Unmonitored", filters: [DiffStatus.MUTED], + actionTypeIconOverride: ResourceChangeType.MUTED, }, ]; @@ -31,6 +34,8 @@ const useDetectionResultsFilterTabs = ({ filterTabIndex, setFilterTabIndex, activeDiffFilters: filterTabs[filterTabIndex].filters, + activeActionTypeIconOverride: + filterTabs[filterTabIndex].actionTypeIconOverride, }; }; export default useDetectionResultsFilterTabs; diff --git a/clients/admin-ui/src/features/data-discovery-and-detection/tables/DetectionResultTable.tsx b/clients/admin-ui/src/features/data-discovery-and-detection/tables/DetectionResultTable.tsx index f2c7b6edb07..edde45a215d 100644 --- a/clients/admin-ui/src/features/data-discovery-and-detection/tables/DetectionResultTable.tsx +++ b/clients/admin-ui/src/features/data-discovery-and-detection/tables/DetectionResultTable.tsx @@ -68,12 +68,17 @@ const DetectionResultTable = ({ resourceUrn }: MonitorResultTableProps) => { const router = useRouter(); const [searchQuery, setSearchQuery] = useState(""); - const { filterTabs, setFilterTabIndex, filterTabIndex, activeDiffFilters } = - useDetectionResultFilterTabs({ - initialFilterTabIndex: router.query?.filterTabIndex - ? Number(router.query?.filterTabIndex) - : undefined, - }); + const { + filterTabs, + setFilterTabIndex, + filterTabIndex, + activeDiffFilters, + activeActionTypeIconOverride, + } = useDetectionResultFilterTabs({ + initialFilterTabIndex: router.query?.filterTabIndex + ? Number(router.query?.filterTabIndex) + : undefined, + }); const { PAGE_SIZES, @@ -109,7 +114,10 @@ const DetectionResultTable = ({ resourceUrn }: MonitorResultTableProps) => { const resourceType = findResourceType(resources?.items[0]); - const { columns } = useDetectionResultColumns({ resourceType }); + const { columns } = useDetectionResultColumns({ + resourceType, + iconChangeTypeOverride: activeActionTypeIconOverride, + }); const { items: data, From 42e58b11e404953f47253772adca9f8c76da1a45 Mon Sep 17 00:00:00 2001 From: Lucano Vera Date: Tue, 27 Aug 2024 10:57:48 -0300 Subject: [PATCH 10/23] PROD-2323 Reset table pagination to page 1 after switching data detection filter tabs. --- .../hooks/useDiscoveryResultsFilterTabs.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDiscoveryResultsFilterTabs.tsx b/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDiscoveryResultsFilterTabs.tsx index 53907e318c0..07b6199d2d3 100644 --- a/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDiscoveryResultsFilterTabs.tsx +++ b/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDiscoveryResultsFilterTabs.tsx @@ -14,7 +14,10 @@ const useDiscoveryResultsFilterTabs = ({ const filterTabs = [ { label: "Action Required", - filters: [DiffStatus.ADDITION, DiffStatus.REMOVAL], + filters: [ + DiffStatus.CLASSIFICATION_ADDITION, + DiffStatus.CLASSIFICATION_UPDATE, + ], }, { label: "Classifying", From d523748938e0bc9222c3251b5837e526e18f5038 Mon Sep 17 00:00:00 2001 From: Lucano Vera Date: Tue, 27 Aug 2024 10:58:22 -0300 Subject: [PATCH 11/23] PROD-2323 Reset table pagination to page 1 after switching data detection filter tabs. --- .../tables/DetectionResultTable.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clients/admin-ui/src/features/data-discovery-and-detection/tables/DetectionResultTable.tsx b/clients/admin-ui/src/features/data-discovery-and-detection/tables/DetectionResultTable.tsx index edde45a215d..7d6960d5159 100644 --- a/clients/admin-ui/src/features/data-discovery-and-detection/tables/DetectionResultTable.tsx +++ b/clients/admin-ui/src/features/data-discovery-and-detection/tables/DetectionResultTable.tsx @@ -97,7 +97,7 @@ const DetectionResultTable = ({ resourceUrn }: MonitorResultTableProps) => { useEffect(() => { resetPageIndexToDefault(); - }, [resourceUrn, searchQuery, resetPageIndexToDefault]); + }, [resourceUrn, searchQuery, resetPageIndexToDefault, activeDiffFilters]); const { isFetching, From 53bd47a7d1478afeddb2412ad0a3161ccb251881 Mon Sep 17 00:00:00 2001 From: Lucano Vera Date: Tue, 27 Aug 2024 11:35:54 -0300 Subject: [PATCH 12/23] PROD-2323 Fix discovery results using unmonitored tab --- .../hooks/useDiscoveryResultsFilterTabs.tsx | 15 ++++-- .../tables/DiscoveryResultTable.tsx | 50 ++++++++++++------- 2 files changed, 42 insertions(+), 23 deletions(-) diff --git a/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDiscoveryResultsFilterTabs.tsx b/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDiscoveryResultsFilterTabs.tsx index 07b6199d2d3..8959419891c 100644 --- a/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDiscoveryResultsFilterTabs.tsx +++ b/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDiscoveryResultsFilterTabs.tsx @@ -6,6 +6,11 @@ interface DiscoveryResultsFilterTabsProps { initialFilterTabIndex?: number; } +export enum DiscoveryResultsFilterTabsIndexEnum { + ACTION_REQUIRED = 0, + UNMONITORED = 1, +} + const useDiscoveryResultsFilterTabs = ({ initialFilterTabIndex = 0, }: DiscoveryResultsFilterTabsProps) => { @@ -18,14 +23,15 @@ const useDiscoveryResultsFilterTabs = ({ DiffStatus.CLASSIFICATION_ADDITION, DiffStatus.CLASSIFICATION_UPDATE, ], - }, - { - label: "Classifying", - filters: [DiffStatus.MONITORED], + childFilters: [ + DiffStatus.CLASSIFICATION_ADDITION, + DiffStatus.CLASSIFICATION_UPDATE, + ], }, { label: "Unmonitored", filters: [DiffStatus.MUTED], + childFilters: [], }, ]; @@ -34,6 +40,7 @@ const useDiscoveryResultsFilterTabs = ({ filterTabIndex, setFilterTabIndex, activeDiffFilters: filterTabs[filterTabIndex].filters, + activeChildDiffFilters: filterTabs[filterTabIndex].childFilters, }; }; export default useDiscoveryResultsFilterTabs; diff --git a/clients/admin-ui/src/features/data-discovery-and-detection/tables/DiscoveryResultTable.tsx b/clients/admin-ui/src/features/data-discovery-and-detection/tables/DiscoveryResultTable.tsx index 80fb7520bad..d83cefc0127 100644 --- a/clients/admin-ui/src/features/data-discovery-and-detection/tables/DiscoveryResultTable.tsx +++ b/clients/admin-ui/src/features/data-discovery-and-detection/tables/DiscoveryResultTable.tsx @@ -9,6 +9,7 @@ import { useReactTable, } from "@tanstack/react-table"; import { Box, Flex, Text, VStack } from "fidesui"; +import { useRouter } from "next/router"; import { useEffect, useMemo, useState } from "react"; import { @@ -18,8 +19,12 @@ import { TableSkeletonLoader, useServerSidePagination, } from "~/features/common/table/v2"; +import DetectionResultFilterTabs from "~/features/data-discovery-and-detection/DetectionResultFilterTabs"; import { useGetMonitorResultsQuery } from "~/features/data-discovery-and-detection/discovery-detection.slice"; import useDiscoveryResultColumns from "~/features/data-discovery-and-detection/hooks/useDiscoveryResultColumns"; +import useDiscoveryResultsFilterTabs, { + DiscoveryResultsFilterTabsIndexEnum, +} from "~/features/data-discovery-and-detection/hooks/useDiscoveryResultsFilterTabs"; import useDiscoveryRoutes from "~/features/data-discovery-and-detection/hooks/useDiscoveryRoutes"; import IconLegendTooltip from "~/features/data-discovery-and-detection/IndicatorLegend"; import DiscoveryFieldBulkActions from "~/features/data-discovery-and-detection/tables/DiscoveryFieldBulkActions"; @@ -28,11 +33,7 @@ import { StagedResourceType } from "~/features/data-discovery-and-detection/type import { findResourceType } from "~/features/data-discovery-and-detection/utils/findResourceType"; import getResourceRowName from "~/features/data-discovery-and-detection/utils/getResourceRowName"; import isNestedField from "~/features/data-discovery-and-detection/utils/isNestedField"; -import { - DiffStatus, - StagedResource, - StagedResourceAPIResponse, -} from "~/types/api"; +import { StagedResource, StagedResourceAPIResponse } from "~/types/api"; import { SearchInput } from "../SearchInput"; @@ -69,17 +70,21 @@ interface MonitorResultTableProps { } const DiscoveryResultTable = ({ resourceUrn }: MonitorResultTableProps) => { - const diffStatusFilter: DiffStatus[] = [ - DiffStatus.CLASSIFICATION_ADDITION, - DiffStatus.CLASSIFICATION_UPDATE, - ]; + const router = useRouter(); + const [searchQuery, setSearchQuery] = useState(""); - const childDiffStatusFilter: DiffStatus[] = [ - DiffStatus.CLASSIFICATION_ADDITION, - DiffStatus.CLASSIFICATION_UPDATE, - ]; + const { + filterTabs, + setFilterTabIndex, + filterTabIndex, + activeDiffFilters, + activeChildDiffFilters, + } = useDiscoveryResultsFilterTabs({ + initialFilterTabIndex: router.query?.filterTabIndex + ? Number(router.query?.filterTabIndex) + : undefined, + }); - const [searchQuery, setSearchQuery] = useState(""); const [rowSelection, setRowSelection] = useState({}); const { @@ -109,8 +114,8 @@ const DiscoveryResultTable = ({ resourceUrn }: MonitorResultTableProps) => { staged_resource_urn: resourceUrn, page: pageIndex, size: pageSize, - child_diff_status: childDiffStatusFilter, - diff_status: diffStatusFilter, + child_diff_status: activeChildDiffFilters, + diff_status: activeDiffFilters, search: searchQuery, }); @@ -163,6 +168,11 @@ const DiscoveryResultTable = ({ resourceUrn }: MonitorResultTableProps) => { return ( <> + @@ -173,9 +183,11 @@ const DiscoveryResultTable = ({ resourceUrn }: MonitorResultTableProps) => { {resourceType === StagedResourceType.TABLE && !!selectedUrns.length && ( )} - {resourceType === StagedResourceType.FIELD && ( - - )} + {resourceType === StagedResourceType.FIELD && + filterTabIndex !== + DiscoveryResultsFilterTabsIndexEnum.UNMONITORED && ( + + )} Date: Tue, 27 Aug 2024 11:38:36 -0300 Subject: [PATCH 13/23] PROD-2323 Fix detection results using unmonitored tab --- .../hooks/useDetectionResultsFilterTabs.tsx | 4 ++++ .../tables/DetectionResultTable.tsx | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultsFilterTabs.tsx b/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultsFilterTabs.tsx index 9cd3f3adbe5..430fabdb018 100644 --- a/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultsFilterTabs.tsx +++ b/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultsFilterTabs.tsx @@ -16,15 +16,18 @@ const useDetectionResultsFilterTabs = ({ { label: "Action Required", filters: [DiffStatus.ADDITION, DiffStatus.REMOVAL], + childFilters: [DiffStatus.ADDITION, DiffStatus.REMOVAL], }, { label: "Monitored", filters: [DiffStatus.MONITORED], + childFilters: [], actionTypeIconOverride: ResourceChangeType.MONITORED, }, { label: "Unmonitored", filters: [DiffStatus.MUTED], + childFilters: [], actionTypeIconOverride: ResourceChangeType.MUTED, }, ]; @@ -34,6 +37,7 @@ const useDetectionResultsFilterTabs = ({ filterTabIndex, setFilterTabIndex, activeDiffFilters: filterTabs[filterTabIndex].filters, + activeChildDiffFilters: filterTabs[filterTabIndex].childFilters, activeActionTypeIconOverride: filterTabs[filterTabIndex].actionTypeIconOverride, }; diff --git a/clients/admin-ui/src/features/data-discovery-and-detection/tables/DetectionResultTable.tsx b/clients/admin-ui/src/features/data-discovery-and-detection/tables/DetectionResultTable.tsx index 7d6960d5159..d0ef604f3d1 100644 --- a/clients/admin-ui/src/features/data-discovery-and-detection/tables/DetectionResultTable.tsx +++ b/clients/admin-ui/src/features/data-discovery-and-detection/tables/DetectionResultTable.tsx @@ -73,6 +73,7 @@ const DetectionResultTable = ({ resourceUrn }: MonitorResultTableProps) => { setFilterTabIndex, filterTabIndex, activeDiffFilters, + activeChildDiffFilters, activeActionTypeIconOverride, } = useDetectionResultFilterTabs({ initialFilterTabIndex: router.query?.filterTabIndex @@ -107,7 +108,7 @@ const DetectionResultTable = ({ resourceUrn }: MonitorResultTableProps) => { staged_resource_urn: resourceUrn, page: pageIndex, size: pageSize, - child_diff_status: activeDiffFilters, + child_diff_status: activeChildDiffFilters, diff_status: activeDiffFilters, search: searchQuery, }); From 3d0ec8b92e4c22270dbdda73a3ac61acb3333717 Mon Sep 17 00:00:00 2001 From: Lucano Vera Date: Tue, 27 Aug 2024 16:52:42 -0300 Subject: [PATCH 14/23] PROD-2323 WIP --- .../hooks/useDetectionResultColumns.tsx | 31 ++++++++++++++----- .../hooks/useDetectionResultsFilterTabs.tsx | 7 ++--- .../tables/DetectionResultTable.tsx | 4 +-- 3 files changed, 28 insertions(+), 14 deletions(-) diff --git a/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultColumns.tsx b/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultColumns.tsx index 1a3bee8db5b..e449e1a99e3 100644 --- a/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultColumns.tsx +++ b/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultColumns.tsx @@ -14,10 +14,10 @@ import findProjectFromUrn from "../utils/findProjectFromUrn"; const useDetectionResultColumns = ({ resourceType, - iconChangeTypeOverride, + changeTypeOverride, }: { resourceType?: StagedResourceType; - iconChangeTypeOverride?: ResourceChangeType; + changeTypeOverride?: ResourceChangeType; }) => { const columnHelper = createColumnHelper(); @@ -33,7 +33,7 @@ const useDetectionResultColumns = ({ id: "name", cell: (props) => ( ), @@ -48,7 +48,12 @@ const useDetectionResultColumns = ({ }), columnHelper.display({ id: "status", - cell: (props) => , + cell: (props) => ( + + ), header: (props) => , }), columnHelper.accessor((row) => row.system, { @@ -83,7 +88,7 @@ const useDetectionResultColumns = ({ id: "name", cell: (props) => ( ), @@ -96,7 +101,12 @@ const useDetectionResultColumns = ({ }), columnHelper.display({ id: "status", - cell: (props) => , + cell: (props) => ( + + ), header: (props) => , }), columnHelper.accessor((row) => row.monitor_config_id, { @@ -126,7 +136,7 @@ const useDetectionResultColumns = ({ id: "name", cell: (props) => ( ), @@ -144,7 +154,12 @@ const useDetectionResultColumns = ({ }), columnHelper.display({ id: "status", - cell: (props) => , + cell: (props) => ( + + ), header: (props) => , }), columnHelper.accessor((row) => row.monitor_config_id, { diff --git a/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultsFilterTabs.tsx b/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultsFilterTabs.tsx index 430fabdb018..5dd7f69ba49 100644 --- a/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultsFilterTabs.tsx +++ b/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultsFilterTabs.tsx @@ -22,13 +22,13 @@ const useDetectionResultsFilterTabs = ({ label: "Monitored", filters: [DiffStatus.MONITORED], childFilters: [], - actionTypeIconOverride: ResourceChangeType.MONITORED, + changeTypeOverride: ResourceChangeType.MONITORED, }, { label: "Unmonitored", filters: [DiffStatus.MUTED], childFilters: [], - actionTypeIconOverride: ResourceChangeType.MUTED, + changeTypeOverride: ResourceChangeType.MUTED, }, ]; @@ -38,8 +38,7 @@ const useDetectionResultsFilterTabs = ({ setFilterTabIndex, activeDiffFilters: filterTabs[filterTabIndex].filters, activeChildDiffFilters: filterTabs[filterTabIndex].childFilters, - activeActionTypeIconOverride: - filterTabs[filterTabIndex].actionTypeIconOverride, + activeChangeTypeOverride: filterTabs[filterTabIndex].changeTypeOverride, }; }; export default useDetectionResultsFilterTabs; diff --git a/clients/admin-ui/src/features/data-discovery-and-detection/tables/DetectionResultTable.tsx b/clients/admin-ui/src/features/data-discovery-and-detection/tables/DetectionResultTable.tsx index d0ef604f3d1..31c3bd947e6 100644 --- a/clients/admin-ui/src/features/data-discovery-and-detection/tables/DetectionResultTable.tsx +++ b/clients/admin-ui/src/features/data-discovery-and-detection/tables/DetectionResultTable.tsx @@ -74,7 +74,7 @@ const DetectionResultTable = ({ resourceUrn }: MonitorResultTableProps) => { filterTabIndex, activeDiffFilters, activeChildDiffFilters, - activeActionTypeIconOverride, + activeChangeTypeOverride, } = useDetectionResultFilterTabs({ initialFilterTabIndex: router.query?.filterTabIndex ? Number(router.query?.filterTabIndex) @@ -117,7 +117,7 @@ const DetectionResultTable = ({ resourceUrn }: MonitorResultTableProps) => { const { columns } = useDetectionResultColumns({ resourceType, - iconChangeTypeOverride: activeActionTypeIconOverride, + changeTypeOverride: activeChangeTypeOverride, }); const { From 385954971ae2d053743b39e081df0aeed5fb2698 Mon Sep 17 00:00:00 2001 From: Lucano Vera Date: Wed, 28 Aug 2024 10:02:10 -0300 Subject: [PATCH 15/23] PROD-2323 update paging when filters change --- .../tables/DetectionResultTable.tsx | 8 +++++++- .../tables/DiscoveryResultTable.tsx | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/clients/admin-ui/src/features/data-discovery-and-detection/tables/DetectionResultTable.tsx b/clients/admin-ui/src/features/data-discovery-and-detection/tables/DetectionResultTable.tsx index 31c3bd947e6..5f3f5591bc2 100644 --- a/clients/admin-ui/src/features/data-discovery-and-detection/tables/DetectionResultTable.tsx +++ b/clients/admin-ui/src/features/data-discovery-and-detection/tables/DetectionResultTable.tsx @@ -98,7 +98,13 @@ const DetectionResultTable = ({ resourceUrn }: MonitorResultTableProps) => { useEffect(() => { resetPageIndexToDefault(); - }, [resourceUrn, searchQuery, resetPageIndexToDefault, activeDiffFilters]); + }, [ + resourceUrn, + searchQuery, + resetPageIndexToDefault, + activeDiffFilters, + activeChildDiffFilters, + ]); const { isFetching, diff --git a/clients/admin-ui/src/features/data-discovery-and-detection/tables/DiscoveryResultTable.tsx b/clients/admin-ui/src/features/data-discovery-and-detection/tables/DiscoveryResultTable.tsx index d83cefc0127..76d5f0c4e59 100644 --- a/clients/admin-ui/src/features/data-discovery-and-detection/tables/DiscoveryResultTable.tsx +++ b/clients/admin-ui/src/features/data-discovery-and-detection/tables/DiscoveryResultTable.tsx @@ -104,7 +104,13 @@ const DiscoveryResultTable = ({ resourceUrn }: MonitorResultTableProps) => { useEffect(() => { resetPageIndexToDefault(); - }, [resourceUrn, searchQuery, resetPageIndexToDefault]); + }, [ + resourceUrn, + searchQuery, + resetPageIndexToDefault, + activeDiffFilters, + activeChildDiffFilters, + ]); const { isFetching, From 7e7dc08ce9770480faf71dae3339fe679e91bf98 Mon Sep 17 00:00:00 2001 From: Lucano Vera Date: Wed, 28 Aug 2024 10:08:23 -0300 Subject: [PATCH 16/23] PROD-2323 Fix bug --- clients/admin-ui/src/features/common/DataTabsHeader.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clients/admin-ui/src/features/common/DataTabsHeader.tsx b/clients/admin-ui/src/features/common/DataTabsHeader.tsx index da64be93e55..cebea4a7fbb 100644 --- a/clients/admin-ui/src/features/common/DataTabsHeader.tsx +++ b/clients/admin-ui/src/features/common/DataTabsHeader.tsx @@ -5,7 +5,7 @@ import { FidesTab, TabData, TabListBorder } from "~/features/common/DataTabs"; interface DataTabsHeaderProps { data: Pick[]; border?: TabListBorder; - borderWidth?: TabsProps["borderSize"]; + borderWidth?: TabsProps["borderWidth"]; } const DataTabsHeader = ({ From 6cb0091ac45d922da51c8ea128728316cbcbc12b Mon Sep 17 00:00:00 2001 From: Lucano Vera Date: Wed, 28 Aug 2024 10:30:24 -0300 Subject: [PATCH 17/23] PROD-2323 Don't show confirm button in Monitored/Unmonitored view --- .../hooks/useDetectionResultColumns.tsx | 10 +++++++++- .../tables/cells/DetectionItemActionsCell.tsx | 14 +++++++++++--- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultColumns.tsx b/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultColumns.tsx index e449e1a99e3..0f640a6188e 100644 --- a/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultColumns.tsx +++ b/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultColumns.tsx @@ -74,7 +74,15 @@ const useDetectionResultColumns = ({ columnHelper.display({ id: "actions", cell: (props) => ( - + ), header: "Actions", }), diff --git a/clients/admin-ui/src/features/data-discovery-and-detection/tables/cells/DetectionItemActionsCell.tsx b/clients/admin-ui/src/features/data-discovery-and-detection/tables/cells/DetectionItemActionsCell.tsx index 2f3841b266c..a64120663b3 100644 --- a/clients/admin-ui/src/features/data-discovery-and-detection/tables/cells/DetectionItemActionsCell.tsx +++ b/clients/admin-ui/src/features/data-discovery-and-detection/tables/cells/DetectionItemActionsCell.tsx @@ -16,9 +16,13 @@ import { findResourceType } from "../../utils/findResourceType"; interface DetectionItemActionProps { resource: StagedResource; + ignoreChildActions?: boolean; } -const DetectionItemActionsCell = ({ resource }: DetectionItemActionProps) => { +const DetectionItemActionsCell = ({ + resource, + ignoreChildActions = false, +}: DetectionItemActionProps) => { const resourceType = findResourceType(resource); const [confirmResourceMutation, { isLoading: confirmIsLoading }] = useConfirmResourceMutation(); @@ -44,11 +48,15 @@ const DetectionItemActionsCell = ({ resource }: DetectionItemActionProps) => { (!isFieldType && diffStatus === DiffStatus.ADDITION); const showMuteAction = diffStatus !== DiffStatus.MUTED; const showUnmuteAction = diffStatus === DiffStatus.MUTED; - const showConfirmAction = - diffStatus === DiffStatus.MONITORED && + + const childDiffHasChanges = childDiffStatus && (childDiffStatus[DiffStatus.ADDITION] || childDiffStatus[DiffStatus.REMOVAL]); + const showConfirmAction = + diffStatus === DiffStatus.MONITORED && + !ignoreChildActions && + childDiffHasChanges; return ( e.stopPropagation()}> From 82e1329f985d521b12f76e9d44a8d50a14406c12 Mon Sep 17 00:00:00 2001 From: Lucano Vera Date: Wed, 28 Aug 2024 10:49:01 -0300 Subject: [PATCH 18/23] PROD-2323 Update tests --- .../cypress/e2e/discovery-detection.cy.ts | 67 ++++++---- .../detection/table-list-full-schema.json | 120 ------------------ .../table-list-monitored-tab-filter.json | 35 +++++ .../table-list-unmonitored-tab-filter.json | 35 +++++ 4 files changed, 114 insertions(+), 143 deletions(-) delete mode 100644 clients/admin-ui/cypress/fixtures/detection-discovery/results/detection/table-list-full-schema.json create mode 100644 clients/admin-ui/cypress/fixtures/detection-discovery/results/detection/table-list-monitored-tab-filter.json create mode 100644 clients/admin-ui/cypress/fixtures/detection-discovery/results/detection/table-list-unmonitored-tab-filter.json diff --git a/clients/admin-ui/cypress/e2e/discovery-detection.cy.ts b/clients/admin-ui/cypress/e2e/discovery-detection.cy.ts index a155d21344a..f62e79f0070 100644 --- a/clients/admin-ui/cypress/e2e/discovery-detection.cy.ts +++ b/clients/admin-ui/cypress/e2e/discovery-detection.cy.ts @@ -165,12 +165,20 @@ describe("discovery and detection", () => { }).as("getFilteredDetectionTables"); cy.intercept( "GET", - "/api/v1/plus/discovery-monitor/results?*diff_status=monitored&diff_status=muted*", + "/api/v1/plus/discovery-monitor/results?diff_status=monitored*", { fixture: - "detection-discovery/results/detection/table-list-full-schema.json", + "detection-discovery/results/detection/table-list-monitored-tab-filter.json", }, - ).as("getAllDetectionTables"); + ).as("getAllMonitoredTables"); + cy.intercept( + "GET", + "/api/v1/plus/discovery-monitor/results?diff_status=muted*", + { + fixture: + "detection-discovery/results/detection/table-list-unmonitored-tab-filter.json", + }, + ).as("getAllMutedTables"); cy.visit( `${DATA_DETECTION_ROUTE}/my_bigquery_monitor.prj-bigquery-418515.test_dataset_1`, ); @@ -181,12 +189,12 @@ describe("discovery and detection", () => { cy.getByTestId("row-my_bigquery_monitor-consent-reports-20").should( "exist", ); + cy.getByTestId("row-my_bigquery_monitor-consent-reports-19").should( + "exist", + ); cy.getByTestId("row-my_bigquery_monitor-consent-reports-21").should( "not.exist", ); - cy.getByTestId("full-schema-toggle").within(() => { - cy.get("span").should("not.have.attr", "data-checked"); - }); }); it("should navigate to field view on row click", () => { @@ -198,30 +206,24 @@ describe("discovery and detection", () => { ); }); - describe("full schema view", () => { - it("should be able to toggle showing full schema", () => { - cy.getByTestId("full-schema-toggle").click(); - cy.wait("@getAllDetectionTables"); - cy.getByTestId( - "row-my_bigquery_monitor-consent-reports-21-col-status", - ).should("contain", "Unmonitored"); + describe("Tab filter views", () => { + it("should be able to switch to monitored tab", () => { + cy.getByTestId("tab-Monitored").click(); + cy.wait("@getAllMonitoredTables"); + cy.getByTestId( "row-my_bigquery_monitor-consent-reports-22-col-status", ).should("contain", "Monitoring"); - }); - - it("should allow muted tables to be unmuted", () => { - cy.getByTestId("full-schema-toggle").click(); cy.getByTestId( - "row-my_bigquery_monitor-consent-reports-21-col-actions", - ).within(() => { - cy.getByTestId("action-Monitor").click(); - cy.wait("@unmuteResource"); - }); + "row-my_bigquery_monitor-consent-reports-19-col-status", + ).should("contain", "Monitoring"); + cy.getByTestId( + "row-my_bigquery_monitor-consent-reports-20-col-status", + ).should("contain", "Monitoring"); }); it("should allow monitored tables to be muted", () => { - cy.getByTestId("full-schema-toggle").click(); + cy.getByTestId("tab-Monitored").click(); cy.getByTestId( "row-my_bigquery_monitor-consent-reports-22-col-actions", ).within(() => { @@ -229,6 +231,25 @@ describe("discovery and detection", () => { cy.wait("@ignoreResource"); }); }); + + it("should be able to switch to unmonitored tab", () => { + cy.getByTestId("tab-Unmonitored").click(); + cy.wait("@getAllMutedTables"); + + cy.getByTestId( + "row-my_bigquery_monitor-consent-reports-21-col-status", + ).should("contain", "Unmonitored"); + }); + + it("should allow muted tables to be unmuted", () => { + cy.getByTestId("tab-Unmonitored").click(); + cy.getByTestId( + "row-my_bigquery_monitor-consent-reports-21-col-actions", + ).within(() => { + cy.getByTestId("action-Monitor").click(); + cy.wait("@unmuteResource"); + }); + }); }); }); diff --git a/clients/admin-ui/cypress/fixtures/detection-discovery/results/detection/table-list-full-schema.json b/clients/admin-ui/cypress/fixtures/detection-discovery/results/detection/table-list-full-schema.json deleted file mode 100644 index d8bd5ada4b6..00000000000 --- a/clients/admin-ui/cypress/fixtures/detection-discovery/results/detection/table-list-full-schema.json +++ /dev/null @@ -1,120 +0,0 @@ -{ - "items": [ - { - "urn": "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20", - "user_assigned_data_categories": [], - "name": "consent-reports-20", - "description": null, - "monitor_config_id": "my_bigquery_monitor", - "updated_at": null, - "source_modified": "2024-03-27T21:47:09.915000+00:00", - "classifications": [], - "diff_status": "addition", - "child_diff_statuses": { - "addition": 9 - }, - "parent_schema": "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1", - "schema_name": "test_dataset_1", - "num_rows": 19, - "fields": [ - "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.Created", - "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.Fides_user_device", - "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.User_geography", - "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.Preference", - "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.Notice_title", - "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.Phone_number", - "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.Request_origin", - "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.Method", - "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.Email" - ], - "database_name": "prj-bigquery-418515" - }, - { - "urn": "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20", - "user_assigned_data_categories": [], - "name": "consent-reports-21", - "description": null, - "monitor_config_id": "my_bigquery_monitor", - "updated_at": null, - "source_modified": "2024-03-27T21:47:09.915000+00:00", - "classifications": [], - "diff_status": "muted", - "child_diff_statuses": {}, - "parent_schema": "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1", - "schema_name": "test_dataset_1", - "num_rows": 19, - "fields": [ - "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.Created", - "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.Fides_user_device", - "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.User_geography", - "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.Preference", - "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.Notice_title", - "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.Phone_number", - "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.Request_origin", - "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.Method", - "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.Email" - ], - "database_name": "prj-bigquery-418515" - }, - { - "urn": "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20", - "user_assigned_data_categories": [], - "name": "consent-reports-22", - "description": null, - "monitor_config_id": "my_bigquery_monitor", - "updated_at": null, - "source_modified": "2024-03-27T21:47:09.915000+00:00", - "classifications": [], - "diff_status": "monitored", - "child_diff_statuses": {}, - "parent_schema": "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1", - "schema_name": "test_dataset_1", - "num_rows": 19, - "fields": [ - "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.Created", - "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.Fides_user_device", - "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.User_geography", - "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.Preference", - "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.Notice_title", - "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.Phone_number", - "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.Request_origin", - "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.Method", - "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.Email" - ], - "database_name": "prj-bigquery-418515" - }, - { - "urn": "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-19", - "user_assigned_data_categories": [], - "name": "consent-reports-19", - "description": null, - "monitor_config_id": "my_bigquery_monitor", - "updated_at": null, - "source_modified": "2024-04-24T19:12:22.287000+00:00", - "classifications": [], - "diff_status": "addition", - "child_diff_statuses": { - "addition": 9 - }, - "parent_schema": "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1", - "schema_name": "test_dataset_1", - "num_rows": 13, - "fields": [ - "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-19.User_geography", - "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-19.Phone_number", - "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-19.Request_origin", - "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-19.Notice_title", - "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-19.Preference", - "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-19.Method", - "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-19.Email", - "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-19.Created", - "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-19.Fides_user_device" - ], - "database_name": "prj-bigquery-418515" - } - ], - "total": 2, - "page": 1, - "size": 25, - "pages": 1 -} diff --git a/clients/admin-ui/cypress/fixtures/detection-discovery/results/detection/table-list-monitored-tab-filter.json b/clients/admin-ui/cypress/fixtures/detection-discovery/results/detection/table-list-monitored-tab-filter.json new file mode 100644 index 00000000000..2dbfdd0ee8d --- /dev/null +++ b/clients/admin-ui/cypress/fixtures/detection-discovery/results/detection/table-list-monitored-tab-filter.json @@ -0,0 +1,35 @@ +{ + "items": [ + { + "urn": "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20", + "user_assigned_data_categories": [], + "name": "consent-reports-22", + "description": null, + "monitor_config_id": "my_bigquery_monitor", + "updated_at": null, + "source_modified": "2024-03-27T21:47:09.915000+00:00", + "classifications": [], + "diff_status": "monitored", + "child_diff_statuses": {}, + "parent_schema": "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1", + "schema_name": "test_dataset_1", + "num_rows": 19, + "fields": [ + "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.Created", + "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.Fides_user_device", + "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.User_geography", + "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.Preference", + "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.Notice_title", + "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.Phone_number", + "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.Request_origin", + "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.Method", + "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.Email" + ], + "database_name": "prj-bigquery-418515" + } + ], + "total": 2, + "page": 1, + "size": 25, + "pages": 1 +} diff --git a/clients/admin-ui/cypress/fixtures/detection-discovery/results/detection/table-list-unmonitored-tab-filter.json b/clients/admin-ui/cypress/fixtures/detection-discovery/results/detection/table-list-unmonitored-tab-filter.json new file mode 100644 index 00000000000..33d071646de --- /dev/null +++ b/clients/admin-ui/cypress/fixtures/detection-discovery/results/detection/table-list-unmonitored-tab-filter.json @@ -0,0 +1,35 @@ +{ + "items": [ + { + "urn": "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20", + "user_assigned_data_categories": [], + "name": "consent-reports-21", + "description": null, + "monitor_config_id": "my_bigquery_monitor", + "updated_at": null, + "source_modified": "2024-03-27T21:47:09.915000+00:00", + "classifications": [], + "diff_status": "muted", + "child_diff_statuses": {}, + "parent_schema": "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1", + "schema_name": "test_dataset_1", + "num_rows": 19, + "fields": [ + "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.Created", + "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.Fides_user_device", + "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.User_geography", + "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.Preference", + "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.Notice_title", + "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.Phone_number", + "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.Request_origin", + "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.Method", + "my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.Email" + ], + "database_name": "prj-bigquery-418515" + } + ], + "total": 1, + "page": 1, + "size": 25, + "pages": 1 +} From 7690924ee555dce6826c190ea4e1f5cd6f966952 Mon Sep 17 00:00:00 2001 From: Lucano Vera Date: Wed, 28 Aug 2024 10:53:32 -0300 Subject: [PATCH 19/23] PROD-2323 Remove confusing eye icons for monitor/unmonitor --- .../tables/cells/DetectionItemActionsCell.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/clients/admin-ui/src/features/data-discovery-and-detection/tables/cells/DetectionItemActionsCell.tsx b/clients/admin-ui/src/features/data-discovery-and-detection/tables/cells/DetectionItemActionsCell.tsx index a64120663b3..e8dd2108972 100644 --- a/clients/admin-ui/src/features/data-discovery-and-detection/tables/cells/DetectionItemActionsCell.tsx +++ b/clients/admin-ui/src/features/data-discovery-and-detection/tables/cells/DetectionItemActionsCell.tsx @@ -1,4 +1,4 @@ -import { CheckIcon, HStack, ViewIcon, ViewOffIcon } from "fidesui"; +import { CheckIcon, HStack } from "fidesui"; import { useAlert } from "~/features/common/hooks"; import { DiffStatus, StagedResource } from "~/types/api"; @@ -81,7 +81,7 @@ const DetectionItemActionsCell = ({ {showUnmuteAction && ( : } + icon={} onClick={async () => { await unmuteResourceMutation({ staged_resource_urn: resource.urn, @@ -117,7 +117,7 @@ const DetectionItemActionsCell = ({ {showMuteAction && ( : } + icon={} onClick={async () => { await muteResourceMutation({ staged_resource_urn: resource.urn, From 15a629d5bd2cc282639fb44365eb6a659c8a7b6a Mon Sep 17 00:00:00 2001 From: Lucano Vera Date: Wed, 28 Aug 2024 11:12:31 -0300 Subject: [PATCH 20/23] PROD-2323 Update test --- clients/admin-ui/cypress/e2e/discovery-detection.cy.ts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/clients/admin-ui/cypress/e2e/discovery-detection.cy.ts b/clients/admin-ui/cypress/e2e/discovery-detection.cy.ts index f62e79f0070..1125ada1363 100644 --- a/clients/admin-ui/cypress/e2e/discovery-detection.cy.ts +++ b/clients/admin-ui/cypress/e2e/discovery-detection.cy.ts @@ -214,12 +214,6 @@ describe("discovery and detection", () => { cy.getByTestId( "row-my_bigquery_monitor-consent-reports-22-col-status", ).should("contain", "Monitoring"); - cy.getByTestId( - "row-my_bigquery_monitor-consent-reports-19-col-status", - ).should("contain", "Monitoring"); - cy.getByTestId( - "row-my_bigquery_monitor-consent-reports-20-col-status", - ).should("contain", "Monitoring"); }); it("should allow monitored tables to be muted", () => { From 99d8de1397e04f124572263958c1288de70cb1cf Mon Sep 17 00:00:00 2001 From: Lucano Vera Date: Wed, 28 Aug 2024 11:14:51 -0300 Subject: [PATCH 21/23] PROD-2323 Update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1945ae355dc..fa7073b035b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,9 @@ The types of changes are: ### Added - Added Gzip Middleware for responses [#5225](https://github.com/ethyca/fides/pull/5225) - Adding source and submitted_by fields to privacy requests (Fidesplus) [#5206](https://github.com/ethyca/fides/pull/5206) +- Added Action Required / Monitored / Unmonitored tabs to Data Detection page [#5236](https://github.com/ethyca/fides/pull/5236) +- Added Action Required / Unmonitored tabs to Data Discovery page [#5236](https://github.com/ethyca/fides/pull/5236) + ### Changed - Removed unused `username` parameter from the Delighted integration configuration [#5220](https://github.com/ethyca/fides/pull/5220) From e04d548611131c5132f464800a10d70ed269240c Mon Sep 17 00:00:00 2001 From: Lucano Vera Date: Wed, 28 Aug 2024 12:53:17 -0300 Subject: [PATCH 22/23] PROD-2323 Add size width of 180 to actions column to prevent buttons from getting too small --- .../hooks/useDetectionResultColumns.tsx | 1 + .../hooks/useDiscoveryResultColumns.tsx | 1 + 2 files changed, 2 insertions(+) diff --git a/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultColumns.tsx b/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultColumns.tsx index 0f640a6188e..0205071f0b7 100644 --- a/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultColumns.tsx +++ b/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDetectionResultColumns.tsx @@ -85,6 +85,7 @@ const useDetectionResultColumns = ({ /> ), header: "Actions", + size: 180, }), ]; return { columns }; diff --git a/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDiscoveryResultColumns.tsx b/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDiscoveryResultColumns.tsx index 7be2426bf3a..15b6debd4d5 100644 --- a/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDiscoveryResultColumns.tsx +++ b/clients/admin-ui/src/features/data-discovery-and-detection/hooks/useDiscoveryResultColumns.tsx @@ -74,6 +74,7 @@ const useDiscoveryResultColumns = ({ ), header: "Actions", + size: 180, }), ]; return { columns }; From 1c7e59dfb80376319e118db0ba9db0a31050696b Mon Sep 17 00:00:00 2001 From: Lucano Vera Date: Wed, 28 Aug 2024 14:20:15 -0300 Subject: [PATCH 23/23] PROD-2323 Update changelog --- CHANGELOG.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa7073b035b..5db2a2dbdfc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,8 +20,7 @@ The types of changes are: ### Added - Added Gzip Middleware for responses [#5225](https://github.com/ethyca/fides/pull/5225) - Adding source and submitted_by fields to privacy requests (Fidesplus) [#5206](https://github.com/ethyca/fides/pull/5206) -- Added Action Required / Monitored / Unmonitored tabs to Data Detection page [#5236](https://github.com/ethyca/fides/pull/5236) -- Added Action Required / Unmonitored tabs to Data Discovery page [#5236](https://github.com/ethyca/fides/pull/5236) +- Added Action Required / Monitored / Unmonitored tabs to Data Detection & Discovery page [#5236](https://github.com/ethyca/fides/pull/5236) ### Changed