1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-09 15:55:23 +02:00

fix(ui/datatables): make empty table label consistent [EE-6499] (#11612)

This commit is contained in:
Chaim Lev-Ari 2024-06-02 12:29:20 +03:00 committed by GitHub
parent 02fbdfec36
commit b7cde35c3d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
56 changed files with 45 additions and 93 deletions

View file

@ -60,7 +60,6 @@ export function AccessDatatable({
roles: rolesState,
})}
isRowSelectable={({ original: item }) => !inheritFrom || !item.Inherited}
emptyContentLabel="No authorized users or teams."
renderTableActions={(selectedItems) => (
<>
<RemoveAccessButton items={selectedItems} onClick={onRemove} />

View file

@ -70,7 +70,6 @@ export function HelmRepositoryDatatable() {
renderTableActions={(selectedRows) => (
<HelmRepositoryDatatableActions selectedItems={selectedRows} />
)}
emptyContentLabel="No Helm repository found"
isLoading={helmReposQuery.isLoading}
isRowSelectable={(row) => !row.original.Global}
data-cy="helm-repositories-datatable"

View file

@ -36,7 +36,6 @@ export function TagsDatatable({
dataset={dataset || []}
columns={columns}
isLoading={!dataset}
emptyContentLabel="No tag available."
settingsManager={tableState}
renderTableActions={(selectedItems) => (
<DeleteButton

View file

@ -25,7 +25,6 @@ export function AssociatedEnvironmentsSelector({
<div className="w-1/2">
<GroupAssociationTable
title="Available environments"
emptyContentLabel="No environment available"
query={{
groupIds: [1],
excludeIds: value,
@ -41,7 +40,6 @@ export function AssociatedEnvironmentsSelector({
<div className="w-1/2">
<GroupAssociationTable
title="Associated environments"
emptyContentLabel="No associated environment'"
query={{
endpointIds: value,
}}

View file

@ -23,13 +23,11 @@ const columns = [
export function GroupAssociationTable({
title,
query,
emptyContentLabel,
onClickRow,
'data-cy': dataCy,
}: {
title: string;
query: EnvironmentsQueryParams;
emptyContentLabel: string;
onClickRow?: (env: Environment) => void;
} & AutomationTestingProps) {
const tableState = useTableStateWithoutStorage('Name');
@ -61,7 +59,6 @@ export function GroupAssociationTable({
onClick={onClickRow ? () => onClickRow(row.original) : undefined}
/>
)}
emptyContentLabel={emptyContentLabel}
data-cy={dataCy}
disableSelect
/>

View file

@ -70,7 +70,6 @@ export function ListView() {
settingsManager={tableState}
title="Update & rollback"
titleIcon={Clock}
emptyContentLabel="No schedules found"
isLoading={listQuery.isLoading}
renderTableActions={(selectedRows) => (
<TableActions selectedRows={selectedRows} />

View file

@ -47,7 +47,6 @@ export function NotificationsView() {
titleIcon={Bell}
dataset={userNotifications}
settingsManager={tableState}
emptyContentLabel="No notifications found"
renderTableActions={(selectedRows) => (
<TableActions selectedRows={selectedRows} />
)}

View file

@ -38,7 +38,6 @@ export function GitlabProjectTable({
columns={columns}
dataset={dataset}
settingsManager={tableState}
emptyContentLabel="No projects available."
title="Gitlab projects"
titleIcon={ListIcon}
extendTableOptions={withControlledSelected(

View file

@ -35,7 +35,6 @@ export function TagsDatatable({
dataset={dataset || []}
isLoading={!dataset}
settingsManager={tableState}
emptyContentLabel="No tags available."
renderTableActions={(selectedItems) =>
advancedFeaturesAvailable && (
<DeleteButton

View file

@ -16,7 +16,6 @@ export function RepositoriesDatatable({ dataset }: { dataset?: Repository[] }) {
dataset={dataset || []}
isLoading={!dataset}
settingsManager={tableState}
emptyContentLabel="No repository available."
disableSelect
data-cy="registry-repositories-datatable"
/>

View file

@ -22,7 +22,6 @@ export function LDAPGroupsTable({ dataset }: { dataset?: Value[] }) {
title="Groups"
titleIcon={Users}
settingsManager={tableState}
emptyContentLabel="No groups found."
disableSelect
data-cy="ldap-groups-datatable"
/>

View file

@ -21,7 +21,6 @@ export function LDAPUsersTable({ dataset }: { dataset?: string[] }) {
title="Users"
titleIcon={Users}
settingsManager={tableState}
emptyContentLabel="No users found."
disableSelect
data-cy="ldap-users-datatable"
/>

View file

@ -31,7 +31,6 @@ export function FDOProfilesDatatable({
title="Device Profiles"
titleIcon={List}
disableSelect={!isFDOEnabled}
emptyContentLabel="No profiles found"
getRowId={(row) => row.id.toString()}
isLoading={isLoading}
renderTableActions={(selectedItems) => (

View file

@ -12,6 +12,14 @@ export function EffectiveAccessViewerDatatable({
}) {
const tableState = useTableStateWithStorage('access-viewer', 'Environment');
if (dataset?.length === 0) {
return (
<TextTip color="blue">
The selected user does not have access to any environments.
</TextTip>
);
}
return (
<Datatable
dataset={dataset || []}
@ -22,14 +30,9 @@ export function EffectiveAccessViewerDatatable({
description={
<TextTip color="blue">
Effective role for each environment will be displayed for the selected
user
user.
</TextTip>
}
emptyContentLabel={
dataset
? 'The selected user does not have access to any environment(s)'
: 'Select a user to show associated access and role'
}
disableSelect
data-cy="effective-access-viewer-datatable"
/>

View file

@ -34,7 +34,6 @@ export function RbacRolesDatatable({
dataset={dataset || []}
columns={columns}
isLoading={!dataset}
emptyContentLabel="No role available."
settingsManager={tableState}
disableSelect
data-cy="rbac-roles-datatable"

View file

@ -47,7 +47,6 @@ export function TeamsDatatable({ teams, isAdmin }: Props) {
/>
)
}
emptyContentLabel="No teams found"
data-cy="teams-datatable"
/>
);