Skip to content

Commit 35c23ea

Browse files
authored
Merge pull request #2875 from appwrite/fix-SER-1123-relationship-text-many-side
fix: tooltips and Correct relationship text on many side
2 parents 078e57f + 15da4e7 commit 35c23ea

File tree

6 files changed

+46
-24
lines changed

6 files changed

+46
-24
lines changed

src/routes/(console)/project-[region]-[project]/databases/+page.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@
7272
</Button>
7373
</div>
7474
<svelte:fragment slot="tooltip">
75-
You have reached the maximum number of databases for your plan.
75+
<div style="white-space: pre-line;">
76+
You have reached the maximum number of databases for your plan.
77+
</div>
7678
</svelte:fragment>
7779
</Tooltip>
7880
{/if}

src/routes/(console)/project-[region]-[project]/databases/database-[database]/table-[table]/columns/relationship.svelte

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -229,23 +229,35 @@
229229
</div>
230230
</Box>
231231
{#if data.relationType}
232+
{@const isManySide = data.side === 'child' && data.relationType === 'oneToMany'}
232233
<div>
233-
<p class="u-text-center">
234-
<b data-private>{camelize(currentTable.name)}</b> can contain {[
235-
'oneToOne',
236-
'manyToOne'
237-
].includes(data.relationType)
238-
? 'one'
239-
: 'many'}
240-
<b data-private>{camelize(data.key)}</b>
241-
</p>
242-
<p class="u-text-center">
243-
<b data-private>{camelize(data.key)}</b>
244-
can belong to {['oneToOne', 'oneToMany'].includes(data.relationType)
245-
? 'one'
246-
: 'many'}
247-
<b data-private>{camelize(currentTable.name)}</b>
248-
</p>
234+
{#if isManySide}
235+
<p class="u-text-center">
236+
<b data-private>{camelize(currentTable.name)}</b> can belong to one
237+
<b data-private>{camelize(data.key)}</b>
238+
</p>
239+
<p class="u-text-center">
240+
<b data-private>{camelize(data.key)}</b> can have many
241+
<b data-private>{camelize(currentTable.name)}</b>
242+
</p>
243+
{:else}
244+
<p class="u-text-center">
245+
<b data-private>{camelize(currentTable.name)}</b> can contain {[
246+
'oneToOne',
247+
'manyToOne'
248+
].includes(data.relationType)
249+
? 'one'
250+
: 'many'}
251+
<b data-private>{camelize(data.key)}</b>
252+
</p>
253+
<p class="u-text-center">
254+
<b data-private>{camelize(data.key)}</b>
255+
can belong to {['oneToOne', 'oneToMany'].includes(data.relationType)
256+
? 'one'
257+
: 'many'}
258+
<b data-private>{camelize(currentTable.name)}</b>
259+
</p>
260+
{/if}
249261
</div>
250262
{/if}
251263
</div>

src/routes/(console)/project-[region]-[project]/functions/+page.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@
109109
</Button>
110110
</div>
111111
<svelte:fragment slot="tooltip">
112-
You have reached the maximum number of functions for your plan.
112+
<div style="white-space: pre-line;">
113+
You have reached the maximum number of functions for your plan.
114+
</div>
113115
</svelte:fragment>
114116
</Tooltip>
115117
</Layout.Stack>

src/routes/(console)/project-[region]-[project]/overview/platforms/action.svelte

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
{#if $canWritePlatforms}
2222
{#if isLimited}
23-
<Tooltip maxWidth="200px">
23+
<Tooltip>
2424
<div>
2525
<Button disabled>
2626
<Icon icon={IconPlus} slot="start" />
@@ -29,7 +29,9 @@
2929
</div>
3030

3131
<svelte:fragment slot="tooltip">
32-
You have reached the maximum number of platforms for your plan in a project.
32+
<div style="white-space: pre-line;">
33+
You have reached the maximum number of platforms for your plan in a project.
34+
</div>
3335
</svelte:fragment>
3436
</Tooltip>
3537
{:else}

src/routes/(console)/project-[region]-[project]/settings/webhooks/+page.svelte

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,17 @@
3939
<Layout.Stack direction="row" alignItems="center" justifyContent="flex-end">
4040
<ViewSelector ui="new" {columns} view={View.Table} hideView />
4141
{#if $canWriteWebhooks}
42-
<Tooltip disabled={!isLimited} maxWidth="200px">
42+
<Tooltip disabled={!isLimited}>
4343
<div>
4444
<Button disabled={isLimited} event="create_webhook" href={webhooksCreateUrl}>
4545
<Icon icon={IconPlus} slot="start" size="s" />
4646
Create webhook
4747
</Button>
4848
</div>
4949
<svelte:fragment slot="tooltip">
50-
You have reached the maximum number of webhooks for your plan.
50+
<div style="white-space: pre-line;">
51+
You have reached the maximum number of webhooks for your plan.
52+
</div>
5153
</svelte:fragment>
5254
</Tooltip>
5355
{/if}

src/routes/(console)/project-[region]-[project]/storage/+page.svelte

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
view={data.view}
4545
searchPlaceholder="Search by name or ID">
4646
{#if $canWriteBuckets}
47-
<Tooltip disabled={!isLimited} maxWidth="200px">
47+
<Tooltip disabled={!isLimited}>
4848
<div>
4949
<Button
5050
size="s"
@@ -56,7 +56,9 @@
5656
</Button>
5757
</div>
5858
<svelte:fragment slot="tooltip">
59-
You have reached the maximum number of buckets for your plan.
59+
<div style="white-space: pre-line;">
60+
You have reached the maximum number of buckets for your plan.
61+
</div>
6062
</svelte:fragment>
6163
</Tooltip>
6264
{/if}

0 commit comments

Comments
 (0)