Skip to content

Commit 6c192f1

Browse files
Merge branch 'develop' into release/v0.48.x
2 parents 5376410 + adfeaaa commit 6c192f1

File tree

29 files changed

+258
-256
lines changed

29 files changed

+258
-256
lines changed

frontend/src/constants/panelTypes.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,5 @@ export const getComponentForPanelType = (
4040
export const AVAILABLE_EXPORT_PANEL_TYPES = [
4141
PANEL_TYPES.TIME_SERIES,
4242
PANEL_TYPES.TABLE,
43+
PANEL_TYPES.LIST,
4344
];

frontend/src/container/GridCardLayout/GridCard/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ function GridCardGraph({
108108
query: updatedQuery,
109109
globalSelectedInterval,
110110
variables: getDashboardVariables(variables),
111+
fillGaps: widget.fillSpans,
111112
};
112113
}
113114
updatedQuery.builder.queryData[0].pageSize = 10;
@@ -122,6 +123,7 @@ function GridCardGraph({
122123
limit: updatedQuery.builder.queryData[0].limit || 0,
123124
},
124125
},
126+
fillGaps: widget.fillSpans,
125127
};
126128
});
127129

@@ -152,6 +154,7 @@ function GridCardGraph({
152154
widget?.query,
153155
widget?.panelTypes,
154156
widget.timePreferance,
157+
widget.fillSpans,
155158
requestData,
156159
],
157160
retry(failureCount, error): boolean {

frontend/src/container/LogsExplorerViews/index.tsx

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import { useNotifications } from 'hooks/useNotifications';
3737
import useUrlQueryData from 'hooks/useUrlQueryData';
3838
import { FlatLogData } from 'lib/logs/flatLogData';
3939
import { getPaginationQueryData } from 'lib/newQueryBuilder/getPaginationQueryData';
40-
import { defaultTo, isEmpty, omit } from 'lodash-es';
40+
import { cloneDeep, defaultTo, isEmpty, omit, set } from 'lodash-es';
4141
import { Sliders } from 'lucide-react';
4242
import { SELECTED_VIEWS } from 'pages/LogsExplorer/utils';
4343
import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
@@ -117,6 +117,12 @@ function LogsExplorerViews({
117117
return stagedQuery.builder.queryData.find((item) => !item.disabled) || null;
118118
}, [stagedQuery]);
119119

120+
const { options, config } = useOptionsMenu({
121+
storageKey: LOCALSTORAGE.LOGS_LIST_OPTIONS,
122+
dataSource: initialDataSource || DataSource.LOGS,
123+
aggregateOperator: listQuery?.aggregateOperator || StringOperators.NOOP,
124+
});
125+
120126
const orderByTimestamp: OrderByPayload | null = useMemo(() => {
121127
const timestampOrderBy = listQuery?.orderBy.find(
122128
(item) => item.columnName === 'timestamp',
@@ -174,10 +180,10 @@ function LogsExplorerViews({
174180
() =>
175181
updateAllQueriesOperators(
176182
currentQuery || initialQueriesMap.logs,
177-
PANEL_TYPES.TIME_SERIES,
183+
selectedPanelType,
178184
DataSource.LOGS,
179185
),
180-
[currentQuery, updateAllQueriesOperators],
186+
[currentQuery, selectedPanelType, updateAllQueriesOperators],
181187
);
182188

183189
const handleModeChange = (panelType: PANEL_TYPES): void => {
@@ -309,6 +315,14 @@ function LogsExplorerViews({
309315
isLoading: isUpdateDashboardLoading,
310316
} = useUpdateDashboard();
311317

318+
const getUpdatedQueryForExport = useCallback((): Query => {
319+
const updatedQuery = cloneDeep(currentQuery);
320+
321+
set(updatedQuery, 'builder.queryData[0].pageSize', 10);
322+
323+
return updatedQuery;
324+
}, [currentQuery]);
325+
312326
const handleExport = useCallback(
313327
(dashboard: Dashboard | null): void => {
314328
if (!dashboard || !panelType) return;
@@ -319,11 +333,17 @@ function LogsExplorerViews({
319333

320334
const widgetId = v4();
321335

336+
const query =
337+
panelType === PANEL_TYPES.LIST
338+
? getUpdatedQueryForExport()
339+
: exportDefaultQuery;
340+
322341
const updatedDashboard = addEmptyWidgetInDashboardJSONWithQuery(
323342
dashboard,
324-
exportDefaultQuery,
343+
query,
325344
widgetId,
326345
panelTypeParam,
346+
options.selectColumns,
327347
);
328348

329349
updateDashboard(updatedDashboard, {
@@ -353,7 +373,7 @@ function LogsExplorerViews({
353373
}
354374

355375
const dashboardEditView = generateExportToDashboardLink({
356-
query: exportDefaultQuery,
376+
query,
357377
panelType: panelTypeParam,
358378
dashboardId: data.payload?.uuid || '',
359379
widgetId,
@@ -365,7 +385,9 @@ function LogsExplorerViews({
365385
});
366386
},
367387
[
388+
getUpdatedQueryForExport,
368389
exportDefaultQuery,
390+
options.selectColumns,
369391
history,
370392
notifications,
371393
panelType,
@@ -460,12 +482,6 @@ function LogsExplorerViews({
460482
selectedView,
461483
]);
462484

463-
const { options, config } = useOptionsMenu({
464-
storageKey: LOCALSTORAGE.LOGS_LIST_OPTIONS,
465-
dataSource: initialDataSource || DataSource.METRICS,
466-
aggregateOperator: listQuery?.aggregateOperator || StringOperators.NOOP,
467-
});
468-
469485
const chartData = useMemo(() => {
470486
if (!stagedQuery) return [];
471487

frontend/src/container/LogsPanelTable/LogsPanelComponent.styles.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
height: 100%;
66

77
.resize-table {
8-
height: calc(100% - 40px);
8+
height: calc(100% - 70px);
99
overflow: scroll;
1010
overflow-x: hidden;
1111

frontend/src/container/NewDashboard/DashboardVariablesSelection/DashboardVariableSelection.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ function DashboardVariableSelection(): JSX.Element | null {
138138
}}
139139
onValueUpdate={onValueUpdate}
140140
variablesToGetUpdated={variablesToGetUpdated}
141+
setVariablesToGetUpdated={setVariablesToGetUpdated}
141142
/>
142143
))}
143144
</Row>

frontend/src/container/NewDashboard/DashboardVariablesSelection/VariableItem.test.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ describe('VariableItem', () => {
5454
existingVariables={{}}
5555
onValueUpdate={mockOnValueUpdate}
5656
variablesToGetUpdated={[]}
57+
setVariablesToGetUpdated={(): void => {}}
5758
/>
5859
</MockQueryClientProvider>,
5960
);
@@ -69,6 +70,7 @@ describe('VariableItem', () => {
6970
existingVariables={{}}
7071
onValueUpdate={mockOnValueUpdate}
7172
variablesToGetUpdated={[]}
73+
setVariablesToGetUpdated={(): void => {}}
7274
/>
7375
</MockQueryClientProvider>,
7476
);
@@ -83,6 +85,7 @@ describe('VariableItem', () => {
8385
existingVariables={{}}
8486
onValueUpdate={mockOnValueUpdate}
8587
variablesToGetUpdated={[]}
88+
setVariablesToGetUpdated={(): void => {}}
8689
/>
8790
</MockQueryClientProvider>,
8891
);
@@ -111,6 +114,7 @@ describe('VariableItem', () => {
111114
existingVariables={{}}
112115
onValueUpdate={mockOnValueUpdate}
113116
variablesToGetUpdated={[]}
117+
setVariablesToGetUpdated={(): void => {}}
114118
/>
115119
</MockQueryClientProvider>,
116120
);
@@ -134,6 +138,7 @@ describe('VariableItem', () => {
134138
existingVariables={{}}
135139
onValueUpdate={mockOnValueUpdate}
136140
variablesToGetUpdated={[]}
141+
setVariablesToGetUpdated={(): void => {}}
137142
/>
138143
</MockQueryClientProvider>,
139144
);
@@ -149,6 +154,7 @@ describe('VariableItem', () => {
149154
existingVariables={{}}
150155
onValueUpdate={mockOnValueUpdate}
151156
variablesToGetUpdated={[]}
157+
setVariablesToGetUpdated={(): void => {}}
152158
/>
153159
</MockQueryClientProvider>,
154160
);

frontend/src/container/NewDashboard/DashboardVariablesSelection/VariableItem.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ interface VariableItemProps {
5252
allSelected: boolean,
5353
) => void;
5454
variablesToGetUpdated: string[];
55+
setVariablesToGetUpdated: React.Dispatch<React.SetStateAction<string[]>>;
5556
}
5657

5758
const getSelectValue = (
@@ -73,6 +74,7 @@ function VariableItem({
7374
existingVariables,
7475
onValueUpdate,
7576
variablesToGetUpdated,
77+
setVariablesToGetUpdated,
7678
}: VariableItemProps): JSX.Element {
7779
const [optionsData, setOptionsData] = useState<(string | number | boolean)[]>(
7880
[],
@@ -171,6 +173,10 @@ function VariableItem({
171173
}
172174

173175
setOptionsData(newOptionsData);
176+
} else {
177+
setVariablesToGetUpdated((prev) =>
178+
prev.filter((name) => name !== variableData.name),
179+
);
174180
}
175181
}
176182
} catch (e) {

frontend/src/container/NewWidget/LeftContainer/index.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,16 @@ function LeftContainer({
7272
globalSelectedInterval,
7373
graphType: getGraphType(selectedGraph || selectedWidget.panelTypes),
7474
query: stagedQuery,
75+
fillGaps: selectedWidget.fillSpans || false,
7576
}));
7677
}
7778
// eslint-disable-next-line react-hooks/exhaustive-deps
78-
}, [stagedQuery, selectedTime, globalSelectedInterval]);
79+
}, [
80+
stagedQuery,
81+
selectedTime,
82+
selectedWidget.fillSpans,
83+
globalSelectedInterval,
84+
]);
7985

8086
const queryResponse = useGetQueryRange(
8187
requestData,

frontend/src/container/NewWidget/utils.ts

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -189,50 +189,6 @@ export const panelTypeDataSourceFormValuesMap: Record<
189189
},
190190
},
191191
},
192-
[PANEL_TYPES.HISTOGRAM]: {
193-
[DataSource.LOGS]: {
194-
builder: {
195-
queryData: [
196-
'filters',
197-
'aggregateOperator',
198-
'aggregateAttribute',
199-
'groupBy',
200-
'limit',
201-
'having',
202-
'orderBy',
203-
'functions',
204-
],
205-
},
206-
},
207-
[DataSource.METRICS]: {
208-
builder: {
209-
queryData: [
210-
'filters',
211-
'aggregateOperator',
212-
'aggregateAttribute',
213-
'groupBy',
214-
'limit',
215-
'having',
216-
'orderBy',
217-
'functions',
218-
'spaceAggregation',
219-
],
220-
},
221-
},
222-
[DataSource.TRACES]: {
223-
builder: {
224-
queryData: [
225-
'filters',
226-
'aggregateOperator',
227-
'aggregateAttribute',
228-
'groupBy',
229-
'limit',
230-
'having',
231-
'orderBy',
232-
],
233-
},
234-
},
235-
},
236192
[PANEL_TYPES.TABLE]: {
237193
[DataSource.LOGS]: {
238194
builder: {

frontend/src/container/TraceDetail/TraceDetails.styles.scss

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
.span-details-sider {
2+
padding-top: 16px;
3+
4+
::-webkit-scrollbar {
5+
width: 0.2em;
6+
}
7+
8+
::-webkit-scrollbar-track {
9+
box-shadow: inset 0 0 6px rgba(18, 18, 18, 0.3);
10+
}
11+
212
&.dark {
313
.ant-layout-sider-trigger {
4-
background-color: black !important;
14+
background-color: #0b0c0e !important;
515
}
616
}
717

frontend/src/container/TraceDetail/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,13 +246,14 @@ function TraceDetail({ response }: TraceDetailProps): JSX.Element {
246246

247247
<Sider
248248
className={cx('span-details-sider', isDarkMode ? 'dark' : 'light')}
249-
style={{ background: isDarkMode ? '#000' : '#fff' }}
249+
style={{ background: isDarkMode ? '#0b0c0e' : '#fff' }}
250250
theme={isDarkMode ? 'dark' : 'light'}
251251
collapsible
252252
collapsed={collapsed}
253253
reverseArrow
254254
width={300}
255255
collapsedWidth={40}
256+
defaultCollapsed
256257
onCollapse={(value): void => setCollapsed(value)}
257258
>
258259
{!collapsed && (

frontend/src/container/TracesExplorer/TracesView/configs.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { ColumnsType } from 'antd/es/table';
33
import ROUTES from 'constants/routes';
44
import { getMs } from 'container/Trace/Filters/Panel/PanelBody/Duration/util';
55
import { DEFAULT_PER_PAGE_OPTIONS } from 'hooks/queryPagination';
6-
import { generatePath } from 'react-router-dom';
6+
import { generatePath, Link } from 'react-router-dom';
77
import { ListItem } from 'types/api/widgets/getQuery';
88

99
export const PER_PAGE_OPTIONS: number[] = [10, ...DEFAULT_PER_PAGE_OPTIONS];
@@ -38,14 +38,14 @@ export const columns: ColumnsType<ListItem['data']> = [
3838
dataIndex: 'traceID',
3939
key: 'traceID',
4040
render: (traceID: string): JSX.Element => (
41-
<Typography.Link
42-
href={generatePath(ROUTES.TRACE_DETAIL, {
41+
<Link
42+
to={generatePath(ROUTES.TRACE_DETAIL, {
4343
id: traceID,
4444
})}
4545
data-testid="trace-id"
4646
>
4747
{traceID}
48-
</Typography.Link>
48+
</Link>
4949
),
5050
},
5151
];

frontend/src/container/TracesTableComponent/TracesTableComponent.styles.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
height: 100%;
66

77
.resize-table {
8-
height: calc(100% - 40px);
8+
height: calc(100% - 70px);
99
overflow: scroll;
1010
overflow-x: hidden;
1111

0 commit comments

Comments
 (0)