From 579c7cbed746b2dc9568806486ba1450bb90caac Mon Sep 17 00:00:00 2001 From: amlannandy Date: Mon, 6 Jan 2025 23:18:09 +0530 Subject: [PATCH] chore: address comments --- .../components/HostMetricsDetail/constants.ts | 2 + .../InfraMonitoring.styles.scss | 2 +- .../InfraMonitoringK8s.styles.scss | 8 +- .../InfraMonitoringK8s/InfraMonitoringK8s.tsx | 3 - .../InfraMonitoringK8s/Nodes/K8sNodesList.tsx | 2 + .../NodeDetails/Events/NodeEvents.styles.scss | 2 +- .../Nodes/NodeDetails/NodeDetails.tsx | 3 +- .../Nodes/NodeDetails/Traces/NodeTraces.tsx | 2 +- .../Nodes/NodeDetails/Traces/utils.tsx | 84 ------------------- .../Nodes/NodeDetails/constants.ts | 14 ---- .../InfraMonitoringK8s/Nodes/utils.tsx | 3 +- .../InfraMonitoringK8s/Pods/K8sPodLists.tsx | 12 +-- .../Pods/PodDetails/Events/Events.styles.scss | 2 +- .../Pods/PodDetails/PodDetails.tsx | 3 +- .../Pods/PodDetails/PodTraces/PodTraces.tsx | 2 +- .../Pods/PodDetails/PodTraces/utils.tsx | 84 ------------------- .../Pods/PodDetails/constants.ts | 14 ---- .../InfraMonitoringK8s/Volumes/Volumes.tsx | 3 - .../container/InfraMonitoringK8s/utils.tsx | 3 +- .../ListOfDashboard/DashboardList.styles.scss | 2 +- .../queryBuilder/queryAutocompleteResponse.ts | 2 +- .../api/queryBuilder/queryBuilderData.ts | 2 +- frontend/src/utils/localStorageReadWrite.ts | 17 ---- 23 files changed, 30 insertions(+), 241 deletions(-) delete mode 100644 frontend/src/container/InfraMonitoringK8s/Nodes/NodeDetails/Traces/utils.tsx delete mode 100644 frontend/src/container/InfraMonitoringK8s/Pods/PodDetails/PodTraces/utils.tsx delete mode 100644 frontend/src/container/InfraMonitoringK8s/Volumes/Volumes.tsx delete mode 100644 frontend/src/utils/localStorageReadWrite.ts diff --git a/frontend/src/components/HostMetricsDetail/constants.ts b/frontend/src/components/HostMetricsDetail/constants.ts index 490ecbb4d3..e024fe5b55 100644 --- a/frontend/src/components/HostMetricsDetail/constants.ts +++ b/frontend/src/components/HostMetricsDetail/constants.ts @@ -4,6 +4,7 @@ export enum VIEWS { TRACES = 'traces', CONTAINERS = 'containers', PROCESSES = 'processes', + EVENTS = 'events', } export const VIEW_TYPES = { @@ -12,4 +13,5 @@ export const VIEW_TYPES = { TRACES: VIEWS.TRACES, CONTAINERS: VIEWS.CONTAINERS, PROCESSES: VIEWS.PROCESSES, + EVENTS: VIEWS.EVENTS, }; diff --git a/frontend/src/container/InfraMonitoringHosts/InfraMonitoring.styles.scss b/frontend/src/container/InfraMonitoringHosts/InfraMonitoring.styles.scss index 78c6409e5e..8066481a4f 100644 --- a/frontend/src/container/InfraMonitoringHosts/InfraMonitoring.styles.scss +++ b/frontend/src/container/InfraMonitoringHosts/InfraMonitoring.styles.scss @@ -93,7 +93,7 @@ } .hostname-column-value { - color: var(--Vanilla-100, #fff); + color: var(--bg-vanilla-100); font-family: 'Geist Mono'; font-style: normal; font-weight: 600; diff --git a/frontend/src/container/InfraMonitoringK8s/InfraMonitoringK8s.styles.scss b/frontend/src/container/InfraMonitoringK8s/InfraMonitoringK8s.styles.scss index f2f0334e7f..26867ba094 100644 --- a/frontend/src/container/InfraMonitoringK8s/InfraMonitoringK8s.styles.scss +++ b/frontend/src/container/InfraMonitoringK8s/InfraMonitoringK8s.styles.scss @@ -272,7 +272,7 @@ .group-by-label { min-width: max-content; - color: var(--Vanilla-400, #c0c1c3); + color: var(--bg-vanilla-100, #c0c1c3); font-size: 13px; font-style: normal; font-weight: 400; @@ -280,9 +280,9 @@ letter-spacing: -0.07px; border-radius: 2px 0px 0px 2px; - border: 1px solid var(--Slate-400, #1d212d); + border: 1px solid var(--bg-slate-400, #1d212d); border-right: none; - background: var(--Ink-300, #16181d); + background: var(--bg-ink-100, #16181d); border-top-right-radius: 0px; border-bottom-right-radius: 0px; @@ -387,7 +387,7 @@ } .hostname-column-value { - color: var(--Vanilla-100, #fff); + color: var(--bg-vanilla-100); font-family: 'Geist Mono'; font-style: normal; font-weight: 600; diff --git a/frontend/src/container/InfraMonitoringK8s/InfraMonitoringK8s.tsx b/frontend/src/container/InfraMonitoringK8s/InfraMonitoringK8s.tsx index d639b327f5..f152182ca8 100644 --- a/frontend/src/container/InfraMonitoringK8s/InfraMonitoringK8s.tsx +++ b/frontend/src/container/InfraMonitoringK8s/InfraMonitoringK8s.tsx @@ -19,7 +19,6 @@ import { } from './constants'; import K8sNodesList from './Nodes/K8sNodesList'; import K8sPodLists from './Pods/K8sPodLists'; -import Volumes from './Volumes/Volumes'; export default function InfraMonitoringK8s(): JSX.Element { const [showFilters, setShowFilters] = useState(true); @@ -312,8 +311,6 @@ export default function InfraMonitoringK8s(): JSX.Element { handleFilterVisibilityChange={handleFilterVisibilityChange} /> )} - - {selectedCategory === K8sCategories.VOLUMES && } diff --git a/frontend/src/container/InfraMonitoringK8s/Nodes/K8sNodesList.tsx b/frontend/src/container/InfraMonitoringK8s/Nodes/K8sNodesList.tsx index c8db90deb2..ed9bfab2f1 100644 --- a/frontend/src/container/InfraMonitoringK8s/Nodes/K8sNodesList.tsx +++ b/frontend/src/container/InfraMonitoringK8s/Nodes/K8sNodesList.tsx @@ -93,9 +93,11 @@ function K8sNodesList({ baseFilters.items.push({ key: { key: key.key, + type: null, }, op: '=', value: groupedByMeta[key.key], + id: key.key, }); } diff --git a/frontend/src/container/InfraMonitoringK8s/Nodes/NodeDetails/Events/NodeEvents.styles.scss b/frontend/src/container/InfraMonitoringK8s/Nodes/NodeDetails/Events/NodeEvents.styles.scss index badd38ed95..807ec2910a 100644 --- a/frontend/src/container/InfraMonitoringK8s/Nodes/NodeDetails/Events/NodeEvents.styles.scss +++ b/frontend/src/container/InfraMonitoringK8s/Nodes/NodeDetails/Events/NodeEvents.styles.scss @@ -105,7 +105,7 @@ } .nodename-column-value { - color: var(--Vanilla-100, #fff); + color: var(--bg-vanilla-100); font-family: 'Geist Mono'; font-style: normal; font-weight: 600; diff --git a/frontend/src/container/InfraMonitoringK8s/Nodes/NodeDetails/NodeDetails.tsx b/frontend/src/container/InfraMonitoringK8s/Nodes/NodeDetails/NodeDetails.tsx index 84febfed61..a81bcfede9 100644 --- a/frontend/src/container/InfraMonitoringK8s/Nodes/NodeDetails/NodeDetails.tsx +++ b/frontend/src/container/InfraMonitoringK8s/Nodes/NodeDetails/NodeDetails.tsx @@ -5,6 +5,7 @@ import { Color, Spacing } from '@signozhq/design-tokens'; import { Button, Divider, Drawer, Radio, Tooltip, Typography } from 'antd'; import { RadioChangeEvent } from 'antd/lib'; import logEvent from 'api/common/logEvent'; +import { VIEW_TYPES, VIEWS } from 'components/HostMetricsDetail/constants'; import { QueryParams } from 'constants/query'; import { initialQueryBuilderFormValuesMap, @@ -41,7 +42,7 @@ import { import { GlobalReducer } from 'types/reducer/globalTime'; import { v4 as uuidv4 } from 'uuid'; -import { QUERY_KEYS, VIEW_TYPES, VIEWS } from './constants'; +import { QUERY_KEYS } from './constants'; import NodeEvents from './Events'; import NodeLogs from './Logs'; import NodeMetrics from './Metrics'; diff --git a/frontend/src/container/InfraMonitoringK8s/Nodes/NodeDetails/Traces/NodeTraces.tsx b/frontend/src/container/InfraMonitoringK8s/Nodes/NodeDetails/Traces/NodeTraces.tsx index b1306432ad..00e3533f2d 100644 --- a/frontend/src/container/InfraMonitoringK8s/Nodes/NodeDetails/Traces/NodeTraces.tsx +++ b/frontend/src/container/InfraMonitoringK8s/Nodes/NodeDetails/Traces/NodeTraces.tsx @@ -1,5 +1,6 @@ import './NodeTraces.styles.scss'; +import { getListColumns } from 'components/HostMetricsDetail/HostMetricTraces/utils'; import { ResizeTable } from 'components/ResizeTable'; import { DEFAULT_ENTITY_VERSION } from 'constants/app'; import { QueryParams } from 'constants/query'; @@ -25,7 +26,6 @@ import { IBuilderQuery } from 'types/api/queryBuilder/queryBuilderData'; import { DataSource } from 'types/common/queryBuilder'; import { getNodeTracesQueryPayload, selectedColumns } from './constants'; -import { getListColumns } from './utils'; interface Props { timeRange: { diff --git a/frontend/src/container/InfraMonitoringK8s/Nodes/NodeDetails/Traces/utils.tsx b/frontend/src/container/InfraMonitoringK8s/Nodes/NodeDetails/Traces/utils.tsx deleted file mode 100644 index aba284586a..0000000000 --- a/frontend/src/container/InfraMonitoringK8s/Nodes/NodeDetails/Traces/utils.tsx +++ /dev/null @@ -1,84 +0,0 @@ -import { Tag, Typography } from 'antd'; -import { ColumnsType } from 'antd/es/table'; -import { getMs } from 'container/Trace/Filters/Panel/PanelBody/Duration/util'; -import { - BlockLink, - getTraceLink, -} from 'container/TracesExplorer/ListView/utils'; -import dayjs from 'dayjs'; -import { RowData } from 'lib/query/createTableColumnsFromQuery'; -import { BaseAutocompleteData } from 'types/api/queryBuilder/queryAutocompleteResponse'; - -const keyToLabelMap: Record = { - timestamp: 'Timestamp', - serviceName: 'Service Name', - name: 'Name', - durationNano: 'Duration', - httpMethod: 'HTTP Method', - responseStatusCode: 'Status Code', -}; - -export const getListColumns = ( - selectedColumns: BaseAutocompleteData[], -): ColumnsType => { - const columns: ColumnsType = - selectedColumns.map(({ dataType, key, type }) => ({ - title: keyToLabelMap[key], - dataIndex: key, - key: `${key}-${dataType}-${type}`, - width: 145, - render: (value, item): JSX.Element => { - const itemData = item.data as any; - - if (key === 'timestamp') { - const date = - typeof value === 'string' - ? dayjs(value).format('YYYY-MM-DD HH:mm:ss.SSS') - : dayjs(value / 1e6).format('YYYY-MM-DD HH:mm:ss.SSS'); - - return ( - - {date} - - ); - } - - if (value === '') { - return ( - - N/A - - ); - } - - if (key === 'httpMethod' || key === 'responseStatusCode') { - return ( - - - {itemData[key]} - - - ); - } - - if (key === 'durationNano') { - const durationNano = itemData[key]; - - return ( - - {getMs(durationNano)}ms - - ); - } - - return ( - - {itemData[key]} - - ); - }, - responsive: ['md'], - })) || []; - - return columns; -}; diff --git a/frontend/src/container/InfraMonitoringK8s/Nodes/NodeDetails/constants.ts b/frontend/src/container/InfraMonitoringK8s/Nodes/NodeDetails/constants.ts index a737762b76..e771ffa91f 100644 --- a/frontend/src/container/InfraMonitoringK8s/Nodes/NodeDetails/constants.ts +++ b/frontend/src/container/InfraMonitoringK8s/Nodes/NodeDetails/constants.ts @@ -1,17 +1,3 @@ -export enum VIEWS { - METRICS = 'metrics', - LOGS = 'logs', - TRACES = 'traces', - EVENTS = 'events', -} - -export const VIEW_TYPES = { - METRICS: VIEWS.METRICS, - LOGS: VIEWS.LOGS, - TRACES: VIEWS.TRACES, - EVENTS: VIEWS.EVENTS, -}; - export const QUERY_KEYS = { K8S_OBJECT_KIND: 'k8s.object.kind', K8S_OBJECT_NAME: 'k8s.object.name', diff --git a/frontend/src/container/InfraMonitoringK8s/Nodes/utils.tsx b/frontend/src/container/InfraMonitoringK8s/Nodes/utils.tsx index ad160c0902..6722391714 100644 --- a/frontend/src/container/InfraMonitoringK8s/Nodes/utils.tsx +++ b/frontend/src/container/InfraMonitoringK8s/Nodes/utils.tsx @@ -1,3 +1,4 @@ +import { Color } from '@signozhq/design-tokens'; import { Tag, Tooltip } from 'antd'; import { ColumnType } from 'antd/es/table'; import { @@ -163,7 +164,7 @@ const getGroupByEle = ( return (
{groupByValues.map((value) => ( - + {value === '' ? '' : value} ))} diff --git a/frontend/src/container/InfraMonitoringK8s/Pods/K8sPodLists.tsx b/frontend/src/container/InfraMonitoringK8s/Pods/K8sPodLists.tsx index 5fea3d622f..abf257ae5d 100644 --- a/frontend/src/container/InfraMonitoringK8s/Pods/K8sPodLists.tsx +++ b/frontend/src/container/InfraMonitoringK8s/Pods/K8sPodLists.tsx @@ -11,6 +11,8 @@ import { Typography, } from 'antd'; import { ColumnType, SorterResult } from 'antd/es/table/interface'; +import get from 'api/browser/localstorage/get'; +import set from 'api/browser/localstorage/set'; import logEvent from 'api/common/logEvent'; import { K8sPodsListPayload } from 'api/infraMonitoring/getK8sPodsList'; import { useGetK8sPodsList } from 'hooks/infraMonitoring/useGetK8sPodsList'; @@ -23,10 +25,6 @@ import { useSelector } from 'react-redux'; import { AppState } from 'store/reducers'; import { IBuilderQuery } from 'types/api/queryBuilder/queryBuilderData'; import { GlobalReducer } from 'types/reducer/globalTime'; -import { - getFromLocalStorage, - updateLocalStorage, -} from 'utils/localStorageReadWrite'; import { K8sCategory, @@ -107,7 +105,7 @@ function K8sPodsList({ ); useEffect(() => { - const addedColumns = getFromLocalStorage('k8sPodsAddedColumns'); + const addedColumns = JSON.parse(get('k8sPodsAddedColumns') ?? ''); if (addedColumns && addedColumns.length > 0) { const availableColumns = defaultAvailableColumns.filter( @@ -176,9 +174,11 @@ function K8sPodsList({ baseFilters.items.push({ key: { key, + type: null, }, op: '=', value: groupedByMeta[key], + id: key, }); } @@ -363,7 +363,7 @@ function K8sPodsList({ useEffect(() => { const addedColumnIDs = addedColumns.map((column) => column.id); - updateLocalStorage('k8sPodsAddedColumns', addedColumnIDs); + set('k8sPodsAddedColumns', JSON.stringify(addedColumnIDs)); }, [addedColumns]); useEffect(() => { diff --git a/frontend/src/container/InfraMonitoringK8s/Pods/PodDetails/Events/Events.styles.scss b/frontend/src/container/InfraMonitoringK8s/Pods/PodDetails/Events/Events.styles.scss index acefb8bd4e..54ed42d565 100644 --- a/frontend/src/container/InfraMonitoringK8s/Pods/PodDetails/Events/Events.styles.scss +++ b/frontend/src/container/InfraMonitoringK8s/Pods/PodDetails/Events/Events.styles.scss @@ -105,7 +105,7 @@ } .hostname-column-value { - color: var(--Vanilla-100, #fff); + color: var(--bg-vanilla-100); font-family: 'Geist Mono'; font-style: normal; font-weight: 600; diff --git a/frontend/src/container/InfraMonitoringK8s/Pods/PodDetails/PodDetails.tsx b/frontend/src/container/InfraMonitoringK8s/Pods/PodDetails/PodDetails.tsx index 345f24d144..1da904aa6d 100644 --- a/frontend/src/container/InfraMonitoringK8s/Pods/PodDetails/PodDetails.tsx +++ b/frontend/src/container/InfraMonitoringK8s/Pods/PodDetails/PodDetails.tsx @@ -6,6 +6,7 @@ import { Color, Spacing } from '@signozhq/design-tokens'; import { Button, Divider, Drawer, Radio, Tooltip, Typography } from 'antd'; import { RadioChangeEvent } from 'antd/lib'; import logEvent from 'api/common/logEvent'; +import { VIEW_TYPES, VIEWS } from 'components/HostMetricsDetail/constants'; import { QueryParams } from 'constants/query'; import { initialQueryBuilderFormValuesMap, @@ -42,7 +43,7 @@ import { import { GlobalReducer } from 'types/reducer/globalTime'; import { v4 as uuidv4 } from 'uuid'; -import { QUERY_KEYS, VIEW_TYPES, VIEWS } from './constants'; +import { QUERY_KEYS } from './constants'; import Events from './Events/Events'; import Metrics from './Metrics/Metrics'; import { PodDetailProps } from './PodDetail.interfaces'; diff --git a/frontend/src/container/InfraMonitoringK8s/Pods/PodDetails/PodTraces/PodTraces.tsx b/frontend/src/container/InfraMonitoringK8s/Pods/PodDetails/PodTraces/PodTraces.tsx index 343b127367..03c7f43b93 100644 --- a/frontend/src/container/InfraMonitoringK8s/Pods/PodDetails/PodTraces/PodTraces.tsx +++ b/frontend/src/container/InfraMonitoringK8s/Pods/PodDetails/PodTraces/PodTraces.tsx @@ -1,5 +1,6 @@ import './PodTraces.styles.scss'; +import { getListColumns } from 'components/HostMetricsDetail/HostMetricTraces/utils'; import { ResizeTable } from 'components/ResizeTable'; import { DEFAULT_ENTITY_VERSION } from 'constants/app'; import { QueryParams } from 'constants/query'; @@ -25,7 +26,6 @@ import { IBuilderQuery } from 'types/api/queryBuilder/queryBuilderData'; import { DataSource } from 'types/common/queryBuilder'; import { getPodTracesQueryPayload, selectedColumns } from './constants'; -import { getListColumns } from './utils'; interface Props { timeRange: { diff --git a/frontend/src/container/InfraMonitoringK8s/Pods/PodDetails/PodTraces/utils.tsx b/frontend/src/container/InfraMonitoringK8s/Pods/PodDetails/PodTraces/utils.tsx deleted file mode 100644 index aba284586a..0000000000 --- a/frontend/src/container/InfraMonitoringK8s/Pods/PodDetails/PodTraces/utils.tsx +++ /dev/null @@ -1,84 +0,0 @@ -import { Tag, Typography } from 'antd'; -import { ColumnsType } from 'antd/es/table'; -import { getMs } from 'container/Trace/Filters/Panel/PanelBody/Duration/util'; -import { - BlockLink, - getTraceLink, -} from 'container/TracesExplorer/ListView/utils'; -import dayjs from 'dayjs'; -import { RowData } from 'lib/query/createTableColumnsFromQuery'; -import { BaseAutocompleteData } from 'types/api/queryBuilder/queryAutocompleteResponse'; - -const keyToLabelMap: Record = { - timestamp: 'Timestamp', - serviceName: 'Service Name', - name: 'Name', - durationNano: 'Duration', - httpMethod: 'HTTP Method', - responseStatusCode: 'Status Code', -}; - -export const getListColumns = ( - selectedColumns: BaseAutocompleteData[], -): ColumnsType => { - const columns: ColumnsType = - selectedColumns.map(({ dataType, key, type }) => ({ - title: keyToLabelMap[key], - dataIndex: key, - key: `${key}-${dataType}-${type}`, - width: 145, - render: (value, item): JSX.Element => { - const itemData = item.data as any; - - if (key === 'timestamp') { - const date = - typeof value === 'string' - ? dayjs(value).format('YYYY-MM-DD HH:mm:ss.SSS') - : dayjs(value / 1e6).format('YYYY-MM-DD HH:mm:ss.SSS'); - - return ( - - {date} - - ); - } - - if (value === '') { - return ( - - N/A - - ); - } - - if (key === 'httpMethod' || key === 'responseStatusCode') { - return ( - - - {itemData[key]} - - - ); - } - - if (key === 'durationNano') { - const durationNano = itemData[key]; - - return ( - - {getMs(durationNano)}ms - - ); - } - - return ( - - {itemData[key]} - - ); - }, - responsive: ['md'], - })) || []; - - return columns; -}; diff --git a/frontend/src/container/InfraMonitoringK8s/Pods/PodDetails/constants.ts b/frontend/src/container/InfraMonitoringK8s/Pods/PodDetails/constants.ts index 243fe50b0b..6a9b1f852f 100644 --- a/frontend/src/container/InfraMonitoringK8s/Pods/PodDetails/constants.ts +++ b/frontend/src/container/InfraMonitoringK8s/Pods/PodDetails/constants.ts @@ -1,17 +1,3 @@ -export enum VIEWS { - METRICS = 'metrics', - LOGS = 'logs', - TRACES = 'traces', - EVENTS = 'events', -} - -export const VIEW_TYPES = { - METRICS: VIEWS.METRICS, - LOGS: VIEWS.LOGS, - TRACES: VIEWS.TRACES, - EVENTS: VIEWS.EVENTS, -}; - export const QUERY_KEYS = { K8S_OBJECT_KIND: 'k8s.object.kind', K8S_OBJECT_NAME: 'k8s.object.name', diff --git a/frontend/src/container/InfraMonitoringK8s/Volumes/Volumes.tsx b/frontend/src/container/InfraMonitoringK8s/Volumes/Volumes.tsx deleted file mode 100644 index a4ab86c7ef..0000000000 --- a/frontend/src/container/InfraMonitoringK8s/Volumes/Volumes.tsx +++ /dev/null @@ -1,3 +0,0 @@ -export default function Volumes(): JSX.Element { - return
Volumes
; -} diff --git a/frontend/src/container/InfraMonitoringK8s/utils.tsx b/frontend/src/container/InfraMonitoringK8s/utils.tsx index 4fa6fbfc71..156d53aa28 100644 --- a/frontend/src/container/InfraMonitoringK8s/utils.tsx +++ b/frontend/src/container/InfraMonitoringK8s/utils.tsx @@ -2,6 +2,7 @@ /* eslint-disable sonarjs/cognitive-complexity */ import './InfraMonitoringK8s.styles.scss'; +import { Color } from '@signozhq/design-tokens'; import { Tag, Tooltip } from 'antd'; import { ColumnType } from 'antd/es/table'; import { @@ -313,7 +314,7 @@ const getGroupByEle = ( return (
{groupByValues.map((value) => ( - + {value === '' ? '' : value} ))} diff --git a/frontend/src/container/ListOfDashboard/DashboardList.styles.scss b/frontend/src/container/ListOfDashboard/DashboardList.styles.scss index 08e62dd101..5f09653b60 100644 --- a/frontend/src/container/ListOfDashboard/DashboardList.styles.scss +++ b/frontend/src/container/ListOfDashboard/DashboardList.styles.scss @@ -905,7 +905,7 @@ gap: 4px; .title { - color: var(--Vanilla-100, #fff); + color: var(--bg-vanilla-100); font-family: Inter; font-size: 12.805px; font-style: normal; diff --git a/frontend/src/types/api/queryBuilder/queryAutocompleteResponse.ts b/frontend/src/types/api/queryBuilder/queryAutocompleteResponse.ts index 58bfdec0d8..f2f67520d2 100644 --- a/frontend/src/types/api/queryBuilder/queryAutocompleteResponse.ts +++ b/frontend/src/types/api/queryBuilder/queryAutocompleteResponse.ts @@ -19,7 +19,7 @@ export interface BaseAutocompleteData { dataType?: DataTypes; isColumn?: boolean; key: string; - type?: AutocompleteType | string | null; + type: AutocompleteType | string | null; isJSON?: boolean; isIndexed?: boolean; } diff --git a/frontend/src/types/api/queryBuilder/queryBuilderData.ts b/frontend/src/types/api/queryBuilder/queryBuilderData.ts index 6d3906e8f8..d15a41cec9 100644 --- a/frontend/src/types/api/queryBuilder/queryBuilderData.ts +++ b/frontend/src/types/api/queryBuilder/queryBuilderData.ts @@ -21,7 +21,7 @@ export interface IBuilderFormula { } export interface TagFilterItem { - id?: string; + id: string; key?: BaseAutocompleteData; op: string; value: string[] | string | number | boolean; diff --git a/frontend/src/utils/localStorageReadWrite.ts b/frontend/src/utils/localStorageReadWrite.ts deleted file mode 100644 index 0d88288cce..0000000000 --- a/frontend/src/utils/localStorageReadWrite.ts +++ /dev/null @@ -1,17 +0,0 @@ -export const updateLocalStorage = (key: string, value: any): void => { - try { - localStorage.setItem(key, JSON.stringify(value)); - } catch (error) { - console.error(`Failed to update ${key} in localStorage`, error); - } -}; - -export const getFromLocalStorage = (key: string): any => { - try { - const item = localStorage.getItem(key); - return item ? JSON.parse(item) : null; - } catch (error) { - console.error(`Failed to retrieve ${key} from localStorage`, error); - return null; - } -};