Unverified Commit 7f800c94 authored by pal-sig's avatar pal-sig Committed by GitHub
Browse files

fix(UI): latest timestamp bug is resolved (#494)

fix(UI): latest timestamp bug is resolved (#494)
parent 0f39643a
develop 1244-edit-alert 1725-expection 24-may-2022-testing 414-uri ankit01-oss-patch-1 bump-json-iterator bump-prometheus chore/analytics chore/change-validation-message chore/improve-metrics-perf chore/improve-perf-remote-read chore/install-script-update chore/migration-0.8.0 chore/migration-file-path chore/moving-to-clickhouse-v2 chore/remove-query-service-codeowners chore/update-otelcollector-0.43.0 dashboarad-vars dashboard-bug-fix debug-dep debug-dep-migrate effgo feat-doc-contribute feat-statsd-receiver feat/addHasErrorColumn feat/amol-ee feat/clickhouse-db-optimizations feat/custom-func-getSubTreeSpans feat/dynamic-tooltip feat/ee feat/exclude-filter-support feat/featureFlagging feat/fields-compression feat/gRPC-code-method feat/getFilteredSpans feat/getSpanFilters feat/gh-bot feat/newTraceFilter feat/searchTraceId feat/support-custom-events feat/support-error-tab-page feat/support-events feat/tagValueSuggestion feat/trace-detail feat/trace-resource-attributes feat/udf-function-getSubTreeSpans feat/usage feat/usage-reporting filter-set fix-double-client fix-husky fix/414-error-trace-filter-APIs fix/aggregate fix/error-exception-page-typo fix/error-exception-sql-issue fix/errorDetailURL fix/exceptionPageOptimization fix/exclude-operation fix/null-values fix/serviceMapDependencies fix/setTTLapis fix/telemetry-bug issue-1228 issue-1252 issue-1293 issue-1294 issue-1442 issue-1485-develop issue-1511 issue-1583 issue-618 issue-pod-687 labels_object main makeavish-patch-1 makeavish-patch-2 metric-suggest-apis-chv2 metrics-builder-all metrics-table new-metrics new-metrics-enums palashgdev-patch-1 palashgdev-patch-2 perf/trace-detail-page playwright pranay01-patch-1 pranshuchittora/feat/dynamic-step-size prashant/add-codeowners prashant/add-deploy-docs prashant/ci-k3s-enchancements prashant/contributing-docs prashant/docker-data-path prashant/e2e-k3s-changes prashant/frontend-docker prashant/hotrod-log-options prashant/hotrod-template prashant/hotrod-yaml prashant/install-script-changes prashant/integrate-behaviorbot prashant/migrate-helm-charts prashant/minor-k3s-changes prashant/nginx-cache-improvement prashant/remove-ports prashant/rename-config prashant/single-hotrod-manifest prashant/two-compose-yaml prashant/version-ping-mini-css-extract-plugin prashant/versioning release/v0.10 release/v0.10.0 release/v0.10.1 release/v0.10.2 release/v0.11 release/v0.11.0 release/v0.11.1 release/v0.11.2 release/v0.11.3 release/v0.6 release/v0.6.0 release/v0.6.1 release/v0.6.2 release/v0.7 release/v0.7.0 release/v0.7.1 release/v0.7.2 release/v0.7.3 release/v0.7.4 release/v0.7.5 release/v0.8 release/v0.8.0 release/v0.8.1 release/v0.8.2 release/v0.9 release/v0.9.0 release/v0.9.1 release/v0.9.2 revert-628-chore/migration-file-path revert-770-trace-styles revert-814-release/v0.7.0 revert-835-pc/feat/shared-styles-for-styled-components snyk-fix-3d7b28e56a36018c4b5cf8438365ff27 snyk-fix-4ef12a6988dec7696867e0b2accb8289 snyk-fix-7ee2560cd9d67a9821899135c05c1175 snyk-fix-8f3a2f55a70c214b57d1a3b3bce7d0cf trace-search troubleshoot ttl-plus uuid-server wip-release-0.11.1 v0.11.3 v0.11.3-rc.1 v0.11.2 v0.11.2-rc.3 v0.11.2-rc.2 v0.11.2-rc.1 v0.11.1 v0.11.1-rc.1 v0.11.0 v0.11.0-rc.1 v0.11 v0.10.2 v0.10.1 v0.10.1-rc.1 v0.10.0 v0.10.0-rc2 v0.10.0-rc1 v0.10 v0.9.2 v0.9.2-rc1 v0.9.1 v0.9.0 v0.9.0-rc2 v0.9.0-rc1 v0.9 v0.8.2 v0.8.1 v0.8.1-rc5 v0.8.1-rc4 v0.8.1-rc3 v0.8.1-rc2 v0.8.1-rc1 v0.8.0 v0.8.0-rc6 v0.8.0-rc5 v0.8.0-rc4 v0.8.0-rc3 v0.8.0-rc2 v0.8.0-rc1 v0.8 v0.7.5 v0.7.5-rc2 v0.7.5-rc1 v0.7.4 v0.7.4-rc2 v0.7.4-rc1 v0.7.3 v0.7.2 v0.7.2-rc1 v0.7.1 v0.7.0 v0.7 v0.6.2 v0.6.1 v0.6.0 v0.6 v0.5.4
No related merge requests found
Showing with 19 additions and 9 deletions
+19 -9
......@@ -21,6 +21,7 @@ import { AppState } from 'store/reducers';
import AppActions from 'types/actions';
import { GlobalTime } from 'types/actions/globalTime';
import DashboardReducer from 'types/reducer/dashboards';
import { GlobalReducer } from 'types/reducer/globalTime';
import LeftContainer from './LeftContainer';
import RightContainer from './RightContainer';
......@@ -42,9 +43,10 @@ const NewWidget = ({
const { dashboards } = useSelector<AppState, DashboardReducer>(
(state) => state.dashboards,
);
const { maxTime, minTime } = useSelector<AppState, GlobalTime>(
(state) => state.globalTime,
);
const { maxTime, minTime, selectedTime: globalSelectedInterval } = useSelector<
AppState,
GlobalReducer
>((state) => state.globalTime);
const [selectedDashboard] = dashboards;
......@@ -146,12 +148,11 @@ const NewWidget = ({
const getQueryResult = useCallback(() => {
if (selectedWidget?.id.length !== 0) {
getQueryResults({
maxTime,
minTime,
query: selectedWidget?.query || [],
selectedTime: selectedTime.enum,
widgetId: selectedWidget?.id || '',
graphType: selectedGraph,
globalSelectedInterval,
});
}
}, [
......
......@@ -3,10 +3,13 @@ import { AxiosError } from 'axios';
import { ITEMS } from 'container/NewDashboard/ComponentsSlider/menuItems';
import { timePreferenceType } from 'container/NewWidget/RightContainer/timeItems';
import GetMaxMinTime from 'lib/getMaxMinTime';
import GetMinMax from 'lib/getMinMax';
import GetStartAndEndTime from 'lib/getStartAndEndTime';
import { Dispatch } from 'redux';
import AppActions from 'types/actions';
import { Query } from 'types/api/dashboard/getAll';
import { GlobalReducer } from 'types/reducer/globalTime';
import store from 'store';
export const GetQueryResults = (
props: GetQueryResultsProps,
......@@ -15,10 +18,17 @@ export const GetQueryResults = (
try {
const queryData = props.query;
const { globalTime } = store.getState();
const minMax = GetMinMax(props.globalSelectedInterval, [
globalTime.minTime / 1000000,
globalTime.maxTime / 1000000,
]);
const getMaxMinTime = GetMaxMinTime({
graphType: props.graphType,
maxTime: props.maxTime,
minTime: props.minTime,
maxTime: minMax.maxTime,
minTime: minMax.minTime,
});
const { end, start } = GetStartAndEndTime({
......@@ -92,8 +102,7 @@ export const GetQueryResults = (
export interface GetQueryResultsProps {
widgetId: string;
selectedTime: timePreferenceType;
maxTime: number;
minTime: number;
query: Query[];
graphType: ITEMS;
globalSelectedInterval: GlobalReducer['selectedTime'];
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment