From 287652f27954eedeee28bdddbbc6d108759920df Mon Sep 17 00:00:00 2001 From: Denis Bykhov Date: Thu, 29 Feb 2024 00:53:09 +0600 Subject: [PATCH] planning (#4814) Signed-off-by: Denis Bykhov --- common/config/rush/pnpm-lock.yaml | 237 +++++++ models/server-time/.eslintrc.js | 7 + models/server-time/.npmignore | 4 + models/server-time/config/rig.json | 5 + models/server-time/package.json | 41 ++ models/server-time/src/index.ts | 84 +++ models/server-time/tsconfig.json | 10 + models/time/.eslintrc.js | 7 + models/time/.npmignore | 4 + models/time/config/rig.json | 5 + models/time/package.json | 55 ++ models/time/src/index.ts | 369 +++++++++++ models/time/src/migration.ts | 165 +++++ models/time/src/plugin.ts | 68 ++ models/time/tsconfig.json | 10 + plugins/time-assets/.eslintrc.js | 7 + plugins/time-assets/assets/icons.svg | 47 ++ plugins/time-assets/config/rig.json | 5 + plugins/time-assets/jest.config.js | 7 + plugins/time-assets/lang/en.json | 54 ++ plugins/time-assets/lang/ru.json | 54 ++ plugins/time-assets/package.json | 40 ++ .../time-assets/src/__tests__/lang.test.ts | 6 + plugins/time-assets/src/index.ts | 29 + plugins/time-assets/tsconfig.json | 11 + plugins/time-resources/.eslintrc.js | 4 + plugins/time-resources/config/rig.json | 5 + plugins/time-resources/jest.config.js | 7 + plugins/time-resources/package.json | 67 ++ plugins/time-resources/postcss.config.js | 5 + .../src/components/Border.svelte | 6 + .../src/components/CreateToDo.svelte | 65 ++ .../src/components/CreateToDoPopup.svelte | 295 +++++++++ .../src/components/DueDateEditor.svelte | 55 ++ .../src/components/EditToDo.svelte | 271 ++++++++ .../src/components/EditWorkSlot.svelte | 194 ++++++ .../src/components/EmployeeSelector.svelte | 61 ++ .../src/components/Header.svelte | 81 +++ .../time-resources/src/components/Me.svelte | 11 + .../NotificationToDoPresenter.svelte | 30 + .../src/components/PlanView.svelte | 98 +++ .../src/components/PlanningCalendar.svelte | 243 ++++++++ .../src/components/PriorityEditor.svelte | 89 +++ .../src/components/PriorityPresenter.svelte | 38 ++ .../src/components/TaskSelector.svelte | 42 ++ .../src/components/ToDoDatePresenter.svelte | 107 ++++ .../src/components/ToDoDuration.svelte | 35 ++ .../src/components/ToDoElement.svelte | 169 +++++ .../src/components/ToDoGroup.svelte | 124 ++++ .../src/components/ToDoPresenter.svelte | 74 +++ .../src/components/ToDos.svelte | 317 ++++++++++ .../src/components/ToDosNavigator.svelte | 233 +++++++ .../src/components/TodoWorkslots.svelte | 94 +++ .../src/components/WorkItemPresenter.svelte | 53 ++ .../src/components/WorkSlotElement.svelte | 38 ++ .../src/components/Workslots.svelte | 82 +++ .../src/components/icons/Diff.svelte | 36 ++ .../src/components/icons/Menu.svelte | 27 + .../src/components/icons/Sun.svelte | 67 ++ .../presenters/ApplicantPresenter.svelte | 42 ++ .../presenters/CardPresenter.svelte | 28 + .../presenters/IssuePresenter.svelte | 162 +++++ .../presenters/LeadPresenter.svelte | 41 ++ .../presenters/TimePresenter.svelte | 27 + .../src/components/team/Team.svelte | 81 +++ .../src/components/team/TeamNavigator.svelte | 90 +++ .../src/components/team/WithTeamData.svelte | 110 ++++ .../src/components/team/agenda/Agenda.svelte | 101 +++ .../src/components/team/agenda/DayPlan.svelte | 49 ++ .../components/team/agenda/EventItem.svelte | 44 ++ .../components/team/agenda/PlanGroup.svelte | 42 ++ .../components/team/agenda/PlanItem.svelte | 57 ++ .../components/team/agenda/PlanPerson.svelte | 94 +++ .../components/team/calendar/Calendar.svelte | 62 ++ .../team/calendar/EventElement.svelte | 92 +++ .../team/calendar/PersonCalendar.svelte | 319 ++++++++++ .../team/calendar/TeamCalendar.svelte | 240 +++++++ .../team/calendar/TeamCalendarDay.svelte | 171 +++++ .../components/team/calendar/TxPanel.svelte | 70 +++ .../src/components/team/utils.ts | 201 ++++++ plugins/time-resources/src/index.ts | 51 ++ plugins/time-resources/src/plugin.ts | 60 ++ plugins/time-resources/src/types.ts | 27 + plugins/time-resources/src/utils.ts | 35 ++ plugins/time-resources/svelte.config.js | 5 + plugins/time-resources/tsconfig.json | 9 + plugins/time/.eslintrc.js | 7 + plugins/time/.npmignore | 4 + plugins/time/config/rig.json | 4 + plugins/time/jest.config.js | 7 + plugins/time/package.json | 43 ++ plugins/time/src/index.ts | 140 +++++ plugins/time/tsconfig.json | 10 + rush.json | 37 +- server-plugins/time-resources/.eslintrc.js | 7 + server-plugins/time-resources/.npmignore | 4 + server-plugins/time-resources/config/rig.json | 4 + server-plugins/time-resources/jest.config.js | 7 + server-plugins/time-resources/package.json | 47 ++ server-plugins/time-resources/src/index.ts | 586 ++++++++++++++++++ server-plugins/time-resources/tsconfig.json | 10 + server-plugins/time/.eslintrc.js | 7 + server-plugins/time/.npmignore | 4 + server-plugins/time/config/rig.json | 4 + server-plugins/time/jest.config.js | 7 + server-plugins/time/package.json | 43 ++ server-plugins/time/src/index.ts | 61 ++ server-plugins/time/tsconfig.json | 10 + 108 files changed, 7816 insertions(+), 1 deletion(-) create mode 100644 models/server-time/.eslintrc.js create mode 100644 models/server-time/.npmignore create mode 100644 models/server-time/config/rig.json create mode 100644 models/server-time/package.json create mode 100644 models/server-time/src/index.ts create mode 100644 models/server-time/tsconfig.json create mode 100644 models/time/.eslintrc.js create mode 100644 models/time/.npmignore create mode 100644 models/time/config/rig.json create mode 100644 models/time/package.json create mode 100644 models/time/src/index.ts create mode 100644 models/time/src/migration.ts create mode 100644 models/time/src/plugin.ts create mode 100644 models/time/tsconfig.json create mode 100644 plugins/time-assets/.eslintrc.js create mode 100644 plugins/time-assets/assets/icons.svg create mode 100644 plugins/time-assets/config/rig.json create mode 100644 plugins/time-assets/jest.config.js create mode 100644 plugins/time-assets/lang/en.json create mode 100644 plugins/time-assets/lang/ru.json create mode 100644 plugins/time-assets/package.json create mode 100644 plugins/time-assets/src/__tests__/lang.test.ts create mode 100644 plugins/time-assets/src/index.ts create mode 100644 plugins/time-assets/tsconfig.json create mode 100644 plugins/time-resources/.eslintrc.js create mode 100644 plugins/time-resources/config/rig.json create mode 100644 plugins/time-resources/jest.config.js create mode 100644 plugins/time-resources/package.json create mode 100644 plugins/time-resources/postcss.config.js create mode 100644 plugins/time-resources/src/components/Border.svelte create mode 100644 plugins/time-resources/src/components/CreateToDo.svelte create mode 100644 plugins/time-resources/src/components/CreateToDoPopup.svelte create mode 100644 plugins/time-resources/src/components/DueDateEditor.svelte create mode 100644 plugins/time-resources/src/components/EditToDo.svelte create mode 100644 plugins/time-resources/src/components/EditWorkSlot.svelte create mode 100644 plugins/time-resources/src/components/EmployeeSelector.svelte create mode 100644 plugins/time-resources/src/components/Header.svelte create mode 100644 plugins/time-resources/src/components/Me.svelte create mode 100644 plugins/time-resources/src/components/NotificationToDoPresenter.svelte create mode 100644 plugins/time-resources/src/components/PlanView.svelte create mode 100644 plugins/time-resources/src/components/PlanningCalendar.svelte create mode 100644 plugins/time-resources/src/components/PriorityEditor.svelte create mode 100644 plugins/time-resources/src/components/PriorityPresenter.svelte create mode 100644 plugins/time-resources/src/components/TaskSelector.svelte create mode 100644 plugins/time-resources/src/components/ToDoDatePresenter.svelte create mode 100644 plugins/time-resources/src/components/ToDoDuration.svelte create mode 100644 plugins/time-resources/src/components/ToDoElement.svelte create mode 100644 plugins/time-resources/src/components/ToDoGroup.svelte create mode 100644 plugins/time-resources/src/components/ToDoPresenter.svelte create mode 100644 plugins/time-resources/src/components/ToDos.svelte create mode 100644 plugins/time-resources/src/components/ToDosNavigator.svelte create mode 100644 plugins/time-resources/src/components/TodoWorkslots.svelte create mode 100644 plugins/time-resources/src/components/WorkItemPresenter.svelte create mode 100644 plugins/time-resources/src/components/WorkSlotElement.svelte create mode 100644 plugins/time-resources/src/components/Workslots.svelte create mode 100644 plugins/time-resources/src/components/icons/Diff.svelte create mode 100644 plugins/time-resources/src/components/icons/Menu.svelte create mode 100644 plugins/time-resources/src/components/icons/Sun.svelte create mode 100644 plugins/time-resources/src/components/presenters/ApplicantPresenter.svelte create mode 100644 plugins/time-resources/src/components/presenters/CardPresenter.svelte create mode 100644 plugins/time-resources/src/components/presenters/IssuePresenter.svelte create mode 100644 plugins/time-resources/src/components/presenters/LeadPresenter.svelte create mode 100644 plugins/time-resources/src/components/presenters/TimePresenter.svelte create mode 100644 plugins/time-resources/src/components/team/Team.svelte create mode 100644 plugins/time-resources/src/components/team/TeamNavigator.svelte create mode 100644 plugins/time-resources/src/components/team/WithTeamData.svelte create mode 100644 plugins/time-resources/src/components/team/agenda/Agenda.svelte create mode 100644 plugins/time-resources/src/components/team/agenda/DayPlan.svelte create mode 100644 plugins/time-resources/src/components/team/agenda/EventItem.svelte create mode 100644 plugins/time-resources/src/components/team/agenda/PlanGroup.svelte create mode 100644 plugins/time-resources/src/components/team/agenda/PlanItem.svelte create mode 100644 plugins/time-resources/src/components/team/agenda/PlanPerson.svelte create mode 100644 plugins/time-resources/src/components/team/calendar/Calendar.svelte create mode 100644 plugins/time-resources/src/components/team/calendar/EventElement.svelte create mode 100644 plugins/time-resources/src/components/team/calendar/PersonCalendar.svelte create mode 100644 plugins/time-resources/src/components/team/calendar/TeamCalendar.svelte create mode 100644 plugins/time-resources/src/components/team/calendar/TeamCalendarDay.svelte create mode 100644 plugins/time-resources/src/components/team/calendar/TxPanel.svelte create mode 100644 plugins/time-resources/src/components/team/utils.ts create mode 100644 plugins/time-resources/src/index.ts create mode 100644 plugins/time-resources/src/plugin.ts create mode 100644 plugins/time-resources/src/types.ts create mode 100644 plugins/time-resources/src/utils.ts create mode 100644 plugins/time-resources/svelte.config.js create mode 100644 plugins/time-resources/tsconfig.json create mode 100644 plugins/time/.eslintrc.js create mode 100644 plugins/time/.npmignore create mode 100644 plugins/time/config/rig.json create mode 100644 plugins/time/jest.config.js create mode 100644 plugins/time/package.json create mode 100644 plugins/time/src/index.ts create mode 100644 plugins/time/tsconfig.json create mode 100644 server-plugins/time-resources/.eslintrc.js create mode 100644 server-plugins/time-resources/.npmignore create mode 100644 server-plugins/time-resources/config/rig.json create mode 100644 server-plugins/time-resources/jest.config.js create mode 100644 server-plugins/time-resources/package.json create mode 100644 server-plugins/time-resources/src/index.ts create mode 100644 server-plugins/time-resources/tsconfig.json create mode 100644 server-plugins/time/.eslintrc.js create mode 100644 server-plugins/time/.npmignore create mode 100644 server-plugins/time/config/rig.json create mode 100644 server-plugins/time/jest.config.js create mode 100644 server-plugins/time/package.json create mode 100644 server-plugins/time/src/index.ts create mode 100644 server-plugins/time/tsconfig.json diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index dc8f938802..513fa15a66 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -338,6 +338,9 @@ dependencies: '@rush-temp/model-server-templates': specifier: file:./projects/model-server-templates.tgz version: file:projects/model-server-templates.tgz(svelte@4.2.11) + '@rush-temp/model-server-time': + specifier: file:./projects/model-server-time.tgz + version: file:projects/model-server-time.tgz(svelte@4.2.11) '@rush-temp/model-server-tracker': specifier: file:./projects/model-server-tracker.tgz version: file:projects/model-server-tracker.tgz(svelte@4.2.11) @@ -368,6 +371,9 @@ dependencies: '@rush-temp/model-text-editor': specifier: file:./projects/model-text-editor.tgz version: file:projects/model-text-editor.tgz(svelte@4.2.11) + '@rush-temp/model-time': + specifier: file:./projects/model-time.tgz + version: file:projects/model-time.tgz(svelte@4.2.11) '@rush-temp/model-tracker': specifier: file:./projects/model-tracker.tgz version: file:projects/model-tracker.tgz(svelte@4.2.11) @@ -578,6 +584,12 @@ dependencies: '@rush-temp/server-templates': specifier: file:./projects/server-templates.tgz version: file:projects/server-templates.tgz(esbuild@0.20.1)(svelte@4.2.11)(ts-node@10.9.2) + '@rush-temp/server-time': + specifier: file:./projects/server-time.tgz + version: file:projects/server-time.tgz(esbuild@0.20.1)(svelte@4.2.11)(ts-node@10.9.2) + '@rush-temp/server-time-resources': + specifier: file:./projects/server-time-resources.tgz + version: file:projects/server-time-resources.tgz(@types/node@20.11.19)(esbuild@0.20.1)(svelte@4.2.11)(ts-node@10.9.2) '@rush-temp/server-token': specifier: file:./projects/server-token.tgz version: file:projects/server-token.tgz(esbuild@0.20.1)(svelte@4.2.11)(ts-node@10.9.2) @@ -668,6 +680,15 @@ dependencies: '@rush-temp/theme': specifier: file:./projects/theme.tgz version: file:projects/theme.tgz(@types/node@20.11.19)(esbuild@0.20.1)(postcss-load-config@4.0.2)(postcss@8.4.35)(ts-node@10.9.2) + '@rush-temp/time': + specifier: file:./projects/time.tgz + version: file:projects/time.tgz(@types/node@20.11.19)(esbuild@0.20.1)(svelte@4.2.11)(ts-node@10.9.2) + '@rush-temp/time-assets': + specifier: file:./projects/time-assets.tgz + version: file:projects/time-assets.tgz(esbuild@0.20.1)(svelte@4.2.11)(ts-node@10.9.2) + '@rush-temp/time-resources': + specifier: file:./projects/time-resources.tgz + version: file:projects/time-resources.tgz(@types/node@20.11.19)(esbuild@0.20.1)(postcss-load-config@4.0.2)(postcss@8.4.35)(ts-node@10.9.2) '@rush-temp/tool': specifier: file:./projects/tool.tgz version: file:projects/tool.tgz(bufferutil@4.0.8)(svelte@4.2.11) @@ -19942,6 +19963,27 @@ packages: - svelte dev: false + file:projects/model-server-time.tgz(svelte@4.2.11): + resolution: {integrity: sha512-u27Dbh9sMM9RQznVDnMB5Tzj+FKN98E16dNoWVTz9G1YzhnPXxi2ZDD1hYtlYH//G/Cc9qfls+ggB8OKrm4cMQ==, tarball: file:projects/model-server-time.tgz} + id: file:projects/model-server-time.tgz + name: '@rush-temp/model-server-time' + version: 0.0.0 + dependencies: + '@typescript-eslint/eslint-plugin': 6.21.0(@typescript-eslint/parser@6.21.0)(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.21.0(eslint@8.56.0)(typescript@5.3.3) + eslint: 8.56.0 + eslint-config-standard-with-typescript: 40.0.0(@typescript-eslint/eslint-plugin@6.21.0)(eslint-plugin-import@2.29.1)(eslint-plugin-n@15.7.0)(eslint-plugin-promise@6.1.1)(eslint@8.56.0)(typescript@5.3.3) + eslint-plugin-import: 2.29.1(eslint@8.56.0) + eslint-plugin-n: 15.7.0(eslint@8.56.0) + eslint-plugin-promise: 6.1.1(eslint@8.56.0) + prettier: 3.2.5 + prettier-plugin-svelte: 3.2.1(prettier@3.2.5)(svelte@4.2.11) + typescript: 5.3.3 + transitivePeerDependencies: + - supports-color + - svelte + dev: false + file:projects/model-server-tracker.tgz(svelte@4.2.11): resolution: {integrity: sha512-8TqauIOhrL/TrZIwsKyaixz5G2XlQjulPp9aMFm7gMxRHm7b3bjUiPI7SZ0bC4+kP99o5mxepmyiLsU/XrYSig==, tarball: file:projects/model-server-tracker.tgz} id: file:projects/model-server-tracker.tgz @@ -20152,6 +20194,27 @@ packages: - svelte dev: false + file:projects/model-time.tgz(svelte@4.2.11): + resolution: {integrity: sha512-XCIFtZCPReL043R2aEMcHhdSvq2w7h+GsMsXAb1mKMfjMPLDbRoF5631UKaNve3s4hnFHajVkKqZmP+ERL0LPQ==, tarball: file:projects/model-time.tgz} + id: file:projects/model-time.tgz + name: '@rush-temp/model-time' + version: 0.0.0 + dependencies: + '@typescript-eslint/eslint-plugin': 6.21.0(@typescript-eslint/parser@6.21.0)(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.21.0(eslint@8.56.0)(typescript@5.3.3) + eslint: 8.56.0 + eslint-config-standard-with-typescript: 40.0.0(@typescript-eslint/eslint-plugin@6.21.0)(eslint-plugin-import@2.29.1)(eslint-plugin-n@15.7.0)(eslint-plugin-promise@6.1.1)(eslint@8.56.0)(typescript@5.3.3) + eslint-plugin-import: 2.29.1(eslint@8.56.0) + eslint-plugin-n: 15.7.0(eslint@8.56.0) + eslint-plugin-promise: 6.1.1(eslint@8.56.0) + prettier: 3.2.5 + prettier-plugin-svelte: 3.2.1(prettier@3.2.5)(svelte@4.2.11) + typescript: 5.3.3 + transitivePeerDependencies: + - supports-color + - svelte + dev: false + file:projects/model-tracker.tgz(svelte@4.2.11): resolution: {integrity: sha512-JekAX6mPwRvA0RvyDDELrdcyCDDGYtSeqseUfklkZZKSj0t3zrAT1KQlmIFTe05x3uqOMCcQXgPRVBvtgsPqUA==, tarball: file:projects/model-tracker.tgz} id: file:projects/model-tracker.tgz @@ -22537,6 +22600,70 @@ packages: - ts-node dev: false + file:projects/server-time-resources.tgz(@types/node@20.11.19)(esbuild@0.20.1)(svelte@4.2.11)(ts-node@10.9.2): + resolution: {integrity: sha512-KLlFROUBWJhmETbztTgHNZYtWRTcuHOndKlim9XA1mSduJH3cHdlboqUEttVIA8ed1X9QeJ6X4Ct/HM4gigPUw==, tarball: file:projects/server-time-resources.tgz} + id: file:projects/server-time-resources.tgz + name: '@rush-temp/server-time-resources' + version: 0.0.0 + dependencies: + '@types/jest': 29.5.12 + '@typescript-eslint/eslint-plugin': 6.21.0(@typescript-eslint/parser@6.21.0)(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.21.0(eslint@8.56.0)(typescript@5.3.3) + eslint: 8.56.0 + eslint-config-standard-with-typescript: 40.0.0(@typescript-eslint/eslint-plugin@6.21.0)(eslint-plugin-import@2.29.1)(eslint-plugin-n@15.7.0)(eslint-plugin-promise@6.1.1)(eslint@8.56.0)(typescript@5.3.3) + eslint-plugin-import: 2.29.1(eslint@8.56.0) + eslint-plugin-n: 15.7.0(eslint@8.56.0) + eslint-plugin-promise: 6.1.1(eslint@8.56.0) + jest: 29.7.0(@types/node@20.11.19)(ts-node@10.9.2) + prettier: 3.2.5 + prettier-plugin-svelte: 3.2.1(prettier@3.2.5)(svelte@4.2.11) + ts-jest: 29.1.2(esbuild@0.20.1)(jest@29.7.0)(typescript@5.3.3) + typescript: 5.3.3 + transitivePeerDependencies: + - '@babel/core' + - '@jest/types' + - '@types/node' + - babel-jest + - babel-plugin-macros + - esbuild + - node-notifier + - supports-color + - svelte + - ts-node + dev: false + + file:projects/server-time.tgz(esbuild@0.20.1)(svelte@4.2.11)(ts-node@10.9.2): + resolution: {integrity: sha512-bq1MSajRmqHhjS/q5aSewETO75Yy9w/fi8MHU5ZpWcV2MNTyR3Do4oi7ei1KRyEq6NRncwRAH6R5inlvkaGeIQ==, tarball: file:projects/server-time.tgz} + id: file:projects/server-time.tgz + name: '@rush-temp/server-time' + version: 0.0.0 + dependencies: + '@types/jest': 29.5.12 + '@types/node': 20.11.19 + '@typescript-eslint/eslint-plugin': 6.21.0(@typescript-eslint/parser@6.21.0)(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.21.0(eslint@8.56.0)(typescript@5.3.3) + eslint: 8.56.0 + eslint-config-standard-with-typescript: 40.0.0(@typescript-eslint/eslint-plugin@6.21.0)(eslint-plugin-import@2.29.1)(eslint-plugin-n@15.7.0)(eslint-plugin-promise@6.1.1)(eslint@8.56.0)(typescript@5.3.3) + eslint-plugin-import: 2.29.1(eslint@8.56.0) + eslint-plugin-n: 15.7.0(eslint@8.56.0) + eslint-plugin-promise: 6.1.1(eslint@8.56.0) + jest: 29.7.0(@types/node@20.11.19)(ts-node@10.9.2) + prettier: 3.2.5 + prettier-plugin-svelte: 3.2.1(prettier@3.2.5)(svelte@4.2.11) + ts-jest: 29.1.2(esbuild@0.20.1)(jest@29.7.0)(typescript@5.3.3) + typescript: 5.3.3 + transitivePeerDependencies: + - '@babel/core' + - '@jest/types' + - babel-jest + - babel-plugin-macros + - esbuild + - node-notifier + - supports-color + - svelte + - ts-node + dev: false + file:projects/server-token.tgz(esbuild@0.20.1)(svelte@4.2.11)(ts-node@10.9.2): resolution: {integrity: sha512-njkCF8ZsS1x6rIwZPjyN368EONN8FrN9R+6f3yYoMR+2luiJt/GknPNNopZwuvEIcorJ43fUC79ECsJFMzHfMg==, tarball: file:projects/server-token.tgz} id: file:projects/server-token.tgz @@ -23746,6 +23873,116 @@ packages: - ts-node dev: false + file:projects/time-assets.tgz(esbuild@0.20.1)(svelte@4.2.11)(ts-node@10.9.2): + resolution: {integrity: sha512-GdLQ03f2nfzZmXBSyNztwmlmUv3yJe4fDz93b8MuOJIX4Ajd+4ylmwz454yb6Pc8w1PnWRLexFg0/mmjqWlc3w==, tarball: file:projects/time-assets.tgz} + id: file:projects/time-assets.tgz + name: '@rush-temp/time-assets' + version: 0.0.0 + dependencies: + '@types/jest': 29.5.12 + '@types/node': 20.11.19 + '@typescript-eslint/eslint-plugin': 6.21.0(@typescript-eslint/parser@6.21.0)(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.21.0(eslint@8.56.0)(typescript@5.3.3) + eslint: 8.56.0 + eslint-config-standard-with-typescript: 40.0.0(@typescript-eslint/eslint-plugin@6.21.0)(eslint-plugin-import@2.29.1)(eslint-plugin-n@15.7.0)(eslint-plugin-promise@6.1.1)(eslint@8.56.0)(typescript@5.3.3) + eslint-plugin-import: 2.29.1(eslint@8.56.0) + eslint-plugin-n: 15.7.0(eslint@8.56.0) + eslint-plugin-promise: 6.1.1(eslint@8.56.0) + jest: 29.7.0(@types/node@20.11.19)(ts-node@10.9.2) + prettier: 3.2.5 + prettier-plugin-svelte: 3.2.1(prettier@3.2.5)(svelte@4.2.11) + ts-jest: 29.1.2(esbuild@0.20.1)(jest@29.7.0)(typescript@5.3.3) + typescript: 5.3.3 + transitivePeerDependencies: + - '@babel/core' + - '@jest/types' + - babel-jest + - babel-plugin-macros + - esbuild + - node-notifier + - supports-color + - svelte + - ts-node + dev: false + + file:projects/time-resources.tgz(@types/node@20.11.19)(esbuild@0.20.1)(postcss-load-config@4.0.2)(postcss@8.4.35)(ts-node@10.9.2): + resolution: {integrity: sha512-Qeyao7d/LxS2q9N19l1zoSB76fYbicJwz6zhE3tQDOUfR061XG9n3YlTxgoaBA4GNtKDJc9EI7smbVybGYH1Yw==, tarball: file:projects/time-resources.tgz} + id: file:projects/time-resources.tgz + name: '@rush-temp/time-resources' + version: 0.0.0 + dependencies: + '@types/jest': 29.5.12 + '@typescript-eslint/eslint-plugin': 6.21.0(@typescript-eslint/parser@6.21.0)(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.21.0(eslint@8.56.0)(typescript@5.3.3) + eslint: 8.56.0 + eslint-config-standard-with-typescript: 40.0.0(@typescript-eslint/eslint-plugin@6.21.0)(eslint-plugin-import@2.29.1)(eslint-plugin-n@15.7.0)(eslint-plugin-promise@6.1.1)(eslint@8.56.0)(typescript@5.3.3) + eslint-plugin-import: 2.29.1(eslint@8.56.0) + eslint-plugin-n: 15.7.0(eslint@8.56.0) + eslint-plugin-promise: 6.1.1(eslint@8.56.0) + eslint-plugin-svelte: 2.35.1(eslint@8.56.0)(svelte@4.2.11)(ts-node@10.9.2) + fast-equals: 2.0.4 + jest: 29.7.0(@types/node@20.11.19)(ts-node@10.9.2) + prettier: 3.2.5 + prettier-plugin-svelte: 3.2.1(prettier@3.2.5)(svelte@4.2.11) + sass: 1.71.1 + svelte: 4.2.11 + svelte-check: 3.6.4(postcss-load-config@4.0.2)(postcss@8.4.35)(sass@1.71.1)(svelte@4.2.11) + svelte-eslint-parser: 0.33.1(svelte@4.2.11) + svelte-loader: 3.1.9(svelte@4.2.11) + svelte-preprocess: 5.1.3(postcss-load-config@4.0.2)(postcss@8.4.35)(sass@1.71.1)(svelte@4.2.11)(typescript@5.3.3) + ts-jest: 29.1.2(esbuild@0.20.1)(jest@29.7.0)(typescript@5.3.3) + typescript: 5.3.3 + transitivePeerDependencies: + - '@babel/core' + - '@jest/types' + - '@types/node' + - babel-jest + - babel-plugin-macros + - coffeescript + - esbuild + - less + - node-notifier + - postcss + - postcss-load-config + - pug + - stylus + - sugarss + - supports-color + - ts-node + dev: false + + file:projects/time.tgz(@types/node@20.11.19)(esbuild@0.20.1)(svelte@4.2.11)(ts-node@10.9.2): + resolution: {integrity: sha512-yneBtaqzPc7z4BLY6cwk+dinYNBWnH6+hsN82ELJW3PQLH7zlZxXEIvUOVeTlz0CyAj9WFHIk/x/mDmyduITvQ==, tarball: file:projects/time.tgz} + id: file:projects/time.tgz + name: '@rush-temp/time' + version: 0.0.0 + dependencies: + '@types/jest': 29.5.12 + '@typescript-eslint/eslint-plugin': 6.21.0(@typescript-eslint/parser@6.21.0)(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.21.0(eslint@8.56.0)(typescript@5.3.3) + eslint: 8.56.0 + eslint-config-standard-with-typescript: 40.0.0(@typescript-eslint/eslint-plugin@6.21.0)(eslint-plugin-import@2.29.1)(eslint-plugin-n@15.7.0)(eslint-plugin-promise@6.1.1)(eslint@8.56.0)(typescript@5.3.3) + eslint-plugin-import: 2.29.1(eslint@8.56.0) + eslint-plugin-n: 15.7.0(eslint@8.56.0) + eslint-plugin-promise: 6.1.1(eslint@8.56.0) + jest: 29.7.0(@types/node@20.11.19)(ts-node@10.9.2) + prettier: 3.2.5 + prettier-plugin-svelte: 3.2.1(prettier@3.2.5)(svelte@4.2.11) + ts-jest: 29.1.2(esbuild@0.20.1)(jest@29.7.0)(typescript@5.3.3) + typescript: 5.3.3 + transitivePeerDependencies: + - '@babel/core' + - '@jest/types' + - '@types/node' + - babel-jest + - babel-plugin-macros + - esbuild + - node-notifier + - supports-color + - svelte + - ts-node + dev: false + file:projects/tool.tgz(bufferutil@4.0.8)(svelte@4.2.11): resolution: {integrity: sha512-u/v+y38hfzb8fBpMNT1IkihE0UA06lngEqh/bQWl6rMb4EMKOVc6V5N6YPq41mLIQvDnqMz4mzDsVRlq6c4HDQ==, tarball: file:projects/tool.tgz} id: file:projects/tool.tgz diff --git a/models/server-time/.eslintrc.js b/models/server-time/.eslintrc.js new file mode 100644 index 0000000000..c1cf82cba0 --- /dev/null +++ b/models/server-time/.eslintrc.js @@ -0,0 +1,7 @@ +module.exports = { + extends: ['./node_modules/@hcengineering/platform-rig/profiles/model/eslint.config.json'], + parserOptions: { + tsconfigRootDir: __dirname, + project: './tsconfig.json' + } +} diff --git a/models/server-time/.npmignore b/models/server-time/.npmignore new file mode 100644 index 0000000000..e3ec093c38 --- /dev/null +++ b/models/server-time/.npmignore @@ -0,0 +1,4 @@ +* +!/lib/** +!CHANGELOG.md +/lib/**/__tests__/ diff --git a/models/server-time/config/rig.json b/models/server-time/config/rig.json new file mode 100644 index 0000000000..2f6be36605 --- /dev/null +++ b/models/server-time/config/rig.json @@ -0,0 +1,5 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json", + "rigPackageName": "@hcengineering/platform-rig", + "rigProfile": "model" +} diff --git a/models/server-time/package.json b/models/server-time/package.json new file mode 100644 index 0000000000..9102855726 --- /dev/null +++ b/models/server-time/package.json @@ -0,0 +1,41 @@ +{ + "name": "@hcengineering/model-server-time", + "version": "0.6.0", + "main": "lib/index.js", + "svelte": "src/index.ts", + "types": "types/index.d.ts", + "author": "Anticrm Platform Contributors", + "template": "@hcengineering/model-package", + "license": "EPL-2.0", + "scripts": { + "build": "compile", + "build:watch": "compile", + "format": "format src", + "_phase:build": "compile transpile src", + "_phase:format": "format src", + "_phase:validate": "compile validate" + }, + "devDependencies": { + "@hcengineering/platform-rig": "^0.6.0", + "@typescript-eslint/eslint-plugin": "^6.11.0", + "eslint-plugin-import": "^2.26.0", + "eslint-plugin-promise": "^6.1.1", + "eslint-plugin-n": "^15.4.0", + "eslint": "^8.54.0", + "@typescript-eslint/parser": "^6.11.0", + "eslint-config-standard-with-typescript": "^40.0.0", + "prettier": "^3.1.0", + "prettier-plugin-svelte": "^3.1.0", + "typescript": "^5.3.3" + }, + "dependencies": { + "@hcengineering/core": "^0.6.28", + "@hcengineering/model": "^0.6.7", + "@hcengineering/platform": "^0.6.9", + "@hcengineering/server-time": "^0.6.0", + "@hcengineering/time": "^0.6.0", + "@hcengineering/tracker": "^0.6.13", + "@hcengineering/server-core": "^0.6.1", + "@hcengineering/model-core": "^0.6.0" + } +} diff --git a/models/server-time/src/index.ts b/models/server-time/src/index.ts new file mode 100644 index 0000000000..5803e518e7 --- /dev/null +++ b/models/server-time/src/index.ts @@ -0,0 +1,84 @@ +// +// Copyright © 2023 Hardcore Engineering Inc. +// +// Licensed under the Eclipse Public License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. You may +// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import { Mixin, type Builder } from '@hcengineering/model' + +import core, { type Tx } from '@hcengineering/core' +import { TClass } from '@hcengineering/model-core' +import { type Resource } from '@hcengineering/platform' +import serverCore, { type TriggerControl } from '@hcengineering/server-core' +import tracker from '@hcengineering/tracker' +import serverTime, { type ToDoFactory, type OnToDo } from '@hcengineering/server-time' +import { type ToDo, type WorkSlot } from '@hcengineering/time' + +@Mixin(serverTime.mixin.ToDoFactory, core.class.Class) +export class TToDoFactory extends TClass implements ToDoFactory { + factory!: Resource<(tx: Tx, control: TriggerControl) => Promise> +} + +@Mixin(serverTime.mixin.OnToDo, core.class.Class) +export class TOnToDo extends TClass implements OnToDo { + onDone!: Resource<(control: TriggerControl, workslots: WorkSlot[], todo: ToDo) => Promise> +} + +export function createModel (builder: Builder): void { + builder.createModel(TToDoFactory, TOnToDo) + + builder.createDoc(serverCore.class.Trigger, core.space.Model, { + trigger: serverTime.trigger.OnTask + }) + + builder.createDoc(serverCore.class.Trigger, core.space.Model, { + trigger: serverTime.trigger.OnToDoUpdate, + txMatch: { + _class: core.class.TxCollectionCUD, + 'tx._class': core.class.TxUpdateDoc + } + }) + + builder.createDoc(serverCore.class.Trigger, core.space.Model, { + trigger: serverTime.trigger.OnToDoRemove, + txMatch: { + _class: core.class.TxCollectionCUD, + 'tx._class': core.class.TxRemoveDoc + } + }) + + builder.createDoc(serverCore.class.Trigger, core.space.Model, { + trigger: serverTime.trigger.OnToDoCreate, + txMatch: { + _class: core.class.TxCollectionCUD, + 'tx._class': core.class.TxCreateDoc + } + }) + + builder.createDoc(serverCore.class.Trigger, core.space.Model, { + trigger: serverTime.trigger.OnWorkSlotCreate, + txMatch: { + _class: core.class.TxCollectionCUD, + 'tx._class': core.class.TxCreateDoc + } + }) + + builder.mixin(tracker.class.Issue, core.class.Class, serverTime.mixin.ToDoFactory, { + factory: serverTime.function.IssueToDoFactory + }) + + builder.mixin(tracker.class.Issue, core.class.Class, serverTime.mixin.OnToDo, { + onDone: serverTime.function.IssueToDoDone + }) +} + +export * from '@hcengineering/server-time' diff --git a/models/server-time/tsconfig.json b/models/server-time/tsconfig.json new file mode 100644 index 0000000000..9765b6086d --- /dev/null +++ b/models/server-time/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "./node_modules/@hcengineering/platform-rig/profiles/model/tsconfig.json", + + "compilerOptions": { + "rootDir": "./src", + "outDir": "./lib", + "declarationDir": "./types", + "tsBuildInfoFile": ".build/build.tsbuildinfo" + } +} \ No newline at end of file diff --git a/models/time/.eslintrc.js b/models/time/.eslintrc.js new file mode 100644 index 0000000000..c1cf82cba0 --- /dev/null +++ b/models/time/.eslintrc.js @@ -0,0 +1,7 @@ +module.exports = { + extends: ['./node_modules/@hcengineering/platform-rig/profiles/model/eslint.config.json'], + parserOptions: { + tsconfigRootDir: __dirname, + project: './tsconfig.json' + } +} diff --git a/models/time/.npmignore b/models/time/.npmignore new file mode 100644 index 0000000000..e3ec093c38 --- /dev/null +++ b/models/time/.npmignore @@ -0,0 +1,4 @@ +* +!/lib/** +!CHANGELOG.md +/lib/**/__tests__/ diff --git a/models/time/config/rig.json b/models/time/config/rig.json new file mode 100644 index 0000000000..2f6be36605 --- /dev/null +++ b/models/time/config/rig.json @@ -0,0 +1,5 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json", + "rigPackageName": "@hcengineering/platform-rig", + "rigProfile": "model" +} diff --git a/models/time/package.json b/models/time/package.json new file mode 100644 index 0000000000..086ebf30c9 --- /dev/null +++ b/models/time/package.json @@ -0,0 +1,55 @@ +{ + "name": "@hcengineering/model-time", + "version": "0.6.0", + "main": "lib/index.js", + "svelte": "src/index.ts", + "types": "types/index.d.ts", + "author": "Uberflow Contributors", + "template": "@hcengineering/model-package", + "license": "EPL-2.0", + "scripts": { + "build": "compile", + "build:watch": "compile", + "format": "format src", + "_phase:build": "compile transpile src", + "_phase:format": "format src", + "_phase:validate": "compile validate" + }, + "devDependencies": { + "@hcengineering/platform-rig": "^0.6.0", + "@typescript-eslint/eslint-plugin": "^6.11.0", + "eslint-plugin-import": "^2.26.0", + "eslint-plugin-promise": "^6.1.1", + "eslint-plugin-n": "^15.4.0", + "eslint": "^8.54.0", + "@typescript-eslint/parser": "^6.11.0", + "eslint-config-standard-with-typescript": "^40.0.0", + "prettier": "^3.1.0", + "prettier-plugin-svelte": "^3.1.0", + "typescript": "^5.3.3" + }, + "dependencies": { + "@hcengineering/platform": "^0.6.9", + "@hcengineering/core": "^0.6.28", + "@hcengineering/model": "^0.6.7", + "@hcengineering/ui": "^0.6.11", + "@hcengineering/view": "^0.6.9", + "@hcengineering/tracker": "^0.6.13", + "@hcengineering/tags": "^0.6.12", + "@hcengineering/task": "^0.6.13", + "@hcengineering/lead": "^0.6.0", + "@hcengineering/contact": "^0.6.20", + "@hcengineering/recruit": "^0.6.21", + "@hcengineering/board": "^0.6.12", + "@hcengineering/calendar": "^0.6.17", + "@hcengineering/model-workbench": "^0.6.1", + "@hcengineering/model-core": "^0.6.0", + "@hcengineering/model-view": "^0.6.0", + "@hcengineering/model-calendar": "^0.6.0", + "@hcengineering/activity": "^0.6.0", + "@hcengineering/notification": "^0.6.16", + "@hcengineering/model-tracker": "^0.6.0", + "@hcengineering/time": "^0.6.0", + "@hcengineering/time-resources": "^0.6.0" + } +} diff --git a/models/time/src/index.ts b/models/time/src/index.ts new file mode 100644 index 0000000000..e67814f9d8 --- /dev/null +++ b/models/time/src/index.ts @@ -0,0 +1,369 @@ +// +// Copyright © 2023 Hardcore Engineering Inc. +// +// Licensed under the Eclipse Public License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. You may +// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import activity from '@hcengineering/activity' +import board from '@hcengineering/board' +import calendarPlugin, { type Visibility } from '@hcengineering/calendar' +import contactPlugin, { type Person } from '@hcengineering/contact' +import { + DOMAIN_MODEL, + type Class, + type Domain, + type Markup, + type Ref, + type Space, + type Timestamp, + type Type, + DateRangeMode +} from '@hcengineering/core' +import lead from '@hcengineering/lead' +import { Collection, Mixin, Model, Prop, TypeRef, TypeString, UX, type Builder, TypeDate } from '@hcengineering/model' +import { TEvent } from '@hcengineering/model-calendar' +import core, { TAttachedDoc, TClass, TDoc, TType } from '@hcengineering/model-core' +import tracker from '@hcengineering/model-tracker' +import view, { createAction } from '@hcengineering/model-view' +import workbench from '@hcengineering/model-workbench' +import notification from '@hcengineering/notification' +import recruit from '@hcengineering/recruit' +import tags from '@hcengineering/tags' +import { type AnyComponent } from '@hcengineering/ui' +import { + type TodoDoneTester, + timeId, + type ItemPresenter, + type ProjectToDo, + type ToDo, + type ToDoPriority, + type TodoAutomationHelper, + type WorkSlot +} from '@hcengineering/time' + +import { type Resource } from '@hcengineering/platform' +import time from './plugin' +import task from '@hcengineering/task' + +export { timeId } from '@hcengineering/time' +export { default } from './plugin' + +export const DOMAIN_TIME = 'time' as Domain + +export function TypeToDoPriority (): Type { + return { _class: time.class.TypeToDoPriority, label: time.string.Priority } +} + +@Mixin(time.mixin.ItemPresenter, core.class.Class) +export class TItemPresenter extends TClass implements ItemPresenter { + presenter!: AnyComponent +} + +@Model(time.class.WorkSlot, calendarPlugin.class.Event) +@UX(time.string.WorkSlot) +export class TWorkSlot extends TEvent implements WorkSlot { + declare attachedTo: Ref + declare attachedToClass: Ref> +} + +@Model(time.class.TypeToDoPriority, core.class.Type, DOMAIN_MODEL) +export class TTypeToDoPriority extends TType {} + +@Model(time.class.ToDo, core.class.AttachedDoc, DOMAIN_TIME) +@UX(time.string.ToDo, time.icon.Planned) +export class TToDO extends TAttachedDoc implements ToDo { + @Prop(TypeDate(DateRangeMode.DATE), task.string.DueDate) + dueDate?: number | null | undefined + + @Prop(TypeToDoPriority(), time.string.Priority) + priority!: ToDoPriority + + visibility!: Visibility + attachedSpace?: Ref | undefined + + @Prop(TypeString(), calendarPlugin.string.Title) + title!: string + + @Prop(TypeString(), calendarPlugin.string.Description) + description!: Markup + + doneOn?: Timestamp | null + + @Prop(TypeRef(contactPlugin.class.Person), contactPlugin.string.For) + user!: Ref + + @Prop(Collection(time.class.WorkSlot, time.string.WorkSlot), time.string.WorkSlot) + workslots!: number + + @Prop(Collection(tags.class.TagReference, tags.string.TagLabel), tags.string.Tags) + labels?: number | undefined +} + +@Model(time.class.ProjectToDo, time.class.ToDo) +@UX(time.string.ToDo, time.icon.Planned) +export class TProjectToDo extends TToDO implements ProjectToDo { + declare attachedSpace: Ref +} + +@Model(time.class.TodoAutomationHelper, core.class.Doc, DOMAIN_MODEL) +@UX(time.string.ToDo, time.icon.Planned) +export class TTodoAutomationHelper extends TDoc implements TodoAutomationHelper { + onDoneTester!: Resource +} + +export function createModel (builder: Builder): void { + builder.createModel(TWorkSlot, TItemPresenter, TToDO, TProjectToDo, TTypeToDoPriority, TTodoAutomationHelper) + + builder.mixin(time.class.ToDo, core.class.Class, activity.mixin.IgnoreActivity, {}) + builder.mixin(time.class.ProjectToDo, core.class.Class, activity.mixin.IgnoreActivity, {}) + + builder.mixin(time.class.TypeToDoPriority, core.class.Class, view.mixin.AttributeEditor, { + inlineEditor: time.component.PriorityEditor + }) + + builder.mixin(time.class.WorkSlot, core.class.Class, calendarPlugin.mixin.CalendarEventPresenter, { + presenter: time.component.WorkSlotElement + }) + + builder.mixin(tracker.class.Issue, core.class.Class, time.mixin.ItemPresenter, { + presenter: time.component.IssuePresenter + }) + + builder.mixin(lead.class.Lead, core.class.Class, time.mixin.ItemPresenter, { + presenter: time.component.LeadPresenter + }) + + builder.mixin(recruit.class.Applicant, core.class.Class, time.mixin.ItemPresenter, { + presenter: time.component.ApplicantPresenter + }) + + builder.mixin(board.class.Card, core.class.Class, time.mixin.ItemPresenter, { + presenter: time.component.CardPresenter + }) + + builder.mixin(time.class.WorkSlot, core.class.Class, view.mixin.ObjectEditor, { + editor: time.component.EditWorkSlot + }) + + builder.mixin(time.class.ToDo, core.class.Class, view.mixin.ObjectTitle, { + titleProvider: time.function.ToDoTitleProvider + }) + + builder.createDoc( + workbench.class.Application, + core.space.Model, + { + label: time.string.Planner, + icon: calendarPlugin.icon.Calendar, + alias: timeId, + hidden: false, + position: 'top', + component: time.component.Me + }, + time.app.Me + ) + + builder.createDoc( + workbench.class.Application, + core.space.Model, + { + label: time.string.Team, + icon: time.icon.Team, + alias: 'team', + hidden: false, + position: 'top', + component: time.component.Team + }, + time.app.Team + ) + + builder.mixin(time.class.ToDo, core.class.Class, view.mixin.IgnoreActions, { + actions: [view.action.Open, tracker.action.NewRelatedIssue, view.action.Delete] + }) + + createAction( + builder, + { + action: view.actionImpl.Delete, + actionProps: { + skipCheck: true + }, + label: view.string.Delete, + icon: view.icon.Delete, + keyBinding: ['Meta + Backspace'], + category: view.category.General, + input: 'any', + override: [view.action.Delete], + target: time.class.ToDo, + context: { mode: ['context', 'browser'], group: 'remove' } + }, + time.action.DeleteToDo + ) + + builder.createDoc( + view.class.ActionCategory, + core.space.Model, + { label: time.string.Planner, visible: true }, + time.category.Time + ) + createAction( + builder, + { + action: view.actionImpl.ShowPopup, + actionProps: { + component: time.component.CreateToDoPopup, + element: 'top', + fillProps: { + _object: 'object' + } + }, + label: time.string.CreateToDo, + icon: time.icon.Target, + keyBinding: [], + input: 'none', + category: time.category.Time, + target: core.class.Doc, + context: { + mode: [], + group: 'associate' + }, + override: [time.action.CreateToDoGlobal] + }, + time.action.CreateToDo + ) + + createAction( + builder, + { + action: view.actionImpl.ShowPopup, + actionProps: { + component: time.component.CreateToDoPopup, + element: 'top', + fillProps: { + _object: 'object' + } + }, + label: time.string.CreateToDo, + icon: time.icon.Target, + keyBinding: [], + input: 'none', + category: time.category.Time, + target: core.class.Doc, + context: { + mode: [], + group: 'create' + } + }, + time.action.CreateToDoGlobal + ) + + createAction( + builder, + { + action: view.actionImpl.ShowPopup, + actionProps: { + component: time.component.EditToDo, + element: 'top', + fillProps: { + _object: 'object', + space: 'space' + } + }, + label: time.string.EditToDo, + icon: view.icon.Edit, + keyBinding: [], + input: 'focus', + category: time.category.Time, + target: time.class.ToDo, + context: { + mode: ['context', 'browser'], + group: 'edit' + } + }, + time.action.EditToDo + ) + + createAction(builder, { + action: workbench.actionImpl.Navigate, + actionProps: { + mode: 'app', + application: 'time' + }, + label: time.string.GotoTimePlaning, + icon: view.icon.ArrowRight, + input: 'none', + category: view.category.Navigation, + target: core.class.Doc, + context: { + mode: ['workbench', 'browser', 'editor', 'panel', 'popup'] + } + }) + createAction(builder, { + action: workbench.actionImpl.Navigate, + actionProps: { + mode: 'app', + application: 'team' + }, + label: time.string.GotoTimeTeamPlaning, + icon: view.icon.ArrowRight, + input: 'none', + category: view.category.Navigation, + target: core.class.Doc, + context: { + mode: ['workbench', 'browser', 'editor', 'panel', 'popup'] + } + }) + + builder.createDoc( + notification.class.NotificationGroup, + core.space.Model, + { + label: time.string.ToDos, + icon: time.icon.Team, + objectClass: time.class.ToDo + }, + time.ids.TimeNotificationGroup + ) + + builder.createDoc( + notification.class.NotificationType, + core.space.Model, + { + hidden: false, + generated: false, + allowedForAuthor: true, + label: time.string.NewToDo, + group: time.ids.TimeNotificationGroup, + txClasses: [core.class.TxCreateDoc], + objectClass: time.class.ProjectToDo, + onlyOwn: true, + providers: { + [notification.providers.PlatformNotification]: true + } + }, + time.ids.ToDoCreated + ) + + builder.mixin(time.class.ToDo, core.class.Class, notification.mixin.ClassCollaborators, { + fields: ['user'] + }) + + builder.mixin(time.class.ToDo, core.class.Class, notification.mixin.NotificationObjectPresenter, { + presenter: time.component.NotificationToDoPresenter + }) + + builder.mixin(time.class.ProjectToDo, core.class.Class, view.mixin.ObjectPanel, { + component: view.component.AttachedDocPanel + }) +} + +export * from './migration' diff --git a/models/time/src/migration.ts b/models/time/src/migration.ts new file mode 100644 index 0000000000..d1d4e7efcd --- /dev/null +++ b/models/time/src/migration.ts @@ -0,0 +1,165 @@ +// +// Copyright © 2022 Hardcore Engineering Inc. +// +// Licensed under the Eclipse Public License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. You may +// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import { type PersonAccount } from '@hcengineering/contact' +import { type Account, type Doc, type Ref, TxOperations } from '@hcengineering/core' +import { + type MigrateOperation, + type MigrationClient, + type MigrationUpgradeClient, + createOrUpdate +} from '@hcengineering/model' +import core from '@hcengineering/model-core' +import task from '@hcengineering/task' +import tags from '@hcengineering/tags' +import { type ToDo, ToDoPriority } from '@hcengineering/time' +import { DOMAIN_TIME } from '.' +import time from './plugin' + +export async function migrateWorkSlots (client: TxOperations): Promise { + const h = client.getHierarchy() + const desc = h.getDescendants(task.class.Task) + const oldWorkSlots = await client.findAll(time.class.WorkSlot, { + attachedToClass: { $in: desc } + }) + const now = Date.now() + const todos = new Map, Ref>() + const count = new Map, number>() + for (const oldWorkSlot of oldWorkSlots) { + const todo = todos.get(oldWorkSlot.attachedTo) + if (todo === undefined) { + const acc = oldWorkSlot.space.replace('_calendar', '') as Ref + const account = (await client.findOne(core.class.Account, { _id: acc })) as PersonAccount + if (account.person !== undefined) { + const todo = await client.addCollection( + time.class.ProjectToDo, + time.space.ToDos, + oldWorkSlot.attachedTo, + oldWorkSlot.attachedToClass, + 'todos', + { + attachedSpace: (oldWorkSlot as any).attachedSpace, + title: oldWorkSlot.title, + description: '', + doneOn: oldWorkSlot.dueDate > now ? null : oldWorkSlot.dueDate, + workslots: 0, + priority: ToDoPriority.NoPriority, + user: account.person, + visibility: 'public' + } + ) + await client.update(oldWorkSlot, { + attachedTo: todo, + attachedToClass: time.class.ProjectToDo, + collection: 'workslots' + }) + todos.set(oldWorkSlot.attachedTo, todo) + count.set(todo, 1) + } + } else { + await client.update(oldWorkSlot, { + attachedTo: todo, + attachedToClass: time.class.ProjectToDo, + collection: 'workslots' + }) + const c = count.get(todo) ?? 1 + count.set(todo, c + 1) + } + } + for (const [todoId, c] of count.entries()) { + const todo = await client.findOne(time.class.ToDo, { _id: todoId }) + if (todo === undefined) continue + const tx = client.txFactory.createTxUpdateDoc(time.class.ToDo, todo.space, todo._id, { + workslots: c + }) + tx.space = core.space.DerivedTx + await client.tx(tx) + } +} + +async function migrateTodosSpace (client: TxOperations): Promise { + const oldTodos = await client.findAll(time.class.ToDo, { + space: { $ne: time.space.ToDos } + }) + for (const oldTodo of oldTodos) { + const account = (await client.findOne(core.class.Account, { + _id: oldTodo.space as string as Ref + })) as PersonAccount + if (account.person === undefined) continue + await client.update(oldTodo, { + user: account.person, + space: time.space.ToDos + }) + } +} + +async function createDefaultSpace (tx: TxOperations): Promise { + const current = await tx.findOne(core.class.Space, { + _id: time.space.ToDos + }) + if (current === undefined) { + await tx.createDoc( + core.class.Space, + core.space.Space, + { + name: 'Todos', + description: 'Space for all todos', + private: false, + archived: false, + members: [] + }, + time.space.ToDos + ) + } +} + +async function fillProps (client: MigrationClient): Promise { + await client.update( + DOMAIN_TIME, + { _class: time.class.ProjectToDo, visibility: { $exists: false } }, + { visibility: 'public' } + ) + await client.update( + DOMAIN_TIME, + { _class: time.class.ToDo, visibility: { $exists: false } }, + { visibility: 'private' } + ) + await client.update(DOMAIN_TIME, { priority: { $exists: false } }, { priority: ToDoPriority.NoPriority }) +} + +export const timeOperation: MigrateOperation = { + async migrate (client: MigrationClient): Promise { + await fillProps(client) + }, + async upgrade (client: MigrationUpgradeClient): Promise { + const tx = new TxOperations(client, core.account.System) + await createDefaultSpace(tx) + await createOrUpdate( + tx, + tags.class.TagCategory, + tags.space.Tags, + { + icon: tags.icon.Tags, + label: 'Other', + targetClass: time.class.ToDo, + tags: [], + default: true + }, + time.category.Other + ) + await migrateWorkSlots(tx) + await migrateTodosSpace(tx) + } +} diff --git a/models/time/src/plugin.ts b/models/time/src/plugin.ts new file mode 100644 index 0000000000..951d92a1f7 --- /dev/null +++ b/models/time/src/plugin.ts @@ -0,0 +1,68 @@ +// +// Copyright © 2023 Hardcore Engineering Inc. +// +// Licensed under the Eclipse Public License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. You may +// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import { type Client, type Doc, type Ref } from '@hcengineering/core' +import { type Application } from '@hcengineering/model-workbench' +import { type IntlString, mergeIds, type Resource } from '@hcengineering/platform' +import type { AnyComponent } from '@hcengineering/ui' +import { type Action, type ActionCategory } from '@hcengineering/view' +import { timeId } from '@hcengineering/time' +import time from '@hcengineering/time-resources/src/plugin' +import { type NotificationGroup, type NotificationType } from '@hcengineering/notification' +import { type TxViewlet } from '@hcengineering/activity' + +export default mergeIds(timeId, time, { + action: { + EditToDo: '' as Ref>, + CreateToDo: '' as Ref>, + DeleteToDo: '' as Ref>, + CreateToDoGlobal: '' as Ref> + }, + string: { + EditToDo: '' as IntlString, + GotoTimePlaning: '' as IntlString, + GotoTimeTeamPlaning: '' as IntlString, + NewToDo: '' as IntlString, + ToDo: '' as IntlString, + Priority: '' as IntlString, + MarkedAsDone: '' as IntlString + }, + category: { + Time: '' as Ref + }, + component: { + IssuePresenter: '' as AnyComponent, + ApplicantPresenter: '' as AnyComponent, + CardPresenter: '' as AnyComponent, + LeadPresenter: '' as AnyComponent, + WorkSlotElement: '' as AnyComponent, + EditWorkSlot: '' as AnyComponent, + CreateToDoPopup: '' as AnyComponent, + NotificationToDoPresenter: '' as AnyComponent, + PriorityEditor: '' as AnyComponent + }, + app: { + Me: '' as Ref, + Team: '' as Ref + }, + ids: { + TimeNotificationGroup: '' as Ref, + ToDoCreated: '' as Ref, + TxToDoCreated: '' as Ref + }, + function: { + ToDoTitleProvider: '' as Resource<(client: Client, ref: Ref, doc?: Doc) => Promise> + } +}) diff --git a/models/time/tsconfig.json b/models/time/tsconfig.json new file mode 100644 index 0000000000..9765b6086d --- /dev/null +++ b/models/time/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "./node_modules/@hcengineering/platform-rig/profiles/model/tsconfig.json", + + "compilerOptions": { + "rootDir": "./src", + "outDir": "./lib", + "declarationDir": "./types", + "tsBuildInfoFile": ".build/build.tsbuildinfo" + } +} \ No newline at end of file diff --git a/plugins/time-assets/.eslintrc.js b/plugins/time-assets/.eslintrc.js new file mode 100644 index 0000000000..e73094bc7e --- /dev/null +++ b/plugins/time-assets/.eslintrc.js @@ -0,0 +1,7 @@ +module.exports = { + extends: ['./node_modules/@hcengineering/platform-rig/profiles/assets/eslint.config.json'], + parserOptions: { + tsconfigRootDir: __dirname, + project: './tsconfig.json' + } +} diff --git a/plugins/time-assets/assets/icons.svg b/plugins/time-assets/assets/icons.svg new file mode 100644 index 0000000000..6ea0a970e0 --- /dev/null +++ b/plugins/time-assets/assets/icons.svg @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/time-assets/config/rig.json b/plugins/time-assets/config/rig.json new file mode 100644 index 0000000000..b75800b9b7 --- /dev/null +++ b/plugins/time-assets/config/rig.json @@ -0,0 +1,5 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json", + "rigPackageName": "@hcengineering/platform-rig", + "rigProfile": "assets" +} diff --git a/plugins/time-assets/jest.config.js b/plugins/time-assets/jest.config.js new file mode 100644 index 0000000000..2cfd408b67 --- /dev/null +++ b/plugins/time-assets/jest.config.js @@ -0,0 +1,7 @@ +module.exports = { + preset: 'ts-jest', + testEnvironment: 'node', + testMatch: ['**/?(*.)+(spec|test).[jt]s?(x)'], + roots: ["./src"], + coverageReporters: ["text-summary", "html"] +} diff --git a/plugins/time-assets/lang/en.json b/plugins/time-assets/lang/en.json new file mode 100644 index 0000000000..2db979bbf8 --- /dev/null +++ b/plugins/time-assets/lang/en.json @@ -0,0 +1,54 @@ +{ + "string": { + "Planner": "Planner", + "Calendar": "Calendar", + "Agenda": "Agenda", + "Me": "Me", + "Team": "Team", + "Today": "Today", + "TodayColon": "Today:", + "Tomorrow": "Tomorrow", + "Yesterday": "Yesterday", + "Completed": "Completed", + "Now": "Now", + "Scheduled": "Scheduled", + "Schedule": "Schedule", + "WithoutProject": "Without project", + "TotalGroupTime": "{days, plural, =0 {} other {#d}} {hours, plural, =0 {} other {#h}} {minutes, plural, =0 {} other {#m}}", + "Tasks": "Tasks", + "WorkSlot": "Work Slot", + "WorkItem": "Work Item", + "Inbox": "Inbox", + "All": "All", + "Days": "{days}d", + "Hours": "{hours}h", + "Minutes": "{minutes}m", + "AddToDo": "Add ToDo", + "CreateToDo": "Add todo, press Enter to save", + "ToDos": "Todo's", + "Done": "Done", + "EditToDo": "Edit Todo", + "Unplanned": "Unplanned", + "Planned": "Planned", + "AddSlot": "Add Slot", + "NoPriority": "No Priority", + "LowPriority": "Low Priority", + "MediumPriority": "Medium Priority", + "HighPriority": "High Priority", + "AddTo": "Add to", + "AddTitle": "Add Title", + "MyWork": "My work", + "WeekCalendar": "Week", + "DayCalendar": "Day", + "GotoTimePlaning": "Planing", + "GotoTimeTeamPlaning": "Team Planing", + "NewToDo": "New Todo", + "ToDo": "Todo", + "ToDoColon": "Todo:", + "Priority": "Priority", + "CreatedToDo": "Created Todo", + "NewToDoDetails": "New Todo: {details}", + "MarkedAsDone": "Completed", + "WorkSchedule": "Work schedule" + } +} diff --git a/plugins/time-assets/lang/ru.json b/plugins/time-assets/lang/ru.json new file mode 100644 index 0000000000..669f60f5c3 --- /dev/null +++ b/plugins/time-assets/lang/ru.json @@ -0,0 +1,54 @@ +{ + "string": { + "Planner": "Планировщик", + "Calendar": "Календарь", + "Agenda": "Agenda", + "Me": "Me", + "Team": "Команда", + "Today": "Сегодня", + "TodayColon": "Сегодня:", + "Tomorrow": "Завтра", + "Yesterday": "Вчера", + "Completed": "Выполнено", + "Now": "Сейчас", + "Scheduled": "Запланировано", + "Schedule": "График", + "WithoutProject": "Без проекта", + "TotalGroupTime": "{days, plural, =0 {} other {#д}} {hours, plural, =0 {} other {#ч}} {minutes, plural, =0 {} other {#м}}", + "Tasks": "Задачи", + "WorkSlot": "Work Slot", + "WorkItem": "Задача", + "Inbox": "Входящие", + "All": "Все", + "Days": "{days}д", + "Hours": "{hours}ч", + "Minutes": "{minutes}м", + "AddToDo": "Добавить ToDo", + "CreateToDo": "Добавьте Todo, нажмите Ввод, чтобы сохранить", + "ToDos": "Todo's", + "Done": "Завершено", + "EditToDo": "Редактировать Todo", + "Unplanned": "Не запланировано", + "Planned": "Запланировано", + "AddSlot": "Добавить слот", + "NoPriority": "Без приоритета", + "HighPriority": "Высокий приоритет", + "MediumPriority": "Средний приоритет", + "LowPriority": "Низкий приоритет", + "AddTo": "Добавить в", + "AddTitle": "Добавить заголовок", + "MyWork": "Моя работа", + "WeekCalendar": "Неделя", + "DayCalendar": "Дни", + "GotoTimePlaning": "Планирование", + "GotoTimeTeamPlaning": "Командное планирование", + "NewToDo": "Новое Todo", + "ToDo": "Todo", + "ToDoColon": "Todo:", + "Priority": "Приоритет", + "CreatedToDo": "Создал(а) Todo", + "NewToDoDetails": "Новое Todo: {details}", + "MarkedAsDone": "Выполнено", + "WorkSchedule": "Расписание работы" + } +} diff --git a/plugins/time-assets/package.json b/plugins/time-assets/package.json new file mode 100644 index 0000000000..dba60105f8 --- /dev/null +++ b/plugins/time-assets/package.json @@ -0,0 +1,40 @@ +{ + "name": "@hcengineering/time-assets", + "version": "0.6.0", + "main": "src/index.ts", + "author": "Uberflow Contributors", + "template": "@hcengineering/assets-package", + "license": "EPL-2.0", + "scripts": { + "build": "compile", + "test": "jest --passWithNoTests --silent", + "build:docs": "", + "format": "format src", + "build:watch": "compile", + "_phase:build": "compile transpile src", + "_phase:test": "jest --passWithNoTests --silent", + "_phase:format": "format src", + "_phase:validate": "compile validate" + }, + "devDependencies": { + "@hcengineering/platform-rig": "^0.6.0", + "@typescript-eslint/eslint-plugin": "^6.11.0", + "@typescript-eslint/parser": "^6.11.0", + "eslint-config-standard-with-typescript": "^40.0.0", + "eslint-plugin-import": "^2.26.0", + "eslint-plugin-n": "^15.4.0", + "eslint-plugin-promise": "^6.1.1", + "eslint": "^8.54.0", + "prettier": "^3.1.0", + "@types/node": "~20.11.16", + "jest": "^29.7.0", + "ts-jest": "^29.1.1", + "@types/jest": "^29.5.5", + "prettier-plugin-svelte": "^3.1.0", + "typescript": "^5.3.3" + }, + "dependencies": { + "@hcengineering/platform": "^0.6.9", + "@hcengineering/time": "^0.6.0" + } +} diff --git a/plugins/time-assets/src/__tests__/lang.test.ts b/plugins/time-assets/src/__tests__/lang.test.ts new file mode 100644 index 0000000000..cf96c6dcf7 --- /dev/null +++ b/plugins/time-assets/src/__tests__/lang.test.ts @@ -0,0 +1,6 @@ +import { makeLocalesTest } from '@hcengineering/platform' + +it( + 'Locales are equale', + makeLocalesTest((lang) => import(`../../lang/${lang}.json`)) +) diff --git a/plugins/time-assets/src/index.ts b/plugins/time-assets/src/index.ts new file mode 100644 index 0000000000..1d3dcc7a36 --- /dev/null +++ b/plugins/time-assets/src/index.ts @@ -0,0 +1,29 @@ +// +// Copyright © 2022 Hardcore Engineering Inc. +// +// Licensed under the Eclipse Public License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. You may +// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import { loadMetadata } from '@hcengineering/platform' +import time from '@hcengineering/time' + +const icons = require('../assets/icons.svg') as string // eslint-disable-line +loadMetadata(time.icon, { + Team: `${icons}#team`, + Hashtag: `${icons}#hashtag`, + Inbox: `${icons}#inbox`, + Target: `${icons}#target`, + Flag: `${icons}#flag`, + FilledFlag: `${icons}#filledFlag`, + Planned: `${icons}#planned`, + All: `${icons}#all` +}) diff --git a/plugins/time-assets/tsconfig.json b/plugins/time-assets/tsconfig.json new file mode 100644 index 0000000000..4449c73536 --- /dev/null +++ b/plugins/time-assets/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "./node_modules/@hcengineering/platform-rig/profiles/assets/tsconfig.json", + + "compilerOptions": { + "rootDir": "./src", + "outDir": "./lib", + "declarationDir": "./types", + "types": ["node", "jest"], + "tsBuildInfoFile": ".build/build.tsbuildinfo" + } +} \ No newline at end of file diff --git a/plugins/time-resources/.eslintrc.js b/plugins/time-resources/.eslintrc.js new file mode 100644 index 0000000000..bb8fd7450d --- /dev/null +++ b/plugins/time-resources/.eslintrc.js @@ -0,0 +1,4 @@ +module.exports = { + extends: ['./node_modules/@hcengineering/platform-rig/profiles/ui/eslint.config.json'], + parserOptions: { tsconfigRootDir: __dirname } +} diff --git a/plugins/time-resources/config/rig.json b/plugins/time-resources/config/rig.json new file mode 100644 index 0000000000..bcad6f7c33 --- /dev/null +++ b/plugins/time-resources/config/rig.json @@ -0,0 +1,5 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json", + "rigPackageName": "@hcengineering/platform-rig", + "rigProfile": "ui" +} diff --git a/plugins/time-resources/jest.config.js b/plugins/time-resources/jest.config.js new file mode 100644 index 0000000000..2cfd408b67 --- /dev/null +++ b/plugins/time-resources/jest.config.js @@ -0,0 +1,7 @@ +module.exports = { + preset: 'ts-jest', + testEnvironment: 'node', + testMatch: ['**/?(*.)+(spec|test).[jt]s?(x)'], + roots: ["./src"], + coverageReporters: ["text-summary", "html"] +} diff --git a/plugins/time-resources/package.json b/plugins/time-resources/package.json new file mode 100644 index 0000000000..50bdfe3f35 --- /dev/null +++ b/plugins/time-resources/package.json @@ -0,0 +1,67 @@ +{ + "name": "@hcengineering/time-resources", + "version": "0.6.0", + "main": "src/index.ts", + "author": "Uberflow Contributors", + "license": "EPL-2.0", + "scripts": { + "build": "compile ui", + "build:docs": "api-extractor run --local", + "format": "format src", + "svelte-check": "do-svelte-check", + "_phase:svelte-check": "do-svelte-check", + "build:watch": "compile ui", + "_phase:build": "compile ui", + "_phase:format": "format src", + "_phase:validate": "compile validate" + }, + "devDependencies": { + "svelte-loader": "^3.1.9", + "sass": "^1.53.0", + "svelte-preprocess": "^5.1.0", + "@hcengineering/platform-rig": "^0.6.0", + "@typescript-eslint/eslint-plugin": "^6.11.0", + "@typescript-eslint/parser": "^6.11.0", + "eslint-config-standard-with-typescript": "^40.0.0", + "eslint-plugin-import": "^2.26.0", + "eslint-plugin-n": "^15.4.0", + "eslint-plugin-promise": "^6.1.1", + "prettier-plugin-svelte": "^3.1.0", + "eslint": "^8.54.0", + "prettier": "^3.1.0", + "svelte-check": "^3.6.0", + "typescript": "^5.3.3", + "jest": "^29.7.0", + "ts-jest": "^29.1.1", + "@types/jest": "^29.5.5", + "eslint-plugin-svelte": "^2.34.0", + "svelte-eslint-parser": "^0.33.1" + }, + "dependencies": { + "svelte": "^4.2.5", + "@hcengineering/ui": "^0.6.11", + "@hcengineering/calendar": "^0.6.17", + "@hcengineering/calendar-resources": "^0.6.0", + "@hcengineering/presentation": "^0.6.2", + "@hcengineering/core": "^0.6.28", + "@hcengineering/tracker": "^0.6.13", + "@hcengineering/tracker-resources": "^0.6.0", + "@hcengineering/task": "^0.6.13", + "@hcengineering/task-resources": "^0.6.0", + "@hcengineering/tags": "^0.6.12", + "@hcengineering/tags-resources": "^0.6.0", + "@hcengineering/lead": "^0.6.0", + "@hcengineering/recruit": "^0.6.21", + "@hcengineering/board": "^0.6.12", + "@hcengineering/view": "^0.6.9", + "@hcengineering/contact": "^0.6.20", + "@hcengineering/contact-resources": "^0.6.0", + "@hcengineering/view-resources": "^0.6.0", + "@hcengineering/platform": "^0.6.9", + "@hcengineering/text-editor": "^0.6.0", + "@hcengineering/time": "^0.6.0", + "fast-equals": "^2.0.3", + "@hcengineering/activity": "^0.6.0", + "@hcengineering/activity-resources": "^0.6.1" + } +} diff --git a/plugins/time-resources/postcss.config.js b/plugins/time-resources/postcss.config.js new file mode 100644 index 0000000000..88752c6cb0 --- /dev/null +++ b/plugins/time-resources/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: [ + require('autoprefixer') + ] +} diff --git a/plugins/time-resources/src/components/Border.svelte b/plugins/time-resources/src/components/Border.svelte new file mode 100644 index 0000000000..a25e208c6b --- /dev/null +++ b/plugins/time-resources/src/components/Border.svelte @@ -0,0 +1,6 @@ + + + + + diff --git a/plugins/time-resources/src/components/CreateToDo.svelte b/plugins/time-resources/src/components/CreateToDo.svelte new file mode 100644 index 0000000000..a2340e981f --- /dev/null +++ b/plugins/time-resources/src/components/CreateToDo.svelte @@ -0,0 +1,65 @@ + + +
+ { + if (e.key === 'Enter') { + save() + e.preventDefault() + e.stopPropagation() + } + }} + > + + +
+ + diff --git a/plugins/time-resources/src/components/CreateToDoPopup.svelte b/plugins/time-resources/src/components/CreateToDoPopup.svelte new file mode 100644 index 0000000000..23f3cfd136 --- /dev/null +++ b/plugins/time-resources/src/components/CreateToDoPopup.svelte @@ -0,0 +1,295 @@ + + + +
+
+ +
+
+
+
+
+ +
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+ { + tags = e.detail + }} + /> +
+
+
+
+ +
+
+
+
+
+ + diff --git a/plugins/time-resources/src/components/DueDateEditor.svelte b/plugins/time-resources/src/components/DueDateEditor.svelte new file mode 100644 index 0000000000..4f283adff9 --- /dev/null +++ b/plugins/time-resources/src/components/DueDateEditor.svelte @@ -0,0 +1,55 @@ + + + + diff --git a/plugins/time-resources/src/components/EditToDo.svelte b/plugins/time-resources/src/components/EditToDo.svelte new file mode 100644 index 0000000000..ee8a25d705 --- /dev/null +++ b/plugins/time-resources/src/components/EditToDo.svelte @@ -0,0 +1,271 @@ + + + + + +
+ {#if object} + + {:else} + + {/if} +
+
+ + {#if object} + visibilityChange(e.detail)} + /> + { + if (event.detail !== undefined) countTag = event.detail + }} + /> + {/if} + + + dispatch('close')} /> + + + {#if object} +
+ +
+ +
+
+
+ + spaceChange(e.detail)} + /> +
+
+
+ {#if countTag} +
+ +
+ {/if} +
+
+ + +
+ dueDateChange(e.detail)} /> + priorityChange(e.detail)} /> +
+
+ +
+ {/if} +
+ + diff --git a/plugins/time-resources/src/components/EditWorkSlot.svelte b/plugins/time-resources/src/components/EditWorkSlot.svelte new file mode 100644 index 0000000000..038e084594 --- /dev/null +++ b/plugins/time-resources/src/components/EditWorkSlot.svelte @@ -0,0 +1,194 @@ + + + + + +
+
+ +
+
+
+
+ +
+
+
+ + +
+ +
+
+ +
+ + +
+ +
+
+
+
+
+ + diff --git a/plugins/time-resources/src/components/EmployeeSelector.svelte b/plugins/time-resources/src/components/EmployeeSelector.svelte new file mode 100644 index 0000000000..37b4169304 --- /dev/null +++ b/plugins/time-resources/src/components/EmployeeSelector.svelte @@ -0,0 +1,61 @@ + + +{#if space} + + {#each employees as employee} + + {/each} + +{/if} diff --git a/plugins/time-resources/src/components/Header.svelte b/plugins/time-resources/src/components/Header.svelte new file mode 100644 index 0000000000..d6d243cd32 --- /dev/null +++ b/plugins/time-resources/src/components/Header.svelte @@ -0,0 +1,81 @@ + + +
+
+ +
+
+
+
+ + diff --git a/plugins/time-resources/src/components/Me.svelte b/plugins/time-resources/src/components/Me.svelte new file mode 100644 index 0000000000..f01b51ea5d --- /dev/null +++ b/plugins/time-resources/src/components/Me.svelte @@ -0,0 +1,11 @@ + + +
+ +
diff --git a/plugins/time-resources/src/components/NotificationToDoPresenter.svelte b/plugins/time-resources/src/components/NotificationToDoPresenter.svelte new file mode 100644 index 0000000000..f54d6c94c1 --- /dev/null +++ b/plugins/time-resources/src/components/NotificationToDoPresenter.svelte @@ -0,0 +1,30 @@ + + + +
+
+
+
+ {value.title} +
+
diff --git a/plugins/time-resources/src/components/PlanView.svelte b/plugins/time-resources/src/components/PlanView.svelte new file mode 100644 index 0000000000..731242b0cb --- /dev/null +++ b/plugins/time-resources/src/components/PlanView.svelte @@ -0,0 +1,98 @@ + + +{#if visibleNav} + + +
+ (dragItem = e.detail)} + on:dragend={() => (dragItem = undefined)} + /> +
+ +{/if} +
+ (visibleNav = event.detail)} + /> +
diff --git a/plugins/time-resources/src/components/PlanningCalendar.svelte b/plugins/time-resources/src/components/PlanningCalendar.svelte new file mode 100644 index 0000000000..caf13b9fe5 --- /dev/null +++ b/plugins/time-resources/src/components/PlanningCalendar.svelte @@ -0,0 +1,243 @@ + + + + + diff --git a/plugins/time-resources/src/components/PriorityEditor.svelte b/plugins/time-resources/src/components/PriorityEditor.svelte new file mode 100644 index 0000000000..7abfeb8de6 --- /dev/null +++ b/plugins/time-resources/src/components/PriorityEditor.svelte @@ -0,0 +1,89 @@ + + + + { + change(e.detail._id) + }} +/> diff --git a/plugins/time-resources/src/components/PriorityPresenter.svelte b/plugins/time-resources/src/components/PriorityPresenter.svelte new file mode 100644 index 0000000000..2a268ee96d --- /dev/null +++ b/plugins/time-resources/src/components/PriorityPresenter.svelte @@ -0,0 +1,38 @@ + + + +{#if value !== ToDoPriority.NoPriority} + +{/if} diff --git a/plugins/time-resources/src/components/TaskSelector.svelte b/plugins/time-resources/src/components/TaskSelector.svelte new file mode 100644 index 0000000000..48b4e0b1a8 --- /dev/null +++ b/plugins/time-resources/src/components/TaskSelector.svelte @@ -0,0 +1,42 @@ + + +{#if value && value.attachedTo !== time.ids.NotAttached} +
+ + +
+{/if} diff --git a/plugins/time-resources/src/components/ToDoDatePresenter.svelte b/plugins/time-resources/src/components/ToDoDatePresenter.svelte new file mode 100644 index 0000000000..9c126cc490 --- /dev/null +++ b/plugins/time-resources/src/components/ToDoDatePresenter.svelte @@ -0,0 +1,107 @@ + + +
+ {str} +
+ + diff --git a/plugins/time-resources/src/components/ToDoDuration.svelte b/plugins/time-resources/src/components/ToDoDuration.svelte new file mode 100644 index 0000000000..77ad0ada9f --- /dev/null +++ b/plugins/time-resources/src/components/ToDoDuration.svelte @@ -0,0 +1,35 @@ + + +{res} diff --git a/plugins/time-resources/src/components/ToDoElement.svelte b/plugins/time-resources/src/components/ToDoElement.svelte new file mode 100644 index 0000000000..81130238a5 --- /dev/null +++ b/plugins/time-resources/src/components/ToDoElement.svelte @@ -0,0 +1,169 @@ + + + +
+ {#if updating !== undefined} + + {:else} + + {/if} +
+
+ {#if isTodo} + {#if size === 'small'} +
+ {todo.title} +
+ {:else} +
+
+ {todo.title} +
+
+ + +
+
+ {/if} + {:else} +
+
+ {todo.title} +
+ + {#if size === 'large'} +
+ + +
+ {/if} +
+
+ {/if} + +
+ {#if size === 'small'} +
+ + +
+ {/if} + {#if events.length > 0} + + + + {/if} +
+ diff --git a/plugins/time-resources/src/components/ToDoGroup.svelte b/plugins/time-resources/src/components/ToDoGroup.svelte new file mode 100644 index 0000000000..56466ee37c --- /dev/null +++ b/plugins/time-resources/src/components/ToDoGroup.svelte @@ -0,0 +1,124 @@ + + +{#if showTitle} + + + + + {#if groups} + {#each groups as group} + + {#each todos.filter((td) => td.attachedSpace === group._id) as todo} + +
dispatch('dragstart', todo)}> + +
+ {/each} +
+ {/each} + {/if} + {#if withoutProject} + + {#each todos.filter((td) => !hasProject(td.attachedSpace)) as todo} + +
dispatch('dragstart', todo)}> + +
+ {/each} +
+ {/if} +
+{:else} +
+ {#each todos as todo} + +
dispatch('dragstart', todo)}> + +
+ {/each} +
+{/if} diff --git a/plugins/time-resources/src/components/ToDoPresenter.svelte b/plugins/time-resources/src/components/ToDoPresenter.svelte new file mode 100644 index 0000000000..50702a54c8 --- /dev/null +++ b/plugins/time-resources/src/components/ToDoPresenter.svelte @@ -0,0 +1,74 @@ + + + +{#if showCheck} +
+
+ +
+
+
+ {#if visible} + {value.title} + {:else} +
+ {#if value.attachedTo !== time.ids.NotAttached && visible} +
+ +
+ {/if} +
+
+{:else} +
+
+ {#if visible} + {value.title} + {:else} +
+ {#if value.attachedTo !== time.ids.NotAttached && visible} +
+ +
+ {/if} +
+{/if} diff --git a/plugins/time-resources/src/components/ToDos.svelte b/plugins/time-resources/src/components/ToDos.svelte new file mode 100644 index 0000000000..02f2ec6362 --- /dev/null +++ b/plugins/time-resources/src/components/ToDos.svelte @@ -0,0 +1,317 @@ + + +
+
+ +
+
+ + (largeSize = !largeSize)} + /> + +
+ + + 1 ? todosSP : defaultSP} noStretch> + {#each groups as group} + 1} + showDuration={group[0] !== time.string.Unplanned} + {mode} + {projects} + {largeSize} + on:dragstart + on:dragend + /> + {/each} + +
+ + diff --git a/plugins/time-resources/src/components/ToDosNavigator.svelte b/plugins/time-resources/src/components/ToDosNavigator.svelte new file mode 100644 index 0000000000..2a2feb08fb --- /dev/null +++ b/plugins/time-resources/src/components/ToDosNavigator.svelte @@ -0,0 +1,233 @@ + + +
+
+
+
+ + + {#each modes as _mode} + {@const counter = counters[_mode.value] ?? 0} + 0 ? counter : null} + on:click={() => { + mode = _mode.value + tag = undefined + localStorage.setItem('todos_last_mode', mode) + localStorage.removeItem('todos_last_tag') + }} + /> + {/each} + +
+ { + if (event.detail) { + tag = undefined + currentDate = event.detail + mode = 'date' + } + }} + > + +
+
+
+ +
+
+
+ +
+
+ + + + + +
+ + {#if tags.length > 0} + + {#each tags as _tag} + {@const color = getPlatformColorDef(_tag.color ?? 0, $themeStore.dark)} + { + mode = 'tag' + tag = _tag._id + localStorage.setItem('todos_last_mode', mode) + localStorage.setItem('todos_last_tag', tag) + }} + /> + {/each} + + {/if} + +
+ +
+ + diff --git a/plugins/time-resources/src/components/TodoWorkslots.svelte b/plugins/time-resources/src/components/TodoWorkslots.svelte new file mode 100644 index 0000000000..2e30339ffb --- /dev/null +++ b/plugins/time-resources/src/components/TodoWorkslots.svelte @@ -0,0 +1,94 @@ + + + + diff --git a/plugins/time-resources/src/components/WorkItemPresenter.svelte b/plugins/time-resources/src/components/WorkItemPresenter.svelte new file mode 100644 index 0000000000..4e2d77153d --- /dev/null +++ b/plugins/time-resources/src/components/WorkItemPresenter.svelte @@ -0,0 +1,53 @@ + + +{#if presenter?.presenter && doc} + {#if kind === 'default'} + + +
+ +
+ {:else} + + + + {/if} +{/if} diff --git a/plugins/time-resources/src/components/WorkSlotElement.svelte b/plugins/time-resources/src/components/WorkSlotElement.svelte new file mode 100644 index 0000000000..3218caa72e --- /dev/null +++ b/plugins/time-resources/src/components/WorkSlotElement.svelte @@ -0,0 +1,38 @@ + + + +{#if hideDetails} +