Update CatalogTable to default total count to 0 instead of undefined
Depending on latency in making the request the context can load without items and then refresh moments later with the correct count. Until the entities are loaded the total will show as "All (undefined)", which is not confidence inspiring. Signed-off-by: CiscoRob <133238823+CiscoRob@users.noreply.github.com> Signed-off-by: Coderrob <rolindle@cisco.com>
This commit is contained in:
@@ -88,10 +88,15 @@ export const CatalogTable = (props: CatalogTableProps) => {
|
||||
} = props;
|
||||
const { isStarredEntity, toggleStarredEntity } = useStarredEntities();
|
||||
const entityListContext = useEntityList();
|
||||
const { loading, error, entities, filters, pageInfo, totalItems } =
|
||||
entityListContext;
|
||||
const {
|
||||
loading,
|
||||
error,
|
||||
entities,
|
||||
filters,
|
||||
pageInfo,
|
||||
totalItems = 0,
|
||||
} = entityListContext;
|
||||
const enablePagination = !!pageInfo;
|
||||
|
||||
const tableColumns = useMemo(
|
||||
() =>
|
||||
typeof columns === 'function' ? columns(entityListContext) : columns,
|
||||
|
||||
Reference in New Issue
Block a user