diff --git a/models/tracker/src/index.ts b/models/tracker/src/index.ts
index 2f86ae9ccff..feb3e13e2b8 100644
--- a/models/tracker/src/index.ts
+++ b/models/tracker/src/index.ts
@@ -327,6 +327,10 @@ export function createModel (builder: Builder): void {
presenter: tracker.component.StatusPresenter
})
+ builder.mixin(tracker.class.Project, core.class.Class, view.mixin.AttributePresenter, {
+ presenter: tracker.component.ProjectTitlePresenter
+ })
+
builder.createDoc(
workbench.class.Application,
core.space.Model,
diff --git a/packages/text-editor/src/components/StyledTextArea.svelte b/packages/text-editor/src/components/StyledTextArea.svelte
new file mode 100644
index 00000000000..a49deda4437
--- /dev/null
+++ b/packages/text-editor/src/components/StyledTextArea.svelte
@@ -0,0 +1,84 @@
+
+
+
-
+ {#if isScrollable}
+
+ {
+ dispatch('message', ev.detail)
+ content = ''
+ textEditor.clear()
+ }}
+ on:blur
+ on:focus
+ supportSubmit={false}
+ />
+
+ {:else}
-
+ {/if}
{#if showButtons}
diff --git a/packages/text-editor/src/index.ts b/packages/text-editor/src/index.ts
index b1d4d39a782..ad7ba8f1162 100644
--- a/packages/text-editor/src/index.ts
+++ b/packages/text-editor/src/index.ts
@@ -20,6 +20,7 @@ import { textEditorId } from './plugin'
export * from '@anticrm/presentation/src/types'
export { default as ReferenceInput } from './components/ReferenceInput.svelte'
export { default as StyledTextBox } from './components/StyledTextBox.svelte'
+export { default as StyledTextArea } from './components/StyledTextArea.svelte'
export { default as StyledTextEditor } from './components/StyledTextEditor.svelte'
export { default as TextEditor } from './components/TextEditor.svelte'
export { default } from './plugin'
diff --git a/plugins/tracker-assets/lang/en.json b/plugins/tracker-assets/lang/en.json
index b98d9fa8647..869fe2f834e 100644
--- a/plugins/tracker-assets/lang/en.json
+++ b/plugins/tracker-assets/lang/en.json
@@ -96,6 +96,7 @@
"PastMonth": "Past month",
"CopyIssueUrl": "Copy Issue URL to clipboard",
"CopyIssueId": "Copy Issue ID to clipboard",
+ "CopyIssueBranch": "Copy Git branch name to clipboard",
"AssetLabel": "Asset",
"AddToProject": "Add to project\u2026",
"MoveToProject": "Move to project\u2026",
@@ -113,7 +114,9 @@
"FilterIs": "is",
"FilterIsNot": "is not",
"FilterIsEither": "is either of",
- "FilterStatesCount": "{value, plural, =1 {1 state} other {# states}}"
+ "FilterStatesCount": "{value, plural, =1 {1 state} other {# states}}",
+
+ "EditIssue": "Edit {title}"
},
"status": {}
}
\ No newline at end of file
diff --git a/plugins/tracker-assets/lang/ru.json b/plugins/tracker-assets/lang/ru.json
index a8d9273d25a..72f507d607a 100644
--- a/plugins/tracker-assets/lang/ru.json
+++ b/plugins/tracker-assets/lang/ru.json
@@ -73,7 +73,9 @@
"GotoBacklog": "Перейти к пулу задач",
"GotoBoard": "Перейти к канбану",
"GotoProjects": "Перейти к проекту",
- "GotoTrackerApplication": "Перейти к приложению Трекер"
+ "GotoTrackerApplication": "Перейти к приложению Трекер",
+
+ "EditIssue": "Редактирование {title}"
},
"status": {}
}
diff --git a/plugins/tracker-resources/package.json b/plugins/tracker-resources/package.json
index 02281014ed9..7d5e64a932d 100644
--- a/plugins/tracker-resources/package.json
+++ b/plugins/tracker-resources/package.json
@@ -49,6 +49,7 @@
"@anticrm/view-resources": "~0.6.0",
"@anticrm/text-editor": "~0.6.0",
"@anticrm/panel": "~0.6.0",
- "@anticrm/kanban": "~0.6.0"
+ "@anticrm/kanban": "~0.6.0",
+ "@anticrm/attachment-resources": "~0.6.0"
}
}
diff --git a/plugins/tracker-resources/src/components/issues/AssigneeEditor.svelte b/plugins/tracker-resources/src/components/issues/AssigneeEditor.svelte
new file mode 100644
index 00000000000..dca78f50b33
--- /dev/null
+++ b/plugins/tracker-resources/src/components/issues/AssigneeEditor.svelte
@@ -0,0 +1,53 @@
+
+
+
+{#if value}
+
+ handleAssigneeChanged(detail)}
+ />
+
+{/if}
diff --git a/plugins/tracker-resources/src/components/issues/DueDateEditor.svelte b/plugins/tracker-resources/src/components/issues/DueDateEditor.svelte
new file mode 100644
index 00000000000..46270acde24
--- /dev/null
+++ b/plugins/tracker-resources/src/components/issues/DueDateEditor.svelte
@@ -0,0 +1,49 @@
+
+
+
+{#if value}
+
+
handleDueDateChanged(detail)}
+ />
+{/if}
diff --git a/plugins/tracker-resources/src/components/issues/DueDatePresenter.svelte b/plugins/tracker-resources/src/components/issues/DueDatePresenter.svelte
index a1582479681..811cf5cea10 100644
--- a/plugins/tracker-resources/src/components/issues/DueDatePresenter.svelte
+++ b/plugins/tracker-resources/src/components/issues/DueDatePresenter.svelte
@@ -19,10 +19,10 @@
import { getClient } from '@anticrm/presentation'
import DueDatePopup from './DueDatePopup.svelte'
import tracker from '../../plugin'
+ import { getDueDateIconModifier } from '../../utils'
export let value: WithLookup
- const WARNING_DAYS = 7
const client = getClient()
$: today = new Date(new Date(Date.now()).setHours(0, 0, 0, 0))
@@ -30,7 +30,7 @@
$: isOverdue = dueDateMs !== null && dueDateMs < today.getTime()
$: dueDate = dueDateMs === null ? null : new Date(dueDateMs)
$: daysDifference = dueDate === null ? null : getDaysDifference(today, dueDate)
- $: iconModifier = getIconModifier(isOverdue, daysDifference)
+ $: iconModifier = getDueDateIconModifier(isOverdue, daysDifference)
$: formattedDate = !dueDateMs ? '' : new Date(dueDateMs).toLocaleString('default', { month: 'short', day: 'numeric' })
const handleDueDateChanged = async (event: CustomEvent) => {
@@ -43,20 +43,6 @@
await client.update(value, { dueDate: newDate })
}
- const getIconModifier = (isOverdue: boolean, daysDifference: number | null) => {
- if (isOverdue) {
- return 'overdue' as 'overdue' // Fixes `DatePresenter` icon type issue
- }
-
- if (daysDifference === 0) {
- return 'critical' as 'critical'
- }
-
- if (daysDifference !== null && daysDifference <= WARNING_DAYS) {
- return 'warning' as 'warning'
- }
- }
-
$: shouldRenderPresenter =
dueDateMs &&
value.$lookup?.status?.category !== tracker.issueStatusCategory.Completed &&
diff --git a/plugins/tracker-resources/src/components/issues/EditIssue.svelte b/plugins/tracker-resources/src/components/issues/EditIssue.svelte
deleted file mode 100644
index cbbe2143477..00000000000
--- a/plugins/tracker-resources/src/components/issues/EditIssue.svelte
+++ /dev/null
@@ -1,258 +0,0 @@
-
-
-
-{#if issue !== undefined}
- {
- dispatch('close')
- }}
- >
- Custom Title
-
-
- {#if currentTeam}
-
- {/if}
-
-
- {#if innerWidth < 900}
-
- {/if}
-
-
-
-
-
-
-
-
- {issueLabel}
-
-
-
-
-
-
-
- change('title', issue?.title)}
- />
-
-
- evt.detail !== issue?.description && change('description', evt.detail)}
- />
-
-
- {issueLabel}
-
-
-
-
- {#if issue && currentTeam && issueStatuses && direction === 'column'}
-
-
-
-
-
-
-
-
-
-
-
-
-
change('assignee', issue?.assignee)}
- />
-
-
-
-
-
-
-
-
-
-
-
-
- {#if issue.dueDate !== null}
-
-
-
-
- change('dueDate', detail)} />
- {/if}
-
- {:else}
-
- {/if}
-
-
-{/if}
-
-
diff --git a/plugins/tracker-resources/src/components/issues/IssuePresenter.svelte b/plugins/tracker-resources/src/components/issues/IssuePresenter.svelte
index 1d1f8da544c..613c06fb48e 100644
--- a/plugins/tracker-resources/src/components/issues/IssuePresenter.svelte
+++ b/plugins/tracker-resources/src/components/issues/IssuePresenter.svelte
@@ -27,13 +27,13 @@
$: issueName = `${currentTeam.identifier}-${value.number}`
- const handleIssueEditorOpened = () => {
+ const handleIssuePreviewOpened = () => {
showPanel(tracker.component.EditIssue, value._id, value._class, 'content')
}
{#if value && shortLabel}
-
+
diff --git a/plugins/tracker-resources/src/components/issues/edit/ControlPanel.svelte b/plugins/tracker-resources/src/components/issues/edit/ControlPanel.svelte
new file mode 100644
index 00000000000..47b3b9c820a
--- /dev/null
+++ b/plugins/tracker-resources/src/components/issues/edit/ControlPanel.svelte
@@ -0,0 +1,93 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {#if issue.dueDate !== null}
+
+
+
+
+
+
+ {/if}
+
+
+
diff --git a/plugins/tracker-resources/src/components/issues/edit/CopyToClipboard.svelte b/plugins/tracker-resources/src/components/issues/edit/CopyToClipboard.svelte
new file mode 100644
index 00000000000..924771de662
--- /dev/null
+++ b/plugins/tracker-resources/src/components/issues/edit/CopyToClipboard.svelte
@@ -0,0 +1,61 @@
+
+
+
+{#if issueUrl}
+
copy(issueUrl)}
+ />
+{/if}
+
+{#if issueId}
+ copy(issueId)}
+ />
+{/if}
+
+{#if issueBranch}
+ issueBranch}
+ />
+{/if}
diff --git a/plugins/tracker-resources/src/components/issues/edit/EditIssue.svelte b/plugins/tracker-resources/src/components/issues/edit/EditIssue.svelte
new file mode 100644
index 00000000000..c3cde9813fa
--- /dev/null
+++ b/plugins/tracker-resources/src/components/issues/edit/EditIssue.svelte
@@ -0,0 +1,197 @@
+
+
+
+{#if issue !== undefined}
+ dispatch('close')}
+ >
+
+
+
+
+ {#if innerWidth < 900}
+
+ {/if}
+
+
+
+
+
+
+
+
+
+ {#if issueId}{issueId}{/if}
+
+
+
+ {#if isEditing}
+
+
+ {:else}
+
+ {/if}
+
+
+ {#if isEditing}
+
+
+
+ {:else}
+ {title}
+
+
+
+ {/if}
+
+
+
+ {#if issueId}{issueId}{/if}
+
+
+
+
+
+
+ {#if issue && currentTeam && issueStatuses}
+
+ {/if}
+
+
+{/if}
+
+
diff --git a/plugins/tracker-resources/src/components/issues/ProjectEditor.svelte b/plugins/tracker-resources/src/components/projects/ProjectEditor.svelte
similarity index 79%
rename from plugins/tracker-resources/src/components/issues/ProjectEditor.svelte
rename to plugins/tracker-resources/src/components/projects/ProjectEditor.svelte
index 08657ba631d..57a42b9d343 100644
--- a/plugins/tracker-resources/src/components/issues/ProjectEditor.svelte
+++ b/plugins/tracker-resources/src/components/projects/ProjectEditor.svelte
@@ -16,10 +16,10 @@
import { Ref } from '@anticrm/core'
import { Issue, Project } from '@anticrm/tracker'
import { getClient } from '@anticrm/presentation'
- import type { ButtonKind, ButtonShape, ButtonSize } from '@anticrm/ui'
+ import { ButtonKind, ButtonShape, ButtonSize, Tooltip } from '@anticrm/ui'
+ import { IntlString } from '@anticrm/platform'
import tracker from '../../plugin'
import ProjectSelector from '../ProjectSelector.svelte'
- import { IntlString } from '@anticrm/platform'
export let value: Issue
export let isEditable: boolean = true
@@ -44,16 +44,18 @@
{#if value.project || shouldShowPlaceholder}
-
+
+
+
{/if}
diff --git a/plugins/tracker-resources/src/components/projects/ProjectTitlePresenter.svelte b/plugins/tracker-resources/src/components/projects/ProjectTitlePresenter.svelte
new file mode 100644
index 00000000000..da49841a6cf
--- /dev/null
+++ b/plugins/tracker-resources/src/components/projects/ProjectTitlePresenter.svelte
@@ -0,0 +1,25 @@
+
+
+
+{#if value}
+
+ {value.label}
+
+{/if}
diff --git a/plugins/tracker-resources/src/index.ts b/plugins/tracker-resources/src/index.ts
index 50c1e676cbe..bd6e6946c32 100644
--- a/plugins/tracker-resources/src/index.ts
+++ b/plugins/tracker-resources/src/index.ts
@@ -25,12 +25,13 @@ import Issues from './components/issues/Issues.svelte'
import MyIssues from './components/myissues/MyIssues.svelte'
import Projects from './components/projects/Projects.svelte'
import ProjectPresenter from './components/projects/ProjectPresenter.svelte'
+import ProjectTitlePresenter from './components/projects/ProjectTitlePresenter.svelte'
import Views from './components/views/Views.svelte'
import IssuePresenter from './components/issues/IssuePresenter.svelte'
import TitlePresenter from './components/issues/TitlePresenter.svelte'
import PriorityPresenter from './components/issues/PriorityPresenter.svelte'
import PriorityEditor from './components/issues/PriorityEditor.svelte'
-import ProjectEditor from './components/issues/ProjectEditor.svelte'
+import ProjectEditor from './components/projects/ProjectEditor.svelte'
import StatusPresenter from './components/issues/StatusPresenter.svelte'
import StatusEditor from './components/issues/StatusEditor.svelte'
import DueDatePresenter from './components/issues/DueDatePresenter.svelte'
@@ -38,7 +39,7 @@ import AssigneePresenter from './components/issues/AssigneePresenter.svelte'
import ViewOptionsPopup from './components/issues/ViewOptionsPopup.svelte'
import ModificationDatePresenter from './components/issues/ModificationDatePresenter.svelte'
-import EditIssue from './components/issues/EditIssue.svelte'
+import EditIssue from './components/issues/edit/EditIssue.svelte'
import NewIssueHeader from './components/NewIssueHeader.svelte'
export default async (): Promise => ({
@@ -54,6 +55,7 @@ export default async (): Promise => ({
Views,
IssuePresenter,
ProjectPresenter,
+ ProjectTitlePresenter,
TitlePresenter,
ModificationDatePresenter,
PriorityPresenter,
diff --git a/plugins/tracker-resources/src/plugin.ts b/plugins/tracker-resources/src/plugin.ts
index f6a3b867357..042b23c1a5a 100644
--- a/plugins/tracker-resources/src/plugin.ts
+++ b/plugins/tracker-resources/src/plugin.ts
@@ -127,11 +127,14 @@ export default mergeIds(trackerId, tracker, {
CopyIssueUrl: '' as IntlString,
CopyIssueId: '' as IntlString,
+ CopyIssueBranch: '' as IntlString,
FilterIs: '' as IntlString,
FilterIsNot: '' as IntlString,
FilterIsEither: '' as IntlString,
- FilterStatesCount: '' as IntlString
+ FilterStatesCount: '' as IntlString,
+
+ EditIssue: '' as IntlString
},
component: {
NopeComponent: '' as AnyComponent,
@@ -144,6 +147,7 @@ export default mergeIds(trackerId, tracker, {
Board: '' as AnyComponent,
Projects: '' as AnyComponent,
IssuePresenter: '' as AnyComponent,
+ ProjectTitlePresenter: '' as AnyComponent,
ProjectPresenter: '' as AnyComponent,
TitlePresenter: '' as AnyComponent,
ModificationDatePresenter: '' as AnyComponent,
diff --git a/plugins/tracker-resources/src/utils.ts b/plugins/tracker-resources/src/utils.ts
index 19d16278b3c..3787d18c9f1 100644
--- a/plugins/tracker-resources/src/utils.ts
+++ b/plugins/tracker-resources/src/utils.ts
@@ -228,3 +228,22 @@ export const getArraysUnion = (a: any[], b: any[]): any[] => {
return Array.from(union)
}
+
+const WARNING_DAYS = 7
+
+export const getDueDateIconModifier = (
+ isOverdue: boolean,
+ daysDifference: number | null
+): 'overdue' | 'critical' | 'warning' | undefined => {
+ if (isOverdue) {
+ return 'overdue'
+ }
+
+ if (daysDifference === 0) {
+ return 'critical'
+ }
+
+ if (daysDifference !== null && daysDifference <= WARNING_DAYS) {
+ return 'warning'
+ }
+}