diff --git a/services/web/frontend/stylesheets/modules/admin-tools/manage-projects-page.scss b/services/web/frontend/stylesheets/modules/admin-tools/manage-projects-page.scss new file mode 100644 index 0000000000..358047669b --- /dev/null +++ b/services/web/frontend/stylesheets/modules/admin-tools/manage-projects-page.scss @@ -0,0 +1,7 @@ +.project-ds-nav-page { + .manage-projects-page { + .nav-item-projects { + display: initial !important; + } + } +} diff --git a/services/web/frontend/stylesheets/modules/all.scss b/services/web/frontend/stylesheets/modules/all.scss index 73c4982388..a98ccb6122 100644 --- a/services/web/frontend/stylesheets/modules/all.scss +++ b/services/web/frontend/stylesheets/modules/all.scss @@ -11,3 +11,4 @@ @import 'labs'; @import 'admin-tools/user-list'; @import 'admin-tools/user-list-ds-nav'; +@import 'admin-tools/manage-projects-page'; diff --git a/services/web/modules/admin-tools/app/src/UserListController.mjs b/services/web/modules/admin-tools/app/src/UserListController.mjs index 7b70dc217a..8b775d8235 100644 --- a/services/web/modules/admin-tools/app/src/UserListController.mjs +++ b/services/web/modules/admin-tools/app/src/UserListController.mjs @@ -290,8 +290,8 @@ function _sortAndPaginate(users, sort, page) { function _formatUserInfo(user, maxDate) { let authMethods = [] if (availableAuthMethods.includes('local') && user.hashedPassword) authMethods.push('local') - if (availableAuthMethods.includes('saml') && user.samlIdentifiers.length > 0) authMethods.push('saml') - if (availableAuthMethods.includes('oidc') && user.thirdPartyIdentifiers.length > 0) authMethods.push('oidc') + if (availableAuthMethods.includes('saml') && user.samlIdentifiers?.length) authMethods.push('saml') + if (availableAuthMethods.includes('oidc') && user.thirdPartyIdentifiers?.length) authMethods.push('oidc') // If none of the above, mark as LDAP if (availableAuthMethods.includes('ldap') && authMethods.length === 0 && user.loginCount !== 0) authMethods.push('ldap') diff --git a/services/web/modules/admin-tools/frontend/js/project-list/components/project-list-ds-nav.tsx b/services/web/modules/admin-tools/frontend/js/project-list/components/project-list-ds-nav.tsx index 6b3e84c128..d4f4a0a78c 100644 --- a/services/web/modules/admin-tools/frontend/js/project-list/components/project-list-ds-nav.tsx +++ b/services/web/modules/admin-tools/frontend/js/project-list/components/project-list-ds-nav.tsx @@ -56,11 +56,13 @@ export function ProjectListDsNav() { return (
- +
+ +
diff --git a/services/web/modules/admin-tools/frontend/js/user-list/components/modals/show-user-info-modal.tsx b/services/web/modules/admin-tools/frontend/js/user-list/components/modals/show-user-info-modal.tsx index 7d893ac405..d46c2ae0aa 100644 --- a/services/web/modules/admin-tools/frontend/js/user-list/components/modals/show-user-info-modal.tsx +++ b/services/web/modules/admin-tools/frontend/js/user-list/components/modals/show-user-info-modal.tsx @@ -42,7 +42,8 @@ function ShowUserInfoModal({ const user = users[0] const [activationLink, setActivationLink] = useState(null) - const [copied, setCopied] = useState(false) + const [copiedId, setCopiedId] = useState(false) + const [copiedActivationLink, setCopiedActivationLink] = useState(false) useEffect(() => { if (!showModal) return @@ -56,22 +57,22 @@ function ShowUserInfoModal({ }) }, [showModal, user.id]) - const handleCopy = () => { - if (!activationLink) return + const markCopied = (setter: React.Dispatch>) => { + setter(true) + setTimeout(() => setter(false), 1500) + } - const markCopied = () => { - setCopied(true) - setTimeout(() => setCopied(false), 1500) - } + const handleCopy = (text: string, setter: React.Dispatch>) => { + if (!text) return if (navigator.clipboard?.writeText) { - navigator.clipboard.writeText(activationLink).then(markCopied) + navigator.clipboard.writeText(text).then(() => markCopied(setter)) return } // fallback for older browsers const tempInput = document.createElement('input') - tempInput.value = activationLink + tempInput.value = text tempInput.style.position = 'fixed' tempInput.style.opacity = '0' document.body.appendChild(tempInput) @@ -79,7 +80,7 @@ function ShowUserInfoModal({ document.execCommand('copy') document.body.removeChild(tempInput) - markCopied() + markCopied(setter) } return ( @@ -95,7 +96,22 @@ function ShowUserInfoModal({ <> {t('Account')} - + handleCopy(user.id, setCopiedId)} + > + {user.id} + {copiedId && ( + + ({t('copied')}) + + )} + + } + /> @@ -111,15 +127,15 @@ function ShowUserInfoModal({ /> )} {activationLink && ( - handleCopy(activationLink, setCopiedActivationLink)} > {activationLink} - {copied && ( + {copiedActivationLink && ( ({t('copied')}) @@ -171,4 +187,3 @@ function ShowUserInfoModal({ } export default ShowUserInfoModal -