Show workspace name in tab title (#1176)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2022-03-19 18:23:12 +07:00 committed by GitHub
parent fea10ad0f8
commit c3ff3db99f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 11 additions and 13 deletions

View File

@ -43,6 +43,7 @@
setMetadataLocalStorage(login.metadata.LoginToken, result.token)
setMetadataLocalStorage(login.metadata.LoginEndpoint, result.endpoint)
setMetadataLocalStorage(login.metadata.LoginEmail, result.email)
setMetadataLocalStorage(login.metadata.CurrentWorkspace, object.workspace)
showPopup(InviteLink, {}, undefined, () => {
navigate({ path: [workbench.component.WorkbenchApp] })
})

View File

@ -77,6 +77,7 @@
setMetadataLocalStorage(login.metadata.LoginToken, result.token)
setMetadataLocalStorage(login.metadata.LoginEndpoint, result.endpoint)
setMetadataLocalStorage(login.metadata.LoginEmail, result.email)
setMetadataLocalStorage(login.metadata.CurrentWorkspace, location.query?.workspace ?? '')
navigate({ path: [workbench.component.WorkbenchApp] })
}
}

View File

@ -35,6 +35,7 @@
setMetadataLocalStorage(login.metadata.LoginToken, result.token)
setMetadataLocalStorage(login.metadata.LoginEndpoint, result.endpoint)
setMetadataLocalStorage(login.metadata.LoginEmail, result.email)
setMetadataLocalStorage(login.metadata.CurrentWorkspace, workspace)
if (navigateUrl !== undefined) {
navigate(JSON.parse(decodeURIComponent(navigateUrl)))
} else {

View File

@ -17,18 +17,6 @@ import type { Plugin, Asset, Metadata } from '@anticrm/platform'
import { plugin } from '@anticrm/platform'
import type { AnyComponent } from '@anticrm/ui'
// /**
// * @public
// */
// export interface LoginInfo {
// email: string
// workspace: string
// server: string
// port: string
// token: string
// secondFactorEnabled: boolean
// }
/**
* @public
*/
@ -44,6 +32,7 @@ export default plugin(loginId, {
LoginToken: '' as Metadata<string>,
LoginEndpoint: '' as Metadata<string>,
LoginEmail: '' as Metadata<string>,
CurrentWorkspace: '' as Metadata<string>,
OverrideLoginToken: '' as Metadata<string>, // debug purposes
OverrideEndpoint: '' as Metadata<string>
},

View File

@ -37,6 +37,7 @@
setMetadataLocalStorage(login.metadata.LoginToken, null)
setMetadataLocalStorage(login.metadata.LoginEndpoint, null)
setMetadataLocalStorage(login.metadata.LoginEmail, null)
setMetadataLocalStorage(login.metadata.CurrentWorkspace, null)
navigate({ path: [login.component.LoginApp] })
}
function selectWorkspace (): void {

View File

@ -56,6 +56,7 @@
setMetadataLocalStorage(login.metadata.LoginToken, null)
setMetadataLocalStorage(login.metadata.LoginEndpoint, null)
setMetadataLocalStorage(login.metadata.LoginEmail, null)
setMetadataLocalStorage(login.metadata.CurrentWorkspace, null)
navigate({ path: [login.component.LoginApp] })
}

View File

@ -18,7 +18,7 @@
import notification, { NotificationStatus } from '@anticrm/notification'
import { NotificationClientImpl } from '@anticrm/notification-resources'
import { IntlString } from '@anticrm/platform'
import { Avatar, createQuery, setClient } from '@anticrm/presentation'
import { Avatar, createQuery, getClient, setClient } from '@anticrm/presentation'
import {
AnyComponent, closePopup,
closeTooltip,

View File

@ -53,6 +53,7 @@ async function connect (): Promise<Client | undefined> {
setMetadataLocalStorage(login.metadata.LoginToken, null)
setMetadataLocalStorage(login.metadata.LoginEndpoint, null)
setMetadataLocalStorage(login.metadata.LoginEmail, null)
setMetadataLocalStorage(login.metadata.CurrentWorkspace, null)
navigate({ path: [login.component.LoginApp], query: { navigateUrl: encodeURIComponent(JSON.stringify(getCurrentLocation())) } })
return
}
@ -82,6 +83,9 @@ async function connect (): Promise<Client | undefined> {
}
}
// Update window title
document.title = [(fetchMetadataLocalStorage(login.metadata.CurrentWorkspace)), 'Platform'].filter(it => it).join(' - ')
return instance
}