diff --git a/packages/ui/lang/en.json b/packages/ui/lang/en.json index b682e07d67..00eaadcb9d 100644 --- a/packages/ui/lang/en.json +++ b/packages/ui/lang/en.json @@ -27,7 +27,11 @@ "AddDueDate": "Add due date", "EditDueDate": "Edit due date", "SaveDueDate": "Save due date", - "IssueNeedsToBeCompletedByThisDate": "Issue needs to be completed by this date", + "NeedsToBeCompletedByThisDate": "Needs to be completed by this date", + "DueDatePopupTitle": "Due on {value}", + "DueDatePopupOverdueTitle": "Was due on {value}", + "DueDatePopupDescription": "{value, plural, =0 {Today} =1 {Tomorrow} other {# days remaining}}", + "DueDatePopupOverdueDescription": "{value, plural, =1 {1 day overdue} other {# days overdue}}", "English": "English", "Russian": "Russian", "MinutesBefore": "{minutes, plural, =1 {a minute before} other {# minutes before}}", diff --git a/packages/ui/lang/ru.json b/packages/ui/lang/ru.json index 37abe32359..7efc44d6e3 100644 --- a/packages/ui/lang/ru.json +++ b/packages/ui/lang/ru.json @@ -27,7 +27,11 @@ "AddDueDate": "Установить дату", "EditDueDate": "Изменить дату", "SaveDueDate": "Сохранить дату", - "IssueNeedsToBeCompletedByThisDate": "Задача должна быть завершена к этой дате", + "NeedsToBeCompletedByThisDate": "Должно быть завершено к этой дате", + "DueDatePopupTitle": "Срок {value}", + "DueDatePopupOverdueTitle": "Должно было завершится {value}", + "DueDatePopupDescription": "{value, plural, =0 {Сегодня} =1 {Завтра} other {# дней осталось}}", + "DueDatePopupOverdueDescription": "{value, plural, =1 {1 день опоздания} other {# дней опаздания}}", "English": "Английский", "Russian": "Русский", "MinutesBefore": "{minutes, plural, =1 {за минуту} other {за # минут}}", diff --git a/packages/ui/src/components/calendar/DatePopup.svelte b/packages/ui/src/components/calendar/DatePopup.svelte index 34b65e1bf9..522fb323db 100644 --- a/packages/ui/src/components/calendar/DatePopup.svelte +++ b/packages/ui/src/components/calendar/DatePopup.svelte @@ -13,21 +13,22 @@ // limitations under the License. --> + +{#if shouldRender} +
+ +
+{/if} diff --git a/packages/ui/src/index.ts b/packages/ui/src/index.ts index d55c47ad5b..2be146e2bb 100644 --- a/packages/ui/src/index.ts +++ b/packages/ui/src/index.ts @@ -72,6 +72,7 @@ export { default as TimePopup } from './components/calendar/TimePopup.svelte' export { default as DateRangePresenter } from './components/calendar/DateRangePresenter.svelte' export { default as DateTimeRangePresenter } from './components/calendar/DateTimeRangePresenter.svelte' export { default as DatePresenter } from './components/calendar/DatePresenter.svelte' +export { default as DueDatePresenter } from './components/calendar/DueDatePresenter.svelte' export { default as DateTimePresenter } from './components/calendar/DateTimePresenter.svelte' export { default as StylishEdit } from './components/StylishEdit.svelte' export { default as Grid } from './components/Grid.svelte' diff --git a/packages/ui/src/plugin.ts b/packages/ui/src/plugin.ts index 301c1f845e..4b2d0f0487 100644 --- a/packages/ui/src/plugin.ts +++ b/packages/ui/src/plugin.ts @@ -52,7 +52,7 @@ export const uis = plugin(uiId, { AddDueDate: '' as IntlString, EditDueDate: '' as IntlString, SaveDueDate: '' as IntlString, - IssueNeedsToBeCompletedByThisDate: '' as IntlString, + NeedsToBeCompletedByThisDate: '' as IntlString, English: '' as IntlString, Russian: '' as IntlString, MinutesBefore: '' as IntlString, @@ -70,7 +70,11 @@ export const uis = plugin(uiId, { DD: '' as IntlString, MM: '' as IntlString, YYYY: '' as IntlString, - HH: '' as IntlString + HH: '' as IntlString, + DueDatePopupTitle: '' as IntlString, + DueDatePopupOverdueTitle: '' as IntlString, + DueDatePopupDescription: '' as IntlString, + DueDatePopupOverdueDescription: '' as IntlString }, metadata: { DefaultApplication: '' as Metadata, diff --git a/plugins/recruit-resources/src/components/KanbanCard.svelte b/plugins/recruit-resources/src/components/KanbanCard.svelte index 35128bef7d..dc306ebae8 100644 --- a/plugins/recruit-resources/src/components/KanbanCard.svelte +++ b/plugins/recruit-resources/src/components/KanbanCard.svelte @@ -24,7 +24,7 @@ import recruit from '@hcengineering/recruit' import { AssigneePresenter, StateRefPresenter } from '@hcengineering/task-resources' import tracker from '@hcengineering/tracker' - import { Component, showPanel } from '@hcengineering/ui' + import { Component, DueDatePresenter, showPanel } from '@hcengineering/ui' import view from '@hcengineering/view' import { ObjectPresenter } from '@hcengineering/view-resources' import ApplicationPresenter from './ApplicationPresenter.svelte' @@ -90,6 +90,13 @@ + { + await client.update(object, { dueDate: e }) + }} + /> {#if (object.attachments ?? 0) > 0}
diff --git a/plugins/tracker-assets/lang/en.json b/plugins/tracker-assets/lang/en.json index 07b3ae3bd5..4f82219e0a 100644 --- a/plugins/tracker-assets/lang/en.json +++ b/plugins/tracker-assets/lang/en.json @@ -113,10 +113,6 @@ "NewIssueDialogCloseNote": "All changes will be lost", "RemoveComponentDialogClose": "Delete the component?", "RemoveComponentDialogCloseNote": "Are you sure you want to delete this component? This operation cannot be undone", - "DueDatePopupTitle": "Due on {value}", - "DueDatePopupOverdueTitle": "Was due on {value}", - "DueDatePopupDescription": "{value, plural, =0 {Today} =1 {Tomorrow} other {# days remaining}}", - "DueDatePopupOverdueDescription": "{value, plural, =1 {1 day overdue} other {# days overdue}}", "Grouping": "Grouping", "Ordering": "Ordering", "CompletedIssues": "Completed issues", diff --git a/plugins/tracker-assets/lang/ru.json b/plugins/tracker-assets/lang/ru.json index d6366ee1c2..0b330e032d 100644 --- a/plugins/tracker-assets/lang/ru.json +++ b/plugins/tracker-assets/lang/ru.json @@ -113,10 +113,6 @@ "NewIssueDialogCloseNote": "Все внесенные изменения будут потеряны", "RemoveComponentDialogClose": "Удалить компонент?", "RemoveComponentDialogCloseNote": "Уверены, что хотите удалить этот компонент? Эта операция не может быть отменена", - "DueDatePopupTitle": "Срок {value}", - "DueDatePopupOverdueTitle": "Должна была завершится {value}", - "DueDatePopupDescription": "{value, plural, =0 {Сегодня} =1 {Завтра} other {# дней осталось}}", - "DueDatePopupOverdueDescription": "{value, plural, =1 {1 день опозщдания} other {# дней опазданий}}", "Grouping": "Группировка", "Ordering": "Сортировка", "CompletedIssues": "Завершённые задачи", diff --git a/plugins/tracker-resources/src/components/CommonTrackerDatePresenter.svelte b/plugins/tracker-resources/src/components/CommonTrackerDatePresenter.svelte deleted file mode 100644 index 75baa91ced..0000000000 --- a/plugins/tracker-resources/src/components/CommonTrackerDatePresenter.svelte +++ /dev/null @@ -1,79 +0,0 @@ - - - -{#if shouldRender} - {#if formattedDate} -
- -
- {:else} - - {/if} -{/if} diff --git a/plugins/tracker-resources/src/components/components/TargetDatePresenter.svelte b/plugins/tracker-resources/src/components/components/TargetDatePresenter.svelte index aea60ac320..1194d0c969 100644 --- a/plugins/tracker-resources/src/components/components/TargetDatePresenter.svelte +++ b/plugins/tracker-resources/src/components/components/TargetDatePresenter.svelte @@ -15,7 +15,7 @@ - + diff --git a/plugins/tracker-resources/src/components/issues/DueDateEditor.svelte b/plugins/tracker-resources/src/components/issues/DueDateEditor.svelte index 22b6505f24..2267b60a2c 100644 --- a/plugins/tracker-resources/src/components/issues/DueDateEditor.svelte +++ b/plugins/tracker-resources/src/components/issues/DueDateEditor.svelte @@ -15,14 +15,13 @@ {#if value} - - handleDueDateChanged(detail)} - /> + handleDueDateChanged(e)} /> {/if} diff --git a/plugins/tracker-resources/src/components/issues/DueDatePresenter.svelte b/plugins/tracker-resources/src/components/issues/DueDatePresenter.svelte index 018e96b9f9..3dde898156 100644 --- a/plugins/tracker-resources/src/components/issues/DueDatePresenter.svelte +++ b/plugins/tracker-resources/src/components/issues/DueDatePresenter.svelte @@ -16,11 +16,11 @@ import { WithLookup } from '@hcengineering/core' import { Issue } from '@hcengineering/tracker' import { getClient } from '@hcengineering/presentation' - import CommonTrackerDatePresenter from '../CommonTrackerDatePresenter.svelte' import tracker from '../../plugin' + import { ButtonKind, DueDatePresenter } from '@hcengineering/ui' export let value: WithLookup - export let kind: 'transparent' | 'primary' | 'link' | 'list' = 'primary' + export let kind: ButtonKind = 'link' export let isEditable = true const client = getClient() @@ -45,10 +45,10 @@ value.$lookup?.status?.category !== tracker.issueStatusCategory.Canceled - diff --git a/plugins/tracker-resources/src/components/issues/KanbanView.svelte b/plugins/tracker-resources/src/components/issues/KanbanView.svelte index c87310a3ac..4c6fa60ee9 100644 --- a/plugins/tracker-resources/src/components/issues/KanbanView.svelte +++ b/plugins/tracker-resources/src/components/issues/KanbanView.svelte @@ -78,6 +78,7 @@ import PriorityEditor from './PriorityEditor.svelte' import StatusEditor from './StatusEditor.svelte' import EstimationEditor from './timereport/EstimationEditor.svelte' + import DueDatePresenter from './DueDatePresenter.svelte' export let space: Ref | undefined = undefined export let baseMenuClass: Ref> | undefined = undefined @@ -341,7 +342,7 @@
-
+
{#if issue && issue.subIssues > 0} {/if} @@ -355,6 +356,7 @@ width={''} bind:onlyIcon={fullFilled[issueId]} /> +
diff --git a/plugins/tracker-resources/src/plugin.ts b/plugins/tracker-resources/src/plugin.ts index 92bcba9840..10490a2a24 100644 --- a/plugins/tracker-resources/src/plugin.ts +++ b/plugins/tracker-resources/src/plugin.ts @@ -141,10 +141,6 @@ export default mergeIds(trackerId, tracker, { DocumentIcon: '' as IntlString, DocumentColor: '' as IntlString, Rank: '' as IntlString, - DueDatePopupTitle: '' as IntlString, - DueDatePopupOverdueTitle: '' as IntlString, - DueDatePopupDescription: '' as IntlString, - DueDatePopupOverdueDescription: '' as IntlString, Grouping: '' as IntlString, Ordering: '' as IntlString, CompletedIssues: '' as IntlString, diff --git a/plugins/tracker-resources/src/utils.ts b/plugins/tracker-resources/src/utils.ts index af23f6cff5..4884e64ca0 100644 --- a/plugins/tracker-resources/src/utils.ts +++ b/plugins/tracker-resources/src/utils.ts @@ -227,25 +227,6 @@ 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' - } -} - export type ComponentsViewMode = 'all' | 'backlog' | 'active' | 'closed' export type SprintViewMode = 'all' | 'planned' | 'active' | 'closed'