Skip to content
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

Minor Bug: Cascade delete tool tip displaying active collection when creating new collection #3098

Closed
Green-Ranger11 opened this issue Aug 9, 2023 · 2 comments

Comments

@Green-Ranger11
Copy link

When adding a relation in a new collection the tooltip always displays the selected collection in the background instead of just saying field.

For example, if you log in the active collection is automatically set to users. When you create a new collection and add a relation, the cascade delete tooltip will say something like:

Whether on field record deletion to delete also the user (or the selected active collection in the background) associated records.

When it should be:

Whether on field record deletion to delete also the field associated records.

I can't screenshot the tooltip unfortunately but I believe the issue is in


because $activeCollection always has a value .

I was thinking of maybe passing a prop but I don't want to ruin this clean foreach loop by having one of the schemas have one prop separate from the others (maybe that's just me)

<svelte:component
this={fieldComponents[field.type]}
key={getSchemaFieldIndex(field)}
bind:field
on:remove={() => removeField(i)}
on:rename={(e) => replaceIndexesColumn(e.detail.oldName, e.detail.newName)}
/>

Maybe another way would be clear $activeCollection on creating a new collection?

Maybe there's a better way since I'm not too familiar with the UI codebase but I reckon it would be fine to just remove the || and just have it say "field"

@ganigeorgiev
Copy link
Member

Yes, the use of $activeCollection is not correct here.

I'll consider removing it and generalize the message in order to to keep the current schema fields components separate from their collection model.

@ganigeorgiev
Copy link
Member

ganigeorgiev commented Aug 9, 2023

I've updated the message (+ added some additional info for multiple relation fields) in master.

In general the relation field options panel will slightly change in the next release as I'm planning of moving the "Display fields" to be as global collection option to reduce the duplication when different relations to the same collection are created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants