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

Prefill Relation Fields with Initiating Object Icon and Name #7355

Closed
Bonapara opened this issue Sep 30, 2024 · 3 comments
Closed

Prefill Relation Fields with Initiating Object Icon and Name #7355

Bonapara opened this issue Sep 30, 2024 · 3 comments

Comments

@Bonapara
Copy link
Member

Bonapara commented Sep 30, 2024

Current Behavior

Today, when we create a relation:

CleanShot 2024-09-30 at 16 48 26

  1. We display the user icon as the default "Field on XXX" icon.
  2. We display the Field name as the "Field on XXX" placeholder.

Desired Behavior

Since we know the object that initiates the relation creation, we want to prefill the "field on XXX" input and icon:

  1. The object that initiates the relation icon
  2. The object that initiates the relation name (adjusted for plural or singular based on the relation type: one-to-many, many-to-many, or many-to-one)

In the example above, the relation is initiated from the company object so the default "field on people" infos should be prefilled like this:

CleanShot 2024-09-30 at 17 03 09

We should keep the Field name placeholder if the user removes the Object initiator name text.

@ehconitin
Copy link
Contributor

are you working on this @sid0-0 ?

@sid0-0
Copy link
Contributor

sid0-0 commented Oct 1, 2024

Yes @ehconitin a PR is raised.

lucasbordeau added a commit that referenced this issue Oct 10, 2024
feat: #7355 

Behaviour implemented:
1. Relation field name field is updated when relation type is updated
2. Icon is only prefilled in the beginning
3. If user manually edits the field name, then no subsequent updates are
made to that field upon relation type change.



https://github.com/user-attachments/assets/d372b106-8dcb-458d-8374-a76cd130f091

---------

Co-authored-by: sid0-0 <[email protected]>
Co-authored-by: Lucas Bordeau <[email protected]>
@lucasbordeau
Copy link
Contributor

Closed by #7363

@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in Product development ✅ Oct 10, 2024
lucasbordeau added a commit that referenced this issue Oct 11, 2024
@lucasbordeau 
forms are broken!
revert - #7363 
used useRelationSettingsFormInitialValues hook from that commit.
TODO - figure out a way to change the relation name label from singular
to plural and vice versa, until it is edited.
related issue - #7355

---------

Co-authored-by: Lucas Bordeau <[email protected]>
harshit078 pushed a commit to harshit078/twenty that referenced this issue Oct 14, 2024
…q#7363)

feat: twentyhq#7355 

Behaviour implemented:
1. Relation field name field is updated when relation type is updated
2. Icon is only prefilled in the beginning
3. If user manually edits the field name, then no subsequent updates are
made to that field upon relation type change.



https://github.com/user-attachments/assets/d372b106-8dcb-458d-8374-a76cd130f091

---------

Co-authored-by: sid0-0 <[email protected]>
Co-authored-by: Lucas Bordeau <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

4 participants