Skip to content

Commit

Permalink
fix(inventory-changes-timeline): remove mock data
Browse files Browse the repository at this point in the history
  • Loading branch information
sijav committed Aug 7, 2024
1 parent 0b16d1f commit f63f198
Showing 1 changed file with 2 additions and 139 deletions.
141 changes: 2 additions & 139 deletions src/pages/panel/inventory-search/InventoryChangesTimeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { useUserProfile } from 'src/core/auth'
import { useThemeMode } from 'src/core/theme'
import { useFixQueryParser } from 'src/shared/fix-query-parser'
import { LoadingSuspenseFallback } from 'src/shared/loading'
import { PostWorkspaceInventoryHistoryTimelineResponse, WorkspaceInventoryNodeHistoryChanges } from 'src/shared/types/server'
import { WorkspaceInventoryNodeHistoryChanges } from 'src/shared/types/server'
import { getNumberFormatter } from 'src/shared/utils/getNumberFormatter'
import { postWorkspaceInventoryHistoryTimelineQuery } from './postWorkspaceInventoryHistoryTimeline.query'
import { inventoryRenderNodeChangeCellToString } from './utils/inventoryRenderNodeChangeCell'
Expand All @@ -32,142 +32,6 @@ const getColorFromHistoryChange = (change: WorkspaceInventoryNodeHistoryChanges,
}
}

const fakeData = [
{
at: '2024-05-22T18:14:24.000Z',
group: {
change: 'node_updated',
},
v: 1,
},
{
at: '2024-05-23T17:16:48.000Z',
group: {
change: 'node_created',
},
v: 6,
},
{
at: '2024-05-23T17:16:48.000Z',
group: {
change: 'node_deleted',
},
v: 6,
},
{
at: '2024-05-23T17:16:48.000Z',
group: {
change: 'node_vulnerable',
},
v: 2,
},
{
at: '2024-05-23T17:16:48.000Z',
group: {
change: 'node_compliant',
},
v: 2,
},
{
at: '2024-05-23T17:16:48.000Z',
group: {
change: 'node_updated',
},
v: 6,
},
{
at: '2024-05-24T04:48:00.000Z',
group: {
change: 'node_created',
},
v: 24,
},
{
at: '2024-05-24T04:48:00.000Z',
group: {
change: 'node_deleted',
},
v: 18,
},
{
at: '2024-05-24T16:19:12.000Z',
group: {
change: 'node_updated',
},
v: 1,
},
{
at: '2024-05-28T00:57:36.000Z',
group: {
change: 'node_created',
},
v: 2,
},
{
at: '2024-05-28T00:57:36.000Z',
group: {
change: 'node_updated',
},
v: 5,
},
{
at: '2024-05-29T11:31:12.000Z',
group: {
change: 'node_updated',
},
v: 4524,
},
{
at: '2024-05-29T11:31:12.000Z',
group: {
change: 'node_created',
},
v: 4859,
},
{
at: '2024-05-30T10:33:36.000Z',
group: {
change: 'node_updated',
},
v: 230,
},
{
at: '2024-05-31T09:36:00.000Z',
group: {
change: 'node_updated',
},
v: 11,
},
{
at: '2024-05-31T21:07:12.000Z',
group: {
change: 'node_updated',
},
v: 1,
},
{
at: '2024-06-01T20:09:36.000Z',
group: {
change: 'node_updated',
},
v: 73,
},
{
at: '2024-06-02T07:40:48.000Z',
group: {
change: 'node_updated',
},
v: 150,
},
{
at: '2024-06-02T19:12:00.000Z',
group: {
change: 'node_updated',
},
v: 21,
},
] as PostWorkspaceInventoryHistoryTimelineResponse

export const InventoryChangesTimeline = ({ searchCrit }: InventoryChangesTimelineProps) => {
const {
history: { changes, after, before },
Expand All @@ -180,7 +44,7 @@ export const InventoryChangesTimeline = ({ searchCrit }: InventoryChangesTimelin
const {
i18n: { locale },
} = useLingui()
const { isLoading } = useQuery({
const { data, isLoading } = useQuery({
queryKey: [
'workspace-inventory-history-timeline',
selectedWorkspace?.id,
Expand All @@ -192,7 +56,6 @@ export const InventoryChangesTimeline = ({ searchCrit }: InventoryChangesTimelin
],
queryFn: postWorkspaceInventoryHistoryTimelineQuery,
})
const data = fakeData
const { series, labels } = useMemo(() => {
if (data) {
const numberFormatter = getNumberFormatter(locale)
Expand Down

0 comments on commit f63f198

Please sign in to comment.