mirror of
https://github.com/hcengineering/platform.git
synced 2025-06-06 07:46:32 +00: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 view from '@hcengineering/view'
|
||||||
import { ObjectBox } from '@hcengineering/view-resources'
|
import { ObjectBox } from '@hcengineering/view-resources'
|
||||||
import { createEventDispatcher } from 'svelte'
|
import { createEventDispatcher } from 'svelte'
|
||||||
import { activeProject, activeSprint, updateIssueRelation } from '../issues'
|
import { activeProject, activeSprint, generateIssueShortLink, getIssueId, updateIssueRelation } from '../issues'
|
||||||
import tracker from '../plugin'
|
import tracker from '../plugin'
|
||||||
import AssigneeEditor from './issues/AssigneeEditor.svelte'
|
import AssigneeEditor from './issues/AssigneeEditor.svelte'
|
||||||
import ParentIssue from './issues/ParentIssue.svelte'
|
import ParentIssue from './issues/ParentIssue.svelte'
|
||||||
@ -555,7 +555,8 @@
|
|||||||
|
|
||||||
addNotification(tracker.string.IssueCreated, getTitle(object.title), IssueNotification, {
|
addNotification(tracker.string.IssueCreated, getTitle(object.title), IssueNotification, {
|
||||||
issueId: objectId,
|
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()
|
objectId = generateId()
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
Label,
|
Label,
|
||||||
showPanel
|
showPanel
|
||||||
} from '@hcengineering/ui'
|
} from '@hcengineering/ui'
|
||||||
import { createQuery } from '@hcengineering/presentation'
|
import { copyTextToClipboard, createQuery } from '@hcengineering/presentation'
|
||||||
import { Issue, IssueStatus } from '@hcengineering/tracker'
|
import { Issue, IssueStatus } from '@hcengineering/tracker'
|
||||||
|
|
||||||
import IssueStatusIcon from './IssueStatusIcon.svelte'
|
import IssueStatusIcon from './IssueStatusIcon.svelte'
|
||||||
@ -79,6 +79,11 @@
|
|||||||
|
|
||||||
onRemove()
|
onRemove()
|
||||||
}
|
}
|
||||||
|
const handleCopyUrl = () => {
|
||||||
|
if (issue) {
|
||||||
|
copyTextToClipboard(params?.issueUrl)
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="root" in:fade out:fade>
|
<div class="root" in:fade out:fade>
|
||||||
@ -104,8 +109,18 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="view-issue-button">
|
<div class="row">
|
||||||
<Button label={tracker.string.ViewIssue} kind="link" size="medium" on:click={handleIssueOpened} />
|
<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>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -152,6 +167,11 @@
|
|||||||
margin-left: -5px;
|
margin-left: -5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.copy-link-button {
|
||||||
|
margin-top: 10px;
|
||||||
|
margin-left: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
Loading…
Reference in New Issue
Block a user