@ -6,8 +6,9 @@
* It can be instantiated by calling showUserManagerModal with the UserAPI and IUserManagerOptions .
* /
import { makeT } from 'app/client/lib/localization' ;
import { commonUrls } from 'app/common/gristUrls' ;
import { commonUrls , isOrgInPathOnly } from 'app/common/gristUrls' ;
import { capitalizeFirstWord , isLongerThan } from 'app/common/gutil' ;
import { getGristConfig } from 'app/common/urlUtils' ;
import { FullUser } from 'app/common/LoginSessionAPI' ;
import * as roles from 'app/common/roles' ;
import { Organization , PermissionData , UserAPI } from 'app/common/UserAPI' ;
@ -816,15 +817,25 @@ const cssMemberPublicAccess = styled(cssMemberSecondary, `
function renderTitle ( resourceType : ResourceType , resource? : Resource , personal? : boolean ) {
switch ( resourceType ) {
case 'organization' : {
if ( personal ) { return t ( 'Your role for this team site' ) ; }
return [
t ( 'Manage members of team site' ) ,
! resource ? null : cssOrgName (
` ${ ( resource as Organization ) . name } ( ` ,
cssOrgDomain ( ` ${ ( resource as Organization ) . domain } .getgrist.com ` ) ,
')' ,
)
] ;
if ( personal ) {
return t ( 'Your role for this team site' ) ;
}
function getOrgDisplay() {
if ( ! resource ) {
return null ;
}
const org = resource as Organization ;
const gristConfig = getGristConfig ( ) ;
const gristHomeHost = gristConfig . homeUrl ? new URL ( gristConfig . homeUrl ) . host : '' ;
const baseDomain = gristConfig . baseDomain || gristHomeHost ;
const orgDisplay = isOrgInPathOnly ( ) ? ` ${ baseDomain } /o/ ${ org . domain } ` : ` ${ org . domain } ${ baseDomain } ` ;
return cssOrgName ( ` ${ org . name } ( ` , cssOrgDomain ( orgDisplay ) , ')' ) ;
}
return [ t ( 'Manage members of team site' ) , getOrgDisplay ( ) ] ;
}
default : {
return personal ?