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

PROD-2504 FE When-column-should-never-be-blank-or-have-N-A-in-Activity-table #5177

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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ The types of changes are:
- Fixes a Marigold Sailthru error when a user does not exist [#5145](https://github.com/ethyca/fides/pull/5145)
- Fixed malformed HTML issue on switch components [#5166](https://github.com/ethyca/fides/pull/5166)
- Fixed a timing issue with tcf/gpp locator iframe naming [#5173](https://github.com/ethyca/fides/pull/5173)
- Detection & Discovery: The when column will now display the correct value with a tooltip showing the full date and time [#5177](https://github.com/ethyca/fides/pull/5177)


## [2.42.1](https://github.com/ethyca/fides/compare/2.42.0...2.42.1)

Expand Down
21 changes: 19 additions & 2 deletions clients/admin-ui/src/features/common/table/v2/cells.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
SwitchProps,
Text,
TextProps,
Tooltip,
useDisclosure,
useToast,
WarningIcon,
Expand All @@ -20,7 +21,7 @@ import { ChangeEvent, ReactNode } from "react";
import { getErrorMessage, isErrorResult } from "~/features/common/helpers";
import ConfirmationModal from "~/features/common/modals/ConfirmationModal";
import { errorToastParams } from "~/features/common/toast";
import { sentenceCase } from "~/features/common/utils";
import { formatDate, sentenceCase } from "~/features/common/utils";
import { RTKResult } from "~/types/errors";

export const DefaultCell = ({
Expand Down Expand Up @@ -69,7 +70,23 @@ export const RelativeTimestampCell = ({
addSuffix: true,
});

return <DefaultCell value={sentenceCase(timestamp)} />;
const formattedDate = formatDate(new Date(time));

return (
<Flex alignItems="center" height="100%">
<Tooltip label={formattedDate} hasArrow>
<Text
fontSize="xs"
lineHeight={4}
fontWeight="normal"
overflow="hidden"
textOverflow="ellipsis"
>
{sentenceCase(timestamp)}
</Text>
</Tooltip>
</Flex>
);
};

export const BadgeCellContainer = ({ children }: { children: ReactNode }) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const useDetectionResultColumns = ({
cell: (props) => <DefaultCell value={props.getValue()} />,
header: (props) => <DefaultHeaderCell value="Detected by" {...props} />,
}),
columnHelper.accessor((row) => row.source_modified, {
columnHelper.accessor((row) => row.updated_at, {
id: "time",
cell: (props) => <RelativeTimestampCell time={props.getValue()} />,
header: (props) => <DefaultHeaderCell value="When" {...props} />,
Expand Down Expand Up @@ -83,7 +83,7 @@ const useDetectionResultColumns = ({
cell: (props) => <DefaultCell value={props.getValue()} />,
header: (props) => <DefaultHeaderCell value="Detected by" {...props} />,
}),
columnHelper.accessor((row) => row.source_modified, {
columnHelper.accessor((row) => row.updated_at, {
id: "time",
cell: (props) => <RelativeTimestampCell time={props.getValue()} />,
header: (props) => <DefaultHeaderCell value="When" {...props} />,
Expand Down Expand Up @@ -114,7 +114,7 @@ const useDetectionResultColumns = ({
cell: (props) => <DefaultCell value={props.getValue()} />,
header: (props) => <DefaultHeaderCell value="Detected by" {...props} />,
}),
columnHelper.accessor((row) => row.source_modified, {
columnHelper.accessor((row) => row.updated_at, {
id: "time",
cell: (props) => <RelativeTimestampCell time={props.getValue()} />,
header: (props) => <DefaultHeaderCell value="When" {...props} />,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const useDiscoveryResultColumns = ({
cell: (props) => <DefaultCell value={props.getValue()} />,
header: (props) => <DefaultHeaderCell value="Detected by" {...props} />,
}),
columnHelper.accessor((row) => row.source_modified, {
columnHelper.accessor((row) => row.updated_at, {
id: "time",
cell: (props) => <RelativeTimestampCell time={props.getValue()} />,
header: (props) => <DefaultHeaderCell value="When" {...props} />,
Expand Down Expand Up @@ -115,7 +115,7 @@ const useDiscoveryResultColumns = ({
cell: () => <DefaultCell value="Table" />,
header: "Type",
}),
columnHelper.accessor((row) => row.source_modified, {
columnHelper.accessor((row) => row.updated_at, {
id: "time",
cell: (props) => <RelativeTimestampCell time={props.getValue()} />,
header: "Time",
Expand Down Expand Up @@ -155,7 +155,7 @@ const useDiscoveryResultColumns = ({
header: "Data category",
minSize: 280, // keep a minimum width so the Select has space to display the options properly
}),
columnHelper.accessor((row) => row.source_modified, {
columnHelper.accessor((row) => row.updated_at, {
id: "time",
cell: (props) => <RelativeTimestampCell time={props.getValue()} />,
header: (props) => <DefaultHeaderCell value="When" {...props} />,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ const ActivityTable = ({
cell: (props) => <DefaultCell value={props.getValue()} />,
header: (props) => <DefaultHeaderCell value="Detected by" {...props} />,
}),
columnHelper.accessor((row) => row.source_modified, {
columnHelper.accessor((row) => row.updated_at, {
id: "time",
cell: (props) => <RelativeTimestampCell time={props.getValue()} />,
header: (props) => <DefaultHeaderCell value="When" {...props} />,
Expand Down
Loading