diff --git a/ui/cypress/integration/admin.test.ts b/ui/cypress/integration/admin.test.ts index 6680507d4..f0dfc2cf5 100644 --- a/ui/cypress/integration/admin.test.ts +++ b/ui/cypress/integration/admin.test.ts @@ -238,15 +238,6 @@ describe('Use Admin tab', () => { }) it('create a role, edit it, assign it to a user, and delete it', () => { - cy.getByTestID('admin-table--head').within(() => { - cy.get('th').contains('Users').should('exist') - }) - - cy.getByTestID('hide-users--toggle').click() - cy.getByTestID('admin-table--head').within(() => { - cy.get('th').contains('Users').should('not.exist') - }) - cy.getByTestID(`role-${influxDB.role.name}--row`).should('not.exist') cy.getByTestID('create-role--button').click({force: true}) cy.getByTestID('dismiss-button').click() diff --git a/ui/src/admin/components/EmptyRow.tsx b/ui/src/admin/components/EmptyRow.tsx deleted file mode 100644 index 7c8faddff..000000000 --- a/ui/src/admin/components/EmptyRow.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import React, {FunctionComponent} from 'react' - -interface Props { - entities: string - colSpan?: number - filtered?: boolean -} -const EmptyRow: FunctionComponent = ({entities, colSpan, filtered}) => ( - - - {filtered ? ( -

No Matching {entities}

- ) : ( -

- You don't have any {entities},
- why not create one? -

- )} - - -) - -export default EmptyRow diff --git a/ui/src/admin/components/influxdb/NoEntities.tsx b/ui/src/admin/components/influxdb/NoEntities.tsx new file mode 100644 index 000000000..81093f436 --- /dev/null +++ b/ui/src/admin/components/influxdb/NoEntities.tsx @@ -0,0 +1,17 @@ +import React, {FunctionComponent} from 'react' + +interface Props { + entities: string + filtered?: boolean +} +const NoEntities: FunctionComponent = ({entities, filtered}) => + filtered ? ( +

No Matching {entities} Found

+ ) : ( +

+ You don't have any {entities},
+ why not create one? +

+ ) + +export default NoEntities diff --git a/ui/src/admin/containers/influxdb/RolesPage.tsx b/ui/src/admin/containers/influxdb/RolesPage.tsx index eb462ddcc..a45b0da0c 100644 --- a/ui/src/admin/containers/influxdb/RolesPage.tsx +++ b/ui/src/admin/containers/influxdb/RolesPage.tsx @@ -18,7 +18,7 @@ import AdminInfluxDBTabbedPage, { isConnectedToLDAP, } from './AdminInfluxDBTabbedPage' import FancyScrollbar from 'src/shared/components/FancyScrollbar' -import EmptyRow from 'src/admin/components/EmptyRow' +import NoEntities from 'src/admin/components/influxdb/NoEntities' import RoleRow from 'src/admin/components/RoleRow' import {useCallback} from 'react' import allOrParticularSelection from '../../util/allOrParticularSelection' @@ -207,30 +207,30 @@ const RolesPage = ({
- - - - - - {showUsers && ( - - )} - {visibleRoles.length && visibleDBNames.length - ? visibleDBNames.map(name => ( - - )) - : null} - - - - {visibleRoles.length ? ( - visibleRoles.map((role, roleIndex) => ( + {visibleRoles.length ? ( + +
RoleUsers - {name} -
+ + + + {showUsers && ( + + )} + {visibleDBNames.length + ? visibleDBNames.map(name => ( + + )) + : null} + + + + {visibleRoles.map((role, roleIndex) => ( - )) - ) : ( - - )} - -
RoleUsers + {name} +
-
+ ))} + + + + ) : ( + + )}
diff --git a/ui/src/admin/containers/influxdb/UsersPage.tsx b/ui/src/admin/containers/influxdb/UsersPage.tsx index edd4d373a..0c69b4013 100644 --- a/ui/src/admin/containers/influxdb/UsersPage.tsx +++ b/ui/src/admin/containers/influxdb/UsersPage.tsx @@ -18,7 +18,7 @@ import AdminInfluxDBTabbedPage, { isConnectedToLDAP, } from './AdminInfluxDBTabbedPage' import FancyScrollbar from 'src/shared/components/FancyScrollbar' -import EmptyRow from 'src/admin/components/EmptyRow' +import NoEntities from 'src/admin/components/influxdb/NoEntities' import UserRow from 'src/admin/components/UserRow' import useDebounce from 'src/utils/useDebounce' import useChangeEffect from 'src/utils/useChangeEffect' @@ -218,32 +218,32 @@ const UsersPage = ({
- - - - - - {showRoles && ( - - )} - {visibleUsers.length && visibleDBNames.length - ? visibleDBNames.map(name => ( - - )) - : null} - - - - {visibleUsers.length ? ( - visibleUsers.map((user, userIndex) => ( + {visibleUsers.length ? ( + +
User - {isEnterprise ? 'Roles' : 'Admin'} - - {name} -
+ + + + {showRoles && ( + + )} + {visibleDBNames.length + ? visibleDBNames.map(name => ( + + )) + : null} + + + + {visibleUsers.map((user, userIndex) => ( - )) - ) : ( - - )} - -
User + {isEnterprise ? 'Roles' : 'Admin'} + + {name} +
-
+ ))} + + + + ) : ( + + )}
diff --git a/ui/src/style/pages/admin.scss b/ui/src/style/pages/admin.scss index e201c05d6..ef5b93753 100644 --- a/ui/src/style/pages/admin.scss +++ b/ui/src/style/pages/admin.scss @@ -153,6 +153,12 @@ pre.admin-table--query { padding: 0 30px; min-height: 60px; } + p.empty { + font-weight: 400; + font-size: 18px; + color: $g9-mountain; + } + .influxdb-admin--contents{ height: calc(100%-60px); }