-
Notifications
You must be signed in to change notification settings - Fork 33
[PB-5650]: Add auto-delete column to trash view #1799
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
base: feature/automatic-trash-disposal
Are you sure you want to change the base?
[PB-5650]: Add auto-delete column to trash view #1799
Conversation
Add a new "Auto-delete" column in the trash list that displays the number of days until an item is permanently deleted. The column shows "In X day(s)" with a warning icon, and highlights items in red when they have 2 days or less remaining. Changes: - Add caducityDate field to DriveFileData and DriveFolderData types - Add "Auto-delete" translation key to English locale - Create skinSkeletonTrash for trash view loading state - Add auto-delete column header to trash list (non-orderable) - Display auto-delete countdown with WarningCircle icon in list items - Calculate days until deletion from caducityDate field - Apply red text styling for urgent items (≤2 days remaining)
Deploying drive-web with
|
| Latest commit: |
aa07b6e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://cff86de2.drive-web.pages.dev |
| Branch Preview URL: | https://feature-automatic-trash-colu.drive-web.pages.dev |
| interface ListHeaderItem { | ||
| label: string; | ||
| width: string; | ||
| name: 'type' | 'name' | 'updatedAt' | 'size' | 'caducityDate'; | ||
| orderable: boolean; | ||
| defaultDirection: 'ASC' | 'DESC'; | ||
| buttonDataCy?: string; | ||
| textDataCy?: string; | ||
| } | ||
|
|
||
| const getListHeaders = (translate: (key: string) => string, isRecents: boolean, isTrash: boolean): ListHeaderItem[] => { |
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.
Maybe we can move this outside in order to keep it separately and make it easy to maintain. We could add it in a DriveExplorerList directory and add all components related with this DriveExplorerList
| days: number, | ||
| translate: (key: string, options?: { count?: number }) => string, | ||
| ): { text: string; isUrgent: boolean } => { | ||
| const isUrgent = days <= 2; |
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.
why 2? Add it to a descriptive variable
| }; | ||
|
|
||
| const DriveExplorerListItem = ({ item }: DriveExplorerItemProps): JSX.Element => { | ||
| const getAutoDeleteDisplay = ( |
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.
I think that this function name does not reflect what does, maybe getAutoDeleteStatusInfo or something similar fits better
| }; | ||
|
|
||
| const DriveExplorerListItem = ({ item }: DriveExplorerItemProps): JSX.Element => { | ||
| const getAutoDeleteDisplay = ( |
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.
Maybe we can add memoization for this function
|



Description
Add a new "Auto-delete" column in the trash list that displays the number of days until an item is
permanently deleted. The column shows "In X day(s)" with a warning icon, and highlights items in red when
they have 2 days or less remaining.
Changes:
Related Issues
Related Pull Requests
Checklist
Testing Process
Additional Notes