mirror of
https://github.com/hcengineering/platform.git
synced 2025-05-03 22:05:06 +00:00
parent
5f294caa1f
commit
608759ad56
@ -7,7 +7,7 @@ import {
|
|||||||
navigate,
|
navigate,
|
||||||
languageStore
|
languageStore
|
||||||
} from '@hcengineering/ui'
|
} from '@hcengineering/ui'
|
||||||
import { type Ref, type Doc, type Class, generateId } from '@hcengineering/core'
|
import { type Ref, type Doc, type Class, generateId, concatLink } from '@hcengineering/core'
|
||||||
import activity, { type ActivityMessage } from '@hcengineering/activity'
|
import activity, { type ActivityMessage } from '@hcengineering/activity'
|
||||||
import {
|
import {
|
||||||
type Channel,
|
type Channel,
|
||||||
@ -19,10 +19,10 @@ import {
|
|||||||
import { type DocNotifyContext, notificationId } from '@hcengineering/notification'
|
import { type DocNotifyContext, notificationId } from '@hcengineering/notification'
|
||||||
import workbench, { type Widget, workbenchId, type LocationData } from '@hcengineering/workbench'
|
import workbench, { type Widget, workbenchId, type LocationData } from '@hcengineering/workbench'
|
||||||
import { classIcon, getObjectLinkId, parseLinkId } from '@hcengineering/view-resources'
|
import { classIcon, getObjectLinkId, parseLinkId } from '@hcengineering/view-resources'
|
||||||
import { getClient } from '@hcengineering/presentation'
|
import presentation, { getClient } from '@hcengineering/presentation'
|
||||||
import view, { encodeObjectURI, decodeObjectURI } from '@hcengineering/view'
|
import view, { encodeObjectURI, decodeObjectURI } from '@hcengineering/view'
|
||||||
import { createWidgetTab, isElementFromSidebar, sidebarStore } from '@hcengineering/workbench-resources'
|
import { createWidgetTab, isElementFromSidebar, sidebarStore } from '@hcengineering/workbench-resources'
|
||||||
import { type Asset, type IntlString, translate } from '@hcengineering/platform'
|
import { type Asset, getMetadata, type IntlString, translate } from '@hcengineering/platform'
|
||||||
import contact from '@hcengineering/contact'
|
import contact from '@hcengineering/contact'
|
||||||
import { get } from 'svelte/store'
|
import { get } from 'svelte/store'
|
||||||
|
|
||||||
@ -113,8 +113,10 @@ export async function getMessageLink (message: ActivityMessage): Promise<string>
|
|||||||
}
|
}
|
||||||
|
|
||||||
const id = encodeURIComponent(encodeObjectURI(_id, _class))
|
const id = encodeURIComponent(encodeObjectURI(_id, _class))
|
||||||
|
const frontUrl = getMetadata(presentation.metadata.FrontUrl)
|
||||||
return `${window.location.protocol}//${window.location.host}/${workbenchId}/${location.path[1]}/${chunterId}/${id}${threadParent}?message=${message._id}`
|
const protocolAndHost = frontUrl ?? `${window.location.protocol}//${window.location.host}`
|
||||||
|
const path = `${workbenchId}/${location.path[1]}/${chunterId}/${id}${threadParent}?message=${message._id}`
|
||||||
|
return concatLink(protocolAndHost, path)
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function chunterSpaceLinkFragmentProvider (doc: ChunterSpace): Promise<Location> {
|
export async function chunterSpaceLinkFragmentProvider (doc: ChunterSpace): Promise<Location> {
|
||||||
|
@ -13,7 +13,9 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { NavLink } from '@hcengineering/presentation'
|
import { concatLink } from '@hcengineering/core'
|
||||||
|
import { getMetadata } from '@hcengineering/platform'
|
||||||
|
import presentation, { NavLink } from '@hcengineering/presentation'
|
||||||
import { trackerId, type Issue, type IssueParentInfo } from '@hcengineering/tracker'
|
import { trackerId, type Issue, type IssueParentInfo } from '@hcengineering/tracker'
|
||||||
import { getCurrentLocation, locationToUrl } from '@hcengineering/ui'
|
import { getCurrentLocation, locationToUrl } from '@hcengineering/ui'
|
||||||
|
|
||||||
@ -26,7 +28,8 @@
|
|||||||
loc.path[2] = trackerId
|
loc.path[2] = trackerId
|
||||||
loc.path[3] = parentInfo.identifier
|
loc.path[3] = parentInfo.identifier
|
||||||
loc.path.length = 4
|
loc.path.length = 4
|
||||||
return `${window.location.origin}${locationToUrl(loc)}`
|
const frontUrl = getMetadata(presentation.metadata.FrontUrl) ?? window.location.origin
|
||||||
|
return concatLink(frontUrl, locationToUrl(loc))
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -16,16 +16,20 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { NavLink } from '@hcengineering/presentation'
|
import presentation, { NavLink } from '@hcengineering/presentation'
|
||||||
import { locationToUrl } from '@hcengineering/ui'
|
import { locationToUrl } from '@hcengineering/ui'
|
||||||
import { Document } from '@hcengineering/controlled-documents'
|
import { Document } from '@hcengineering/controlled-documents'
|
||||||
import { documentRoute } from '../routing/routes/documentRoute'
|
import { documentRoute } from '../routing/routes/documentRoute'
|
||||||
|
import { getMetadata } from '@hcengineering/platform'
|
||||||
|
import { concatLink } from '@hcengineering/core'
|
||||||
|
|
||||||
export let value: Document
|
export let value: Document
|
||||||
|
|
||||||
|
const frontUrl = getMetadata(presentation.metadata.FrontUrl) ?? window.location.origin
|
||||||
|
|
||||||
let href: string | undefined
|
let href: string | undefined
|
||||||
$: {
|
$: {
|
||||||
href = `${window.location.origin}${locationToUrl(documentRoute.build({ id: value._id }))}`
|
href = concatLink(frontUrl, locationToUrl(documentRoute.build({ id: value._id })))
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -13,11 +13,12 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Doc, Hierarchy } from '@hcengineering/core'
|
import { concatLink, Doc, Hierarchy } from '@hcengineering/core'
|
||||||
import { NavLink, getClient } from '@hcengineering/presentation'
|
import presentation, { NavLink, getClient } from '@hcengineering/presentation'
|
||||||
import { AnyComponent, getPanelURI, locationToUrl } from '@hcengineering/ui'
|
import { AnyComponent, getPanelURI, locationToUrl } from '@hcengineering/ui'
|
||||||
import view from '../plugin'
|
import view from '../plugin'
|
||||||
import { getObjectLinkFragment, restrictionStore } from '../utils'
|
import { getObjectLinkFragment, restrictionStore } from '../utils'
|
||||||
|
import { getMetadata } from '@hcengineering/platform'
|
||||||
|
|
||||||
export let object: Doc | undefined
|
export let object: Doc | undefined
|
||||||
export let disabled: boolean = false
|
export let disabled: boolean = false
|
||||||
@ -50,7 +51,8 @@
|
|||||||
const panelComponent = hierarchy.classHierarchyMixin(object._class, view.mixin.ObjectPanel)
|
const panelComponent = hierarchy.classHierarchyMixin(object._class, view.mixin.ObjectPanel)
|
||||||
const comp = panelComponent?.component ?? component
|
const comp = panelComponent?.component ?? component
|
||||||
const loc = await getObjectLinkFragment(hierarchy, object, props, comp)
|
const loc = await getObjectLinkFragment(hierarchy, object, props, comp)
|
||||||
href = `${window.location.origin}${locationToUrl(loc)}`
|
const frontUrl = getMetadata(presentation.metadata.FrontUrl) ?? window.location.origin
|
||||||
|
href = concatLink(frontUrl, locationToUrl(loc))
|
||||||
}
|
}
|
||||||
|
|
||||||
$: if (object !== undefined) getHref(object)
|
$: if (object !== undefined) getHref(object)
|
||||||
|
Loading…
Reference in New Issue
Block a user