refactor(content-picker): convert Content to TypeScript#3944
refactor(content-picker): convert Content to TypeScript#3944devin-ai-integration[bot] wants to merge 8 commits intomasterfrom
Conversation
- Renamed Content.js to Content.tsx - Converted Flow types to TypeScript interfaces - Improved type safety with proper function signatures - Removed Flow comments and simplified JSDoc Link to Devin run: https://app.devin.ai/sessions/848dfdad3fe447138f3a218f3058e660 Requested by: tjuanitas@box.com
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
| import ItemList from './ItemList'; | ||
| import { VIEW_ERROR, VIEW_SELECTED } from '../../constants'; | ||
| import type { View, Collection } from '../../common/types/core'; | ||
| import { View, Collection } from '../../common/types/core'; |
There was a problem hiding this comment.
Can you sort this?
| import { View, Collection } from '../../common/types/core'; | |
| import { Collection, View } from '../../common/types/core'; |
| * | ||
| * @param {string} view the current view | ||
| * @param {Object} currentCollection the current collection | ||
| * @return {boolean} empty or not |
There was a problem hiding this comment.
Please revert this change.
There was a problem hiding this comment.
Devin please revert this change
- Sort imports alphabetically - Restore JSDoc comments
tjuanitas
left a comment
There was a problem hiding this comment.
don't merge this yet, as the JS component could be useful for testing. however, it looks good and doesn't require any more changes.
| /** | ||
| * @flow | ||
| * @file File picker header and list component | ||
| * @author Box | ||
| */ | ||
|
|
There was a problem hiding this comment.
Please delete this comment, you don't need the header comment at the top of the file
| @@ -68,24 +65,22 @@ const Content = ({ | |||
| <ProgressBar percent={currentCollection.percentLoaded} /> | |||
| )} | |||
| {isEmpty(view, currentCollection) ? ( | |||
| <EmptyView view={view} isLoading={currentCollection.percentLoaded !== 100} /> | |||
There was a problem hiding this comment.
why did you make this change?
| canSetShareAccess, | ||
| onItemSelect, | ||
| onItemClick, | ||
| onShareAccessChange, |
There was a problem hiding this comment.
please revert these changes
| onFocusChange={onFocusChange} | ||
| onShareAccessChange={onShareAccessChange} | ||
| onFocusChange={onFocusChange} | ||
| extensionsWhitelist={extensionsWhitelist} |
There was a problem hiding this comment.
please revert these changes
| */ | ||
|
|
||
| import * as React from 'react'; | ||
| // $FlowFixMe TypeScript file |
| view, | ||
| rootId, | ||
| isSmall, | ||
| rootElement, | ||
| focusedRow, | ||
| hasHitSelectionLimit, | ||
| selectableType, | ||
| currentCollection, | ||
| tableRef, | ||
| canSetShareAccess, | ||
| isSingleSelect, | ||
| onItemClick, | ||
| onItemSelect, | ||
| onShareAccessChange, | ||
| onFocusChange, | ||
| extensionsWhitelist, |
There was a problem hiding this comment.
can you sort this list alphabetically?
| view={view} | ||
| rootId={rootId} | ||
| isSmall={isSmall} | ||
| rootElement={rootElement} | ||
| focusedRow={focusedRow} | ||
| currentCollection={currentCollection} | ||
| tableRef={tableRef} | ||
| canSetShareAccess={canSetShareAccess} | ||
| hasHitSelectionLimit={hasHitSelectionLimit} | ||
| isSingleSelect={isSingleSelect} | ||
| selectableType={selectableType} | ||
| onItemSelect={onItemSelect} | ||
| onItemClick={onItemClick} | ||
| onFocusChange={onFocusChange} | ||
| onShareAccessChange={onShareAccessChange} | ||
| extensionsWhitelist={extensionsWhitelist} |
There was a problem hiding this comment.
can you sort these props alphabetically?
| <ProgressBar percent={currentCollection.percentLoaded} /> | ||
| )} | ||
| {isEmpty(view, currentCollection) ? ( | ||
| <EmptyView view={view} isLoading={currentCollection.percentLoaded !== 100} /> |
There was a problem hiding this comment.
can you sort the props alphabetically?
There was a problem hiding this comment.
| <EmptyView view={view} isLoading={currentCollection.percentLoaded !== 100} /> | |
| <EmptyView isLoading={currentCollection.percentLoaded !== 100} view={view} /> |
Line-by-Line Comparison between Content.tsx and Content.js.flow
The main structural changes were:
|
Line-by-Line Comparison between Content.tsx and Content.js.flow (Part 1)
|
Line-by-Line Comparison (Part 2)
|
Line-by-Line Comparison (Part 3)
|
Line-by-Line Comparison (Summary)The main structural changes were:
|
|
Closing due to inactivity. |
Description
Converted Content.js to TypeScript in the content-picker element.
Changes made:
Link to Devin run: https://app.devin.ai/sessions/848dfdad3fe447138f3a218f3058e660
Requested by: tjuanitas@box.com