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

fix issue (#7152 : Improve relation empty states on record page) #7157

Merged
merged 6 commits into from
Sep 24, 2024

Conversation

falgunmpatel
Copy link
Contributor

  • "No xxx" removed for empty relations
  • All(0) removed

… page)

- "No xxx" removed for empty relations
- All(0) removed
Copy link
Contributor

@greptile-apps greptile-apps bot left a 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

@Bonapara
Copy link
Member

Bonapara commented Sep 19, 2024

Thanks @falgunmpatel

  • The gap below the relation name should match the gap above it. (Make sure the spacing remains as today when there are some relations under though 🚨)
  • You also missed the point about showing the CTA when there is no relation displayed

image

@falgunmpatel
Copy link
Contributor Author

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.

falgunmpatel and others added 2 commits September 19, 2024 22:46
- make spaces even for empty records
- display icons for empty records while keeping them on hover for other records
@falgunmpatel
Copy link
Contributor Author

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.

Also should I delete the component that I commented.

@bosiraphael bosiraphael self-assigned this Sep 20, 2024
Copy link
Contributor

@bosiraphael bosiraphael left a 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

Comment on lines 2 to 37
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>
// );
// };
Copy link
Contributor

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 :)

@Bonapara
Copy link
Member

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.

Before

image

Desired

image

falgunmpatel and others added 2 commits September 22, 2024 21:03
- Remove unused code for empty state in record detail relation records list
@falgunmpatel
Copy link
Contributor Author

falgunmpatel commented Sep 22, 2024

@Bonapara I have removed skeletons causing flashing effect and achieved desired output. Also, I have removed unused components.

Copy link
Contributor

@bosiraphael bosiraphael left a 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

…cord-detail-section/components/RecordDetailRelationSection.tsx

Co-authored-by: Raphaël Bosi <[email protected]>
Copy link
Contributor

@bosiraphael bosiraphael left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bosiraphael bosiraphael merged commit fd6740f into twentyhq:main Sep 24, 2024
8 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants