From 5481f0b838835f72fe08d452b8f4e5f0bc1b12e9 Mon Sep 17 00:00:00 2001 From: brendan colloran Date: Thu, 7 Sep 2023 14:35:47 -0700 Subject: [PATCH] cleanups --- .../leaderboard/ContextColumnValue.svelte | 8 ++++---- .../dashboards/leaderboard/Leaderboard.svelte | 17 +++-------------- .../leaderboard/LeaderboardListItem.svelte | 6 +++--- 3 files changed, 10 insertions(+), 21 deletions(-) diff --git a/web-common/src/features/dashboards/leaderboard/ContextColumnValue.svelte b/web-common/src/features/dashboards/leaderboard/ContextColumnValue.svelte index 22a8d6237d7..4bdf598aa24 100644 --- a/web-common/src/features/dashboards/leaderboard/ContextColumnValue.svelte +++ b/web-common/src/features/dashboards/leaderboard/ContextColumnValue.svelte @@ -5,18 +5,18 @@ import { contextColumnWidth } from "./leaderboard-utils"; export let formattedValue: string; - export let showContext: LeaderboardContextColumn; + export let contextColumn: LeaderboardContextColumn; $: neg = formattedValue[0] === "-"; $: noData = formattedValue === "" || !formattedValue; $: customStyle = neg ? "text-red-500" : noData ? "opacity-50 italic" : ""; - $: width = contextColumnWidth(showContext); + $: width = contextColumnWidth(contextColumn); -{#if showContext === LeaderboardContextColumn.DELTA_PERCENT || showContext === LeaderboardContextColumn.PERCENT} +{#if contextColumn === LeaderboardContextColumn.DELTA_PERCENT || contextColumn === LeaderboardContextColumn.PERCENT}
-{:else if showContext === LeaderboardContextColumn.DELTA_ABSOLUTE} +{:else if contextColumn === LeaderboardContextColumn.DELTA_ABSOLUTE}
{#if noData} no data diff --git a/web-common/src/features/dashboards/leaderboard/Leaderboard.svelte b/web-common/src/features/dashboards/leaderboard/Leaderboard.svelte index baf9b6aa953..230fbe18217 100644 --- a/web-common/src/features/dashboards/leaderboard/Leaderboard.svelte +++ b/web-common/src/features/dashboards/leaderboard/Leaderboard.svelte @@ -8,7 +8,7 @@ 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 { LeaderboardContextColumn } from "@rilldata/web-common/features/dashboards/leaderboard-context-column"; + import { getFilterForDimension, useMetaDimension, @@ -108,17 +108,6 @@ $: sortType = $dashboardStore.dashboardSortType; $: contextColumn = $dashboardStore?.leaderboardContextColumn; - // Compose the comparison /toplist query - $: showTimeComparison = - (contextColumn === LeaderboardContextColumn.DELTA_PERCENT || - contextColumn === LeaderboardContextColumn.DELTA_ABSOLUTE) && - $timeControlsStore?.showComparison; - - $: showPercentOfTotal = - $dashboardStore?.leaderboardContextColumn === - LeaderboardContextColumn.PERCENT; - - $: showContext = $dashboardStore?.leaderboardContextColumn; $: querySortType = getQuerySortType(sortType); @@ -219,7 +208,7 @@ {#each aboveTheFold as itemData (itemData.dimensionValue)}