-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Fixes Empty Label Identifer Preview in Settings/DataModel/Object/Edit #6370
Fixes Empty Label Identifer Preview in Settings/DataModel/Object/Edit #6370
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This pull request addresses the issue of empty identifier previews in the settings data model by updating default values and adding new hooks and logic to ensure meaningful previews.
- Updated default values in
packages/twenty-front/src/modules/settings/data-model/constants/SettingsFieldTypeConfigs.ts
to provide clearer placeholder content. - Passed
fieldName
prop inpackages/twenty-front/src/modules/settings/data-model/fields/preview/components/SettingsDataModelFieldPreview.tsx
to ensure correct field name usage. - Added logic in
packages/twenty-front/src/modules/settings/data-model/fields/preview/components/SettingsDataModelSetFieldValueEffect.tsx
to check for upserted preview records. - Introduced custom hooks in
packages/twenty-front/src/modules/settings/data-model/fields/preview/hooks/previewRecordIdHooks.ts
andpackages/twenty-front/src/modules/settings/data-model/fields/preview/hooks/useUpsertedPreviewRecord.ts
for managing preview record IDs. - Wrapped form components with
RecordFieldValueSelectorContextProvider
inpackages/twenty-front/src/pages/settings/data-model/SettingsObjectEdit.tsx
for enhanced state management.
11 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings
packages/twenty-front/src/pages/settings/data-model/SettingsObjectEdit.tsx
Show resolved
Hide resolved
Hey @Faisal-imtiyaz123, I tried to review this but I couldn't figure out exactly what you did and why you did it. |
Because you don't follow conventions very well (like naming the hook "[previewRecordIdHooks.ts]") then it makes the reviewer suspicious about the rest of the code, which might indeed be the best solution possible, but in that case it's best to provide context and explain why you had to make those choices |
I will close the PR for now to keep the PR backlog clean but please feel free to raise a new one with a clean description and the most elegant solution possible without introducing un-necessary hooks or complex conditions. Thanks! |
@FelixMalfait There were couple of problems with this one. One was that |
@FelixMalfait The hooks I made are to use the previewRecordId's. Not much code there . Just for refactoring I made them. |
@FelixMalfait If I raise I new PR I think I should only change |
@FelixMalfait I would request you to please give it another look according to what I explained. I put quite some work in it. |
@FelixMalfait Thanks for reopening it. Do u want me to make a new PR with the refactoring of
Or Are you currently looking into it ? Please let me know. |
Sorry I should not have closed it. I think you are a great problem solver, but since your code is sometimes not the cleanest it's easy to judge quickly and dismiss it. I should have spent more time on it. We'll merge it like this! |
@lucasbordeau when you come back I'd appreciate if you can have a look at this merged PR |
Thanks @Faisal-imtiyaz123 for your contribution! |
@FelixMalfait I am deeply thankful to you for reopening it again and spending time to review it . Thanks for believing in me. I am working everyday to improve my code quality. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
(updates since last review)
This pull request addresses the issue of empty identifier previews in the Object settings by updating various components, hooks, and utilities to ensure meaningful previews are displayed.
- Updated
package.json
: Patchedtypeorm
dependency to use a local patch file (./packages/twenty-server/patches/typeorm+0.3.20.patch
). - Modified GraphQL Enum: Renamed
MessageChannelSyncStatusEnum.Completed
toActive
inpackages/twenty-chrome-extension/src/generated/graphql.tsx
. - Simplified Image URI Handling: Replaced
getImageAbsoluteURIOrBase64
withgetImageAbsoluteURI
in multiple files, includingpackages/twenty-emails/src/emails/send-invite-link.email.tsx
. - Refactored State Management: Removed
activityIdInDrawerState
and related states, simplifying state management across various components. - Enhanced Field Handling: Added support for new field types (
RichText
,Actor
) and updated hooks and components to handle these types correctly.
These changes ensure that the identifier preview functionality is improved, providing meaningful content and better state management across the application.
293 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings
fixes #6143