Skip to content

Commit dde7de7

Browse files
Hide Discord and support links in embedded contexts (#9135)
- CTANeedHelp: check EmbedStore.isEmbedded() and hide Discord link - PivotEmpty: wrap Discord help link in isFetching state with isEmbedded guard - TimeDimensionDisplay: hide Discord contact link in error state when embedded - DashboardErrored: hide Discord help link when embedded Resolves APP-824 Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: ericokuma <ericokuma@users.noreply.github.com>
1 parent d9ddc08 commit dde7de7

4 files changed

Lines changed: 45 additions & 25 deletions

File tree

web-admin/src/features/dashboards/DashboardErrored.svelte

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
<script lang="ts">
22
import CtaButton from "@rilldata/web-common/components/calls-to-action/CTAButton.svelte";
33
import CancelCircleInverse from "@rilldata/web-common/components/icons/CancelCircleInverse.svelte";
4+
import { EmbedStore } from "@rilldata/web-common/features/embeds/embed-store";
45
import ProjectAccessControls from "../projects/ProjectAccessControls.svelte";
56
67
export let organization: string;
78
export let project: string;
9+
10+
$: isEmbedded = EmbedStore.isEmbedded();
811
</script>
912

1013
<div class="flex flex-col justify-center items-center h-3/5 space-y-6 m-auto">
@@ -38,9 +41,11 @@
3841
</CtaButton>
3942
</svelte:fragment>
4043
</ProjectAccessControls>
41-
<p class="text-fg-secondary">
42-
Need help? Reach out to us on <a href="https://discord.gg/2ubRfjC7Rh"
43-
>Discord</a
44-
>
45-
</p>
44+
{#if !isEmbedded}
45+
<p class="text-fg-secondary">
46+
Need help? Reach out to us on <a href="https://discord.gg/2ubRfjC7Rh"
47+
>Discord</a
48+
>
49+
</p>
50+
{/if}
4651
</div>
Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1-
<p class="text-sm text-fg-secondary text-center">
2-
Need help? Reach out to us on <a
3-
href="https://discord.gg/2ubRfjC7Rh"
4-
target="_blank">Discord</a
5-
>
6-
</p>
1+
<script lang="ts">
2+
import { EmbedStore } from "@rilldata/web-common/features/embeds/embed-store";
3+
4+
$: isEmbedded = EmbedStore.isEmbedded();
5+
</script>
6+
7+
{#if !isEmbedded}
8+
<p class="text-sm text-fg-secondary text-center">
9+
Need help? Reach out to us on <a
10+
href="https://discord.gg/2ubRfjC7Rh"
11+
target="_blank">Discord</a
12+
>
13+
</p>
14+
{/if}

web-common/src/features/dashboards/pivot/PivotEmpty.svelte

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@
1616
<div class="font-semibold text-fg-primary mt-1 text-lg">
1717
Hang tight! We're building your table...
1818
</div>
19-
<div class="text-fg-secondary">
20-
Need help? Reach out to us on <a
21-
target="_blank"
22-
rel="noopener"
23-
href="https://discord.gg/2ubRfjC7Rh">Discord</a
24-
>
25-
</div>
19+
{#if !isEmbedded}
20+
<div class="text-fg-secondary">
21+
Need help? Reach out to us on <a
22+
target="_blank"
23+
rel="noopener"
24+
href="https://discord.gg/2ubRfjC7Rh">Discord</a
25+
>
26+
</div>
27+
{/if}
2628
{:else if hasColumnAndNoMeasure}
2729
<EmptyMeasureIcon />
2830
<div class="flex flex-col items-center gap-y-2">

web-common/src/features/dashboards/time-dimension-details/TimeDimensionDisplay.svelte

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
SortDirection,
55
SortType,
66
} from "@rilldata/web-common/features/dashboards/proto-state/derived-types";
7+
import { EmbedStore } from "@rilldata/web-common/features/embeds/embed-store";
78
import { getStateManagers } from "@rilldata/web-common/features/dashboards/state-managers/state-managers";
89
import { metricsExplorerStore } from "@rilldata/web-common/features/dashboards/stores/dashboard-stores";
910
import { useTimeControlStore } from "@rilldata/web-common/features/dashboards/time-controls/time-control-store";
@@ -25,6 +26,8 @@
2526
export let expandedMeasureName: string;
2627
export let hideStartPivotButton = false;
2728
29+
$: isEmbedded = EmbedStore.isEmbedded();
30+
2831
const stateManagers = getStateManagers();
2932
const {
3033
dashboardStore,
@@ -218,13 +221,15 @@
218221
We encountered an error while loading the data. Please try refreshing
219222
the page.
220223
</div>
221-
<div class="text-fg-secondary">
222-
If the issue persists, please contact us on <a
223-
target="_blank"
224-
rel="noopener noreferrer"
225-
href="https://discord.gg/2ubRfjC7Rh">Discord</a
226-
>.
227-
</div>
224+
{#if !isEmbedded}
225+
<div class="text-fg-secondary">
226+
If the issue persists, please contact us on <a
227+
target="_blank"
228+
rel="noopener noreferrer"
229+
href="https://discord.gg/2ubRfjC7Rh">Discord</a
230+
>.
231+
</div>
232+
{/if}
228233
</div>
229234
</div>
230235
{:else if formattedData && comparisonCopy && measure}

0 commit comments

Comments
 (0)