Merge pull request #10741 from AlexSCorey/10495-ActionBtnOnEmptyState

Improves empty state messages for improve UX
This commit is contained in:
Jake McDermott
2021-07-28 10:18:49 -04:00
committed by GitHub
3 changed files with 8 additions and 1 deletions

View File

@@ -159,6 +159,7 @@ function JobList({ defaultParams, showTypeColumn = false }) {
hasContentLoading={isLoading || isDeleteLoading || isCancelLoading} hasContentLoading={isLoading || isDeleteLoading || isCancelLoading}
items={jobs} items={jobs}
itemCount={count} itemCount={count}
emptyContentMessage={t`Please run a job to populate this list.`}
pluralizedItemName={t`Jobs`} pluralizedItemName={t`Jobs`}
qsConfig={qsConfig} qsConfig={qsConfig}
toolbarSearchColumns={[ toolbarSearchColumns={[

View File

@@ -10,7 +10,6 @@ import { useKebabifiedMenu } from 'contexts/Kebabified';
function ToolbarAddButton({ function ToolbarAddButton({
linkTo, linkTo,
onClick, onClick,
isDisabled, isDisabled,
defaultLabel = t`Add`, defaultLabel = t`Add`,
showToggleIndicator, showToggleIndicator,

View File

@@ -147,6 +147,11 @@ function ScheduleList({
} }
return missingValues && t`This schedule is missing required survey values`; return missingValues && t`This schedule is missing required survey values`;
}; };
let emptyContentMessage = t`Please add a Schedule to populate this list.`;
if (location.pathname.startsWith('/schedules')) {
emptyContentMessage = t`Please add a Schedule to populate this list. Schedules can be added to a Template, Project, or Inventory Source.`;
}
return ( return (
<> <>
@@ -156,6 +161,8 @@ function ScheduleList({
items={schedules} items={schedules}
itemCount={itemCount} itemCount={itemCount}
qsConfig={QS_CONFIG} qsConfig={QS_CONFIG}
pluralizedItemName={t`Schedules`}
emptyContentMessage={emptyContentMessage}
onRowClick={handleSelect} onRowClick={handleSelect}
headerRow={ headerRow={
<HeaderRow qsConfig={QS_CONFIG}> <HeaderRow qsConfig={QS_CONFIG}>