Skip to content

Commit

Permalink
Update empty state strings for consistency and accuracy
Browse files Browse the repository at this point in the history
Update the strings displayed on empty tables to be more consistent
across resource types and also to be more accurate.

Since we've added label filtering support the 'no resources found'
message has been a bit misleading, it should really be 'no matching
resources found'.

This is even more obvious with the recent addition of status filtering
on the TaskRuns and PipelineRuns lists.

Update the strings used for all namespaces, cluster resources, and
selected namespace empty states.
  • Loading branch information
AlanGreene authored and tekton-robot committed Dec 15, 2020
1 parent dbffe8c commit 2ed1471
Show file tree
Hide file tree
Showing 26 changed files with 66 additions and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,15 @@ const PipelineResources = ({
emptyTextAllNamespaces={intl.formatMessage(
{
id: 'dashboard.emptyState.allNamespaces',
defaultMessage: 'No {kind} in any namespace.'
defaultMessage: 'No matching {kind} found'
},
{ kind: 'PipelineResources' }
)}
emptyTextSelectedNamespace={intl.formatMessage(
{
id: 'dashboard.emptyState.selectedNamespace',
defaultMessage: 'No {kind} in namespace {selectedNamespace}'
defaultMessage:
'No matching {kind} found in namespace {selectedNamespace}'
},
{ kind: 'PipelineResources', selectedNamespace }
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ it('PipelineResources renders empty state', () => {
const { queryByText } = renderWithIntl(
<PipelineResources pipelineResources={[]} />
);
expect(queryByText(/no pipelineresources/i)).toBeTruthy();
expect(queryByText(/no matching pipelineresources/i)).toBeTruthy();
expect(queryByText('Namespace')).toBeTruthy();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,15 @@ const PipelineRuns = ({
emptyTextAllNamespaces={intl.formatMessage(
{
id: 'dashboard.emptyState.allNamespaces',
defaultMessage: 'No {kind} in any namespace.'
defaultMessage: 'No matching {kind} found'
},
{ kind: 'PipelineRuns' }
)}
emptyTextSelectedNamespace={intl.formatMessage(
{
id: 'dashboard.emptyState.selectedNamespace',
defaultMessage: 'No {kind} in namespace {selectedNamespace}'
defaultMessage:
'No matching {kind} found in namespace {selectedNamespace}'
},
{ kind: 'PipelineRuns', selectedNamespace }
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import PipelineRuns from './PipelineRuns';
describe('PipelineRuns', () => {
it('renders empty state', () => {
const { queryByText } = renderWithIntl(<PipelineRuns pipelineRuns={[]} />);
expect(queryByText(/no pipelineruns/i)).toBeTruthy();
expect(queryByText(/no matching pipelineruns/i)).toBeTruthy();
expect(queryByText('Namespace')).toBeTruthy();
});

Expand All @@ -33,7 +33,7 @@ describe('PipelineRuns', () => {

expect(queryByText('Namespace')).toBeFalsy();
expect(queryByText('Pipeline')).toBeTruthy();
expect(queryByText(/no pipelineruns/i)).toBeTruthy();
expect(queryByText(/no matching pipelineruns/i)).toBeTruthy();
});

it('renders custom columns', () => {
Expand Down
4 changes: 0 additions & 4 deletions packages/components/src/components/Table/Table.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,6 @@ describe('Table', () => {
expect(queryByText(/Add/i)).toBeNull();
expect(queryByLabelText('Select all rows')).toBeNull();
expect(queryByLabelText('Select row')).toBeNull();
expect(
queryByText("No Resources created in namespace 'default'.")
).toBeNull();
expect(queryByText('No Resources created in any namespace.')).toBeNull();
});

it('batch action button specifies correct arguments for callback with one row selected', () => {
Expand Down
5 changes: 3 additions & 2 deletions packages/components/src/components/TaskRuns/TaskRuns.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,15 @@ const TaskRuns = ({
emptyTextAllNamespaces={intl.formatMessage(
{
id: 'dashboard.emptyState.allNamespaces',
defaultMessage: 'No {kind} in any namespace.'
defaultMessage: 'No matching {kind} found'
},
{ kind: 'TaskRuns' }
)}
emptyTextSelectedNamespace={intl.formatMessage(
{
id: 'dashboard.emptyState.selectedNamespace',
defaultMessage: 'No {kind} in namespace {selectedNamespace}'
defaultMessage:
'No matching {kind} found in namespace {selectedNamespace}'
},
{ kind: 'TaskRuns', selectedNamespace }
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import TaskRuns from './TaskRuns';

it('TaskRuns renders empty state', () => {
const { queryByText } = renderWithIntl(<TaskRuns taskRuns={[]} />);
expect(queryByText(/no taskruns/i)).toBeTruthy();
expect(queryByText(/no matching taskruns/i)).toBeTruthy();
});

it('TaskRuns renders headers state', () => {
Expand Down
5 changes: 3 additions & 2 deletions src/components/CreateSecret/ServiceAccountSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,15 @@ const ServiceAccountSelector = props => {
emptyTextAllNamespaces={intl.formatMessage(
{
id: 'dashboard.emptyState.allNamespaces',
defaultMessage: 'No {kind} in any namespace.'
defaultMessage: 'No matching {kind} found'
},
{ kind: 'Secrets' }
)}
emptyTextSelectedNamespace={intl.formatMessage(
{
id: 'dashboard.emptyState.selectedNamespace',
defaultMessage: 'No {kind} in namespace {selectedNamespace}'
defaultMessage:
'No matching {kind} found in namespace {selectedNamespace}'
},
{ kind: 'Secrets', selectedNamespace: namespace }
)}
Expand Down
4 changes: 2 additions & 2 deletions src/containers/ClusterTasks/ClusterTasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,14 @@ export /* istanbul ignore next */ class ClusterTasksContainer extends Component
emptyTextAllNamespaces={intl.formatMessage(
{
id: 'dashboard.emptyState.clusterResource',
defaultMessage: 'No {kind}'
defaultMessage: 'No matching {kind} found'
},
{ kind: 'ClusterTasks' }
)}
emptyTextSelectedNamespace={intl.formatMessage(
{
id: 'dashboard.emptyState.clusterResource',
defaultMessage: 'No {kind}'
defaultMessage: 'No matching {kind} found'
},
{ kind: 'ClusterTasks' }
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,14 @@ export /* istanbul ignore next */ class ClusterTriggerBindings extends Component
emptyTextAllNamespaces={intl.formatMessage(
{
id: 'dashboard.emptyState.clusterResource',
defaultMessage: 'No {kind}'
defaultMessage: 'No matching {kind} found'
},
{ kind: 'ClusterTriggerBindings' }
)}
emptyTextSelectedNamespace={intl.formatMessage(
{
id: 'dashboard.emptyState.clusterResource',
defaultMessage: 'No {kind}'
defaultMessage: 'No matching {kind} found'
},
{ kind: 'ClusterTriggerBindings' }
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ it('ClusterTriggerBindings renders with no bindings', () => {
);

expect(getByText('ClusterTriggerBindings')).toBeTruthy();
expect(getByText('No ClusterTriggerBindings')).toBeTruthy();
expect(getByText('No matching ClusterTriggerBindings found')).toBeTruthy();
});

it('ClusterTriggerBindings renders with one binding', () => {
Expand Down Expand Up @@ -112,7 +112,7 @@ it('ClusterTriggerBindings renders with one binding', () => {
);

expect(queryByText('ClusterTriggerBindings')).toBeTruthy();
expect(queryByText('No ClusterTriggerBindings')).toBeTruthy();
expect(queryByText('No matching ClusterTriggerBindings found')).toBeTruthy();
expect(queryByText('cluster-trigger-binding')).toBeFalsy();
});

Expand Down Expand Up @@ -176,8 +176,6 @@ it('ClusterTriggerBindings renders in loading state', () => {
);

expect(queryByText(/ClusterTriggerBindings/i)).toBeTruthy();
expect(
queryByText('No ClusterTriggerBindings in any namespace.')
).toBeFalsy();
expect(queryByText('No matching ClusterTriggerBindings found')).toBeFalsy();
expect(queryByText('cluster-trigger-bindings')).toBeFalsy();
});
5 changes: 3 additions & 2 deletions src/containers/Conditions/Conditions.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,15 @@ export class Conditions extends Component {
emptyTextAllNamespaces={intl.formatMessage(
{
id: 'dashboard.emptyState.allNamespaces',
defaultMessage: 'No {kind} in any namespace.'
defaultMessage: 'No matching {kind} found'
},
{ kind: 'Conditions' }
)}
emptyTextSelectedNamespace={intl.formatMessage(
{
id: 'dashboard.emptyState.selectedNamespace',
defaultMessage: 'No {kind} in namespace {selectedNamespace}'
defaultMessage:
'No matching {kind} found in namespace {selectedNamespace}'
},
{ kind: 'Conditions', selectedNamespace }
)}
Expand Down
5 changes: 3 additions & 2 deletions src/containers/EventListeners/EventListeners.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,15 @@ export /* istanbul ignore next */ class EventListeners extends Component {
emptyTextAllNamespaces={intl.formatMessage(
{
id: 'dashboard.emptyState.allNamespaces',
defaultMessage: 'No {kind} in any namespace.'
defaultMessage: 'No matching {kind} found'
},
{ kind: 'EventListeners' }
)}
emptyTextSelectedNamespace={intl.formatMessage(
{
id: 'dashboard.emptyState.selectedNamespace',
defaultMessage: 'No {kind} in namespace {selectedNamespace}'
defaultMessage:
'No matching {kind} found in namespace {selectedNamespace}'
},
{ kind: 'EventListeners', selectedNamespace }
)}
Expand Down
6 changes: 3 additions & 3 deletions src/containers/EventListeners/EventListeners.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ it('EventListeners renders with no bindings', () => {
);

expect(getByText('EventListeners')).toBeTruthy();
expect(getByText('No EventListeners in any namespace.')).toBeTruthy();
expect(getByText('No matching EventListeners found')).toBeTruthy();
});

it('EventListeners renders with one binding', () => {
Expand Down Expand Up @@ -112,7 +112,7 @@ it('EventListeners renders with one binding', () => {
);

expect(queryByText('EventListeners')).toBeTruthy();
expect(queryByText('No EventListeners in any namespace.')).toBeFalsy();
expect(queryByText('No matching EventListeners found')).toBeFalsy();
expect(queryByText('event-listener')).toBeTruthy();
expect(queryByTitle('event-listener')).toBeTruthy();
});
Expand Down Expand Up @@ -177,6 +177,6 @@ it('EventListeners renders in loading state', () => {
);

expect(queryByText(/EventListeners/i)).toBeTruthy();
expect(queryByText('No EventListeners in any namespace.')).toBeFalsy();
expect(queryByText('No matching EventListeners found')).toBeFalsy();
expect(queryByText('event-listeners')).toBeFalsy();
});
2 changes: 1 addition & 1 deletion src/containers/Extensions/Extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const Extensions = /* istanbul ignore next */ ({

const emptyText = intl.formatMessage({
id: 'dashboard.extensions.emptyState',
defaultMessage: 'No extensions'
defaultMessage: 'No extensions found'
});

return (
Expand Down
5 changes: 3 additions & 2 deletions src/containers/Pipelines/Pipelines.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,15 @@ export /* istanbul ignore next */ class Pipelines extends Component {
emptyTextAllNamespaces={intl.formatMessage(
{
id: 'dashboard.emptyState.allNamespaces',
defaultMessage: 'No {kind} in any namespace.'
defaultMessage: 'No matching {kind} found'
},
{ kind: 'Pipelines' }
)}
emptyTextSelectedNamespace={intl.formatMessage(
{
id: 'dashboard.emptyState.selectedNamespace',
defaultMessage: 'No {kind} in namespace {selectedNamespace}'
defaultMessage:
'No matching {kind} found in namespace {selectedNamespace}'
},
{ kind: 'Pipelines', selectedNamespace }
)}
Expand Down
2 changes: 1 addition & 1 deletion src/containers/ResourceList/ResourceList.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export class ResourceListContainer extends Component {
const emptyText = intl.formatMessage(
{
id: 'dashboard.resourceList.emptyState',
defaultMessage: 'No resources for type {type}.'
defaultMessage: 'No matching resources found for type {type}'
},
{ type }
);
Expand Down
5 changes: 3 additions & 2 deletions src/containers/Secrets/Secrets.js
Original file line number Diff line number Diff line change
Expand Up @@ -453,14 +453,15 @@ export /* istanbul ignore next */ class Secrets extends Component {
emptyTextAllNamespaces={intl.formatMessage(
{
id: 'dashboard.emptyState.allNamespaces',
defaultMessage: 'No {kind} in any namespace.'
defaultMessage: 'No matching {kind} found'
},
{ kind: 'Secrets' }
)}
emptyTextSelectedNamespace={intl.formatMessage(
{
id: 'dashboard.emptyState.selectedNamespace',
defaultMessage: 'No {kind} in namespace {selectedNamespace}'
defaultMessage:
'No matching {kind} found in namespace {selectedNamespace}'
},
{ kind: 'Secrets', selectedNamespace }
)}
Expand Down
5 changes: 3 additions & 2 deletions src/containers/ServiceAccounts/ServiceAccounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,15 @@ export /* istanbul ignore next */ class ServiceAccounts extends Component {
emptyTextAllNamespaces={intl.formatMessage(
{
id: 'dashboard.emptyState.allNamespaces',
defaultMessage: 'No {kind} in any namespace.'
defaultMessage: 'No matching {kind} found'
},
{ kind: 'ServiceAccounts' }
)}
emptyTextSelectedNamespace={intl.formatMessage(
{
id: 'dashboard.emptyState.selectedNamespace',
defaultMessage: 'No {kind} in namespace {selectedNamespace}'
defaultMessage:
'No matching {kind} found in namespace {selectedNamespace}'
},
{ kind: 'ServiceAccounts', selectedNamespace }
)}
Expand Down
6 changes: 3 additions & 3 deletions src/containers/ServiceAccounts/ServiceAccounts.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ it('ServiceAccounts renders with no bindings', () => {
);

expect(getByText('ServiceAccounts')).toBeTruthy();
expect(getByText('No ServiceAccounts in any namespace.')).toBeTruthy();
expect(getByText('No matching ServiceAccounts found')).toBeTruthy();
});

it('ServiceAccounts renders with one binding', () => {
Expand Down Expand Up @@ -111,7 +111,7 @@ it('ServiceAccounts renders with one binding', () => {
);

expect(queryByText('ServiceAccounts')).toBeTruthy();
expect(queryByText('No ServiceAccounts in any namespace.')).toBeFalsy();
expect(queryByText('No matching ServiceAccounts found')).toBeFalsy();
expect(queryByText('foo-service-account')).toBeTruthy();
});

Expand Down Expand Up @@ -175,5 +175,5 @@ it('ServiceAccounts renders in loading state', () => {
);

expect(queryByText(/ServiceAccounts/i)).toBeTruthy();
expect(queryByText('No ServiceAccounts in any namespace.')).toBeFalsy();
expect(queryByText('No matching ServiceAccounts found')).toBeFalsy();
});
5 changes: 3 additions & 2 deletions src/containers/Tasks/Tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,15 @@ export /* istanbul ignore next */ class Tasks extends Component {
emptyTextAllNamespaces={intl.formatMessage(
{
id: 'dashboard.emptyState.allNamespaces',
defaultMessage: 'No {kind} in any namespace.'
defaultMessage: 'No matching {kind} found'
},
{ kind: 'Tasks' }
)}
emptyTextSelectedNamespace={intl.formatMessage(
{
id: 'dashboard.emptyState.selectedNamespace',
defaultMessage: 'No {kind} in namespace {selectedNamespace}'
defaultMessage:
'No matching {kind} found in namespace {selectedNamespace}'
},
{ kind: 'Tasks', selectedNamespace }
)}
Expand Down
5 changes: 3 additions & 2 deletions src/containers/TriggerBindings/TriggerBindings.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,15 @@ export /* istanbul ignore next */ class TriggerBindings extends Component {
emptyTextAllNamespaces={intl.formatMessage(
{
id: 'dashboard.emptyState.allNamespaces',
defaultMessage: 'No {kind} in any namespace.'
defaultMessage: 'No matching {kind} found'
},
{ kind: 'TriggerBindings' }
)}
emptyTextSelectedNamespace={intl.formatMessage(
{
id: 'dashboard.emptyState.selectedNamespace',
defaultMessage: 'No {kind} in namespace {selectedNamespace}'
defaultMessage:
'No matching {kind} found in namespace {selectedNamespace}'
},
{ kind: 'TriggerBindings', selectedNamespace }
)}
Expand Down
Loading

0 comments on commit 2ed1471

Please sign in to comment.