verbb / formie

The most user-friendly forms plugin for Craft CMS.
Other
95 stars 72 forks source link

Add existing fields dialog has duplicate synced fields #1877

Open benfeather opened 4 months ago

benfeather commented 4 months ago

Describe the bug

The Add Existing Fields dialog shows synced fields multiple times:

CleanShot 2024-05-09 at 09 58 45@2x

In the image above, the password field is associated with 4 forms and is shown 4 times.

Is it possible to hide these duplicates?

Steps to reproduce

N/A

Form settings

Craft CMS version

5.1.2

Plugin version

dev-craft-5 as 3.0.0-beta.10

Multi-site?

Yes

Additional context

No response

benfeather commented 4 months ago

On a slightly unrelated note, can we get the field handle displayed in this view?

I have a few different "Email" fields for different purposes:

  1. One for the register form with the handle: emailUnique (as it uses the unique validation)
  2. One for user profile form with the handle: email
  3. One for the login form with the handle: loginName

It's hard to tell which field I'm selecting as all of the labels need to be "Email"

engram-design commented 4 months ago

Yeah that's an interesting one. So currently you're looking at the "All Forms" which is going to show all fields across all forms. If we were to remove duplicates, the "Password" field would be missing on several forms. I'm not sure if that's desirable. A user might go to a form they know the "Password" field exists on, but doesn't appear, because it's used on another form. They then have to either find which form has the "Password" field, or switch back to "All Forms"

Or, we just filter out duplicate synced field for "All Forms" and leave others as-is.

Good call on the field handle, happy to add that.

benfeather commented 4 months ago

It makes sense to filter the duplicates on the "All forms" page and leave the others as is. That, plus the visible field handles, should make it much easier to find the one you're looking for.