From e1638a88ac3b1591ee4b69822f522ffc51e73c75 Mon Sep 17 00:00:00 2001 From: brendan colloran Date: Tue, 12 Sep 2023 17:04:32 -0700 Subject: [PATCH] cleanups --- .../dashboards/leaderboard/Leaderboard.svelte | 6 ------ .../leaderboard/leaderboard-utils.ts | 19 ++++++++----------- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/web-common/src/features/dashboards/leaderboard/Leaderboard.svelte b/web-common/src/features/dashboards/leaderboard/Leaderboard.svelte index c94d9b107a8..57fede4a2de 100644 --- a/web-common/src/features/dashboards/leaderboard/Leaderboard.svelte +++ b/web-common/src/features/dashboards/leaderboard/Leaderboard.svelte @@ -8,7 +8,6 @@ import Tooltip from "@rilldata/web-common/components/tooltip/Tooltip.svelte"; import TooltipContent from "@rilldata/web-common/components/tooltip/TooltipContent.svelte"; import { cancelDashboardQueries } from "@rilldata/web-common/features/dashboards/dashboard-queries"; - import { getFilterForDimension, useMetaDimension, @@ -148,11 +147,6 @@ sortedQueryOptions ); - $: if (!$sortedQuery.isFetching) { - console.log("sortedQuery RAW DATA --", dimensionName, $sortedQuery?.data); - } - - /** replace data after fetched. */ let aboveTheFold: LeaderboardItemData[] = []; let selectedBelowTheFold: LeaderboardItemData[] = []; let noAvailableValues = true; diff --git a/web-common/src/features/dashboards/leaderboard/leaderboard-utils.ts b/web-common/src/features/dashboards/leaderboard/leaderboard-utils.ts index 1d9afdf3fa3..ee0d093a637 100644 --- a/web-common/src/features/dashboards/leaderboard/leaderboard-utils.ts +++ b/web-common/src/features/dashboards/leaderboard/leaderboard-utils.ts @@ -1,5 +1,5 @@ import { - V1MetricsViewComparisonSortType, + V1MetricsViewComparisonSortType as ApiSortType, type V1MetricsViewComparisonRow, type V1MetricsViewComparisonValue, } from "@rilldata/web-common/runtime-client"; @@ -126,9 +126,7 @@ export function prepareLeaderboardItemData( const aboveTheFold: LeaderboardItemData[] = []; const selectedBelowTheFold: LeaderboardItemData[] = []; let selectedValuesCopy = [...selectedValues]; - // console.log({ values, len: values.length, selectedValues }); values.forEach((v, i) => { - // console.log({ dimval: v.dimensionValue, selectedValues }); const selected = selectedValuesCopy.findIndex((value) => value === v.dimensionValue) >= 0; // drop the value from the selectedValues array so that we'll @@ -219,29 +217,28 @@ export function getQuerySortType(sortType: SortType) { return ( { [SortType.VALUE]: - V1MetricsViewComparisonSortType.METRICS_VIEW_COMPARISON_SORT_TYPE_BASE_VALUE, + ApiSortType.METRICS_VIEW_COMPARISON_SORT_TYPE_BASE_VALUE, [SortType.DELTA_ABSOLUTE]: - V1MetricsViewComparisonSortType.METRICS_VIEW_COMPARISON_SORT_TYPE_ABS_DELTA, + ApiSortType.METRICS_VIEW_COMPARISON_SORT_TYPE_ABS_DELTA, [SortType.DELTA_PERCENT]: - V1MetricsViewComparisonSortType.METRICS_VIEW_COMPARISON_SORT_TYPE_REL_DELTA, + ApiSortType.METRICS_VIEW_COMPARISON_SORT_TYPE_REL_DELTA, // NOTE: sorting by percent-of-total has the same effect // as sorting by base value [SortType.PERCENT]: - V1MetricsViewComparisonSortType.METRICS_VIEW_COMPARISON_SORT_TYPE_BASE_VALUE, + ApiSortType.METRICS_VIEW_COMPARISON_SORT_TYPE_BASE_VALUE, // NOTE: UNSPECIFIED is not actually a valid sort type, // but it is required by protobuf serialization [SortType.UNSPECIFIED]: - V1MetricsViewComparisonSortType.METRICS_VIEW_COMPARISON_SORT_TYPE_BASE_VALUE, + ApiSortType.METRICS_VIEW_COMPARISON_SORT_TYPE_BASE_VALUE, // FIXME: sort by dimension value is not yet implemented, // for now fall back to sorting by base value [SortType.DIMENSION]: - V1MetricsViewComparisonSortType.METRICS_VIEW_COMPARISON_SORT_TYPE_BASE_VALUE, - }[sortType] || - V1MetricsViewComparisonSortType.METRICS_VIEW_COMPARISON_SORT_TYPE_BASE_VALUE + ApiSortType.METRICS_VIEW_COMPARISON_SORT_TYPE_BASE_VALUE, + }[sortType] || ApiSortType.METRICS_VIEW_COMPARISON_SORT_TYPE_BASE_VALUE ); }