mirror of
https://github.com/hcengineering/platform.git
synced 2026-08-26 06:12:23 +02:00
UBER-532: Copy issue URL works wrong (#3529)
Signed-off-by: Maxim Karmatskikh <mkarmatskih@gmail.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { copyTextToClipboard, createQuery } from '@hcengineering/presentation'
|
||||
import presentation, { copyTextToClipboard, createQuery } from '@hcengineering/presentation'
|
||||
import { getMetadata } from '@hcengineering/platform'
|
||||
import { Issue, IssueStatus } from '@hcengineering/tracker'
|
||||
import view from '@hcengineering/view'
|
||||
import {
|
||||
@@ -77,8 +78,9 @@
|
||||
const handleIssueOpened = () => {
|
||||
if (params?.issueUrl) {
|
||||
const url = new URL(params?.issueUrl)
|
||||
const frontUrl = getMetadata(presentation.metadata.FrontUrl) ?? window.location.origin
|
||||
|
||||
if (url.origin === window.location.origin) {
|
||||
if (url.origin === frontUrl) {
|
||||
navigate(parseLocation(url))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Doc, DocumentUpdate, Ref, RelatedDocument, TxOperations } from '@hcengineering/core'
|
||||
import { getClient } from '@hcengineering/presentation'
|
||||
import presentation, { getClient } from '@hcengineering/presentation'
|
||||
import { getMetadata } from '@hcengineering/platform'
|
||||
import { Component, Issue, Project, Milestone, trackerId } from '@hcengineering/tracker'
|
||||
import { Location, ResolvedLocation, getPanelURI, getCurrentResolvedLocation } from '@hcengineering/ui'
|
||||
import { workbenchId } from '@hcengineering/workbench'
|
||||
@@ -64,7 +65,9 @@ export async function issueLinkProvider (doc: Doc): Promise<string> {
|
||||
|
||||
export function generateIssueShortLink (issueId: string): string {
|
||||
const location = getCurrentResolvedLocation()
|
||||
return `${window.location.protocol}//${window.location.host}/${workbenchId}/${location.path[1]}/${trackerId}/${issueId}`
|
||||
const frontUrl = getMetadata(presentation.metadata.FrontUrl)
|
||||
const protocolAndHost = frontUrl ?? `${window.location.protocol}//${window.location.host}`
|
||||
return `${protocolAndHost}/${workbenchId}/${location.path[1]}/${trackerId}/${issueId}`
|
||||
}
|
||||
|
||||
export async function generateIssueLocation (loc: Location, issueId: string): Promise<ResolvedLocation | undefined> {
|
||||
|
||||
Reference in New Issue
Block a user