diff --git a/dev/tool/package.json b/dev/tool/package.json index fea308fbfa..0614834793 100644 --- a/dev/tool/package.json +++ b/dev/tool/package.json @@ -14,6 +14,7 @@ "docker:staging": "../../common/scripts/docker_tag.sh hardcoreeng/tool staging", "docker:push": "../../common/scripts/docker_tag.sh hardcoreeng/tool", "run-local": "cross-env MINIO_ACCESS_KEY=minioadmin MINIO_SECRET_KEY=minioadmin MINIO_ENDPOINT=localhost MONGO_URL=mongodb://localhost:27017 TRANSACTOR_URL=ws:/localhost:3333 TELEGRAM_DATABASE=telegram-service ELASTIC_URL=http://localhost:9200 REKONI_URL=http://localhost:4004 ts-node ./src/index.ts", + "upgrade": "rushx run-local upgrade", "lint": "eslint src", "format": "prettier --write src && eslint --fix src" }, diff --git a/models/recruit/src/index.ts b/models/recruit/src/index.ts index 37cafe75a0..a38c38cd3f 100644 --- a/models/recruit/src/index.ts +++ b/models/recruit/src/index.ts @@ -288,7 +288,10 @@ export function createModel (builder: Builder): void { const applicantKanbanLookup: Lookup = { attachedTo: recruit.mixin.Candidate, - assignee: contact.class.Employee + assignee: contact.class.Employee, + _id: { + todoItems: task.class.TodoItem + } } builder.createDoc(view.class.Viewlet, core.space.Model, { diff --git a/models/task/src/index.ts b/models/task/src/index.ts index 66fb59ffcf..d23fcb7168 100644 --- a/models/task/src/index.ts +++ b/models/task/src/index.ts @@ -334,9 +334,12 @@ export function createModel (builder: Builder): void { // eslint-disable-next-line @typescript-eslint/consistent-type-assertions options: { lookup: { - assignee: contact.class.Employee + assignee: contact.class.Employee, + _id: { + todoItems: task.class.TodoItem + } } - } as FindOptions, // TODO: fix + } as FindOptions, config: [] }) diff --git a/packages/ui/src/components/DatePicker.svelte b/packages/ui/src/components/DatePicker.svelte index 4270a8079c..67bf08852e 100644 --- a/packages/ui/src/components/DatePicker.svelte +++ b/packages/ui/src/components/DatePicker.svelte @@ -69,10 +69,9 @@ {#if show}{:else}{/if} -
- {#if value !== undefined} + {#if value != null} {:else} diff --git a/packages/ui/src/components/TooltipInstance.svelte b/packages/ui/src/components/TooltipInstance.svelte index 0dc4b93d8f..d85a55e43a 100644 --- a/packages/ui/src/components/TooltipInstance.svelte +++ b/packages/ui/src/components/TooltipInstance.svelte @@ -14,7 +14,7 @@ -->
@@ -38,7 +42,7 @@
- {formatName(object.$lookup?.attachedTo?.name)} + {formatName(object.$lookup?.attachedTo?.name ?? '')}
{object.$lookup?.attachedTo?.title ?? ''}
@@ -54,6 +58,13 @@
+ {#if todoItems.length > 0} + +
+ ( {doneTasks?.length}/ {todoItems.length} ) +
+
+ {/if}
{#if (object.attachments ?? 0) > 0}
diff --git a/plugins/task-assets/lang/en.json b/plugins/task-assets/lang/en.json index 490c67f189..8927deb8cf 100644 --- a/plugins/task-assets/lang/en.json +++ b/plugins/task-assets/lang/en.json @@ -74,6 +74,7 @@ "CantStatusDelete": "Can't delete status", "CantStatusDeleteError": "There are objects in the given state. Move or delete them first.", "Tasks": "Tasks", - "Assigned": "Assigned to me" + "Assigned": "Assigned to me", + "TodoItems": "Todos" } } \ No newline at end of file diff --git a/plugins/task-assets/lang/ru.json b/plugins/task-assets/lang/ru.json index a30d022099..9cef06dcdf 100644 --- a/plugins/task-assets/lang/ru.json +++ b/plugins/task-assets/lang/ru.json @@ -74,6 +74,7 @@ "CantStatusDelete": "Невозможно удалить статус", "CantStatusDeleteError": "Есть объекты с данным статусом. Сначала переместите или удалите их. ", "Tasks": "Задачи", - "Assigned": "Назначения" + "Assigned": "Назначения", + "TodoItems": "Todos" } } \ No newline at end of file diff --git a/plugins/task-resources/src/components/KanbanCard.svelte b/plugins/task-resources/src/components/KanbanCard.svelte index a02005abd9..4d8a6831c3 100644 --- a/plugins/task-resources/src/components/KanbanCard.svelte +++ b/plugins/task-resources/src/components/KanbanCard.svelte @@ -13,33 +13,52 @@ // limitations under the License. -->
- +
+ + {#if todoItems.length > 0} + +
+ ( {doneTasks?.length}/ {todoItems.length} ) +
+
+ {/if} +
- { showMenu(evt) }} icon={IconMoreH} size={'small'} /> + { + showMenu(evt) + }} + icon={IconMoreH} + size={'small'} + />
{object.name}
@@ -54,7 +73,7 @@ {/if}
-
+
diff --git a/plugins/task-resources/src/components/state/StatePresenter.svelte b/plugins/task-resources/src/components/state/StatePresenter.svelte index fcf57669d9..be9f70ae6f 100644 --- a/plugins/task-resources/src/components/state/StatePresenter.svelte +++ b/plugins/task-resources/src/components/state/StatePresenter.svelte @@ -19,7 +19,6 @@ export let value: State - {#if value}
{value.title} diff --git a/plugins/task-resources/src/components/todos/EditTodo.svelte b/plugins/task-resources/src/components/todos/EditTodo.svelte index 4b49841961..fc8040c7ff 100644 --- a/plugins/task-resources/src/components/todos/EditTodo.svelte +++ b/plugins/task-resources/src/components/todos/EditTodo.svelte @@ -24,15 +24,18 @@ export let item: TodoItem let name: string = '' - let dueTo: Date | undefined + let dueTo: Date | undefined | null = null let _itemId: Ref $: if (_itemId !== item._id) { _itemId = item._id name = item.name - dueTo = new Date(item.dueTo ?? 0) - console.log('AHTUNG', item, dueTo) + if (item.dueTo != null) { + dueTo = new Date(item.dueTo) + } else { + dueTo = null + } } const dispatch = createEventDispatcher() diff --git a/plugins/task-resources/src/components/todos/TodoItemsPopup.svelte b/plugins/task-resources/src/components/todos/TodoItemsPopup.svelte new file mode 100644 index 0000000000..aa88debfa7 --- /dev/null +++ b/plugins/task-resources/src/components/todos/TodoItemsPopup.svelte @@ -0,0 +1,54 @@ + + + +
+ {#if todos.length > 0} + + {/if} + + + diff --git a/plugins/task-resources/src/components/todos/TodoStatePresenter.svelte b/plugins/task-resources/src/components/todos/TodoStatePresenter.svelte index 5d755f9392..1a7442645b 100644 --- a/plugins/task-resources/src/components/todos/TodoStatePresenter.svelte +++ b/plugins/task-resources/src/components/todos/TodoStatePresenter.svelte @@ -15,17 +15,15 @@ --> - -{#if value } +{#if value !== undefined }
diff --git a/plugins/task-resources/src/index.ts b/plugins/task-resources/src/index.ts index e5becc1953..1114623613 100644 --- a/plugins/task-resources/src/index.ts +++ b/plugins/task-resources/src/index.ts @@ -37,6 +37,7 @@ import TaskItem from './components/TaskItem.svelte' import TaskPresenter from './components/TaskPresenter.svelte' import TemplatesIcon from './components/TemplatesIcon.svelte' import TodoItemPresenter from './components/todos/TodoItemPresenter.svelte' +import TodoItemsPopup from './components/todos/TodoItemsPopup.svelte' import Todos from './components/todos/Todos.svelte' import TodoStatePresenter from './components/todos/TodoStatePresenter.svelte' import AssignedTasks from './components/AssignedTasks.svelte' @@ -147,7 +148,8 @@ export default async (): Promise => ({ DoneStateEditor, KanbanTemplateEditor, KanbanTemplateSelector, - AssignedTasks + AssignedTasks, + TodoItemsPopup }, actionImpl: { CreateTask: createTask, diff --git a/plugins/task/src/index.ts b/plugins/task/src/index.ts index a899392817..055725703b 100644 --- a/plugins/task/src/index.ts +++ b/plugins/task/src/index.ts @@ -227,7 +227,11 @@ const task = plugin(taskId, { }, component: { KanbanTemplateEditor: '' as AnyComponent, - KanbanTemplateSelector: '' as AnyComponent + KanbanTemplateSelector: '' as AnyComponent, + TodoItemsPopup: '' as AnyComponent + }, + string: { + TodoItems: '' as IntlString } })