-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
fix issue (#7152 : Improve relation empty states on record page) #7157
fix issue (#7152 : Improve relation empty states on record page) #7157
Conversation
falgunmpatel
commented
Sep 19, 2024
- "No xxx" removed for empty relations
- All(0) removed
… page) - "No xxx" removed for empty relations - All(0) removed
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 issue #7152 by improving the empty state display for relation records on the record page.
- Removed
RecordDetailRelationRecordsListEmptyState
component, eliminating 'No xxx' messages for empty relations - Modified
RecordDetailRelationSection
to hide 'All (0)' link when there are no records - Updated rendering logic in
RecordDetailRelationSection
for a cleaner display of relation records list - Changes align with UX improvement goals by reducing redundant information for empty states
2 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings
...s/object-record/record-show/record-detail-section/components/RecordDetailRelationSection.tsx
Show resolved
Hide resolved
Thanks @falgunmpatel
|
Thanks for your review @Bonapara . I will keep these points in my mind while solving any issues. Also I will rectify my mistakes in this issue soon. |
- make spaces even for empty records - display icons for empty records while keeping them on hover for other records
Also should I delete the component that I commented. |
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.
Hello @falgunmpatel ! Thank you for your contribution :) LGTM, just remove the unused component
import styled from '@emotion/styled'; | ||
import { useIcons } from 'twenty-ui'; | ||
//TODO : File no longer needed, after solving (issue: #7152 :- Improve relation empty states on record page) | ||
|
||
import { ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem'; | ||
// import { useTheme } from '@emotion/react'; | ||
// import styled from '@emotion/styled'; | ||
// import { useIcons } from 'twenty-ui'; | ||
|
||
type RecordDetailRelationRecordsListEmptyStateProps = { | ||
relationObjectMetadataItem: ObjectMetadataItem; | ||
}; | ||
// import { ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem'; | ||
|
||
const StyledRelationRecordsListEmptyState = styled.div` | ||
color: ${({ theme }) => theme.font.color.light}; | ||
align-items: center; | ||
justify-content: center; | ||
gap: ${({ theme }) => theme.spacing(2)}; | ||
display: flex; | ||
height: ${({ theme }) => theme.spacing(10)}; | ||
text-transform: capitalize; | ||
`; | ||
// type RecordDetailRelationRecordsListEmptyStateProps = { | ||
// relationObjectMetadataItem: ObjectMetadataItem; | ||
// }; | ||
|
||
export const RecordDetailRelationRecordsListEmptyState = ({ | ||
relationObjectMetadataItem, | ||
}: RecordDetailRelationRecordsListEmptyStateProps) => { | ||
const theme = useTheme(); | ||
// const StyledRelationRecordsListEmptyState = styled.div` | ||
// color: ${({ theme }) => theme.font.color.light}; | ||
// align-items: center; | ||
// justify-content: center; | ||
// gap: ${({ theme }) => theme.spacing(2)}; | ||
// display: flex; | ||
// height: ${({ theme }) => theme.spacing(10)}; | ||
// text-transform: capitalize; | ||
// `; | ||
|
||
const { getIcon } = useIcons(); | ||
const Icon = getIcon(relationObjectMetadataItem.icon); | ||
// export const RecordDetailRelationRecordsListEmptyState = ({ | ||
// relationObjectMetadataItem, | ||
// }: RecordDetailRelationRecordsListEmptyStateProps) => { | ||
// const theme = useTheme(); | ||
|
||
return ( | ||
<StyledRelationRecordsListEmptyState> | ||
<Icon size={theme.icon.size.sm} /> | ||
<div>No {relationObjectMetadataItem.labelSingular}</div> | ||
</StyledRelationRecordsListEmptyState> | ||
); | ||
}; | ||
// const { getIcon } = useIcons(); | ||
// const Icon = getIcon(relationObjectMetadataItem.icon); | ||
|
||
// return ( | ||
// <StyledRelationRecordsListEmptyState> | ||
// <Icon size={theme.icon.size.sm} /> | ||
// <div>No {relationObjectMetadataItem.labelSingular}</div> | ||
// </StyledRelationRecordsListEmptyState> | ||
// ); | ||
// }; |
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.
You can remove this component :)
Thanks @falgunmpatel! Could you adjust the skeleton loading by removing the relations skeleton? It causes too much flashing since we don't know if they will have content or not. BeforeDesired |
- Remove unused code for empty state in record detail relation records list
@Bonapara I have removed skeletons causing flashing effect and achieved desired output. Also, I have removed unused components. |
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.
Wrong condition, otherwise LGTM ;) Thank you for your contribution
...s/object-record/record-show/record-detail-section/components/RecordDetailRelationSection.tsx
Outdated
Show resolved
Hide resolved
…cord-detail-section/components/RecordDetailRelationSection.tsx Co-authored-by: Raphaël Bosi <[email protected]>
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.
LGTM