From e0853ecf99ad7805d2496cbc4cb947b60e185973 Mon Sep 17 00:00:00 2001 From: Sergei Ogorelkov Date: Fri, 17 Jun 2022 12:07:56 +0700 Subject: [PATCH] Add trigger for updating sub-issues project (#2079) Signed-off-by: Sergei Ogorelkov --- changelog.md | 1 + common/config/rush/pnpm-lock.yaml | 111 +++++++++++++----- dev/prod/package.json | 2 + dev/prod/src/platform-dev.ts | 2 + dev/tool/package.json | 2 + dev/tool/src/elastic.ts | 2 + models/all/package.json | 1 + models/all/src/index.ts | 2 + models/server-tracker/.eslintrc.js | 7 ++ models/server-tracker/.npmignore | 4 + models/server-tracker/config/rig.json | 18 +++ models/server-tracker/package.json | 33 ++++++ models/server-tracker/src/index.ts | 25 ++++ models/server-tracker/tsconfig.json | 8 ++ products/tracker/package.json | 2 + products/tracker/src/platform-dev.ts | 2 + rush.json | 17 ++- server-plugins/tracker-resources/.eslintrc.js | 7 ++ server-plugins/tracker-resources/.npmignore | 4 + .../tracker-resources/config/rig.json | 18 +++ server-plugins/tracker-resources/package.json | 34 ++++++ server-plugins/tracker-resources/src/index.ts | 75 ++++++++++++ .../tracker-resources/tsconfig.json | 8 ++ server-plugins/tracker/.eslintrc.js | 7 ++ server-plugins/tracker/.npmignore | 4 + server-plugins/tracker/config/rig.json | 18 +++ server-plugins/tracker/package.json | 33 ++++++ server-plugins/tracker/src/index.ts | 32 +++++ server-plugins/tracker/tsconfig.json | 9 ++ server/server/package.json | 2 + server/server/src/server.ts | 2 + 31 files changed, 462 insertions(+), 30 deletions(-) create mode 100644 models/server-tracker/.eslintrc.js create mode 100644 models/server-tracker/.npmignore create mode 100644 models/server-tracker/config/rig.json create mode 100644 models/server-tracker/package.json create mode 100644 models/server-tracker/src/index.ts create mode 100644 models/server-tracker/tsconfig.json create mode 100644 server-plugins/tracker-resources/.eslintrc.js create mode 100644 server-plugins/tracker-resources/.npmignore create mode 100644 server-plugins/tracker-resources/config/rig.json create mode 100644 server-plugins/tracker-resources/package.json create mode 100644 server-plugins/tracker-resources/src/index.ts create mode 100644 server-plugins/tracker-resources/tsconfig.json create mode 100644 server-plugins/tracker/.eslintrc.js create mode 100644 server-plugins/tracker/.npmignore create mode 100644 server-plugins/tracker/config/rig.json create mode 100644 server-plugins/tracker/package.json create mode 100644 server-plugins/tracker/src/index.ts create mode 100644 server-plugins/tracker/tsconfig.json diff --git a/changelog.md b/changelog.md index 66622e6c25..ee6458d9cb 100644 --- a/changelog.md +++ b/changelog.md @@ -7,6 +7,7 @@ Platform: - Allow to attach from clipboard +- Updating subtask project according to parent project Leads: diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index b3d5bd2a81..cbe608d92b 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -87,6 +87,7 @@ specifiers: '@rush-temp/model-server-tags': file:./projects/model-server-tags.tgz '@rush-temp/model-server-task': file:./projects/model-server-task.tgz '@rush-temp/model-server-telegram': file:./projects/model-server-telegram.tgz + '@rush-temp/model-server-tracker': file:./projects/model-server-tracker.tgz '@rush-temp/model-setting': file:./projects/model-setting.tgz '@rush-temp/model-tags': file:./projects/model-tags.tgz '@rush-temp/model-task': file:./projects/model-task.tgz @@ -149,6 +150,8 @@ specifiers: '@rush-temp/server-telegram-resources': file:./projects/server-telegram-resources.tgz '@rush-temp/server-token': file:./projects/server-token.tgz '@rush-temp/server-tool': file:./projects/server-tool.tgz + '@rush-temp/server-tracker': file:./projects/server-tracker.tgz + '@rush-temp/server-tracker-resources': file:./projects/server-tracker-resources.tgz '@rush-temp/server-ws': file:./projects/server-ws.tgz '@rush-temp/setting': file:./projects/setting.tgz '@rush-temp/setting-assets': file:./projects/setting-assets.tgz @@ -226,6 +229,7 @@ specifiers: cropperjs: ~1.5.12 cross-env: ~7.0.3 css-loader: ^5.2.1 + csv-parse: ~5.1.0 deep-equal: ^2.0.5 dotenv: ~16.0.0 dotenv-webpack: ^7.0.2 @@ -373,6 +377,7 @@ dependencies: '@rush-temp/model-server-tags': file:projects/model-server-tags.tgz_typescript@4.7.2 '@rush-temp/model-server-task': file:projects/model-server-task.tgz_typescript@4.7.2 '@rush-temp/model-server-telegram': file:projects/model-server-telegram.tgz_typescript@4.7.2 + '@rush-temp/model-server-tracker': file:projects/model-server-tracker.tgz_typescript@4.7.2 '@rush-temp/model-setting': file:projects/model-setting.tgz_typescript@4.7.2 '@rush-temp/model-tags': file:projects/model-tags.tgz_typescript@4.7.2 '@rush-temp/model-task': file:projects/model-task.tgz_typescript@4.7.2 @@ -435,6 +440,8 @@ dependencies: '@rush-temp/server-telegram-resources': file:projects/server-telegram-resources.tgz '@rush-temp/server-token': file:projects/server-token.tgz '@rush-temp/server-tool': file:projects/server-tool.tgz + '@rush-temp/server-tracker': file:projects/server-tracker.tgz + '@rush-temp/server-tracker-resources': file:projects/server-tracker-resources.tgz '@rush-temp/server-ws': file:projects/server-ws.tgz '@rush-temp/setting': file:projects/setting.tgz '@rush-temp/setting-assets': file:projects/setting-assets.tgz_typescript@4.7.2 @@ -512,6 +519,7 @@ dependencies: cropperjs: 1.5.12 cross-env: 7.0.3 css-loader: 5.2.7_webpack@5.73.0 + csv-parse: 5.1.0 deep-equal: 2.0.5 dotenv: 16.0.1 dotenv-webpack: 7.1.0_webpack@5.73.0 @@ -4064,28 +4072,10 @@ packages: cssom: 0.3.8 dev: false - /csv-generate/4.1.0: - resolution: {integrity: sha512-Z17wI0xmDfpwzB7lShyK7INBt0YMyh5kV7svWTwsBSOa30T6Lq1fHHasmSCtf2rRTI7GnTk52HQRYBk0ToAXQQ==} - dev: false - /csv-parse/5.1.0: resolution: {integrity: sha512-JL+Q6YEikT2uoe57InjFFa6VejhSv0tDwOxeQ1bVQKeUC/NCnLAAZ8n3PzowPQQLuZ37fysDYZipB2UJkH9C6A==} dev: false - /csv-stringify/6.1.0: - resolution: {integrity: sha512-rdBqiy77TczvhGlpLHyoph2adMs6WMnmQY4PBRqeIWykI1FLnVCppnRdso8faGj2+eN7izk9YlbFyZkOrL9rAQ==} - dev: false - - /csv/6.1.0: - resolution: {integrity: sha512-kvd8YWk7emi/0fXhuv+IKaanNFhPi5Up1wT4ZGVUu39bd9lRWpxQu1F7eaRfxTEc9mGxeMWIzEilKKrL0MoEnQ==} - engines: {node: '>= 0.1.90'} - dependencies: - csv-generate: 4.1.0 - csv-parse: 5.1.0 - csv-stringify: 6.1.0 - stream-transform: 3.1.0 - dev: false - /data-urls/2.0.0: resolution: {integrity: sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ==} engines: {node: '>=10'} @@ -8804,10 +8794,6 @@ packages: readable-stream: 3.6.0 dev: false - /stream-transform/3.1.0: - resolution: {integrity: sha512-ncT/rST/M2N2zGLacJmeB7TNq/XS8Ck0xqvhYX6bgLwSPTSZLVFCSvNnwTU+RYhk9fAfwzCkYH9I5kdgcDMvfw==} - dev: false - /streamsearch/1.1.0: resolution: {integrity: sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==} engines: {node: '>=10.0.0'} @@ -11332,7 +11318,7 @@ packages: dev: false file:projects/model-all.tgz_typescript@4.7.2: - resolution: {integrity: sha512-Ard+150yL0Y2NaemClMs5TuSMqKu2oFyYI7oy2WfnHtMzow+H4WEk68FHB/zC2D6KNWi51H6RZ1dIc2+9gcGUg==, tarball: file:projects/model-all.tgz} + resolution: {integrity: sha512-3KLZ8VdyN6qL7q5SOOeD9sU9xUoDeqJRxAbyLtFhAgaTU1tX9n3C+cnmlDZhXq8kcK/Ss/xK2hrHfq0kOI7ILw==, tarball: file:projects/model-all.tgz} id: file:projects/model-all.tgz name: '@rush-temp/model-all' version: 0.0.0 @@ -12045,6 +12031,29 @@ packages: - typescript dev: false + file:projects/model-server-tracker.tgz_typescript@4.7.2: + resolution: {integrity: sha512-3HUhXzYc+nHrN4DYIYeelA1sHD5hbsxAHFd0CVmmTQ+9cCEWDJUroNEiGCCr7hVs9Kt0UXXG9PLdvDcyyKWMPA==, tarball: file:projects/model-server-tracker.tgz} + id: file:projects/model-server-tracker.tgz + name: '@rush-temp/model-server-tracker' + version: 0.0.0 + dependencies: + '@rushstack/heft': 0.45.5 + '@types/heft-jest': 1.0.2 + '@typescript-eslint/eslint-plugin': 5.27.0_738fa17fa57f8a69ace69c90e5cfa1d5 + '@typescript-eslint/parser': 5.27.0_eslint@7.32.0+typescript@4.7.2 + eslint: 7.32.0 + eslint-config-standard-with-typescript: 21.0.1_99a5fe2f2ae1dc64d6b59974c931eb2a + eslint-plugin-import: 2.26.0_c21022bc9feaeb7b200d3d631eeae46c + eslint-plugin-node: 11.1.0_eslint@7.32.0 + eslint-plugin-promise: 5.2.0_eslint@7.32.0 + prettier: 2.6.2 + transitivePeerDependencies: + - eslint-import-resolver-typescript + - eslint-import-resolver-webpack + - supports-color + - typescript + dev: false + file:projects/model-setting.tgz_typescript@4.7.2: resolution: {integrity: sha512-BcxU6vVAXEmrjraS3jewut5+oeAEQuzU/k4aSNrdWi4oaOWJm5p5v1O2gzVZXbjI39eThGIbTtzDLBCEX95n1Q==, tarball: file:projects/model-setting.tgz} id: file:projects/model-setting.tgz @@ -12184,7 +12193,7 @@ packages: dev: false file:projects/model-tracker.tgz_typescript@4.7.2: - resolution: {integrity: sha512-uRgEbWiEJ7vGg8Rwf72rMT+6dqDEiAR7Vn5UiH9j7geeOvz43eusMLcNJ/CAa9/b2301dHO3VKT5h/YnibM5GA==, tarball: file:projects/model-tracker.tgz} + resolution: {integrity: sha512-3giT5Ql8N6I6UaeU038P16HSmmhnQdy2eIYaKok1cF+AX0Z/0dXcR/bSvgQ88WJxMrtAsusZkOkF+PyvUUJOYg==, tarball: file:projects/model-tracker.tgz} id: file:projects/model-tracker.tgz name: '@rush-temp/model-tracker' version: 0.0.0 @@ -12623,7 +12632,7 @@ packages: dev: false file:projects/prod-tracker.tgz_d1c3762ecb2c185353d3f02936f6ec22: - resolution: {integrity: sha512-0eyrMP8f/hVYH+hCzocX+7NQV1qV63Y01jOMV8HkimM51dtCFCz3Qo2Tki5jEw4gjX1Dv3XhvhMAoLDSvDI1Ig==, tarball: file:projects/prod-tracker.tgz} + resolution: {integrity: sha512-zGqmuGtTWtIqvDsoxMoZD3MrD+r0vMKQM/FIxf7HLxosTleGiflEbi85a+ZySK7kSw0cN7J1zP3HoSv7E5/dlg==, tarball: file:projects/prod-tracker.tgz} id: file:projects/prod-tracker.tgz name: '@rush-temp/prod-tracker' version: 0.0.0 @@ -12669,7 +12678,7 @@ packages: dev: false file:projects/prod.tgz_d1c3762ecb2c185353d3f02936f6ec22: - resolution: {integrity: sha512-QATm8tinHt8huisQGumkIxn/Ew4j8Bez88PjoKLuXhybtp5uhZh67ooqqvbN9V+RPaR/827nktjzSzS1vZ6ZQQ==, tarball: file:projects/prod.tgz} + resolution: {integrity: sha512-PehFsaG21mA1q8ou+ldHAfMX0O+nPv2zVXTuj/K5TPMZ/DEkCtQHZtaVElryGq4xD1PlMyaID/1mqppbYEpbPQ==, tarball: file:projects/prod.tgz} id: file:projects/prod.tgz name: '@rush-temp/prod' version: 0.0.0 @@ -13610,6 +13619,51 @@ packages: - utf-8-validate dev: false + file:projects/server-tracker-resources.tgz: + resolution: {integrity: sha512-gJqowCis9yMaD5guzyEHwsD2rPrQVWg8OMz+HA3yavagTbOn+s/kStjDHCuWr/UCvaMG2C8KKGEh+kof5Tw81A==, tarball: file:projects/server-tracker-resources.tgz} + name: '@rush-temp/server-tracker-resources' + version: 0.0.0 + dependencies: + '@rushstack/heft': 0.45.5 + '@types/heft-jest': 1.0.2 + '@typescript-eslint/eslint-plugin': 5.27.0_738fa17fa57f8a69ace69c90e5cfa1d5 + '@typescript-eslint/parser': 5.27.0_eslint@7.32.0+typescript@4.7.2 + eslint: 7.32.0 + eslint-config-standard-with-typescript: 21.0.1_99a5fe2f2ae1dc64d6b59974c931eb2a + eslint-plugin-import: 2.26.0_c21022bc9feaeb7b200d3d631eeae46c + eslint-plugin-node: 11.1.0_eslint@7.32.0 + eslint-plugin-promise: 5.2.0_eslint@7.32.0 + prettier: 2.6.2 + typescript: 4.7.2 + transitivePeerDependencies: + - eslint-import-resolver-typescript + - eslint-import-resolver-webpack + - supports-color + dev: false + + file:projects/server-tracker.tgz: + resolution: {integrity: sha512-MX6s76LYP1+V2O0cX17+ZMRMshwLYFOVZ1H7p1P+dSjLYQvAGd/YLSm4+EBQDezhifALLdUYnRAJ63+6g3xwxA==, tarball: file:projects/server-tracker.tgz} + name: '@rush-temp/server-tracker' + version: 0.0.0 + dependencies: + '@rushstack/heft': 0.45.5 + '@types/heft-jest': 1.0.2 + '@types/node': 16.11.38 + '@typescript-eslint/eslint-plugin': 5.27.0_738fa17fa57f8a69ace69c90e5cfa1d5 + '@typescript-eslint/parser': 5.27.0_eslint@7.32.0+typescript@4.7.2 + eslint: 7.32.0 + eslint-config-standard-with-typescript: 21.0.1_99a5fe2f2ae1dc64d6b59974c931eb2a + eslint-plugin-import: 2.26.0_c21022bc9feaeb7b200d3d631eeae46c + eslint-plugin-node: 11.1.0_eslint@7.32.0 + eslint-plugin-promise: 5.2.0_eslint@7.32.0 + prettier: 2.6.2 + typescript: 4.7.2 + transitivePeerDependencies: + - eslint-import-resolver-typescript + - eslint-import-resolver-webpack + - supports-color + dev: false + file:projects/server-ws.tgz: resolution: {integrity: sha512-3OcollkknCogTVUoodFYtWQY7HEqvk/IwIJcttmAOoiFMZ5bLxVJp4owsikDyltPo6xWLnjEwxYuyzInBaHg0A==, tarball: file:projects/server-ws.tgz} name: '@rush-temp/server-ws' @@ -13638,7 +13692,7 @@ packages: dev: false file:projects/server.tgz: - resolution: {integrity: sha512-DixjIA8WXXltcm2FxRmE1hQMwF3p/5eqoHsMCtEEj1g5Pr8a1XGGfwGcsulDCM3rsekYZ9i+6Rf9baMg47eL8A==, tarball: file:projects/server.tgz} + resolution: {integrity: sha512-YMw6QleaQlQlzkQhIncun4YVr77XcZSRLy8xzfJiy6X1PaBSve9WY9mGkKiiw119bo2/72HEHEHMnsHQU3VtSQ==, tarball: file:projects/server.tgz} name: '@rush-temp/server' version: 0.0.0 dependencies: @@ -14197,7 +14251,7 @@ packages: dev: false file:projects/tool.tgz: - resolution: {integrity: sha512-YguV0HWnBdoHtfM//K6D5IJDro71EfyC7EbAsk7jPk1BR4NEq8fcPqUNO2ySQNOmCeRT8FlYIX5D8iiib+SQug==, tarball: file:projects/tool.tgz} + resolution: {integrity: sha512-cLyyAtdkGqG4pxA7QhbNhoNwhIoxpUktmo6OA8kJzcjisF23dXsuuDv097gM6Y0IOdIRGWET8XRaM1sIE/4ogQ==, tarball: file:projects/tool.tgz} name: '@rush-temp/tool' version: 0.0.0 dependencies: @@ -14214,7 +14268,6 @@ packages: '@typescript-eslint/parser': 5.27.0_eslint@7.32.0+typescript@4.7.2 commander: 8.3.0 cross-env: 7.0.3 - csv: 6.1.0 csv-parse: 5.1.0 esbuild: 0.12.29 eslint: 7.32.0 diff --git a/dev/prod/package.json b/dev/prod/package.json index 91e9ec25d9..9cb30c9369 100644 --- a/dev/prod/package.json +++ b/dev/prod/package.json @@ -136,6 +136,8 @@ "@anticrm/server-telegram": "~0.6.0", "@anticrm/server-telegram-resources": "~0.6.0", "@anticrm/presentation": "~0.6.2", + "@anticrm/server-tracker": "~0.6.0", + "@anticrm/server-tracker-resources": "~0.6.0", "@anticrm/tracker": "~0.6.0", "@anticrm/tracker-assets": "~0.6.0", "@anticrm/tracker-resources": "~0.6.0", diff --git a/dev/prod/src/platform-dev.ts b/dev/prod/src/platform-dev.ts index 81892f9f18..ea726f597a 100644 --- a/dev/prod/src/platform-dev.ts +++ b/dev/prod/src/platform-dev.ts @@ -27,6 +27,7 @@ import { serverInventoryId } from '@anticrm/server-inventory' import { serverLeadId } from '@anticrm/server-lead' import { serverRecruitId } from '@anticrm/server-recruit' import { serverTaskId } from '@anticrm/server-task' +import { serverTrackerId } from '@anticrm/server-tracker' import { serverTagsId } from '@anticrm/server-tags' import { serverCalendarId } from '@anticrm/server-calendar' import { serverGmailId } from '@anticrm/server-gmail' @@ -54,6 +55,7 @@ export function configurePlatformDev() { addLocation(serverLeadId, () => import(/* webpackChunkName: "server-lead" */ '@anticrm/server-lead-resources')) addLocation(serverRecruitId, () => import(/* webpackChunkName: "server-recruit" */ '@anticrm/server-recruit-resources')) addLocation(serverTaskId, () => import/* webpackChunkName: "server-task" */ ('@anticrm/server-task-resources')) + addLocation(serverTrackerId, () => import/* webpackChunkName: "server-tracker" */ ('@anticrm/server-tracker-resources')) addLocation(serverTagsId, () => import/* webpackChunkName: "server-tags" */ ('@anticrm/server-tags-resources')) addLocation(serverCalendarId, () => import/* webpackChunkName: "server-calendar" */ ('@anticrm/server-calendar-resources')) addLocation(serverGmailId, () => import/* webpackChunkName: "server-gmail" */ ('@anticrm/server-gmail-resources')) diff --git a/dev/tool/package.json b/dev/tool/package.json index b345f80a0b..b2d8e1fdc4 100644 --- a/dev/tool/package.json +++ b/dev/tool/package.json @@ -93,6 +93,8 @@ "@anticrm/server-recruit-resources": "~0.6.0", "@anticrm/server-task": "~0.6.0", "@anticrm/server-task-resources": "~0.6.0", + "@anticrm/server-tracker": "~0.6.0", + "@anticrm/server-tracker-resources": "~0.6.0", "@anticrm/server-tags": "~0.6.0", "@anticrm/server-tags-resources": "~0.6.0", "@anticrm/server-calendar": "~0.6.0", diff --git a/dev/tool/src/elastic.ts b/dev/tool/src/elastic.ts index 72039cae6b..5909458f37 100644 --- a/dev/tool/src/elastic.ts +++ b/dev/tool/src/elastic.ts @@ -68,6 +68,7 @@ import { serverRecruitId } from '@anticrm/server-recruit' import { serverSettingId } from '@anticrm/server-setting' import { serverTagsId } from '@anticrm/server-tags' import { serverTaskId } from '@anticrm/server-task' +import { serverTrackerId } from '@anticrm/server-tracker' import { serverTelegramId } from '@anticrm/server-telegram' import { Client as ElasticClient } from '@elastic/elasticsearch' import { Client } from 'minio' @@ -133,6 +134,7 @@ export class ElasticTool { addLocation(serverRecruitId, () => import('@anticrm/server-recruit-resources')) addLocation(serverSettingId, () => import('@anticrm/server-setting-resources')) addLocation(serverTaskId, () => import('@anticrm/server-task-resources')) + addLocation(serverTrackerId, () => import('@anticrm/server-tracker-resources')) addLocation(serverTagsId, () => import('@anticrm/server-tags-resources')) addLocation(serverCalendarId, () => import('@anticrm/server-calendar-resources')) addLocation(serverGmailId, () => import('@anticrm/server-gmail-resources')) diff --git a/models/all/package.json b/models/all/package.json index ab5abb4d26..b7af3a299d 100644 --- a/models/all/package.json +++ b/models/all/package.json @@ -50,6 +50,7 @@ "@anticrm/model-server-setting": "~0.6.0", "@anticrm/model-server-chunter": "~0.6.0", "@anticrm/model-server-task": "~0.6.0", + "@anticrm/model-server-tracker": "~0.6.0", "@anticrm/model-server-tags": "~0.6.0", "@anticrm/model-server-recruit": "~0.6.0", "@anticrm/model-server-lead": "~0.6.0", diff --git a/models/all/src/index.ts b/models/all/src/index.ts index 83027e20c2..4b14f3ef06 100644 --- a/models/all/src/index.ts +++ b/models/all/src/index.ts @@ -35,6 +35,7 @@ import { createModel as serverChunterModel } from '@anticrm/model-server-chunter import { createModel as serverInventoryModel } from '@anticrm/model-server-inventory' import { createModel as serverLeadModel } from '@anticrm/model-server-lead' import { createModel as serverTaskModel } from '@anticrm/model-server-task' +import { createModel as serverTrackerModel } from '@anticrm/model-server-tracker' import { createModel as serverTagsModel } from '@anticrm/model-server-tags' import { createModel as serveSettingModel } from '@anticrm/model-server-setting' import { createModel as serverRecruitModel } from '@anticrm/model-server-recruit' @@ -93,6 +94,7 @@ const builders: [(b: Builder) => void, string][] = [ [serverLeadModel, 'server-lead'], [serverTagsModel, 'server-tags'], [serverTaskModel, 'server-task'], + [serverTrackerModel, 'server-tracker'], [serverRecruitModel, 'server-recruit'], [serverCalendarModel, 'server-calendar'], [serverGmailModel, 'server-gmail'], diff --git a/models/server-tracker/.eslintrc.js b/models/server-tracker/.eslintrc.js new file mode 100644 index 0000000000..c3c2c49417 --- /dev/null +++ b/models/server-tracker/.eslintrc.js @@ -0,0 +1,7 @@ +module.exports = { + extends: ['./node_modules/@anticrm/model-rig/profiles/default/config/eslint.config.json'], + parserOptions: { + tsconfigRootDir: __dirname, + project: './tsconfig.json' + } +} diff --git a/models/server-tracker/.npmignore b/models/server-tracker/.npmignore new file mode 100644 index 0000000000..e3ec093c38 --- /dev/null +++ b/models/server-tracker/.npmignore @@ -0,0 +1,4 @@ +* +!/lib/** +!CHANGELOG.md +/lib/**/__tests__/ diff --git a/models/server-tracker/config/rig.json b/models/server-tracker/config/rig.json new file mode 100644 index 0000000000..e9a9ee9add --- /dev/null +++ b/models/server-tracker/config/rig.json @@ -0,0 +1,18 @@ +// The "rig.json" file directs tools to look for their config files in an external package. +// Documentation for this system: https://www.npmjs.com/package/@rushstack/rig-package +{ + "$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json", + + /** + * (Required) The name of the rig package to inherit from. + * It should be an NPM package name with the "-rig" suffix. + */ + "rigPackageName": "@anticrm/model-rig" + + /** + * (Optional) Selects a config profile from the rig package. The name must consist of + * lowercase alphanumeric words separated by hyphens, for example "sample-profile". + * If omitted, then the "default" profile will be used." + */ + // "rigProfile": "your-profile-name" +} diff --git a/models/server-tracker/package.json b/models/server-tracker/package.json new file mode 100644 index 0000000000..95eddfae23 --- /dev/null +++ b/models/server-tracker/package.json @@ -0,0 +1,33 @@ +{ + "name": "@anticrm/model-server-tracker", + "version": "0.6.0", + "main": "lib/index.js", + "author": "Anticrm Platform Contributors", + "license": "EPL-2.0", + "scripts": { + "build": "heft build", + "build:watch": "tsc", + "lint:fix": "eslint --fix src", + "lint": "eslint src", + "format": "prettier --write src && eslint --fix src" + }, + "devDependencies": { + "@anticrm/model-rig": "~0.6.0", + "@typescript-eslint/eslint-plugin": "^5.21.0", + "eslint-plugin-import": "^2.25.3", + "eslint-plugin-promise": "^5.1.1", + "eslint-plugin-node": "^11.1.0", + "eslint": "^7.32.0", + "@types/heft-jest": "^1.0.2", + "@typescript-eslint/parser": "^5.4.0", + "eslint-config-standard-with-typescript": "^21.0.1", + "prettier": "^2.4.1", + "@rushstack/heft": "^0.45.5" + }, + "dependencies": { + "@anticrm/core": "~0.6.16", + "@anticrm/model": "~0.6.0", + "@anticrm/server-core": "~0.6.1", + "@anticrm/server-tracker": "~0.6.0" + } +} diff --git a/models/server-tracker/src/index.ts b/models/server-tracker/src/index.ts new file mode 100644 index 0000000000..13902324e4 --- /dev/null +++ b/models/server-tracker/src/index.ts @@ -0,0 +1,25 @@ +// +// 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 { Builder } from '@anticrm/model' +import core from '@anticrm/core' +import serverCore from '@anticrm/server-core' +import serverTracker from '@anticrm/server-tracker' + +export function createModel (builder: Builder): void { + builder.createDoc(serverCore.class.Trigger, core.space.Model, { + trigger: serverTracker.trigger.OnIssueProjectUpdate + }) +} diff --git a/models/server-tracker/tsconfig.json b/models/server-tracker/tsconfig.json new file mode 100644 index 0000000000..1d60db76b4 --- /dev/null +++ b/models/server-tracker/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "./node_modules/@anticrm/model-rig/profiles/default/tsconfig.json", + + "compilerOptions": { + "rootDir": "./src", + "outDir": "./lib", + } +} \ No newline at end of file diff --git a/products/tracker/package.json b/products/tracker/package.json index b96abb11f5..f9382930ee 100644 --- a/products/tracker/package.json +++ b/products/tracker/package.json @@ -112,6 +112,8 @@ "@anticrm/server-chunter-resources": "~0.6.0", "@anticrm/server-task": "~0.6.0", "@anticrm/server-task-resources": "~0.6.0", + "@anticrm/server-tracker": "~0.6.0", + "@anticrm/server-tracker-resources": "~0.6.0", "@anticrm/server-calendar": "~0.6.0", "@anticrm/server-calendar-resources": "~0.6.0", "@anticrm/server-gmail": "~0.6.0", diff --git a/products/tracker/src/platform-dev.ts b/products/tracker/src/platform-dev.ts index f0e0dd30af..aeb1875927 100644 --- a/products/tracker/src/platform-dev.ts +++ b/products/tracker/src/platform-dev.ts @@ -24,6 +24,7 @@ import { serverNotificationId } from '@anticrm/server-notification' import { serverSettingId } from '@anticrm/server-setting' import { serverChunterId } from '@anticrm/server-chunter' import { serverTaskId } from '@anticrm/server-task' +import { serverTrackerId } from '@anticrm/server-tracker' import { serverCalendarId } from '@anticrm/server-calendar' import { serverGmailId } from '@anticrm/server-gmail' import { serverTelegramId } from '@anticrm/server-telegram' @@ -47,6 +48,7 @@ export function configurePlatformDev() { addLocation(serverSettingId, () => import(/* webpackChunkName: "server-setting" */ '@anticrm/server-setting-resources')) addLocation(serverChunterId, () => import(/* webpackChunkName: "server-chunter" */ '@anticrm/server-chunter-resources')) addLocation(serverTaskId, () => import/* webpackChunkName: "server-task" */ ('@anticrm/server-task-resources')) + addLocation(serverTrackerId, () => import/* webpackChunkName: "server-tracker" */ ('@anticrm/server-tracker-resources')) addLocation(serverCalendarId, () => import/* webpackChunkName: "server-calendar" */ ('@anticrm/server-calendar-resources')) addLocation(serverGmailId, () => import/* webpackChunkName: "server-gmail" */ ('@anticrm/server-gmail-resources')) addLocation(serverTelegramId, () => import/* webpackChunkName: "server-telegram" */ ('@anticrm/server-telegram-resources')) diff --git a/rush.json b/rush.json index 92c5125adb..8090ddd4bf 100644 --- a/rush.json +++ b/rush.json @@ -1116,6 +1116,21 @@ "projectFolder": "models/server-task", "shouldPublish": true }, + { + "packageName": "@anticrm/server-tracker", + "projectFolder": "server-plugins/tracker", + "shouldPublish": true + }, + { + "packageName": "@anticrm/model-server-tracker", + "projectFolder": "models/server-tracker", + "shouldPublish": true + }, + { + "packageName": "@anticrm/server-tracker-resources", + "projectFolder": "server-plugins/tracker-resources", + "shouldPublish": true + }, { "packageName": "@anticrm/server-task-resources", "projectFolder": "server-plugins/task-resources", @@ -1312,6 +1327,6 @@ "packageName": "@anticrm/pod-backup", "projectFolder": "pods/backup", "shouldPublish": false - }, + } ] } diff --git a/server-plugins/tracker-resources/.eslintrc.js b/server-plugins/tracker-resources/.eslintrc.js new file mode 100644 index 0000000000..5da5872d4a --- /dev/null +++ b/server-plugins/tracker-resources/.eslintrc.js @@ -0,0 +1,7 @@ +module.exports = { + extends: ['./node_modules/@anticrm/platform-rig/profiles/default/config/eslint.config.json'], + parserOptions: { + tsconfigRootDir: __dirname, + project: './tsconfig.json' + } +} diff --git a/server-plugins/tracker-resources/.npmignore b/server-plugins/tracker-resources/.npmignore new file mode 100644 index 0000000000..e3ec093c38 --- /dev/null +++ b/server-plugins/tracker-resources/.npmignore @@ -0,0 +1,4 @@ +* +!/lib/** +!CHANGELOG.md +/lib/**/__tests__/ diff --git a/server-plugins/tracker-resources/config/rig.json b/server-plugins/tracker-resources/config/rig.json new file mode 100644 index 0000000000..af1257a896 --- /dev/null +++ b/server-plugins/tracker-resources/config/rig.json @@ -0,0 +1,18 @@ +// The "rig.json" file directs tools to look for their config files in an external package. +// Documentation for this system: https://www.npmjs.com/package/@rushstack/rig-package +{ + "$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json", + + /** + * (Required) The name of the rig package to inherit from. + * It should be an NPM package name with the "-rig" suffix. + */ + "rigPackageName": "@anticrm/platform-rig" + + /** + * (Optional) Selects a config profile from the rig package. The name must consist of + * lowercase alphanumeric words separated by hyphens, for example "sample-profile". + * If omitted, then the "default" profile will be used." + */ + // "rigProfile": "your-profile-name" +} diff --git a/server-plugins/tracker-resources/package.json b/server-plugins/tracker-resources/package.json new file mode 100644 index 0000000000..458a2dcde3 --- /dev/null +++ b/server-plugins/tracker-resources/package.json @@ -0,0 +1,34 @@ +{ + "name": "@anticrm/server-tracker-resources", + "version": "0.6.0", + "main": "lib/index.js", + "author": "Anticrm Platform Contributors", + "license": "EPL-2.0", + "scripts": { + "build": "heft build", + "build:watch": "tsc", + "lint:fix": "eslint --fix src", + "lint": "eslint src", + "format": "prettier --write src && eslint --fix src" + }, + "devDependencies": { + "@anticrm/platform-rig": "~0.6.0", + "@types/heft-jest": "^1.0.2", + "@typescript-eslint/eslint-plugin": "^5.21.0", + "eslint-plugin-import": "^2.25.3", + "eslint-plugin-promise": "^5.1.1", + "eslint-plugin-node": "^11.1.0", + "eslint": "^7.32.0", + "@typescript-eslint/parser": "^5.4.0", + "eslint-config-standard-with-typescript": "^21.0.1", + "prettier": "^2.4.1", + "@rushstack/heft": "^0.45.5", + "typescript": "^4.3.5" + }, + "dependencies": { + "@anticrm/core": "~0.6.16", + "@anticrm/platform": "~0.6.6", + "@anticrm/server-core": "~0.6.1", + "@anticrm/tracker": "~0.6.0" + } +} diff --git a/server-plugins/tracker-resources/src/index.ts b/server-plugins/tracker-resources/src/index.ts new file mode 100644 index 0000000000..9380459039 --- /dev/null +++ b/server-plugins/tracker-resources/src/index.ts @@ -0,0 +1,75 @@ +// +// 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 core, { AttachedData, Tx, TxUpdateDoc } from '@anticrm/core' +import { extractTx, TriggerControl } from '@anticrm/server-core' +import tracker, { Issue } from '@anticrm/tracker' + +async function updateSubIssues ( + control: TriggerControl, + node: Issue, + update: Partial>, + shouldSkip = false +): Promise[]> { + let txes: TxUpdateDoc[] = [] + + if (!shouldSkip && Object.entries(update).some(([key, value]) => value !== node[key as keyof Issue])) { + txes.push(control.txFactory.createTxUpdateDoc(node._class, node.space, node._id, update)) + } + + if (node.subIssues > 0) { + const subIssues = await control.findAll(tracker.class.Issue, { attachedTo: node._id }) + + for (const subIssue of subIssues) { + txes = txes.concat(await updateSubIssues(control, subIssue, update)) + } + } + + return txes +} + +/** + * @public + */ +export async function OnIssueProjectUpdate (tx: Tx, control: TriggerControl): Promise { + const actualTx = extractTx(tx) + if (actualTx._class !== core.class.TxUpdateDoc) { + return [] + } + + const updateTx = actualTx as TxUpdateDoc + if (!control.hierarchy.isDerived(updateTx.objectClass, tracker.class.Issue)) { + return [] + } + + if (!Object.prototype.hasOwnProperty.call(updateTx.operations, 'project')) { + return [] + } + + const update: Partial> = { project: updateTx.operations.project ?? null } + const [node] = await control.findAll( + updateTx.objectClass, + { _id: updateTx.objectId, subIssues: { $gt: 0 } }, + { limit: 1 } + ) + return node !== undefined ? await updateSubIssues(control, node, update, true) : [] +} + +// eslint-disable-next-line @typescript-eslint/explicit-function-return-type +export default async () => ({ + trigger: { + OnIssueProjectUpdate + } +}) diff --git a/server-plugins/tracker-resources/tsconfig.json b/server-plugins/tracker-resources/tsconfig.json new file mode 100644 index 0000000000..aeb0517b13 --- /dev/null +++ b/server-plugins/tracker-resources/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "./node_modules/@anticrm/platform-rig/profiles/default/tsconfig.json", + + "compilerOptions": { + "rootDir": "./src", + "outDir": "./lib" + } +} \ No newline at end of file diff --git a/server-plugins/tracker/.eslintrc.js b/server-plugins/tracker/.eslintrc.js new file mode 100644 index 0000000000..5da5872d4a --- /dev/null +++ b/server-plugins/tracker/.eslintrc.js @@ -0,0 +1,7 @@ +module.exports = { + extends: ['./node_modules/@anticrm/platform-rig/profiles/default/config/eslint.config.json'], + parserOptions: { + tsconfigRootDir: __dirname, + project: './tsconfig.json' + } +} diff --git a/server-plugins/tracker/.npmignore b/server-plugins/tracker/.npmignore new file mode 100644 index 0000000000..e3ec093c38 --- /dev/null +++ b/server-plugins/tracker/.npmignore @@ -0,0 +1,4 @@ +* +!/lib/** +!CHANGELOG.md +/lib/**/__tests__/ diff --git a/server-plugins/tracker/config/rig.json b/server-plugins/tracker/config/rig.json new file mode 100644 index 0000000000..af1257a896 --- /dev/null +++ b/server-plugins/tracker/config/rig.json @@ -0,0 +1,18 @@ +// The "rig.json" file directs tools to look for their config files in an external package. +// Documentation for this system: https://www.npmjs.com/package/@rushstack/rig-package +{ + "$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json", + + /** + * (Required) The name of the rig package to inherit from. + * It should be an NPM package name with the "-rig" suffix. + */ + "rigPackageName": "@anticrm/platform-rig" + + /** + * (Optional) Selects a config profile from the rig package. The name must consist of + * lowercase alphanumeric words separated by hyphens, for example "sample-profile". + * If omitted, then the "default" profile will be used." + */ + // "rigProfile": "your-profile-name" +} diff --git a/server-plugins/tracker/package.json b/server-plugins/tracker/package.json new file mode 100644 index 0000000000..7bfb370e6c --- /dev/null +++ b/server-plugins/tracker/package.json @@ -0,0 +1,33 @@ +{ + "name": "@anticrm/server-tracker", + "version": "0.6.0", + "main": "lib/index.js", + "author": "Anticrm Platform Contributors", + "license": "EPL-2.0", + "scripts": { + "build": "heft build", + "build:watch": "tsc", + "lint:fix": "eslint --fix src", + "lint": "eslint src", + "format": "prettier --write src && eslint --fix src" + }, + "devDependencies": { + "@anticrm/platform-rig": "~0.6.0", + "@types/heft-jest": "^1.0.2", + "@types/node": "~16.11.12", + "@typescript-eslint/eslint-plugin": "^5.21.0", + "eslint-plugin-import": "^2.25.3", + "eslint-plugin-promise": "^5.1.1", + "eslint-plugin-node": "^11.1.0", + "eslint": "^7.32.0", + "@typescript-eslint/parser": "^5.4.0", + "eslint-config-standard-with-typescript": "^21.0.1", + "prettier": "^2.4.1", + "@rushstack/heft": "^0.45.5", + "typescript": "^4.3.5" + }, + "dependencies": { + "@anticrm/platform": "~0.6.6", + "@anticrm/server-core": "~0.6.1" + } +} diff --git a/server-plugins/tracker/src/index.ts b/server-plugins/tracker/src/index.ts new file mode 100644 index 0000000000..64561336e2 --- /dev/null +++ b/server-plugins/tracker/src/index.ts @@ -0,0 +1,32 @@ +// +// 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 { Plugin, Resource } from '@anticrm/platform' +import { plugin } from '@anticrm/platform' +import { TriggerFunc } from '@anticrm/server-core' + +/** + * @public + */ +export const serverTrackerId = 'server-tracker' as Plugin + +/** + * @public + */ +export default plugin(serverTrackerId, { + trigger: { + OnIssueProjectUpdate: '' as Resource + } +}) diff --git a/server-plugins/tracker/tsconfig.json b/server-plugins/tracker/tsconfig.json new file mode 100644 index 0000000000..fffbf4c341 --- /dev/null +++ b/server-plugins/tracker/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "./node_modules/@anticrm/platform-rig/profiles/default/tsconfig.json", + + "compilerOptions": { + "rootDir": "./src", + "outDir": "./lib", + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/server/server/package.json b/server/server/package.json index 065d44a07b..d68df54044 100644 --- a/server/server/package.json +++ b/server/server/package.json @@ -65,6 +65,8 @@ "@anticrm/server-recruit-resources": "~0.6.0", "@anticrm/server-task": "~0.6.0", "@anticrm/server-task-resources": "~0.6.0", + "@anticrm/server-tracker": "~0.6.0", + "@anticrm/server-tracker-resources": "~0.6.0", "@anticrm/server-tags": "~0.6.0", "@anticrm/server-tags-resources": "~0.6.0", "@anticrm/server-calendar": "~0.6.0", diff --git a/server/server/src/server.ts b/server/server/src/server.ts index 05c57eef9f..6a5cdb1cd1 100644 --- a/server/server/src/server.ts +++ b/server/server/src/server.ts @@ -58,6 +58,7 @@ import { serverRecruitId } from '@anticrm/server-recruit' import { serverSettingId } from '@anticrm/server-setting' import { serverTagsId } from '@anticrm/server-tags' import { serverTaskId } from '@anticrm/server-task' +import { serverTrackerId } from '@anticrm/server-tracker' import { serverTelegramId } from '@anticrm/server-telegram' import { Token } from '@anticrm/server-token' import { BroadcastCall, ClientSession, start as startJsonRpc } from '@anticrm/server-ws' @@ -131,6 +132,7 @@ export function start ( addLocation(serverLeadId, () => import('@anticrm/server-lead-resources')) addLocation(serverRecruitId, () => import('@anticrm/server-recruit-resources')) addLocation(serverTaskId, () => import('@anticrm/server-task-resources')) + addLocation(serverTrackerId, () => import('@anticrm/server-tracker-resources')) addLocation(serverTagsId, () => import('@anticrm/server-tags-resources')) addLocation(serverCalendarId, () => import('@anticrm/server-calendar-resources')) addLocation(serverGmailId, () => import('@anticrm/server-gmail-resources'))