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 (focused) { + textEditor?.focus() + } + }} +> + {#if label} +
+ {/if} + { + focused = true + }} + on:blur={() => { + focused = false + dispatch('value', rawValue) + content = rawValue + }} + on:value={(evt) => { + rawValue = evt.detail + }} + /> +
+ + diff --git a/packages/text-editor/src/components/StyledTextEditor.svelte b/packages/text-editor/src/components/StyledTextEditor.svelte index 0866c1801f5..1cd5876c43e 100644 --- a/packages/text-editor/src/components/StyledTextEditor.svelte +++ b/packages/text-editor/src/components/StyledTextEditor.svelte @@ -28,6 +28,7 @@ export let content: string = '' export let placeholder: IntlString = textEditorPlugin.string.EditorPlaceholder export let showButtons = true + export let isScrollable = true let textEditor: TextEditor @@ -42,7 +43,24 @@
- + {#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} - - -{/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 @@ + + + +
+ + + + + + + + + + + + + + +
+
+ + +