mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-22 01:25:00 +02:00
TSK-833 Доработка Таблицы Vacations TSK-817 Click on Employee is broken, it should open Edit Contact TSK-805 Открывать задачу в новой вкладке при клике колесиком TSK-794 Прикрепление ссылки на вакансию/аппликейшн в чате (#2734)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
@@ -16,7 +16,8 @@
|
||||
import { Ref, WithLookup } from '@hcengineering/core'
|
||||
import { createQuery } from '@hcengineering/presentation'
|
||||
import type { Issue, Team } from '@hcengineering/tracker'
|
||||
import { Icon, showPanel, tooltip } from '@hcengineering/ui'
|
||||
import { Icon, tooltip } from '@hcengineering/ui'
|
||||
import { DocNavLink } from '@hcengineering/view-resources'
|
||||
import tracker from '../../plugin'
|
||||
|
||||
export let value: WithLookup<Issue>
|
||||
@@ -29,18 +30,6 @@
|
||||
// Extra properties
|
||||
export let teams: Map<Ref<Team>, Team> | undefined = undefined
|
||||
|
||||
function handleIssueEditorOpened () {
|
||||
if (disableClick) {
|
||||
return
|
||||
}
|
||||
|
||||
if (onClick) {
|
||||
onClick()
|
||||
}
|
||||
|
||||
showPanel(tracker.component.EditIssue, value._id, value._class, 'content')
|
||||
}
|
||||
|
||||
const spaceQuery = createQuery()
|
||||
let currentTeam: Team | undefined = value?.$lookup?.space
|
||||
|
||||
@@ -58,23 +47,18 @@
|
||||
</script>
|
||||
|
||||
{#if value}
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
<span
|
||||
class="issuePresenterRoot"
|
||||
class:noPointer={disableClick}
|
||||
class:noUnderline
|
||||
class:inline
|
||||
on:click={handleIssueEditorOpened}
|
||||
>
|
||||
{#if withIcon}
|
||||
<div class="icon" use:tooltip={{ label: tracker.string.Issue }}>
|
||||
<Icon icon={tracker.icon.Issues} size={'small'} />
|
||||
</div>
|
||||
{/if}
|
||||
<span class="select-text" title={value?.title}>
|
||||
{title}
|
||||
<DocNavLink object={value} {onClick} {disableClick} {noUnderline} {inline} component={tracker.component.EditIssue}>
|
||||
<span class="issuePresenterRoot" class:inline>
|
||||
{#if withIcon}
|
||||
<div class="icon" use:tooltip={{ label: tracker.string.Issue }}>
|
||||
<Icon icon={tracker.icon.Issues} size={'small'} />
|
||||
</div>
|
||||
{/if}
|
||||
<span class="select-text" title={value?.title}>
|
||||
{title}
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
</DocNavLink>
|
||||
{/if}
|
||||
|
||||
<style lang="scss">
|
||||
@@ -106,28 +90,5 @@
|
||||
color: var(--accent-color);
|
||||
}
|
||||
}
|
||||
&.noPointer {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
&.noUnderline {
|
||||
color: var(--caption-color);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
&:not(.noUnderline) {
|
||||
&:hover {
|
||||
color: var(--caption-color);
|
||||
text-decoration: underline;
|
||||
|
||||
.icon {
|
||||
color: var(--caption-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&:active {
|
||||
color: var(--accent-color);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -13,59 +13,44 @@
|
||||
// limitations under the License.
|
||||
-->
|
||||
<script lang="ts">
|
||||
import { WithLookup } from '@hcengineering/core'
|
||||
import type { Issue } from '@hcengineering/tracker'
|
||||
import { showPanel } from '@hcengineering/ui'
|
||||
import { DocNavLink } from '@hcengineering/view-resources'
|
||||
import tracker from '../../plugin'
|
||||
import ParentNamesPresenter from './ParentNamesPresenter.svelte'
|
||||
|
||||
export let value: Issue
|
||||
export let value: WithLookup<Issue>
|
||||
export let shouldUseMargin: boolean = false
|
||||
export let showParent = true
|
||||
export let onClick: (() => void) | undefined = undefined
|
||||
|
||||
function handleIssueEditorOpened () {
|
||||
if (onClick) {
|
||||
onClick()
|
||||
}
|
||||
|
||||
showPanel(tracker.component.EditIssue, value._id, value._class, 'content')
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if value}
|
||||
<span class="titlePresenter-container" class:with-margin={shouldUseMargin} title={value.title}>
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
<DocNavLink object={value} {onClick} component={tracker.component.EditIssue}>
|
||||
<span
|
||||
class="name overflow-label cursor-pointer select-text"
|
||||
style:max-width={showParent ? `${value.parents.length !== 0 ? 95 : 100}%` : '100%'}
|
||||
on:click={handleIssueEditorOpened}>{value.title}</span
|
||||
class="name overflow-label select-text"
|
||||
class:with-margin={shouldUseMargin}
|
||||
style:max-width={showParent ? `${value.parents.length !== 0 ? 95 : 100}%` : '100%'}>{value.title}</span
|
||||
>
|
||||
{#if showParent}
|
||||
<ParentNamesPresenter {value} />
|
||||
{/if}
|
||||
</span>
|
||||
</DocNavLink>
|
||||
{/if}
|
||||
|
||||
<style lang="scss">
|
||||
.titlePresenter-container {
|
||||
display: flex;
|
||||
flex-grow: 0;
|
||||
min-width: 1.5rem;
|
||||
// flex-shrink: 10;
|
||||
|
||||
.name {
|
||||
flex-shrink: 0;
|
||||
&:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
&:active {
|
||||
color: var(--accent-color);
|
||||
}
|
||||
.name {
|
||||
flex-shrink: 0;
|
||||
&:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
&.with-margin {
|
||||
margin-left: 0.5rem;
|
||||
&:active {
|
||||
color: var(--accent-color);
|
||||
}
|
||||
}
|
||||
|
||||
.with-margin {
|
||||
margin-left: 0.5rem;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -28,7 +28,6 @@ import { getClient, MessageBox, ObjectSearchResult } from '@hcengineering/presen
|
||||
import { Issue, Scrum, ScrumRecord, Sprint, Team } from '@hcengineering/tracker'
|
||||
import { showPopup } from '@hcengineering/ui'
|
||||
import CreateIssue from './components/CreateIssue.svelte'
|
||||
import CreateIssueTemplate from './components/templates/CreateIssueTemplate.svelte'
|
||||
import Inbox from './components/inbox/Inbox.svelte'
|
||||
import Active from './components/issues/Active.svelte'
|
||||
import AssigneePresenter from './components/issues/AssigneePresenter.svelte'
|
||||
@@ -42,9 +41,11 @@ import Issues from './components/issues/Issues.svelte'
|
||||
import IssuesView from './components/issues/IssuesView.svelte'
|
||||
import KanbanView from './components/issues/KanbanView.svelte'
|
||||
import ModificationDatePresenter from './components/issues/ModificationDatePresenter.svelte'
|
||||
import PriorityRefPresenter from './components/issues/PriorityRefPresenter.svelte'
|
||||
import PriorityEditor from './components/issues/PriorityEditor.svelte'
|
||||
import PriorityPresenter from './components/issues/PriorityPresenter.svelte'
|
||||
import PriorityRefPresenter from './components/issues/PriorityRefPresenter.svelte'
|
||||
import RelatedIssueSelector from './components/issues/related/RelatedIssueSelector.svelte'
|
||||
import RelatedIssuesSection from './components/issues/related/RelatedIssuesSection.svelte'
|
||||
import StatusEditor from './components/issues/StatusEditor.svelte'
|
||||
import StatusPresenter from './components/issues/StatusPresenter.svelte'
|
||||
import TitlePresenter from './components/issues/TitlePresenter.svelte'
|
||||
@@ -66,18 +67,18 @@ import TeamProjects from './components/projects/TeamProjects.svelte'
|
||||
import RelationsPopup from './components/RelationsPopup.svelte'
|
||||
import SetDueDateActionPopup from './components/SetDueDateActionPopup.svelte'
|
||||
import SetParentIssueActionPopup from './components/SetParentIssueActionPopup.svelte'
|
||||
import Views from './components/views/Views.svelte'
|
||||
import Statuses from './components/workflow/Statuses.svelte'
|
||||
import RelatedIssuesSection from './components/issues/related/RelatedIssuesSection.svelte'
|
||||
import RelatedIssueSelector from './components/issues/related/RelatedIssueSelector.svelte'
|
||||
import SprintProjectEditor from './components/sprints/SprintProjectEditor.svelte'
|
||||
import SprintDatePresenter from './components/sprints/SprintDatePresenter.svelte'
|
||||
import SprintLeadPresenter from './components/sprints/SprintLeadPresenter.svelte'
|
||||
import SprintProjectEditor from './components/sprints/SprintProjectEditor.svelte'
|
||||
import CreateIssueTemplate from './components/templates/CreateIssueTemplate.svelte'
|
||||
import Views from './components/views/Views.svelte'
|
||||
import Statuses from './components/workflow/Statuses.svelte'
|
||||
|
||||
import {
|
||||
getIssueId,
|
||||
getIssueTitle,
|
||||
issueIdProvider,
|
||||
issueLinkFragmentProvider,
|
||||
issueLinkProvider,
|
||||
issueTitleProvider,
|
||||
resolveLocation
|
||||
@@ -91,8 +92,8 @@ import SprintSelector from './components/sprints/SprintSelector.svelte'
|
||||
import SprintStatusPresenter from './components/sprints/SprintStatusPresenter.svelte'
|
||||
import SprintTitlePresenter from './components/sprints/SprintTitlePresenter.svelte'
|
||||
|
||||
import Scrums from './components/scrums/Scrums.svelte'
|
||||
import ScrumRecordPanel from './components/scrums/ScrumRecordPanel.svelte'
|
||||
import Scrums from './components/scrums/Scrums.svelte'
|
||||
|
||||
import SubIssuesSelector from './components/issues/edit/SubIssuesSelector.svelte'
|
||||
import EstimationEditor from './components/issues/timereport/EstimationEditor.svelte'
|
||||
@@ -107,31 +108,31 @@ import ProjectSelector from './components/ProjectSelector.svelte'
|
||||
import IssueTemplatePresenter from './components/templates/IssueTemplatePresenter.svelte'
|
||||
import IssueTemplates from './components/templates/IssueTemplates.svelte'
|
||||
|
||||
import { deleteObject } from '@hcengineering/view-resources/src/utils'
|
||||
import MoveAndDeleteSprintPopup from './components/sprints/MoveAndDeleteSprintPopup.svelte'
|
||||
import EditIssueTemplate from './components/templates/EditIssueTemplate.svelte'
|
||||
import TemplateEstimationEditor from './components/templates/EstimationEditor.svelte'
|
||||
import MoveAndDeleteSprintPopup from './components/sprints/MoveAndDeleteSprintPopup.svelte'
|
||||
import {
|
||||
moveIssuesToAnotherSprint,
|
||||
issueStatusSort,
|
||||
issuePrioritySort,
|
||||
sprintSort,
|
||||
subIssueQuery,
|
||||
getAllStatuses,
|
||||
getAllPriority,
|
||||
getAllProjects,
|
||||
getAllSprints,
|
||||
removeTeam
|
||||
getAllStatuses,
|
||||
issuePrioritySort,
|
||||
issueStatusSort,
|
||||
moveIssuesToAnotherSprint,
|
||||
removeTeam,
|
||||
sprintSort,
|
||||
subIssueQuery
|
||||
} from './utils'
|
||||
import { deleteObject } from '@hcengineering/view-resources/src/utils'
|
||||
|
||||
import { EmployeeAccount } from '@hcengineering/contact'
|
||||
import StatusRefPresenter from './components/issues/StatusRefPresenter.svelte'
|
||||
import TimeSpendReportPopup from './components/issues/timereport/TimeSpendReportPopup.svelte'
|
||||
import DeleteProjectPresenter from './components/projects/DeleteProjectPresenter.svelte'
|
||||
import IssueStatistics from './components/sprints/IssueStatistics.svelte'
|
||||
import SprintRefPresenter from './components/sprints/SprintRefPresenter.svelte'
|
||||
import CreateTeam from './components/teams/CreateTeam.svelte'
|
||||
import TeamPresenter from './components/teams/TeamPresenter.svelte'
|
||||
import IssueStatistics from './components/sprints/IssueStatistics.svelte'
|
||||
import StatusRefPresenter from './components/issues/StatusRefPresenter.svelte'
|
||||
import SprintRefPresenter from './components/sprints/SprintRefPresenter.svelte'
|
||||
import { EmployeeAccount } from '@hcengineering/contact'
|
||||
import DeleteProjectPresenter from './components/projects/DeleteProjectPresenter.svelte'
|
||||
import TimeSpendReportPopup from './components/issues/timereport/TimeSpendReportPopup.svelte'
|
||||
|
||||
export { default as SubIssueList } from './components/issues/edit/SubIssueList.svelte'
|
||||
|
||||
@@ -425,6 +426,7 @@ export default async (): Promise<Resources> => ({
|
||||
IssueTitleProvider: getIssueTitle,
|
||||
GetIssueId: issueIdProvider,
|
||||
GetIssueLink: issueLinkProvider,
|
||||
GetIssueLinkFragment: issueLinkFragmentProvider,
|
||||
GetIssueTitle: issueTitleProvider,
|
||||
IssueStatusSort: issueStatusSort,
|
||||
IssuePrioritySort: issuePrioritySort,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Doc, DocumentUpdate, Ref, RelatedDocument, TxOperations } from '@hcengineering/core'
|
||||
import { getClient } from '@hcengineering/presentation'
|
||||
import { Issue, Project, Sprint, Team, trackerId } from '@hcengineering/tracker'
|
||||
import { getCurrentLocation, getPanelURI, Location } from '@hcengineering/ui'
|
||||
import { getCurrentLocation, getPanelURI, Location, navigate } from '@hcengineering/ui'
|
||||
import { workbenchId } from '@hcengineering/workbench'
|
||||
import { writable } from 'svelte/store'
|
||||
import tracker from './plugin'
|
||||
@@ -36,6 +36,11 @@ export async function issueIdProvider (doc: Doc): Promise<string> {
|
||||
return await getIssueTitle(client, doc._id)
|
||||
}
|
||||
|
||||
export async function issueLinkFragmentProvider (doc: Doc): Promise<string> {
|
||||
const client = getClient()
|
||||
return await getIssueTitle(client, doc._id).then((p) => `${trackerId}|${p}`)
|
||||
}
|
||||
|
||||
export async function issueTitleProvider (doc: Issue): Promise<string> {
|
||||
return await Promise.resolve(doc.title)
|
||||
}
|
||||
@@ -47,7 +52,7 @@ export async function issueLinkProvider (doc: Doc): Promise<string> {
|
||||
|
||||
export function generateIssueShortLink (issueId: string): string {
|
||||
const location = getCurrentLocation()
|
||||
return `${window.location.protocol}//${window.location.host}/${workbenchId}/${location.path[1]}/${trackerId}/${issueId}`
|
||||
return `${window.location.protocol}//${window.location.host}/${workbenchId}/${location.path[1]}/${trackerId}#${trackerId}|${issueId}`
|
||||
}
|
||||
|
||||
export async function generateIssueLocation (loc: Location, issueId: string): Promise<Location | undefined> {
|
||||
@@ -78,14 +83,25 @@ export async function generateIssueLocation (loc: Location, issueId: string): Pr
|
||||
}
|
||||
}
|
||||
|
||||
function checkOld (loc: Location): void {
|
||||
const short = loc.path[3]
|
||||
if (isIssueId(short)) {
|
||||
loc.fragment = short
|
||||
loc.path.length = 3
|
||||
navigate(loc)
|
||||
}
|
||||
}
|
||||
|
||||
export async function resolveLocation (loc: Location): Promise<Location | undefined> {
|
||||
const app = loc.path.length > 2 ? loc.path[2] : undefined
|
||||
if (app !== trackerId) {
|
||||
const split = loc.fragment?.split('|') ?? []
|
||||
const app = loc.path[2]
|
||||
if (app !== trackerId && split[0] !== trackerId) {
|
||||
return undefined
|
||||
}
|
||||
|
||||
const shortLink = loc.path.length > 3 ? loc.path[3] : undefined
|
||||
if (shortLink === undefined || shortLink === null) {
|
||||
const shortLink = split[1] ?? loc.fragment
|
||||
if (shortLink === undefined || shortLink === null || shortLink.trim() === '') {
|
||||
checkOld(loc)
|
||||
return undefined
|
||||
}
|
||||
|
||||
|
||||
@@ -378,6 +378,7 @@ export default mergeIds(trackerId, tracker, {
|
||||
IssueTitleProvider: '' as Resource<(client: Client, ref: Ref<Doc>) => Promise<string>>,
|
||||
GetIssueId: '' as Resource<(doc: Doc, props: Record<string, any>) => Promise<string>>,
|
||||
GetIssueLink: '' as Resource<(doc: Doc, props: Record<string, any>) => Promise<string>>,
|
||||
GetIssueLinkFragment: '' as Resource<(doc: Doc, props: Record<string, any>) => Promise<string>>,
|
||||
GetIssueTitle: '' as Resource<(doc: Doc, props: Record<string, any>) => Promise<string>>,
|
||||
IssueStatusSort: '' as SortFunc,
|
||||
IssuePrioritySort: '' as SortFunc,
|
||||
|
||||
Reference in New Issue
Block a user