Compare commits

...

3 Commits

Author SHA1 Message Date
Ishan Uniyal
eb6d19bedd feat: updated null checks 2026-02-10 16:50:05 +05:30
Ishan Uniyal
a1f82c35b9 feat: moved logic to util 2026-02-10 16:43:25 +05:30
Ishan Uniyal
27079d536d feat: add to alert bug 2026-02-09 10:35:55 +05:30
4 changed files with 45 additions and 2 deletions

View File

@@ -18,6 +18,7 @@ function ExplorerOptionWrapper({
splitedQueries,
signalSource,
handleChangeSelectedView,
logsAlertQuery,
}: ExplorerOptionsWrapperProps): JSX.Element {
const [isExplorerOptionHidden, setIsExplorerOptionHidden] = useState(false);
@@ -40,6 +41,7 @@ function ExplorerOptionWrapper({
isOneChartPerQuery={isOneChartPerQuery}
splitedQueries={splitedQueries}
handleChangeSelectedView={handleChangeSelectedView}
logsAlertQuery={logsAlertQuery}
/>
);
}

View File

@@ -100,7 +100,9 @@ function ExplorerOptions({
isOneChartPerQuery = false,
splitedQueries = [],
handleChangeSelectedView,
logsAlertQuery,
}: ExplorerOptionsProps): JSX.Element {
const alertQuery = logsAlertQuery || query;
const [isExport, setIsExport] = useState<boolean>(false);
const [isSaveModalOpen, setIsSaveModalOpen] = useState(false);
const [newViewName, setNewViewName] = useState<string>('');
@@ -749,7 +751,7 @@ function ExplorerOptions({
<Button
disabled={disabled}
shape="round"
onClick={(): void => onCreateAlertsHandler(query)}
onClick={(): void => onCreateAlertsHandler(alertQuery)}
icon={<ConciergeBell size={16} />}
>
Create an Alert
@@ -757,9 +759,9 @@ function ExplorerOptions({
);
}, [
disabled,
alertQuery,
isOneChartPerQuery,
onCreateAlertsHandler,
query,
splitedQueries,
]);
@@ -1044,6 +1046,7 @@ export interface ExplorerOptionsProps {
isOneChartPerQuery?: boolean;
splitedQueries?: Query[];
handleChangeSelectedView?: ChangeViewFunctionType;
logsAlertQuery?: Query | null;
}
ExplorerOptions.defaultProps = {

View File

@@ -216,3 +216,34 @@ export const getExportQueryData = (
}
return query;
};
export const getExportLogQuery = (
query: Query | null,
panelType: PANEL_TYPES,
): Query | null => {
if (!query) {
return null;
}
if (panelType === PANEL_TYPES.LIST) {
const listQuery = getListQuery(query);
if (!listQuery) {
return null;
}
return {
...query,
builder: {
...query.builder,
queryData: [
{
...listQuery,
orderBy: [],
limit: null,
},
],
},
};
}
return query;
};

View File

@@ -27,6 +27,7 @@ import LogsExplorerChart from 'container/LogsExplorerChart';
import LogsExplorerList from 'container/LogsExplorerList';
import LogsExplorerTable from 'container/LogsExplorerTable';
import {
getExportLogQuery,
getExportQueryData,
getFrequencyChartData,
getListQuery,
@@ -138,6 +139,11 @@ function LogsExplorerViewsContainer({
[selectedPanelType, requestData],
);
const logsAlertQuery = useMemo(
() => getExportLogQuery(requestData, selectedPanelType),
[selectedPanelType, requestData],
);
const {
data: listChartData,
isFetching: isFetchingListChartData,
@@ -527,6 +533,7 @@ function LogsExplorerViewsContainer({
onExport={handleExport}
sourcepage={DataSource.LOGS}
handleChangeSelectedView={handleChangeSelectedView}
logsAlertQuery={logsAlertQuery}
/>
</div>
);