Fix rendering of boolean values in CRDs (#1087)

* Fix rendering of boolean values in CRDs

- add optional special casing for boolean values in DrawerItems and
  TableRows since React (imo annoying fashion) does not render boolean
  values by default.
- add a spinner on the sidebar for when the CRD menu is expeanded but
  the entries have not been loaded yet.
- Add ability to double click a Badge to expand, also make it so that
  Badges highligh all text on first click.

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton authored and GitHub committed 2020-11-10 10:10:19 -05:00
1 parent dd90dcb7f0
commit a78bbb5f6c
15 files changed
+167 -101

No files matched your search

@@ -235,7 +235,7 @@ export class ItemListLayout extends React.Component<ItemListLayoutProps> {
cellProps.className = cssNames(cellProps.className, headCell.className);
}
}
return <TableCell key={index} {...cellProps}/>
return <TableCell key={index} {...cellProps} />
})
}
{renderItemMenu && (
@@ -277,7 +277,7 @@ export class ItemListLayout extends React.Component<ItemListLayoutProps> {
if (!isReady || !filters.length || hideFilters || !userSettings.showAppliedFilters) {
return;
}
return <PageFiltersList filters={filters}/>
return <PageFiltersList filters={filters} />
}
renderNoItems() {
@@ -297,7 +297,7 @@ export class ItemListLayout extends React.Component<ItemListLayoutProps> {
</NoItems>
)
}
return <NoItems/>
return <NoItems />
}
renderHeaderContent(placeholders: IHeaderPlaceholders): ReactNode {
@@ -344,12 +344,12 @@ export class ItemListLayout extends React.Component<ItemListLayoutProps> {
title: <h5 className="title">{title}</h5>,
info: this.renderInfo(),
filters: <>
{!isClusterScoped && <NamespaceSelectFilter/>}
{!isClusterScoped && <NamespaceSelectFilter />}
<PageFiltersSelect allowEmpty disableFilters={{
[FilterType.NAMESPACE]: true, // namespace-select used instead
}}/>
}} />
</>,
search: <SearchInputUrl/>,
search: <SearchInputUrl />,
}
let header = this.renderHeaderContent(placeholders);
if (customizeHeader) {
@@ -381,7 +381,7 @@ export class ItemListLayout extends React.Component<ItemListLayoutProps> {
return (
<div className="items box grow flex column">
{!isReady && (
<Spinner center/>
<Spinner center />
)}
{isReady && (
<Table
@@ -406,8 +406,8 @@ export class ItemListLayout extends React.Component<ItemListLayoutProps> {
onClick={prevDefault(() => store.toggleSelectionAll(items))}
/>
)}
{renderTableHeader.map((cellProps, index) => <TableCell key={index} {...cellProps}/>)}
{renderItemMenu && <TableCell className="menu"/>}
{renderTableHeader.map((cellProps, index) => <TableCell key={index} {...cellProps} />)}
{renderItemMenu && <TableCell className="menu" />}
</TableHead>
)}
{