Skip to content

Commit

Permalink
Merge pull request #3882 from SigNoz/release/v0.33.1
Browse files Browse the repository at this point in the history
Release/v0.33.1
  • Loading branch information
ankitnayan authored Nov 2, 2023
2 parents 7603e0e + 9f5039d commit 0ab09c1
Show file tree
Hide file tree
Showing 12 changed files with 52 additions and 32 deletions.
4 changes: 2 additions & 2 deletions deploy/docker-swarm/clickhouse-setup/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ services:
condition: on-failure

query-service:
image: signoz/query-service:0.33.0
image: signoz/query-service:0.33.1
command:
[
"-config=/root/config/prometheus.yml",
Expand Down Expand Up @@ -186,7 +186,7 @@ services:
<<: *db-depend

frontend:
image: signoz/frontend:0.33.0
image: signoz/frontend:0.33.1
deploy:
restart_policy:
condition: on-failure
Expand Down
4 changes: 2 additions & 2 deletions deploy/docker/clickhouse-setup/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ services:
# Notes for Maintainers/Contributors who will change Line Numbers of Frontend & Query-Section. Please Update Line Numbers in `./scripts/commentLinesForSetup.sh` & `./CONTRIBUTING.md`

query-service:
image: signoz/query-service:${DOCKER_TAG:-0.33.0}
image: signoz/query-service:${DOCKER_TAG:-0.33.1}
container_name: signoz-query-service
command:
[
Expand Down Expand Up @@ -203,7 +203,7 @@ services:
<<: *db-depend

frontend:
image: signoz/frontend:${DOCKER_TAG:-0.33.0}
image: signoz/frontend:${DOCKER_TAG:-0.33.1}
container_name: signoz-frontend
restart: on-failure
depends_on:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import Label from './Label';
export const getLabel = (
labelClickedHandler: (labelIndex: number) => void,
): ColumnType<DataSetProps> => ({
render: (label: string, _, index): JSX.Element => (
render: (label, record): JSX.Element => (
<Label
label={label}
labelIndex={index}
labelIndex={record.index}
labelClickedHandler={labelClickedHandler}
/>
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ export const getGraphManagerTableColumns = ({
width: 50,
dataIndex: ColumnsKeyAndDataIndex.Index,
key: ColumnsKeyAndDataIndex.Index,
render: (_: string, __: DataSetProps, index: number): JSX.Element => (
render: (_: string, record: DataSetProps): JSX.Element => (
<CustomCheckBox
data={data}
index={index}
index={record.index}
checkBoxOnChangeHandler={checkBoxOnChangeHandler}
graphVisibilityState={graphVisibilityState}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,21 @@ function WidgetGraphComponent({
[data, name],
);

const [graphsVisibilityStates, setGraphsVisibilityStates] = useState<
boolean[]
>(localStoredVisibilityStates);

useEffect(() => {
if (!lineChartRef.current) return;

localStoredVisibilityStates.forEach((state, index) => {
lineChartRef.current?.toggleGraph(index, state);
});
setGraphsVisibilityStates(localStoredVisibilityStates);
}, [localStoredVisibilityStates]);

const { setLayouts, selectedDashboard, setSelectedDashboard } = useDashboard();

const [graphsVisibilityStates, setGraphsVisibilityStates] = useState<
boolean[]
>(localStoredVisibilityStates);

const { featureResponse } = useSelector<AppState, AppReducer>(
(state) => state.app,
);
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/container/GridCardLayout/GridCardLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ function GraphLayout({
<CardContainer isDarkMode={isDarkMode} key={id} data-grid={layout}>
<Card $panelType={currentWidget?.panelTypes || PANEL_TYPES.TIME_SERIES}>
<GridCard
widget={currentWidget || ({ id } as Widgets)}
widget={currentWidget || ({ id, query: {} } as Widgets)}
name={currentWidget?.id || ''}
headerMenuList={headerMenuList}
/>
Expand Down
7 changes: 7 additions & 0 deletions frontend/src/container/ListOfDashboard/ImportJSON/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Editor from 'components/Editor';
import ROUTES from 'constants/routes';
import { MESSAGE } from 'hooks/useFeatureFlag';
import { useNotifications } from 'hooks/useNotifications';
import { getUpdatedLayout } from 'lib/dashboard/getUpdatedLayout';
import history from 'lib/history';
import { useState } from 'react';
import { useTranslation } from 'react-i18next';
Expand Down Expand Up @@ -65,6 +66,12 @@ function ImportJSON({
setDashboardCreating(true);
const dashboardData = JSON.parse(editorValue) as DashboardData;

if (dashboardData?.layout) {
dashboardData.layout = getUpdatedLayout(dashboardData.layout);
} else {
dashboardData.layout = [];
}

const response = await createDashboard({
...dashboardData,
uploadedGrafana,
Expand Down
1 change: 1 addition & 0 deletions frontend/src/container/QueryTable/QueryTable.styles.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.query-table {
position: relative;
height: inherit;
.query-table--download {
position: absolute;
top: 15px;
Expand Down
23 changes: 23 additions & 0 deletions frontend/src/lib/dashboard/getUpdatedLayout.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { PANEL_TYPES } from 'constants/queryBuilder';
import { Layout } from 'react-grid-layout';

export const getUpdatedLayout = (layout?: Layout[]): Layout[] => {
let widgetLayout = layout;

// filter empty from i from i due to previous version of signoz
widgetLayout = layout?.filter((i) => i.i !== 'empty');

const seen = new Set();

// filter duplicate i values
widgetLayout = widgetLayout?.filter((i) => {
const duplicate = seen.has(i.i);
seen.add(i.i);
return !duplicate;
});

// filter EMPTY_WIDGET from i due to previous version of signoz
widgetLayout = widgetLayout?.filter((i) => i.i !== PANEL_TYPES.EMPTY_WIDGET);

return widgetLayout || [];
};
20 changes: 4 additions & 16 deletions frontend/src/providers/Dashboard/Dashboard.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Modal } from 'antd';
import get from 'api/dashboard/get';
import { PANEL_TYPES } from 'constants/queryBuilder';
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
import ROUTES from 'constants/routes';
import { getMinMax } from 'container/TopNav/AutoRefresh/config';
import dayjs, { Dayjs } from 'dayjs';
import useTabVisibility from 'hooks/useTabFocus';
import { getUpdatedLayout } from 'lib/dashboard/getUpdatedLayout';
import {
createContext,
PropsWithChildren,
Expand Down Expand Up @@ -107,11 +107,7 @@ export function DashboardProvider({

dashboardRef.current = data;

setLayouts(
data.data.layout?.filter(
(layout) => layout.i !== PANEL_TYPES.EMPTY_WIDGET,
) || [],
);
setLayouts(getUpdatedLayout(data.data.layout));
}

if (
Expand Down Expand Up @@ -147,11 +143,7 @@ export function DashboardProvider({

updatedTimeRef.current = dayjs(data.updated_at);

setLayouts(
data.data.layout?.filter(
(layout) => layout.i !== PANEL_TYPES.EMPTY_WIDGET,
) || [],
);
setLayouts(getUpdatedLayout(data.data.layout));
},
});

Expand All @@ -164,11 +156,7 @@ export function DashboardProvider({

setSelectedDashboard(data);

setLayouts(
data.data.layout?.filter(
(layout) => layout.i !== PANEL_TYPES.EMPTY_WIDGET,
) || [],
);
setLayouts(getUpdatedLayout(data.data.layout));
}
},
},
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.21
require (
github.com/ClickHouse/clickhouse-go/v2 v2.14.0
github.com/SigNoz/govaluate v0.0.0-20220522085550-d19c08c206cb
github.com/SigNoz/signoz-otel-collector v0.79.12
github.com/SigNoz/signoz-otel-collector v0.79.13
github.com/SigNoz/zap_otlp/zap_otlp_encoder v0.0.0-20230822164844-1b861a431974
github.com/SigNoz/zap_otlp/zap_otlp_sync v0.0.0-20230822164844-1b861a431974
github.com/antonmedv/expr v1.12.5
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ github.com/SigNoz/govaluate v0.0.0-20220522085550-d19c08c206cb h1:bneLSKPf9YUSFm
github.com/SigNoz/govaluate v0.0.0-20220522085550-d19c08c206cb/go.mod h1:JznGDNg9x1cujDKa22RaQOimOvvEfy3nxzDGd8XDgmA=
github.com/SigNoz/prometheus v1.9.78 h1:bB3yuDrRzi/Mv00kWayR9DZbyjTuGfendSqISyDcXiY=
github.com/SigNoz/prometheus v1.9.78/go.mod h1:MffmFu2qFILQrOHehx3D0XjYtaZMVfI+Ppeiv98x4Ww=
github.com/SigNoz/signoz-otel-collector v0.79.12 h1:0yDMhcN7Taa8WrFv8YrHRaDvRxHqLfp5c6w1TSEWk+I=
github.com/SigNoz/signoz-otel-collector v0.79.12/go.mod h1:MXjHt3atjTAF2Wrqu0W7Xx+oJ1yb8UfpsNu+A8Ssjtg=
github.com/SigNoz/signoz-otel-collector v0.79.13 h1:An8tJwvIpbfyC2Gtxs/Z424jLbKO2a6W7UzQ64G5/zI=
github.com/SigNoz/signoz-otel-collector v0.79.13/go.mod h1:P6tjd7wTHgHvBk6lHAXR++EuQaGY2mGu0aQWyI086qs=
github.com/SigNoz/zap_otlp v0.1.0 h1:T7rRcFN87GavY8lDGZj0Z3Xv6OhJA6Pj3I9dNPmqvRc=
github.com/SigNoz/zap_otlp v0.1.0/go.mod h1:lcHvbDbRgvDnPxo9lDlaL1JK2PyOyouP/C3ynnYIvyo=
github.com/SigNoz/zap_otlp/zap_otlp_encoder v0.0.0-20230822164844-1b861a431974 h1:PKVgdf83Yw+lZJbFtNGBgqXiXNf3+kOXW2qZ7Ms7OaY=
Expand Down

0 comments on commit 0ab09c1

Please sign in to comment.