File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -275,6 +275,26 @@ describe('SelectCellRenderer', () => {
275275 expect ( container . querySelector ( '[class*="bg-blue-100"]' ) ) . toBeInTheDocument ( ) ;
276276 } ) ;
277277
278+ it ( 'should auto-detect status semantic colors with hyphen (in-progress → blue)' , ( ) => {
279+ const { container } = render (
280+ < SelectCellRenderer
281+ value = "in-progress"
282+ field = { { name : 'status' , type : 'select' , options : [ ] } as any }
283+ />
284+ ) ;
285+ expect ( container . querySelector ( '[class*="bg-blue-100"]' ) ) . toBeInTheDocument ( ) ;
286+ } ) ;
287+
288+ it ( 'should auto-detect status semantic colors with spaces (in progress → blue)' , ( ) => {
289+ const { container } = render (
290+ < SelectCellRenderer
291+ value = "in progress"
292+ field = { { name : 'status' , type : 'select' , options : [ ] } as any }
293+ />
294+ ) ;
295+ expect ( container . querySelector ( '[class*="bg-blue-100"]' ) ) . toBeInTheDocument ( ) ;
296+ } ) ;
297+
278298 it ( 'should render dash for null/empty value' , ( ) => {
279299 render (
280300 < SelectCellRenderer
Original file line number Diff line number Diff line change @@ -369,6 +369,7 @@ export function DateTimeCellRenderer({ value }: CellRendererProps): React.ReactE
369369}
370370
371371// Semantic color mapping (auto-detect from value text for priority & status fields)
372+ // Keys use underscore notation; lookup normalizes spaces/hyphens to underscores automatically.
372373const SEMANTIC_COLOR_MAP : Record < string , string > = {
373374 // Priority values
374375 critical : 'red' ,
Original file line number Diff line number Diff line change @@ -260,15 +260,18 @@ export const RelatedList: React.FC<RelatedListProps> = ({
260260
261261 const hasRowActions = ! ! onRowEdit || ! ! onRowDelete ;
262262
263+ const headerClassName = collapsible ? 'cursor-pointer select-none' : undefined ;
264+ const handleHeaderClick = collapsible ? ( ) => setCollapsed ( ( c ) => ! c ) : undefined ;
265+
263266 return (
264267 < Card className = { className } >
265- < CardHeader className = { collapsible ? 'cursor-pointer select-none' : undefined } onClick = { collapsible ? ( ) => setCollapsed ( ( c ) => ! c ) : undefined } >
268+ < CardHeader className = { headerClassName } onClick = { handleHeaderClick } >
266269 < CardTitle className = "flex items-center justify-between" >
267270 < div className = "flex items-center gap-2" >
268271 { collapsible && (
269272 collapsed
270- ? < ChevronRight className = "h-4 w-4 text-muted-foreground" />
271- : < ChevronDown className = "h-4 w-4 text-muted-foreground" />
273+ ? ( < ChevronRight className = "h-4 w-4 text-muted-foreground" /> )
274+ : ( < ChevronDown className = "h-4 w-4 text-muted-foreground" /> )
272275 ) }
273276 < span > { title } </ span >
274277 < span className = "text-sm font-normal text-muted-foreground" >
You can’t perform that action at this time.
0 commit comments