You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Convert ShareItem from a class component to a functional TypeScript component. The component renders a single share table row with polling logic to reload pending shares every 5 seconds, a RuleTooltip inner class component for displaying access rules, and dependency loading for share rules via loadShareRulesOnce. It uses componentDidMount, UNSAFE_componentWillReceiveProps, and componentWillUnmount to manage polling and rule loading lifecycle.
Acceptance Criteria
Test file item.test.tsx created with 18 unit tests covering: row rendering, share network display, access rules display, dependency loading (loadShareRulesOnce called on mount), polling starts for pending shares, polling stops when share becomes available, polling cleans up on unmount
All tests pass (pnpm vitest run)
File renamed to item.tsx with TypeScript interfaces defined for Rule, ShareRulesState, Share, ShareNetwork, and ShareItemProps
componentDidMount + UNSAFE_componentWillReceiveProps + componentWillUnmount replaced with useEffect hooks
Polling managed via useRef for the interval ID, reacting to share.status
startPolling and stopPolling methods converted to inline effect logic
Inner RuleTooltip class component converted to a functional component
loadShareRulesOnce called in a separate useEffect reacting to share.id
No TypeScript errors (pnpm typecheck), no lint errors (pnpm lint)
Task Description
Convert
ShareItemfrom a class component to a functional TypeScript component. The component renders a single share table row with polling logic to reload pending shares every 5 seconds, aRuleTooltipinner class component for displaying access rules, and dependency loading for share rules vialoadShareRulesOnce. It usescomponentDidMount,UNSAFE_componentWillReceiveProps, andcomponentWillUnmountto manage polling and rule loading lifecycle.Acceptance Criteria
item.test.tsxcreated with 18 unit tests covering: row rendering, share network display, access rules display, dependency loading (loadShareRulesOncecalled on mount), polling starts for pending shares, polling stops when share becomes available, polling cleans up on unmountpnpm vitest run)item.tsxwith TypeScript interfaces defined forRule,ShareRulesState,Share,ShareNetwork, andShareItemPropscomponentDidMount+UNSAFE_componentWillReceiveProps+componentWillUnmountreplaced withuseEffecthooksuseReffor the interval ID, reacting toshare.statusstartPollingandstopPollingmethods converted to inline effect logicRuleTooltipclass component converted to a functional componentloadShareRulesOncecalled in a separateuseEffectreacting toshare.idpnpm typecheck), no lint errors (pnpm lint)