-
Notifications
You must be signed in to change notification settings - Fork 187
Misc fixes. #2310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Misc fixes. #2310
Changes from all commits
134a773
c7a77fe
c6cf2a8
22b3dee
0223478
f411af7
1f68983
8809d3a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ | |
"@appwrite.io/pink-icons": "0.25.0", | ||
"@appwrite.io/pink-icons-svelte": "https://pkg.vc/-/@appwrite/@appwrite.io/pink-icons-svelte@2cf27e0", | ||
"@appwrite.io/pink-legacy": "^1.0.3", | ||
"@appwrite.io/pink-svelte": "https://pkg.vc/-/@appwrite/@appwrite.io/pink-svelte@2cf27e0", | ||
"@appwrite.io/pink-svelte": "https://pkg.vc/-/@appwrite/@appwrite.io/pink-svelte@40fb564", | ||
"@faker-js/faker": "^9.9.0", | ||
"@popperjs/core": "^2.11.8", | ||
"@sentry/sveltekit": "^8.38.0", | ||
|
@@ -95,5 +95,5 @@ | |
"svelte-preprocess" | ||
] | ||
}, | ||
"packageManager": "[email protected].0" | ||
"packageManager": "[email protected].1" | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,7 +1,6 @@ | ||||||||||||||||||||||||||||||||||||||||||||
<script lang="ts"> | ||||||||||||||||||||||||||||||||||||||||||||
import { invalidate } from '$app/navigation'; | ||||||||||||||||||||||||||||||||||||||||||||
import { page } from '$app/state'; | ||||||||||||||||||||||||||||||||||||||||||||
import { InputChoice } from '$lib/elements/forms'; | ||||||||||||||||||||||||||||||||||||||||||||
import { addNotification } from '$lib/stores/notifications'; | ||||||||||||||||||||||||||||||||||||||||||||
import { table } from '../store'; | ||||||||||||||||||||||||||||||||||||||||||||
import type { Columns } from '../store'; | ||||||||||||||||||||||||||||||||||||||||||||
|
@@ -21,7 +20,6 @@ | |||||||||||||||||||||||||||||||||||||||||||
selectedColumn: Columns | string[]; | ||||||||||||||||||||||||||||||||||||||||||||
} = $props(); | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
let checked = $state(false); | ||||||||||||||||||||||||||||||||||||||||||||
let error = $state<string | null>(null); | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
const selectedColumns = $derived( | ||||||||||||||||||||||||||||||||||||||||||||
|
@@ -38,8 +36,6 @@ | |||||||||||||||||||||||||||||||||||||||||||
.some((col) => isRelationship(col) && col.twoWay) | ||||||||||||||||||||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
const isDeleteBtnDisabled = $derived(requiresTwoWayConfirm && !checked); | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
async function handleDelete() { | ||||||||||||||||||||||||||||||||||||||||||||
try { | ||||||||||||||||||||||||||||||||||||||||||||
const client = sdk.forProject(page.params.region, page.params.project); | ||||||||||||||||||||||||||||||||||||||||||||
|
@@ -75,6 +71,16 @@ | |||||||||||||||||||||||||||||||||||||||||||
function getAsRelationship(column: string | Columns): Models.ColumnRelationship { | ||||||||||||||||||||||||||||||||||||||||||||
return column as Models.ColumnRelationship; | ||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
const relatedColumn = $derived( | ||||||||||||||||||||||||||||||||||||||||||||
requiresTwoWayConfirm ? getAsRelationship(selectedColumns[0]) : undefined | ||||||||||||||||||||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
const confirmDeletionLabel = $derived( | ||||||||||||||||||||||||||||||||||||||||||||
!requiresTwoWayConfirm | ||||||||||||||||||||||||||||||||||||||||||||
? 'I understand and confirm' | ||||||||||||||||||||||||||||||||||||||||||||
: `Delete relationship between ${relatedColumn.key} to ${relatedColumn.twoWayKey}` | ||||||||||||||||||||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+75
to
+83
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix two‑way label selection to avoid wrong column and runtime crash
Apply this diff: - const relatedColumn = $derived(
- requiresTwoWayConfirm ? getAsRelationship(selectedColumns[0]) : undefined
- );
-
- const confirmDeletionLabel = $derived(
- !requiresTwoWayConfirm
- ? 'I understand and confirm'
- : `Delete relationship between ${relatedColumn.key} to ${relatedColumn.twoWayKey}`
- );
+ const twoWayColumn = $derived(
+ selectedColumns.find(
+ (c): c is Models.ColumnRelationship =>
+ typeof c !== 'string' && isRelationship(c) && c.twoWay
+ )
+ );
+
+ const confirmDeletionLabel = $derived(
+ twoWayColumn
+ ? `Delete relationship between ${twoWayColumn.key} and ${twoWayColumn.twoWayKey}`
+ : 'I understand and confirm'
+ ); Note: If you adopt this, 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||
</script> | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
<Confirm | ||||||||||||||||||||||||||||||||||||||||||||
|
@@ -83,7 +89,7 @@ | |||||||||||||||||||||||||||||||||||||||||||
title="Delete column" | ||||||||||||||||||||||||||||||||||||||||||||
bind:error | ||||||||||||||||||||||||||||||||||||||||||||
confirmDeletion | ||||||||||||||||||||||||||||||||||||||||||||
disabled={isDeleteBtnDisabled}> | ||||||||||||||||||||||||||||||||||||||||||||
{confirmDeletionLabel}> | ||||||||||||||||||||||||||||||||||||||||||||
{#if selectedColumns.length === 1} | ||||||||||||||||||||||||||||||||||||||||||||
<p> | ||||||||||||||||||||||||||||||||||||||||||||
Are you sure you want to delete <b data-private>{selectedKeys[0]}</b> from | ||||||||||||||||||||||||||||||||||||||||||||
|
@@ -98,19 +104,12 @@ | |||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
{#if requiresTwoWayConfirm} | ||||||||||||||||||||||||||||||||||||||||||||
<!-- not allowed on multi selections, safe to assume that this isn't a string! --> | ||||||||||||||||||||||||||||||||||||||||||||
{@const column = getAsRelationship(selectedColumns[0])} | ||||||||||||||||||||||||||||||||||||||||||||
<Layout.Stack direction="column" gap="xl"> | ||||||||||||||||||||||||||||||||||||||||||||
<p> | ||||||||||||||||||||||||||||||||||||||||||||
This is a two way relationship and the corresponding relationship will also be | ||||||||||||||||||||||||||||||||||||||||||||
deleted. | ||||||||||||||||||||||||||||||||||||||||||||
</p> | ||||||||||||||||||||||||||||||||||||||||||||
<p><b>This action is irreversible.</b></p> | ||||||||||||||||||||||||||||||||||||||||||||
<ul> | ||||||||||||||||||||||||||||||||||||||||||||
<InputChoice id="delete" label="Delete" showLabel={false} bind:value={checked}> | ||||||||||||||||||||||||||||||||||||||||||||
Delete relationship between <b data-private>{column.key}</b> to | ||||||||||||||||||||||||||||||||||||||||||||
<b data-private>{column.twoWayKey}</b> | ||||||||||||||||||||||||||||||||||||||||||||
</InputChoice> | ||||||||||||||||||||||||||||||||||||||||||||
</ul> | ||||||||||||||||||||||||||||||||||||||||||||
</Layout.Stack> | ||||||||||||||||||||||||||||||||||||||||||||
{/if} | ||||||||||||||||||||||||||||||||||||||||||||
</Confirm> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Action columns are no longer filtered out (isAction lost in mapping).
createFilterableColumns relies on column.isAction, but createTableColumns doesn’t carry this flag over, so action columns will leak into Filters.
Apply one of the following:
🤖 Prompt for AI Agents