Skip to content

Fix/fix relationship set and view #1877

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@appwrite.io/pink-icons": "0.25.0",
"@appwrite.io/pink-icons-svelte": "^2.0.0-RC.1",
"@appwrite.io/pink-legacy": "^1.0.3",
"@appwrite.io/pink-svelte": "https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@12707b9",
"@appwrite.io/pink-svelte": "https://try-module.cloud/module/@appwrite/%40appwrite.io%2Fpink-svelte@510c1a7",
"@popperjs/core": "^2.11.8",
"@sentry/sveltekit": "^8.38.0",
"@stripe/stripe-js": "^3.5.0",
Expand Down Expand Up @@ -79,12 +79,12 @@
"svelte-check": "^4.1.5",
"svelte-preprocess": "^6.0.3",
"svelte-sequential-preprocessor": "^2.0.2",
"tldts": "^7.0.7",
"tslib": "^2.8.1",
"typescript": "^5.8.2",
"typescript-eslint": "^8.30.1",
"vite": "^6.2.3",
"vitest": "^3.0.0",
"tldts": "^7.0.7"
"vitest": "^3.0.0"
},
"pnpm": {
"onlyBuiltDependencies": [
Expand Down
19 changes: 9 additions & 10 deletions pnpm-lock.yaml

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
Expand Up @@ -61,7 +61,7 @@
import arrowTwo from './arrow-two.svg';
import { camelize } from '$lib/helpers/string';
import { isValueOfStringEnum } from '$lib/helpers/types';
import { Card, Layout } from '@appwrite.io/pink-svelte';
import { Card, Layout, Input } from '@appwrite.io/pink-svelte';
import { IconArrowSmRight, IconSwitchHorizontal } from '@appwrite.io/pink-icons-svelte';

// Props
Expand All @@ -84,16 +84,15 @@
];

// Variables
let search: string = null;
let collectionList: Models.CollectionList;
let way = 'one';

// Lifecycle hooks
async function getCollections(search: string = null) {
const queries = search ? [Query.orderDesc('')] : [Query.limit(100)];
async function getCollections() {
const queries = [Query.limit(100)];
return sdk
.forProject(page.params.region, page.params.project)
.databases.listCollections(databaseId, queries, search);
.databases.listCollections(databaseId, queries);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So search is being removed because the component is a basic dropdown rather than a combo box where you can type to search? This will make it difficult for people to find the option they need.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is getting the collections from the API. The combobox is filtering on the client based on what the API returned. ATM search is defaulting as null which results in 0 results coming from the API. So ATM it's entirely broken, and this fixes that.
Updating this to the ComboBox is still something we need to do, but there is a bug that the dropdown of the combobox falls behind the modal, so you cannot use it.

TLDR: this change is going from 100% broken to usable. We need to do more work to make it good.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stnguyen90 its now using the combobox! @ArmanNik fixed the issue with the dropdown being behind the modal!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So shouldn't the search be added back while making sure the search param isn't passed in the API call if the user hasn't entered any value?

}

function updateKeyName() {
Expand All @@ -110,7 +109,6 @@
});

// Reactive statements
$: getCollections(search).then((res) => (collectionList = res));
$: collections = collectionList?.collections?.filter((n) => n.$id !== $collection.$id) ?? [];

$: if (editing) {
Expand Down Expand Up @@ -148,15 +146,15 @@
</Card.Selector>
</Layout.Stack>

<InputSelect
<Input.ComboBox
required
id="related"
label="Related collection"
placeholder="Select a collection"
isSearchable
bind:value={data.relatedCollection}
on:change={updateKeyName}
options={collections?.map((n) => ({ value: n.$id, label: `${n.name} (${n.$id})` })) ?? []} />

{#if data?.relatedCollection}
<InputText
id="key"
Expand Down
Loading