mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-22 03:14:40 +03:00
Fix html links (#2558)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
parent
29d6c6f722
commit
017e1cc1d7
@ -34,13 +34,7 @@ location.subscribe((loc) => {
|
||||
}
|
||||
})
|
||||
|
||||
export function getPanelURI (
|
||||
component: AnyComponent,
|
||||
_id: string,
|
||||
_class: string,
|
||||
element?: PopupAlignment,
|
||||
rightSection?: AnyComponent
|
||||
): string {
|
||||
export function getPanelURI (component: AnyComponent, _id: string, _class: string, element?: PopupAlignment): string {
|
||||
const panelProps = [component, _id, _class]
|
||||
if (typeof element === 'string') {
|
||||
panelProps.push(element)
|
||||
@ -55,7 +49,7 @@ export function showPanel (
|
||||
element?: PopupAlignment,
|
||||
rightSection?: AnyComponent
|
||||
): void {
|
||||
const newLoc = getPanelURI(component, _id, _class, element, rightSection)
|
||||
const newLoc = getPanelURI(component, _id, _class, element)
|
||||
if (currentLocation === newLoc) {
|
||||
return
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ export function personHTMLPresenter (doc: Doc, control: TriggerControl): string
|
||||
const front = getMetadata(login.metadata.FrontUrl) ?? ''
|
||||
return `<a href="${front}/${workbenchId}/${control.workspace.name}/${contactId}#${view.component.EditDoc}|${
|
||||
person._id
|
||||
}|${person._class}">${formatName(person.name)}</a>`
|
||||
}|${person._class}|content">${formatName(person.name)}</a>`
|
||||
}
|
||||
|
||||
/**
|
||||
@ -94,7 +94,7 @@ export function personTextPresenter (doc: Doc): string {
|
||||
export function organizationHTMLPresenter (doc: Doc, control: TriggerControl): string {
|
||||
const organization = doc as Organization
|
||||
const front = getMetadata(login.metadata.FrontUrl) ?? ''
|
||||
return `<a href="${front}/${workbenchId}/${control.workspace.name}/${contactId}#${view.component.EditDoc}|${organization._id}|${organization._class}">${organization.name}</a>`
|
||||
return `<a href="${front}/${workbenchId}/${control.workspace.name}/${contactId}#${view.component.EditDoc}|${organization._id}|${organization._class}|content">${organization.name}</a>`
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -27,7 +27,7 @@ import { workbenchId } from '@hcengineering/workbench'
|
||||
export async function productHTMLPresenter (doc: Doc, control: TriggerControl): Promise<string> {
|
||||
const product = doc as Product
|
||||
const front = getMetadata(login.metadata.FrontUrl) ?? ''
|
||||
return `<a href="${front}/${workbenchId}/${control.workspace.name}/${inventoryId}/Products/#${view.component.EditDoc}|${product._id}|${product._class}">${product.name}</a>`
|
||||
return `<a href="${front}/${workbenchId}/${control.workspace.name}/${inventoryId}/Products/#${view.component.EditDoc}|${product._id}|${product._class}|content">${product.name}</a>`
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -37,7 +37,7 @@ import { addAssigneeNotification } from '@hcengineering/server-task-resources'
|
||||
export async function leadHTMLPresenter (doc: Doc, control: TriggerControl): Promise<string> {
|
||||
const lead = doc as Lead
|
||||
const front = getMetadata(login.metadata.FrontUrl) ?? ''
|
||||
return `<a href="${front}/${workbenchId}/${control.workspace.name}/${leadId}/${lead.space}/#${view.component.EditDoc}|${lead._id}|${lead._class}">${lead.title}</a>`
|
||||
return `<a href="${front}/${workbenchId}/${control.workspace.name}/${leadId}/${lead.space}/#${view.component.EditDoc}|${lead._id}|${lead._class}|content">${lead.title}</a>`
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -39,7 +39,7 @@ import { workbenchId } from '@hcengineering/workbench'
|
||||
export async function vacancyHTMLPresenter (doc: Doc, control: TriggerControl): Promise<string> {
|
||||
const vacancy = doc as Vacancy
|
||||
const front = getMetadata(login.metadata.FrontUrl) ?? ''
|
||||
return `<a href="${front}/${workbenchId}/${control.workspace.name}/${recruitId}/${vacancy._id}/#${recruit.component.EditVacancy}|${vacancy._id}|${vacancy._class}">${vacancy.name}</a>`
|
||||
return `<a href="${front}/${workbenchId}/${control.workspace.name}/${recruitId}/${vacancy._id}/#${recruit.component.EditVacancy}|${vacancy._id}|${vacancy._class}|content">${vacancy.name}</a>`
|
||||
}
|
||||
|
||||
/**
|
||||
@ -56,7 +56,7 @@ export async function vacancyTextPresenter (doc: Doc): Promise<string> {
|
||||
export async function applicationHTMLPresenter (doc: Doc, control: TriggerControl): Promise<string> {
|
||||
const applicant = doc as Applicant
|
||||
const front = getMetadata(login.metadata.FrontUrl) ?? ''
|
||||
return `<a href="${front}/${workbenchId}/${control.workspace.name}/${recruitId}/${applicant.space}/#${view.component.EditDoc}|${applicant._id}|${applicant._class}">APP-${applicant.number}</a>`
|
||||
return `<a href="${front}/${workbenchId}/${control.workspace.name}/${recruitId}/${applicant.space}/#${view.component.EditDoc}|${applicant._id}|${applicant._class}|content">APP-${applicant.number}</a>`
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -31,7 +31,7 @@ import { workbenchId } from '@hcengineering/workbench'
|
||||
export async function issueHTMLPresenter (doc: Doc, control: TriggerControl): Promise<string> {
|
||||
const issue = doc as Issue
|
||||
const front = getMetadata(login.metadata.FrontUrl) ?? ''
|
||||
return `<a href="${front}/${workbenchId}/${control.workspace.name}/${taskId}/${issue.space}/#${view.component.EditDoc}|${issue._id}|${issue._class}">Task-${issue.number}</a>`
|
||||
return `<a href="${front}/${workbenchId}/${control.workspace.name}/${taskId}/${issue.space}/#${view.component.EditDoc}|${issue._id}|${issue._class}|content">Task-${issue.number}</a>`
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -59,7 +59,7 @@ export async function issueHTMLPresenter (doc: Doc, control: TriggerControl): Pr
|
||||
const issueName = `${team?.identifier ?? '?'}-${issue.number}`
|
||||
|
||||
const front = getMetadata(login.metadata.FrontUrl) ?? ''
|
||||
return `<a href="${front}/${workbenchId}/${control.workspace.name}/${trackerId}/${issue.space}/#${tracker.component.EditIssue}|${issue._id}|${issue._class}">${issueName}</a>`
|
||||
return `<a href="${front}/${workbenchId}/${control.workspace.name}/${trackerId}/${issue.space}/#${tracker.component.EditIssue}|${issue._id}|${issue._class}|content">${issueName}</a>`
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user