mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-23 03:22:19 +03:00
Show workspace name in tab title (#1176)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
fea10ad0f8
commit
c3ff3db99f
@ -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] })
|
||||
})
|
||||
|
@ -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] })
|
||||
}
|
||||
}
|
||||
|
@ -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 {
|
||||
|
@ -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>
|
||||
},
|
||||
|
@ -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 {
|
||||
|
@ -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] })
|
||||
}
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user