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

Field on label should change singular to plural based on relation type #7683

Closed
ehconitin opened this issue Oct 14, 2024 · 22 comments
Closed
Assignees
Labels
good first issue Good for newcomers scope: front Issues that are affecting the frontend side only

Comments

@ehconitin
Copy link
Contributor

Current behavior

  1. The field on label is populated with active object, and it doesn't change singular to plural or vice versa based on relation type.

1

Expected behavior

  1. The label field on should automatically change from singular to plural (or vice versa) based on the relation type, unless the user manually edits or changes the field.
Copy link

oss-gg bot commented Oct 14, 2024

This issue is not part of oss.gg hackathon. Please pick a different one or start with a side quest

@ehconitin
Copy link
Contributor Author

/oss.gg 200

Copy link

oss-gg bot commented Oct 14, 2024

Thanks for opening an issue! It's live on oss.gg!

@ehconitin ehconitin added good first issue Good for newcomers scope: front Issues that are affecting the frontend side only labels Oct 14, 2024
@bunmi-oye
Copy link

/assign

Copy link

oss-gg bot commented Oct 14, 2024

Assigned to @Cyanhead! Please open a draft PR linking this issue within 48h ⚠️ If we can't detect a PR from you linking this issue in 48h, you'll be unassigned automatically 🕹️ Excited to have you ship this 🚀

@malavshah9
Copy link

/assign

Copy link

oss-gg bot commented Oct 14, 2024

This issue is already assigned to another person. Please find more issues here.

@bibektamang7
Copy link

/assign

Copy link

oss-gg bot commented Oct 15, 2024

This issue is already assigned to another person. Please find more issues here.

Copy link

oss-gg bot commented Oct 16, 2024

@Cyanhead, Just a little reminder: Please open a draft PR linking this issue within 12 hours. If we can't detect a PR in 12h, you will be unassigned automatically.

@Vardhaman619
Copy link
Contributor

/assign

Copy link

oss-gg bot commented Oct 16, 2024

This issue is already assigned to another person. Please find more issues here.

@bunmi-oye
Copy link

Hi @ehconitin, I'm having some difficulty with where exactly to implement the fix for this issue. I have an idea of the cause, but i'm not sure where/how to pass the data.

PHOTO A: It looks like the reason the plural is not being applied is because the initialRelationFieldMetadataItem.label gotten from the useRelationSettingsFormInitialValues hook doesn't get assigned the correct value.

PHOTO B: initialRelationType receives relationTypeFromFieldMetadata as undefined and defaults to RelationDefinitionType.OneToMany.

PHOTO C: The SettingsDataModelFieldSettingsFormCard component passes three properties, of which relationDefinition needed by the useRelationSettingsFormInitialValues isn't included.

Screenshot 2024-10-16 102328 Screenshot 2024-10-16 102834 Screenshot 2024-10-16 103139

@Parth002933v
Copy link

/assign

Copy link

oss-gg bot commented Oct 16, 2024

This issue is already assigned to another person. Please find more issues here.

@vamus092
Copy link

/assign

Copy link

oss-gg bot commented Oct 22, 2024

This issue is already assigned to another person. Please find more issues here.

@bunmi-oye bunmi-oye removed their assignment Nov 4, 2024
@omarNaifer12
Copy link
Contributor

@ehconitin Hello, is this issue still available? Can I work on it?

@omarNaifer12
Copy link
Contributor

/assign

Copy link

oss-gg bot commented Nov 29, 2024

This issue is not part of oss.gg hackathon. Please pick a different one or start with a side quest

@omarNaifer12
Copy link
Contributor

@FelixMalfait @ehconitin Hello,
Sorry for working on this before being assigned. I've completed the task and made a pull request. Please review and let me know if any changes are needed.

Thank you!

@ehconitin
Copy link
Contributor Author

@omarNaifer12 no problem! Thanks 😊

FelixMalfait added a commit that referenced this issue Dec 2, 2024
…ype (#8817)

#7683 

![labelPlural](https://github.com/user-attachments/assets/3e620d7e-dd51-4e4e-a9ba-289f2685ddf3)

![labelSingular](https://github.com/user-attachments/assets/84739ac5-29b4-48c8-8a71-3f8f2816641b)
Hello,
I’ve implemented the logic for dynamically toggling the Field on label
between singular and plural based on the relation type selected by the
user. Here's an overview of the changes:

Added a variable selectedRelationType to store the user’s selected
relation type.
Based on this variable, I determine whether to use labelPlural or
labelSingular from the selectedObjectMetadataItem.
Please review my changes and let me know if there's anything that needs
improvement .

---------

Co-authored-by: Félix Malfait <[email protected]>
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in Product development ✅ Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers scope: front Issues that are affecting the frontend side only
Projects
Status: ✅ Done
Development

No branches or pull requests

10 participants