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:
parent
02fbdfec36
commit
b7cde35c3d
56 changed files with 45 additions and 93 deletions
|
@ -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} />
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -36,7 +36,6 @@ export function TagsDatatable({
|
|||
dataset={dataset || []}
|
||||
columns={columns}
|
||||
isLoading={!dataset}
|
||||
emptyContentLabel="No tag available."
|
||||
settingsManager={tableState}
|
||||
renderTableActions={(selectedItems) => (
|
||||
<DeleteButton
|
||||
|
|
|
@ -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,
|
||||
}}
|
||||
|
|
|
@ -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
|
||||
/>
|
||||
|
|
|
@ -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} />
|
||||
|
|
|
@ -47,7 +47,6 @@ export function NotificationsView() {
|
|||
titleIcon={Bell}
|
||||
dataset={userNotifications}
|
||||
settingsManager={tableState}
|
||||
emptyContentLabel="No notifications found"
|
||||
renderTableActions={(selectedRows) => (
|
||||
<TableActions selectedRows={selectedRows} />
|
||||
)}
|
||||
|
|
|
@ -38,7 +38,6 @@ export function GitlabProjectTable({
|
|||
columns={columns}
|
||||
dataset={dataset}
|
||||
settingsManager={tableState}
|
||||
emptyContentLabel="No projects available."
|
||||
title="Gitlab projects"
|
||||
titleIcon={ListIcon}
|
||||
extendTableOptions={withControlledSelected(
|
||||
|
|
|
@ -35,7 +35,6 @@ export function TagsDatatable({
|
|||
dataset={dataset || []}
|
||||
isLoading={!dataset}
|
||||
settingsManager={tableState}
|
||||
emptyContentLabel="No tags available."
|
||||
renderTableActions={(selectedItems) =>
|
||||
advancedFeaturesAvailable && (
|
||||
<DeleteButton
|
||||
|
|
|
@ -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"
|
||||
/>
|
||||
|
|
|
@ -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"
|
||||
/>
|
||||
|
|
|
@ -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"
|
||||
/>
|
||||
|
|
|
@ -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) => (
|
||||
|
|
|
@ -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"
|
||||
/>
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -47,7 +47,6 @@ export function TeamsDatatable({ teams, isAdmin }: Props) {
|
|||
/>
|
||||
)
|
||||
}
|
||||
emptyContentLabel="No teams found"
|
||||
data-cy="teams-datatable"
|
||||
/>
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue