From bf948d54c2b6afbd8e7a9a10a2e5e9f75271fa1b Mon Sep 17 00:00:00 2001 From: Dhiraj Barnwal Date: Wed, 11 Dec 2024 14:16:06 +0530 Subject: [PATCH] Fix: Use logical or for labels (#6249) * Fix: Use logical or for labels * Lint fix --- .../features/alerts/metadata/AlertFilters.svelte | 4 ++-- .../billing/plans/CancelledTeamPlan.svelte | 2 +- .../src/features/billing/plans/TrialPlan.svelte | 2 +- .../src/features/bookmarks/BookmarkDialog.svelte | 2 +- .../features/navigation/TopNavigationBar.svelte | 2 +- .../[project]/-/settings/public-urls/+page.svelte | 2 +- .../src/features/alerts/alert-preview-data.ts | 4 ++-- web-common/src/features/alerts/utils.ts | 2 +- .../dashboards/filters/FilterChipsReadOnly.svelte | 4 ++-- .../leaderboard/LeaderboardControls.svelte | 14 +++++++------- .../state-managers/selectors/measures.ts | 2 +- .../time-dimension-details/TDDHeader.svelte | 6 +++--- .../metrics-views/GoToDashboardButton.svelte | 6 +++--- .../visual-editing/MeasureDimensionSelector.svelte | 2 +- 14 files changed, 27 insertions(+), 27 deletions(-) diff --git a/web-admin/src/features/alerts/metadata/AlertFilters.svelte b/web-admin/src/features/alerts/metadata/AlertFilters.svelte index 201819164cc..864a15e8ff7 100644 --- a/web-admin/src/features/alerts/metadata/AlertFilters.svelte +++ b/web-admin/src/features/alerts/metadata/AlertFilters.svelte @@ -62,7 +62,7 @@
{#if dimension?.column} @@ -73,7 +73,7 @@ {#each currentMeasureFilters as { name, label, dimensionName, filter } (name)}
diff --git a/web-admin/src/features/billing/plans/CancelledTeamPlan.svelte b/web-admin/src/features/billing/plans/CancelledTeamPlan.svelte index b9c99bd4afe..696edab8391 100644 --- a/web-admin/src/features/billing/plans/CancelledTeamPlan.svelte +++ b/web-admin/src/features/billing/plans/CancelledTeamPlan.svelte @@ -28,7 +28,7 @@ let open = showUpgradeDialog; - +
diff --git a/web-admin/src/features/billing/plans/TrialPlan.svelte b/web-admin/src/features/billing/plans/TrialPlan.svelte index 914f2542f6e..aeb365d54e5 100644 --- a/web-admin/src/features/billing/plans/TrialPlan.svelte +++ b/web-admin/src/features/billing/plans/TrialPlan.svelte @@ -43,7 +43,7 @@ } $: title = - (plan?.displayName ?? "Trial plan") + (trialEnded ? " expired" : ""); + (plan?.displayName || "Trial plan") + (trialEnded ? " expired" : ""); let open = showUpgradeDialog; $: type = (trialEnded ? "trial-expired" : "base") as TeamPlanDialogTypes; diff --git a/web-admin/src/features/bookmarks/BookmarkDialog.svelte b/web-admin/src/features/bookmarks/BookmarkDialog.svelte index f87659b51fa..a72b912592e 100644 --- a/web-admin/src/features/bookmarks/BookmarkDialog.svelte +++ b/web-admin/src/features/bookmarks/BookmarkDialog.svelte @@ -34,7 +34,7 @@ const formState = createForm({ initialValues: { - displayName: bookmark?.resource.displayName ?? "Default Label", + displayName: bookmark?.resource.displayName || "Default Label", description: bookmark?.resource.description ?? "", shared: bookmark?.resource.shared ? "true" : "false", filtersOnly: bookmark?.filtersOnly ?? false, diff --git a/web-admin/src/features/navigation/TopNavigationBar.svelte b/web-admin/src/features/navigation/TopNavigationBar.svelte index bf5e80029be..e6f4813aa25 100644 --- a/web-admin/src/features/navigation/TopNavigationBar.svelte +++ b/web-admin/src/features/navigation/TopNavigationBar.svelte @@ -168,7 +168,7 @@ onPublicURLPage, ); $: publicURLDashboardTitle = - $exploreQuery.data?.explore?.spec?.displayName ?? dashboard ?? ""; + $exploreQuery.data?.explore?.spec?.displayName || dashboard || ""; $: currentPath = [organization, project, dashboard, report || alert]; diff --git a/web-admin/src/routes/[organization]/[project]/-/settings/public-urls/+page.svelte b/web-admin/src/routes/[organization]/[project]/-/settings/public-urls/+page.svelte index ea42edfb341..66d762f311c 100644 --- a/web-admin/src/routes/[organization]/[project]/-/settings/public-urls/+page.svelte +++ b/web-admin/src/routes/[organization]/[project]/-/settings/public-urls/+page.svelte @@ -26,7 +26,7 @@ function useValidDashboardTitle(dashboard: DashboardResource) { return ( - dashboard?.resource.explore?.spec?.displayName ?? + dashboard?.resource.explore?.spec?.displayName || dashboard?.resource.meta.name.name ); } diff --git a/web-common/src/features/alerts/alert-preview-data.ts b/web-common/src/features/alerts/alert-preview-data.ts index a31fe51089c..ac48541000b 100644 --- a/web-common/src/features/alerts/alert-preview-data.ts +++ b/web-common/src/features/alerts/alert-preview-data.ts @@ -111,7 +111,7 @@ function getSchemaEntryForField( return { name: field.name as string, type: field.type?.code ?? TypeCode.CODE_STRING, - label: dimension.displayName ?? field.name, + label: dimension.displayName || field.name, enableResize: false, enableSorting: false, }; @@ -125,7 +125,7 @@ function getSchemaEntryForField( return undefined; let label: VirtualizedTableColumns["label"] = - measure.displayName ?? field.name; + measure.displayName || field.name; let format = measure.formatPreset; let type: string = field.type?.code ?? TypeCode.CODE_STRING; if ( diff --git a/web-common/src/features/alerts/utils.ts b/web-common/src/features/alerts/utils.ts index db395a62fd4..22db9967c0f 100644 --- a/web-common/src/features/alerts/utils.ts +++ b/web-common/src/features/alerts/utils.ts @@ -44,7 +44,7 @@ export function generateAlertName( if (!measure || !typeEntry) return undefined; const measureLabel = - measure.displayName ?? measure.expression ?? (measure.name as string); + measure.displayName || measure.expression || (measure.name as string); let comparisonTitle = ""; if ( diff --git a/web-common/src/features/dashboards/filters/FilterChipsReadOnly.svelte b/web-common/src/features/dashboards/filters/FilterChipsReadOnly.svelte index 2d65c28f957..3a0ce4f3cdd 100644 --- a/web-common/src/features/dashboards/filters/FilterChipsReadOnly.svelte +++ b/web-common/src/features/dashboards/filters/FilterChipsReadOnly.svelte @@ -63,7 +63,7 @@ The main feature-set component for dashboard filters
{#if dimension?.column || dimension?.expression} @@ -75,7 +75,7 @@ The main feature-set component for dashboard filters {#each measureFilters as { name, label, dimensionName, filter } (name)}
diff --git a/web-common/src/features/dashboards/leaderboard/LeaderboardControls.svelte b/web-common/src/features/dashboards/leaderboard/LeaderboardControls.svelte index 84bda535eeb..a088e289f77 100644 --- a/web-common/src/features/dashboards/leaderboard/LeaderboardControls.svelte +++ b/web-common/src/features/dashboards/leaderboard/LeaderboardControls.svelte @@ -1,10 +1,10 @@