mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-22 21:50:34 +03:00
Add copy link button to notification (#2444)
Signed-off-by: Denis Maslennikov <denis.maslennikov@gmail.com>
This commit is contained in:
parent
27b003f35f
commit
cbf83a55ff
@ -70,7 +70,7 @@
|
||||
import view from '@hcengineering/view'
|
||||
import { ObjectBox } from '@hcengineering/view-resources'
|
||||
import { createEventDispatcher } from 'svelte'
|
||||
import { activeProject, activeSprint, updateIssueRelation } from '../issues'
|
||||
import { activeProject, activeSprint, generateIssueShortLink, getIssueId, updateIssueRelation } from '../issues'
|
||||
import tracker from '../plugin'
|
||||
import AssigneeEditor from './issues/AssigneeEditor.svelte'
|
||||
import ParentIssue from './issues/ParentIssue.svelte'
|
||||
@ -555,7 +555,8 @@
|
||||
|
||||
addNotification(tracker.string.IssueCreated, getTitle(object.title), IssueNotification, {
|
||||
issueId: objectId,
|
||||
subTitlePostfix: (await translate(tracker.string.Created, { value: 1 })).toLowerCase()
|
||||
subTitlePostfix: (await translate(tracker.string.Created, { value: 1 })).toLowerCase(),
|
||||
issueUrl: currentTeam && generateIssueShortLink(getIssueId(currentTeam, value as Issue))
|
||||
})
|
||||
|
||||
objectId = generateId()
|
||||
|
@ -11,7 +11,7 @@
|
||||
Label,
|
||||
showPanel
|
||||
} from '@hcengineering/ui'
|
||||
import { createQuery } from '@hcengineering/presentation'
|
||||
import { copyTextToClipboard, createQuery } from '@hcengineering/presentation'
|
||||
import { Issue, IssueStatus } from '@hcengineering/tracker'
|
||||
|
||||
import IssueStatusIcon from './IssueStatusIcon.svelte'
|
||||
@ -79,6 +79,11 @@
|
||||
|
||||
onRemove()
|
||||
}
|
||||
const handleCopyUrl = () => {
|
||||
if (issue) {
|
||||
copyTextToClipboard(params?.issueUrl)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="root" in:fade out:fade>
|
||||
@ -104,8 +109,18 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="view-issue-button">
|
||||
<Button label={tracker.string.ViewIssue} kind="link" size="medium" on:click={handleIssueOpened} />
|
||||
<div class="row">
|
||||
<div class="view-issue-button">
|
||||
<Button label={tracker.string.ViewIssue} kind="link" size="medium" on:click={handleIssueOpened} />
|
||||
</div>
|
||||
<div class="copy-link-button">
|
||||
<Button
|
||||
icon={tracker.icon.CopyURL}
|
||||
kind={'link'}
|
||||
label={tracker.string.CopyIssueUrl}
|
||||
on:click={handleCopyUrl}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -152,6 +167,11 @@
|
||||
margin-left: -5px;
|
||||
}
|
||||
|
||||
.copy-link-button {
|
||||
margin-top: 10px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
Loading…
Reference in New Issue
Block a user