Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

chore(saved-views): retire the old views pages, v1 client and the flag (#13258)

Aditya Singh5b5b9794f9f7
diff --git a/.claude/skills/signoz-page-story/references/controls.md b/.claude/skills/signoz-page-story/references/controls.md
index 07fba7b860..3376712326 100644
--- a/.claude/skills/signoz-page-story/references/controls.md
+++ b/.claude/skills/signoz-page-story/references/controls.md
@@ -46,9 +46,9 @@ One endpoint feeding several widgets stays one handler that reads the request. `
```ts
rest.get(
- 'http://localhost/api/v1/explorer/views',
+ 'http://localhost/api/v2/saved_views',
response.json((req) =>
- savedViews(values.savedViews, req.url.searchParams.get('sourcePage') ?? 'logs'),
+ savedViews(values.savedViews, req.url.searchParams.get('source') ?? 'logs'),
),
),
```
diff --git a/frontend/.storybook/preview.tsx b/frontend/.storybook/preview.tsx
index 2db0e6deca..e35aa36319 100644
--- a/frontend/.storybook/preview.tsx
+++ b/frontend/.storybook/preview.tsx
@@ -141,7 +141,7 @@ const preview: Preview = {
'Services',
['List', 'Detail', 'Top Level Operations', 'Service Map'],
'Logs',
- ['Explorer', 'Live Tail', 'Saved Views', 'Pipelines', 'Settings'],
+ ['Explorer', 'Live Tail', 'Pipelines', 'Settings'],
'Traces',
['Explorer', 'Trace Details', 'Funnel Details'],
'Metrics',
diff --git a/frontend/public/locales/en-GB/explorer.json b/frontend/public/locales/en-GB/explorer.json
deleted file mode 100644
index b4ffa6148c..0000000000
--- a/frontend/public/locales/en-GB/explorer.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "name_of_the_view": "Name of the view"
-}
\ No newline at end of file
diff --git a/frontend/public/locales/en-GB/titles.json b/frontend/public/locales/en-GB/titles.json
index 704ac868c1..4044bb32e3 100644
--- a/frontend/public/locales/en-GB/titles.json
+++ b/frontend/public/locales/en-GB/titles.json
@@ -47,7 +47,6 @@
"INFRASTRUCTURE_MONITORING_HOSTS": "SigNoz | Infra Monitoring",
"INFRASTRUCTURE_MONITORING_KUBERNETES": "SigNoz | Infra Monitoring",
"METER_EXPLORER": "SigNoz | Meter Explorer",
- "METER_EXPLORER_VIEWS": "SigNoz | Meter Explorer Views",
"METER": "SigNoz | Meter",
"ROLES_SETTINGS": "SigNoz | Roles",
"MEMBERS_SETTINGS": "SigNoz | Members",
diff --git a/frontend/public/locales/en/explorer.json b/frontend/public/locales/en/explorer.json
deleted file mode 100644
index 65e4fc2053..0000000000
--- a/frontend/public/locales/en/explorer.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "name_of_the_view": "Name of the view",
- "delete_confirm_message": "Are you sure you want to delete {{viewName}} view? Deleting a view is irreversible and cannot be undone."
-}
\ No newline at end of file
diff --git a/frontend/public/locales/en/titles.json b/frontend/public/locales/en/titles.json
index 6c0dc54c7a..95cc89d5c0 100644
--- a/frontend/public/locales/en/titles.json
+++ b/frontend/public/locales/en/titles.json
@@ -50,8 +50,6 @@
"WORKSPACE_SUSPENDED": "SigNoz | Workspace Suspended",
"WORKSPACE_ACCESS_RESTRICTED": "SigNoz | Workspace Access Restricted",
"SUPPORT": "SigNoz | Support",
- "LOGS_SAVE_VIEWS": "SigNoz | Logs Saved Views",
- "TRACES_SAVE_VIEWS": "SigNoz | Traces Saved Views",
"TRACES_FUNNELS": "SigNoz | Traces Funnels",
"DEFAULT": "Open source Observability Platform | SigNoz",
"SHORTCUTS": "SigNoz | Shortcuts",
@@ -66,10 +64,8 @@
"INFRASTRUCTURE_MONITORING_KUBERNETES": "SigNoz | Infra Monitoring",
"METRICS_EXPLORER": "SigNoz | Metrics Explorer",
"METRICS_EXPLORER_EXPLORER": "SigNoz | Metrics Explorer",
- "METRICS_EXPLORER_VIEWS": "SigNoz | Metrics Explorer",
"API_MONITORING": "SigNoz | External APIs",
"METER_EXPLORER": "SigNoz | Meter Explorer",
- "METER_EXPLORER_VIEWS": "SigNoz | Meter Explorer Views",
"METER": "SigNoz | Meter",
"ROLES_SETTINGS": "SigNoz | Roles",
"MEMBERS_SETTINGS": "SigNoz | Members",
diff --git a/frontend/src/AppRoutes/__tests__/Private.test.tsx b/frontend/src/AppRoutes/__tests__/Private.test.tsx
index 0edc1cba97..b063260c0f 100644
--- a/frontend/src/AppRoutes/__tests__/Private.test.tsx
+++ b/frontend/src/AppRoutes/__tests__/Private.test.tsx
@@ -303,10 +303,10 @@ describe('PrivateRoute', () => {
it.each([
['/logs-save-views', ROUTES.LOGS_EXPLORER],
['/traces-save-views', ROUTES.TRACES_EXPLORER],
- [ROUTES.LOGS_SAVE_VIEWS, ROUTES.LOGS_EXPLORER],
- [ROUTES.TRACES_SAVE_VIEWS, ROUTES.TRACES_EXPLORER],
- [ROUTES.METRICS_EXPLORER_VIEWS, ROUTES.METRICS_EXPLORER_EXPLORER],
- [ROUTES.METER_EXPLORER_VIEWS, ROUTES.METER_EXPLORER],
+ ['/logs/saved-views', ROUTES.LOGS_EXPLORER],
+ ['/traces/saved-views', ROUTES.TRACES_EXPLORER],
+ ['/metrics-explorer/views', ROUTES.METRICS_EXPLORER_EXPLORER],
+ ['/meter/explorer/views', ROUTES.METER_EXPLORER],
])('should redirect the old views route %s to %s', (from, to) => {
renderPrivateRoute({ initialRoute: from });
diff --git a/frontend/src/AppRoutes/index.tsx b/frontend/src/AppRoutes/index.tsx
index 92f4d5ad16..706da4dc2b 100644
--- a/frontend/src/AppRoutes/index.tsx
+++ b/frontend/src/AppRoutes/index.tsx
@@ -18,7 +18,6 @@ import AppLayout from 'container/AppLayout';
import Hex from 'crypto-js/enc-hex';
import HmacSHA256 from 'crypto-js/hmac-sha256';
import { useIsAIAssistantEnabled } from 'hooks/useIsAIAssistantEnabled';
-import { useSavedViewEnabled } from 'hooks/useSavedViewEnabled';
import { ChatSupportState, useChatSupport } from 'hooks/useChatSupport';
import { useIsDarkMode } from 'hooks/useDarkMode';
import { useGetTenantLicense } from 'hooks/useGetTenantLicense';
@@ -66,7 +65,6 @@ function App(): JSX.Element {
} = useAppContext();
const [routes, setRoutes] = useState<AppRoutes[]>(defaultRoutes);
const isAIAssistantEnabled = useIsAIAssistantEnabled();
- const isSavedViewEnabled = useSavedViewEnabled();
const chatSupport = useChatSupport();
const { hostname } = window.location;
@@ -256,18 +254,8 @@ function App(): JSX.Element {
useEffect(() => {
// The bottom strip carries Support, so the floating bubble goes entirely.
- if (
- isSavedViewEnabled ||
- pathname === ROUTES.ONBOARDING ||
- pathname.startsWith('/public/dashboard/') ||
- pathname === '/ai-assistant' ||
- pathname.startsWith('/ai-assistant/')
- ) {
- window.Pylon?.('hideChatBubble');
- } else {
- window.Pylon?.('showChatBubble');
- }
- }, [pathname, isSavedViewEnabled]);
+ window.Pylon?.('hideChatBubble');
+ }, [pathname]);
// Identity for the Pylon widget. Whether this user gets Pylon at all is
// `useChatSupport`'s call — this only fills in who they are.
diff --git a/frontend/src/AppRoutes/pageComponents.ts b/frontend/src/AppRoutes/pageComponents.ts
index 9b068be3a1..ae51129b7d 100644
--- a/frontend/src/AppRoutes/pageComponents.ts
+++ b/frontend/src/AppRoutes/pageComponents.ts
@@ -26,10 +26,6 @@ export const ServiceMapPage = Loadable(
() => import(/* webpackChunkName: "ServiceMapPage" */ 'modules/Servicemap'),
);
-export const LogsSaveViews = Loadable(
- () => import(/* webpackChunkName: "LogsSaveViews" */ 'pages/LogsModulePage'), // TODO: Add a wrapper so that the same component can be used in traces
-);
-
export const TracesExplorer = Loadable(
() =>
import(
@@ -37,11 +33,6 @@ export const TracesExplorer = Loadable(
),
);
-export const TracesSaveViews = Loadable(
- () =>
- import(/* webpackChunkName: "Traces Save Views" */ 'pages/TracesModulePage'),
-);
-
export const TracesFunnels = Loadable(
() =>
import(/* webpackChunkName: "Traces Funnels" */ 'pages/TracesModulePage'),
diff --git a/frontend/src/AppRoutes/routes.ts b/frontend/src/AppRoutes/routes.ts
index 9189ba4391..823b12ea3c 100644
--- a/frontend/src/AppRoutes/routes.ts
+++ b/frontend/src/AppRoutes/routes.ts
@@ -26,7 +26,6 @@ import {
Login,
Logs,
LogsIndexToFields,
- LogsSaveViews,
MessagingQueuesMainPage,
MeterExplorerPage,
MetricsExplorer,
@@ -48,7 +47,6 @@ import {
TracesExplorer,
TracesFunnelDetails,
TracesFunnels,
- TracesSaveViews,
UnAuthorized,
UsageExplorerPage,
WorkspaceAccessRestricted,
@@ -120,13 +118,6 @@ const routes: AppRoutes[] = [
exact: true,
key: 'SERVICE_MAP',
},
- {
- path: ROUTES.LOGS_SAVE_VIEWS,
- component: LogsSaveViews,
- isPrivate: true,
- exact: true,
- key: 'LOGS_SAVE_VIEWS',
- },
{
path: ROUTES.TRACE_DETAIL,
exact: true,
@@ -218,13 +209,6 @@ const routes: AppRoutes[] = [
isPrivate: true,
key: 'TRACES_EXPLORER',
},
- {
- path: ROUTES.TRACES_SAVE_VIEWS,
- exact: true,
- component: TracesSaveViews,
- isPrivate: true,
- key: 'TRACES_SAVE_VIEWS',
- },
{
path: ROUTES.TRACES_FUNNELS,
exact: true,
@@ -414,13 +398,6 @@ const routes: AppRoutes[] = [
key: 'METRICS_EXPLORER_EXPLORER',
isPrivate: true,
},
- {
- path: ROUTES.METRICS_EXPLORER_VIEWS,
- exact: true,
- component: MetricsExplorer,
- key: 'METRICS_EXPLORER_VIEWS',
- isPrivate: true,
- },
{
path: ROUTES.METRICS_EXPLORER_VOLUME_CONTROL,
exact: true,
@@ -443,13 +420,6 @@ const routes: AppRoutes[] = [
key: 'METER_EXPLORER',
isPrivate: true,
},
- {
- path: ROUTES.METER_EXPLORER_VIEWS,
- exact: true,
- component: MeterExplorerPage,
- key: 'METER_EXPLORER_VIEWS',
- isPrivate: true,
- },
{
path: ROUTES.API_MONITORING,
exact: true,
diff --git a/frontend/src/api/saveView/deleteView.ts b/frontend/src/api/saveView/deleteView.ts
deleted file mode 100644
index 9317c8331a..0000000000
--- a/frontend/src/api/saveView/deleteView.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-import axios from 'api';
-import { DeleteViewPayloadProps } from 'types/api/saveViews/types';
-
-export const deleteView = (uuid: string): Promise<DeleteViewPayloadProps> =>
- axios.delete(`/explorer/views/${uuid}`);
diff --git a/frontend/src/api/saveView/getAllViews.ts b/frontend/src/api/saveView/getAllViews.ts
deleted file mode 100644
index a26fd13441..0000000000
--- a/frontend/src/api/saveView/getAllViews.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import axios from 'api';
-import { AxiosResponse } from 'axios';
-import { AllViewsProps } from 'types/api/saveViews/types';
-import { DataSource } from 'types/common/queryBuilder';
-
-export const getAllViews = (
- sourcepage: DataSource | 'meter',
-): Promise<AxiosResponse<AllViewsProps>> =>
- axios.get(`/explorer/views?sourcePage=${sourcepage}`);
diff --git a/frontend/src/api/saveView/getViewById.ts b/frontend/src/api/saveView/getViewById.ts
deleted file mode 100644
index 5195ecf252..0000000000
--- a/frontend/src/api/saveView/getViewById.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-import axios from 'api';
-import { AxiosResponse } from 'axios';
-import { ViewProps } from 'types/api/saveViews/types';
-
-/**
- * Fetches a single saved view by ID (`GET /api/v1/explorer/views/{viewId}`).
- *
- * Hand-maintained alongside the other `api/saveView/*` clients — explorer views
- * are not in `docs/api/openapi.yml`, so Orval does not generate a hook here
- * (unlike e.g. `useGetChannelByID` under `api/generated/services/channels`).
- *
- * Used by the AI assistant "Open view" action to load `compositeQuery` and
- * navigate to the correct explorer without listing every view per source page.
- * See `container/AIAssistant/components/ActionsSection/utils/openSavedView.ts`.
- */
-export interface GetViewByIdProps {
- status: string;
- data: ViewProps;
-}
-
-export const getViewById = (
- viewKey: string,
-): Promise<AxiosResponse<GetViewByIdProps>> =>
- axios.get(`/explorer/views/${viewKey}`);
diff --git a/frontend/src/api/saveView/saveView.ts b/frontend/src/api/saveView/saveView.ts
deleted file mode 100644
index 60a552f0bb..0000000000
--- a/frontend/src/api/saveView/saveView.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import axios from 'api';
-import { AxiosResponse } from 'axios';
-import { SaveViewPayloadProps, SaveViewProps } from 'types/api/saveViews/types';
-
-export const saveView = ({
- compositeQuery,
- sourcePage,
- viewName,
- extraData,
-}: SaveViewProps): Promise<AxiosResponse<SaveViewPayloadProps>> =>
- axios.post('/explorer/views', {
- name: viewName,
- sourcePage,
- compositeQuery,
- extraData,
- });
diff --git a/frontend/src/api/saveView/updateView.ts b/frontend/src/api/saveView/updateView.ts
deleted file mode 100644
index b48b73f275..0000000000
--- a/frontend/src/api/saveView/updateView.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import axios from 'api';
-import {
- UpdateViewPayloadProps,
- UpdateViewProps,
-} from 'types/api/saveViews/types';
-
-export const updateView = ({
- compositeQuery,
- viewName,
- extraData,
- sourcePage,
- viewKey,
-}: UpdateViewProps): Promise<UpdateViewPayloadProps> =>
- axios.put(`/explorer/views/${viewKey}`, {
- name: viewName,
- compositeQuery,
- extraData,
- sourcePage,
- });
diff --git a/frontend/src/components/ChatSupportGateway/ChatSupportGateway.tsx b/frontend/src/components/ChatSupportGateway/ChatSupportGateway.tsx
deleted file mode 100644
index d9082759f2..0000000000
--- a/frontend/src/components/ChatSupportGateway/ChatSupportGateway.tsx
+++ /dev/null
@@ -1,43 +0,0 @@
-import { useState } from 'react';
-import { useLocation } from 'react-router-dom';
-import { Button } from 'antd';
-import AddCreditCardModal from 'components/AddCreditCardModal/AddCreditCardModal';
-import logEvent from 'api/common/logEvent';
-import { MessageSquareText } from '@signozhq/icons';
-
-export default function ChatSupportGateway(): JSX.Element {
- const [isAddCreditCardModalOpen, setIsAddCreditCardModalOpen] =
- useState(false);
- const { pathname } = useLocation();
-
- return (
- <>
- <div className="chat-support-gateway">
- <Button
- className="chat-support-gateway-btn"
- onClick={(): void => {
- logEvent('Disabled Chat Support: Clicked', {
- source: `chat support icon`,
- page: pathname,
- });
-
- setIsAddCreditCardModalOpen(true);
- }}
- >
- <MessageSquareText size={24} />
- </Button>
- </div>
-
- <AddCreditCardModal
- open={isAddCreditCardModalOpen}
- onClose={(): void => setIsAddCreditCardModalOpen(false)}
- onAddCreditCard={(): void => {
- logEvent('Add Credit card modal: Clicked', {
- source: `chat support icon`,
- page: pathname,
- });
- }}
- />
- </>
- );
-}
diff --git a/frontend/src/components/ExplorerCard/ExplorerCard.tsx b/frontend/src/components/ExplorerCard/ExplorerCard.tsx
deleted file mode 100644
index 73f7c10735..0000000000
--- a/frontend/src/components/ExplorerCard/ExplorerCard.tsx
+++ /dev/null
@@ -1,252 +0,0 @@
-import { useState } from 'react';
-import { useCopyToClipboard } from 'react-use';
-import { Button, Col, Popover, Row, Select, Space } from 'antd';
-import { Dropdown, type DropdownItemType } from '@signozhq/ui/dropdown';
-import { Typography } from '@signozhq/ui/typography';
-import axios from 'axios';
-import TextToolTip from 'components/TextToolTip';
-import { SOMETHING_WENT_WRONG } from 'constants/api';
-import { LOCALSTORAGE } from 'constants/localStorage';
-import { useOptionsMenu } from 'container/OptionsMenu';
-import { useGetSavedViewParams } from 'hooks/saveViews/useGetSavedViewParams';
-import { useQueryBuilder } from 'hooks/queryBuilder/useQueryBuilder';
-import { useDeleteView } from 'hooks/saveViews/useDeleteView';
-import { useGetAllViews } from 'hooks/saveViews/useGetAllViews';
-import { useUpdateView } from 'hooks/saveViews/useUpdateView';
-import useErrorNotification from 'hooks/useErrorNotification';
-import { useNotifications } from 'hooks/useNotifications';
-import { mapCompositeQueryFromQuery } from 'lib/newQueryBuilder/queryBuilderMappers/mapCompositeQueryFromQuery';
-import { DataSource, StringOperators } from 'types/common/queryBuilder';
-import { popupContainer } from 'utils/selectPopupContainer';
-
-import { ExploreHeaderToolTip, SaveButtonText } from './constants';
-import MenuItemGenerator from './MenuItemGenerator';
-import SaveViewWithName from './SaveViewWithName';
-import {
- DropDownOverlay,
- ExplorerCardHeadContainer,
- OffSetCol,
-} from './styles';
-import { ExplorerCardProps } from './types';
-import { deleteViewHandler } from './utils';
-import { Ellipsis, Save, Share2, Trash2 } from '@signozhq/icons';
-
-function ExplorerCard({
- sourcepage,
- children,
-}: ExplorerCardProps): JSX.Element {
- const [isOpen, setIsOpen] = useState<boolean>(false);
- const [, setCopyUrl] = useCopyToClipboard();
- const { notifications } = useNotifications();
-
- const onCopyUrlHandler = (): void => {
- setCopyUrl(window.location.href);
- notifications.success({
- message: 'Copied to clipboard',
- });
- };
-
- const {
- currentQuery,
- panelType,
- redirectWithQueryBuilderData,
- updateAllQueriesOperators,
- isStagedQueryUpdated,
- } = useQueryBuilder();
-
- const {
- data: viewsData,
- isLoading,
- error,
- isRefetching,
- refetch: refetchAllView,
- } = useGetAllViews(sourcepage);
-
- useErrorNotification(error);
-
- const handleOpenChange = (newOpen = false): void => {
- setIsOpen(newOpen);
- };
-
- const { viewName, viewKey } = useGetSavedViewParams();
-
- const { options } = useOptionsMenu({
- storageKey:
- sourcepage === DataSource.TRACES
- ? LOCALSTORAGE.TRACES_LIST_OPTIONS
- : LOCALSTORAGE.LOGS_LIST_OPTIONS,
- dataSource: sourcepage,
- aggregateOperator: StringOperators.NOOP,
- });
-
- const isQueryUpdated = isStagedQueryUpdated(
- viewsData?.data?.data,
- viewKey,
- options,
- );
-
- const { mutateAsync: updateViewAsync } = useUpdateView({
- compositeQuery: mapCompositeQueryFromQuery(currentQuery, panelType),
- viewKey,
- extraData: '',
- sourcePage: sourcepage,
- viewName,
- });
-
- const { mutateAsync: deleteViewAsync } = useDeleteView(viewKey);
-
- const showErrorNotification = (err: Error): void => {
- notifications.error({
- message: axios.isAxiosError(err) ? err.message : SOMETHING_WENT_WRONG,
- });
- };
-
- const onDeleteHandler = (): void =>
- deleteViewHandler({
- deleteViewAsync,
- notifications,
- panelType,
- redirectWithQueryBuilderData,
- refetchAllView,
- viewId: viewKey,
- viewKey,
- updateAllQueriesOperators,
- sourcePage: sourcepage,
- });
-
- const onUpdateQueryHandler = (): void => {
- updateViewAsync(
- {
- compositeQuery: mapCompositeQueryFromQuery(currentQuery, panelType),
- viewKey,
- extraData: '',
- sourcePage: sourcepage,
- viewName,
- },
- {
- onSuccess: () => {
- notifications.success({
- message: 'View Updated Successfully',
- });
- refetchAllView();
- },
- onError: (err) => {
- showErrorNotification(err);
- },
- },
- );
- };
-
- const moreOptionItems: DropdownItemType[] = [
- {
- type: 'item',
- value: 'delete',
- label: <Typography.Text strong>Delete</Typography.Text>,
- onClick: onDeleteHandler,
- prefix: <Trash2 size="md" />,
- },
- ];
-
- const saveButtonType = isQueryUpdated ? 'default' : 'primary';
- const saveButtonIcon = isQueryUpdated ? null : <Save size="md" />;
-
- const showSaveView = false;
-
- return (
- <>
- {showSaveView && (
- <ExplorerCardHeadContainer size="small">
- <Row align="middle">
- <Col span={6}>
- <Space>
- <Typography>Query Builder</Typography>
- <TextToolTip
- url={ExploreHeaderToolTip.url}
- text={ExploreHeaderToolTip.text}
- useFilledIcon={false}
- />
- </Space>
- </Col>
- <OffSetCol span={18}>
- <Space size="large">
- {viewsData?.data.data && viewsData?.data.data.length && (
- <Space>
- <Select
- getPopupContainer={popupContainer}
- loading={isLoading || isRefetching}
- showSearch
- placeholder="Select a view"
- dropdownStyle={DropDownOverlay}
- dropdownMatchSelectWidth={false}
- optionLabelProp="value"
- value={viewName || undefined}
- >
- {viewsData?.data.data.map((view) => (
- <Select.Option key={view.id} value={view.name}>
- <MenuItemGenerator
- viewName={view.name}
- viewKey={viewKey}
- createdBy={view.createdBy}
- uuid={view.id}
- refetchAllView={refetchAllView}
- viewData={viewsData.data.data}
- sourcePage={sourcepage}
- />
- </Select.Option>
- ))}
- </Select>
- </Space>
- )}
- {isQueryUpdated && (
- <Button type="primary" icon={<Save />} onClick={onUpdateQueryHandler}>
- Save changes
- </Button>
- )}
- <Popover
- getPopupContainer={popupContainer}
- placement="bottomLeft"
- trigger="click"
- content={
- <SaveViewWithName
- sourcePage={sourcepage}
- handlePopOverClose={handleOpenChange}
- refetchAllView={refetchAllView}
- />
- }
- showArrow={false}
- open={isOpen}
- onOpenChange={handleOpenChange}
- >
- <Button
- type={saveButtonType}
- icon={saveButtonIcon}
- data-testid="traces-save-view-action"
- >
- {isQueryUpdated
- ? SaveButtonText.SAVE_AS_NEW_VIEW
- : SaveButtonText.SAVE_VIEW}
- </Button>
- </Popover>
- <Share2 onClick={onCopyUrlHandler} size="md" />
- {viewKey && (
- <Dropdown
- items={moreOptionItems}
- nativeButton
- align="end"
- side="bottom"
- >
- <Button type="text" size="small" icon={<Ellipsis size="md" />} />
- </Dropdown>
- )}
- </Space>
- </OffSetCol>
- </Row>
- </ExplorerCardHeadContainer>
- )}
-
- <div>{children}</div>
- </>
- );
-}
-
-export default ExplorerCard;
diff --git a/frontend/src/components/ExplorerCard/MenuItemGenerator.tsx b/frontend/src/components/ExplorerCard/MenuItemGenerator.tsx
deleted file mode 100644
index 9772658fe2..0000000000
--- a/frontend/src/components/ExplorerCard/MenuItemGenerator.tsx
+++ /dev/null
@@ -1,103 +0,0 @@
-import { MouseEvent, useCallback } from 'react';
-import { Trash2 } from '@signozhq/icons';
-import { Col, Row, Tooltip } from 'antd';
-import { Typography } from '@signozhq/ui/typography';
-import { useQueryBuilder } from 'hooks/queryBuilder/useQueryBuilder';
-import { useDeleteView } from 'hooks/saveViews/useDeleteView';
-import { useHandleExplorerTabChange } from 'hooks/useHandleExplorerTabChange';
-import { useNotifications } from 'hooks/useNotifications';
-
-import { MenuItemContainer } from './styles';
-import { MenuItemLabelGeneratorProps } from './types';
-import {
- deleteViewHandler,
- getViewDetailsUsingViewKey,
- trimViewName,
-} from './utils';
-
-function MenuItemGenerator({
- viewName,
- viewKey,
- createdBy,
- uuid,
- viewData,
- refetchAllView,
- sourcePage,
-}: MenuItemLabelGeneratorProps): JSX.Element {
- const { panelType, redirectWithQueryBuilderData, updateAllQueriesOperators } =
- useQueryBuilder();
- const { handleExplorerTabChange } = useHandleExplorerTabChange();
-
- const { notifications } = useNotifications();
-
- const { mutateAsync: deleteViewAsync } = useDeleteView(uuid);
-
- const onDeleteHandler = (event: MouseEvent<SVGSVGElement>): void => {
- event.stopPropagation();
- deleteViewHandler({
- deleteViewAsync,
- notifications,
- panelType,
- redirectWithQueryBuilderData,
- refetchAllView,
- viewId: uuid,
- viewKey,
- updateAllQueriesOperators,
- sourcePage,
- });
- };
-
- const onMenuItemSelectHandler = useCallback(
- ({ key }: { key: string }): void => {
- const currentViewDetails = getViewDetailsUsingViewKey(key, viewData);
- if (!currentViewDetails) {
- return;
- }
- const { query, name, id, panelType: currentPanelType } = currentViewDetails;
-
- handleExplorerTabChange(currentPanelType, {
- query,
- viewName: name,
- viewKey: id,
- });
- },
- [viewData, handleExplorerTabChange],
- );
-
- const onLabelClickHandler = (): void => {
- onMenuItemSelectHandler({
- key: uuid,
- });
- };
-
- const newViewName = trimViewName(viewName);
-
- return (
- <MenuItemContainer onClick={onLabelClickHandler}>
- <Row justify="space-between">
- <Col span={22}>
- <Row>
- <Tooltip title={viewName}>
- <Typography.Text strong>{newViewName}</Typography.Text>
- </Tooltip>
- </Row>
- <Row>
- <Typography.Text color="muted">Created by {createdBy}</Typography.Text>
- </Row>
- </Col>
- <Col span={2}>
- <Typography.Link>
- <Trash2
- role="img"
- aria-label="Delete view"
- onClick={onDeleteHandler}
- size="md"
- />
- </Typography.Link>
- </Col>
- </Row>
- </MenuItemContainer>
- );
-}
-
-export default MenuItemGenerator;
diff --git a/frontend/src/components/ExplorerCard/SaveViewWithName.tsx b/frontend/src/components/ExplorerCard/SaveViewWithName.tsx
deleted file mode 100644
index 40273bae0c..0000000000
--- a/frontend/src/components/ExplorerCard/SaveViewWithName.tsx
+++ /dev/null
@@ -1,79 +0,0 @@
-import { useTranslation } from 'react-i18next';
-import { Input } from '@signozhq/ui/input';
-import { Card, Form } from 'antd';
-import { Typography } from '@signozhq/ui/typography';
-import { PANEL_TYPES } from 'constants/queryBuilder';
-import { useQueryBuilder } from 'hooks/queryBuilder/useQueryBuilder';
-import { useSaveView } from 'hooks/saveViews/useSaveView';
-import { useNotifications } from 'hooks/useNotifications';
-import { mapCompositeQueryFromQuery } from 'lib/newQueryBuilder/queryBuilderMappers/mapCompositeQueryFromQuery';
-
-import { SaveButton } from './styles';
-import { SaveViewFormProps, SaveViewWithNameProps } from './types';
-import { saveViewHandler } from './utils';
-
-function SaveViewWithName({
- sourcePage,
- handlePopOverClose,
- refetchAllView,
-}: SaveViewWithNameProps): JSX.Element {
- const [form] = Form.useForm<SaveViewFormProps>();
- const { t } = useTranslation(['explorer']);
- const { currentQuery, panelType, redirectWithQueryBuilderData } =
- useQueryBuilder();
- const { notifications } = useNotifications();
- const compositeQuery = mapCompositeQueryFromQuery(currentQuery, panelType);
-
- const { isLoading, mutateAsync: saveViewAsync } = useSaveView({
- viewName: form.getFieldValue('viewName'),
- compositeQuery,
- sourcePage,
- extraData: '',
- });
-
- const onSaveHandler = (): void => {
- saveViewHandler({
- compositeQuery,
- handlePopOverClose,
- extraData: '',
- notifications,
- panelType: panelType || PANEL_TYPES.LIST,
- redirectWithQueryBuilderData,
- refetchAllView,
- saveViewAsync,
- sourcePage,
- viewName: form.getFieldValue('viewName'),
- form,
- });
- };
-
- return (
- <Card>
- <Typography>{t('name_of_the_view')}</Typography>
- <Form form={form} onFinish={onSaveHandler} requiredMark>
- <Form.Item
- name={['viewName']}
- required
- rules={[
- {
- required: true,
- message: 'Please enter view name',
- },
- ]}
- >
- <Input placeholder="Enter Name" />
- </Form.Item>
- <SaveButton
- htmlType="submit"
- type="primary"
- loading={isLoading}
- data-testid="save-view-name-action-button"
- >
- Save
- </SaveButton>
- </Form>
- </Card>
- );
-}
-
-export default SaveViewWithName;
diff --git a/frontend/src/components/ExplorerCard/__mock__/viewData.ts b/frontend/src/components/ExplorerCard/__mock__/viewData.ts
deleted file mode 100644
index 9ba3bcdfd9..0000000000
--- a/frontend/src/components/ExplorerCard/__mock__/viewData.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-import { ICompositeMetricQuery } from 'types/api/alerts/compositeQuery';
-import { ViewProps } from 'types/api/saveViews/types';
-import { DataSource } from 'types/common/queryBuilder';
-
-export const viewMockData: ViewProps[] = [
- {
- id: 'view1',
- name: 'View 1',
- createdBy: 'User 1',
- category: 'category 1',
- compositeQuery: {} as ICompositeMetricQuery,
- createdAt: '2021-07-07T06:31:00.000Z',
- updatedAt: '2021-07-07T06:33:00.000Z',
- extraData: '',
- sourcePage: DataSource.TRACES,
- tags: [],
- updatedBy: 'User 1',
- },
- {
- id: 'view2',
- name: 'View 2',
- createdBy: 'User 2',
- category: 'category 2',
- compositeQuery: {} as ICompositeMetricQuery,
- createdAt: '2021-07-07T06:30:00.000Z',
- updatedAt: '2021-07-07T06:30:00.000Z',
- extraData: '',
- sourcePage: DataSource.TRACES,
- tags: [],
- updatedBy: 'User 2',
- },
-];
diff --git a/frontend/src/components/ExplorerCard/constants.ts b/frontend/src/components/ExplorerCard/constants.ts
deleted file mode 100644
index 8cc5887b41..0000000000
--- a/frontend/src/components/ExplorerCard/constants.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-export const ExploreHeaderToolTip = {
- url: 'https://signoz.io/docs/querying/overview/?utm_source=product&utm_medium=new-query-builder',
- text: 'More details on how to use query builder',
-};
-
-export const SaveButtonText = {
- SAVE_AS_NEW_VIEW: 'Save as new view',
- SAVE_VIEW: 'Save view',
-};
diff --git a/frontend/src/components/ExplorerCard/styles.ts b/frontend/src/components/ExplorerCard/styles.ts
deleted file mode 100644
index 56c3d38c75..0000000000
--- a/frontend/src/components/ExplorerCard/styles.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-import { Button, Card, Col } from 'antd';
-import styled, { CSSProperties } from 'styled-components';
-
-export const ExplorerCardHeadContainer = styled(Card)`
- margin: 1rem 0;
- padding: 0;
-`;
-
-export const OffSetCol = styled(Col)`
- text-align: right;
-`;
-
-export const SaveButton = styled(Button)`
- &&& {
- margin: 1rem 0;
- width: 5rem;
- }
-`;
-
-export const DropDownOverlay: CSSProperties = {
- maxHeight: '20rem',
- overflowY: 'auto',
- width: '20rem',
- padding: 0,
-};
-
-export const MenuItemContainer = styled(Card)`
- padding: 0;
-`;
diff --git a/frontend/src/components/ExplorerCard/test/ExplorerCard.test.tsx b/frontend/src/components/ExplorerCard/test/ExplorerCard.test.tsx
deleted file mode 100644
index 77bc316241..0000000000
--- a/frontend/src/components/ExplorerCard/test/ExplorerCard.test.tsx
+++ /dev/null
@@ -1,96 +0,0 @@
-import { render, screen } from '@testing-library/react';
-import ROUTES from 'constants/routes';
-import { PreferenceContextProvider } from 'providers/preferences/context/PreferenceContextProvider';
-import MockQueryClientProvider from 'providers/test/MockQueryClientProvider';
-import { DataSource } from 'types/common/queryBuilder';
-
-import { viewMockData } from '../__mock__/viewData';
-import ExplorerCard from '../ExplorerCard';
-
-const historyReplace = jest.fn();
-
-jest.mock('react-router-dom', () => ({
- ...jest.requireActual('react-router-dom'),
- useLocation: (): { pathname: string } => ({
- pathname: `${process.env.FRONTEND_API_ENDPOINT}/${ROUTES.TRACES_EXPLORER}/`,
- }),
- useHistory: (): any => ({
- ...jest.requireActual('react-router-dom').useHistory(),
- replace: historyReplace,
- }),
-}));
-
-jest.mock('hooks/useSafeNavigate', () => ({
- useSafeNavigate: (): any => ({
- safeNavigate: jest.fn(),
- }),
-}));
-
-jest.mock('hooks/queryBuilder/useGetPanelTypesQueryParam', () => ({
- useGetPanelTypesQueryParam: jest.fn(() => 'mockedPanelType'),
-}));
-
-jest.mock('hooks/saveViews/useGetAllViews', () => ({
- useGetAllViews: jest.fn(() => ({
- data: { data: { data: viewMockData } },
- isLoading: false,
- error: null,
- isRefetching: false,
- refetch: jest.fn(),
- })),
-}));
-
-jest.mock('hooks/saveViews/useUpdateView', () => ({
- useUpdateView: jest.fn(() => ({
- mutateAsync: jest.fn(),
- })),
-}));
-
-jest.mock('hooks/saveViews/useDeleteView', () => ({
- useDeleteView: jest.fn(() => ({
- mutateAsync: jest.fn(),
- })),
-}));
-
-// Mock usePreferenceSync
-jest.mock('providers/preferences/sync/usePreferenceSync', () => ({
- usePreferenceSync: (): any => ({
- preferences: {
- columns: [],
- formatting: {
- maxLines: 1,
- format: 'table',
- fontSize: 'small',
- version: 1,
- },
- },
- loading: false,
- error: null,
- updateColumns: jest.fn(),
- updateFormatting: jest.fn(),
- }),
-}));
-
-describe('ExplorerCard', () => {
- it('renders a card with a title and a description', () => {
- render(
- <MockQueryClientProvider>
- <PreferenceContextProvider>
- <ExplorerCard sourcepage={DataSource.TRACES}>child</ExplorerCard>
- </PreferenceContextProvider>
- </MockQueryClientProvider>,
- );
- expect(screen.queryByText('Query Builder')).not.toBeInTheDocument();
- });
-
- it('renders a save view button', () => {
- render(
- <MockQueryClientProvider>
- <PreferenceContextProvider>
- <ExplorerCard sourcepage={DataSource.TRACES}>child</ExplorerCard>
- </PreferenceContextProvider>
- </MockQueryClientProvider>,
- );
- expect(screen.queryByText('Save view')).not.toBeInTheDocument();
- });
-});
diff --git a/frontend/src/components/ExplorerCard/test/MenuItemGenerator.test.tsx b/frontend/src/components/ExplorerCard/test/MenuItemGenerator.test.tsx
deleted file mode 100644
index 3e3d6954c4..0000000000
--- a/frontend/src/components/ExplorerCard/test/MenuItemGenerator.test.tsx
+++ /dev/null
@@ -1,63 +0,0 @@
-import { render, screen } from '@testing-library/react';
-import ROUTES from 'constants/routes';
-import MockQueryClientProvider from 'providers/test/MockQueryClientProvider';
-import { DataSource } from 'types/common/queryBuilder';
-
-import { viewMockData } from '../__mock__/viewData';
-import MenuItemGenerator from '../MenuItemGenerator';
-
-jest.mock('react-router-dom', () => ({
- ...jest.requireActual('react-router-dom'),
- useLocation: (): { pathname: string } => ({
- pathname: `${process.env.FRONTEND_API_ENDPOINT}${ROUTES.APPLICATION}/`,
- }),
-}));
-
-jest.mock('antd', () => ({
- ...jest.requireActual('antd'),
- useForm: jest.fn().mockReturnValue({
- onFinish: jest.fn(),
- }),
-}));
-
-describe('MenuItemGenerator', () => {
- it('should render MenuItemGenerator component', () => {
- const screen = render(
- <MockQueryClientProvider>
- <MenuItemGenerator
- viewName={viewMockData[0].name}
- viewKey={viewMockData[0].id}
- createdBy={viewMockData[0].createdBy}
- uuid={viewMockData[0].id}
- refetchAllView={jest.fn()}
- viewData={viewMockData}
- sourcePage={DataSource.TRACES}
- />
- </MockQueryClientProvider>,
- );
-
- expect(screen.getByText(viewMockData[0].name)).toBeInTheDocument();
- });
-
- it('should call onMenuItemSelectHandler on click of MenuItemGenerator', () => {
- render(
- <MockQueryClientProvider>
- <MenuItemGenerator
- viewName={viewMockData[0].name}
- viewKey={viewMockData[0].id}
- createdBy={viewMockData[0].createdBy}
- uuid={viewMockData[0].id}
- refetchAllView={jest.fn()}
- viewData={viewMockData}
- sourcePage={DataSource.TRACES}
- />
- </MockQueryClientProvider>,
- );
-
- const spanElement = screen.getByRole('img', {
- name: /delete view/i,
- });
-
- expect(spanElement).toBeInTheDocument();
- });
-});
diff --git a/frontend/src/components/ExplorerCard/test/SaveViewWithName.test.tsx b/frontend/src/components/ExplorerCard/test/SaveViewWithName.test.tsx
deleted file mode 100644
index 0ccb51a18d..0000000000
--- a/frontend/src/components/ExplorerCard/test/SaveViewWithName.test.tsx
+++ /dev/null
@@ -1,63 +0,0 @@
-import { QueryClient, QueryClientProvider } from 'react-query';
-import { fireEvent, render } from '@testing-library/react';
-import ROUTES from 'constants/routes';
-import { DataSource } from 'types/common/queryBuilder';
-
-import SaveViewWithName from '../SaveViewWithName';
-
-jest.mock('react-router-dom', () => ({
- ...jest.requireActual('react-router-dom'),
- useLocation: (): { pathname: string } => ({
- pathname: `${process.env.FRONTEND_API_ENDPOINT}${ROUTES.APPLICATION}/`,
- }),
-}));
-
-const queryClient = new QueryClient({
- defaultOptions: {
- queries: {
- refetchOnWindowFocus: false,
- },
- },
-});
-
-jest.mock('hooks/queryBuilder/useGetPanelTypesQueryParam', () => ({
- useGetPanelTypesQueryParam: jest.fn(() => 'mockedPanelType'),
-}));
-
-jest.mock('hooks/saveViews/useSaveView', () => ({
- useSaveView: jest.fn(() => ({
- mutateAsync: jest.fn(),
- })),
-}));
-
-describe('SaveViewWithName', () => {
- it('should render SaveViewWithName component', () => {
- const screen = render(
- <QueryClientProvider client={queryClient}>
- <SaveViewWithName
- sourcePage={DataSource.TRACES}
- handlePopOverClose={jest.fn()}
- refetchAllView={jest.fn()}
- />
- </QueryClientProvider>,
- );
-
- expect(screen.getByText('Save')).toBeInTheDocument();
- });
-
- it('should call saveViewAsync on click of Save button', () => {
- const screen = render(
- <QueryClientProvider client={queryClient}>
- <SaveViewWithName
- sourcePage={DataSource.TRACES}
- handlePopOverClose={jest.fn()}
- refetchAllView={jest.fn()}
- />
- </QueryClientProvider>,
- );
-
- fireEvent.click(screen.getByText('Save'));
-
- expect(screen.getByText('Save')).toBeInTheDocument();
- });
-});
diff --git a/frontend/src/components/ExplorerCard/types.ts b/frontend/src/components/ExplorerCard/types.ts
deleted file mode 100644
index e7b3052de9..0000000000
--- a/frontend/src/components/ExplorerCard/types.ts
+++ /dev/null
@@ -1,92 +0,0 @@
-import { UseMutateAsyncFunction } from 'react-query';
-import { FormInstance } from 'antd';
-import type { NotificationInstance } from 'antd/es/notification/interface';
-import { AxiosResponse } from 'axios';
-import { PANEL_TYPES } from 'constants/queryBuilder';
-import { OptionsQuery } from 'container/OptionsMenu/types';
-import { ICompositeMetricQuery } from 'types/api/alerts/compositeQuery';
-import { Query } from 'types/api/queryBuilder/queryBuilderData';
-import {
- DeleteViewPayloadProps,
- SaveViewPayloadProps,
- SaveViewProps,
- ViewProps,
-} from 'types/api/saveViews/types';
-import { DataSource, QueryBuilderContextType } from 'types/common/queryBuilder';
-
-export interface ExplorerCardProps {
- sourcepage: DataSource;
- children: React.ReactNode;
-}
-
-export type GetViewDetailsUsingViewKey = (
- viewKey: string,
- data: ViewProps[] | undefined,
-) =>
- | {
- query: Query;
- name: string;
- id: string;
- panelType: PANEL_TYPES;
- extraData?: string;
- }
- | undefined;
-
-export interface IsQueryUpdatedInViewProps {
- viewKey: string;
- data: ViewProps[] | undefined;
- stagedQuery: Query | null;
- currentPanelType: PANEL_TYPES | null;
- options: OptionsQuery;
-}
-
-export interface SaveViewWithNameProps {
- sourcePage: ExplorerCardProps['sourcepage'];
- handlePopOverClose: VoidFunction;
- refetchAllView: VoidFunction;
-}
-
-export interface SaveViewFormProps {
- viewName: string;
-}
-
-export interface MenuItemLabelGeneratorProps {
- viewName: string;
- viewKey: string;
- createdBy: string;
- uuid: string;
- viewData: ViewProps[];
- refetchAllView: VoidFunction;
- sourcePage: ExplorerCardProps['sourcepage'];
-}
-
-export interface SaveViewHandlerProps {
- viewName: string;
- compositeQuery: ICompositeMetricQuery;
- sourcePage: ExplorerCardProps['sourcepage'];
- extraData: string;
- panelType: PANEL_TYPES | null;
- notifications: NotificationInstance;
- refetchAllView: SaveViewWithNameProps['refetchAllView'];
- saveViewAsync: UseMutateAsyncFunction<
- AxiosResponse<SaveViewPayloadProps>,
- Error,
- SaveViewProps,
- SaveViewPayloadProps
- >;
- handlePopOverClose: SaveViewWithNameProps['handlePopOverClose'];
- redirectWithQueryBuilderData: QueryBuilderContextType['redirectWithQueryBuilderData'];
- form: FormInstance<SaveViewFormProps>;
-}
-
-export interface DeleteViewHandlerProps {
- deleteViewAsync: UseMutateAsyncFunction<DeleteViewPayloadProps, Error, string>;
- refetchAllView: MenuItemLabelGeneratorProps['refetchAllView'];
- redirectWithQueryBuilderData: QueryBuilderContextType['redirectWithQueryBuilderData'];
- notifications: NotificationInstance;
- panelType: PANEL_TYPES | null;
- viewKey: string;
- viewId: string;
- updateAllQueriesOperators: QueryBuilderContextType['updateAllQueriesOperators'];
- sourcePage: ExplorerCardProps['sourcepage'];
-}
diff --git a/frontend/src/components/ExplorerCard/utils.ts b/frontend/src/components/ExplorerCard/utils.ts
deleted file mode 100644
index e4367f4e1b..0000000000
--- a/frontend/src/components/ExplorerCard/utils.ts
+++ /dev/null
@@ -1,204 +0,0 @@
-import type { NotificationInstance } from 'antd/es/notification/interface';
-import axios from 'axios';
-import { SOMETHING_WENT_WRONG } from 'constants/api';
-import { QueryParams } from 'constants/query';
-import { initialQueriesMap, PANEL_TYPES } from 'constants/queryBuilder';
-import { mapQueryDataFromApi } from 'lib/newQueryBuilder/queryBuilderMappers/mapQueryDataFromApi';
-import isEqual from 'lodash-es/isEqual';
-import { Query } from 'types/api/queryBuilder/queryBuilderData';
-import { DataSource } from 'types/common/queryBuilder';
-
-import {
- DeleteViewHandlerProps,
- GetViewDetailsUsingViewKey,
- IsQueryUpdatedInViewProps,
- SaveViewHandlerProps,
-} from './types';
-
-export const showErrorNotification = (
- notifications: NotificationInstance,
- err: Error,
-): void => {
- notifications.error({
- message: axios.isAxiosError(err) ? err.message : SOMETHING_WENT_WRONG,
- });
-};
-
-export const getViewDetailsUsingViewKey: GetViewDetailsUsingViewKey = (
- viewKey,
- data,
-) => {
- const selectedView = data?.find((view) => view.id === viewKey);
- if (selectedView) {
- const { compositeQuery, name, id, extraData } = selectedView;
- const query = mapQueryDataFromApi(compositeQuery);
- return { query, name, id, panelType: compositeQuery.panelType, extraData };
- }
- return undefined;
-};
-
-export const omitIdFromQuery = (query: Query | null): any => ({
- ...query,
- builder: {
- ...query?.builder,
- queryData: query?.builder.queryData.map((queryData) => {
- const { id: _aggregateAttributeId, ...rest } =
- queryData.aggregateAttribute || {};
- const newAggregateAttribute = rest;
- const newGroupByAttributes = queryData.groupBy.map((groupByAttribute) => {
- const { id: _groupByAttributeId, ...rest } = groupByAttribute;
- return rest;
- });
- const newItems = queryData.filters?.items?.map((item) => {
- const { id: _itemId, ...newItem } = item;
- if (item.key) {
- const { id: _keyId, ...rest } = item.key;
- return {
- ...newItem,
- key: rest,
- };
- }
- return newItem;
- });
- return {
- ...queryData,
- aggregateAttribute: newAggregateAttribute,
- groupBy: newGroupByAttributes,
- filters: {
- ...queryData.filters,
- items: newItems,
- },
- limit: queryData.limit ? queryData.limit : 0,
- offset: queryData.offset ? queryData.offset : 0,
- pageSize: queryData.pageSize ? queryData.pageSize : 0,
- };
- }),
- },
-});
-
-export const isQueryUpdatedInView = ({
- viewKey,
- data,
- stagedQuery,
- currentPanelType,
- options,
-}: IsQueryUpdatedInViewProps): boolean => {
- const currentViewDetails = getViewDetailsUsingViewKey(viewKey, data);
- if (!currentViewDetails) {
- return false;
- }
- const { query, panelType, extraData } = currentViewDetails;
-
- // Omitting id from aggregateAttribute and groupBy
- const updatedCurrentQuery = omitIdFromQuery(stagedQuery);
-
- if (
- updatedCurrentQuery?.builder === undefined ||
- updatedCurrentQuery.clickhouse_sql === undefined ||
- updatedCurrentQuery.promql === undefined
- ) {
- return false;
- }
- return (
- panelType !== currentPanelType ||
- !isEqual(query.builder, updatedCurrentQuery?.builder) ||
- !isEqual(query.clickhouse_sql, updatedCurrentQuery?.clickhouse_sql) ||
- !isEqual(query.promql, updatedCurrentQuery?.promql) ||
- !isEqual(
- options?.selectColumns,
- extraData && JSON.parse(extraData)?.selectColumns,
- ) ||
- (stagedQuery?.builder?.queryData?.[0]?.dataSource === DataSource.LOGS &&
- (!isEqual(options?.format, extraData && JSON.parse(extraData)?.format) ||
- !isEqual(options?.maxLines, extraData && JSON.parse(extraData)?.maxLines) ||
- !isEqual(options?.fontSize, extraData && JSON.parse(extraData)?.fontSize)))
- );
-};
-
-export const saveViewHandler = ({
- saveViewAsync,
- refetchAllView,
- notifications,
- handlePopOverClose,
- viewName,
- compositeQuery,
- sourcePage,
- extraData,
- redirectWithQueryBuilderData,
- panelType,
- form,
-}: SaveViewHandlerProps): void => {
- saveViewAsync(
- {
- viewName,
- compositeQuery,
- sourcePage,
- extraData,
- },
- {
- onSuccess: (data) => {
- refetchAllView();
- redirectWithQueryBuilderData(mapQueryDataFromApi(compositeQuery), {
- [QueryParams.panelTypes]: panelType,
- [QueryParams.viewName]: viewName,
- [QueryParams.viewKey]: data.data.data,
- });
- notifications.success({
- message: 'View Saved Successfully',
- });
- },
- onError: (err) => {
- showErrorNotification(notifications, err);
- },
- onSettled: () => {
- handlePopOverClose();
- form.resetFields();
- },
- },
- );
-};
-
-export const deleteViewHandler = ({
- deleteViewAsync,
- refetchAllView,
- redirectWithQueryBuilderData,
- notifications,
- panelType,
- viewKey,
- viewId,
- updateAllQueriesOperators,
- sourcePage,
-}: DeleteViewHandlerProps): void => {
- deleteViewAsync(viewKey, {
- onSuccess: () => {
- if (viewId === viewKey) {
- redirectWithQueryBuilderData(
- updateAllQueriesOperators(
- initialQueriesMap[sourcePage],
- panelType || PANEL_TYPES.LIST,
- sourcePage,
- ),
- {
- [QueryParams.viewName]: '',
- [QueryParams.panelTypes]: panelType,
- [QueryParams.viewKey]: '',
- },
- );
- }
- notifications.success({
- message: 'View Deleted Successfully',
- });
- refetchAllView();
- },
- onError: (err) => {
- showErrorNotification(notifications, err);
- },
- });
-};
-
-export const trimViewName = (viewName: string): string => {
- if (viewName.length > 20) {
- return `${viewName.substring(0, 20)}...`;
- }
- return viewName;
-};
diff --git a/frontend/src/components/LogDetail/LogDetail.interfaces.ts b/frontend/src/components/LogDetail/LogDetail.interfaces.ts
index 314937008d..5b145141ec 100644
--- a/frontend/src/components/LogDetail/LogDetail.interfaces.ts
+++ b/frontend/src/components/LogDetail/LogDetail.interfaces.ts
@@ -1,5 +1,5 @@
import { DrawerProps } from 'antd';
-import { ChangeViewFunctionType } from 'container/ExplorerOptions/types';
+import { ChangeViewFunctionType } from 'hooks/useHandleExplorerTabChange';
import { IField } from 'types/api/logs/fields';
import { ILog } from 'types/api/logs/log';
diff --git a/frontend/src/components/Logs/ListLogView/index.tsx b/frontend/src/components/Logs/ListLogView/index.tsx
index c3575f3057..d597817fb7 100644
--- a/frontend/src/components/Logs/ListLogView/index.tsx
+++ b/frontend/src/components/Logs/ListLogView/index.tsx
@@ -4,7 +4,7 @@ import { Typography } from '@signozhq/ui/typography';
import cx from 'classnames';
import { VIEW_TYPES } from 'components/LogDetail/constants';
import { DATE_TIME_FORMATS } from 'constants/dateTimeFormats';
-import { ChangeViewFunctionType } from 'container/ExplorerOptions/types';
+import { ChangeViewFunctionType } from 'hooks/useHandleExplorerTabChange';
import {
getBodyDisplayString,
getSanitizedLogBody,
diff --git a/frontend/src/components/Logs/RawLogView/types.ts b/frontend/src/components/Logs/RawLogView/types.ts
index 331aef8b88..3781b2833e 100644
--- a/frontend/src/components/Logs/RawLogView/types.ts
+++ b/frontend/src/components/Logs/RawLogView/types.ts
@@ -1,6 +1,6 @@
import { MouseEvent } from 'react';
import { VIEW_TYPES } from 'components/LogDetail/constants';
-import { ChangeViewFunctionType } from 'container/ExplorerOptions/types';
+import { ChangeViewFunctionType } from 'hooks/useHandleExplorerTabChange';
import { FontSize } from 'container/OptionsMenu/types';
import { IField } from 'types/api/logs/fields';
import { ILog } from 'types/api/logs/log';
diff --git a/frontend/src/components/QueryBuilderV2/QueryV2/__tests__/QueryV2.test.tsx b/frontend/src/components/QueryBuilderV2/QueryV2/__tests__/QueryV2.test.tsx
index 25fb020443..101e62511c 100644
--- a/frontend/src/components/QueryBuilderV2/QueryV2/__tests__/QueryV2.test.tsx
+++ b/frontend/src/components/QueryBuilderV2/QueryV2/__tests__/QueryV2.test.tsx
@@ -130,7 +130,6 @@ describe('QueryBuilderV2 + QueryV2 - base render', () => {
updateAllQueriesOperators,
updateQueriesData,
initQueryBuilderData: jest.fn(),
- isStagedQueryUpdated: jest.fn(() => false),
isDefaultQuery: jest.fn(() => false),
} as unknown as QueryBuilderContextType;
diff --git a/frontend/src/components/QueryBuilderV2/__tests__/QueryBuilder.PrevQuery.test.tsx b/frontend/src/components/QueryBuilderV2/__tests__/QueryBuilder.PrevQuery.test.tsx
index b3df1a5f0e..aad79fcb4f 100644
--- a/frontend/src/components/QueryBuilderV2/__tests__/QueryBuilder.PrevQuery.test.tsx
+++ b/frontend/src/components/QueryBuilderV2/__tests__/QueryBuilder.PrevQuery.test.tsx
@@ -136,7 +136,6 @@ describe('MetricsSelect - signal source switching (standalone)', () => {
updateAllQueriesOperators: ((q: any) => q) as any,
updateQueriesData: ((q: any) => q) as any,
initQueryBuilderData: jest.fn(),
- isStagedQueryUpdated: jest.fn(() => false),
isDefaultQuery: jest.fn(() => false),
});
});
@@ -293,7 +292,6 @@ describe('DataSource change - Logs to Traces', () => {
updateAllQueriesOperators: ((q: any) => q) as any,
updateQueriesData: ((q: any) => q) as any,
initQueryBuilderData: jest.fn(),
- isStagedQueryUpdated: jest.fn(() => false),
isDefaultQuery: jest.fn(() => false),
});
});
diff --git a/frontend/src/components/QuickFilters/QuickFiltersLayout/QuickFiltersLayout.tsx b/frontend/src/components/QuickFilters/QuickFiltersLayout/QuickFiltersLayout.tsx
index 35c52a9d84..694e1a1328 100644
--- a/frontend/src/components/QuickFilters/QuickFiltersLayout/QuickFiltersLayout.tsx
+++ b/frontend/src/components/QuickFilters/QuickFiltersLayout/QuickFiltersLayout.tsx
@@ -5,7 +5,6 @@ import OverlayScrollbar from 'components/OverlayScrollbar/OverlayScrollbar';
import SavedViewsHeader from 'container/SavedViews/SavedViewsHeader';
import SavedViewsPanel from 'container/SavedViews/SavedViewsPanel';
import SavedViewsRestore from 'container/SavedViews/SavedViewsRestore';
-import { useSavedViewEnabled } from 'hooks/useSavedViewEnabled';
import QuickFilters from '../QuickFilters';
import { SIDEBAR_TOOLTIP_DELAY_MS } from './constants';
@@ -50,10 +49,9 @@ function QuickFiltersLayout({
children,
}: QuickFiltersLayoutProps): JSX.Element {
const [isViewsListOpen, setIsViewsListOpen] = useState(false);
- const isSavedViewEnabled = useSavedViewEnabled();
const hasQuickFilters = !!quickFilterProps;
- const hasSavedViews = !!savedViewProps && isSavedViewEnabled;
+ const hasSavedViews = !!savedViewProps;
const showSidebar = showFilters && (hasQuickFilters || hasSavedViews);
diff --git a/frontend/src/components/QuickFilters/QuickFiltersLayout/__tests__/QuickFiltersLayout.test.tsx b/frontend/src/components/QuickFilters/QuickFiltersLayout/__tests__/QuickFiltersLayout.test.tsx
index 408175d776..835e60f380 100644
--- a/frontend/src/components/QuickFilters/QuickFiltersLayout/__tests__/QuickFiltersLayout.test.tsx
+++ b/frontend/src/components/QuickFilters/QuickFiltersLayout/__tests__/QuickFiltersLayout.test.tsx
@@ -1,6 +1,5 @@
import { Button } from '@signozhq/ui/button';
import { SavedviewtypesSourceDTO } from 'api/generated/services/sigNoz.schemas';
-import { useSavedViewEnabled } from 'hooks/useSavedViewEnabled';
import { render, screen, userEvent, waitFor } from 'tests/test-utils';
import { QuickFiltersSource } from '../../types';
@@ -20,10 +19,6 @@ jest.mock('../QuickFiltersLayout.module.scss', () => ({
},
}));
-jest.mock('hooks/useSavedViewEnabled', () => ({
- useSavedViewEnabled: jest.fn(() => true),
-}));
-
jest.mock('container/SavedViews/SavedViewsRestore', () => ({
__esModule: true,
default: ({ source }: { source: string }): JSX.Element => (
@@ -71,10 +66,6 @@ const drawer = (): HTMLElement =>
screen.getByTestId('quick-filters-layout-drawer');
describe('QuickFiltersLayout', () => {
- beforeEach(() => {
- jest.mocked(useSavedViewEnabled).mockReturnValue(true);
- });
-
it('renders QuickFilters with the given props inside the filters pane', () => {
render(
<QuickFiltersLayout showFilters quickFilterProps={quickFilterProps}>
@@ -149,35 +140,6 @@ describe('QuickFiltersLayout', () => {
});
describe('saved views', () => {
- it('ignores savedViewProps while the flag is off', () => {
- jest.mocked(useSavedViewEnabled).mockReturnValue(false);
- const { unmount } = render(
- <QuickFiltersLayout
- showFilters
- quickFilterProps={quickFilterProps}
- savedViewProps={savedViewProps}
- >
- <div>content</div>
- </QuickFiltersLayout>,
- );
-
- expect(screen.getByTestId('quick-filters')).toBeInTheDocument();
- expect(screen.queryByTestId('saved-views-header')).not.toBeInTheDocument();
- expect(screen.queryByTestId('saved-views-panel')).not.toBeInTheDocument();
-
- // Saved views only, so nothing is left to show.
- unmount();
- render(
- <QuickFiltersLayout showFilters savedViewProps={savedViewProps}>
- <div>content</div>
- </QuickFiltersLayout>,
- );
- expect(
- screen.queryByTestId('quick-filters-layout-filters'),
- ).not.toBeInTheDocument();
- expect(screen.queryByTestId('saved-views-restore')).not.toBeInTheDocument();
- });
-
it('opens the panel from the header and slides the quick filters drawer, keeping the same QuickFilters node', async () => {
render(
<QuickFiltersLayout
diff --git a/frontend/src/constants/localStorage.ts b/frontend/src/constants/localStorage.ts
index 9a5088b595..b856ded541 100644
--- a/frontend/src/constants/localStorage.ts
+++ b/frontend/src/constants/localStorage.ts
@@ -21,7 +21,6 @@ export enum LOCALSTORAGE {
CHAT_SUPPORT = 'CHAT_SUPPORT',
IS_IDENTIFIED_USER = 'IS_IDENTIFIED_USER',
DASHBOARD_VARIABLES = 'DASHBOARD_VARIABLES',
- SHOW_EXPLORER_TOOLBAR = 'SHOW_EXPLORER_TOOLBAR',
PINNED_ATTRIBUTES = 'PINNED_ATTRIBUTES',
THEME_ANALYTICS_V1 = 'THEME_ANALYTICS_V1',
LAST_USED_SAVED_VIEWS = 'LAST_USED_SAVED_VIEWS',
@@ -47,5 +46,4 @@ export enum LOCALSTORAGE {
DASHBOARDS_LIST_VIEWS = 'DASHBOARDS_LIST_VIEWS',
DASHBOARD_V2_PANEL_COLUMN_WIDTHS = 'DASHBOARD_V2_PANEL_COLUMN_WIDTHS',
LLM_ATTRIBUTE_MAPPING_TEST_SPAN = 'LLM_ATTRIBUTE_MAPPING_TEST_SPAN',
- SAVED_VIEW_ENABLED = 'SAVED_VIEW_ENABLED',
}
diff --git a/frontend/src/constants/routes.ts b/frontend/src/constants/routes.ts
index c5633a2e12..f1cec24dbd 100644
--- a/frontend/src/constants/routes.ts
+++ b/frontend/src/constants/routes.ts
@@ -50,8 +50,6 @@ const ROUTES = {
ROLE_EDIT: '/settings/roles/:roleId/edit',
MEMBERS_SETTINGS: '/settings/members',
SUPPORT: '/support',
- LOGS_SAVE_VIEWS: '/logs/saved-views',
- TRACES_SAVE_VIEWS: '/traces/saved-views',
TRACES_FUNNELS: '/traces/funnels',
TRACES_FUNNELS_DETAIL: '/traces/funnels/:funnelId',
WORKSPACE_LOCKED: '/workspace-locked',
@@ -69,7 +67,6 @@ const ROUTES = {
MESSAGING_QUEUES_OVERVIEW: '/messaging-queues/overview',
METRICS_EXPLORER: '/metrics-explorer/summary',
METRICS_EXPLORER_EXPLORER: '/metrics-explorer/explorer',
- METRICS_EXPLORER_VIEWS: '/metrics-explorer/views',
METRICS_EXPLORER_VOLUME_CONTROL: '/metrics-explorer/volume-control',
API_MONITORING_BASE: '/api-monitoring',
API_MONITORING: '/api-monitoring/explorer',
@@ -77,7 +74,6 @@ const ROUTES = {
WORKSPACE_ACCESS_RESTRICTED: '/workspace-access-restricted',
METER: '/meter',
METER_EXPLORER: '/meter/explorer',
- METER_EXPLORER_VIEWS: '/meter/explorer/views',
HOME_PAGE: '/',
PUBLIC_DASHBOARD: '/public/dashboard/:dashboardId',
SERVICE_ACCOUNTS_SETTINGS: '/settings/service-accounts',
diff --git a/frontend/src/container/AIAssistant/AIAssistantTrigger/AIAssistantTrigger.module.scss b/frontend/src/container/AIAssistant/AIAssistantTrigger/AIAssistantTrigger.module.scss
deleted file mode 100644
index dd1c2d18d9..0000000000
--- a/frontend/src/container/AIAssistant/AIAssistantTrigger/AIAssistantTrigger.module.scss
+++ /dev/null
@@ -1,15 +0,0 @@
-.trigger {
- position: absolute;
- bottom: 24px;
- right: 24px;
- z-index: 10;
- transition: transform 0.15s;
-
- &:hover {
- transform: scale(1.08);
- }
-
- &:active {
- transform: scale(0.96);
- }
-}
diff --git a/frontend/src/container/AIAssistant/AIAssistantTrigger/AIAssistantTrigger.tsx b/frontend/src/container/AIAssistant/AIAssistantTrigger/AIAssistantTrigger.tsx
deleted file mode 100644
index 2952ca574e..0000000000
--- a/frontend/src/container/AIAssistant/AIAssistantTrigger/AIAssistantTrigger.tsx
+++ /dev/null
@@ -1,61 +0,0 @@
-import { useCallback } from 'react';
-import { matchPath, useLocation } from 'react-router-dom';
-import { Button } from '@signozhq/ui/button';
-import { Tooltip } from '@signozhq/ui/tooltip';
-import logEvent from 'api/common/logEvent';
-import ROUTES from 'constants/routes';
-import Noz from 'components/Noz/Noz';
-import { NOZ_TOOLTIP_TITLE } from 'components/Noz/Noz.constants';
-
-import { AIAssistantEvents, AIAssistantOpenSource } from '../events';
-import { normalizePage } from '../hooks/useAIAssistantAnalyticsContext';
-import {
- openAIAssistant,
- useAIAssistantStore,
-} from '../store/useAIAssistantStore';
-
-import styles from './AIAssistantTrigger.module.scss';
-
-/**
- * Floating action button anchored to the bottom-right of the content area.
- * Hidden when the panel is already open or when on the full-screen AI Assistant page.
- */
-export default function AIAssistantTrigger(): JSX.Element | null {
- const { pathname } = useLocation();
- const isDrawerOpen = useAIAssistantStore((s) => s.isDrawerOpen);
- const isModalOpen = useAIAssistantStore((s) => s.isModalOpen);
-
- const isFullScreenPage = !!matchPath(pathname, {
- path: ROUTES.AI_ASSISTANT,
- exact: true,
- });
-
- const handleOpen = useCallback((): void => {
- void logEvent(AIAssistantEvents.Opened, {
- source: AIAssistantOpenSource.Icon,
- currentPage: normalizePage(pathname),
- });
- openAIAssistant();
- }, [pathname]);
-
- if (isDrawerOpen || isModalOpen || isFullScreenPage) {
- return null;
- }
-
- return (
- <div className={`${styles.trigger} noz-wave`}>
- <Tooltip title={NOZ_TOOLTIP_TITLE}>
- <Button
- size="md"
- variant="solid"
- color="primary"
- icon
- onClick={handleOpen}
- aria-label="Open Noz"
- >
- <Noz size={24} />
- </Button>
- </Tooltip>
- </div>
- );
-}
diff --git a/frontend/src/container/AIAssistant/AIAssistantTrigger/index.ts b/frontend/src/container/AIAssistant/AIAssistantTrigger/index.ts
deleted file mode 100644
index 9acfdd4625..0000000000
--- a/frontend/src/container/AIAssistant/AIAssistantTrigger/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from './AIAssistantTrigger';
-export { default } from './AIAssistantTrigger';
diff --git a/frontend/src/container/AIAssistant/__tests__/resolvePageType.test.ts b/frontend/src/container/AIAssistant/__tests__/resolvePageType.test.ts
index 0e8004825d..f6697a2a0b 100644
--- a/frontend/src/container/AIAssistant/__tests__/resolvePageType.test.ts
+++ b/frontend/src/container/AIAssistant/__tests__/resolvePageType.test.ts
@@ -102,7 +102,7 @@ describe('resolvePageType', () => {
expect(resolvePageType(ROUTES.METRICS_EXPLORER_EXPLORER, '')).toBe(
PageTypeDTO.metrics_explorer,
);
- expect(resolvePageType(ROUTES.METRICS_EXPLORER_VIEWS, '')).toBe(
+ expect(resolvePageType('/metrics-explorer/views', '')).toBe(
PageTypeDTO.metrics_explorer,
);
});
diff --git a/frontend/src/container/AIAssistant/components/ActionsSection/utils/__tests__/openSavedView.test.ts b/frontend/src/container/AIAssistant/components/ActionsSection/utils/__tests__/openSavedView.test.ts
index 5c54d6c354..9f7351d40a 100644
--- a/frontend/src/container/AIAssistant/components/ActionsSection/utils/__tests__/openSavedView.test.ts
+++ b/frontend/src/container/AIAssistant/components/ActionsSection/utils/__tests__/openSavedView.test.ts
@@ -235,7 +235,6 @@ describe('buildExplorerNavigationUrl', () => {
{ queryType: 'builder' } as never,
{
[QueryParams.panelTypes]: PANEL_TYPES.LIST,
- [QueryParams.viewName]: 'My view',
[QueryParams.viewKey]: 'view-1',
},
);
@@ -259,7 +258,7 @@ describe('openSavedView', () => {
expect(pushedUrl).toContain(ROUTES.LOGS_EXPLORER);
const params = new URLSearchParams(pushedUrl.split('?')[1]);
expect(params.get(QueryParams.viewKey)).toBe('"view-logs"');
- expect(params.get(QueryParams.viewName)).toBe('"View view-logs"');
+ expect(params.get(QueryParams.viewName)).toBeNull();
expect(params.get(QueryParams.panelTypes)).toBe('"list"');
});
diff --git a/frontend/src/container/AIAssistant/components/ActionsSection/utils/openSavedView.ts b/frontend/src/container/AIAssistant/components/ActionsSection/utils/openSavedView.ts
index 964d11091d..a0b50731a2 100644
--- a/frontend/src/container/AIAssistant/components/ActionsSection/utils/openSavedView.ts
+++ b/frontend/src/container/AIAssistant/components/ActionsSection/utils/openSavedView.ts
@@ -9,7 +9,7 @@ import { SavedViewSourcePage } from 'container/SavedViews/types';
import { findSavedView } from 'container/SavedViews/utils/findSavedView';
import { getSavedViewQuery } from 'container/SavedViews/utils/getSavedViewQuery';
import { toSavedViewSource } from 'container/SavedViews/utils/toSavedViewSource';
-import { SOURCEPAGE_VS_ROUTES } from 'pages/SaveView/constants';
+import { SOURCEPAGE_VS_ROUTES } from 'container/SavedViews/constants';
import { DataSource } from 'types/common/queryBuilder';
import { Query } from 'types/api/queryBuilder/queryBuilderData';
import { History } from 'history';
@@ -108,7 +108,6 @@ export function openSavedView(
const query = getSavedViewQuery(view);
const url = buildExplorerNavigationUrl(route, query, {
[QueryParams.panelTypes]: view.spec.panelType as unknown as PANEL_TYPES,
- [QueryParams.viewName]: view.spec.displayName,
[QueryParams.viewKey]: view.id,
});
history.push(url);
diff --git a/frontend/src/container/AIAssistant/getAutoContexts.ts b/frontend/src/container/AIAssistant/getAutoContexts.ts
index eada7b8884..83b1d7ffda 100644
--- a/frontend/src/container/AIAssistant/getAutoContexts.ts
+++ b/frontend/src/container/AIAssistant/getAutoContexts.ts
@@ -13,7 +13,7 @@ import { matchPath } from 'react-router-dom';
*
* **URL-only.** All inputs come from `pathname` + `search`; we never reach
* into Redux / context. SigNoz already encodes most page state into the URL
- * (`compositeQuery`, `startTime`/`endTime`, `viewName`/`viewKey`,
+ * (`compositeQuery`, `startTime`/`endTime`, `viewKey`,
* `variables`, `expandedWidgetId`, `activeLogId`, …), so URL parsing is
* sufficient. Anything not in the URL is simply omitted from `metadata` —
* the server applies its own defaults.
@@ -288,7 +288,7 @@ export function getAutoContexts(
// ── Metrics ───────────────────────────────────────────────────────────────
- // Metrics explorer — `/metrics-explorer` and sub-routes (summary, explorer, views).
+ // Metrics explorer — `/metrics-explorer` and sub-routes (summary, explorer).
if (
matchPath(pathname, { path: ROUTES.METRICS_EXPLORER_BASE, exact: false })
) {
@@ -361,10 +361,6 @@ function collectSharedMetadata(
if (viewKey) {
out.savedViewId = viewKey;
}
- const viewName = params.get(QueryParams.viewName);
- if (viewName) {
- out.savedViewName = viewName;
- }
const variablesRaw = params.get(QueryParams.variables);
if (variablesRaw) {
try {
diff --git a/frontend/src/container/AppLayout/AppLayout.styles.scss b/frontend/src/container/AppLayout/AppLayout.styles.scss
index 9da434d132..d9aee76da9 100644
--- a/frontend/src/container/AppLayout/AppLayout.styles.scss
+++ b/frontend/src/container/AppLayout/AppLayout.styles.scss
@@ -72,40 +72,6 @@
}
}
-.chat-support-gateway {
- position: fixed;
- // Lifted above the bottom strip. Don't extend this pattern — new fixed-bottom
- // UI belongs in the bounded layout, not in another offset here.
- bottom: calc(20px + var(--bottom-strip-height, 0px));
- right: 20px;
- z-index: 1000;
-
- .chat-support-gateway-btn {
- max-width: 48px;
- width: 48px;
- max-height: 48px;
- height: 48px;
- padding: 12px;
- border-radius: 50%;
-
- display: flex;
- justify-content: center;
- align-items: center;
-
- background-color: #f25733;
- border: none;
-
- &:hover {
- color: white !important;
- border-color: white !important;
- }
-
- .chat-support-gateway-btn-icon {
- fill: white;
- }
- }
-}
-
.add-credit-card-btn,
.cancel-btn {
display: inline-flex;
diff --git a/frontend/src/container/AppLayout/index.tsx b/frontend/src/container/AppLayout/index.tsx
index 997a5238a2..1855422417 100644
--- a/frontend/src/container/AppLayout/index.tsx
+++ b/frontend/src/container/AppLayout/index.tsx
@@ -28,7 +28,6 @@ import getUserLatestVersion from 'api/v1/version/getLatestVersion';
import { AxiosError } from 'axios';
import cx from 'classnames';
import ChangelogModal from 'components/ChangelogModal/ChangelogModal';
-import ChatSupportGateway from 'components/ChatSupportGateway/ChatSupportGateway';
import OverlayScrollbar from 'components/OverlayScrollbar/OverlayScrollbar';
import RefreshPaymentStatus from 'components/RefreshPaymentStatus/RefreshPaymentStatus';
import AuthZTooltip from 'lib/authz/components/AuthZTooltip/AuthZTooltip';
@@ -51,8 +50,6 @@ import { useIsDarkMode } from 'hooks/useDarkMode';
import { useGetTenantLicense } from 'hooks/useGetTenantLicense';
import { useIsAIAssistantEnabled } from 'hooks/useIsAIAssistantEnabled';
import { useNotifications } from 'hooks/useNotifications';
-import { ChatSupportState, useChatSupport } from 'hooks/useChatSupport';
-import { useSavedViewEnabled } from 'hooks/useSavedViewEnabled';
import useTabVisibility from 'hooks/useTabFocus';
import history from 'lib/history';
import { isNull } from 'lodash-es';
@@ -401,7 +398,6 @@ function AppLayout(props: AppLayoutProps): JSX.Element {
}, [pathname]);
const isToDisplayLayout = isLoggedIn;
- const isSavedViewEnabled = useSavedViewEnabled();
const routeKey = useMemo(() => getRouteKey(pathname), [pathname]);
const pageTitle = t(routeKey);
@@ -489,8 +485,6 @@ function AppLayout(props: AppLayoutProps): JSX.Element {
}
}, [isDarkMode]);
- const chatSupport = useChatSupport();
-
// Listen for API warnings
const handleWarning = (
isSlow: boolean,
@@ -834,9 +828,7 @@ function AppLayout(props: AppLayoutProps): JSX.Element {
</LayoutContent>
</Sentry.ErrorBoundary>
- {isSavedViewEnabled && isToDisplayLayout && !renderFullScreen && (
- <BottomStrip />
- )}
+ {isToDisplayLayout && !renderFullScreen && <BottomStrip />}
</div>
{isLoggedIn && isAIAssistantEnabled && (
@@ -847,9 +839,6 @@ function AppLayout(props: AppLayoutProps): JSX.Element {
)}
</Flex>
- {chatSupport === ChatSupportState.NeedsCard && !isSavedViewEnabled && (
- <ChatSupportGateway />
- )}
{showChangelogModal && changelog && (
<ChangelogModal changelog={changelog} onClose={toggleChangelogModal} />
)}
diff --git a/frontend/src/container/CreateAlertV2/utils.tsx b/frontend/src/container/CreateAlertV2/utils.tsx
index e1095ab6e7..a388340e6b 100644
--- a/frontend/src/container/CreateAlertV2/utils.tsx
+++ b/frontend/src/container/CreateAlertV2/utils.tsx
@@ -3,7 +3,6 @@ import { Color } from '@signozhq/design-tokens';
import { Spin } from 'antd';
import { TIMEZONE_DATA } from 'components/CustomTimePicker/timezoneUtils';
import { UniversalYAxisUnit } from 'components/YAxisUnitSelector/types';
-import { getRandomColor } from 'container/ExplorerOptions/utils';
import { AlertDetectionTypes } from 'container/FormAlertRules';
import { AlertTypes } from 'types/api/alerts/alertTypes';
import { PostableAlertRuleV2 } from 'types/api/alerts/alertTypesV2';
@@ -54,7 +53,9 @@ export function getColorForThreshold(thresholdLabel: string): string {
if (thresholdLabel === 'info') {
return Color.BG_ROBIN_500;
}
- return getRandomColor();
+ const colorKeys = Object.keys(Color) as (keyof typeof Color)[];
+ const randomKey = colorKeys[Math.floor(Math.random() * colorKeys.length)];
+ return Color[randomKey];
}
export function parseGoTime(input: string): {
diff --git a/frontend/src/container/ExplorerOptions/ExplorerOptionWrapper.tsx b/frontend/src/container/ExplorerOptions/ExplorerOptionWrapper.tsx
deleted file mode 100644
index 9115e1ca66..0000000000
--- a/frontend/src/container/ExplorerOptions/ExplorerOptionWrapper.tsx
+++ /dev/null
@@ -1,47 +0,0 @@
-import { useEffect, useState } from 'react';
-
-import ExplorerOptions, { ExplorerOptionsProps } from './ExplorerOptions';
-import { getExplorerToolBarVisibility } from './utils';
-
-type ExplorerOptionsWrapperProps = Omit<
- ExplorerOptionsProps,
- 'isExplorerOptionDrop'
->;
-
-function ExplorerOptionWrapper({
- disabled,
- query,
- isLoading,
- onExport,
- sourcepage,
- isOneChartPerQuery,
- splitedQueries,
- signalSource,
- handleChangeSelectedView,
-}: ExplorerOptionsWrapperProps): JSX.Element {
- const [isExplorerOptionHidden, setIsExplorerOptionHidden] = useState(false);
-
- useEffect(() => {
- const toolbarVisibility = getExplorerToolBarVisibility(sourcepage);
- setIsExplorerOptionHidden(!toolbarVisibility);
- // eslint-disable-next-line react-hooks/exhaustive-deps
- }, []);
-
- return (
- <ExplorerOptions
- disabled={disabled}
- query={query}
- isLoading={isLoading}
- onExport={onExport}
- sourcepage={sourcepage}
- signalSource={signalSource}
- isExplorerOptionHidden={isExplorerOptionHidden}
- setIsExplorerOptionHidden={setIsExplorerOptionHidden}
- isOneChartPerQuery={isOneChartPerQuery}
- splitedQueries={splitedQueries}
- handleChangeSelectedView={handleChangeSelectedView}
- />
- );
-}
-
-export default ExplorerOptionWrapper;
diff --git a/frontend/src/container/ExplorerOptions/ExplorerOptions.styles.scss b/frontend/src/container/ExplorerOptions/ExplorerOptions.styles.scss
deleted file mode 100644
index 6123c4482c..0000000000
--- a/frontend/src/container/ExplorerOptions/ExplorerOptions.styles.scss
+++ /dev/null
@@ -1,234 +0,0 @@
-.explorer-options-container {
- position: fixed;
- // Lifted above the bottom strip. Don't extend this pattern — new fixed-bottom
- // UI belongs in the bounded layout, not in another offset here.
- bottom: var(--bottom-strip-height, 0px);
- left: calc(50% + 240px);
- transform: translate(calc(-50% - 120px), 0);
- transition: left 0.2s linear;
-
- display: flex;
- gap: 8px;
- background-color: transparent;
-
- .multi-alert-button,
- .multi-dashboard-button {
- min-width: 130px;
-
- .ant-select-selector {
- .ant-select-selection-placeholder {
- margin-left: 0 !important;
- }
-
- .ant-select-arrow {
- display: none !important;
- }
- }
- }
-
- &__divider {
- --divider-vertical-margin: 0;
- }
-}
-
-.hide-update {
- left: calc(50% - 72px) !important;
-}
-
-.explorer-update {
- display: inline-flex;
- align-items: center;
- gap: 12px;
- padding: 10px 12px;
- background: color-mix(in srgb, var(--l1-border) 60%, transparent);
- border: 1px solid var(--l1-border);
- border-radius: 4px;
- backdrop-filter: blur(20px);
- box-sizing: border-box;
-
- .action-icon {
- display: flex;
- justify-content: center;
- align-items: center;
- padding: 8px;
- border-radius: 50px;
- border: 1px solid var(--l1-border);
- background: var(--l1-border);
- cursor: pointer;
- box-shadow: none;
- }
-
- .hidden {
- display: none;
- }
-}
-
-.explorer-options {
- padding: 10px 12px;
- border-radius: 4px;
- border: 1px solid var(--l1-border);
- background: var(--l2-background);
- backdrop-filter: blur(20px);
-
- cursor: default;
- display: flex;
- gap: 16px;
- z-index: 1;
-
- .ant-select-selector {
- padding: 0 !important;
- }
-
- hr {
- border-color: var(--l1-border);
- }
-
- .view-options,
- .actions {
- .info-icon {
- margin: 8px;
- }
-
- .hidden {
- display: none;
- }
-
- display: flex;
- justify-content: center;
- align-items: center;
- gap: 8px;
-
- .ant-select-focused {
- border-color: transparent !important;
-
- .ant-select-selector {
- border-color: transparent !important;
- box-shadow: none !important;
- }
- }
-
- .ant-select-selector {
- border: transparent !important;
- background-color: transparent !important;
-
- .ant-select-selection-placeholder {
- margin-left: 12px;
- }
- }
- }
- .hidden {
- display: none;
- }
-
- button {
- display: flex;
- align-items: center;
- justify-content: center;
- }
-}
-
-.app-content {
- &.collapsed {
- .explorer-options-container {
- left: calc(50% + 72px);
- }
- }
-}
-
-.render-options {
- display: flex;
- align-items: center;
- gap: 8px;
- padding: 0 2px;
- color: var(--l2-foreground);
- font-family: Inter;
- font-size: 12px;
- font-style: normal;
- font-weight: 400;
- line-height: 20px; /* 142.857% */
- letter-spacing: -0.07px;
-
- .dot {
- margin-left: 6px;
- min-height: 6px;
- min-width: 6px;
- border-radius: 50%;
- backdrop-filter: blur(20px);
- }
-}
-
-.save-view-modal {
- width: 384px !important;
- .ant-modal-content {
- padding: 0;
- border-radius: 4px;
- border: 1px solid var(--l1-border);
- background: var(--l2-background);
- box-shadow: 0px -4px 16px 2px rgba(0, 0, 0, 0.2);
-
- .ant-modal-header {
- padding: 16px;
- background: var(--l2-background);
- border-bottom: 1px solid var(--l1-border);
- }
-
- .ant-modal-body {
- padding: 12px 16px 0px 16px;
-
- .ant-typography {
- color: var(--l1-foreground);
- font-family: Inter;
- font-size: 14px;
- font-style: normal;
- font-weight: 500;
- line-height: 20px; /* 142.857% */
- }
-
- .save-view-input {
- margin-top: 8px;
- display: flex;
- gap: 8px;
- }
-
- .ant-color-picker-trigger {
- padding: 6px;
- border-radius: 2px;
- border: 1px solid var(--l1-border);
- background: var(--l3-background);
- width: 32px;
- height: 32px;
-
- .ant-color-picker-color-block {
- border-radius: 50px;
- width: 16px;
- height: 16px;
- flex-shrink: 0;
-
- .ant-color-picker-color-block-inner {
- display: flex;
- justify-content: center;
- align-items: center;
- }
- }
- }
- }
-
- .ant-modal-footer {
- display: flex;
- justify-content: flex-end;
- padding: 16px 16px;
- margin: 0;
- .save-button {
- display: flex;
- }
- }
- }
- .title {
- color: var(--l1-foreground);
- font-family: Inter;
- font-size: 14px;
- font-style: normal;
- font-weight: 400;
- line-height: 20px;
- }
-}
diff --git a/frontend/src/container/ExplorerOptions/ExplorerOptions.tsx b/frontend/src/container/ExplorerOptions/ExplorerOptions.tsx
deleted file mode 100644
index 330bd2c45f..0000000000
--- a/frontend/src/container/ExplorerOptions/ExplorerOptions.tsx
+++ /dev/null
@@ -1,1078 +0,0 @@
-import {
- CSSProperties,
- Dispatch,
- SetStateAction,
- useCallback,
- useEffect,
- useMemo,
- useRef,
- useState,
-} from 'react';
-import { useHistory } from 'react-router-dom';
-import {
- Check,
- ConciergeBell,
- Disc3,
- PanelBottomClose,
- Plus,
- X,
- Info,
-} from '@signozhq/icons';
-import { Color } from '@signozhq/design-tokens';
-import {
- Button,
- ColorPicker,
- Modal,
- RefSelectProps,
- Select,
- Tooltip,
-} from 'antd';
-import { Divider } from '@signozhq/ui/divider';
-import { Typography } from '@signozhq/ui/typography';
-import { Input } from '@signozhq/ui/input';
-import getLocalStorageKey from 'api/browser/localstorage/get';
-import setLocalStorageKey from 'api/browser/localstorage/set';
-import logEvent from 'api/common/logEvent';
-import { TelemetryFieldKey } from 'api/v5/v5';
-import axios from 'axios';
-import cx from 'classnames';
-import { getViewDetailsUsingViewKey } from 'components/ExplorerCard/utils';
-import { SOMETHING_WENT_WRONG } from 'constants/api';
-import { LOCALSTORAGE } from 'constants/localStorage';
-import { QueryParams } from 'constants/query';
-import { PANEL_TYPES } from 'constants/queryBuilder';
-import ROUTES from 'constants/routes';
-import ExportPanelContainer from 'container/ExportPanel/ExportPanelContainer';
-import {
- MetricsExplorerEventKeys,
- MetricsExplorerEvents,
-} from 'container/MetricsExplorer/events';
-import { useOptionsMenu } from 'container/OptionsMenu';
-import {
- defaultLogsSelectedColumns,
- defaultTraceSelectedColumns,
-} from 'container/OptionsMenu/constants';
-import { OptionsQuery } from 'container/OptionsMenu/types';
-import { ExportDashboard } from 'hooks/dashboard/useExportDashboards';
-import { useGetSavedViewParams } from 'hooks/saveViews/useGetSavedViewParams';
-import { useQueryBuilder } from 'hooks/queryBuilder/useQueryBuilder';
-import { useGetAllViews } from 'hooks/saveViews/useGetAllViews';
-import { useSaveView } from 'hooks/saveViews/useSaveView';
-import { useUpdateView } from 'hooks/saveViews/useUpdateView';
-import { useIsDarkMode } from 'hooks/useDarkMode';
-import useErrorNotification from 'hooks/useErrorNotification';
-import { useHandleExplorerTabChange } from 'hooks/useHandleExplorerTabChange';
-import { useNotifications } from 'hooks/useNotifications';
-import { mapCompositeQueryFromQuery } from 'lib/newQueryBuilder/queryBuilderMappers/mapCompositeQueryFromQuery';
-import { cloneDeep, isEqual, omit } from 'lodash-es';
-import { useAppContext } from 'providers/App/App';
-import { FormattingOptions } from 'providers/preferences/types';
-import { Query } from 'types/api/queryBuilder/queryBuilderData';
-import { ViewProps } from 'types/api/saveViews/types';
-import { DataSource, StringOperators } from 'types/common/queryBuilder';
-import { USER_ROLES } from 'types/roles';
-import { panelTypeToExplorerView } from 'utils/explorerUtils';
-
-import { PreservedViewsTypes } from './constants';
-import ExplorerOptionsHideArea from './ExplorerOptionsHideArea';
-import { ChangeViewFunctionType, PreservedViewsInLocalStorage } from './types';
-import {
- DATASOURCE_VS_ROUTES,
- generateRGBAFromHex,
- getRandomColor,
- saveNewViewHandler,
- setExplorerToolBarVisibility,
-} from './utils';
-
-import './ExplorerOptions.styles.scss';
-
-const allowedRoles = [USER_ROLES.ADMIN, USER_ROLES.AUTHOR, USER_ROLES.EDITOR];
-
-// eslint-disable-next-line sonarjs/cognitive-complexity
-function ExplorerOptions({
- disabled,
- isLoading,
- onExport,
- query,
- sourcepage,
- signalSource,
- isExplorerOptionHidden = false,
- setIsExplorerOptionHidden,
- isOneChartPerQuery = false,
- splitedQueries = [],
- handleChangeSelectedView,
-}: ExplorerOptionsProps): JSX.Element {
- const [isExport, setIsExport] = useState<boolean>(false);
- const [isSaveModalOpen, setIsSaveModalOpen] = useState(false);
- const [newViewName, setNewViewName] = useState<string>('');
- const [color, setColor] = useState(Color.BG_SIENNA_500);
- const { notifications } = useNotifications();
- const history = useHistory();
- const ref = useRef<RefSelectProps>(null);
- const isDarkMode = useIsDarkMode();
- const [queryToExport, setQueryToExport] = useState<Query | null>(null);
-
- const isLogsExplorer = sourcepage === DataSource.LOGS;
- const isMetricsExplorer = sourcepage === DataSource.METRICS;
- const isMeterExplorer = signalSource === 'meter';
-
- const PRESERVED_VIEW_LOCAL_STORAGE_KEY = LOCALSTORAGE.LAST_USED_SAVED_VIEWS;
-
- const PRESERVED_VIEW_TYPE = useMemo(() => {
- if (isLogsExplorer) {
- return PreservedViewsTypes.LOGS;
- }
- if (isMetricsExplorer) {
- return PreservedViewsTypes.METRICS;
- }
- if (isMeterExplorer) {
- return PreservedViewsTypes.METER;
- }
- return PreservedViewsTypes.TRACES;
- }, [isLogsExplorer, isMetricsExplorer, isMeterExplorer]);
-
- const onModalToggle = useCallback((value: boolean) => {
- setIsExport(value);
- }, []);
-
- const {
- currentQuery,
- panelType,
- isStagedQueryUpdated,
- redirectWithQueryBuilderData,
- isDefaultQuery,
- } = useQueryBuilder();
-
- const handleSaveViewModalToggle = (): void => {
- if (sourcepage === DataSource.TRACES) {
- logEvent('Traces Explorer: Save view clicked', {
- panelType,
- });
- } else if (isLogsExplorer) {
- logEvent('Logs Explorer: Save view clicked', {
- panelType,
- });
- } else if (isMetricsExplorer) {
- logEvent(MetricsExplorerEvents.SaveViewClicked, {
- [MetricsExplorerEventKeys.Tab]: 'explorer',
- [MetricsExplorerEventKeys.OneChartPerQueryEnabled]: isOneChartPerQuery,
- panelType,
- });
- } else if (isMeterExplorer) {
- logEvent('Meter Explorer: Save view clicked', {
- panelType,
- });
- }
- setIsSaveModalOpen(!isSaveModalOpen);
- };
-
- const hideSaveViewModal = (): void => {
- setIsSaveModalOpen(false);
- };
-
- const { user } = useAppContext();
-
- const handleConditionalQueryModification = useCallback(
- // eslint-disable-next-line sonarjs/cognitive-complexity
- (defaultQuery: Query | null): string => {
- const queryToUse = defaultQuery || query;
- if (!queryToUse) {
- throw new Error('No query provided');
- }
- if (
- queryToUse?.builder?.queryData?.[0]?.aggregateOperator !==
- StringOperators.NOOP &&
- sourcepage !== DataSource.LOGS
- ) {
- return JSON.stringify(queryToUse);
- }
-
- // Convert NOOP to COUNT for alerts and strip orderBy for logs
- const modifiedQuery = cloneDeep(queryToUse);
- if (modifiedQuery && modifiedQuery.builder?.queryData) {
- modifiedQuery.builder.queryData = modifiedQuery.builder.queryData.map(
- (item) => {
- const updatedItem = { ...item };
-
- if (updatedItem.aggregateOperator === StringOperators.NOOP) {
- updatedItem.aggregateOperator = StringOperators.COUNT;
- }
-
- // Alerts do not support order by on logs explorer queries
- if (sourcepage === DataSource.LOGS && panelType === PANEL_TYPES.LIST) {
- updatedItem.orderBy = [];
- }
-
- return updatedItem;
- },
- );
- }
-
- try {
- return JSON.stringify(modifiedQuery);
- } catch (err) {
- throw new Error(
- 'Failed to stringify modified query: ' +
- (err instanceof Error ? err.message : String(err)),
- );
- }
- },
- [panelType, query, sourcepage],
- );
-
- const onCreateAlertsHandler = useCallback(
- (defaultQuery: Query | null) => {
- if (sourcepage === DataSource.TRACES) {
- logEvent('Traces Explorer: Create alert', {
- panelType,
- });
- } else if (isLogsExplorer) {
- logEvent('Logs Explorer: Create alert', {
- panelType,
- });
- } else if (isMetricsExplorer) {
- logEvent(MetricsExplorerEvents.AddToAlertClicked, {
- panelType,
- [MetricsExplorerEventKeys.Tab]: 'explorer',
- [MetricsExplorerEventKeys.OneChartPerQueryEnabled]: isOneChartPerQuery,
- });
- }
-
- const stringifiedQuery = handleConditionalQueryModification(defaultQuery);
-
- history.push(
- `${ROUTES.ALERTS_NEW}?${QueryParams.compositeQuery}=${encodeURIComponent(
- stringifiedQuery,
- )}`,
- );
- },
- // eslint-disable-next-line react-hooks/exhaustive-deps
- [handleConditionalQueryModification, history],
- );
-
- const onCancel = (value: boolean) => (): void => {
- onModalToggle(value);
- if (isOneChartPerQuery) {
- setQueryToExport(null);
- }
- };
-
- const onAddToDashboard = useCallback((): void => {
- if (sourcepage === DataSource.TRACES) {
- logEvent('Traces Explorer: Add to dashboard clicked', {
- panelType,
- });
- } else if (isLogsExplorer) {
- logEvent('Logs Explorer: Add to dashboard clicked', {
- panelType,
- });
- } else if (isMetricsExplorer) {
- logEvent(MetricsExplorerEvents.AddToDashboardClicked, {
- panelType,
- [MetricsExplorerEventKeys.Tab]: 'explorer',
- [MetricsExplorerEventKeys.OneChartPerQueryEnabled]: isOneChartPerQuery,
- });
- }
- setIsExport(true);
- // eslint-disable-next-line react-hooks/exhaustive-deps
- }, [isLogsExplorer, isMetricsExplorer, panelType, setIsExport, sourcepage]);
-
- const {
- data: viewsData,
- isLoading: viewsIsLoading,
- error,
- isRefetching,
- refetch: refetchAllView,
- } = useGetAllViews(isMeterExplorer ? 'meter' : sourcepage);
-
- const compositeQuery = mapCompositeQueryFromQuery(currentQuery, panelType);
-
- const { viewName, viewKey } = useGetSavedViewParams();
-
- const extraData = viewsData?.data?.data?.find(
- (view) => view.id === viewKey,
- )?.extraData;
-
- const extraDataColor = extraData ? JSON.parse(extraData).color : '';
- const rgbaColor = generateRGBAFromHex(
- extraDataColor || Color.BG_SIENNA_500,
- 0.08,
- );
-
- const { options, handleOptionsChange } = useOptionsMenu({
- storageKey:
- sourcepage === DataSource.TRACES
- ? LOCALSTORAGE.TRACES_LIST_OPTIONS
- : LOCALSTORAGE.LOGS_LIST_OPTIONS,
- dataSource: sourcepage,
- aggregateOperator: StringOperators.NOOP,
- });
-
- const getUpdatedExtraData = (
- extraData: string | undefined,
- newSelectedColumns: TelemetryFieldKey[],
- formattingOptions?: FormattingOptions,
- ): string => {
- let updatedExtraData;
-
- if (extraData) {
- const parsedExtraData = JSON.parse(extraData);
- parsedExtraData.selectColumns = newSelectedColumns;
- if (formattingOptions) {
- parsedExtraData.format = formattingOptions.format;
- parsedExtraData.maxLines = formattingOptions.maxLines;
- parsedExtraData.fontSize = formattingOptions.fontSize;
- }
- updatedExtraData = JSON.stringify(parsedExtraData);
- } else {
- updatedExtraData = JSON.stringify({
- color: Color.BG_SIENNA_500,
- selectColumns: newSelectedColumns,
- format: formattingOptions?.format,
- maxLines: formattingOptions?.maxLines,
- fontSize: formattingOptions?.fontSize,
- });
- }
- return updatedExtraData;
- };
-
- const updatedExtraData = getUpdatedExtraData(
- extraData,
- options?.selectColumns,
- // pass this only for logs
- sourcepage === DataSource.LOGS
- ? {
- format: options?.format,
- maxLines: options?.maxLines,
- fontSize: options?.fontSize,
- }
- : undefined,
- );
-
- const { mutateAsync: updateViewAsync, isLoading: isViewUpdating } =
- useUpdateView({
- compositeQuery,
- viewKey,
- extraData: updatedExtraData,
- sourcePage: isMeterExplorer ? 'meter' : sourcepage,
- viewName,
- });
-
- const showErrorNotification = (err: Error): void => {
- notifications.error({
- message: axios.isAxiosError(err) ? err.message : SOMETHING_WENT_WRONG,
- });
- };
-
- const onUpdateQueryHandler = (): void => {
- updateViewAsync(
- {
- compositeQuery: mapCompositeQueryFromQuery(currentQuery, panelType),
- viewKey,
- extraData: updatedExtraData,
- sourcePage: isMeterExplorer ? 'meter' : sourcepage,
- viewName,
- },
- {
- onSuccess: () => {
- notifications.success({
- message: 'View Updated Successfully',
- });
- refetchAllView();
- },
- onError: (err) => {
- showErrorNotification(err);
- },
- },
- );
- };
-
- useErrorNotification(error);
-
- const { handleExplorerTabChange } = useHandleExplorerTabChange();
-
- type ExtraData = {
- selectColumns?: TelemetryFieldKey[];
- version?: number;
- };
-
- const updateOrRestoreSelectColumns = (
- key: string,
- allViewsData: ViewProps[] | undefined,
- options: OptionsQuery,
- handleOptionsChange: (newQueryData: OptionsQuery) => void,
- ): void => {
- const currentViewDetails = getViewDetailsUsingViewKey(key, allViewsData);
- if (!currentViewDetails) {
- return;
- }
-
- let extraData: ExtraData = {};
- try {
- extraData = JSON.parse(currentViewDetails?.extraData ?? '{}') as ExtraData;
- } catch (error) {
- console.error('Error parsing extraData:', error);
- }
-
- let backwardCompatibleOptions = options;
-
- if (!extraData?.version) {
- backwardCompatibleOptions = omit(options, 'version');
- }
-
- // Use the correct default columns based on the current data source
- const defaultColumns =
- sourcepage === DataSource.TRACES
- ? defaultTraceSelectedColumns
- : defaultLogsSelectedColumns;
-
- if (extraData.selectColumns?.length) {
- handleOptionsChange({
- ...backwardCompatibleOptions,
- selectColumns: extraData.selectColumns,
- });
- } else if (!isEqual(defaultColumns, options.selectColumns)) {
- handleOptionsChange({
- ...backwardCompatibleOptions,
- selectColumns: defaultColumns,
- });
- }
- };
- const onMenuItemSelectHandler = useCallback(
- ({ key }: { key: string }): void => {
- const currentViewDetails = getViewDetailsUsingViewKey(
- key,
- viewsData?.data?.data,
- );
- if (!currentViewDetails) {
- return;
- }
- const { query, name, id, panelType: currentPanelType } = currentViewDetails;
-
- if (handleChangeSelectedView) {
- handleChangeSelectedView(panelTypeToExplorerView[currentPanelType], {
- query,
- viewName: name,
- viewKey: id,
- });
- } else {
- // to remove this after traces cleanup
- handleExplorerTabChange(currentPanelType, {
- query,
- viewName: name,
- viewKey: id,
- });
- }
- },
- [viewsData, handleExplorerTabChange, handleChangeSelectedView],
- );
-
- const updatePreservedViewInLocalStorage = (option: {
- key: string;
- value: string;
- }): void => {
- // Retrieve stored views from local storage
- const storedViews = getLocalStorageKey(PRESERVED_VIEW_LOCAL_STORAGE_KEY);
-
- // Initialize or parse the stored views
- const updatedViews: PreservedViewsInLocalStorage = storedViews
- ? JSON.parse(storedViews)
- : {};
-
- // Update the views with the new selection
- updatedViews[PRESERVED_VIEW_TYPE] = {
- key: option.key,
- value: option.value,
- };
-
- // Save the updated views back to local storage
- setLocalStorageKey(
- PRESERVED_VIEW_LOCAL_STORAGE_KEY,
- JSON.stringify(updatedViews),
- );
- };
-
- const handleSelect = (
- value: string,
- option: { key: string; value: string },
- ): void => {
- onMenuItemSelectHandler({
- key: option.key,
- });
- if (sourcepage === DataSource.TRACES) {
- logEvent('Traces Explorer: Select view', {
- panelType,
- viewName: option?.value,
- });
- } else if (isLogsExplorer) {
- logEvent('Logs Explorer: Select view', {
- panelType,
- viewName: option?.value,
- });
- } else if (isMetricsExplorer) {
- logEvent('Metrics Explorer: Select view', {
- panelType,
- viewName: option?.value,
- });
- } else if (isMeterExplorer) {
- logEvent('Meter Explorer: Select view', {
- panelType,
- viewName: option?.value,
- });
- }
-
- updatePreservedViewInLocalStorage(option);
-
- updateOrRestoreSelectColumns(
- option.key,
- viewsData?.data?.data,
- options,
- handleOptionsChange,
- );
-
- if (ref.current) {
- ref.current.blur();
- }
- };
-
- const removeCurrentViewFromLocalStorage = (): void => {
- // Retrieve stored views from local storage
- const storedViews = getLocalStorageKey(PRESERVED_VIEW_LOCAL_STORAGE_KEY);
-
- if (storedViews) {
- // Parse the stored views
- const parsedViews = JSON.parse(storedViews);
-
- // Remove the current view type from the parsed views
- delete parsedViews[PRESERVED_VIEW_TYPE];
-
- // Update local storage with the modified views
- setLocalStorageKey(
- PRESERVED_VIEW_LOCAL_STORAGE_KEY,
- JSON.stringify(parsedViews),
- );
- }
- };
-
- const handleClearSelect = (): void => {
- removeCurrentViewFromLocalStorage();
-
- handleOptionsChange({
- ...options,
- selectColumns:
- sourcepage === DataSource.TRACES
- ? defaultTraceSelectedColumns
- : defaultLogsSelectedColumns,
- });
-
- if (signalSource === 'meter') {
- history.replace(ROUTES.METER_EXPLORER);
- return;
- }
-
- if (handleChangeSelectedView) {
- handleChangeSelectedView(panelTypeToExplorerView[PANEL_TYPES.LIST]);
- }
-
- history.replace(DATASOURCE_VS_ROUTES[sourcepage]);
- };
-
- const isQueryUpdated = isStagedQueryUpdated(
- viewsData?.data?.data,
- viewKey,
- options,
- );
-
- const { isLoading: isSaveViewLoading, mutateAsync: saveViewAsync } =
- useSaveView({
- viewName: newViewName || '',
- compositeQuery,
- sourcePage: sourcepage,
- extraData: JSON.stringify({
- color,
- selectColumns: options.selectColumns,
- }),
- });
-
- const onSaveHandler = (): void => {
- saveNewViewHandler({
- compositeQuery,
- handlePopOverClose: hideSaveViewModal,
- extraData: JSON.stringify({
- color,
- selectColumns: options.selectColumns,
- version: 1,
- ...// pass this only for logs
- (sourcepage === DataSource.LOGS
- ? {
- format: options?.format,
- maxLines: options?.maxLines,
- fontSize: options?.fontSize,
- }
- : {}),
- }),
- notifications,
- panelType: panelType || PANEL_TYPES.LIST,
- redirectWithQueryBuilderData,
- refetchAllView,
- saveViewAsync,
- sourcePage: isMeterExplorer ? 'meter' : sourcepage,
- viewName: newViewName,
- setNewViewName,
- });
- if (sourcepage === DataSource.TRACES) {
- logEvent('Traces Explorer: Save view successful', {
- panelType,
- viewName: newViewName,
- });
- } else if (isLogsExplorer) {
- logEvent('Logs Explorer: Save view successful', {
- panelType,
- viewName: newViewName,
- });
- } else if (isMetricsExplorer) {
- logEvent('Metrics Explorer: Save view successful', {
- panelType,
- viewName: newViewName,
- });
- }
- };
-
- // TODO: Remove this and move this to scss file
- const dropdownStyle: CSSProperties = useMemo(
- () => ({
- borderRadius: '4px',
- border: isDarkMode
- ? `1px solid ${Color.BG_SLATE_400}`
- : `1px solid ${Color.BG_VANILLA_300}`,
- background: isDarkMode
- ? 'var(--bg-gradient-dark-shadow)'
- : 'linear-gradient(139deg, rgba(241, 241, 241, 0.8) 0%, rgba(241, 241, 241, 0.9) 98.68%)',
- boxShadow: '4px 10px 16px 2px rgba(0, 0, 0, 0.20)',
- backdropFilter: 'blur(20px)',
- bottom: '74px',
- width: '191px',
- }),
- [isDarkMode],
- );
-
- const isEditDeleteSupported = allowedRoles.includes(user.role as string);
-
- const [isRecentlyUsedSavedViewSelected, setIsRecentlyUsedSavedViewSelected] =
- useState(false);
-
- useEffect(() => {
- // If the query is not the default query, don't set the recently used saved view
- if (!isDefaultQuery({ currentQuery, sourcePage: sourcepage })) {
- return;
- }
-
- const parsedPreservedView = JSON.parse(
- getLocalStorageKey(PRESERVED_VIEW_LOCAL_STORAGE_KEY) || '{}',
- );
-
- const preservedView = parsedPreservedView[PRESERVED_VIEW_TYPE] || {};
-
- let timeoutId: string | number | NodeJS.Timeout | undefined;
-
- if (
- !!preservedView?.key &&
- viewsData?.data?.data &&
- !(!!viewName || !!viewKey) &&
- !isRecentlyUsedSavedViewSelected
- ) {
- // prevent the race condition with useShareBuilderUrl
- timeoutId = setTimeout(() => {
- onMenuItemSelectHandler({ key: preservedView.key });
- }, 0);
- setIsRecentlyUsedSavedViewSelected(false);
- }
-
- return (): void => {
- clearTimeout(timeoutId);
- };
- }, [
- PRESERVED_VIEW_LOCAL_STORAGE_KEY,
- PRESERVED_VIEW_TYPE,
- currentQuery,
- isDefaultQuery,
- isRecentlyUsedSavedViewSelected,
- onMenuItemSelectHandler,
- sourcepage,
- viewKey,
- viewName,
- viewsData?.data?.data,
- ]);
-
- const infoIconText = useMemo(() => {
- if (isLogsExplorer) {
- return 'Learn more about Logs explorer';
- }
- if (isMetricsExplorer) {
- return 'Learn more about Metrics explorer';
- }
- return 'Learn more about Traces explorer';
- }, [isLogsExplorer, isMetricsExplorer]);
-
- const infoIconLink = useMemo(() => {
- if (isLogsExplorer) {
- return 'https://signoz.io/docs/userguide/logs_query_builder/?utm_source=product&utm_medium=logs-explorer-toolbar';
- }
- // TODO: Add metrics explorer info icon link
- if (isMetricsExplorer) {
- return '';
- }
- return 'https://signoz.io/docs/userguide/traces/?utm_source=product&utm_medium=trace-explorer-toolbar';
- }, [isLogsExplorer, isMetricsExplorer]);
-
- const getQueryName = (query: Query): string => {
- if (query.builder.queryFormulas.length > 0) {
- return `Formula ${query.builder.queryFormulas[0].queryName}`;
- }
- return `Query ${query.builder.queryData[0].queryName}`;
- };
-
- const CreateAlertButton = useMemo(() => {
- if (isOneChartPerQuery) {
- const selectLabel = (
- <Button
- disabled={disabled}
- shape="round"
- icon={<ConciergeBell size={16} />}
- >
- Create an Alert
- </Button>
- );
- return (
- <Select
- disabled={disabled}
- className="multi-alert-button"
- placeholder={selectLabel}
- value={selectLabel}
- suffixIcon={null}
- onSelect={(e): void => {
- const selectedQuery = splitedQueries.find(
- (query) => query.id === (e as unknown as string),
- );
- if (selectedQuery) {
- onCreateAlertsHandler(selectedQuery);
- }
- }}
- >
- {splitedQueries.map((splittedQuery) => (
- <Select.Option key={splittedQuery.id} value={splittedQuery.id}>
- {getQueryName(splittedQuery)}
- </Select.Option>
- ))}
- </Select>
- );
- }
- return (
- <Button
- disabled={disabled}
- shape="round"
- onClick={(): void => onCreateAlertsHandler(query)}
- icon={<ConciergeBell size={16} />}
- >
- Create an Alert
- </Button>
- );
- }, [
- disabled,
- query,
- isOneChartPerQuery,
- onCreateAlertsHandler,
- splitedQueries,
- ]);
-
- const AddToDashboardButton = useMemo(() => {
- if (isOneChartPerQuery) {
- const selectLabel = (
- <Button
- type="primary"
- disabled={disabled}
- shape="round"
- onClick={onAddToDashboard}
- icon={<Plus size={16} />}
- >
- Add to Dashboard
- </Button>
- );
- return (
- <Select
- disabled={disabled}
- className="multi-dashboard-button"
- placeholder={selectLabel}
- value={selectLabel}
- suffixIcon={null}
- onSelect={(e): void => {
- const selectedQuery = splitedQueries.find(
- (query) => query.id === (e as unknown as string),
- );
- if (selectedQuery) {
- setQueryToExport(() => {
- onAddToDashboard();
- return selectedQuery;
- });
- }
- }}
- >
- {/* eslint-disable-next-line sonarjs/no-identical-functions */}
- {splitedQueries.map((splittedQuery) => (
- <Select.Option key={splittedQuery.id} value={splittedQuery.id}>
- {getQueryName(splittedQuery)}
- </Select.Option>
- ))}
- </Select>
- );
- }
- return (
- <Button
- type="primary"
- disabled={disabled}
- shape="round"
- onClick={onAddToDashboard}
- icon={<Plus size={16} />}
- >
- Add to Dashboard
- </Button>
- );
- }, [disabled, isOneChartPerQuery, onAddToDashboard, splitedQueries]);
-
- const hideToolbar = (): void => {
- setExplorerToolBarVisibility(false, sourcepage);
- if (setIsExplorerOptionHidden) {
- setIsExplorerOptionHidden(true);
- }
- };
-
- return (
- <div className="explorer-options-container">
- {
- // if a viewName is selected and the explorer options are not hidden then
- // always show the clear option
- }
- {!isExplorerOptionHidden && viewName && (
- <div
- className={cx(
- isEditDeleteSupported ? '' : 'hide-update',
- 'explorer-update',
- )}
- >
- <Tooltip title="Clear this view" placement="top">
- <Button
- className="action-icon"
- onClick={handleClearSelect}
- icon={<X size={14} />}
- />
- </Tooltip>
- {
- // only show the update view option when the query is updated
- }
- {isQueryUpdated && (
- <>
- <Divider
- type="vertical"
- className={cx('explorer-options-container__divider', {
- hidden: !isEditDeleteSupported,
- })}
- />
- <Tooltip title="Update this view" placement="top">
- <Button
- className={cx('action-icon', isEditDeleteSupported ? ' ' : 'hidden')}
- disabled={isViewUpdating}
- onClick={onUpdateQueryHandler}
- icon={<Disc3 size={14} />}
- />
- </Tooltip>
- </>
- )}
- </div>
- )}
- {!isExplorerOptionHidden && (
- <div
- className="explorer-options"
- style={{
- background: extraData
- ? `linear-gradient(90deg, rgba(0,0,0,0) -5%, ${rgbaColor} 9%, rgba(0,0,0,0) 30%)`
- : 'initial',
- }}
- >
- <div className="view-options">
- <Select<string, { key: string; value: string }>
- showSearch
- placeholder="Select a view"
- loading={viewsIsLoading || isRefetching}
- value={viewName || undefined}
- onSelect={handleSelect}
- style={{
- minWidth: 170,
- }}
- dropdownStyle={dropdownStyle}
- className="views-dropdown"
- allowClear={false}
- ref={ref}
- >
- {viewsData?.data?.data?.map((view) => {
- const extraData =
- view.extraData !== '' ? JSON.parse(view.extraData) : '';
- let bgColor = getRandomColor();
- if (extraData !== '') {
- bgColor = extraData.color;
- }
- return (
- <Select.Option key={view.id} value={view.name}>
- <div className="render-options">
- <span
- className="dot"
- style={{
- background: bgColor,
- boxShadow: `0px 0px 6px 0px ${bgColor}`,
- }}
- />{' '}
- {view.name}
- </div>
- </Select.Option>
- );
- })}
- </Select>
-
- <Button
- shape="round"
- onClick={handleSaveViewModalToggle}
- className={isEditDeleteSupported ? '' : 'hidden'}
- disabled={viewsIsLoading || isRefetching}
- icon={<Disc3 size={16} />}
- >
- Save this view
- </Button>
- </div>
-
- <hr className={isEditDeleteSupported ? '' : 'hidden'} />
-
- {signalSource !== 'meter' && (
- <div className={cx('actions', isEditDeleteSupported ? '' : 'hidden')}>
- {CreateAlertButton}
- {AddToDashboardButton}
- </div>
- )}
-
- <div className="actions">
- {/* Hide the info icon for metrics explorer until we get the docs link */}
- {!isMetricsExplorer && (
- <Tooltip
- title={
- <div>
- {infoIconText}
- <Typography.Link href={infoIconLink} target="_blank">
- {' '}
- here
- </Typography.Link>{' '}
- </div>
- }
- >
- <Info size="md" className="info-icon" />
- </Tooltip>
- )}
-
- <Tooltip title="Hide">
- <Button
- disabled={disabled}
- shape="circle"
- onClick={hideToolbar}
- icon={<PanelBottomClose size={16} />}
- data-testid="hide-toolbar"
- />
- </Tooltip>
- </div>
- </div>
- )}
- <ExplorerOptionsHideArea
- viewName={viewName}
- isExplorerOptionHidden={isExplorerOptionHidden}
- setIsExplorerOptionHidden={setIsExplorerOptionHidden}
- sourcepage={sourcepage}
- isQueryUpdated={isQueryUpdated}
- handleClearSelect={handleClearSelect}
- onUpdateQueryHandler={onUpdateQueryHandler}
- isEditDeleteSupported={isEditDeleteSupported}
- />
- <Modal
- className="save-view-modal"
- title={<span className="title">Save this view</span>}
- open={isSaveModalOpen}
- closable
- onCancel={hideSaveViewModal}
- footer={[
- <Button
- key="submit"
- type="primary"
- icon={<Check size={16} />}
- onClick={onSaveHandler}
- disabled={isSaveViewLoading}
- data-testid="save-view-btn"
- className="save-button"
- >
- Save this view
- </Button>,
- ]}
- >
- <Typography.Text>Label</Typography.Text>
- <div className="save-view-input">
- <ColorPicker
- value={color}
- onChange={(value, hex): void => setColor(hex)}
- />
- <Input
- placeholder="e.g. External http method view"
- value={newViewName}
- onChange={(e): void => setNewViewName(e.target.value)}
- />
- </div>
- </Modal>
- <ExportPanelContainer
- open={isExport}
- onClose={onCancel(false)}
- query={isOneChartPerQuery ? queryToExport : query}
- isLoading={isLoading}
- onExport={(dashboard, isNewDashboard): void => {
- if (isOneChartPerQuery && queryToExport) {
- onExport(dashboard, isNewDashboard, queryToExport);
- } else {
- onExport(dashboard, isNewDashboard);
- }
- }}
- />
- </div>
- );
-}
-
-export interface ExplorerOptionsProps {
- isLoading?: boolean;
- onExport: (
- dashboard: ExportDashboard | null,
- isNewDashboard?: boolean,
- queryToExport?: Query,
- ) => void;
- query: Query | null;
- disabled: boolean;
- sourcepage: DataSource;
- signalSource?: string;
- isExplorerOptionHidden?: boolean;
- setIsExplorerOptionHidden?: Dispatch<SetStateAction<boolean>>;
- isOneChartPerQuery?: boolean;
- splitedQueries?: Query[];
- handleChangeSelectedView?: ChangeViewFunctionType;
-}
-
-ExplorerOptions.defaultProps = {
- isLoading: false,
- isExplorerOptionHidden: false,
- setIsExplorerOptionHidden: undefined,
- isOneChartPerQuery: false,
- splitedQueries: [],
- signalSource: '',
- handleChangeSelectedView: undefined,
-};
-
-export default ExplorerOptions;
diff --git a/frontend/src/container/ExplorerOptions/ExplorerOptionsHideArea.styles.scss b/frontend/src/container/ExplorerOptions/ExplorerOptionsHideArea.styles.scss
deleted file mode 100644
index 046d4fefef..0000000000
--- a/frontend/src/container/ExplorerOptions/ExplorerOptionsHideArea.styles.scss
+++ /dev/null
@@ -1,48 +0,0 @@
-.explorer-option-droppable-container {
- position: fixed;
- // Lifted above the bottom strip. Don't extend this pattern — new fixed-bottom
- // UI belongs in the bounded layout, not in another offset here.
- bottom: var(--bottom-strip-height, 0px);
- width: -webkit-fill-available;
- height: 24px;
- display: flex;
- justify-content: center;
- border-radius: 10px 10px 0px 0px;
- // box-shadow: 0px 4px 16px 0px rgba(0, 0, 0, 0.25);
- // backdrop-filter: blur(20px);
-
- .explorer-actions-btn {
- display: flex;
- gap: 8px;
- margin-right: 8px;
-
- .action-btn {
- display: flex;
- justify-content: center;
- align-items: center;
- border-radius: 10px 10px 0px 0px;
- box-shadow: 0px 4px 16px 0px rgba(0, 0, 0, 0.25);
- backdrop-filter: blur(20px);
- height: 24px !important;
- border: none;
- }
- }
-
- .explorer-show-btn {
- border-radius: 6px 6px 0px 0px;
- border: 1px solid var(--l1-border);
- background: color-mix(in srgb, var(--l1-border) 40%, transparent);
- box-shadow: 0px 4px 16px 0px rgba(0, 0, 0, 0.25);
- backdrop-filter: blur(20px);
- align-self: center;
- padding: 8px 12px;
- height: 24px !important;
-
- .menu-bar {
- border-radius: 50px;
- background: var(--l3-background);
- height: 4px;
- width: 50px;
- }
- }
-}
diff --git a/frontend/src/container/ExplorerOptions/ExplorerOptionsHideArea.tsx b/frontend/src/container/ExplorerOptions/ExplorerOptionsHideArea.tsx
deleted file mode 100644
index 3888ef82af..0000000000
--- a/frontend/src/container/ExplorerOptions/ExplorerOptionsHideArea.tsx
+++ /dev/null
@@ -1,84 +0,0 @@
-import { Dispatch, SetStateAction } from 'react';
-import { Color } from '@signozhq/design-tokens';
-import { Button, Tooltip } from 'antd';
-import { Disc3, X } from '@signozhq/icons';
-import { DataSource } from 'types/common/queryBuilder';
-
-import { setExplorerToolBarVisibility } from './utils';
-
-import './ExplorerOptionsHideArea.styles.scss';
-
-interface DroppableAreaProps {
- viewName: string;
- isQueryUpdated: boolean;
- isExplorerOptionHidden?: boolean;
- sourcepage: DataSource;
- setIsExplorerOptionHidden?: Dispatch<SetStateAction<boolean>>;
- handleClearSelect: () => void;
- onUpdateQueryHandler: () => void;
- isEditDeleteSupported: boolean;
-}
-
-function ExplorerOptionsHideArea({
- viewName,
- isQueryUpdated,
- isExplorerOptionHidden,
- sourcepage,
- setIsExplorerOptionHidden,
- handleClearSelect,
- onUpdateQueryHandler,
- isEditDeleteSupported,
-}: DroppableAreaProps): JSX.Element {
- const handleShowExplorerOption = (): void => {
- if (setIsExplorerOptionHidden) {
- setIsExplorerOptionHidden(false);
- setExplorerToolBarVisibility(true, sourcepage);
- }
- };
-
- return (
- <div className="explorer-option-droppable-container">
- {isExplorerOptionHidden && (
- <>
- {viewName && (
- <div className="explorer-actions-btn">
- <Tooltip title="Clear this view">
- <Button
- onClick={handleClearSelect}
- className="action-btn"
- style={{ background: Color.BG_CHERRY_500 }}
- icon={<X size={14} color={Color.BG_INK_500} />}
- />
- </Tooltip>
- {isEditDeleteSupported && isQueryUpdated && (
- <Tooltip title="Update this View">
- <Button
- onClick={onUpdateQueryHandler}
- className="action-btn"
- style={{ background: Color.BG_ROBIN_500 }}
- icon={<Disc3 size={14} color={Color.BG_INK_500} />}
- />
- </Tooltip>
- )}
- </div>
- )}
- <Button
- // style={{ alignSelf: 'center', marginRight: 'calc(10% - 20px)' }}
- className="explorer-show-btn"
- onClick={handleShowExplorerOption}
- data-testid="show-explorer-option"
- >
- <div className="menu-bar" />
- </Button>
- </>
- )}
- </div>
- );
-}
-
-ExplorerOptionsHideArea.defaultProps = {
- isExplorerOptionHidden: undefined,
- setIsExplorerOptionHidden: undefined,
-};
-
-export default ExplorerOptionsHideArea;
diff --git a/frontend/src/container/ExplorerOptions/__tests__/ExplorerOptionWrapper.test.tsx b/frontend/src/container/ExplorerOptions/__tests__/ExplorerOptionWrapper.test.tsx
deleted file mode 100644
index 3d6daa22ed..0000000000
--- a/frontend/src/container/ExplorerOptions/__tests__/ExplorerOptionWrapper.test.tsx
+++ /dev/null
@@ -1,391 +0,0 @@
-import { useHistory } from 'react-router-dom';
-import { PANEL_TYPES } from 'constants/queryBuilder';
-import { MOCK_QUERY } from 'container/QueryTable/Drilldown/__tests__/mockTableData';
-import { ExportDashboard } from 'hooks/dashboard/useExportDashboards';
-import { rest, server } from 'mocks-server/server';
-import {
- defaultFeatureFlags,
- render,
- screen,
- userEvent,
- waitFor,
-} from 'tests/test-utils';
-import { Query } from 'types/api/queryBuilder/queryBuilderData';
-import { DataSource } from 'types/common/queryBuilder';
-import { buildExportPanelLink } from 'pages/DashboardPage/DashboardContainer/PanelEditor/newPanelRoute';
-
-import ExplorerOptionWrapper from '../ExplorerOptionWrapper';
-import { getExplorerToolBarVisibility } from '../utils';
-
-jest.mock('react-router-dom', () => ({
- ...jest.requireActual('react-router-dom'),
- useHistory: jest.fn(),
-}));
-
-jest.mock('../utils', () => ({
- getExplorerToolBarVisibility: jest.fn(),
- generateRGBAFromHex: jest.fn(() => 'rgba(0, 0, 0, 0.08)'),
- getRandomColor: jest.fn(() => '#000000'),
- saveNewViewHandler: jest.fn(),
- setExplorerToolBarVisibility: jest.fn(),
- DATASOURCE_VS_ROUTES: {},
-}));
-
-const mockGetExplorerToolBarVisibility = jest.mocked(
- getExplorerToolBarVisibility,
-);
-
-const mockUseHistory = jest.mocked(useHistory);
-
-// Mock data
-const TEST_QUERY_ID = 'test-query-id';
-const TEST_DASHBOARD_ID = 'test-dashboard-id';
-const TEST_DASHBOARD_TITLE_2 = 'Test Dashboard for Export';
-const NEW_DASHBOARD_ID = 'new-dashboard-id';
-
-// The export dialog talks to the generated Perses-spec dashboard endpoints.
-const V2_LIST_ENDPOINT = '*/api/v2/users/me/dashboards';
-const V2_CREATE_ENDPOINT = '*/api/v2/dashboards';
-
-// "Create new dashboard" names the dashboard from the `new_dashboard_title` i18n
-// key; the test-utils react-i18next mock returns the key verbatim.
-const NEW_DASHBOARD_TITLE = 'new_dashboard_title';
-
-// Use the existing mock query from the codebase
-const mockQuery: Query = {
- ...MOCK_QUERY,
- id: TEST_QUERY_ID, // Override with our test ID
-} as Query;
-
-const ADD_TO_DASHBOARD_BUTTON_NAME = /add to dashboard/i;
-
-interface PickerDashboard {
- id: string;
- title: string;
-}
-
-/** Register the "list dashboards" endpoint the picker reads. */
-function mockDashboardList(dashboards: PickerDashboard[]): void {
- server.use(
- rest.get(V2_LIST_ENDPOINT, (_req, res, ctx) =>
- res(
- ctx.status(200),
- ctx.json({
- status: 'success',
- data: {
- dashboards: dashboards.map(({ id, title }) => ({
- id,
- name: title,
- spec: { display: { name: title } },
- })),
- reservedKeywords: [],
- },
- }),
- ),
- ),
- );
-}
-
-/** Register the "create dashboard" endpoint the "New dashboard" button hits. */
-function mockCreateDashboard(id: string): void {
- server.use(
- rest.post(V2_CREATE_ENDPOINT, (_req, res, ctx) =>
- res(ctx.status(201), ctx.json({ status: 'success', data: { id } })),
- ),
- );
-}
-
-// Helper function to render component with props
-const renderExplorerOptionWrapper = (
- overrides = {},
-): ReturnType<typeof render> => {
- const props = {
- disabled: false,
- query: mockQuery,
- isLoading: false,
- onExport: jest.fn() as jest.MockedFunction<
- (
- dashboard: ExportDashboard | null,
- isNewDashboard?: boolean,
- queryToExport?: Query,
- ) => void
- >,
- sourcepage: DataSource.LOGS,
- isOneChartPerQuery: false,
- splitedQueries: [],
- signalSource: 'test-signal',
- ...overrides,
- };
-
- return render(
- <ExplorerOptionWrapper
- disabled={props.disabled}
- query={props.query}
- isLoading={props.isLoading}
- onExport={props.onExport}
- sourcepage={props.sourcepage}
- isOneChartPerQuery={props.isOneChartPerQuery}
- splitedQueries={props.splitedQueries}
- signalSource={props.signalSource}
- />,
- undefined,
- { appContextOverrides: { featureFlags: defaultFeatureFlags } },
- );
-};
-
-describe('ExplorerOptionWrapper', () => {
- beforeEach(() => {
- jest.clearAllMocks();
- mockGetExplorerToolBarVisibility.mockReturnValue(true);
- });
-
- it('should navigate to alert creation page when "Create an Alert" is clicked in logs-explorer', async () => {
- const user = userEvent.setup({ pointerEventsCheck: 0 });
- const mockPush = jest.fn();
- mockUseHistory.mockReturnValue({
- push: mockPush,
- } as unknown as ReturnType<typeof useHistory>);
-
- renderExplorerOptionWrapper({ sourcepage: DataSource.LOGS });
-
- const createAlertButton = screen.getByRole('button', {
- name: 'Create an Alert',
- });
- await user.click(createAlertButton);
-
- expect(mockPush).toHaveBeenCalledTimes(1);
- const calledWith = mockPush.mock.calls[0][0] as string;
- const [path, search = ''] = calledWith.split('?');
- expect(path).toBe('/alerts/new');
- const params = new URLSearchParams(search);
- expect(params.has('compositeQuery')).toBe(true);
- });
-
- describe('onExport functionality', () => {
- it('should call onExport when New Dashboard button is clicked in export modal', async () => {
- const user = userEvent.setup({ pointerEventsCheck: 0 });
- const testOnExport = jest.fn() as jest.MockedFunction<
- (
- dashboard: ExportDashboard | null,
- isNewDashboard?: boolean,
- queryToExport?: Query,
- ) => void
- >;
-
- mockCreateDashboard(NEW_DASHBOARD_ID);
-
- renderExplorerOptionWrapper({ onExport: testOnExport });
-
- // Find and click the "Add to Dashboard" button
- const addToDashboardButton = screen.getByRole('button', {
- name: ADD_TO_DASHBOARD_BUTTON_NAME,
- });
- await user.click(addToDashboardButton);
-
- // Wait for the export modal to appear
- await waitFor(() => {
- expect(screen.getByRole('dialog')).toBeInTheDocument();
- });
-
- // Click the "New dashboard" button
- const newDashboardButton = screen.getByTestId('export-panel-new-dashboard');
- await user.click(newDashboardButton);
-
- // Wait for the API call to complete and onExport to be called
- await waitFor(() => {
- expect(testOnExport).toHaveBeenCalledWith(
- { id: NEW_DASHBOARD_ID, title: NEW_DASHBOARD_TITLE },
- true,
- );
- });
- });
-
- it('should call onExport when selecting existing dashboard and clicking Export button', async () => {
- const user = userEvent.setup({ pointerEventsCheck: 0 });
- const testOnExport = jest.fn() as jest.MockedFunction<
- (
- dashboard: ExportDashboard | null,
- isNewDashboard?: boolean,
- queryToExport?: Query,
- ) => void
- >;
-
- // Mock existing dashboards with unique titles
- const dashboards: PickerDashboard[] = [
- { id: 'dashboard-1', title: 'Dashboard 1' },
- { id: 'dashboard-2', title: 'Dashboard 2' },
- ];
- mockDashboardList(dashboards);
-
- renderExplorerOptionWrapper({ onExport: testOnExport });
-
- // Find and click the "Add to Dashboard" button
- const addToDashboardButton = screen.getByRole('button', {
- name: ADD_TO_DASHBOARD_BUTTON_NAME,
- });
- await user.click(addToDashboardButton);
-
- // Wait for the export modal to appear
- await waitFor(() => {
- expect(screen.getByRole('dialog')).toBeInTheDocument();
- });
-
- // Wait for the dashboard select to render AND finish loading. antd
- // disables the Select while the list request is in flight, and a click
- // on a disabled combobox is a no-op — so sync on the ready (enabled)
- // state before clicking.
- const modal = screen.getByRole('dialog');
- await waitFor(() => {
- const combobox = modal.querySelector('[role="combobox"]');
- expect(combobox).toBeTruthy();
- expect(combobox).not.toBeDisabled();
- });
-
- const dashboardSelect = modal.querySelector(
- '[role="combobox"]',
- ) as HTMLElement;
- expect(dashboardSelect).toBeInTheDocument();
- await user.click(dashboardSelect);
-
- // Wait for the dropdown options to appear and select the first dashboard
- await waitFor(() => {
- expect(screen.getByText(dashboards[0].title)).toBeInTheDocument();
- });
-
- // Click on the first dashboard option
- const dashboardOption = screen.getByText(dashboards[0].title);
- await user.click(dashboardOption);
-
- // Wait for the selection to be made and the export button to be enabled
- await waitFor(() => {
- expect(screen.getByTestId('export-panel-export')).not.toHaveAttribute(
- 'aria-disabled',
- 'true',
- );
- });
-
- // Click the export button
- const exportButton = screen.getByTestId('export-panel-export');
- await user.click(exportButton);
-
- // Wait for onExport to be called with the selected dashboard
- await waitFor(() => {
- expect(testOnExport).toHaveBeenCalledWith(
- { id: dashboards[0].id, title: dashboards[0].title },
- false,
- );
- });
- });
-
- it('should navigate to the panel editor via the export link without writing the dashboard', async () => {
- const user = userEvent.setup({ pointerEventsCheck: 0 });
-
- // Mock the safeNavigate function
- const mockSafeNavigate = jest.fn();
-
- const panelTypeParam = PANEL_TYPES.TIME_SERIES;
- const query = mockQuery;
-
- // Create a real handleExport function similar to LogsExplorerViews
- // Export navigates only; it must not write the dashboard (PR #8029).
- const handleExport = (dashboard: ExportDashboard | null): void => {
- if (!dashboard) {
- return;
- }
-
- // Call the real link builder (not mocked)
- const dashboardEditView = buildExportPanelLink({
- query,
- panelType: panelTypeParam,
- dashboardId: dashboard.id,
- });
-
- // Simulate navigation
- mockSafeNavigate(dashboardEditView);
- };
-
- // Mock existing dashboards
- const dashboards: PickerDashboard[] = [
- { id: TEST_DASHBOARD_ID, title: TEST_DASHBOARD_TITLE_2 },
- ];
- mockDashboardList(dashboards);
-
- renderExplorerOptionWrapper({ onExport: handleExport });
-
- // Find and click the "Add to Dashboard" button
- const addToDashboardButton = screen.getByRole('button', {
- name: ADD_TO_DASHBOARD_BUTTON_NAME,
- });
- await user.click(addToDashboardButton);
-
- // Wait for the export modal to appear
- await waitFor(() => {
- expect(screen.getByRole('dialog')).toBeInTheDocument();
- });
-
- // Wait for the dashboard select to render AND finish loading (see note above).
- const modal = screen.getByRole('dialog');
- await waitFor(() => {
- const combobox = modal.querySelector('[role="combobox"]');
- expect(combobox).toBeTruthy();
- expect(combobox).not.toBeDisabled();
- });
-
- const dashboardSelect = modal.querySelector(
- '[role="combobox"]',
- ) as HTMLElement;
- expect(dashboardSelect).toBeInTheDocument();
- await user.click(dashboardSelect);
-
- // Wait for the dropdown options to appear and select the dashboard
- await waitFor(() => {
- expect(screen.getByText(dashboards[0].title)).toBeInTheDocument();
- });
-
- // Click on the dashboard option
- const dashboardOption = screen.getByText(dashboards[0].title);
- await user.click(dashboardOption);
-
- // Wait for the selection to be made and the export button to be enabled
- await waitFor(() => {
- expect(screen.getByTestId('export-panel-export')).not.toHaveAttribute(
- 'aria-disabled',
- 'true',
- );
- });
-
- // Click the export button
- const exportButton = screen.getByTestId('export-panel-export');
- await user.click(exportButton);
-
- // Wait for the handleExport function to be called and navigation to occur
- await waitFor(() => {
- expect(mockSafeNavigate).toHaveBeenCalledTimes(1);
- // V2 panel-editor link: compositeQuery is double-encoded (see newPanelRoute).
- expect(mockSafeNavigate).toHaveBeenCalledWith(
- `/dashboard/${TEST_DASHBOARD_ID}/panel/new?panelKind=signoz%2FTimeSeriesPanel&compositeQuery=${encodeURIComponent(
- encodeURIComponent(JSON.stringify(query)),
- )}`,
- );
- });
- });
- });
-
- it('should not show export buttons when component is disabled', () => {
- const testOnExport = jest.fn() as jest.MockedFunction<
- (
- dashboard: ExportDashboard | null,
- isNewDashboard?: boolean,
- queryToExport?: Query,
- ) => void
- >;
-
- renderExplorerOptionWrapper({ disabled: true, onExport: testOnExport });
-
- // The "Add to Dashboard" button should be disabled
- const addToDashboardButton = screen.getByRole('button', {
- name: ADD_TO_DASHBOARD_BUTTON_NAME,
- });
- expect(addToDashboardButton).toBeDisabled();
- });
-});
diff --git a/frontend/src/container/ExplorerOptions/constants.ts b/frontend/src/container/ExplorerOptions/constants.ts
deleted file mode 100644
index f0e49bb5ab..0000000000
--- a/frontend/src/container/ExplorerOptions/constants.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-export enum PreservedViewsTypes {
- LOGS = 'logs',
- TRACES = 'traces',
- METRICS = 'metrics',
- METER = 'meter',
-}
diff --git a/frontend/src/container/ExplorerOptions/types.ts b/frontend/src/container/ExplorerOptions/types.ts
deleted file mode 100644
index a5a030c98b..0000000000
--- a/frontend/src/container/ExplorerOptions/types.ts
+++ /dev/null
@@ -1,47 +0,0 @@
-import { Dispatch, SetStateAction } from 'react';
-import { UseMutateAsyncFunction } from 'react-query';
-import type { NotificationInstance } from 'antd/es/notification/interface';
-import { AxiosResponse } from 'axios';
-import { SaveViewWithNameProps } from 'components/ExplorerCard/types';
-import { PANEL_TYPES } from 'constants/queryBuilder';
-import { ICurrentQueryData } from 'hooks/useHandleExplorerTabChange';
-import { ExplorerViews } from 'pages/LogsExplorer/utils';
-import { ICompositeMetricQuery } from 'types/api/alerts/compositeQuery';
-import { SaveViewPayloadProps, SaveViewProps } from 'types/api/saveViews/types';
-import { DataSource, QueryBuilderContextType } from 'types/common/queryBuilder';
-
-import { PreservedViewsTypes } from './constants';
-
-export interface SaveNewViewHandlerProps {
- viewName: string;
- compositeQuery: ICompositeMetricQuery;
- sourcePage: DataSource | 'meter';
- extraData: SaveViewProps['extraData'];
- panelType: PANEL_TYPES | null;
- notifications: NotificationInstance;
- refetchAllView: SaveViewWithNameProps['refetchAllView'];
- saveViewAsync: UseMutateAsyncFunction<
- AxiosResponse<SaveViewPayloadProps>,
- Error,
- SaveViewProps,
- SaveViewPayloadProps
- >;
- handlePopOverClose: SaveViewWithNameProps['handlePopOverClose'];
- redirectWithQueryBuilderData: QueryBuilderContextType['redirectWithQueryBuilderData'];
- setNewViewName: Dispatch<SetStateAction<string>>;
-}
-
-export type PreservedViewType =
- | PreservedViewsTypes.LOGS
- | PreservedViewsTypes.TRACES
- | PreservedViewsTypes.METRICS
- | PreservedViewsTypes.METER;
-
-export type PreservedViewsInLocalStorage = Partial<
- Record<PreservedViewType, { key: string; value: string }>
->;
-
-export type ChangeViewFunctionType = (
- view: ExplorerViews,
- querySearchParameters?: ICurrentQueryData,
-) => void;
diff --git a/frontend/src/container/ExplorerOptions/utils.ts b/frontend/src/container/ExplorerOptions/utils.ts
deleted file mode 100644
index 61c0264d8c..0000000000
--- a/frontend/src/container/ExplorerOptions/utils.ts
+++ /dev/null
@@ -1,123 +0,0 @@
-import { Color } from '@signozhq/design-tokens';
-import getLocalStorageKey from 'api/browser/localstorage/get';
-import setLocalStorageKey from 'api/browser/localstorage/set';
-import { showErrorNotification } from 'components/ExplorerCard/utils';
-import { LOCALSTORAGE } from 'constants/localStorage';
-import { QueryParams } from 'constants/query';
-import ROUTES from 'constants/routes';
-import { mapQueryDataFromApi } from 'lib/newQueryBuilder/queryBuilderMappers/mapQueryDataFromApi';
-import { DataSource } from 'types/common/queryBuilder';
-
-import { SaveNewViewHandlerProps } from './types';
-
-export const getRandomColor = (): string => {
- const colorKeys = Object.keys(Color) as (keyof typeof Color)[];
- const randomKey = colorKeys[Math.floor(Math.random() * colorKeys.length)];
- return Color[randomKey];
-};
-
-export const DATASOURCE_VS_ROUTES: Record<DataSource, string> = {
- [DataSource.METRICS]: ROUTES.METRICS_EXPLORER_EXPLORER,
- [DataSource.TRACES]: ROUTES.TRACES_EXPLORER,
- [DataSource.LOGS]: ROUTES.LOGS_EXPLORER,
-};
-
-export const saveNewViewHandler = ({
- saveViewAsync,
- refetchAllView,
- notifications,
- handlePopOverClose,
- viewName,
- compositeQuery,
- sourcePage,
- extraData,
- redirectWithQueryBuilderData,
- panelType,
- setNewViewName,
-}: SaveNewViewHandlerProps): void => {
- saveViewAsync(
- {
- viewName,
- compositeQuery,
- sourcePage: sourcePage as DataSource,
- extraData,
- },
- {
- onSuccess: (data) => {
- refetchAllView();
- redirectWithQueryBuilderData(mapQueryDataFromApi(compositeQuery), {
- [QueryParams.panelTypes]: panelType,
- [QueryParams.viewName]: viewName,
- [QueryParams.viewKey]: data.data.data,
- });
- notifications.success({
- message: 'View Saved Successfully',
- });
- },
- onError: (err) => {
- showErrorNotification(notifications, err);
- },
- onSettled: () => {
- handlePopOverClose();
- setNewViewName('');
- },
- },
- );
-};
-
-export const generateRGBAFromHex = (hex: string, opacity: number): string =>
- `rgba(${parseInt(hex.slice(1, 3), 16)}, ${parseInt(
- hex.slice(3, 5),
- 16,
- )}, ${parseInt(hex.slice(5, 7), 16)}, ${opacity})`;
-
-export const getExplorerToolBarVisibility = (dataSource: string): boolean => {
- try {
- const showExplorerToolbar = getLocalStorageKey(
- LOCALSTORAGE.SHOW_EXPLORER_TOOLBAR,
- );
- if (showExplorerToolbar === null) {
- const parsedShowExplorerToolbar: {
- [DataSource.LOGS]: boolean;
- [DataSource.TRACES]: boolean;
- [DataSource.METRICS]: boolean;
- } = {
- [DataSource.METRICS]: true,
- [DataSource.TRACES]: true,
- [DataSource.LOGS]: true,
- };
- setLocalStorageKey(
- LOCALSTORAGE.SHOW_EXPLORER_TOOLBAR,
- JSON.stringify(parsedShowExplorerToolbar),
- );
- return true;
- }
- const parsedShowExplorerToolbar = JSON.parse(showExplorerToolbar || '{}');
- return parsedShowExplorerToolbar[dataSource];
- } catch (error) {
- console.error(error);
- return false;
- }
-};
-
-export const setExplorerToolBarVisibility = (
- value: boolean,
- dataSource: string,
-): void => {
- try {
- const showExplorerToolbar = getLocalStorageKey(
- LOCALSTORAGE.SHOW_EXPLORER_TOOLBAR,
- );
- if (showExplorerToolbar) {
- const parsedShowExplorerToolbar = JSON.parse(showExplorerToolbar);
- parsedShowExplorerToolbar[dataSource] = value;
- setLocalStorageKey(
- LOCALSTORAGE.SHOW_EXPLORER_TOOLBAR,
- JSON.stringify(parsedShowExplorerToolbar),
- );
- return;
- }
- } catch (error) {
- console.error(error);
- }
-};
diff --git a/frontend/src/container/Home/SavedViews/SavedViews.tsx b/frontend/src/container/Home/SavedViews/SavedViews.tsx
index 55f7b47b20..1c34cd4056 100644
--- a/frontend/src/container/Home/SavedViews/SavedViews.tsx
+++ b/frontend/src/container/Home/SavedViews/SavedViews.tsx
@@ -10,9 +10,8 @@ import {
import ROUTES from 'constants/routes';
import { getSavedViewQuery } from 'container/SavedViews/utils/getSavedViewQuery';
import { useHandleExplorerTabChange } from 'hooks/useHandleExplorerTabChange';
-import { SOURCEPAGE_VS_ROUTES } from 'pages/SaveView/constants';
+import { SOURCEPAGE_VS_ROUTES } from 'container/SavedViews/constants';
import Card from 'periscope/components/Card/Card';
-import { useSavedViewEnabled } from 'hooks/useSavedViewEnabled';
import { useAppContext } from 'providers/App/App';
import { USER_ROLES } from 'types/roles';
@@ -36,7 +35,6 @@ export default function SavedViews({
loadingUserPreferences: boolean;
}): JSX.Element {
const { user } = useAppContext();
- const isSavedViewEnabled = useSavedViewEnabled();
const [selectedEntity, setSelectedEntity] = useState<string>('logs');
const [selectedEntityViews, setSelectedEntityViews] = useState<
SavedviewtypesSavedViewDTO[]
@@ -104,7 +102,6 @@ export default function SavedViews({
view.spec.panelType,
{
query: getSavedViewQuery(view),
- viewName: view.spec.displayName,
viewKey: view.id,
},
SOURCEPAGE_VS_ROUTES[selectedEntity],
@@ -117,19 +114,6 @@ export default function SavedViews({
}
}, [hasSavedViews, onUpdateChecklistDoneItem, loadingUserPreferences]);
- const footerLink = useMemo(() => {
- if (selectedEntity === 'logs') {
- return ROUTES.LOGS_SAVE_VIEWS;
- }
- if (selectedEntity === 'traces') {
- return ROUTES.TRACES_SAVE_VIEWS;
- }
- if (selectedEntity === 'metrics') {
- return ROUTES.METRICS_EXPLORER_VIEWS;
- }
- return '';
- }, [selectedEntity]);
-
const getStartedLink = useMemo(() => {
if (selectedEntity === 'logs') {
return ROUTES.LOGS_EXPLORER;
@@ -352,26 +336,6 @@ export default function SavedViews({
<Card.Content>
{selectedEntityViews.length > 0 ? renderSavedViews() : emptyStateCard()}
</Card.Content>
-
- {!isSavedViewEnabled && selectedEntityViews.length > 0 && (
- <Card.Footer>
- <div className="services-footer home-data-card-footer">
- <Link to={footerLink}>
- <Button
- type="link"
- className="periscope-btn link learn-more-link"
- onClick={(): void => {
- logEvent('Homepage: All saved views clicked', {
- entity: selectedEntity,
- });
- }}
- >
- All Views <ArrowRight size={12} />
- </Button>
- </Link>
- </div>
- </Card.Footer>
- )}
</Card>
);
}
diff --git a/frontend/src/container/LLMObservability/Explorer/Explorer.styles.scss b/frontend/src/container/LLMObservability/Explorer/Explorer.styles.scss
index e28fec0813..10804624b2 100644
--- a/frontend/src/container/LLMObservability/Explorer/Explorer.styles.scss
+++ b/frontend/src/container/LLMObservability/Explorer/Explorer.styles.scss
@@ -23,7 +23,6 @@
.traces-explorer-views {
padding: 8px;
- padding-bottom: 60px;
margin-bottom: 24px;
.ant-tabs-tabpane {
diff --git a/frontend/src/container/LLMObservability/Explorer/Explorer.tsx b/frontend/src/container/LLMObservability/Explorer/Explorer.tsx
index 439b0c2bf9..c5450304c7 100644
--- a/frontend/src/container/LLMObservability/Explorer/Explorer.tsx
+++ b/frontend/src/container/LLMObservability/Explorer/Explorer.tsx
@@ -3,7 +3,6 @@ import { useQueryClient } from 'react-query';
import { useSearchParams } from 'react-router-dom-v5-compat';
import * as Sentry from '@sentry/react';
import logEvent from 'api/common/logEvent';
-import ExplorerCard from 'components/ExplorerCard/ExplorerCard';
import QueryCancelledPlaceholder from 'components/QueryCancelledPlaceholder';
import QuickFiltersLayout from 'components/QuickFilters/QuickFiltersLayout/QuickFiltersLayout';
import { useSignalFieldApis } from 'components/QuickFilters/hooks/useSignalFieldApis';
@@ -225,11 +224,9 @@ function Explorer(): JSX.Element {
}
/>
</div>
- <ExplorerCard sourcepage={DataSource.TRACES}>
- <div className="query-section-container">
- <QuerySection />
- </div>
- </ExplorerCard>
+ <div className="query-section-container">
+ <QuerySection />
+ </div>
<div className="traces-explorer-views">
{isCancelled && (
diff --git a/frontend/src/container/LiveLogs/LiveLogsContainer/index.tsx b/frontend/src/container/LiveLogs/LiveLogsContainer/index.tsx
index b9b0661857..8202f7af61 100644
--- a/frontend/src/container/LiveLogs/LiveLogsContainer/index.tsx
+++ b/frontend/src/container/LiveLogs/LiveLogsContainer/index.tsx
@@ -6,7 +6,7 @@ import FieldsSelector from 'components/FieldsSelector';
import LogsFormatOptionsMenu from 'components/LogsFormatOptionsMenu/LogsFormatOptionsMenu';
import { MAX_LOGS_LIST_SIZE } from 'constants/liveTail';
import { LOCALSTORAGE } from 'constants/localStorage';
-import { ChangeViewFunctionType } from 'container/ExplorerOptions/types';
+import { ChangeViewFunctionType } from 'hooks/useHandleExplorerTabChange';
import GoToTop from 'container/GoToTop';
import { useOptionsMenu } from 'container/OptionsMenu';
import { LOGS_REQUIRED_COLUMNS } from 'container/OptionsMenu/constants';
diff --git a/frontend/src/container/LiveLogs/LiveLogsList/types.ts b/frontend/src/container/LiveLogs/LiveLogsList/types.ts
index 7c9af4180a..a5c39f4eec 100644
--- a/frontend/src/container/LiveLogs/LiveLogsList/types.ts
+++ b/frontend/src/container/LiveLogs/LiveLogsList/types.ts
@@ -1,4 +1,4 @@
-import { ChangeViewFunctionType } from 'container/ExplorerOptions/types';
+import { ChangeViewFunctionType } from 'hooks/useHandleExplorerTabChange';
import { ILog } from 'types/api/logs/log';
export interface ILiveLogsLog {
diff --git a/frontend/src/container/LogDetailedView/Overview.tsx b/frontend/src/container/LogDetailedView/Overview.tsx
index 97c5cf52c1..0a54bc09f5 100644
--- a/frontend/src/container/LogDetailedView/Overview.tsx
+++ b/frontend/src/container/LogDetailedView/Overview.tsx
@@ -1,5 +1,5 @@
import { ReactNode } from 'react';
-import { ChangeViewFunctionType } from 'container/ExplorerOptions/types';
+import { ChangeViewFunctionType } from 'hooks/useHandleExplorerTabChange';
import { DataViewer } from 'periscope/components/DataViewer';
import { ILog } from 'types/api/logs/log';
diff --git a/frontend/src/container/LogDetailedView/hooks/useLogAttributeActions.tsx b/frontend/src/container/LogDetailedView/hooks/useLogAttributeActions.tsx
index 8f0caae09f..deccf83a6c 100644
--- a/frontend/src/container/LogDetailedView/hooks/useLogAttributeActions.tsx
+++ b/frontend/src/container/LogDetailedView/hooks/useLogAttributeActions.tsx
@@ -2,9 +2,11 @@ import { useCallback, useMemo } from 'react';
import { CircleMinus, CirclePlus, Layers, RefreshCw } from '@signozhq/icons';
import { convertFiltersToExpression } from 'components/QueryBuilderV2/utils';
import { FeatureKeys } from 'constants/features';
-import { ChangeViewFunctionType } from 'container/ExplorerOptions/types';
import { useQueryBuilder } from 'hooks/queryBuilder/useQueryBuilder';
-import { ICurrentQueryData } from 'hooks/useHandleExplorerTabChange';
+import {
+ ChangeViewFunctionType,
+ ICurrentQueryData,
+} from 'hooks/useHandleExplorerTabChange';
import { ExplorerViews } from 'pages/LogsExplorer/utils';
import {
FieldContext,
diff --git a/frontend/src/container/LogsExplorerList/LogsExplorerList.interfaces.ts b/frontend/src/container/LogsExplorerList/LogsExplorerList.interfaces.ts
index cf2d265422..d6f0f617d5 100644
--- a/frontend/src/container/LogsExplorerList/LogsExplorerList.interfaces.ts
+++ b/frontend/src/container/LogsExplorerList/LogsExplorerList.interfaces.ts
@@ -1,4 +1,4 @@
-import { ChangeViewFunctionType } from 'container/ExplorerOptions/types';
+import { ChangeViewFunctionType } from 'hooks/useHandleExplorerTabChange';
import APIError from 'types/api/error';
import { ILog } from 'types/api/logs/log';
import { IBuilderQuery } from 'types/api/queryBuilder/queryBuilderData';
diff --git a/frontend/src/container/LogsExplorerViews/index.tsx b/frontend/src/container/LogsExplorerViews/index.tsx
index eeaf22c4e0..d1f963ae03 100644
--- a/frontend/src/container/LogsExplorerViews/index.tsx
+++ b/frontend/src/container/LogsExplorerViews/index.tsx
@@ -16,7 +16,6 @@ import setToLocalstorage from 'api/browser/localstorage/set';
import logEvent from 'api/common/logEvent';
import { ENTITY_VERSION_V5 } from 'constants/app';
import { LOCALSTORAGE } from 'constants/localStorage';
-import { AVAILABLE_EXPORT_PANEL_TYPES } from 'constants/panelTypes';
import { QueryParams } from 'constants/query';
import {
initialFilters,
@@ -24,8 +23,7 @@ import {
PANEL_TYPES,
} from 'constants/queryBuilder';
import { DEFAULT_PER_PAGE_VALUE } from 'container/Controls/config';
-import ExplorerOptionWrapper from 'container/ExplorerOptions/ExplorerOptionWrapper';
-import { ChangeViewFunctionType } from 'container/ExplorerOptions/types';
+import { ChangeViewFunctionType } from 'hooks/useHandleExplorerTabChange';
import GoToTop from 'container/GoToTop';
import LogsExplorerChart from 'container/LogsExplorerChart';
import LogsExplorerList from 'container/LogsExplorerList';
@@ -39,13 +37,9 @@ import {
} from 'container/LogsExplorerViews/explorerUtils';
import ExplorerActions from 'container/ExplorerActions/ExplorerActions';
import TimeSeriesView from 'container/TimeSeriesView/TimeSeriesView';
-import { ExportDashboard } from 'hooks/dashboard/useExportDashboards';
-import { useGetExportToDashboardLink } from 'hooks/dashboard/useGetExportToDashboardLink';
import { useCopyLogLink } from 'hooks/logs/useCopyLogLink';
import { useGetExplorerQueryRange } from 'hooks/queryBuilder/useGetExplorerQueryRange';
import { useQueryBuilder } from 'hooks/queryBuilder/useQueryBuilder';
-import { useSafeNavigate } from 'hooks/useSafeNavigate';
-import { useSavedViewEnabled } from 'hooks/useSavedViewEnabled';
import useUrlQueryData from 'hooks/useUrlQueryData';
import useUrlYAxisUnit from 'hooks/useUrlYAxisUnit';
import { isEmpty, isUndefined } from 'lodash-es';
@@ -59,7 +53,6 @@ import { Filter } from 'types/api/v5/queryRange';
import { QueryDataV3 } from 'types/api/widgets/getQuery';
import { DataSource } from 'types/common/queryBuilder';
import { GlobalReducer } from 'types/reducer/globalTime';
-import { v4 } from 'uuid';
import { getListOrderBy, setListOrderBy } from 'utils/explorerUtils';
import LogsActionsContainer from './LogsActionsContainer';
@@ -82,10 +75,6 @@ function LogsExplorerViewsContainer({
showLiveLogs: boolean;
handleChangeSelectedView: ChangeViewFunctionType;
}): JSX.Element {
- const { safeNavigate } = useSafeNavigate();
- const isSavedViewEnabled = useSavedViewEnabled();
- const getExportToDashboardLink = useGetExportToDashboardLink();
-
const [showFrequencyChart, setShowFrequencyChart] = useState(
() => getFromLocalstorage(LOCALSTORAGE.SHOW_FREQUENCY_CHART) === 'true',
);
@@ -276,49 +265,6 @@ function LogsExplorerViewsContainer({
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [data?.payload]);
- const handleExport = useCallback(
- (dashboard: ExportDashboard | null, isNewDashboard?: boolean): void => {
- if (!dashboard || !selectedPanelType) {
- return;
- }
-
- const panelTypeParam = AVAILABLE_EXPORT_PANEL_TYPES.includes(
- selectedPanelType,
- )
- ? selectedPanelType
- : PANEL_TYPES.TIME_SERIES;
-
- const widgetId = v4();
-
- if (!exportDefaultQuery) {
- return;
- }
-
- logEvent('Logs Explorer: Add to dashboard successful', {
- panelType: selectedPanelType,
- isNewDashboard,
- dashboardName: dashboard?.title,
- });
-
- const dashboardEditView = getExportToDashboardLink({
- query: exportDefaultQuery,
- panelType: panelTypeParam,
- dashboardId: dashboard.id,
- widgetId,
- });
-
- if (dashboardEditView) {
- safeNavigate(dashboardEditView);
- }
- },
- [
- safeNavigate,
- exportDefaultQuery,
- selectedPanelType,
- getExportToDashboardLink,
- ],
- );
-
useEffect(() => {
const currentData = data?.payload?.data?.newResult?.data?.result || [];
if (currentData.length > 0 && currentData[0].list) {
@@ -517,16 +463,6 @@ function LogsExplorerViewsContainer({
</div>
<GoToTop />
-
- {!isSavedViewEnabled && (
- <ExplorerOptionWrapper
- disabled={!stagedQuery}
- query={exportDefaultQuery}
- onExport={handleExport}
- sourcepage={DataSource.LOGS}
- handleChangeSelectedView={handleChangeSelectedView}
- />
- )}
</div>
);
}
diff --git a/frontend/src/container/LogsExplorerViews/tests/LogsExplorerPagination.test.tsx b/frontend/src/container/LogsExplorerViews/tests/LogsExplorerPagination.test.tsx
index 778550c758..fd18a1a790 100644
--- a/frontend/src/container/LogsExplorerViews/tests/LogsExplorerPagination.test.tsx
+++ b/frontend/src/container/LogsExplorerViews/tests/LogsExplorerPagination.test.tsx
@@ -138,13 +138,6 @@ jest.mock(
return <div>MockQueryBuilderSearchV2</div>;
},
);
-jest.mock(
- 'container/ExplorerOptions/ExplorerOptionWrapper',
- () =>
- function MockExplorerOptionWrapper(): JSX.Element {
- return <div>MockExplorerOptionWrapper</div>;
- },
-);
jest.mock(
'components/QuickFilters/QuickFilters',
() =>
@@ -416,7 +409,6 @@ function LogsExplorerWithMockContext({
updateQueriesData: (): Query => initialQueriesMap.logs,
initQueryBuilderData: noop,
handleOnUnitsChange: noop,
- isStagedQueryUpdated: (): boolean => false,
}),
[currentQuery, stagedQuery, handleRunQuery],
);
diff --git a/frontend/src/container/LogsExplorerViews/tests/mock.ts b/frontend/src/container/LogsExplorerViews/tests/mock.ts
index 29ebbd167e..aeb29f4739 100644
--- a/frontend/src/container/LogsExplorerViews/tests/mock.ts
+++ b/frontend/src/container/LogsExplorerViews/tests/mock.ts
@@ -200,5 +200,4 @@ export const mockQueryBuilderContextValue = {
updateQueriesData: (): Query => initialQueriesMap.logs,
initQueryBuilderData: noop,
handleOnUnitsChange: noop,
- isStagedQueryUpdated: (): boolean => false,
};
diff --git a/frontend/src/container/MeterExplorer/Explorer/Explorer.styles.scss b/frontend/src/container/MeterExplorer/Explorer/Explorer.styles.scss
index c7a4099157..5dfd29308f 100644
--- a/frontend/src/container/MeterExplorer/Explorer/Explorer.styles.scss
+++ b/frontend/src/container/MeterExplorer/Explorer/Explorer.styles.scss
@@ -1,8 +1,5 @@
.meter-explorer-container {
.meter-explorer-content-section {
- // Clearance for the fixed ExplorerOptions bar.
- padding-bottom: 80px;
-
// Meant to fix the query builder colors
--input-background: var(--l2-background);
--input-hover-background: var(--l2-background);
diff --git a/frontend/src/container/MeterExplorer/Explorer/Explorer.tsx b/frontend/src/container/MeterExplorer/Explorer/Explorer.tsx
index affdbba4c1..d8205cd9f4 100644
--- a/frontend/src/container/MeterExplorer/Explorer/Explorer.tsx
+++ b/frontend/src/container/MeterExplorer/Explorer/Explorer.tsx
@@ -10,38 +10,22 @@ import { useSignalFieldApis } from 'components/QuickFilters/hooks/useSignalField
import { QuickFiltersSource } from 'components/QuickFilters/types';
import { initialQueryMeterWithType, PANEL_TYPES } from 'constants/queryBuilder';
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
-import ExplorerOptionWrapper from 'container/ExplorerOptions/ExplorerOptionWrapper';
import RightToolbarActions from 'container/QueryBuilder/components/ToolbarActions/RightToolbarActions';
import DateTimeSelector from 'container/TopNav/DateTimeSelectionV2';
-import { ExportDashboard } from 'hooks/dashboard/useExportDashboards';
-import { useGetExportToDashboardLink } from 'hooks/dashboard/useGetExportToDashboardLink';
import { useQueryBuilder } from 'hooks/queryBuilder/useQueryBuilder';
import { useShareBuilderUrl } from 'hooks/queryBuilder/useShareBuilderUrl';
-import { useSafeNavigate } from 'hooks/useSafeNavigate';
-import { useSavedViewEnabled } from 'hooks/useSavedViewEnabled';
import { Filter } from '@signozhq/icons';
import ErrorBoundaryFallback from 'pages/ErrorBoundaryFallback/ErrorBoundaryFallback';
-import { Query } from 'types/api/queryBuilder/queryBuilderData';
import { DataSource } from 'types/common/queryBuilder';
-import { v4 as uuid } from 'uuid';
import { MeterExplorerEventKeys, MeterExplorerEvents } from '../events';
import TimeSeries from './TimeSeries';
-import { splitQueryIntoOneChartPerQuery } from './utils';
import './Explorer.styles.scss';
function Explorer(): JSX.Element {
const quickFilterFieldApis = useSignalFieldApis();
- const {
- handleRunQuery,
- stagedQuery,
- updateAllQueriesOperators,
- currentQuery,
- } = useQueryBuilder();
- const { safeNavigate } = useSafeNavigate();
- const isSavedViewEnabled = useSavedViewEnabled();
- const getExportToDashboardLink = useGetExportToDashboardLink();
+ const { handleRunQuery, updateAllQueriesOperators } = useQueryBuilder();
const queryClient = useQueryClient();
const [isLoadingQueries, setIsLoadingQueries] = useState(false);
const [isCancelled, setIsCancelled] = useState(false);
@@ -70,51 +54,8 @@ function Explorer(): JSX.Element {
[updateAllQueriesOperators],
);
- const exportDefaultQuery = useMemo(
- () =>
- updateAllQueriesOperators(
- currentQuery || initialQueryMeterWithType,
- PANEL_TYPES.BAR,
- DataSource.METRICS,
- 'meter' as 'meter' | '',
- ),
- [currentQuery, updateAllQueriesOperators],
- );
-
useShareBuilderUrl({ defaultValue: defaultQuery });
- const handleExport = useCallback(
- (
- dashboard: ExportDashboard | null,
- _isNewDashboard?: boolean,
- queryToExport?: Query,
- ): void => {
- if (!dashboard) {
- return;
- }
-
- const widgetId = uuid();
-
- const dashboardEditView = getExportToDashboardLink({
- query: queryToExport || exportDefaultQuery,
- panelType: PANEL_TYPES.BAR,
- dashboardId: dashboard.id,
- widgetId,
- });
-
- if (dashboardEditView) {
- safeNavigate(dashboardEditView);
- }
- },
- [exportDefaultQuery, safeNavigate, getExportToDashboardLink],
- );
-
- const splitedQueries = useMemo(
- () =>
- splitQueryIntoOneChartPerQuery(stagedQuery || initialQueryMeterWithType),
- [stagedQuery],
- );
-
useEffect(() => {
logEvent(MeterExplorerEvents.TabChanged, {
[MeterExplorerEventKeys.Tab]: 'explorer',
@@ -178,17 +119,6 @@ function Explorer(): JSX.Element {
/>
</div>
</div>
- {!isSavedViewEnabled && (
- <ExplorerOptionWrapper
- disabled={!stagedQuery}
- query={exportDefaultQuery}
- sourcepage={DataSource.METRICS}
- signalSource="meter"
- onExport={handleExport}
- isOneChartPerQuery={false}
- splitedQueries={splitedQueries}
- />
- )}
</div>
</QuickFiltersLayout>
</Sentry.ErrorBoundary>
diff --git a/frontend/src/container/MeterExplorer/Explorer/utils.tsx b/frontend/src/container/MeterExplorer/Explorer/utils.tsx
deleted file mode 100644
index 78af296684..0000000000
--- a/frontend/src/container/MeterExplorer/Explorer/utils.tsx
+++ /dev/null
@@ -1,37 +0,0 @@
-import { Query } from 'types/api/queryBuilder/queryBuilderData';
-import { v4 as uuid } from 'uuid';
-
-export const splitQueryIntoOneChartPerQuery = (query: Query): Query[] => {
- const queries: Query[] = [];
-
- query.builder.queryData.forEach((currentQuery) => {
- const newQuery = {
- ...query,
- id: uuid(),
- builder: {
- ...query.builder,
- queryData: [currentQuery],
- queryFormulas: [],
- },
- };
- queries.push(newQuery);
- });
-
- query.builder.queryFormulas.forEach((currentFormula) => {
- const newQuery = {
- ...query,
- id: uuid(),
- builder: {
- ...query.builder,
- queryFormulas: [currentFormula],
- queryData: query.builder.queryData.map((currentQuery) => ({
- ...currentQuery,
- disabled: true,
- })),
- },
- };
- queries.push(newQuery);
- });
-
- return queries;
-};
diff --git a/frontend/src/container/MetricsExplorer/Explorer/Explorer.styles.scss b/frontend/src/container/MetricsExplorer/Explorer/Explorer.styles.scss
index 0e894d2580..9f95659705 100644
--- a/frontend/src/container/MetricsExplorer/Explorer/Explorer.styles.scss
+++ b/frontend/src/container/MetricsExplorer/Explorer/Explorer.styles.scss
@@ -1,6 +1,4 @@
.metrics-explorer-explore-container {
- padding-bottom: 80px;
-
// Meant to fix the query builder colors
--input-background: var(--l2-background);
--input-hover-background: var(--l2-background);
diff --git a/frontend/src/container/MetricsExplorer/Explorer/Explorer.tsx b/frontend/src/container/MetricsExplorer/Explorer/Explorer.tsx
index 6dc9382679..6341dcde96 100644
--- a/frontend/src/container/MetricsExplorer/Explorer/Explorer.tsx
+++ b/frontend/src/container/MetricsExplorer/Explorer/Explorer.tsx
@@ -14,20 +14,11 @@ import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
import { usePageActions } from 'container/AIAssistant/pageActions/usePageActions';
import { SavedviewtypesSourceDTO } from 'api/generated/services/sigNoz.schemas';
import QuickFiltersLayout from 'components/QuickFilters/QuickFiltersLayout/QuickFiltersLayout';
-import ExplorerOptionWrapper from 'container/ExplorerOptions/ExplorerOptionWrapper';
import RightToolbarActions from 'container/QueryBuilder/components/ToolbarActions/RightToolbarActions';
import DateTimeSelector from 'container/TopNav/DateTimeSelectionV2';
-import { ExportDashboard } from 'hooks/dashboard/useExportDashboards';
-import { useGetExportToDashboardLink } from 'hooks/dashboard/useGetExportToDashboardLink';
import { useQueryBuilder } from 'hooks/queryBuilder/useQueryBuilder';
import { useShareBuilderUrl } from 'hooks/queryBuilder/useShareBuilderUrl';
-import {
- ICurrentQueryData,
- useHandleExplorerTabChange,
-} from 'hooks/useHandleExplorerTabChange';
import { useIsAIAssistantEnabled } from 'hooks/useIsAIAssistantEnabled';
-import { useSafeNavigate } from 'hooks/useSafeNavigate';
-import { useSavedViewEnabled } from 'hooks/useSavedViewEnabled';
import { isEmpty } from 'lodash-es';
import ErrorBoundaryFallback from 'pages/ErrorBoundaryFallback/ErrorBoundaryFallback';
import {
@@ -35,13 +26,9 @@ import {
metricsRunQueryAction,
metricsSaveViewAction,
} from 'pages/MetricsExplorer/aiActions';
-import { ExplorerViews } from 'pages/LogsExplorer/utils';
import { Warning } from 'types/api';
-import { Query } from 'types/api/queryBuilder/queryBuilderData';
import { MetricAggregation } from 'types/api/v5/queryRange';
import { DataSource } from 'types/common/queryBuilder';
-import { explorerViewToPanelType } from 'utils/explorerUtils';
-import { v4 as uuid } from 'uuid';
import { MetricsExplorerEventKeys, MetricsExplorerEvents } from '../events';
import MetricDetails from '../MetricDetails/MetricDetails';
@@ -62,14 +49,9 @@ function Explorer(): JSX.Element {
stagedQuery,
updateAllQueriesOperators,
currentQuery,
- handleSetConfig,
handleSetQueryData,
redirectWithQueryBuilderData,
} = useQueryBuilder();
- const { safeNavigate } = useSafeNavigate();
- const isSavedViewEnabled = useSavedViewEnabled();
- const getExportToDashboardLink = useGetExportToDashboardLink();
- const { handleExplorerTabChange } = useHandleExplorerTabChange();
const isAIAssistantEnabled = useIsAIAssistantEnabled();
const [isMetricDetailsOpen, setIsMetricDetailsOpen] = useState(false);
const [showSidebar, setShowSidebar] = useState(true);
@@ -220,16 +202,6 @@ function Explorer(): JSX.Element {
useShareBuilderUrl({ defaultValue: defaultQuery });
- const handleChangeSelectedView = useCallback(
- (view: ExplorerViews, querySearchParameters?: ICurrentQueryData): void => {
- const nextPanelType =
- explorerViewToPanelType[view] || PANEL_TYPES.TIME_SERIES;
- handleSetConfig(nextPanelType, DataSource.METRICS);
- handleExplorerTabChange(nextPanelType, querySearchParameters);
- },
- [handleSetConfig, handleExplorerTabChange],
- );
-
// ─── AI Assistant page actions (only when license feature is on) ───────────
const aiActions = useMemo(
() =>
@@ -265,40 +237,6 @@ function Explorer(): JSX.Element {
usePageActions('metrics-explorer', aiActions);
// ───────────────────────────────────────────────────────────────────────────
- const handleExport = useCallback(
- (
- dashboard: ExportDashboard | null,
- _isNewDashboard?: boolean,
- queryToExport?: Query,
- ): void => {
- if (!dashboard) {
- return;
- }
-
- const widgetId = uuid();
-
- let query = queryToExport || exportDefaultQuery;
- if (yAxisUnit && !query.unit) {
- query = {
- ...query,
- unit: yAxisUnit,
- };
- }
-
- const dashboardEditView = getExportToDashboardLink({
- query,
- panelType: PANEL_TYPES.TIME_SERIES,
- dashboardId: dashboard.id,
- widgetId,
- });
-
- if (dashboardEditView) {
- safeNavigate(dashboardEditView);
- }
- },
- [exportDefaultQuery, safeNavigate, yAxisUnit, getExportToDashboardLink],
- );
-
const splitedQueries = useMemo(
() =>
splitQueryIntoOneChartPerQuery(
@@ -424,17 +362,6 @@ function Explorer(): JSX.Element {
</div>
</div>
</QuickFiltersLayout>
- {!isSavedViewEnabled && (
- <ExplorerOptionWrapper
- disabled={!stagedQuery}
- query={exportDefaultQuery}
- sourcepage={DataSource.METRICS}
- onExport={handleExport}
- isOneChartPerQuery={showOneChartPerQuery}
- splitedQueries={splitedQueries}
- handleChangeSelectedView={handleChangeSelectedView}
- />
- )}
{isMetricDetailsOpen && selectedMetricName && (
<MetricDetails
metricName={selectedMetricName}
diff --git a/frontend/src/container/MetricsExplorer/Explorer/__tests__/Explorer.test.tsx b/frontend/src/container/MetricsExplorer/Explorer/__tests__/Explorer.test.tsx
index 9a98a0bcc7..47039548fd 100644
--- a/frontend/src/container/MetricsExplorer/Explorer/__tests__/Explorer.test.tsx
+++ b/frontend/src/container/MetricsExplorer/Explorer/__tests__/Explorer.test.tsx
@@ -39,7 +39,6 @@ const mockUseQueryBuilderData = {
currentQuery: initialQueriesMap[DataSource.METRICS],
resetQuery: jest.fn(),
redirectWithQueryBuilderData: jest.fn(),
- isStagedQueryUpdated: jest.fn(),
handleSetQueryData: jest.fn(),
handleSetFormulaData: jest.fn(),
handleSetQueryItemData: jest.fn(),
diff --git a/frontend/src/container/MetricsExplorer/Summary/__tests__/Summary.test.tsx b/frontend/src/container/MetricsExplorer/Summary/__tests__/Summary.test.tsx
index 0f6fd9a78f..4094d80b07 100644
--- a/frontend/src/container/MetricsExplorer/Summary/__tests__/Summary.test.tsx
+++ b/frontend/src/container/MetricsExplorer/Summary/__tests__/Summary.test.tsx
@@ -68,7 +68,6 @@ const mockUseQueryBuilderData = {
currentQuery: initialQueriesMap[DataSource.METRICS],
resetQuery: jest.fn(),
redirectWithQueryBuilderData: jest.fn(),
- isStagedQueryUpdated: jest.fn(),
handleSetQueryData: jest.fn(),
handleSetFormulaData: jest.fn(),
handleSetQueryItemData: jest.fn(),
diff --git a/frontend/src/container/MetricsExplorer/events.ts b/frontend/src/container/MetricsExplorer/events.ts
index c166a9bdb8..39ff6f8bb2 100644
--- a/frontend/src/container/MetricsExplorer/events.ts
+++ b/frontend/src/container/MetricsExplorer/events.ts
@@ -20,10 +20,7 @@ export enum MetricsExplorerEvents {
AddToAlertClicked = 'Metrics Explorer: Add to alert clicked',
AddToDashboardClicked = 'Metrics Explorer: Add to dashboard clicked',
AddToDashboardSuccessful = 'Metrics Explorer: Add to dashboard successful',
- SaveViewClicked = 'Metrics Explorer: Save view clicked',
SearchApplied = 'Metrics Explorer: Search applied',
- ViewEdited = 'Metrics Explorer: View edited',
- ViewDeleted = 'Metrics Explorer: View deleted',
}
export enum MetricsExplorerEventKeys {
@@ -46,7 +43,6 @@ export enum MetricsExplorerEventKeys {
SpaceAggregationLabels = 'spaceAggregationLabels',
OneChartPerQueryEnabled = 'oneChartPerQueryEnabled',
YAxisUnit = 'yAxisUnit',
- ViewName = 'viewName',
Filters = 'filters',
TimeRange = 'timeRange',
}
diff --git a/frontend/src/container/SavedViews/constants.ts b/frontend/src/container/SavedViews/constants.ts
index 4a4ce0cf8f..ab768aa1cd 100644
--- a/frontend/src/container/SavedViews/constants.ts
+++ b/frontend/src/container/SavedViews/constants.ts
@@ -4,6 +4,7 @@ import {
SavedviewtypesSourceDTO,
} from 'api/generated/services/sigNoz.schemas';
import { QueryParams } from 'constants/query';
+import ROUTES from 'constants/routes';
import {
buildSavedViewDeletePermission,
buildSavedViewUpdatePermission,
@@ -30,6 +31,15 @@ export const SAVED_VIEW_URL_PARAMS = [
QueryParams.panelTypes,
];
+export const SOURCEPAGE_VS_ROUTES: {
+ [key: string]: Partial<(typeof ROUTES)[keyof typeof ROUTES]>;
+} = {
+ logs: ROUTES.LOGS_EXPLORER,
+ traces: ROUTES.TRACES_EXPLORER,
+ metrics: ROUTES.METRICS_EXPLORER_EXPLORER,
+ meter: ROUTES.METER_EXPLORER,
+} as const;
+
export const MY_VIEW_NAME = 'My view';
export const SAVED_VIEW_LOAD_FAILED_NAME = 'View failed to load';
diff --git a/frontend/src/container/SavedViews/hooks/useLastUsedView.ts b/frontend/src/container/SavedViews/hooks/useLastUsedView.ts
index abc2db994c..e216a7249a 100644
--- a/frontend/src/container/SavedViews/hooks/useLastUsedView.ts
+++ b/frontend/src/container/SavedViews/hooks/useLastUsedView.ts
@@ -6,9 +6,8 @@ import { LOCALSTORAGE } from 'constants/localStorage';
import {
PreservedViewsInLocalStorage,
PreservedViewType,
-} from 'container/ExplorerOptions/types';
-
-import { UseLastUsedViewResult } from '../types';
+ UseLastUsedViewResult,
+} from '../types';
function readLastUsedViews(): PreservedViewsInLocalStorage {
try {
diff --git a/frontend/src/container/SavedViews/types.ts b/frontend/src/container/SavedViews/types.ts
index 47fe5ed6c4..1fc3faaf62 100644
--- a/frontend/src/container/SavedViews/types.ts
+++ b/frontend/src/container/SavedViews/types.ts
@@ -225,3 +225,20 @@ export interface SavedViewsEmptyStateProps {
isSaving: boolean;
onSave: (displayName: string) => Promise<boolean>;
}
+
+export enum PreservedViewsTypes {
+ LOGS = 'logs',
+ TRACES = 'traces',
+ METRICS = 'metrics',
+ METER = 'meter',
+}
+
+export type PreservedViewType =
+ | PreservedViewsTypes.LOGS
+ | PreservedViewsTypes.TRACES
+ | PreservedViewsTypes.METRICS
+ | PreservedViewsTypes.METER;
+
+export type PreservedViewsInLocalStorage = Partial<
+ Record<PreservedViewType, { key: string; value: string }>
+>;
diff --git a/frontend/src/container/TopNav/DateTimeSelectionV2/constants.ts b/frontend/src/container/TopNav/DateTimeSelectionV2/constants.ts
index 6eee614d9c..af137b34da 100644
--- a/frontend/src/container/TopNav/DateTimeSelectionV2/constants.ts
+++ b/frontend/src/container/TopNav/DateTimeSelectionV2/constants.ts
@@ -166,10 +166,8 @@ export const routesToSkip = [
ROUTES.LOGS,
ROUTES.MY_SETTINGS,
ROUTES.LIST_LICENSES,
- ROUTES.LOGS_SAVE_VIEWS,
ROUTES.LOGS_PIPELINES,
ROUTES.TRACES_EXPLORER,
- ROUTES.TRACES_SAVE_VIEWS,
ROUTES.TRACES_FUNNELS,
ROUTES.TRACES_FUNNELS_DETAIL,
ROUTES.SHORTCUTS,
@@ -188,7 +186,6 @@ export const routesToSkip = [
ROUTES.INFRASTRUCTURE_MONITORING_KUBERNETES,
ROUTES.METRICS_EXPLORER,
ROUTES.METRICS_EXPLORER_EXPLORER,
- ROUTES.METRICS_EXPLORER_VIEWS,
ROUTES.API_MONITORING,
ROUTES.CHANNELS_NEW,
ROUTES.CHANNELS_EDIT,
@@ -198,7 +195,6 @@ export const routesToSkip = [
ROUTES.NOT_FOUND,
ROUTES.METER_EXPLORER,
ROUTES.METER,
- ROUTES.METER_EXPLORER_VIEWS,
ROUTES.METRICS_EXPLORER_VOLUME_CONTROL,
ROUTES.SOMETHING_WENT_WRONG,
ROUTES.AI_OBSERVABILITY_OVERVIEW,
diff --git a/frontend/src/hooks/__tests__/useHandleExplorerTabChange.test.ts b/frontend/src/hooks/__tests__/useHandleExplorerTabChange.test.ts
index 340fb41e93..1eda68466c 100644
--- a/frontend/src/hooks/__tests__/useHandleExplorerTabChange.test.ts
+++ b/frontend/src/hooks/__tests__/useHandleExplorerTabChange.test.ts
@@ -6,8 +6,7 @@ import { IBuilderQuery, Query } from 'types/api/queryBuilder/queryBuilderData';
jest.mock('hooks/queryBuilder/useQueryBuilder');
jest.mock('hooks/saveViews/useGetSavedViewParams', () => ({
- useGetSavedViewParams: (): { viewName: string; viewKey: string } => ({
- viewName: '',
+ useGetSavedViewParams: (): { viewKey: string } => ({
viewKey: '',
}),
}));
diff --git a/frontend/src/hooks/saveViews/__tests__/useGetSavedViewParams.test.ts b/frontend/src/hooks/saveViews/__tests__/useGetSavedViewParams.test.ts
index 1cb251bf3e..29ac6c7bea 100644
--- a/frontend/src/hooks/saveViews/__tests__/useGetSavedViewParams.test.ts
+++ b/frontend/src/hooks/saveViews/__tests__/useGetSavedViewParams.test.ts
@@ -21,40 +21,30 @@ describe('useGetSavedViewParams', () => {
const { result } = renderHook(() => useGetSavedViewParams());
- expect(result.current).toStrictEqual({ viewName: '', viewKey: '' });
+ expect(result.current).toStrictEqual({ viewKey: '' });
});
it('parses JSON-stringified values', () => {
- setSearch(
- `viewName=${encodeURIComponent(
- JSON.stringify('Hindsight'),
- )}&viewKey=${encodeURIComponent(JSON.stringify('abc-123'))}`,
- );
+ setSearch(`viewKey=${encodeURIComponent(JSON.stringify('abc-123'))}`);
const { result } = renderHook(() => useGetSavedViewParams());
- expect(result.current).toStrictEqual({
- viewName: 'Hindsight',
- viewKey: 'abc-123',
- });
+ expect(result.current).toStrictEqual({ viewKey: 'abc-123' });
});
it('falls back to the raw string when a value is not valid JSON', () => {
- setSearch('viewName=Hindsight&viewKey=some-uuid-value');
+ setSearch('viewKey=some-uuid-value');
const { result } = renderHook(() => useGetSavedViewParams());
- expect(result.current).toStrictEqual({
- viewName: 'Hindsight',
- viewKey: 'some-uuid-value',
- });
+ expect(result.current).toStrictEqual({ viewKey: 'some-uuid-value' });
});
it('does not throw and keeps the raw string for non-string JSON', () => {
- setSearch('viewName=123');
+ setSearch('viewKey=123');
const { result } = renderHook(() => useGetSavedViewParams());
- expect(result.current).toStrictEqual({ viewName: '123', viewKey: '' });
+ expect(result.current).toStrictEqual({ viewKey: '123' });
});
});
diff --git a/frontend/src/hooks/saveViews/useDeleteView.ts b/frontend/src/hooks/saveViews/useDeleteView.ts
deleted file mode 100644
index a1d58c204d..0000000000
--- a/frontend/src/hooks/saveViews/useDeleteView.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import { useMutation, UseMutationResult, useQueryClient } from 'react-query';
-import { invalidateListSavedViews } from 'api/generated/services/saved-view';
-import { deleteView } from 'api/saveView/deleteView';
-import { DeleteViewPayloadProps } from 'types/api/saveViews/types';
-
-export const useDeleteView = (
- uuid: string,
-): UseMutationResult<DeleteViewPayloadProps, Error, string> => {
- const queryClient = useQueryClient();
-
- return useMutation({
- mutationKey: [uuid],
- mutationFn: () => deleteView(uuid),
- // v1 and v2 share storage; consumers already on v2 must see this write.
- // Temporary till the v1 client is deleted with the explorer bar.
- onSuccess: () => invalidateListSavedViews(queryClient),
- });
-};
diff --git a/frontend/src/hooks/saveViews/useGetAllViews.ts b/frontend/src/hooks/saveViews/useGetAllViews.ts
deleted file mode 100644
index e0e495799c..0000000000
--- a/frontend/src/hooks/saveViews/useGetAllViews.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import { useQuery, UseQueryResult } from 'react-query';
-import { getAllViews } from 'api/saveView/getAllViews';
-import { AxiosError, AxiosResponse } from 'axios';
-import { AllViewsProps } from 'types/api/saveViews/types';
-import { DataSource } from 'types/common/queryBuilder';
-
-export const useGetAllViews = (
- sourcepage: DataSource | 'meter',
- enabled?: boolean,
-): UseQueryResult<AxiosResponse<AllViewsProps>, AxiosError> =>
- useQuery<AxiosResponse<AllViewsProps>, AxiosError>({
- queryKey: [{ sourcepage }],
- queryFn: () => getAllViews(sourcepage as DataSource),
- ...(enabled !== undefined ? { enabled } : {}),
- });
diff --git a/frontend/src/hooks/saveViews/useGetSavedViewParams.ts b/frontend/src/hooks/saveViews/useGetSavedViewParams.ts
index dcba66991c..3891e0537f 100644
--- a/frontend/src/hooks/saveViews/useGetSavedViewParams.ts
+++ b/frontend/src/hooks/saveViews/useGetSavedViewParams.ts
@@ -3,7 +3,6 @@ import { QueryParams } from 'constants/query';
import useUrlQuery from 'hooks/useUrlQuery';
interface SavedViewParams {
- viewName: string;
viewKey: string;
}
@@ -25,7 +24,6 @@ export const useGetSavedViewParams = (): SavedViewParams => {
return useMemo(
() => ({
- viewName: parseViewParam(urlQuery.get(QueryParams.viewName)),
viewKey: parseViewParam(urlQuery.get(QueryParams.viewKey)),
}),
[urlQuery],
diff --git a/frontend/src/hooks/saveViews/useSaveView.ts b/frontend/src/hooks/saveViews/useSaveView.ts
deleted file mode 100644
index 0a08b210b6..0000000000
--- a/frontend/src/hooks/saveViews/useSaveView.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-import { useMutation, UseMutationResult, useQueryClient } from 'react-query';
-import { invalidateListSavedViews } from 'api/generated/services/saved-view';
-import { saveView } from 'api/saveView/saveView';
-import { AxiosResponse } from 'axios';
-import { SaveViewPayloadProps, SaveViewProps } from 'types/api/saveViews/types';
-
-export const useSaveView = ({
- compositeQuery,
- sourcePage,
- viewName,
- extraData,
-}: SaveViewProps): UseMutationResult<
- AxiosResponse<SaveViewPayloadProps>,
- Error,
- SaveViewProps,
- SaveViewPayloadProps
-> => {
- const queryClient = useQueryClient();
-
- return useMutation({
- mutationKey: [viewName, sourcePage, compositeQuery, extraData],
- mutationFn: saveView,
- // v1 and v2 share storage; consumers already on v2 must see this write.
- // Temporary till the v1 client is deleted with the explorer bar.
- onSuccess: () => invalidateListSavedViews(queryClient),
- });
-};
diff --git a/frontend/src/hooks/saveViews/useUpdateView.ts b/frontend/src/hooks/saveViews/useUpdateView.ts
deleted file mode 100644
index dc68c75723..0000000000
--- a/frontend/src/hooks/saveViews/useUpdateView.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-import { useMutation, UseMutationResult, useQueryClient } from 'react-query';
-import { invalidateListSavedViews } from 'api/generated/services/saved-view';
-import { updateView } from 'api/saveView/updateView';
-import {
- UpdateViewPayloadProps,
- UpdateViewProps,
-} from 'types/api/saveViews/types';
-
-export const useUpdateView = ({
- compositeQuery,
- viewName,
- extraData,
- sourcePage,
- viewKey,
-}: UpdateViewProps): UseMutationResult<
- UpdateViewPayloadProps,
- Error,
- UpdateViewProps,
- UpdateViewPayloadProps
-> => {
- const queryClient = useQueryClient();
-
- return useMutation({
- mutationKey: [viewName, sourcePage, compositeQuery, extraData],
- mutationFn: () =>
- updateView({
- compositeQuery,
- viewName,
- extraData,
- sourcePage,
- viewKey,
- }),
- // v1 and v2 share storage; consumers already on v2 must see this write.
- // Temporary till the v1 client is deleted with the explorer bar.
- onSuccess: () => invalidateListSavedViews(queryClient),
- });
-};
diff --git a/frontend/src/hooks/useHandleExplorerTabChange.ts b/frontend/src/hooks/useHandleExplorerTabChange.ts
index da4476a752..51cf4413ef 100644
--- a/frontend/src/hooks/useHandleExplorerTabChange.ts
+++ b/frontend/src/hooks/useHandleExplorerTabChange.ts
@@ -2,6 +2,7 @@ import { useCallback } from 'react';
import { QueryParams } from 'constants/query';
import { initialAutocompleteData, PANEL_TYPES } from 'constants/queryBuilder';
import ROUTES from 'constants/routes';
+import { ExplorerViews } from 'pages/LogsExplorer/utils';
import { Query } from 'types/api/queryBuilder/queryBuilderData';
import { DataSource } from 'types/common/queryBuilder';
@@ -9,11 +10,15 @@ import { useGetSavedViewParams } from './saveViews/useGetSavedViewParams';
import { useQueryBuilder } from './queryBuilder/useQueryBuilder';
export interface ICurrentQueryData {
- viewName?: string;
viewKey?: string;
query: Query;
}
+export type ChangeViewFunctionType = (
+ view: ExplorerViews,
+ querySearchParameters?: ICurrentQueryData,
+) => void;
+
export const useHandleExplorerTabChange = (): {
handleExplorerTabChange: (
type: string,
@@ -30,7 +35,7 @@ export const useHandleExplorerTabChange = (): {
updateQueriesData,
} = useQueryBuilder();
- const { viewName, viewKey } = useGetSavedViewParams();
+ const { viewKey } = useGetSavedViewParams();
const getUpdateQuery = useCallback(
(newPanelType: PANEL_TYPES): Query => {
@@ -73,21 +78,19 @@ export const useHandleExplorerTabChange = (): {
const query = currentQueryData?.query || getUpdateQuery(newPanelType);
const nextViewKey = currentQueryData?.viewKey || viewKey;
- const nextViewName = currentQueryData?.viewName || viewName;
redirectWithQueryBuilderData(
query,
{
[QueryParams.panelTypes]: newPanelType,
...(nextViewKey ? { [QueryParams.viewKey]: nextViewKey } : {}),
- ...(nextViewName ? { [QueryParams.viewName]: nextViewName } : {}),
},
redirectToUrl,
undefined,
newTab,
);
},
- [panelType, getUpdateQuery, redirectWithQueryBuilderData, viewName, viewKey],
+ [panelType, getUpdateQuery, redirectWithQueryBuilderData, viewKey],
);
return { handleExplorerTabChange };
diff --git a/frontend/src/hooks/useSavedViewEnabled.ts b/frontend/src/hooks/useSavedViewEnabled.ts
deleted file mode 100644
index 0b99e2fc3e..0000000000
--- a/frontend/src/hooks/useSavedViewEnabled.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export function useSavedViewEnabled(): boolean {
- return true;
-}
diff --git a/frontend/src/mocks-server/__mockdata__/explorer_views.ts b/frontend/src/mocks-server/__mockdata__/explorer_views.ts
deleted file mode 100644
index f4fd4b57b5..0000000000
--- a/frontend/src/mocks-server/__mockdata__/explorer_views.ts
+++ /dev/null
@@ -1,133 +0,0 @@
-import { ReduceOperators } from 'types/common/queryBuilder';
-
-export const explorerView = {
- status: 'success',
- data: [
- {
- id: 'test-uuid-1',
- name: 'Table View',
- category: '',
- createdAt: '2023-08-29T18:04:10.906310033Z',
- createdBy: 'test-user-1',
- updatedAt: '2024-01-29T10:42:47.346331133Z',
- updatedBy: 'test-user-1',
- sourcePage: 'traces',
- tags: [''],
- compositeQuery: {
- builderQueries: {
- A: {
- queryName: 'A',
- stepInterval: 60,
- dataSource: 'traces',
- aggregateOperator: 'count',
- aggregateAttribute: {
- key: 'component',
- dataType: 'string',
- type: 'tag',
- },
- filters: {
- op: 'AND',
- items: [
- {
- key: {
- key: 'component',
- dataType: 'string',
- type: 'tag',
- },
- value: 'test-component',
- op: '!=',
- },
- ],
- },
- groupBy: [
- {
- key: 'component',
- dataType: 'string',
- type: 'tag',
- },
- {
- key: 'client-uuid',
- dataType: 'string',
- type: 'resource',
- },
- ],
- expression: 'A',
- disabled: false,
- limit: 0,
- offset: 0,
- pageSize: 0,
- orderBy: [
- {
- columnName: 'timestamp',
- order: 'desc',
- },
- ],
- reduceTo: ReduceOperators.SUM,
- ShiftBy: 0,
- },
- },
- panelType: 'table',
- queryType: 'builder',
- },
- extraData: '{"color":"#00ffd0"}',
- },
- {
- id: '8c4bf492-d54d-4ab2-a8d6-9c1563f46e1f',
- name: 'R-test panel',
- category: '',
- createdAt: '2024-07-01T13:45:57.924686766Z',
- createdBy: 'test-user-test',
- updatedAt: '2024-07-01T13:48:31.032106578Z',
- updatedBy: 'test-user-test',
- sourcePage: 'traces',
- tags: [''],
- compositeQuery: {
- builderQueries: {
- A: {
- queryName: 'A',
- stepInterval: 60,
- dataSource: 'traces',
- aggregateOperator: 'noop',
- aggregateAttribute: {
- key: '',
- dataType: '',
- type: '',
- },
- filters: {
- op: 'AND',
- items: [
- {
- key: {
- key: 'httpMethod',
- dataType: 'string',
- type: 'tag',
- },
- value: 'GET',
- op: '=',
- },
- ],
- },
- expression: 'A',
- disabled: false,
- limit: 0,
- offset: 0,
- pageSize: 0,
- orderBy: [
- {
- columnName: 'timestamp',
- order: 'desc',
- },
- ],
- reduceTo: ReduceOperators.AVG,
- timeAggregation: 'rate',
- spaceAggregation: 'sum',
- ShiftBy: 0,
- },
- },
- panelType: 'list',
- queryType: 'builder',
- },
- extraData: '{"color":"#AD7F58"}',
- },
- ],
-};
diff --git a/frontend/src/mocks-server/handlers.ts b/frontend/src/mocks-server/handlers.ts
index 07394a6499..98f069c3ee 100644
--- a/frontend/src/mocks-server/handlers.ts
+++ b/frontend/src/mocks-server/handlers.ts
@@ -13,7 +13,6 @@ import {
dashboardSuccessResponse,
getDashboardById,
} from './__mockdata__/dashboards';
-import { explorerView } from './__mockdata__/explorer_views';
import { licensesSuccessResponse } from './__mockdata__/licenses';
import { queryRangeSuccessResponse } from './__mockdata__/query_range';
import { serviceSuccessResponse } from './__mockdata__/services';
@@ -175,20 +174,6 @@ export const handlers = [
),
),
- rest.get('http://localhost/api/v1/explorer/views', (req, res, ctx) =>
- res(ctx.status(200), ctx.json(explorerView)),
- ),
-
- rest.post('http://localhost/api/v1/explorer/views', (req, res, ctx) =>
- res(
- ctx.status(200),
- ctx.json({
- status: 'success',
- data: '7731ece1-3fa3-4ed4-8b1c-58b4c28723b2',
- }),
- ),
- ),
-
rest.post('http://localhost/api/v1/event', (req, res, ctx) =>
res(
ctx.status(200),
diff --git a/frontend/src/pages/AIAssistantPage/stories/AIAssistantPage.stories.tsx b/frontend/src/pages/AIAssistantPage/stories/AIAssistantPage.stories.tsx
index 30ffffa16a..e882a54033 100644
--- a/frontend/src/pages/AIAssistantPage/stories/AIAssistantPage.stories.tsx
+++ b/frontend/src/pages/AIAssistantPage/stories/AIAssistantPage.stories.tsx
@@ -304,14 +304,6 @@ export const TooltipsInApprovalDiff: Story = {
play: openApprovalDiff,
};
-/**
- * The conversation count in the bottom strip, in place of the build version.
- * Archived threads are left out of it.
- */
-export const BottomStrip: Story = {
- args: { bottomStrip: true },
-};
-
/**
* The recording controls' tooltips, held open: discard, stop and send, and the
* send button beside them, which waits for words.
diff --git a/frontend/src/pages/AlertList/AlertRules/stories/AlertRules.stories.tsx b/frontend/src/pages/AlertList/AlertRules/stories/AlertRules.stories.tsx
index 75e3e8fc3a..b8fde345a2 100644
--- a/frontend/src/pages/AlertList/AlertRules/stories/AlertRules.stories.tsx
+++ b/frontend/src/pages/AlertList/AlertRules/stories/AlertRules.stories.tsx
@@ -136,16 +136,11 @@ export const Tooltips: Story = {
};
/**
- * The rule count in the bottom strip, in place of the build version: the rows on
- * the page against the total, the same pair the table's own footer prints.
+ * The rule count in the bottom strip on a second page, where the rows on the
+ * page and the total come apart.
*/
-export const BottomStrip: Story = {
- args: { bottomStrip: true },
-};
-
-/** The same count on a second page, where the two numbers come apart. */
export const BottomStripPaginated: Story = {
- args: { bottomStrip: true, rules: RULE_MAX },
+ args: { rules: RULE_MAX },
parameters: {
signoz: { route: '/alerts?tab=AlertRules&page=2&limit=10' },
},
diff --git a/frontend/src/pages/AllErrors/stories/AllErrors.stories.tsx b/frontend/src/pages/AllErrors/stories/AllErrors.stories.tsx
index 7c5589aa47..3e4b6744fe 100644
--- a/frontend/src/pages/AllErrors/stories/AllErrors.stories.tsx
+++ b/frontend/src/pages/AllErrors/stories/AllErrors.stories.tsx
@@ -131,14 +131,6 @@ export const QuickFiltersSettingsWithBanner: Story = {
play: dirtyQuickFiltersSettings,
};
-/**
- * The exception count in the bottom strip, in place of the build version: the
- * rows on the page against the total the count query returns.
- */
-export const BottomStrip: Story = {
- args: { bottomStrip: true },
-};
-
/** The resource filter opened: every key the exceptions can be narrowed by. */
export const FilterKeySuggestions: Story = {
play: async ({ canvasElement }): Promise<void> => {
diff --git a/frontend/src/pages/HomePage/stories/HomePage.stories.tsx b/frontend/src/pages/HomePage/stories/HomePage.stories.tsx
index 080d2e43a3..046777d601 100644
--- a/frontend/src/pages/HomePage/stories/HomePage.stories.tsx
+++ b/frontend/src/pages/HomePage/stories/HomePage.stories.tsx
@@ -97,11 +97,3 @@ export const NavSettingsMenu: Story = {
await screen.findByRole('menu');
},
};
-
-/**
- * The firing alert count in the bottom strip, in place of the build version. It
- * counts firing instances, so it does not match the alert rules widget above.
- */
-export const BottomStrip: Story = {
- args: { bottomStrip: true },
-};
diff --git a/frontend/src/pages/LLMObservability/Explorer/stories/Explorer.stories.mocks.tsx b/frontend/src/pages/LLMObservability/Explorer/stories/Explorer.stories.mocks.tsx
index a61d4af3e2..ce786812ec 100644
--- a/frontend/src/pages/LLMObservability/Explorer/stories/Explorer.stories.mocks.tsx
+++ b/frontend/src/pages/LLMObservability/Explorer/stories/Explorer.stories.mocks.tsx
@@ -28,7 +28,6 @@ import {
// same endpoints for the same shapes and answers from the traces builders.
import {
exportDashboardsResponse,
- savedTraceViewsResponse,
traceAttributeValuesResponse,
traceFieldKeysResponse,
traceFieldValues,
@@ -41,7 +40,6 @@ import {
const VIEW = 'Explorer · view';
const LIST = 'Explorer · list';
const FILTERS = 'Explorer · filters';
-const SAVED = 'Explorer · saved';
const explorerRoute = (view: ExplorerViews): string => {
const params = new URLSearchParams({
@@ -97,12 +95,6 @@ export const llmExplorerMocks = defineStoryMocks({
value: 6,
max: 8,
}),
- savedViews: countControl('Saved views', {
- group: SAVED,
- description: 'Fills the views dropdown the explorer options offer.',
- value: 4,
- max: 8,
- }),
},
handlers: (values, response) => [
rest.get(
@@ -145,11 +137,6 @@ export const llmExplorerMocks = defineStoryMocks({
),
),
- rest.get(
- 'http://localhost/api/v1/explorer/views',
- response.json(() => savedTraceViewsResponse(values.savedViews)),
- ),
-
rest.get(
'http://localhost/api/v2/users/me/dashboards',
response.json(exportDashboardsResponse),
diff --git a/frontend/src/pages/LLMObservability/Explorer/stories/Explorer.stories.tsx b/frontend/src/pages/LLMObservability/Explorer/stories/Explorer.stories.tsx
index 8b032c5e29..ea2e220586 100644
--- a/frontend/src/pages/LLMObservability/Explorer/stories/Explorer.stories.tsx
+++ b/frontend/src/pages/LLMObservability/Explorer/stories/Explorer.stories.tsx
@@ -126,7 +126,7 @@ export const TimeSeries: Story = {
* their empty states.
*/
export const NoSpans: Story = {
- args: { spans: 0, quickFilters: 0, savedViews: 0 },
+ args: { spans: 0, quickFilters: 0 },
};
/** The list mid-query, with the cancel action the toolbar offers while it runs. */
diff --git a/frontend/src/pages/LiveLogs/LiveLogs.tsx b/frontend/src/pages/LiveLogs/LiveLogs.tsx
index b289be8e35..96dfebac91 100644
--- a/frontend/src/pages/LiveLogs/LiveLogs.tsx
+++ b/frontend/src/pages/LiveLogs/LiveLogs.tsx
@@ -1,6 +1,6 @@
import { useEffect } from 'react';
import { PANEL_TYPES } from 'constants/queryBuilder';
-import { ChangeViewFunctionType } from 'container/ExplorerOptions/types';
+import { ChangeViewFunctionType } from 'hooks/useHandleExplorerTabChange';
import { liveLogsCompositeQuery } from 'container/LiveLogs/constants';
import LiveLogsContainer from 'container/LiveLogs/LiveLogsContainer';
import { useQueryBuilder } from 'hooks/queryBuilder/useQueryBuilder';
diff --git a/frontend/src/pages/LogsExplorer/__tests__/LogsExplorer.test.tsx b/frontend/src/pages/LogsExplorer/__tests__/LogsExplorer.test.tsx
index 614c1aa478..01db045a4d 100644
--- a/frontend/src/pages/LogsExplorer/__tests__/LogsExplorer.test.tsx
+++ b/frontend/src/pages/LogsExplorer/__tests__/LogsExplorer.test.tsx
@@ -243,7 +243,6 @@ describe('Logs Explorer Tests', () => {
updateQueriesData: (): Query => initialQueriesMap.metrics,
initQueryBuilderData: noop,
handleOnUnitsChange: noop,
- isStagedQueryUpdated: (): boolean => false,
}}
>
<PreferenceContextProvider>
diff --git a/frontend/src/pages/LogsExplorer/index.tsx b/frontend/src/pages/LogsExplorer/index.tsx
index e35167fa0f..802e9abbb3 100644
--- a/frontend/src/pages/LogsExplorer/index.tsx
+++ b/frontend/src/pages/LogsExplorer/index.tsx
@@ -3,7 +3,6 @@ import { useQueryClient } from 'react-query';
import * as Sentry from '@sentry/react';
import getLocalStorageKey from 'api/browser/localstorage/get';
import setLocalStorageApi from 'api/browser/localstorage/set';
-import ExplorerCard from 'components/ExplorerCard/ExplorerCard';
import QueryCancelledPlaceholder from 'components/QueryCancelledPlaceholder';
import { SavedviewtypesSourceDTO } from 'api/generated/services/sigNoz.schemas';
import QuickFiltersLayout from 'components/QuickFilters/QuickFiltersLayout/QuickFiltersLayout';
@@ -268,9 +267,7 @@ function LogsExplorer(): JSX.Element {
<div className="log-explorer-query-container">
<div>
- <ExplorerCard sourcepage={DataSource.LOGS}>
- <LogExplorerQuerySection selectedView={selectedView} />
- </ExplorerCard>
+ <LogExplorerQuerySection selectedView={selectedView} />
</div>
<div className="logs-explorer-views">
{isCancelled ? (
diff --git a/frontend/src/pages/LogsModulePage/LiveLogs/stories/LiveLogs.stories.mocks.tsx b/frontend/src/pages/LogsModulePage/LiveLogs/stories/LiveLogs.stories.mocks.tsx
index 9db5b3ee71..d402cd176f 100644
--- a/frontend/src/pages/LogsModulePage/LiveLogs/stories/LiveLogs.stories.mocks.tsx
+++ b/frontend/src/pages/LogsModulePage/LiveLogs/stories/LiveLogs.stories.mocks.tsx
@@ -22,7 +22,7 @@ import {
} from '@/storybook/controls/controls';
import { defineStoryMocks } from '@/storybook/controls/defineStoryMocks';
-import { logsSavedViewsResponse } from '../../SavedViews/stories/__story_mockdata__/savedViews';
+import { logsSavedViewsResponse } from '../../stories/__story_mockdata__/savedViews';
import {
attributeValuesResponse,
dashboardsResponse,
@@ -187,7 +187,7 @@ export const liveLogsMocks = defineStoryMocks({
),
rest.get(
- 'http://localhost/api/v1/explorer/views',
+ 'http://localhost/api/v2/saved_views',
response.json(() => logsSavedViewsResponse(4)),
),
diff --git a/frontend/src/pages/LogsModulePage/LogsModulePage.tsx b/frontend/src/pages/LogsModulePage/LogsModulePage.tsx
index 76414fd390..4c07705ef6 100644
--- a/frontend/src/pages/LogsModulePage/LogsModulePage.tsx
+++ b/frontend/src/pages/LogsModulePage/LogsModulePage.tsx
@@ -1,22 +1,16 @@
import { useLocation } from 'react-use';
import RouteTab from 'components/RouteTab';
import { TabRoutes } from 'components/RouteTab/types';
-import { useSavedViewEnabled } from 'hooks/useSavedViewEnabled';
import history from 'lib/history';
-import { logSaveView, logsExplorer, logsPipelines } from './constants';
+import { logsExplorer, logsPipelines } from './constants';
import './LogsModulePage.styles.scss';
export default function LogsModulePage(): JSX.Element {
const { pathname } = useLocation();
- const isSavedViewEnabled = useSavedViewEnabled();
- const routes: TabRoutes[] = [
- logsExplorer,
- logsPipelines,
- ...(isSavedViewEnabled ? [] : [logSaveView]),
- ];
+ const routes: TabRoutes[] = [logsExplorer, logsPipelines];
return (
<RouteTab
diff --git a/frontend/src/pages/LogsModulePage/SavedViews/stories/__story_mockdata__/savedViews.ts b/frontend/src/pages/LogsModulePage/SavedViews/stories/__story_mockdata__/savedViews.ts
deleted file mode 100644
index 79d36f262c..0000000000
--- a/frontend/src/pages/LogsModulePage/SavedViews/stories/__story_mockdata__/savedViews.ts
+++ /dev/null
@@ -1,62 +0,0 @@
-/**
- * AI-owned. Generated and maintained by the `signoz-page-story` skill.
- * Do not hand-edit: regenerate instead.
- */
-
-import { explorerView } from 'mocks-server/__mockdata__/explorer_views';
-import type { AllViewsProps, ViewProps } from 'types/api/saveViews/types';
-import { DataSource } from 'types/common/queryBuilder';
-
-const VIEWS: { name: string; color: string; createdBy: string }[] = [
- { name: 'Checkout errors', color: '#f2536b', createdBy: '[email protected]' },
- {
- name: 'Auth service warnings',
- color: '#ffbe0b',
- createdBy: '[email protected]',
- },
- {
- name: 'Slow SQL statements',
- color: '#00ffd0',
- createdBy: '[email protected]',
- },
- { name: 'Payment webhooks', color: '#7c4dff', createdBy: '[email protected]' },
- {
- name: 'Rate limited requests',
- color: '#4e74f8',
- createdBy: '[email protected]',
- },
- { name: 'Cron job failures', color: '#ff7d3b', createdBy: '[email protected]' },
- { name: 'Cold start traces', color: '#189e5f', createdBy: '[email protected]' },
- { name: 'Kafka consumer lag', color: '#c7c7c7', createdBy: '[email protected]' },
-];
-
-export const SAVED_VIEW_MAX = VIEWS.length;
-
-/** The table paginates past this, which is the only place page 2 shows up. */
-export const SAVED_VIEWS_PAGE_SIZE = 5;
-
-/** The jest fixture is the shape of a view; only what the list shows changes. */
-const [baseView] = explorerView.data as unknown as ViewProps[];
-
-export const logsSavedViewsResponse = (count: number): AllViewsProps => ({
- status: 'success',
- data: VIEWS.slice(0, count).map(({ name, color, createdBy }, index) => ({
- ...baseView,
- id: `storybook-logs-view-${index + 1}`,
- name,
- sourcePage: DataSource.LOGS,
- tags: ['logs'],
- createdBy,
- createdAt: `2026-08-${String(4 + index).padStart(2, '0')}T09:24:11.000Z`,
- extraData: JSON.stringify({ color }),
- })),
-});
-
-/**
- * Renaming and deleting answer, so the modal closes and the notification is the
- * one the page shows on success. The list itself is what the `Saved views`
- * control says it is, so the refetch reads it back unchanged: see the PR.
- */
-export const savedViewWriteResponse = (): { status: string } => ({
- status: 'success',
-});
diff --git a/frontend/src/pages/LogsModulePage/constants.tsx b/frontend/src/pages/LogsModulePage/constants.tsx
index a0a88254c9..c93b6f6754 100644
--- a/frontend/src/pages/LogsModulePage/constants.tsx
+++ b/frontend/src/pages/LogsModulePage/constants.tsx
@@ -1,9 +1,8 @@
import { TabRoutes } from 'components/RouteTab/types';
import ROUTES from 'constants/routes';
-import { Compass, TowerControl, Workflow } from '@signozhq/icons';
+import { Compass, Workflow } from '@signozhq/icons';
import LogsExplorer from 'pages/LogsExplorer';
import Pipelines from 'pages/Pipelines';
-import SaveView from 'pages/SaveView';
export const logsExplorer: TabRoutes = {
Component: (): JSX.Element => <LogsExplorer />,
@@ -26,14 +25,3 @@ export const logsPipelines: TabRoutes = {
route: ROUTES.LOGS_PIPELINES,
key: ROUTES.LOGS_PIPELINES,
};
-
-export const logSaveView: TabRoutes = {
- Component: SaveView,
- name: (
- <div className="tab-item">
- <TowerControl size={16} /> Views
- </div>
- ),
- route: ROUTES.LOGS_SAVE_VIEWS,
- key: ROUTES.LOGS_SAVE_VIEWS,
-};
diff --git a/frontend/src/pages/LogsModulePage/stories/LogsModulePage.stories.mocks.tsx b/frontend/src/pages/LogsModulePage/stories/LogsModulePage.stories.mocks.tsx
index 73405d0f92..e948b6c707 100644
--- a/frontend/src/pages/LogsModulePage/stories/LogsModulePage.stories.mocks.tsx
+++ b/frontend/src/pages/LogsModulePage/stories/LogsModulePage.stories.mocks.tsx
@@ -34,7 +34,7 @@ import {
import {
logsSavedViewsResponse,
SAVED_VIEW_MAX,
-} from '../SavedViews/stories/__story_mockdata__/savedViews';
+} from './__story_mockdata__/savedViews';
import {
attributeValuesResponse,
dashboardsResponse,
@@ -181,7 +181,7 @@ export const logsMocks = defineStoryMocks({
}),
savedViews: countControl('Saved views', {
group: FILTERS,
- description: 'The views the view picker above the query builder lists.',
+ description: 'The views the saved views panel beside the explorer lists.',
value: 4,
max: SAVED_VIEW_MAX,
}),
@@ -257,7 +257,7 @@ export const logsMocks = defineStoryMocks({
),
rest.get(
- 'http://localhost/api/v1/explorer/views',
+ 'http://localhost/api/v2/saved_views',
response.json(() => logsSavedViewsResponse(values.savedViews)),
),
diff --git a/frontend/src/pages/LogsModulePage/stories/LogsModulePage.stories.tsx b/frontend/src/pages/LogsModulePage/stories/LogsModulePage.stories.tsx
index 3782deb333..a5088f38a5 100644
--- a/frontend/src/pages/LogsModulePage/stories/LogsModulePage.stories.tsx
+++ b/frontend/src/pages/LogsModulePage/stories/LogsModulePage.stories.tsx
@@ -76,8 +76,8 @@ const openFirstLog = async (canvasElement: HTMLElement): Promise<void> => {
/**
* The explorer on its list view: quick filters down the left, the frequency
- * chart over a page of log lines across every severity, and the org's saved
- * views in the view picker.
+ * chart over a page of log lines across every severity, and the saved views
+ * header above the filters.
*/
export const Default: Story = {};
diff --git a/frontend/src/pages/LogsModulePage/stories/__story_mockdata__/savedViews.ts b/frontend/src/pages/LogsModulePage/stories/__story_mockdata__/savedViews.ts
new file mode 100644
index 0000000000..156bf49b1a
--- /dev/null
+++ b/frontend/src/pages/LogsModulePage/stories/__story_mockdata__/savedViews.ts
@@ -0,0 +1,56 @@
+/**
+ * AI-owned. Generated and maintained by the `signoz-page-story` skill.
+ * Do not hand-edit: regenerate instead.
+ */
+
+import {
+ type ListSavedViews200,
+ Querybuildertypesv5QueryBuilderQueryGithubComSigNozSignozPkgTypesQuerybuildertypesQuerybuildertypesv5LogAggregationDTOSignal as LogsSignal,
+ Querybuildertypesv5QueryEnvelopeBuilderDTOType,
+ Querybuildertypesv5RequestTypeDTO,
+ SavedviewtypesPanelTypeDTO,
+ SavedviewtypesSchemaVersionDTO,
+ SavedviewtypesSourceDTO,
+} from 'api/generated/services/sigNoz.schemas';
+
+const VIEWS: { name: string; createdBy: string }[] = [
+ { name: 'Checkout errors', createdBy: '[email protected]' },
+ { name: 'Auth service warnings', createdBy: '[email protected]' },
+ { name: 'Slow SQL statements', createdBy: '[email protected]' },
+ { name: 'Payment webhooks', createdBy: '[email protected]' },
+ { name: 'Rate limited requests', createdBy: '[email protected]' },
+ { name: 'Cron job failures', createdBy: '[email protected]' },
+ { name: 'Cold start traces', createdBy: '[email protected]' },
+ { name: 'Kafka consumer lag', createdBy: '[email protected]' },
+];
+
+export const SAVED_VIEW_MAX = VIEWS.length;
+
+export const logsSavedViewsResponse = (count: number): ListSavedViews200 => ({
+ status: 'success',
+ data: VIEWS.slice(0, count).map(({ name, createdBy }, index) => {
+ const timestamp = `2026-08-${String(4 + index).padStart(2, '0')}T09:24:11Z`;
+
+ return {
+ id: `storybook-logs-view-${index + 1}`,
+ name: `storybook-logs-view-${index + 1}`,
+ source: SavedviewtypesSourceDTO.logs,
+ schemaVersion: SavedviewtypesSchemaVersionDTO.v2,
+ createdAt: timestamp,
+ createdBy,
+ updatedAt: timestamp,
+ updatedBy: createdBy,
+ spec: {
+ displayName: name,
+ panelType: SavedviewtypesPanelTypeDTO.list,
+ requestType: Querybuildertypesv5RequestTypeDTO.raw,
+ queries: [
+ {
+ type: Querybuildertypesv5QueryEnvelopeBuilderDTOType.builder_query,
+ spec: { name: 'A', signal: LogsSignal.logs },
+ },
+ ],
+ },
+ };
+ }),
+});
diff --git a/frontend/src/pages/MeterExplorer/MeterExplorerPage.tsx b/frontend/src/pages/MeterExplorer/MeterExplorerPage.tsx
index 488bcae9b4..094af1704e 100644
--- a/frontend/src/pages/MeterExplorer/MeterExplorerPage.tsx
+++ b/frontend/src/pages/MeterExplorer/MeterExplorerPage.tsx
@@ -2,22 +2,16 @@ import { useLocation } from 'react-use';
import RouteTab from 'components/RouteTab';
import { TabRoutes } from 'components/RouteTab/types';
import ROUTES from 'constants/routes';
-import { useSavedViewEnabled } from 'hooks/useSavedViewEnabled';
import history from 'lib/history';
-import { Explorer, Meter, Views } from './constants';
+import { Explorer, Meter } from './constants';
import './MeterExplorer.styles.scss';
function MeterExplorerPage(): JSX.Element {
const { pathname } = useLocation();
- const isSavedViewEnabled = useSavedViewEnabled();
- const routes: TabRoutes[] = [
- Meter,
- Explorer,
- ...(isSavedViewEnabled ? [] : [Views]),
- ];
+ const routes: TabRoutes[] = [Meter, Explorer];
return (
<RouteTab
diff --git a/frontend/src/pages/MeterExplorer/constants.tsx b/frontend/src/pages/MeterExplorer/constants.tsx
index 091863a9c4..4cbb9673d8 100644
--- a/frontend/src/pages/MeterExplorer/constants.tsx
+++ b/frontend/src/pages/MeterExplorer/constants.tsx
@@ -3,7 +3,6 @@ import ROUTES from 'constants/routes';
import BreakDownPage from 'container/MeterExplorer/Breakdown/BreakDown';
import ExplorerPage from 'container/MeterExplorer/Explorer';
import { Compass, TowerControl } from '@signozhq/icons';
-import SaveView from 'pages/SaveView';
export const Explorer: TabRoutes = {
Component: (): JSX.Element => <ExplorerPage />,
@@ -16,17 +15,6 @@ export const Explorer: TabRoutes = {
key: ROUTES.METER_EXPLORER,
};
-export const Views: TabRoutes = {
- Component: SaveView,
- name: (
- <div className="tab-item">
- <TowerControl size={16} /> Views
- </div>
- ),
- route: ROUTES.METER_EXPLORER_VIEWS,
- key: ROUTES.METER_EXPLORER_VIEWS,
-};
-
export const Meter: TabRoutes = {
Component: BreakDownPage,
name: (
diff --git a/frontend/src/pages/MeterExplorer/stories/MeterExplorer.stories.mocks.tsx b/frontend/src/pages/MeterExplorer/stories/MeterExplorer.stories.mocks.tsx
index b07d719c3b..2236861140 100644
--- a/frontend/src/pages/MeterExplorer/stories/MeterExplorer.stories.mocks.tsx
+++ b/frontend/src/pages/MeterExplorer/stories/MeterExplorer.stories.mocks.tsx
@@ -105,10 +105,6 @@ interface RouteValues {
const meterRoute = ({ tab, metric, timeRange }: RouteValues): string => {
const params = new URLSearchParams(meterTimeWindow(timeRange).search);
- if (tab === 'views') {
- return `${ROUTES.METER_EXPLORER_VIEWS}?${params.toString()}`;
- }
-
if (tab === 'explorer') {
// Encoded the way `redirectWithQueryBuilderData` writes it, so the param
// survives the extra decode the query builder does when reading it back.
@@ -137,7 +133,7 @@ export const meterMocks = defineStoryMocks({
tab: choiceControl<MeterTab>('Tab', {
group: VIEW,
description:
- 'The three pathnames the module tabs between. Clicking another tab leaves the story, so switch it here.',
+ 'The two pathnames the module tabs between. Clicking another tab leaves the story, so switch it here.',
options: METER_TABS,
value: 'meter',
}),
@@ -177,7 +173,7 @@ export const meterMocks = defineStoryMocks({
}),
savedViews: countControl('Saved views', {
group: EXPLORER,
- description: 'Fills the views dropdown and the Views tab.',
+ description: 'Fills the saved views list beside the explorer.',
value: 4,
max: 6,
}),
@@ -237,7 +233,7 @@ export const meterMocks = defineStoryMocks({
),
rest.get(
- 'http://localhost/api/v1/explorer/views',
+ 'http://localhost/api/v2/saved_views',
response.json(() => savedMeterViewsResponse(values.savedViews)),
),
diff --git a/frontend/src/pages/MeterExplorer/stories/MeterExplorer.stories.tsx b/frontend/src/pages/MeterExplorer/stories/MeterExplorer.stories.tsx
index e9edfaed9f..1ce163286b 100644
--- a/frontend/src/pages/MeterExplorer/stories/MeterExplorer.stories.tsx
+++ b/frontend/src/pages/MeterExplorer/stories/MeterExplorer.stories.tsx
@@ -15,7 +15,7 @@ const pageStory = storyMocks(meterMocks, { layout: 'app' });
* What the workspace is metered for, per signal: the explorer over `query_range`,
* its saved views and the billing notice above them.
*
- * Routes: `/meter`, `/meter/explorer` and `/meter/explorer/views`.
+ * Routes: `/meter` and `/meter/explorer`.
*/
const meta = {
title: 'Pages/Metering/Cost Meter',
@@ -76,15 +76,10 @@ export const Explorer: Story = {
args: { tab: 'explorer' },
};
-/** The Views tab, where the meter queries the workspace has saved are managed. */
-export const SavedViews: Story = {
- args: { tab: 'views' },
-};
-
/**
* A workspace that has not sent telemetry yet: the totals read zero and every
* section reports no data. Its quick filters and saved views are unset too, so
- * the Explorer and Views tabs are empty from here as well.
+ * the Explorer tab is empty from here as well.
*/
export const NoUsage: Story = {
args: { signals: [], quickFilters: 0, savedViews: 0 },
@@ -118,11 +113,6 @@ export const ExplorerWithoutQuickFilters: Story = {
args: { tab: 'explorer', quickFilters: 0 },
};
-/** The Views tab without any saved meter queries. */
-export const ViewsEmpty: Story = {
- args: { tab: 'views', savedViews: 0 },
-};
-
/** The editable quick-filter settings panel, which lives on the Explorer tab. */
export const QuickFiltersSettings: Story = {
args: { tab: 'explorer' },
diff --git a/frontend/src/pages/MeterExplorer/stories/__story_mockdata__/meter.ts b/frontend/src/pages/MeterExplorer/stories/__story_mockdata__/meter.ts
index bb8f749500..150badecbd 100644
--- a/frontend/src/pages/MeterExplorer/stories/__story_mockdata__/meter.ts
+++ b/frontend/src/pages/MeterExplorer/stories/__story_mockdata__/meter.ts
@@ -6,14 +6,22 @@
import type {
GetQuickFilters200,
ListMetrics200,
+ ListSavedViews200,
TelemetrytypesTelemetryFieldKeyDTO,
} from 'api/generated/services/sigNoz.schemas';
import {
MetrictypesTemporalityDTO,
MetrictypesTypeDTO,
+ Querybuildertypesv5QueryBuilderQueryGithubComSigNozSignozPkgTypesQuerybuildertypesQuerybuildertypesv5MetricAggregationDTOSignal as MetricsSignal,
+ Querybuildertypesv5QueryEnvelopeBuilderDTOType,
+ Querybuildertypesv5RequestTypeDTO,
QuickfiltertypesSourceDTO,
+ SavedviewtypesPanelTypeDTO,
+ SavedviewtypesSchemaVersionDTO,
+ SavedviewtypesSourceDTO,
TelemetrytypesFieldContextDTO,
TelemetrytypesFieldDataTypeDTO,
+ TelemetrytypesSourceDTO,
} from 'api/generated/services/sigNoz.schemas';
import type { Time } from 'container/TopNav/DateTimeSelectionV2/types';
import {
@@ -23,7 +31,6 @@ import {
getSpanCountWidgetData,
getSpanSizeWidgetData,
} from 'container/MeterExplorer/Breakdown/graphs';
-import { explorerView } from 'mocks-server/__mockdata__/explorer_views';
import type { Widgets } from 'types/api/widgets/widget';
import type { Query } from 'types/api/queryBuilder/queryBuilderData';
import type { TimeSeries } from 'types/api/v5/queryRange';
@@ -31,7 +38,7 @@ import type { TimeSeries } from 'types/api/v5/queryRange';
import { timeSeriesPoints } from '@/storybook/msw/__story_mockdata__/queryRange';
import { quickFiltersResponse } from '@/storybook/msw/__story_mockdata__/quickFilters';
-export const METER_TABS = ['meter', 'explorer', 'views'] as const;
+export const METER_TABS = ['meter', 'explorer'] as const;
export type MeterTab = (typeof METER_TABS)[number];
@@ -351,20 +358,33 @@ const VIEW_NAMES = [
'Collector breakdown',
];
-export const savedMeterViewsResponse = (
- count: number,
-): { status: string; data: unknown[] } => ({
+export const savedMeterViewsResponse = (count: number): ListSavedViews200 => ({
status: 'success',
- data: Array.from(
- { length: Math.min(count, VIEW_NAMES.length) },
- (_unused, index) => ({
- ...explorerView.data[0],
- id: `storybook-meter-view-${index + 1}`,
- name: VIEW_NAMES[index],
- sourcePage: 'meter',
- tags: ['meter'],
- }),
- ),
+ data: VIEW_NAMES.slice(0, count).map((displayName, index) => ({
+ id: `storybook-meter-view-${index + 1}`,
+ name: `storybook-meter-view-${index + 1}`,
+ source: SavedviewtypesSourceDTO.meter,
+ schemaVersion: SavedviewtypesSchemaVersionDTO.v2,
+ createdAt: '2026-08-20T09:00:00Z',
+ createdBy: '[email protected]',
+ updatedAt: '2026-08-20T09:00:00Z',
+ updatedBy: '[email protected]',
+ spec: {
+ displayName,
+ panelType: SavedviewtypesPanelTypeDTO.graph,
+ requestType: Querybuildertypesv5RequestTypeDTO.time_series,
+ queries: [
+ {
+ type: Querybuildertypesv5QueryEnvelopeBuilderDTOType.builder_query,
+ spec: {
+ name: 'A',
+ signal: MetricsSignal.metrics,
+ source: TelemetrytypesSourceDTO.meter,
+ },
+ },
+ ],
+ },
+ })),
});
const DASHBOARD_NAMES = [
diff --git a/frontend/src/pages/MetricsExplorer/MetricsExplorerPage.tsx b/frontend/src/pages/MetricsExplorer/MetricsExplorerPage.tsx
index 97d0db7051..e6e37af41c 100644
--- a/frontend/src/pages/MetricsExplorer/MetricsExplorerPage.tsx
+++ b/frontend/src/pages/MetricsExplorer/MetricsExplorerPage.tsx
@@ -8,27 +8,20 @@ import { initialQueriesMap, PANEL_TYPES } from 'constants/queryBuilder';
import { useVolumeControlFeatureGate } from 'hooks/metricsExplorer/useVolumeControlFeatureGate';
import { useQueryBuilder } from 'hooks/queryBuilder/useQueryBuilder';
import { useShareBuilderUrl } from 'hooks/queryBuilder/useShareBuilderUrl';
-import { useSavedViewEnabled } from 'hooks/useSavedViewEnabled';
import history from 'lib/history';
import { DataSource } from 'types/common/queryBuilder';
-import { Explorer, Summary, Views, VolumeControl } from './constants';
+import { Explorer, Summary, VolumeControl } from './constants';
import './MetricsExplorerPage.styles.scss';
function MetricsExplorerPage(): JSX.Element {
const { pathname } = useLocation();
const { isVolumeControlEnabled } = useVolumeControlFeatureGate();
- const isSavedViewEnabled = useSavedViewEnabled();
const routes: TabRoutes[] = useMemo(
- () => [
- Summary,
- ...(isVolumeControlEnabled ? [VolumeControl] : []),
- Explorer,
- ...(isSavedViewEnabled ? [] : [Views]),
- ],
- [isVolumeControlEnabled, isSavedViewEnabled],
+ () => [Summary, ...(isVolumeControlEnabled ? [VolumeControl] : []), Explorer],
+ [isVolumeControlEnabled],
);
const { updateAllQueriesOperators } = useQueryBuilder();
diff --git a/frontend/src/pages/MetricsExplorer/constants.tsx b/frontend/src/pages/MetricsExplorer/constants.tsx
index 152fa8ea9c..9bab808296 100644
--- a/frontend/src/pages/MetricsExplorer/constants.tsx
+++ b/frontend/src/pages/MetricsExplorer/constants.tsx
@@ -3,8 +3,7 @@ import ROUTES from 'constants/routes';
import ExplorerPage from 'container/MetricsExplorer/Explorer';
import SummaryPage from 'container/MetricsExplorer/Summary';
import VolumeControlTab from 'container/MetricsExplorer/VolumeControl/components/VolumeControlTab/VolumeControlTab';
-import { BarChart, Compass, Gauge, TowerControl } from '@signozhq/icons';
-import SaveView from 'pages/SaveView';
+import { BarChart, Compass, Gauge } from '@signozhq/icons';
export const Summary: TabRoutes = {
Component: SummaryPage,
@@ -28,17 +27,6 @@ export const Explorer: TabRoutes = {
key: ROUTES.METRICS_EXPLORER_EXPLORER,
};
-export const Views: TabRoutes = {
- Component: SaveView,
- name: (
- <div className="tab-item">
- <TowerControl size={16} /> Views
- </div>
- ),
- route: ROUTES.METRICS_EXPLORER_VIEWS,
- key: ROUTES.METRICS_EXPLORER_VIEWS,
-};
-
export const VolumeControl: TabRoutes = {
Component: VolumeControlTab,
name: (
diff --git a/frontend/src/pages/MetricsExplorer/stories/MetricsExplorerPage.stories.mocks.tsx b/frontend/src/pages/MetricsExplorer/stories/MetricsExplorerPage.stories.mocks.tsx
index adf7e7a3b8..52dbea4c4f 100644
--- a/frontend/src/pages/MetricsExplorer/stories/MetricsExplorerPage.stories.mocks.tsx
+++ b/frontend/src/pages/MetricsExplorer/stories/MetricsExplorerPage.stories.mocks.tsx
@@ -63,7 +63,6 @@ import {
metricMetadataResponse,
metricTemporalityOf,
metricTypeOf,
- metricsSavedViewsResponse,
metricsSavedViewsV2Response,
metricsStatsResponse,
metricsTreemapResponse,
@@ -80,12 +79,7 @@ const SUMMARY = 'Metrics · summary';
const EXPLORER = 'Metrics · explorer';
const VOLUME = 'Metrics · volume control';
-const METRICS_TABS = [
- 'summary',
- 'volume-control',
- 'explorer',
- 'views',
-] as const;
+const METRICS_TABS = ['summary', 'volume-control', 'explorer'] as const;
type MetricsTab = (typeof METRICS_TABS)[number];
@@ -173,10 +167,6 @@ const metricsRoute = ({
drawerMetric,
explorerMetrics,
}: RouteValues): string => {
- if (tab === 'views') {
- return ROUTES.METRICS_EXPLORER_VIEWS;
- }
-
if (tab === 'volume-control') {
return ROUTES.METRICS_EXPLORER_VOLUME_CONTROL;
}
@@ -269,7 +259,7 @@ export const metricsMocks = defineStoryMocks({
tab: choiceControl<MetricsTab>('Tab', {
group: VIEW,
description:
- 'The four pathnames the module tabs between. Clicking another tab leaves the story, so switch it here.',
+ 'The three pathnames the module tabs between. Clicking another tab leaves the story, so switch it here.',
options: METRICS_TABS,
value: 'summary',
}),
@@ -348,7 +338,7 @@ export const metricsMocks = defineStoryMocks({
}),
savedViews: countControl('Saved views', {
group: EXPLORER,
- description: 'Fills the explorer views dropdown and the Views tab.',
+ description: 'Fills the saved views list beside the explorer.',
value: 4,
max: SAVED_VIEW_MAX,
}),
@@ -513,11 +503,6 @@ export const metricsMocks = defineStoryMocks({
response.json(() => dashboardsForUserResponse(EXPORT_DASHBOARDS)),
),
- rest.get(
- 'http://localhost/api/v1/explorer/views',
- response.json(() => metricsSavedViewsResponse(values.savedViews)),
- ),
-
rest.get(
'http://localhost/api/v2/saved_views',
response.json(() => metricsSavedViewsV2Response(values.savedViews)),
diff --git a/frontend/src/pages/MetricsExplorer/stories/MetricsExplorerPage.stories.tsx b/frontend/src/pages/MetricsExplorer/stories/MetricsExplorerPage.stories.tsx
index c52d9e9416..2c666678a5 100644
--- a/frontend/src/pages/MetricsExplorer/stories/MetricsExplorerPage.stories.tsx
+++ b/frontend/src/pages/MetricsExplorer/stories/MetricsExplorerPage.stories.tsx
@@ -69,17 +69,12 @@ export const VolumeControl: Story = {
/**
* The Explorer tab plotting one metric, with the query builder above the chart
- * and the saved-view actions in the toolbar.
+ * and the saved views beside it.
*/
export const Explorer: Story = {
args: { tab: 'explorer' },
};
-/** The Views tab, where the saved views the explorer offers are managed. */
-export const SavedViews: Story = {
- args: { tab: 'views' },
-};
-
/**
* A fresh workspace: nothing ingested in the window, so the Summary tab drops
* both views for its onboarding state and nothing is saved or reduced yet.
diff --git a/frontend/src/pages/MetricsExplorer/stories/__story_mockdata__/metricsExplorer.ts b/frontend/src/pages/MetricsExplorer/stories/__story_mockdata__/metricsExplorer.ts
index 1c80e82a1c..0f326d9227 100644
--- a/frontend/src/pages/MetricsExplorer/stories/__story_mockdata__/metricsExplorer.ts
+++ b/frontend/src/pages/MetricsExplorer/stories/__story_mockdata__/metricsExplorer.ts
@@ -32,9 +32,6 @@ import {
SavedviewtypesSchemaVersionDTO,
SavedviewtypesSourceDTO,
} from 'api/generated/services/sigNoz.schemas';
-import { explorerView } from 'mocks-server/__mockdata__/explorer_views';
-import type { AllViewsProps, ViewProps } from 'types/api/saveViews/types';
-import { DataSource } from 'types/common/queryBuilder';
interface MetricSeed {
metricName: string;
@@ -775,22 +772,6 @@ const VIEW_NAMES = [
export const SAVED_VIEW_MAX = VIEW_NAMES.length;
-/** The jest fixture is the shape of a view; only what the list shows changes. */
-const [baseView] = explorerView.data as unknown as ViewProps[];
-
-export const metricsSavedViewsResponse = (count: number): AllViewsProps => ({
- status: 'success',
- data: VIEW_NAMES.slice(0, count).map((name, index) => ({
- ...baseView,
- id: `storybook-metrics-view-${index + 1}`,
- name,
- sourcePage: DataSource.METRICS,
- tags: ['metrics'],
- createdBy: '[email protected]',
- extraData: '{"color":"#7cd4fd"}',
- })),
-});
-
export const metricsSavedViewsV2Response = (
count: number,
): ListSavedViews200 => ({
diff --git a/frontend/src/pages/SaveView/SaveView.styles.scss b/frontend/src/pages/SaveView/SaveView.styles.scss
deleted file mode 100644
index 7c946f6f48..0000000000
--- a/frontend/src/pages/SaveView/SaveView.styles.scss
+++ /dev/null
@@ -1,241 +0,0 @@
-.save-view-container {
- margin-top: 70px;
- display: flex;
- justify-content: center;
- width: 100%;
-
- .save-view-content {
- width: calc(100% - 30px);
- max-width: 736px;
-
- .title {
- color: var(--l1-foreground);
- font-size: var(--font-size-lg);
- font-style: normal;
- font-weight: var(--font-weight-normal);
- line-height: 28px; /* 155.556% */
- letter-spacing: -0.09px;
- }
-
- .subtitle {
- color: var(--l2-foreground);
- font-size: var(--font-size-sm);
- font-style: normal;
- font-weight: var(--font-weight-normal);
- line-height: 20px; /* 142.857% */
- letter-spacing: -0.07px;
- }
- .learn-more {
- font-size: 14px;
- }
- .search-input-container {
- margin-top: 16px;
- margin-bottom: 8px;
- }
-
- .ant-input-affix-wrapper {
- margin-top: 16px;
- margin-bottom: 8px;
- }
-
- .ant-table-row {
- .ant-table-cell {
- padding: 0;
- border: none;
- background: var(--l1-background);
- }
- .column-render {
- margin: 8px 0 !important;
- padding: 16px;
- border-radius: 6px;
- border: 1px solid var(--l1-border);
- background: var(--l2-background);
-
- .title-with-action {
- display: flex;
- justify-content: space-between;
- align-items: center;
-
- .save-view-title {
- display: flex;
- align-items: center;
- gap: 6px;
- .dot {
- min-height: 6px;
- min-width: 6px;
- border-radius: 50%;
- }
- .ant-typography {
- color: var(--l2-foreground);
- font-size: var(--font-size-sm);
- font-style: normal;
- font-weight: var(--font-weight-medium);
- line-height: 20px;
- letter-spacing: -0.07px;
- }
- }
-
- .action-btn {
- display: flex;
- align-items: center;
- gap: 20px;
- cursor: pointer;
-
- .hidden {
- display: none;
- }
- }
- }
- .view-details {
- margin-top: 8px;
- display: flex;
- align-items: center;
-
- .view-tag {
- width: 14px;
- height: 14px;
- border-radius: 50px;
- background: var(--l3-background);
- display: flex;
- justify-content: center;
- align-items: center;
-
- .tag-text {
- color: var(--l2-foreground);
- leading-trim: both;
- text-edge: cap;
- font-size: 10px;
- font-style: normal;
- font-weight: var(--font-weight-normal);
- line-height: normal;
- letter-spacing: -0.05px;
- }
- }
-
- .view-created-by {
- margin-left: 8px;
- }
-
- .view-created-at {
- margin-left: 24px;
- display: flex;
- align-items: center;
- .ant-typography {
- margin-left: 6px;
- color: var(--l2-foreground);
- font-size: var(--font-size-sm);
- font-style: normal;
- font-weight: var(--font-weight-normal);
- line-height: 18px; /* 128.571% */
- letter-spacing: -0.07px;
- }
- }
- }
- }
- }
-
- .ant-pagination-item {
- display: flex;
- justify-content: center;
- align-items: center;
-
- > a {
- color: var(--l2-foreground);
- font-variant-numeric: lining-nums tabular-nums slashed-zero;
- font-feature-settings:
- 'dlig' on,
- 'salt' on,
- 'case' on,
- 'cpsp' on;
- font-size: var(--font-size-sm);
- font-style: normal;
- font-weight: var(--font-weight-normal);
- line-height: 20px; /* 142.857% */
- }
- }
-
- .ant-pagination-item-active {
- background-color: var(--primary-background);
- > a {
- color: var(--l1-background) !important;
- font-size: var(--font-size-sm);
- font-style: normal;
- font-weight: var(--font-weight-medium);
- line-height: 20px;
- }
- }
- }
-}
-
-.delete-view-modal {
- width: calc(100% - 30px) !important; /* Adjust the 20px as needed */
- max-width: 384px;
- .ant-modal-content {
- padding: 0;
- border-radius: 4px;
- border: 1px solid var(--l1-border);
- background: var(--l2-background);
- box-shadow: 0px -4px 16px 2px rgba(0, 0, 0, 0.2);
-
- .ant-modal-header {
- padding: 16px;
- background: var(--l2-background);
- }
-
- .ant-modal-body {
- padding: 0px 16px 28px 16px;
-
- .ant-typography {
- color: var(--l2-foreground);
- font-size: var(--font-size-sm);
- font-style: normal;
- font-weight: var(--font-weight-normal);
- line-height: 20px;
- letter-spacing: -0.07px;
- }
-
- .save-view-input {
- margin-top: 8px;
- display: flex;
- gap: 8px;
- }
-
- .ant-color-picker-trigger {
- padding: 6px;
- border-radius: 2px;
- border: 1px solid var(--l1-border);
- background: var(--l3-background);
- width: 32px;
- height: 32px;
-
- .ant-color-picker-color-block {
- border-radius: 50px;
- width: 16px;
- height: 16px;
- flex-shrink: 0;
-
- .ant-color-picker-color-block-inner {
- display: flex;
- justify-content: center;
- align-items: center;
- }
- }
- }
- }
-
- .ant-modal-footer {
- display: flex;
- justify-content: flex-end;
- gap: 8px;
- padding: 16px 16px;
- margin: 0;
- }
- }
- .title {
- color: var(--l1-foreground);
- font-size: var(--font-size-sm);
- font-style: normal;
- font-weight: var(--font-weight-medium);
- line-height: 20px; /* 142.857% */
- }
-}
diff --git a/frontend/src/pages/SaveView/__test__/SaveView.test.tsx b/frontend/src/pages/SaveView/__test__/SaveView.test.tsx
deleted file mode 100644
index e9fb3b336d..0000000000
--- a/frontend/src/pages/SaveView/__test__/SaveView.test.tsx
+++ /dev/null
@@ -1,175 +0,0 @@
-/* eslint-disable @typescript-eslint/explicit-function-return-type */
-import { MemoryRouter, Route } from 'react-router-dom';
-import ROUTES from 'constants/routes';
-import { explorerView } from 'mocks-server/__mockdata__/explorer_views';
-import { server } from 'mocks-server/server';
-import { rest } from 'msw';
-import { fireEvent, render, screen, waitFor, within } from 'tests/test-utils';
-
-import SaveView from '..';
-
-const handleExplorerTabChangeTest = jest.fn();
-jest.mock('hooks/useHandleExplorerTabChange', () => ({
- useHandleExplorerTabChange: () => ({
- handleExplorerTabChange: handleExplorerTabChangeTest,
- }),
-}));
-
-jest.mock('react-router-dom', () => {
- const ROUTES = jest.requireActual('constants/routes').default;
- return {
- ...jest.requireActual('react-router-dom'),
- useLocation: jest.fn().mockReturnValue({
- pathname: ROUTES.TRACES_SAVE_VIEWS,
- }),
- };
-});
-
-describe('SaveView', () => {
- it('should render the SaveView component', async () => {
- render(<SaveView />);
- await expect(screen.findByText('Table View')).resolves.toBeInTheDocument();
-
- const savedViews = screen.getAllByRole('row');
- expect(savedViews).toHaveLength(2);
-
- // assert row 1
- expect(
- within(document.querySelector('.view-tag') as HTMLElement).getByText('T'),
- ).toBeInTheDocument();
- expect(screen.getByText('test-user-1')).toBeInTheDocument();
-
- // assert row 2
- expect(screen.getByText('R-test panel')).toBeInTheDocument();
- expect(screen.getByText('test-user-test')).toBeInTheDocument();
- });
-
- it('explorer icon should take the user to the related explorer page', async () => {
- render(
- <MemoryRouter initialEntries={[ROUTES.TRACES_SAVE_VIEWS]}>
- <Route path={ROUTES.TRACES_SAVE_VIEWS}>
- <SaveView />
- </Route>
- </MemoryRouter>,
- );
-
- await expect(screen.findByText('Table View')).resolves.toBeInTheDocument();
-
- const explorerIcon = await screen.findAllByTestId('go-to-explorer');
- expect(explorerIcon[0]).toBeInTheDocument();
-
- // Simulate click on explorer icon
- fireEvent.click(explorerIcon[0]);
-
- await waitFor(() =>
- expect(handleExplorerTabChangeTest).toHaveBeenCalledWith(
- expect.anything(),
- expect.anything(),
- '/traces-explorer', // Asserts the third argument is '/traces-explorer'
- ),
- );
- });
-
- it('should render the SaveView component with a search input', async () => {
- render(<SaveView />);
- const searchInput = screen.getByPlaceholderText('Search for views...');
- await expect(screen.findByText('Table View')).resolves.toBeInTheDocument();
-
- expect(searchInput).toBeInTheDocument();
-
- // search for 'R-test panel'
- searchInput.focus();
- (searchInput as HTMLInputElement).setSelectionRange(
- 0,
- (searchInput as HTMLInputElement).value.length,
- );
-
- fireEvent.change(searchInput, { target: { value: 'R-test panel' } });
- expect(searchInput).toHaveValue('R-test panel');
- searchInput.blur();
-
- await expect(screen.findByText('R-test panel')).resolves.toBeInTheDocument();
-
- // Table View should not be present now
- const savedViews = screen.getAllByRole('row');
- expect(savedViews).toHaveLength(1);
- });
-
- it('should be able to edit name of view', async () => {
- server.use(
- rest.put(
- 'http://localhost/api/v1/explorer/views/test-uuid-1',
- (_req, res, ctx) =>
- res(
- ctx.status(200),
- ctx.json({
- ...explorerView,
- data: [
- ...explorerView.data,
- (explorerView.data[0].name = 'New Table View'),
- ],
- }),
- ),
- ),
- );
- render(<SaveView />);
-
- const editButton = await screen.findAllByTestId('edit-view');
- fireEvent.click(editButton[0]);
-
- const viewName = await screen.findByTestId('view-name');
- expect(viewName).toBeInTheDocument();
- expect(viewName).toHaveValue('Table View');
-
- const newViewName = 'New Table View';
- fireEvent.change(viewName, { target: { value: newViewName } });
- expect(viewName).toHaveValue(newViewName);
-
- const saveButton = await screen.findByTestId('save-view');
- fireEvent.click(saveButton);
-
- await waitFor(() =>
- expect(screen.getByText(newViewName)).toBeInTheDocument(),
- );
- });
-
- it('should be able to delete a view', async () => {
- server.use(
- rest.delete(
- 'http://localhost/api/v1/explorer/views/test-uuid-1',
- (_req, res, ctx) => res(ctx.status(200), ctx.json({ status: 'success' })),
- ),
- );
-
- render(<SaveView />);
-
- const deleteButton = await screen.findAllByTestId('delete-view');
- fireEvent.click(deleteButton[0]);
-
- await expect(
- screen.findByText('delete_confirm_message'),
- ).resolves.toBeInTheDocument();
-
- const confirmButton = await screen.findByTestId('confirm-delete');
- fireEvent.click(confirmButton);
-
- await waitFor(() => expect(screen.queryByText('Table View')).toBeNull());
- });
-
- it('should render empty state', async () => {
- server.use(
- rest.get('http://localhost/api/v1/explorer/views', (_req, res, ctx) =>
- res(
- ctx.status(200),
- ctx.json({
- status: 'success',
- data: [],
- }),
- ),
- ),
- );
- render(<SaveView />);
-
- expect(screen.getByText('No data')).toBeInTheDocument();
- });
-});
diff --git a/frontend/src/pages/SaveView/constants.ts b/frontend/src/pages/SaveView/constants.ts
deleted file mode 100644
index 5691f2403c..0000000000
--- a/frontend/src/pages/SaveView/constants.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import ROUTES from 'constants/routes';
-
-export const SOURCEPAGE_VS_ROUTES: {
- [key: string]: Partial<(typeof ROUTES)[keyof typeof ROUTES]>;
-} = {
- logs: ROUTES.LOGS_EXPLORER,
- traces: ROUTES.TRACES_EXPLORER,
- metrics: ROUTES.METRICS_EXPLORER_EXPLORER,
- meter: ROUTES.METER_EXPLORER,
-} as const;
-
-export const ROUTES_VS_SOURCEPAGE: {
- [key: string]: string;
-} = {
- [ROUTES.LOGS_SAVE_VIEWS]: 'logs',
- [ROUTES.TRACES_SAVE_VIEWS]: 'traces',
- [ROUTES.METRICS_EXPLORER_VIEWS]: 'metrics',
- [ROUTES.METER_EXPLORER_VIEWS]: 'meter',
-} as const;
diff --git a/frontend/src/pages/SaveView/index.tsx b/frontend/src/pages/SaveView/index.tsx
deleted file mode 100644
index 3bd3e7fbd9..0000000000
--- a/frontend/src/pages/SaveView/index.tsx
+++ /dev/null
@@ -1,411 +0,0 @@
-import { ChangeEvent, useEffect, useRef, useState } from 'react';
-import { useTranslation } from 'react-i18next';
-import { useLocation } from 'react-router-dom';
-import { Color } from '@signozhq/design-tokens';
-import { Button } from '@signozhq/ui/button';
-import { Input } from '@signozhq/ui/input';
-import { ColorPicker, Modal, Table, TableProps } from 'antd';
-import { Typography } from '@signozhq/ui/typography';
-import logEvent from 'api/common/logEvent';
-import {
- getViewDetailsUsingViewKey,
- showErrorNotification,
-} from 'components/ExplorerCard/utils';
-import { DATE_TIME_FORMATS } from 'constants/dateTimeFormats';
-import { getRandomColor } from 'container/ExplorerOptions/utils';
-import {
- MeterExplorerEventKeys,
- MeterExplorerEvents,
-} from 'container/MeterExplorer/events';
-import {
- MetricsExplorerEventKeys,
- MetricsExplorerEvents,
-} from 'container/MetricsExplorer/events';
-import { useDeleteView } from 'hooks/saveViews/useDeleteView';
-import { useGetAllViews } from 'hooks/saveViews/useGetAllViews';
-import { useUpdateView } from 'hooks/saveViews/useUpdateView';
-import useErrorNotification from 'hooks/useErrorNotification';
-import { useHandleExplorerTabChange } from 'hooks/useHandleExplorerTabChange';
-import { useNotifications } from 'hooks/useNotifications';
-import {
- CalendarClock,
- Check,
- Compass,
- PenLine,
- Search,
- Trash2,
- X,
-} from '@signozhq/icons';
-import { useAppContext } from 'providers/App/App';
-import { useTimezone } from 'providers/Timezone';
-import { ICompositeMetricQuery } from 'types/api/alerts/compositeQuery';
-import { ViewProps } from 'types/api/saveViews/types';
-import { DataSource } from 'types/common/queryBuilder';
-import { USER_ROLES } from 'types/roles';
-
-import { ROUTES_VS_SOURCEPAGE, SOURCEPAGE_VS_ROUTES } from './constants';
-import { deleteViewHandler } from './utils';
-
-import './SaveView.styles.scss';
-
-const allowedRoles = [USER_ROLES.ADMIN, USER_ROLES.AUTHOR, USER_ROLES.EDITOR];
-
-function SaveView(): JSX.Element {
- const { pathname } = useLocation();
- const sourcepage = ROUTES_VS_SOURCEPAGE[pathname];
- const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false);
- const [activeViewKey, setActiveViewKey] = useState<string>('');
- const [newViewName, setNewViewName] = useState<string>('');
- const [color, setColor] = useState(Color.BG_SIENNA_500);
- const [isEditModalOpen, setIsEditModalOpen] = useState(false);
- const [activeViewName, setActiveViewName] = useState<string>('');
- const [activeCompositeQuery, setActiveCompositeQuery] =
- useState<ICompositeMetricQuery | null>(null);
- const [searchValue, setSearchValue] = useState<string>('');
- const [dataSource, setDataSource] = useState<ViewProps[]>([]);
- const { t } = useTranslation(['explorer']);
-
- const hideDeleteViewModal = (): void => {
- setIsDeleteModalOpen(false);
- };
-
- const { user } = useAppContext();
-
- const handleDeleteModelOpen = (uuid: string, name: string): void => {
- setActiveViewKey(uuid);
- setActiveViewName(name);
- setIsDeleteModalOpen(true);
- };
-
- const hideEditViewModal = (): void => {
- setIsEditModalOpen(false);
- };
-
- const handleEditModelOpen = (view: ViewProps, color: string): void => {
- setActiveViewKey(view.id);
- setColor(color);
- setActiveViewName(view.name);
- setNewViewName(view.name);
- setActiveCompositeQuery(view.compositeQuery);
- setIsEditModalOpen(true);
- };
-
- const { notifications } = useNotifications();
-
- const {
- data: viewsData,
- isLoading,
- error,
- isRefetching,
- refetch: refetchAllView,
- } = useGetAllViews(sourcepage as DataSource);
-
- useEffect(() => {
- setDataSource(viewsData?.data.data || []);
- }, [viewsData?.data.data]);
-
- useErrorNotification(error);
-
- const handleSearch = (e: ChangeEvent<HTMLInputElement>): void => {
- setSearchValue(e.target.value);
- const filteredData = viewsData?.data.data.filter((view) =>
- view.name.toLowerCase().includes(e.target.value.toLowerCase()),
- );
- setDataSource(filteredData || []);
- };
-
- const clearSearch = (): void => {
- setSearchValue('');
- };
-
- const { mutateAsync: deleteViewAsync, isLoading: isDeleteLoading } =
- useDeleteView(activeViewKey);
-
- const onDeleteHandler = (): void => {
- deleteViewHandler({
- deleteViewAsync,
- notifications,
- refetchAllView,
- viewId: activeViewKey,
- hideDeleteViewModal,
- clearSearch,
- });
- };
-
- const { mutateAsync: updateViewAsync, isLoading: isViewUpdating } =
- useUpdateView({
- compositeQuery: activeCompositeQuery || ({} as ICompositeMetricQuery),
- viewKey: activeViewKey,
- extraData: JSON.stringify({ color }),
- sourcePage: sourcepage || DataSource.LOGS,
- viewName: newViewName,
- });
-
- const logEventCalledRef = useRef(false);
- useEffect(() => {
- if (!logEventCalledRef.current && !isLoading) {
- if (sourcepage === DataSource.TRACES) {
- logEvent('Traces Views: Views visited', {
- number: viewsData?.data?.data?.length,
- });
- } else if (sourcepage === DataSource.LOGS) {
- logEvent('Logs Views: Views visited', {
- number: viewsData?.data?.data?.length,
- });
- } else if (sourcepage === DataSource.METRICS) {
- logEvent(MetricsExplorerEvents.TabChanged, {
- [MetricsExplorerEventKeys.Tab]: 'views',
- });
- } else if (sourcepage === 'meter') {
- logEvent(MeterExplorerEvents.TabChanged, {
- [MeterExplorerEventKeys.Tab]: 'views',
- });
- }
- logEventCalledRef.current = true;
- }
- // eslint-disable-next-line react-hooks/exhaustive-deps
- }, [viewsData?.data.data, isLoading]);
- const onUpdateQueryHandler = (): void => {
- updateViewAsync(
- {
- compositeQuery: activeCompositeQuery || ({} as ICompositeMetricQuery),
- viewKey: activeViewKey,
- extraData: JSON.stringify({ color }),
- sourcePage: sourcepage,
- viewName: activeViewName,
- },
- {
- onSuccess: () => {
- notifications.success({
- message: 'View Updated Successfully',
- });
- hideEditViewModal();
- refetchAllView();
- logEvent(MetricsExplorerEvents.ViewEdited, {
- [MetricsExplorerEventKeys.Tab]: 'views',
- });
- },
- onError: (err) => {
- showErrorNotification(notifications, err);
- },
- },
- );
- };
-
- const { handleExplorerTabChange } = useHandleExplorerTabChange();
-
- const handleRedirectQuery = (view: ViewProps): void => {
- const currentViewDetails = getViewDetailsUsingViewKey(
- view.id,
- viewsData?.data.data,
- );
- if (!currentViewDetails) {
- return;
- }
- const { query, name, id, panelType: currentPanelType } = currentViewDetails;
-
- if (sourcepage) {
- handleExplorerTabChange(
- currentPanelType,
- {
- query,
- viewName: name,
- viewKey: id,
- },
- SOURCEPAGE_VS_ROUTES[sourcepage],
- );
- logEvent(MetricsExplorerEvents.OpenInExplorerClicked, {
- [MetricsExplorerEventKeys.Tab]: 'views',
- [MetricsExplorerEventKeys.ViewName]: name,
- });
- }
- };
-
- const { formatTimezoneAdjustedTimestamp } = useTimezone();
-
- const columns: TableProps<ViewProps>['columns'] = [
- {
- title: 'Save View',
- key: 'view',
- render: (view: ViewProps): JSX.Element => {
- const extraData = view.extraData !== '' ? JSON.parse(view.extraData) : '';
- let bgColor = getRandomColor();
- if (extraData !== '') {
- bgColor = extraData.color;
- }
-
- const formattedDateAndTime = formatTimezoneAdjustedTimestamp(
- view.createdAt,
- DATE_TIME_FORMATS.DASH_TIME_DATE,
- );
-
- const isEditDeleteSupported = allowedRoles.includes(user.role as string);
-
- return (
- <div className="column-render">
- <div className="title-with-action">
- <div className="save-view-title">
- <span
- className="dot"
- style={{
- background: bgColor,
- boxShadow: `0px 0px 6px 0px ${bgColor}`,
- }}
- />{' '}
- <Typography.Text>{view.name}</Typography.Text>
- </div>
-
- <div className="action-btn">
- <PenLine
- size={14}
- className={isEditDeleteSupported ? '' : 'hidden'}
- data-testid="edit-view"
- onClick={(): void => handleEditModelOpen(view, bgColor)}
- />
- <Compass
- size={14}
- onClick={(): void => handleRedirectQuery(view)}
- data-testid="go-to-explorer"
- />
- <Trash2
- size={14}
- className={isEditDeleteSupported ? '' : 'hidden'}
- color={Color.BG_CHERRY_500}
- data-testid="delete-view"
- onClick={(): void => handleDeleteModelOpen(view.id, view.name)}
- />
- </div>
- </div>
- <div className="view-details">
- <div className="view-tag">
- <Typography.Text className="tag-text">
- {view.createdBy.substring(0, 1).toUpperCase()}
- </Typography.Text>
- </div>
- <Typography.Text className="view-created-by">
- {view.createdBy}
- </Typography.Text>
- <div className="view-created-at">
- <CalendarClock size={14} />
- <Typography.Text>{formattedDateAndTime}</Typography.Text>
- </div>
- </div>
- </div>
- );
- },
- },
- ];
-
- const paginationConfig = { pageSize: 5, hideOnSinglePage: true };
-
- return (
- <div className="save-view-container">
- <div className="save-view-content">
- <Typography.Title className="title">Views</Typography.Title>
- <Typography.Text className="subtitle">
- Manage your saved views for {ROUTES_VS_SOURCEPAGE[pathname]}.{' '}
- <Typography.Link
- className="learn-more"
- href="https://signoz.io/docs/metrics-management/metrics-explorer/?utm_source=product&utm_medium=views-tab#saved-views-in-metrics-explorer"
- target="_blank"
- >
- Learn more
- </Typography.Link>
- </Typography.Text>
- <div className="search-input-container">
- <Input
- placeholder="Search for views..."
- prefix={<Search size={12} color={Color.BG_VANILLA_400} />}
- value={searchValue}
- onChange={handleSearch}
- className="search-input"
- />
- </div>
-
- <Table
- columns={columns}
- dataSource={dataSource}
- loading={isLoading || isRefetching}
- showHeader={false}
- pagination={paginationConfig}
- />
- </div>
-
- <Modal
- className="delete-view-modal"
- title={<span className="title">Delete view</span>}
- open={isDeleteModalOpen}
- closable={false}
- onCancel={hideDeleteViewModal}
- footer={[
- <Button
- size="md"
- key="cancel"
- variant="solid"
- color="secondary"
- onClick={hideDeleteViewModal}
- prefix={<X size={16} />}
- >
- Cancel
- </Button>,
- <Button
- size="md"
- key="submit"
- variant="solid"
- color="danger"
- prefix={<Trash2 size={16} />}
- onClick={onDeleteHandler}
- loading={isDeleteLoading}
- testId="confirm-delete"
- >
- Delete view
- </Button>,
- ]}
- >
- <Typography.Text className="delete-text">
- {t('delete_confirm_message', {
- viewName: activeViewName,
- })}
- </Typography.Text>
- </Modal>
-
- <Modal
- className="save-view-modal"
- title={<span className="title">Edit view details</span>}
- open={isEditModalOpen}
- closable={false}
- onCancel={hideEditViewModal}
- footer={[
- <Button
- size="md"
- key="submit"
- variant="solid"
- color="primary"
- prefix={<Check size={16} color={Color.BG_VANILLA_100} />}
- onClick={onUpdateQueryHandler}
- loading={isViewUpdating}
- testId="save-view"
- >
- Save changes
- </Button>,
- ]}
- >
- <Typography.Text>Label</Typography.Text>
- <div className="save-view-input">
- <ColorPicker
- value={color}
- onChange={(value, hex): void => setColor(hex)}
- />
- <Input
- placeholder="e.g. Crash landing view"
- value={newViewName}
- data-testid="view-name"
- onChange={(e): void => setNewViewName(e.target.value)}
- />
- </div>
- </Modal>
- </div>
- );
-}
-
-export default SaveView;
diff --git a/frontend/src/pages/SaveView/utils.ts b/frontend/src/pages/SaveView/utils.ts
deleted file mode 100644
index 020698f64f..0000000000
--- a/frontend/src/pages/SaveView/utils.ts
+++ /dev/null
@@ -1,45 +0,0 @@
-import { UseMutateAsyncFunction } from 'react-query';
-import type { NotificationInstance } from 'antd/es/notification/interface';
-import logEvent from 'api/common/logEvent';
-import { MenuItemLabelGeneratorProps } from 'components/ExplorerCard/types';
-import { showErrorNotification } from 'components/ExplorerCard/utils';
-import {
- MetricsExplorerEventKeys,
- MetricsExplorerEvents,
-} from 'container/MetricsExplorer/events';
-import { DeleteViewPayloadProps } from 'types/api/saveViews/types';
-
-type DeleteViewProps = {
- deleteViewAsync: UseMutateAsyncFunction<DeleteViewPayloadProps, Error, string>;
- refetchAllView: MenuItemLabelGeneratorProps['refetchAllView'];
- notifications: NotificationInstance;
- viewId: string;
- hideDeleteViewModal: () => void;
- clearSearch: () => void;
-};
-
-export const deleteViewHandler = ({
- deleteViewAsync,
- refetchAllView,
- notifications,
- viewId,
- hideDeleteViewModal,
- clearSearch,
-}: DeleteViewProps): void => {
- deleteViewAsync(viewId, {
- onSuccess: () => {
- hideDeleteViewModal();
- clearSearch();
- notifications.success({
- message: 'View Deleted Successfully',
- });
- refetchAllView();
- logEvent(MetricsExplorerEvents.ViewDeleted, {
- [MetricsExplorerEventKeys.Tab]: 'views',
- });
- },
- onError: (err) => {
- showErrorNotification(notifications, err);
- },
- });
-};
diff --git a/frontend/src/pages/Services/stories/Services.stories.tsx b/frontend/src/pages/Services/stories/Services.stories.tsx
index a44f2aebfa..a148107183 100644
--- a/frontend/src/pages/Services/stories/Services.stories.tsx
+++ b/frontend/src/pages/Services/stories/Services.stories.tsx
@@ -61,13 +61,3 @@ export const Pagination: Story = {
export const OverTrialLimit: Story = {
args: { traffic: 'over-trial-limit', banner: 'trial-expiry' },
};
-
-/** The service count in the bottom strip, in place of the build version. */
-export const BottomStrip: Story = {
- args: { bottomStrip: true },
-};
-
-/** The same count on the span metrics table, which is the page's other path. */
-export const BottomStripSpanMetrics: Story = {
- args: { bottomStrip: true, mode: 'span-metrics' },
-};
diff --git a/frontend/src/pages/TraceDetailsV3/stories/TraceDetailsV3.stories.tsx b/frontend/src/pages/TraceDetailsV3/stories/TraceDetailsV3.stories.tsx
index cb0c21b6db..cd21408386 100644
--- a/frontend/src/pages/TraceDetailsV3/stories/TraceDetailsV3.stories.tsx
+++ b/frontend/src/pages/TraceDetailsV3/stories/TraceDetailsV3.stories.tsx
@@ -83,22 +83,9 @@ export const Loading: Story = {
args: { dataState: 'loading' },
};
-/**
- * The trace's span and error counts in the bottom strip, in place of the build
- * version, the error icon red while any span failed.
- */
-export const BottomStrip: Story = {
- args: { bottomStrip: true },
-};
-
/** The strip over a trace with no failing span: the error icon stays neutral. */
export const BottomStripNoErrors: Story = {
- args: { bottomStrip: true, errors: false },
-};
-
-/** The strip mid-fetch, whose counts read zero until the trace resolves. */
-export const BottomStripLoading: Story = {
- args: { bottomStrip: true, dataState: 'loading' },
+ args: { errors: false },
};
/**
diff --git a/frontend/src/pages/TracesExplorer/TracesExplorer.styles.scss b/frontend/src/pages/TracesExplorer/TracesExplorer.styles.scss
index e28fec0813..10804624b2 100644
--- a/frontend/src/pages/TracesExplorer/TracesExplorer.styles.scss
+++ b/frontend/src/pages/TracesExplorer/TracesExplorer.styles.scss
@@ -23,7 +23,6 @@
.traces-explorer-views {
padding: 8px;
- padding-bottom: 60px;
margin-bottom: 24px;
.ant-tabs-tabpane {
diff --git a/frontend/src/pages/TracesExplorer/__test__/testUtils.ts b/frontend/src/pages/TracesExplorer/__test__/testUtils.ts
index 2033a44a9c..58c0989c18 100644
--- a/frontend/src/pages/TracesExplorer/__test__/testUtils.ts
+++ b/frontend/src/pages/TracesExplorer/__test__/testUtils.ts
@@ -188,5 +188,4 @@ export const qbProviderValue = {
updateQueriesData: (): Query => initialQueriesMap.traces,
initQueryBuilderData: noop,
handleOnUnitsChange: noop,
- isStagedQueryUpdated: (): boolean => false,
} as any;
diff --git a/frontend/src/pages/TracesExplorer/index.tsx b/frontend/src/pages/TracesExplorer/index.tsx
index b61d1860e3..bc05e0c040 100644
--- a/frontend/src/pages/TracesExplorer/index.tsx
+++ b/frontend/src/pages/TracesExplorer/index.tsx
@@ -3,7 +3,6 @@ import { useQueryClient } from 'react-query';
import { useSearchParams } from 'react-router-dom-v5-compat';
import * as Sentry from '@sentry/react';
import logEvent from 'api/common/logEvent';
-import ExplorerCard from 'components/ExplorerCard/ExplorerCard';
import QueryCancelledPlaceholder from 'components/QueryCancelledPlaceholder';
import { SavedviewtypesSourceDTO } from 'api/generated/services/sigNoz.schemas';
import QuickFiltersLayout from 'components/QuickFilters/QuickFiltersLayout/QuickFiltersLayout';
@@ -11,12 +10,10 @@ import { useSignalFieldApis } from 'components/QuickFilters/hooks/useSignalField
import { QuickFiltersSource } from 'components/QuickFilters/types';
import WarningPopover from 'components/WarningPopover/WarningPopover';
import { LOCALSTORAGE } from 'constants/localStorage';
-import { AVAILABLE_EXPORT_PANEL_TYPES } from 'constants/panelTypes';
import { initialQueriesMap, PANEL_TYPES } from 'constants/queryBuilder';
import { usePageActions } from 'container/AIAssistant/pageActions/usePageActions';
import ExplorerActions from 'container/ExplorerActions/ExplorerActions';
import { getExportPanelType } from 'container/ExplorerActions/utils';
-import ExplorerOptionWrapper from 'container/ExplorerOptions/ExplorerOptionWrapper';
import { useOptionsMenu } from 'container/OptionsMenu';
import LeftToolbarActions from 'container/QueryBuilder/components/ToolbarActions/LeftToolbarActions';
import RightToolbarActions from 'container/QueryBuilder/components/ToolbarActions/RightToolbarActions';
@@ -30,8 +27,6 @@ import { defaultSelectedColumns } from 'container/TracesExplorer/ListView/config
import QuerySection from 'container/TracesExplorer/QuerySection';
import TableView from 'container/TracesExplorer/TableView';
import TracesView from 'container/TracesExplorer/TracesView';
-import { ExportDashboard } from 'hooks/dashboard/useExportDashboards';
-import { useGetExportToDashboardLink } from 'hooks/dashboard/useGetExportToDashboardLink';
import { useGetPanelTypesQueryParam } from 'hooks/queryBuilder/useGetPanelTypesQueryParam';
import { useQueryBuilder } from 'hooks/queryBuilder/useQueryBuilder';
import { useShareBuilderUrl } from 'hooks/queryBuilder/useShareBuilderUrl';
@@ -40,8 +35,6 @@ import {
useHandleExplorerTabChange,
} from 'hooks/useHandleExplorerTabChange';
import { useIsAIAssistantEnabled } from 'hooks/useIsAIAssistantEnabled';
-import { useSafeNavigate } from 'hooks/useSafeNavigate';
-import { useSavedViewEnabled } from 'hooks/useSavedViewEnabled';
import { isEmpty } from 'lodash-es';
import ErrorBoundaryFallback from 'pages/ErrorBoundaryFallback/ErrorBoundaryFallback';
import { ExplorerViews } from 'pages/LogsExplorer/utils';
@@ -53,7 +46,6 @@ import {
explorerViewToPanelType,
getExplorerViewFromUrl,
} from 'utils/explorerUtils';
-import { v4 } from 'uuid';
import {
tracesAddFilterAction,
@@ -134,9 +126,6 @@ function TracesExplorer(): JSX.Element {
const { handleExplorerTabChange } = useHandleExplorerTabChange();
const quickFilterFieldApis = useSignalFieldApis();
- const { safeNavigate } = useSafeNavigate();
- const isSavedViewEnabled = useSavedViewEnabled();
- const getExportToDashboardLink = useGetExportToDashboardLink();
const handleChangeSelectedView = useCallback(
(view: ExplorerViews, querySearchParameters?: ICurrentQueryData): void => {
@@ -219,50 +208,6 @@ function TracesExplorer(): JSX.Element {
[stagedQuery, exportDefaultQuery, exportDashboardQuery],
);
- const handleExport = useCallback(
- (dashboard: ExportDashboard | null, isNewDashboard?: boolean): void => {
- if (!dashboard || !panelType) {
- return;
- }
-
- const panelTypeParam = AVAILABLE_EXPORT_PANEL_TYPES.includes(panelType)
- ? panelType
- : PANEL_TYPES.TIME_SERIES;
-
- const widgetId = v4();
-
- const query = getExportQueryData(
- exportDefaultQuery,
- panelTypeParam,
- options,
- );
-
- logEvent('Traces Explorer: Add to dashboard successful', {
- panelType,
- isNewDashboard,
- dashboardName: dashboard?.title,
- });
-
- const dashboardEditView = getExportToDashboardLink({
- query,
- panelType: panelTypeParam,
- dashboardId: dashboard.id,
- widgetId,
- });
-
- if (dashboardEditView) {
- safeNavigate(dashboardEditView);
- }
- },
- [
- exportDefaultQuery,
- panelType,
- safeNavigate,
- options,
- getExportToDashboardLink,
- ],
- );
-
useShareBuilderUrl({ defaultValue: defaultQuery });
const logEventCalledRef = useRef(false);
@@ -323,11 +268,9 @@ function TracesExplorer(): JSX.Element {
}
/>
</div>
- <ExplorerCard sourcepage={DataSource.TRACES}>
- <div className="query-section-container">
- <QuerySection />
- </div>
- </ExplorerCard>
+ <div className="query-section-container">
+ <QuerySection />
+ </div>
<div className="traces-explorer-views">
{isCancelled && (
@@ -382,16 +325,6 @@ function TracesExplorer(): JSX.Element {
</div>
)}
</div>
-
- {!isSavedViewEnabled && (
- <ExplorerOptionWrapper
- disabled={!stagedQuery}
- query={exportDefaultQuery}
- sourcepage={DataSource.TRACES}
- onExport={handleExport}
- handleChangeSelectedView={handleChangeSelectedView}
- />
- )}
</div>
</QuickFiltersLayout>
</Sentry.ErrorBoundary>
diff --git a/frontend/src/pages/TracesModulePage/TracesModulePage.tsx b/frontend/src/pages/TracesModulePage/TracesModulePage.tsx
index 91e73d68c9..e1f484243a 100644
--- a/frontend/src/pages/TracesModulePage/TracesModulePage.tsx
+++ b/frontend/src/pages/TracesModulePage/TracesModulePage.tsx
@@ -3,22 +3,16 @@ import logEvent from 'api/common/logEvent';
import RouteTab from 'components/RouteTab';
import { TabRoutes } from 'components/RouteTab/types';
import ROUTES from 'constants/routes';
-import { useSavedViewEnabled } from 'hooks/useSavedViewEnabled';
import history from 'lib/history';
-import { tracesExplorer, tracesFunnel, tracesSaveView } from './constants';
+import { tracesExplorer, tracesFunnel } from './constants';
import './TracesModulePage.styles.scss';
function TracesModulePage(): JSX.Element {
const { pathname } = useLocation();
- const isSavedViewEnabled = useSavedViewEnabled();
- const routes: TabRoutes[] = [
- tracesExplorer,
- tracesFunnel(pathname),
- ...(isSavedViewEnabled ? [] : [tracesSaveView]),
- ].filter(Boolean) as TabRoutes[];
+ const routes: TabRoutes[] = [tracesExplorer, tracesFunnel(pathname)];
const handleTabChange = (activeRoute: string): void => {
if (activeRoute === ROUTES.TRACES_FUNNELS) {
diff --git a/frontend/src/pages/TracesModulePage/constants.tsx b/frontend/src/pages/TracesModulePage/constants.tsx
index 13a725a325..f7b1bbaa60 100644
--- a/frontend/src/pages/TracesModulePage/constants.tsx
+++ b/frontend/src/pages/TracesModulePage/constants.tsx
@@ -1,8 +1,7 @@
import { matchPath } from 'react-router-dom';
import { TabRoutes } from 'components/RouteTab/types';
import ROUTES from 'constants/routes';
-import { Compass, Cone, TowerControl } from '@signozhq/icons';
-import SaveView from 'pages/SaveView';
+import { Compass, Cone } from '@signozhq/icons';
import TracesExplorer from 'pages/TracesExplorer';
import TracesFunnelDetails from 'pages/TracesFunnelDetails';
import TracesFunnels from 'pages/TracesFunnels';
@@ -32,14 +31,3 @@ export const tracesFunnel = (pathname: string): TabRoutes => ({
route: ROUTES.TRACES_FUNNELS,
key: ROUTES.TRACES_FUNNELS,
});
-
-export const tracesSaveView: TabRoutes = {
- Component: SaveView,
- name: (
- <div className="tab-item">
- <TowerControl size={16} /> Views
- </div>
- ),
- route: ROUTES.TRACES_SAVE_VIEWS,
- key: ROUTES.TRACES_SAVE_VIEWS,
-};
diff --git a/frontend/src/pages/TracesModulePage/stories/TracesModulePage.stories.mocks.tsx b/frontend/src/pages/TracesModulePage/stories/TracesModulePage.stories.mocks.tsx
index c3762b69e5..54024d7349 100644
--- a/frontend/src/pages/TracesModulePage/stories/TracesModulePage.stories.mocks.tsx
+++ b/frontend/src/pages/TracesModulePage/stories/TracesModulePage.stories.mocks.tsx
@@ -54,10 +54,6 @@ const tracesRoute = ({ tab, view }: RouteValues): string => {
return ROUTES.TRACES_FUNNELS;
}
- if (tab === 'views') {
- return ROUTES.TRACES_SAVE_VIEWS;
- }
-
const params = new URLSearchParams({
[QueryParams.panelTypes]: JSON.stringify(explorerViewToPanelType[view]),
[QueryParams.selectedExplorerView]: view,
@@ -82,7 +78,7 @@ export const tracesMocks = defineStoryMocks({
tab: choiceControl<TracesTab>('Tab', {
group: VIEW,
description:
- 'The three pathnames the module tabs between. Clicking another tab leaves the story, so switch it here.',
+ 'The two pathnames the module tabs between. Clicking another tab leaves the story, so switch it here.',
options: TRACES_TABS,
value: 'explorer',
}),
@@ -120,7 +116,7 @@ export const tracesMocks = defineStoryMocks({
}),
savedViews: countControl('Saved views', {
group: SAVED,
- description: 'Fills the views dropdown and the Views tab.',
+ description: 'Fills the saved views list beside the explorer.',
value: 4,
max: 8,
}),
@@ -159,7 +155,7 @@ export const tracesMocks = defineStoryMocks({
),
rest.get(
- 'http://localhost/api/v1/explorer/views',
+ 'http://localhost/api/v2/saved_views',
response.json(() => savedTraceViewsResponse(values.savedViews)),
),
diff --git a/frontend/src/pages/TracesModulePage/stories/TracesModulePage.stories.tsx b/frontend/src/pages/TracesModulePage/stories/TracesModulePage.stories.tsx
index cc7e38e3af..e634db090a 100644
--- a/frontend/src/pages/TracesModulePage/stories/TracesModulePage.stories.tsx
+++ b/frontend/src/pages/TracesModulePage/stories/TracesModulePage.stories.tsx
@@ -20,7 +20,7 @@ const pageStory = storyMocks(tracesMocks, { layout: 'app' });
/**
* The traces explorer: the query builder, the span list and its detail drawer,
- * with saved views and funnels as tabs.
+ * with saved views beside it and funnels as a tab.
*
* Route: `/traces-explorer`.
*/
@@ -86,11 +86,6 @@ export const Funnels: Story = {
args: { tab: 'funnels' },
};
-/** The Views tab, where the saved views the explorer offers are managed. */
-export const SavedViews: Story = {
- args: { tab: 'views' },
-};
-
/**
* A fresh workspace: nothing ingested in the window and no quick filters
* configured yet, so the table and the filter panel both show their empty
diff --git a/frontend/src/pages/TracesModulePage/stories/__story_mockdata__/traces.ts b/frontend/src/pages/TracesModulePage/stories/__story_mockdata__/traces.ts
index 79019d8fc6..536bcba070 100644
--- a/frontend/src/pages/TracesModulePage/stories/__story_mockdata__/traces.ts
+++ b/frontend/src/pages/TracesModulePage/stories/__story_mockdata__/traces.ts
@@ -4,16 +4,22 @@
*/
import {
+ Querybuildertypesv5QueryBuilderQueryGithubComSigNozSignozPkgTypesQuerybuildertypesQuerybuildertypesv5TraceAggregationDTOSignal as TracesSignal,
+ Querybuildertypesv5QueryEnvelopeBuilderDTOType,
+ Querybuildertypesv5RequestTypeDTO,
QuickfiltertypesSourceDTO,
+ SavedviewtypesPanelTypeDTO,
+ SavedviewtypesSchemaVersionDTO,
+ SavedviewtypesSourceDTO,
TelemetrytypesFieldContextDTO,
TelemetrytypesFieldDataTypeDTO,
TelemetrytypesSignalDTO,
} from 'api/generated/services/sigNoz.schemas';
import type {
GetQuickFilters200,
+ ListSavedViews200,
TelemetrytypesTelemetryFieldKeyDTO,
} from 'api/generated/services/sigNoz.schemas';
-import { explorerView } from 'mocks-server/__mockdata__/explorer_views';
import { ExplorerViews } from 'pages/LogsExplorer/utils';
import type { IAttributeValuesResponse } from 'types/api/queryBuilder/getAttributesValues';
import type { FunnelData } from 'types/api/traceFunnels';
@@ -22,7 +28,7 @@ import type { RawRow } from 'types/api/v5/queryRange';
import { fieldKeysResponse } from '@/storybook/msw/__story_mockdata__/fields';
import { quickFiltersResponse } from '@/storybook/msw/__story_mockdata__/quickFilters';
-export const TRACES_TABS = ['explorer', 'funnels', 'views'] as const;
+export const TRACES_TABS = ['explorer', 'funnels'] as const;
export type TracesTab = (typeof TRACES_TABS)[number];
@@ -311,20 +317,29 @@ const VIEW_NAMES = [
'Notification retries',
];
-export const savedTraceViewsResponse = (
- count: number,
-): { status: string; data: unknown[] } => ({
+export const savedTraceViewsResponse = (count: number): ListSavedViews200 => ({
status: 'success',
- data: Array.from(
- { length: Math.min(count, VIEW_NAMES.length) },
- (_, index) => ({
- ...explorerView.data[0],
- id: `storybook-traces-view-${index + 1}`,
- name: VIEW_NAMES[index],
- sourcePage: 'traces',
- tags: ['traces'],
- }),
- ),
+ data: VIEW_NAMES.slice(0, count).map((displayName, index) => ({
+ id: `storybook-traces-view-${index + 1}`,
+ name: `storybook-traces-view-${index + 1}`,
+ source: SavedviewtypesSourceDTO.traces,
+ schemaVersion: SavedviewtypesSchemaVersionDTO.v2,
+ createdAt: '2026-08-20T09:00:00Z',
+ createdBy: '[email protected]',
+ updatedAt: '2026-08-20T09:00:00Z',
+ updatedBy: '[email protected]',
+ spec: {
+ displayName,
+ panelType: SavedviewtypesPanelTypeDTO.list,
+ requestType: Querybuildertypesv5RequestTypeDTO.raw,
+ queries: [
+ {
+ type: Querybuildertypesv5QueryEnvelopeBuilderDTOType.builder_query,
+ spec: { name: 'A', signal: TracesSignal.traces },
+ },
+ ],
+ },
+ })),
});
const FUNNEL_NAMES = [
diff --git a/frontend/src/providers/QueryBuilder.tsx b/frontend/src/providers/QueryBuilder.tsx
index 1cfcc8e7ce..616f5345c5 100644
--- a/frontend/src/providers/QueryBuilder.tsx
+++ b/frontend/src/providers/QueryBuilder.tsx
@@ -9,7 +9,6 @@ import {
useState,
} from 'react';
import { useLocation } from 'react-router-dom';
-import { isQueryUpdatedInView } from 'components/ExplorerCard/utils';
import { QueryParams } from 'constants/query';
import {
alphabet,
@@ -33,7 +32,6 @@ import {
panelTypeDataSourceFormValuesMap,
PartialPanelTypes,
} from 'lib/query/panelTypeDataSourceFormValuesMap';
-import { OptionsQuery } from 'container/OptionsMenu/types';
import { useNormalizedCompositeQueryParam } from 'hooks/queryBuilder/useGetCompositeQueryParam';
import { updateStepInterval } from 'hooks/queryBuilder/useStepInterval';
import { useSafeNavigate } from 'hooks/useSafeNavigate';
@@ -53,7 +51,6 @@ import {
Query,
QueryState,
} from 'types/api/queryBuilder/queryBuilderData';
-import { ViewProps } from 'types/api/saveViews/types';
import { EQueryType } from 'types/common/dashboard';
import {
DataSource,
@@ -98,7 +95,6 @@ export const QueryBuilderContext = createContext<QueryBuilderContextType>({
updateQueriesData: () => initialQueriesMap.metrics,
initQueryBuilderData: () => {},
handleOnUnitsChange: () => {},
- isStagedQueryUpdated: () => false,
isDefaultQuery: () => false,
});
@@ -938,22 +934,6 @@ export function QueryBuilderProvider({
[updateQueryBuilderData],
);
- const isStagedQueryUpdated = useCallback(
- (
- viewData: ViewProps[] | undefined,
- viewKey: string,
- options: OptionsQuery,
- ): boolean =>
- isQueryUpdatedInView({
- currentPanelType: panelType,
- data: viewData,
- stagedQuery,
- viewKey,
- options,
- }),
- [panelType, stagedQuery],
- );
-
const { safeNavigate } = useSafeNavigate({
preventSameUrlNavigation: false,
});
@@ -1213,7 +1193,6 @@ export function QueryBuilderProvider({
updateQueriesData,
initQueryBuilderData,
handleOnUnitsChange,
- isStagedQueryUpdated,
}),
[
query,
@@ -1244,7 +1223,6 @@ export function QueryBuilderProvider({
updateQueriesData,
initQueryBuilderData,
handleOnUnitsChange,
- isStagedQueryUpdated,
],
);
diff --git a/frontend/src/storybook/foundations/BottomStrip.stories.tsx b/frontend/src/storybook/foundations/BottomStrip.stories.tsx
index 21cc052213..19c20208d5 100644
--- a/frontend/src/storybook/foundations/BottomStrip.stories.tsx
+++ b/frontend/src/storybook/foundations/BottomStrip.stories.tsx
@@ -25,7 +25,6 @@ const meta = {
title: 'Foundations/Bottom Strip',
tags: ['play'],
component: EmptyPage,
- args: { bottomStrip: true },
parameters: { signoz: { route: ROUTES.HOME, layout: 'app' } },
} satisfies Meta<GlobalMockArgs>;
diff --git a/frontend/src/storybook/globals/appShellMocks.ts b/frontend/src/storybook/globals/appShellMocks.ts
index 66a166167e..8861035977 100644
--- a/frontend/src/storybook/globals/appShellMocks.ts
+++ b/frontend/src/storybook/globals/appShellMocks.ts
@@ -1,8 +1,5 @@
import { StatusCodes } from 'http-status-codes';
-import remove from 'api/browser/localstorage/remove';
-import set from 'api/browser/localstorage/set';
import { FeatureKeys } from 'constants/features';
-import { LOCALSTORAGE } from 'constants/localStorage';
import { USER_PREFERENCES } from 'constants/userPreferences';
import type { IAppContext } from 'providers/App/types';
import { createAppContextMock } from 'tests/fixtures/appContextMock';
@@ -18,7 +15,7 @@ import type { UserPreference } from 'types/api/preferences/preference';
import { USER_ROLES } from 'types/roles';
import { setNoAuthMode } from 'utils/noAuthMode';
-import { choiceControl, toggleControl } from '../controls/controls';
+import { choiceControl } from '../controls/controls';
import { defineStoryMocks } from '../controls/defineStoryMocks';
import type { StoryMockArgs } from '../controls/types';
import { RESPONSE_STATES, type ResponseState } from '../runtime/responseState';
@@ -266,12 +263,6 @@ export const appShellMocks = defineStoryMocks({
options: SIDENAV_STATES,
value: 'pinned',
}),
- bottomStrip: toggleControl('Bottom strip', {
- group: APP_SHELL,
- description:
- 'The `SAVED_VIEW_ENABLED` localStorage flag the bottom strip ships behind.',
- value: false,
- }),
support: choiceControl<SupportState>('Support', {
group: APP_SHELL,
description:
@@ -299,15 +290,9 @@ export const appShellMocks = defineStoryMocks({
},
};
},
- effect: ({ banner, bottomStrip, support }) => {
+ effect: ({ banner, support }) => {
setNoAuthMode(banner === 'no-auth');
- if (bottomStrip) {
- set(LOCALSTORAGE.SAVED_VIEW_ENABLED, 'true');
- } else {
- remove(LOCALSTORAGE.SAVED_VIEW_ENABLED);
- }
-
const pylon = window.signozBootData?.settings?.pylon;
if (pylon) {
diff --git a/frontend/src/types/api/saveViews/types.ts b/frontend/src/types/api/saveViews/types.ts
deleted file mode 100644
index c5f3c9c60e..0000000000
--- a/frontend/src/types/api/saveViews/types.ts
+++ /dev/null
@@ -1,51 +0,0 @@
-import { DataSource } from 'types/common/queryBuilder';
-
-import { ICompositeMetricQuery } from '../alerts/compositeQuery';
-
-export interface ViewProps {
- id: string;
- name: string;
- category: string;
- createdAt: string;
- createdBy: string;
- updatedAt: string;
- updatedBy: string;
- sourcePage: DataSource;
- tags: string[];
- compositeQuery: ICompositeMetricQuery;
- extraData: string;
-}
-
-export interface AllViewsProps {
- status: string;
- data: ViewProps[];
-}
-
-export interface SaveViewProps {
- compositeQuery: ICompositeMetricQuery;
- sourcePage: DataSource;
- viewName: string;
- extraData: string;
-}
-
-export interface SaveViewPayloadProps {
- status: string;
- data: string;
-}
-
-export interface DeleteViewPayloadProps {
- status: string;
-}
-
-export interface UpdateViewProps {
- viewKey: string;
- compositeQuery: ICompositeMetricQuery;
- extraData: string;
- sourcePage: string;
- viewName: string;
-}
-
-export interface UpdateViewPayloadProps {
- success: string;
- data: ViewProps;
-}
diff --git a/frontend/src/types/common/queryBuilder.ts b/frontend/src/types/common/queryBuilder.ts
index 61e60812ec..3a36b75a8e 100644
--- a/frontend/src/types/common/queryBuilder.ts
+++ b/frontend/src/types/common/queryBuilder.ts
@@ -6,7 +6,6 @@ import {
import { PANEL_TYPES } from 'constants/queryBuilder';
import ROUTES from 'constants/routes';
import { Format } from 'constants/formats/types';
-import { OptionsQuery } from 'container/OptionsMenu/types';
import {
IBuilderFormula,
IBuilderQuery,
@@ -16,7 +15,6 @@ import {
Query,
QueryState,
} from 'types/api/queryBuilder/queryBuilderData';
-import { ViewProps } from 'types/api/saveViews/types';
import { EQueryType } from './dashboard';
@@ -334,11 +332,6 @@ export type QueryBuilderContextType = {
) => QueryBuilderData[T][number],
) => Query;
initQueryBuilderData: (query: Query, timeUpdated?: boolean) => void;
- isStagedQueryUpdated: (
- viewData: ViewProps[] | undefined,
- viewKey: string,
- options: OptionsQuery,
- ) => boolean;
isDefaultQuery: (props: IsDefaultQueryProps) => boolean;
};
diff --git a/frontend/src/utils/permission/index.ts b/frontend/src/utils/permission/index.ts
index a5901f1c0f..99e842aaea 100644
--- a/frontend/src/utils/permission/index.ts
+++ b/frontend/src/utils/permission/index.ts
@@ -112,8 +112,6 @@ export const routePermission: Record<keyof typeof ROUTES, ROLES[]> = {
BILLING: ['ADMIN', 'EDITOR', 'VIEWER'],
SUPPORT: ['ADMIN', 'EDITOR', 'VIEWER', 'ANONYMOUS'],
SOMETHING_WENT_WRONG: ['ADMIN', 'EDITOR', 'VIEWER'],
- LOGS_SAVE_VIEWS: ['ADMIN', 'EDITOR', 'VIEWER'],
- TRACES_SAVE_VIEWS: ['ADMIN', 'EDITOR', 'VIEWER'],
TRACES_FUNNELS: ['ADMIN', 'EDITOR', 'VIEWER'],
TRACES_FUNNELS_DETAIL: ['ADMIN', 'EDITOR', 'VIEWER'],
LOGS_BASE: ['ADMIN', 'EDITOR', 'VIEWER'],
@@ -128,7 +126,6 @@ export const routePermission: Record<keyof typeof ROUTES, ROLES[]> = {
MESSAGING_QUEUES_OVERVIEW: ['ADMIN', 'EDITOR', 'VIEWER'],
METRICS_EXPLORER: ['ADMIN', 'EDITOR', 'VIEWER'],
METRICS_EXPLORER_EXPLORER: ['ADMIN', 'EDITOR', 'VIEWER'],
- METRICS_EXPLORER_VIEWS: ['ADMIN', 'EDITOR', 'VIEWER'],
METRICS_EXPLORER_VOLUME_CONTROL: ['ADMIN', 'EDITOR', 'VIEWER'],
API_MONITORING: ['ADMIN', 'EDITOR', 'VIEWER'],
WORKSPACE_ACCESS_RESTRICTED: ['ADMIN', 'EDITOR', 'VIEWER'],
@@ -138,7 +135,6 @@ export const routePermission: Record<keyof typeof ROUTES, ROLES[]> = {
MESSAGING_QUEUES_BASE: ['ADMIN', 'EDITOR', 'VIEWER'],
METER_EXPLORER: ['ADMIN', 'EDITOR', 'VIEWER'],
METER: ['ADMIN', 'EDITOR', 'VIEWER'],
- METER_EXPLORER_VIEWS: ['ADMIN', 'EDITOR', 'VIEWER'],
PUBLIC_DASHBOARD: ['ADMIN', 'EDITOR', 'VIEWER'],
AI_ASSISTANT: ['ADMIN', 'EDITOR', 'VIEWER'],
AI_ASSISTANT_ICON_PREVIEW: ['ADMIN', 'EDITOR', 'VIEWER'],