Merge pull request #2875 from appwrite/fix-SER-1123-relationship-text-many-side

fix: tooltips and Correct relationship text on many side
This commit is contained in:
Harsh Mahajan
2026-02-23 17:00:59 +05:30
committed by GitHub
6 changed files with 46 additions and 24 deletions
@@ -72,7 +72,9 @@
</Button>
</div>
<svelte:fragment slot="tooltip">
You have reached the maximum number of databases for your plan.
<div style="white-space: pre-line;">
You have reached the maximum number of databases for your plan.
</div>
</svelte:fragment>
</Tooltip>
{/if}
@@ -229,23 +229,35 @@
</div>
</Box>
{#if data.relationType}
{@const isManySide = data.side === 'child' && data.relationType === 'oneToMany'}
<div>
<p class="u-text-center">
<b data-private>{camelize(currentTable.name)}</b> can contain {[
'oneToOne',
'manyToOne'
].includes(data.relationType)
? 'one'
: 'many'}
<b data-private>{camelize(data.key)}</b>
</p>
<p class="u-text-center">
<b data-private>{camelize(data.key)}</b>
can belong to {['oneToOne', 'oneToMany'].includes(data.relationType)
? 'one'
: 'many'}
<b data-private>{camelize(currentTable.name)}</b>
</p>
{#if isManySide}
<p class="u-text-center">
<b data-private>{camelize(currentTable.name)}</b> can belong to one
<b data-private>{camelize(data.key)}</b>
</p>
<p class="u-text-center">
<b data-private>{camelize(data.key)}</b> can have many
<b data-private>{camelize(currentTable.name)}</b>
</p>
{:else}
<p class="u-text-center">
<b data-private>{camelize(currentTable.name)}</b> can contain {[
'oneToOne',
'manyToOne'
].includes(data.relationType)
? 'one'
: 'many'}
<b data-private>{camelize(data.key)}</b>
</p>
<p class="u-text-center">
<b data-private>{camelize(data.key)}</b>
can belong to {['oneToOne', 'oneToMany'].includes(data.relationType)
? 'one'
: 'many'}
<b data-private>{camelize(currentTable.name)}</b>
</p>
{/if}
</div>
{/if}
</div>
@@ -109,7 +109,9 @@
</Button>
</div>
<svelte:fragment slot="tooltip">
You have reached the maximum number of functions for your plan.
<div style="white-space: pre-line;">
You have reached the maximum number of functions for your plan.
</div>
</svelte:fragment>
</Tooltip>
</Layout.Stack>
@@ -20,7 +20,7 @@
{#if $canWritePlatforms}
{#if isLimited}
<Tooltip maxWidth="200px">
<Tooltip>
<div>
<Button disabled>
<Icon icon={IconPlus} slot="start" />
@@ -29,7 +29,9 @@
</div>
<svelte:fragment slot="tooltip">
You have reached the maximum number of platforms for your plan in a project.
<div style="white-space: pre-line;">
You have reached the maximum number of platforms for your plan in a project.
</div>
</svelte:fragment>
</Tooltip>
{:else}
@@ -39,7 +39,7 @@
<Layout.Stack direction="row" alignItems="center" justifyContent="flex-end">
<ViewSelector ui="new" {columns} view={View.Table} hideView />
{#if $canWriteWebhooks}
<Tooltip disabled={!isLimited} maxWidth="200px">
<Tooltip disabled={!isLimited}>
<div>
<Button disabled={isLimited} event="create_webhook" href={webhooksCreateUrl}>
<Icon icon={IconPlus} slot="start" size="s" />
@@ -47,7 +47,9 @@
</Button>
</div>
<svelte:fragment slot="tooltip">
You have reached the maximum number of webhooks for your plan.
<div style="white-space: pre-line;">
You have reached the maximum number of webhooks for your plan.
</div>
</svelte:fragment>
</Tooltip>
{/if}
@@ -44,7 +44,7 @@
view={data.view}
searchPlaceholder="Search by name or ID">
{#if $canWriteBuckets}
<Tooltip disabled={!isLimited} maxWidth="200px">
<Tooltip disabled={!isLimited}>
<div>
<Button
size="s"
@@ -56,7 +56,9 @@
</Button>
</div>
<svelte:fragment slot="tooltip">
You have reached the maximum number of buckets for your plan.
<div style="white-space: pre-line;">
You have reached the maximum number of buckets for your plan.
</div>
</svelte:fragment>
</Tooltip>
{/if}