|
@@ -1,4 +1,4 @@
|
|
|
-import { useState } from 'react'
|
|
|
|
|
|
|
+import { useState, useRef, useEffect } from 'react'
|
|
|
import { useTranslation } from 'react-i18next'
|
|
import { useTranslation } from 'react-i18next'
|
|
|
import { User } from '../../../../../../types/group-management/user'
|
|
import { User } from '../../../../../../types/group-management/user'
|
|
|
import { useGroupMembersContext } from '../../context/group-members-context'
|
|
import { useGroupMembersContext } from '../../context/group-members-context'
|
|
@@ -28,6 +28,14 @@ export default function MembersList({ groupId }: ManagedUsersListProps) {
|
|
|
const { users } = useGroupMembersContext()
|
|
const { users } = useGroupMembersContext()
|
|
|
const managedUsersActive = getMeta('ol-managedUsersActive')
|
|
const managedUsersActive = getMeta('ol-managedUsersActive')
|
|
|
const groupSSOActive = getMeta('ol-groupSSOActive')
|
|
const groupSSOActive = getMeta('ol-groupSSOActive')
|
|
|
|
|
+ const tHeadRowRef = useRef<HTMLTableRowElement>(null)
|
|
|
|
|
+ const [colSpan, setColSpan] = useState(0)
|
|
|
|
|
+
|
|
|
|
|
+ useEffect(() => {
|
|
|
|
|
+ if (tHeadRowRef.current) {
|
|
|
|
|
+ setColSpan(tHeadRowRef.current.querySelectorAll('th').length)
|
|
|
|
|
+ }
|
|
|
|
|
+ }, [])
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
|
<div>
|
|
<div>
|
|
@@ -53,7 +61,7 @@ export default function MembersList({ groupId }: ManagedUsersListProps) {
|
|
|
data-testid="managed-entities-table"
|
|
data-testid="managed-entities-table"
|
|
|
>
|
|
>
|
|
|
<thead>
|
|
<thead>
|
|
|
- <tr>
|
|
|
|
|
|
|
+ <tr ref={tHeadRowRef}>
|
|
|
<SelectAllCheckbox />
|
|
<SelectAllCheckbox />
|
|
|
<th className="cell-email">{t('email')}</th>
|
|
<th className="cell-email">{t('email')}</th>
|
|
|
<th className="cell-name">{t('name')}</th>
|
|
<th className="cell-name">{t('name')}</th>
|
|
@@ -83,7 +91,7 @@ export default function MembersList({ groupId }: ManagedUsersListProps) {
|
|
|
<tbody>
|
|
<tbody>
|
|
|
{users.length === 0 && (
|
|
{users.length === 0 && (
|
|
|
<tr>
|
|
<tr>
|
|
|
- <td className="text-center" colSpan={4}>
|
|
|
|
|
|
|
+ <td className="text-center" colSpan={colSpan}>
|
|
|
<small>{t('no_members')}</small>
|
|
<small>{t('no_members')}</small>
|
|
|
</td>
|
|
</td>
|
|
|
</tr>
|
|
</tr>
|