From 66a932b2c9e06c4c474442f2726ae7a6d2008ee4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pete=20An=C3=B8ther?= Date: Tue, 26 Dec 2023 12:31:22 -0300 Subject: [PATCH] TSK-1668: Side changes from Surveys (#4271) Signed-off-by: Petr Vyazovetskiy --- .github/pull_request_template.md | 2 +- common/config/rush/pnpm-lock.yaml | 155 +----------------- dev/prod/package.json | 3 - dev/prod/src/platform.ts | 4 - dev/tool/src/index.ts | 6 +- models/activity/src/index.ts | 4 +- models/all/package.json | 3 +- models/all/src/index.ts | 16 +- models/bitrix/src/plugin.ts | 4 +- models/chunter/src/plugin.ts | 6 +- models/contact/src/plugin.ts | 2 +- models/gmail/src/plugin.ts | 2 +- models/hr/src/plugin.ts | 4 +- models/lead/src/plugin.ts | 4 +- models/recruit/src/plugin.ts | 10 +- models/survey/.eslintrc.js | 7 - models/survey/.npmignore | 4 - models/survey/config/rig.json | 5 - models/survey/package.json | 38 ----- models/survey/src/index.ts | 38 ----- models/survey/src/plugin.ts | 26 --- models/survey/src/types.ts | 18 -- models/survey/tsconfig.json | 9 - models/templates/src/plugin.ts | 8 +- models/tracker/src/plugin.ts | 2 +- models/view/src/index.ts | 6 +- packages/core/lang/ru.json | 2 +- packages/core/src/classes.ts | 16 +- packages/core/src/hierarchy.ts | 14 +- packages/core/src/operations.ts | 6 +- packages/core/src/utils.ts | 3 +- packages/model/src/dsl.ts | 16 ++ .../profiles/ui/eslint.config.json | 5 + .../src/components/StyledTextBox.svelte | 1 + .../src/components/TextEditor.svelte | 8 + packages/ui/src/components/RadioButton.svelte | 2 +- plugins/board/src/index.ts | 14 +- plugins/survey-assets/.eslintrc.js | 7 - plugins/survey-assets/.npmignore | 4 - plugins/survey-assets/assets/icons.svg | 5 - plugins/survey-assets/config/rig.json | 5 - plugins/survey-assets/jest.config.js | 7 - plugins/survey-assets/lang/en.json | 7 - plugins/survey-assets/lang/ru.json | 7 - plugins/survey-assets/package.json | 36 ---- .../survey-assets/src/__tests__/lang.test.ts | 6 - plugins/survey-assets/src/index.ts | 22 --- plugins/survey-assets/tsconfig.json | 10 -- plugins/survey-resources/.eslintrc.js | 4 - plugins/survey-resources/.npmignore | 4 - plugins/survey-resources/config/rig.json | 5 - plugins/survey-resources/jest.config.js | 7 - plugins/survey-resources/package.json | 42 ----- plugins/survey-resources/postcss.config.js | 5 - plugins/survey-resources/src/index.ts | 18 -- plugins/survey-resources/src/plugin.ts | 19 --- plugins/survey-resources/svelte.config.js | 5 - plugins/survey-resources/tsconfig.json | 8 - plugins/survey/.eslintrc.js | 7 - plugins/survey/.npmignore | 4 - plugins/survey/config/rig.json | 4 - plugins/survey/jest.config.js | 7 - plugins/survey/package.json | 37 ----- plugins/survey/src/index.ts | 103 ------------ plugins/survey/tsconfig.json | 9 - plugins/tracker/src/index.ts | 32 ++-- .../src/components/EditDoc.svelte | 8 +- plugins/view/src/index.ts | 24 ++- pods/server/package.json | 4 +- pods/server/src/server.ts | 3 - rush.json | 20 --- 71 files changed, 142 insertions(+), 826 deletions(-) delete mode 100644 models/survey/.eslintrc.js delete mode 100644 models/survey/.npmignore delete mode 100644 models/survey/config/rig.json delete mode 100644 models/survey/package.json delete mode 100644 models/survey/src/index.ts delete mode 100644 models/survey/src/plugin.ts delete mode 100644 models/survey/src/types.ts delete mode 100644 models/survey/tsconfig.json delete mode 100644 plugins/survey-assets/.eslintrc.js delete mode 100644 plugins/survey-assets/.npmignore delete mode 100644 plugins/survey-assets/assets/icons.svg delete mode 100644 plugins/survey-assets/config/rig.json delete mode 100644 plugins/survey-assets/jest.config.js delete mode 100644 plugins/survey-assets/lang/en.json delete mode 100644 plugins/survey-assets/lang/ru.json delete mode 100644 plugins/survey-assets/package.json delete mode 100644 plugins/survey-assets/src/__tests__/lang.test.ts delete mode 100644 plugins/survey-assets/src/index.ts delete mode 100644 plugins/survey-assets/tsconfig.json delete mode 100644 plugins/survey-resources/.eslintrc.js delete mode 100644 plugins/survey-resources/.npmignore delete mode 100644 plugins/survey-resources/config/rig.json delete mode 100644 plugins/survey-resources/jest.config.js delete mode 100644 plugins/survey-resources/package.json delete mode 100644 plugins/survey-resources/postcss.config.js delete mode 100644 plugins/survey-resources/src/index.ts delete mode 100644 plugins/survey-resources/src/plugin.ts delete mode 100644 plugins/survey-resources/svelte.config.js delete mode 100644 plugins/survey-resources/tsconfig.json delete mode 100644 plugins/survey/.eslintrc.js delete mode 100644 plugins/survey/.npmignore delete mode 100644 plugins/survey/config/rig.json delete mode 100644 plugins/survey/jest.config.js delete mode 100644 plugins/survey/package.json delete mode 100644 plugins/survey/src/index.ts delete mode 100644 plugins/survey/tsconfig.json diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index ad8e42206e..0793385b4c 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -7,7 +7,7 @@ * [ ] - UI test added to added/changed functionality? * [ ] - Screenshot is added to PR if applicable ? * [ ] - Does a local formatting is applied (rush format) -* [ ] - Does a local svele-check is applied (rush svelte check) +* [ ] - Does a local svele-check is applied (rush svelte-check) * [ ] - Does a local UI tests are executed [UI Testing](../tests/readme.md) * [ ] - Does the code work? Check whether function and logic are correct. * [ ] - Does Changelog.md is updated with changes? diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 104b786024..bb4f253015 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -320,9 +320,6 @@ dependencies: '@rush-temp/model-support': specifier: file:./projects/model-support.tgz version: file:projects/model-support.tgz(svelte@4.2.5)(typescript@5.2.2) - '@rush-temp/model-survey': - specifier: file:./projects/model-survey.tgz - version: file:projects/model-survey.tgz(svelte@4.2.5)(typescript@5.2.2) '@rush-temp/model-tags': specifier: file:./projects/model-tags.tgz version: file:projects/model-tags.tgz(svelte@4.2.5)(typescript@5.2.2) @@ -575,15 +572,6 @@ dependencies: '@rush-temp/support-resources': specifier: file:./projects/support-resources.tgz version: file:projects/support-resources.tgz(@types/node@16.11.68)(esbuild@0.16.17)(postcss-load-config@4.0.1)(postcss@8.4.31)(ts-node@10.9.1) - '@rush-temp/survey': - specifier: file:./projects/survey.tgz - version: file:projects/survey.tgz(@types/node@16.11.68)(esbuild@0.16.17)(svelte@4.2.5)(ts-node@10.9.1)(typescript@5.2.2) - '@rush-temp/survey-assets': - specifier: file:./projects/survey-assets.tgz - version: file:projects/survey-assets.tgz(esbuild@0.16.17)(svelte@4.2.5)(ts-node@10.9.1)(typescript@5.2.2) - '@rush-temp/survey-resources': - specifier: file:./projects/survey-resources.tgz - version: file:projects/survey-resources.tgz(@types/node@16.11.68)(esbuild@0.16.17)(postcss-load-config@4.0.1)(postcss@8.4.31)(svelte@4.2.5)(ts-node@10.9.1)(typescript@5.2.2) '@rush-temp/tags': specifier: file:./projects/tags.tgz version: file:projects/tags.tgz(@types/node@16.11.68)(esbuild@0.16.17)(ts-node@10.9.1) @@ -815,6 +803,9 @@ dependencies: '@types/minio': specifier: ~7.0.11 version: 7.0.18 + '@types/morgan': + specifier: ~1.9.9 + version: 1.9.9 '@types/node': specifier: ~16.11.12 version: 16.11.68 @@ -18181,7 +18172,7 @@ packages: dev: false file:projects/collaborator.tgz(@tiptap/pm@2.1.12)(bufferutil@4.0.7)(prosemirror-model@1.19.3)(svelte@4.2.5): - resolution: {integrity: sha512-37tcslNB1OuZncrABis1O54JHogvoU8oT3FYo91epmBvzoriNrS6wYuV2Odc+UI4frX6bZGQJEIYxmNYLNMajQ==, tarball: file:projects/collaborator.tgz} + resolution: {integrity: sha512-2XPuNVr/ULt0jAfZ0yWSZqiQy+O/kRETpI25a2LfbVAp1MQF9+4wqRV31wwGKV/I7j6oVaF+kDOT7k7vMVYSkg==, tarball: file:projects/collaborator.tgz} id: file:projects/collaborator.tgz name: '@rush-temp/collaborator' version: 0.0.0 @@ -19496,7 +19487,7 @@ packages: dev: false file:projects/model-all.tgz(svelte@4.2.5)(typescript@5.2.2): - resolution: {integrity: sha512-bqRngFhfXoPedb0IMaXya9LnZ5agvGBsd49EUmpJuM/BWIDMW8Oj4iU2fnkTVYQEiBsprhXX1POk4chGR6dHvA==, tarball: file:projects/model-all.tgz} + resolution: {integrity: sha512-PEl4zAGjvSsQ5stSRUuj2PYcZ0BdWTkxyaJNP63dbX4U6QA5sf7BuXamJRgETTD74jA40pGRXUAMnprS6t9z4w==, tarball: file:projects/model-all.tgz} id: file:projects/model-all.tgz name: '@rush-temp/model-all' version: 0.0.0 @@ -20342,27 +20333,6 @@ packages: - typescript dev: false - file:projects/model-survey.tgz(svelte@4.2.5)(typescript@5.2.2): - resolution: {integrity: sha512-HqvLuhQJO8PpOeuDEPr7dcrxA2xZKXp7FLIwdckKONYx506mZVzErCiU3eXy3M4YyLXIQCTy272vnxJZnemJTw==, tarball: file:projects/model-survey.tgz} - id: file:projects/model-survey.tgz - name: '@rush-temp/model-survey' - version: 0.0.0 - dependencies: - '@typescript-eslint/eslint-plugin': 6.11.0(@typescript-eslint/parser@6.11.0)(eslint@8.54.0)(typescript@5.2.2) - '@typescript-eslint/parser': 6.11.0(eslint@8.54.0)(typescript@5.2.2) - eslint: 8.54.0 - eslint-config-standard-with-typescript: 40.0.0(@typescript-eslint/eslint-plugin@6.11.0)(eslint-plugin-import@2.28.1)(eslint-plugin-n@15.7.0)(eslint-plugin-promise@6.1.1)(eslint@8.54.0)(typescript@5.2.2) - eslint-plugin-import: 2.28.1(eslint@8.54.0) - eslint-plugin-n: 15.7.0(eslint@8.54.0) - eslint-plugin-promise: 6.1.1(eslint@8.54.0) - prettier: 3.1.0 - prettier-plugin-svelte: 3.1.0(prettier@3.1.0)(svelte@4.2.5) - transitivePeerDependencies: - - supports-color - - svelte - - typescript - dev: false - file:projects/model-tags.tgz(svelte@4.2.5)(typescript@5.2.2): resolution: {integrity: sha512-8IMdeZBRZMTuVzzAMB3RVNm/XumQTKt+2mzeMjD5wF2YadXreHf95rLtYAR2URnToZPO0BS74KGR6+toixYVUw==, tarball: file:projects/model-tags.tgz} id: file:projects/model-tags.tgz @@ -21026,7 +20996,7 @@ packages: dev: false file:projects/pod-server.tgz(svelte@4.2.5): - resolution: {integrity: sha512-P3qTbPOzsBBFCp/JsSNERRx6ITah+3bfpBDqPgP4dzydWPEcbW9AALPYjrYviv/GRZuFzgcBu32ZxrUMCZ6DwA==, tarball: file:projects/pod-server.tgz} + resolution: {integrity: sha512-7Griqc83Xh/jubUWlO8qA+Cx1+2pjzZgouGteeQZXfCokol6X813h3O5vkKO3fenjg6doFII5zI+DJx1R4jBnQ==, tarball: file:projects/pod-server.tgz} id: file:projects/pod-server.tgz name: '@rush-temp/pod-server' version: 0.0.0 @@ -21174,7 +21144,7 @@ packages: dev: false file:projects/prod.tgz(bufferutil@4.0.7)(esbuild@0.16.17)(sass@1.69.0)(ts-node@10.9.1)(typescript@5.2.2): - resolution: {integrity: sha512-RpgrKzlPUDZ5L+pT2NPQmXxUomiw84N6898NdEYNbbXERliDL6II+7Qw9LwoEBHtVDChgnU8ez+5WcuknHrjlw==, tarball: file:projects/prod.tgz} + resolution: {integrity: sha512-AMQUJ8O71HSvI9iGDSj/32iyRs75Qepku6ir0Xq6n2/IwVW4BE3n0Fzhh5tfFTsbPtjL2p4qcA0mmJ0zg28D+g==, tarball: file:projects/prod.tgz} id: file:projects/prod.tgz name: '@rush-temp/prod' version: 0.0.0 @@ -23217,115 +23187,6 @@ packages: - ts-node dev: false - file:projects/survey-assets.tgz(esbuild@0.16.17)(svelte@4.2.5)(ts-node@10.9.1)(typescript@5.2.2): - resolution: {integrity: sha512-KqJbIkEBJ7f4dqGEd1ztPbMCP6l6l+wdYOTr83WN37YOUj8ucMuTcDWcZv1aCMZl/T/C6EUIDf5TgYvl1CHjcw==, tarball: file:projects/survey-assets.tgz} - id: file:projects/survey-assets.tgz - name: '@rush-temp/survey-assets' - version: 0.0.0 - dependencies: - '@types/jest': 29.5.5 - '@types/node': 16.11.68 - '@typescript-eslint/eslint-plugin': 6.11.0(@typescript-eslint/parser@6.11.0)(eslint@8.54.0)(typescript@5.2.2) - '@typescript-eslint/parser': 6.11.0(eslint@8.54.0)(typescript@5.2.2) - eslint: 8.54.0 - eslint-config-standard-with-typescript: 40.0.0(@typescript-eslint/eslint-plugin@6.11.0)(eslint-plugin-import@2.28.1)(eslint-plugin-n@15.7.0)(eslint-plugin-promise@6.1.1)(eslint@8.54.0)(typescript@5.2.2) - eslint-plugin-import: 2.28.1(eslint@8.54.0) - eslint-plugin-n: 15.7.0(eslint@8.54.0) - eslint-plugin-promise: 6.1.1(eslint@8.54.0) - jest: 29.7.0(@types/node@16.11.68)(ts-node@10.9.1) - prettier: 3.1.0 - prettier-plugin-svelte: 3.1.0(prettier@3.1.0)(svelte@4.2.5) - ts-jest: 29.1.1(esbuild@0.16.17)(jest@29.7.0)(typescript@5.2.2) - transitivePeerDependencies: - - '@babel/core' - - '@jest/types' - - babel-jest - - babel-plugin-macros - - esbuild - - node-notifier - - supports-color - - svelte - - ts-node - - typescript - dev: false - - file:projects/survey-resources.tgz(@types/node@16.11.68)(esbuild@0.16.17)(postcss-load-config@4.0.1)(postcss@8.4.31)(svelte@4.2.5)(ts-node@10.9.1)(typescript@5.2.2): - resolution: {integrity: sha512-S4t+6+J3q1YibQwIzBOYpeWlSPTiFyvVhnhw07Eqnxy1z3ADHLlHpsxCXUI+zQQQzzo9zvGLRoK1hSYmtcPGfA==, tarball: file:projects/survey-resources.tgz} - id: file:projects/survey-resources.tgz - name: '@rush-temp/survey-resources' - version: 0.0.0 - dependencies: - '@types/jest': 29.5.5 - '@typescript-eslint/eslint-plugin': 6.11.0(@typescript-eslint/parser@6.11.0)(eslint@8.54.0)(typescript@5.2.2) - '@typescript-eslint/parser': 6.11.0(eslint@8.54.0)(typescript@5.2.2) - eslint: 8.54.0 - eslint-config-standard-with-typescript: 40.0.0(@typescript-eslint/eslint-plugin@6.11.0)(eslint-plugin-import@2.28.1)(eslint-plugin-n@15.7.0)(eslint-plugin-promise@6.1.1)(eslint@8.54.0)(typescript@5.2.2) - eslint-plugin-import: 2.28.1(eslint@8.54.0) - eslint-plugin-n: 15.7.0(eslint@8.54.0) - eslint-plugin-promise: 6.1.1(eslint@8.54.0) - eslint-plugin-svelte: 2.35.0(eslint@8.54.0)(svelte@4.2.5)(ts-node@10.9.1) - jest: 29.7.0(@types/node@16.11.68)(ts-node@10.9.1) - prettier: 3.1.0 - prettier-plugin-svelte: 3.1.0(prettier@3.1.0)(svelte@4.2.5) - sass: 1.69.0 - svelte-check: 3.6.0(postcss-load-config@4.0.1)(postcss@8.4.31)(sass@1.69.0)(svelte@4.2.5) - svelte-eslint-parser: 0.33.1(svelte@4.2.5) - svelte-loader: 3.1.9(svelte@4.2.5) - svelte-preprocess: 5.1.0(postcss-load-config@4.0.1)(postcss@8.4.31)(sass@1.69.0)(svelte@4.2.5)(typescript@5.2.2) - ts-jest: 29.1.1(esbuild@0.16.17)(jest@29.7.0)(typescript@5.2.2) - 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 - - svelte - - ts-node - - typescript - dev: false - - file:projects/survey.tgz(@types/node@16.11.68)(esbuild@0.16.17)(svelte@4.2.5)(ts-node@10.9.1)(typescript@5.2.2): - resolution: {integrity: sha512-VQ5Ne0MuO8zCvfvMqROddHTfinHEmiybMnz3XM/YfxOTxU1RRwZDGSoaixBU/tK98BURHp+NDnCiD5X3Q48DtQ==, tarball: file:projects/survey.tgz} - id: file:projects/survey.tgz - name: '@rush-temp/survey' - version: 0.0.0 - dependencies: - '@types/jest': 29.5.5 - '@typescript-eslint/eslint-plugin': 6.11.0(@typescript-eslint/parser@6.11.0)(eslint@8.54.0)(typescript@5.2.2) - '@typescript-eslint/parser': 6.11.0(eslint@8.54.0)(typescript@5.2.2) - eslint: 8.54.0 - eslint-config-standard-with-typescript: 40.0.0(@typescript-eslint/eslint-plugin@6.11.0)(eslint-plugin-import@2.28.1)(eslint-plugin-n@15.7.0)(eslint-plugin-promise@6.1.1)(eslint@8.54.0)(typescript@5.2.2) - eslint-plugin-import: 2.28.1(eslint@8.54.0) - eslint-plugin-n: 15.7.0(eslint@8.54.0) - eslint-plugin-promise: 6.1.1(eslint@8.54.0) - jest: 29.7.0(@types/node@16.11.68)(ts-node@10.9.1) - prettier: 3.1.0 - prettier-plugin-svelte: 3.1.0(prettier@3.1.0)(svelte@4.2.5) - ts-jest: 29.1.1(esbuild@0.16.17)(jest@29.7.0)(typescript@5.2.2) - transitivePeerDependencies: - - '@babel/core' - - '@jest/types' - - '@types/node' - - babel-jest - - babel-plugin-macros - - esbuild - - node-notifier - - supports-color - - svelte - - ts-node - - typescript - dev: false - file:projects/tags-assets.tgz(esbuild@0.16.17)(svelte@4.2.5)(ts-node@10.9.1): resolution: {integrity: sha512-NCYX/a34eY06sVmEOY/3q/G+CSERAcTCcz/HekWWuNw9AUCN5swZI++T+OXSsl+82vaEd08Qg6pz8G2Onh6msw==, tarball: file:projects/tags-assets.tgz} id: file:projects/tags-assets.tgz @@ -23795,7 +23656,7 @@ packages: dev: false file:projects/text-editor.tgz(@types/node@16.11.68)(bufferutil@4.0.7)(esbuild@0.16.17)(postcss-load-config@4.0.1)(postcss@8.4.31)(prosemirror-model@1.19.3)(ts-node@10.9.1): - resolution: {integrity: sha512-42rs06vaqb/uM49NzAf4ggZxatYbBqfT2Qy0rZLsK72tSUAxZC86E97pxUjYaLKguUoAGkou/bQf2iOFySZQwA==, tarball: file:projects/text-editor.tgz} + resolution: {integrity: sha512-s3a0AnlJS8WBnLjA5ggHaLcbSh9tT9DA6Szy9wYWGJzt9R82/nfhh4qMOLWbvHbTgOu/ieWGrhG2FpWAzHSwzw==, tarball: file:projects/text-editor.tgz} id: file:projects/text-editor.tgz name: '@rush-temp/text-editor' version: 0.0.0 diff --git a/dev/prod/package.json b/dev/prod/package.json index c770259024..aa70d6ece0 100644 --- a/dev/prod/package.json +++ b/dev/prod/package.json @@ -161,9 +161,6 @@ "@hcengineering/support": "^0.6.1", "@hcengineering/support-assets": "^0.6.1", "@hcengineering/support-resources": "^0.6.0", - "@hcengineering/survey": "^0.6.0", - "@hcengineering/survey-assets": "^0.6.0", - "@hcengineering/survey-resources": "^0.6.0", "@hcengineering/request": "^0.6.6", "@hcengineering/request-assets": "^0.6.0", "@hcengineering/request-resources": "^0.6.0", diff --git a/dev/prod/src/platform.ts b/dev/prod/src/platform.ts index 73b2b65d13..5ed4472ed3 100644 --- a/dev/prod/src/platform.ts +++ b/dev/prod/src/platform.ts @@ -34,7 +34,6 @@ import rekoni from '@hcengineering/rekoni' import { requestId } from '@hcengineering/request' import { settingId } from '@hcengineering/setting' import { supportId } from '@hcengineering/support' -import { surveyId } from '@hcengineering/survey' import { tagsId } from '@hcengineering/tags' import { taskId } from '@hcengineering/task' import telegram, { telegramId } from '@hcengineering/telegram' @@ -64,7 +63,6 @@ import '@hcengineering/recruit-assets' import '@hcengineering/request-assets' import '@hcengineering/setting-assets' import '@hcengineering/support-assets' -import '@hcengineering/survey-assets' import '@hcengineering/tags-assets' import '@hcengineering/task-assets' import '@hcengineering/telegram-assets' @@ -123,7 +121,6 @@ function configureI18n(): void { addStringsLoader(requestId, async (lang: string) => await import(`@hcengineering/request-assets/lang/${lang}.json`)) addStringsLoader(settingId, async (lang: string) => await import(`@hcengineering/setting-assets/lang/${lang}.json`)) addStringsLoader(supportId, async (lang: string) => await import(`@hcengineering/support-assets/lang/${lang}.json`)) - addStringsLoader(surveyId, async (lang: string) => await import(`@hcengineering/survey-assets/lang/${lang}.json`)) addStringsLoader(tagsId, async (lang: string) => await import(`@hcengineering/tags-assets/lang/${lang}.json`)) addStringsLoader(taskId, async (lang: string) => await import(`@hcengineering/task-assets/lang/${lang}.json`)) addStringsLoader(telegramId, async (lang: string) => await import(`@hcengineering/telegram-assets/lang/${lang}.json`)) @@ -200,7 +197,6 @@ export async function configurePlatform() { addLocation(bitrixId, () => import(/* webpackChunkName: "bitrix" */ '@hcengineering/bitrix-resources')) addLocation(requestId, () => import(/* webpackChunkName: "request" */ '@hcengineering/request-resources')) addLocation(supportId, () => import(/* webpackChunkName: "support" */ '@hcengineering/support-resources')) - addLocation(surveyId, () => import(/* webpackChunkName: "support" */ '@hcengineering/survey-resources')) setMetadata(client.metadata.FilterModel, true) setMetadata(client.metadata.ExtraPlugins, ['preference' as Plugin]) diff --git a/dev/tool/src/index.ts b/dev/tool/src/index.ts index 0628e1d04d..4c338d2142 100644 --- a/dev/tool/src/index.ts +++ b/dev/tool/src/index.ts @@ -120,7 +120,7 @@ export function devTool ( program.version('0.0.1') - // create-user john.appleseed@gmail.com --password 123 --workspace workspace --fullname "John Appleseed" + // create-account john.appleseed@gmail.com --password 123 --workspace workspace --fullname "John Appleseed" program .command('create-account ') .description('create user and corresponding account in master database') @@ -476,7 +476,7 @@ export function devTool ( program .command('clean-workspace ') - .description('set user role') + .description('clean workspace') .option('--recruit', 'Clean recruit', false) .option('--tracker', 'Clean tracker', false) .option('--removedTx', 'Clean removed transactions', false) @@ -501,7 +501,7 @@ export function devTool ( program .command('clean-removed-transactions ') - .description('set user role') + .description('clean removed transactions') .action(async (workspace: string, cmd: any) => { await cleanRemovedTransactions(getWorkspaceId(workspace, productId), transactorUrl) }) diff --git a/models/activity/src/index.ts b/models/activity/src/index.ts index 45e0ff456c..42667f85b0 100644 --- a/models/activity/src/index.ts +++ b/models/activity/src/index.ts @@ -103,7 +103,7 @@ export class TActivityMessage extends TAttachedDoc implements ActivityMessage { reactions?: number } -@Model(activity.class.DocUpdateMessage, activity.class.ActivityMessage, DOMAIN_ACTIVITY) +@Model(activity.class.DocUpdateMessage, activity.class.ActivityMessage) export class TDocUpdateMessage extends TActivityMessage implements DocUpdateMessage { @Prop(TypeRef(core.class.Doc), core.string.Object) @Index(IndexKind.Indexed) @@ -122,7 +122,7 @@ export class TDocUpdateMessage extends TActivityMessage implements DocUpdateMess attributeUpdates?: DocAttributeUpdates } -@Model(activity.class.ActivityInfoMessage, activity.class.ActivityMessage, DOMAIN_ACTIVITY) +@Model(activity.class.ActivityInfoMessage, activity.class.ActivityMessage) export class TActivityInfoMessage extends TActivityMessage implements ActivityInfoMessage { @Prop(TypeIntlString(), activity.string.Update) message!: IntlString diff --git a/models/all/package.json b/models/all/package.json index 1fa1477601..8b724fab5c 100644 --- a/models/all/package.json +++ b/models/all/package.json @@ -80,7 +80,6 @@ "@hcengineering/model-server-activity": "^0.6.0", "@hcengineering/model-server-openai": "^0.6.0", "@hcengineering/model-server-translate": "^0.6.0", - "@hcengineering/model-support": "^0.6.0", - "@hcengineering/model-survey": "^0.6.0" + "@hcengineering/model-support": "^0.6.0" } } diff --git a/models/all/src/index.ts b/models/all/src/index.ts index 991a03fc25..23e5dd4845 100644 --- a/models/all/src/index.ts +++ b/models/all/src/index.ts @@ -60,7 +60,6 @@ import { taskId, createModel as taskModel } from '@hcengineering/model-task' import telegram, { telegramId, createModel as telegramModel } from '@hcengineering/model-telegram' import { templatesId, createModel as templatesModel } from '@hcengineering/model-templates' import { textEditorId, createModel as textEditorModel } from '@hcengineering/model-text-editor' -import survey, { surveyId, createModel as surveyModel } from '@hcengineering/model-survey' import tracker, { trackerId, createModel as trackerModel } from '@hcengineering/model-tracker' import view, { viewId, createModel as viewModel } from '@hcengineering/model-view' import workbench, { workbenchId, createModel as workbenchModel } from '@hcengineering/model-workbench' @@ -254,25 +253,14 @@ export default function buildModel (enabled: string[] = ['*'], disabled: string[ requestModel, requestId, { - label: survey.string.ConfigLabel, - description: survey.string.ConfigDescription, + // request: request.string.ConfigLabel, + // request: request.string.ConfigDescription, enabled: false, beta: true, - icon: survey.icon.SurveyApplication, classFilter: defaultFilter } ], [supportModel, supportId], - [ - surveyModel, - surveyId, - { - // TODO: icon, label, description? - enabled: true, - beta: true, - classFilter: defaultFilter - } - ], [serverCoreModel, serverCoreId], [serverAttachmentModel, serverAttachmentId], diff --git a/models/bitrix/src/plugin.ts b/models/bitrix/src/plugin.ts index 27eb2d9d04..55fb53c6ee 100644 --- a/models/bitrix/src/plugin.ts +++ b/models/bitrix/src/plugin.ts @@ -19,7 +19,7 @@ import bitrix from '@hcengineering/bitrix-resources/src/plugin' import { type IntlString, mergeIds } from '@hcengineering/platform' import { type Action } from '@hcengineering/view' -import { type Ref } from '@hcengineering/core' +import { type Doc, type Ref } from '@hcengineering/core' import type { AnyComponent } from '@hcengineering/ui/src/types' export default mergeIds(bitrixId, bitrix, { @@ -34,6 +34,6 @@ export default mergeIds(bitrixId, bitrix, { ConfigDescription: '' as IntlString }, action: { - BitrixImport: '' as Ref + BitrixImport: '' as Ref> } }) diff --git a/models/chunter/src/plugin.ts b/models/chunter/src/plugin.ts index d581285a74..99418b9442 100644 --- a/models/chunter/src/plugin.ts +++ b/models/chunter/src/plugin.ts @@ -41,9 +41,9 @@ export default mergeIds(chunterId, chunter, { ArchiveChannel: '' as Ref, UnarchiveChannel: '' as Ref, ConvertToPrivate: '' as Ref, - CopyCommentLink: '' as Ref, - CopyThreadMessageLink: '' as Ref, - CopyMessageLink: '' as Ref + CopyCommentLink: '' as Ref>, + CopyThreadMessageLink: '' as Ref>, + CopyMessageLink: '' as Ref> }, actionImpl: { MarkUnread: '' as ViewAction, diff --git a/models/contact/src/plugin.ts b/models/contact/src/plugin.ts index ebf5cafc66..4a6f10e7bc 100644 --- a/models/contact/src/plugin.ts +++ b/models/contact/src/plugin.ts @@ -121,7 +121,7 @@ export default mergeIds(contactId, contact, { action: { KickEmployee: '' as Ref, DeleteEmployee: '' as Ref, - MergePersons: '' as Ref + MergePersons: '' as Ref> }, actionImpl: { KickEmployee: '' as ViewAction, diff --git a/models/gmail/src/plugin.ts b/models/gmail/src/plugin.ts index cc31f25a2d..6add4452c8 100644 --- a/models/gmail/src/plugin.ts +++ b/models/gmail/src/plugin.ts @@ -25,7 +25,7 @@ import { type NotificationGroup } from '@hcengineering/notification' export default mergeIds(gmailId, gmail, { action: { - WriteEmail: '' as Ref + WriteEmail: '' as Ref> }, string: { MessageID: '' as IntlString, diff --git a/models/hr/src/plugin.ts b/models/hr/src/plugin.ts index 0710d904b8..c1c8987b37 100644 --- a/models/hr/src/plugin.ts +++ b/models/hr/src/plugin.ts @@ -13,7 +13,7 @@ // limitations under the License. // -import { type Ref } from '@hcengineering/core' +import { type Doc, type Ref } from '@hcengineering/core' import { hrId } from '@hcengineering/hr' import hr from '@hcengineering/hr-resources/src/plugin' import { type NotificationGroup } from '@hcengineering/notification' @@ -55,7 +55,7 @@ export default mergeIds(hrId, hr, { HR: '' as Ref }, action: { - CreateDepartment: '' as Ref, + CreateDepartment: '' as Ref>, EditDepartment: '' as Ref, ArchiveDepartment: '' as Ref, EditRequest: '' as Ref, diff --git a/models/lead/src/plugin.ts b/models/lead/src/plugin.ts index aef8a17b7b..cc03d12dfc 100644 --- a/models/lead/src/plugin.ts +++ b/models/lead/src/plugin.ts @@ -15,7 +15,7 @@ // import { type ChatMessageViewlet } from '@hcengineering/chunter' -import type { Ref } from '@hcengineering/core' +import type { Doc, Ref } from '@hcengineering/core' import { type Funnel, leadId } from '@hcengineering/lead' import lead from '@hcengineering/lead-resources/src/plugin' import { type NotificationGroup, type NotificationType } from '@hcengineering/notification' @@ -63,7 +63,7 @@ export default mergeIds(leadId, lead, { }, action: { EditStatuses: '' as Ref, - CreateGlobalLead: '' as Ref + CreateGlobalLead: '' as Ref> }, ids: { LeadNotificationGroup: '' as Ref, diff --git a/models/recruit/src/plugin.ts b/models/recruit/src/plugin.ts index 6cc38b51b9..a3165ac675 100644 --- a/models/recruit/src/plugin.ts +++ b/models/recruit/src/plugin.ts @@ -28,12 +28,12 @@ import { type ChatMessageViewlet } from '@hcengineering/chunter' export default mergeIds(recruitId, recruit, { action: { CreateOpinion: '' as Ref, - CreateGlobalApplication: '' as Ref, - CopyApplicationId: '' as Ref, - CopyApplicationLink: '' as Ref, - CopyCandidateLink: '' as Ref, + CreateGlobalApplication: '' as Ref>, + CopyApplicationId: '' as Ref>, + CopyApplicationLink: '' as Ref>, + CopyCandidateLink: '' as Ref>, MoveApplicant: '' as Ref, - GetTalentIds: '' as Ref, + GetTalentIds: '' as Ref>, EditStatuses: '' as Ref }, actionImpl: { diff --git a/models/survey/.eslintrc.js b/models/survey/.eslintrc.js deleted file mode 100644 index c1cf82cba0..0000000000 --- a/models/survey/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['./node_modules/@hcengineering/platform-rig/profiles/model/eslint.config.json'], - parserOptions: { - tsconfigRootDir: __dirname, - project: './tsconfig.json' - } -} diff --git a/models/survey/.npmignore b/models/survey/.npmignore deleted file mode 100644 index e3ec093c38..0000000000 --- a/models/survey/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -* -!/lib/** -!CHANGELOG.md -/lib/**/__tests__/ diff --git a/models/survey/config/rig.json b/models/survey/config/rig.json deleted file mode 100644 index 0691a71573..0000000000 --- a/models/survey/config/rig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json", - "rigPackageName": "@hcengineering/platform-rig", - "rigProfile": "model" -} diff --git a/models/survey/package.json b/models/survey/package.json deleted file mode 100644 index 211a4d7483..0000000000 --- a/models/survey/package.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "@hcengineering/model-survey", - "version": "0.6.0", - "main": "lib/index.js", - "author": "Anticrm Platform Contributors", - "license": "EPL-2.0", - "scripts": { - "build": "tsc", - "build:watch": "tsc", - "lint:fix": "eslint --fix src", - "lint": "eslint src", - "format": "format src" - }, - "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", - "prettier-plugin-svelte": "^3.1.0" - }, - "dependencies": { - "@hcengineering/core": "^0.6.28", - "@hcengineering/model": "^0.6.7", - "@hcengineering/model-core": "^0.6.0", - "@hcengineering/model-workbench": "^0.6.1", - "@hcengineering/platform": "^0.6.9", - "@hcengineering/survey": "^0.6.0", - "@hcengineering/survey-resources": "^0.6.0", - "@hcengineering/ui": "^0.6.11", - "@hcengineering/view": "^0.6.9", - "@hcengineering/workbench": "^0.6.9" - } -} diff --git a/models/survey/src/index.ts b/models/survey/src/index.ts deleted file mode 100644 index 001df1a6d4..0000000000 --- a/models/survey/src/index.ts +++ /dev/null @@ -1,38 +0,0 @@ -// -// 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 Builder } from '@hcengineering/model' - -import core from '@hcengineering/model-core' -import workbench from '@hcengineering/model-workbench' -import { surveyId } from '@hcengineering/survey' -import survey from './plugin' - -export { surveyId } from '@hcengineering/survey' -export { default } from './plugin' - -export function createModel (builder: Builder): void { - builder.createDoc( - workbench.class.Application, - core.space.Model, - { - label: survey.string.SurveyApplication, - icon: survey.icon.SurveyApplication, - alias: surveyId, - hidden: false - }, - survey.app.Survey - ) -} diff --git a/models/survey/src/plugin.ts b/models/survey/src/plugin.ts deleted file mode 100644 index 1e96a40492..0000000000 --- a/models/survey/src/plugin.ts +++ /dev/null @@ -1,26 +0,0 @@ -// -// 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 { mergeIds } from '@hcengineering/platform' -import { surveyId } from '@hcengineering/survey' -import survey from '@hcengineering/survey-resources/src/plugin' -import { type Ref } from '@hcengineering/core' -import { type Application } from '@hcengineering/workbench' - -export default mergeIds(surveyId, survey, { - app: { - Survey: '' as Ref - } -}) diff --git a/models/survey/src/types.ts b/models/survey/src/types.ts deleted file mode 100644 index 82f0b3c3e5..0000000000 --- a/models/survey/src/types.ts +++ /dev/null @@ -1,18 +0,0 @@ -// -// 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 Domain } from '@hcengineering/core' - -export const DOMAIN_SURVEY = 'survey' as Domain diff --git a/models/survey/tsconfig.json b/models/survey/tsconfig.json deleted file mode 100644 index 39a914bbda..0000000000 --- a/models/survey/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "./node_modules/@hcengineering/platform-rig/profiles/model/tsconfig.json", - - "compilerOptions": { - "rootDir": "./src", - "outDir": "./lib", - "tsBuildInfoFile": ".build/build.tsbuildinfo" - } -} diff --git a/models/templates/src/plugin.ts b/models/templates/src/plugin.ts index b9e0035635..bebbdf875d 100644 --- a/models/templates/src/plugin.ts +++ b/models/templates/src/plugin.ts @@ -14,7 +14,7 @@ // limitations under the License. // -import { type Ref } from '@hcengineering/core' +import { type Doc, type Ref } from '@hcengineering/core' import { type IntlString, mergeIds, type Resource } from '@hcengineering/platform' import { type SettingsCategory } from '@hcengineering/setting' import { templatesId } from '@hcengineering/templates' @@ -35,9 +35,9 @@ export default mergeIds(templatesId, templates, { EditGroup: '' as AnyComponent }, action: { - Copy: '' as Ref, - Move: '' as Ref, - EditGroup: '' as Ref, + Copy: '' as Ref>, + Move: '' as Ref>, + EditGroup: '' as Ref>, ShowTemplates: '' as Resource }, category: { diff --git a/models/tracker/src/plugin.ts b/models/tracker/src/plugin.ts index f379eada1f..8a868ed8c7 100644 --- a/models/tracker/src/plugin.ts +++ b/models/tracker/src/plugin.ts @@ -104,7 +104,7 @@ export default mergeIds(trackerId, tracker, { DeleteMilestone: '' as ViewAction }, action: { - NewRelatedIssue: '' as Ref>>, + NewRelatedIssue: '' as Ref>, DeleteMilestone: '' as Ref>>, DeleteProject: '' as Ref>>, DeleteProjectClean: '' as Ref>>, diff --git a/models/view/src/index.ts b/models/view/src/index.ts index 0c0f4f2208..ad3841709a 100644 --- a/models/view/src/index.ts +++ b/models/view/src/index.ts @@ -99,10 +99,10 @@ export const DOMAIN_VIEW = 'view' as Domain export function createAction> ( builder: Builder, data: Data>, - id?: Ref + id?: Ref> ): void { - const { label, ...adata } = data as Data - builder.createDoc(view.class.Action, core.space.Model, { label, ...adata }, id) + const { label, ...adata } = data + builder.createDoc>(view.class.Action, core.space.Model, { label, ...adata }, id) } export function classPresenter ( diff --git a/packages/core/lang/ru.json b/packages/core/lang/ru.json index f3a44e448a..2f1ed81976 100644 --- a/packages/core/lang/ru.json +++ b/packages/core/lang/ru.json @@ -18,7 +18,7 @@ "Markup": "Разметка", "Number": "Число", "Boolean": "Логическое", - "Timestamp": "Времянная отметка", + "Timestamp": "Временная отметка", "Date": "Дата", "IntlString": "Интернационализированная строка", "Ref": "Ссылка", diff --git a/packages/core/src/classes.ts b/packages/core/src/classes.ts index 5c9579d0fd..80ca0612ed 100644 --- a/packages/core/src/classes.ts +++ b/packages/core/src/classes.ts @@ -56,9 +56,9 @@ export interface Obj { /** * @public */ -export interface Doc extends Obj { +export interface Doc extends Obj { _id: Ref - space: Ref + space: Ref modifiedOn: Timestamp modifiedBy: Ref createdBy?: Ref // Marked as optional since it will be filled by platform. @@ -83,10 +83,14 @@ export interface UXObject extends Obj { /** * @public */ -export interface AttachedDoc extends Doc { - attachedTo: Ref - attachedToClass: Ref> - collection: string +export interface AttachedDoc< + Parent extends Doc = Doc, + Collection extends Extract | string = Extract | string, + S extends Space = Space +> extends Doc { + attachedTo: Ref + attachedToClass: Ref> + collection: Collection } /** diff --git a/packages/core/src/hierarchy.ts b/packages/core/src/hierarchy.ts index 3597a4bd13..1768f7b6ed 100644 --- a/packages/core/src/hierarchy.ts +++ b/packages/core/src/hierarchy.ts @@ -143,7 +143,7 @@ export class Hierarchy { return result } - getClass (_class: Ref>): Class { + getClass(_class: Ref>): Class { const data = this.classifiers.get(_class) if (data === undefined || this.isInterface(data)) { throw new Error('class not found: ' + _class) @@ -151,7 +151,7 @@ export class Hierarchy { return data } - hasClass (_class: Ref>): boolean { + hasClass(_class: Ref>): boolean { const data = this.classifiers.get(_class) return !(data === undefined || this.isInterface(data)) @@ -272,7 +272,7 @@ export class Hierarchy { /** * Check if passed _class is derived from `from` class. - * It will iterave over parents. + * It will iterate over parents. */ isDerived(_class: Ref>, from: Ref>): boolean { let cl: Ref> | undefined = _class @@ -289,7 +289,7 @@ export class Hierarchy { getBaseClass(_class: Ref>): Ref> { let cl: Ref> | undefined = _class while (cl !== undefined) { - const clz = this.getClass(cl) + const clz: Class = this.getClass(cl) if (this.isClass(clz)) return cl cl = clz.extends } @@ -298,12 +298,12 @@ export class Hierarchy { /** * Check if passed _class implements passed interfaces `from`. - * It will check for class parents and they interfaces. + * It will check for class parents and their interfaces. */ isImplements(_class: Ref>, from: Ref>): boolean { let cl: Ref> | undefined = _class while (cl !== undefined) { - const klazz = this.getClass(cl) + const klazz: Class = this.getClass(cl) if (this.isExtends(klazz.implements ?? [], from)) { return true } @@ -313,7 +313,7 @@ export class Hierarchy { } /** - * Check if interface is extends passed interface. + * Check if interface extends passed interface. */ private isExtends(extendsOrImplements: Ref>[], from: Ref>): boolean { const result: Ref>[] = [] diff --git a/packages/core/src/operations.ts b/packages/core/src/operations.ts index e6fada5834..1e0efe7420 100644 --- a/packages/core/src/operations.ts +++ b/packages/core/src/operations.ts @@ -103,7 +103,7 @@ export class TxOperations implements Omit { space: Ref, attachedTo: Ref, attachedToClass: Ref>, - collection: string, + collection: Extract | string, attributes: AttachedData

, id?: Ref

, modifiedOn?: Timestamp, @@ -128,7 +128,7 @@ export class TxOperations implements Omit { objectId: Ref

, attachedTo: Ref, attachedToClass: Ref>, - collection: string, + collection: Extract | string, operations: DocumentUpdate

, retrieve?: boolean, modifiedOn?: Timestamp, @@ -153,7 +153,7 @@ export class TxOperations implements Omit { objectId: Ref

, attachedTo: Ref, attachedToClass: Ref>, - collection: string, + collection: Extract | string, modifiedOn?: Timestamp, modifiedBy?: Ref ): Promise> { diff --git a/packages/core/src/utils.ts b/packages/core/src/utils.ts index 93b5f89b73..575c94c909 100644 --- a/packages/core/src/utils.ts +++ b/packages/core/src/utils.ts @@ -235,7 +235,8 @@ export function fillDefaults ( for (const attribute of attributes) { if (attribute[1].defaultValue !== undefined) { if ((object as any)[attribute[0]] === undefined) { - ;(object as any)[attribute[0]] = attribute[1].defaultValue + // Clone default value as it might be an object (e.g. array) + ;(object as any)[attribute[0]] = structuredClone(attribute[1].defaultValue) } } } diff --git a/packages/model/src/dsl.ts b/packages/model/src/dsl.ts index 1c101f68cf..2d4819c45b 100644 --- a/packages/model/src/dsl.ts +++ b/packages/model/src/dsl.ts @@ -301,6 +301,22 @@ export class Builder { byId.set(tx._id, tx) }) + Array.from(byId.entries()).forEach(([id, txes]) => { + if (txes.kind === ClassifierKind.CLASS && txes.domain !== undefined && txes.extends !== undefined) { + let parentTxes: ClassTxes | undefined = txes + let parentDomain: Domain | undefined + do { + parentTxes = parentTxes.extends === undefined ? undefined : byId.get(parentTxes.extends) + parentDomain = parentTxes === undefined ? undefined : parentTxes.domain + } while (parentTxes !== undefined && parentDomain === undefined) + if (parentDomain !== undefined) { + throw new Error( + `Class '${id}' should not specify its own domain '${txes.domain}', as it already extends class '${parentTxes?._id}' in domain '${parentDomain}'` + ) + } + } + }) + const generated = this.generateTransactions(txes, byId) for (const tx of generated) { diff --git a/packages/platform-rig/profiles/ui/eslint.config.json b/packages/platform-rig/profiles/ui/eslint.config.json index 9397f5f415..1544c9ce87 100644 --- a/packages/platform-rig/profiles/ui/eslint.config.json +++ b/packages/platform-rig/profiles/ui/eslint.config.json @@ -35,6 +35,11 @@ "parser": "@typescript-eslint/parser" }, "rules": { + "@typescript-eslint/no-unused-vars": ["warn", { + // Registered Svelte names for better component typings, + // see https://raqueebuddinaziz.com/blog/svelte-type-events-slots-and-props/#restprops-props + "varsIgnorePattern": "^\\$\\$(Props|Events|Slots)$" + }], "@typescript-eslint/array-type": "off", "@typescript-eslint/promise-function-async": "off", "@typescript-eslint/consistent-type-imports": "off", diff --git a/packages/text-editor/src/components/StyledTextBox.svelte b/packages/text-editor/src/components/StyledTextBox.svelte index 7e6db7032c..d75c4d9fc4 100644 --- a/packages/text-editor/src/components/StyledTextBox.svelte +++ b/packages/text-editor/src/components/StyledTextBox.svelte @@ -48,6 +48,7 @@ export let attachFile: FileAttachFunction | undefined = undefined + // TODO: Expose const Mode = { View: 1, Edit: 2 diff --git a/packages/text-editor/src/components/TextEditor.svelte b/packages/text-editor/src/components/TextEditor.svelte index 5b356f297c..b9fbba7fdb 100644 --- a/packages/text-editor/src/components/TextEditor.svelte +++ b/packages/text-editor/src/components/TextEditor.svelte @@ -130,12 +130,20 @@ ...extensions, InlineStyleToolbarExtension.configure({ tippyOptions, + // TODO: Toolbar element is updated on every component update, + // but extensions is created only on mount. This causes issues when + // you're trying to use TextEditor in long-living components that + // get updated, e.g. in QuestionCollectionItemEditor in Surveys element: textToolbarElement, isSupported: () => true, isSelectionOnly: () => false }), InlinePopupExtension.configure({ pluginKey: 'show-image-actions-popup', + // TODO: Toolbar element is updated on every component update, + // but extensions is created only on mount. This causes issues when + // you're trying to use TextEditor in long-living components that + // get updated, e.g. in QuestionCollectionItemEditor in Surveys element: imageToolbarElement, tippyOptions: { ...tippyOptions, diff --git a/packages/ui/src/components/RadioButton.svelte b/packages/ui/src/components/RadioButton.svelte index 5fbe1fe429..8e7d56fa25 100644 --- a/packages/ui/src/components/RadioButton.svelte +++ b/packages/ui/src/components/RadioButton.svelte @@ -58,7 +58,7 @@ {#if labelIntl} diff --git a/plugins/board/src/index.ts b/plugins/board/src/index.ts index 4829f3fe78..16fbd34512 100644 --- a/plugins/board/src/index.ts +++ b/plugins/board/src/index.ts @@ -104,13 +104,13 @@ const boards = plugin(boardId, { }, action: { Open: '' as Ref, - Cover: '' as Ref, - Dates: '' as Ref, - Labels: '' as Ref, - Move: '' as Ref, - Copy: '' as Ref, - Archive: '' as Ref, - SendToBoard: '' as Ref, + Cover: '' as Ref>, + Dates: '' as Ref>, + Labels: '' as Ref>, + Move: '' as Ref>, + Copy: '' as Ref>, + Archive: '' as Ref>, + SendToBoard: '' as Ref>, Delete: '' as Ref }, string: { diff --git a/plugins/survey-assets/.eslintrc.js b/plugins/survey-assets/.eslintrc.js deleted file mode 100644 index e73094bc7e..0000000000 --- a/plugins/survey-assets/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['./node_modules/@hcengineering/platform-rig/profiles/assets/eslint.config.json'], - parserOptions: { - tsconfigRootDir: __dirname, - project: './tsconfig.json' - } -} diff --git a/plugins/survey-assets/.npmignore b/plugins/survey-assets/.npmignore deleted file mode 100644 index e3ec093c38..0000000000 --- a/plugins/survey-assets/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -* -!/lib/** -!CHANGELOG.md -/lib/**/__tests__/ diff --git a/plugins/survey-assets/assets/icons.svg b/plugins/survey-assets/assets/icons.svg deleted file mode 100644 index 4707b1d544..0000000000 --- a/plugins/survey-assets/assets/icons.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/plugins/survey-assets/config/rig.json b/plugins/survey-assets/config/rig.json deleted file mode 100644 index b95df50bbe..0000000000 --- a/plugins/survey-assets/config/rig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json", - "rigPackageName": "@hcengineering/platform-rig", - "rigProfile": "assets" -} diff --git a/plugins/survey-assets/jest.config.js b/plugins/survey-assets/jest.config.js deleted file mode 100644 index 6479224b48..0000000000 --- a/plugins/survey-assets/jest.config.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - preset: 'ts-jest', - testEnvironment: 'node', - testMatch: ['**/?(*.)+(spec|test).[jt]s?(x)'], - roots: ['./src'], - coverageReporters: ['text-summary', 'html'] -} diff --git a/plugins/survey-assets/lang/en.json b/plugins/survey-assets/lang/en.json deleted file mode 100644 index 5a13805715..0000000000 --- a/plugins/survey-assets/lang/en.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "string": { - "ConfigDescription": "Extension to manage surveys", - "ConfigLabel": "Surveys", - "SurveyApplication": "Surveys" - } -} diff --git a/plugins/survey-assets/lang/ru.json b/plugins/survey-assets/lang/ru.json deleted file mode 100644 index 3410d6400e..0000000000 --- a/plugins/survey-assets/lang/ru.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "string": { - "ConfigDescription": "Расширение для управления анкетами", - "ConfigLabel": "Анкеты", - "SurveyApplication": "Анкеты" - } -} diff --git a/plugins/survey-assets/package.json b/plugins/survey-assets/package.json deleted file mode 100644 index 6ab831ef0b..0000000000 --- a/plugins/survey-assets/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "@hcengineering/survey-assets", - "version": "0.6.0", - "main": "lib/index.js", - "author": "Anticrm Platform Contributors", - "license": "EPL-2.0", - "scripts": { - "build": "tsc", - "build:watch": "tsc", - "build:docs": "", - "test": "jest --passWithNoTests --silent", - "lint": "eslint src", - "lint:fix": "eslint --fix src", - "format": "format src" - }, - "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", - "prettier-plugin-svelte": "^3.1.0", - "@types/node": "~16.11.12", - "jest": "^29.7.0", - "ts-jest": "^29.1.1", - "@types/jest": "^29.5.5" - }, - "dependencies": { - "@hcengineering/platform": "^0.6.9", - "@hcengineering/survey": "^0.6.0" - } -} diff --git a/plugins/survey-assets/src/__tests__/lang.test.ts b/plugins/survey-assets/src/__tests__/lang.test.ts deleted file mode 100644 index cf96c6dcf7..0000000000 --- a/plugins/survey-assets/src/__tests__/lang.test.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { makeLocalesTest } from '@hcengineering/platform' - -it( - 'Locales are equale', - makeLocalesTest((lang) => import(`../../lang/${lang}.json`)) -) diff --git a/plugins/survey-assets/src/index.ts b/plugins/survey-assets/src/index.ts deleted file mode 100644 index f63e3c61a6..0000000000 --- a/plugins/survey-assets/src/index.ts +++ /dev/null @@ -1,22 +0,0 @@ -// -// 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 { loadMetadata } from '@hcengineering/platform' -import survey from '@hcengineering/survey' - -const icons = require('../assets/icons.svg') as string // eslint-disable-line -loadMetadata(survey.icon, { - SurveyApplication: `${icons}#survey` -}) diff --git a/plugins/survey-assets/tsconfig.json b/plugins/survey-assets/tsconfig.json deleted file mode 100644 index 224f71dcb2..0000000000 --- a/plugins/survey-assets/tsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "./node_modules/@hcengineering/platform-rig/profiles/default/tsconfig.json", - - "compilerOptions": { - "rootDir": "./src", - "outDir": "./lib", - "types": ["node", "jest"], - "tsBuildInfoFile": ".build/build.tsbuildinfo" - } -} diff --git a/plugins/survey-resources/.eslintrc.js b/plugins/survey-resources/.eslintrc.js deleted file mode 100644 index bb8fd7450d..0000000000 --- a/plugins/survey-resources/.eslintrc.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - extends: ['./node_modules/@hcengineering/platform-rig/profiles/ui/eslint.config.json'], - parserOptions: { tsconfigRootDir: __dirname } -} diff --git a/plugins/survey-resources/.npmignore b/plugins/survey-resources/.npmignore deleted file mode 100644 index e3ec093c38..0000000000 --- a/plugins/survey-resources/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -* -!/lib/** -!CHANGELOG.md -/lib/**/__tests__/ diff --git a/plugins/survey-resources/config/rig.json b/plugins/survey-resources/config/rig.json deleted file mode 100644 index 1a4b944f83..0000000000 --- a/plugins/survey-resources/config/rig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json", - "rigPackageName": "@hcengineering/platform-rig", - "rigProfile": "ui" -} diff --git a/plugins/survey-resources/jest.config.js b/plugins/survey-resources/jest.config.js deleted file mode 100644 index 6479224b48..0000000000 --- a/plugins/survey-resources/jest.config.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - preset: 'ts-jest', - testEnvironment: 'node', - testMatch: ['**/?(*.)+(spec|test).[jt]s?(x)'], - roots: ['./src'], - coverageReporters: ['text-summary', 'html'] -} diff --git a/plugins/survey-resources/package.json b/plugins/survey-resources/package.json deleted file mode 100644 index ae194bf670..0000000000 --- a/plugins/survey-resources/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "@hcengineering/survey-resources", - "version": "0.6.0", - "main": "src/index.ts", - "author": "Anticrm Platform Contributors", - "license": "EPL-2.0", - "scripts": { - "build": "tsc --noEmit --outDir ./dist_cache && echo build", - "build:watch": "tsc --noEmit --outDir ./dist_cache", - "lint:fix": "eslint --fix src", - "lint": "eslint src", - "format": "format src" - }, - "devDependencies": { - "@hcengineering/platform-rig": "^0.6.0", - "svelte-loader":"^3.1.9", - "sass":"^1.53.0", - "svelte-preprocess":"^5.1.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", - "eslint-plugin-svelte": "^2.34.0", - "prettier-plugin-svelte": "^3.1.0", - "svelte-eslint-parser": "^0.33.1", - "prettier": "^3.1.0", - "svelte-check": "^3.6.0", - "jest": "^29.7.0", - "ts-jest": "^29.1.1", - "@types/jest":"^29.5.5" - }, - "dependencies": { - "@hcengineering/core": "^0.6.28", - "@hcengineering/platform": "^0.6.9", - "@hcengineering/survey": "^0.6.0", - "@hcengineering/ui": "^0.6.11", - "@hcengineering/view": "^0.6.9" - } -} diff --git a/plugins/survey-resources/postcss.config.js b/plugins/survey-resources/postcss.config.js deleted file mode 100644 index 88752c6cb0..0000000000 --- a/plugins/survey-resources/postcss.config.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = { - plugins: [ - require('autoprefixer') - ] -} diff --git a/plugins/survey-resources/src/index.ts b/plugins/survey-resources/src/index.ts deleted file mode 100644 index 9a8ff377c3..0000000000 --- a/plugins/survey-resources/src/index.ts +++ /dev/null @@ -1,18 +0,0 @@ -// -// 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 { Resources } from '@hcengineering/platform' - -export default async (): Promise => ({}) diff --git a/plugins/survey-resources/src/plugin.ts b/plugins/survey-resources/src/plugin.ts deleted file mode 100644 index ce00645399..0000000000 --- a/plugins/survey-resources/src/plugin.ts +++ /dev/null @@ -1,19 +0,0 @@ -// -// 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 survey, { surveyId } from '@hcengineering/survey' -import { mergeIds } from '@hcengineering/platform' - -export default mergeIds(surveyId, survey, {}) diff --git a/plugins/survey-resources/svelte.config.js b/plugins/survey-resources/svelte.config.js deleted file mode 100644 index 944a06f73e..0000000000 --- a/plugins/survey-resources/svelte.config.js +++ /dev/null @@ -1,5 +0,0 @@ -const sveltePreprocess = require('svelte-preprocess') - -module.exports = { - preprocess: sveltePreprocess() -}; \ No newline at end of file diff --git a/plugins/survey-resources/tsconfig.json b/plugins/survey-resources/tsconfig.json deleted file mode 100644 index 1bc118e9e9..0000000000 --- a/plugins/survey-resources/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "./node_modules/@hcengineering/platform-rig/profiles/ui/tsconfig.json", - - "compilerOptions": { - "rootDir": "./src", - "outDir": "./lib" - } -} diff --git a/plugins/survey/.eslintrc.js b/plugins/survey/.eslintrc.js deleted file mode 100644 index 72235dc283..0000000000 --- a/plugins/survey/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['./node_modules/@hcengineering/platform-rig/profiles/default/eslint.config.json'], - parserOptions: { - tsconfigRootDir: __dirname, - project: './tsconfig.json' - } -} diff --git a/plugins/survey/.npmignore b/plugins/survey/.npmignore deleted file mode 100644 index e3ec093c38..0000000000 --- a/plugins/survey/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -* -!/lib/** -!CHANGELOG.md -/lib/**/__tests__/ diff --git a/plugins/survey/config/rig.json b/plugins/survey/config/rig.json deleted file mode 100644 index 0110930f55..0000000000 --- a/plugins/survey/config/rig.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json", - "rigPackageName": "@hcengineering/platform-rig" -} diff --git a/plugins/survey/jest.config.js b/plugins/survey/jest.config.js deleted file mode 100644 index 6479224b48..0000000000 --- a/plugins/survey/jest.config.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - preset: 'ts-jest', - testEnvironment: 'node', - testMatch: ['**/?(*.)+(spec|test).[jt]s?(x)'], - roots: ['./src'], - coverageReporters: ['text-summary', 'html'] -} diff --git a/plugins/survey/package.json b/plugins/survey/package.json deleted file mode 100644 index f2c841524f..0000000000 --- a/plugins/survey/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "@hcengineering/survey", - "version": "0.6.0", - "main": "lib/index.js", - "author": "Anticrm Platform Contributors", - "license": "EPL-2.0", - "scripts": { - "build": "tsc", - "test": "jest --passWithNoTests --silent", - "build:watch": "tsc", - "lint:fix": "eslint --fix src", - "lint": "eslint src", - "format": "format src" - }, - "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", - "prettier-plugin-svelte": "^3.1.0", - "jest": "^29.7.0", - "ts-jest": "^29.1.1", - "@types/jest":"^29.5.5" - }, - "dependencies": { - "@hcengineering/attachment": "^0.6.9", - "@hcengineering/core": "^0.6.28", - "@hcengineering/platform": "^0.6.9", - "@hcengineering/ui": "^0.6.11", - "@hcengineering/view": "^0.6.9" - } -} diff --git a/plugins/survey/src/index.ts b/plugins/survey/src/index.ts deleted file mode 100644 index dfc5ee9110..0000000000 --- a/plugins/survey/src/index.ts +++ /dev/null @@ -1,103 +0,0 @@ -// -// 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 { IntlString, Plugin } from '@hcengineering/platform' -import type { AttachedDoc, Class, CollectionSize, Markup, Ref } from '@hcengineering/core' -import type { Attachment } from '@hcengineering/attachment' -import { Asset, plugin } from '@hcengineering/platform' - -/** - * @public - */ -export type Rank = string - -/** - * @public - * - * ∈ [0.0, 100.0] - */ -export type Percentage = number - -/** - * @public - * - * Arbitrary survey item - */ -export interface SurveyItem extends AttachedDoc { - rank: Rank -} - -/** - * @public - * - * Interactive survey item, e.g. a question - */ -export interface SurveyInteractiveItem extends SurveyItem { - title: string -} - -/** - * @public - * - * Assessable interactive survey item, e.g. a question with correct answers - */ -export interface SurveyAssessableItem extends SurveyInteractiveItem { - weight: Percentage -} - -/** - * @public - */ -export interface Survey extends AttachedDoc { - title: string - description: Markup - - threshold: Percentage - items: CollectionSize - attachments: CollectionSize -} - -/** - * @public - */ -export const surveyId = 'survey' as Plugin - -const survey = plugin(surveyId, { - class: { - Survey: '' as Ref>, - SurveyItem: '' as Ref>, - SurveyInteractiveItem: '' as Ref>, - SurveyAssessableItem: '' as Ref> - }, - string: { - ConfigDescription: '' as IntlString, - ConfigLabel: '' as IntlString, - SurveyApplication: '' as IntlString - }, - icon: { - SurveyApplication: '' as Asset - }, - action: { - // TODO: Declare actions? - }, - component: { - // TODO: Declare components? - } -}) - -/** - * @public - */ -export default survey diff --git a/plugins/survey/tsconfig.json b/plugins/survey/tsconfig.json deleted file mode 100644 index 4e0fa3fe7f..0000000000 --- a/plugins/survey/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "./node_modules/@hcengineering/platform-rig/profiles/default/tsconfig.json", - - "compilerOptions": { - "rootDir": "./src", - "outDir": "./lib", - "tsBuildInfoFile": ".build/build.tsbuildinfo" - } -} \ No newline at end of file diff --git a/plugins/tracker/src/index.ts b/plugins/tracker/src/index.ts index e395113472..f6e0d99137 100644 --- a/plugins/tracker/src/index.ts +++ b/plugins/tracker/src/index.ts @@ -493,26 +493,26 @@ const pluginState = plugin(trackerId, { Issue: '' as Ref }, action: { - SetDueDate: '' as Ref, - SetParent: '' as Ref, + SetDueDate: '' as Ref>, + SetParent: '' as Ref>, SetStatus: '' as Ref, - SetPriority: '' as Ref, - SetAssignee: '' as Ref, - SetComponent: '' as Ref, - CopyIssueId: '' as Ref, - CopyIssueTitle: '' as Ref, - CopyIssueLink: '' as Ref, + SetPriority: '' as Ref>, + SetAssignee: '' as Ref>, + SetComponent: '' as Ref>, + CopyIssueId: '' as Ref>, + CopyIssueTitle: '' as Ref>, + CopyIssueLink: '' as Ref>, MoveToProject: '' as Ref, - Duplicate: '' as Ref, - Relations: '' as Ref, - NewIssue: '' as Ref, - NewIssueGlobal: '' as Ref, - NewSubIssue: '' as Ref, + Duplicate: '' as Ref>, + Relations: '' as Ref>, + NewIssue: '' as Ref>, + NewIssueGlobal: '' as Ref>, + NewSubIssue: '' as Ref>, EditWorkflowStatuses: '' as Ref, EditProject: '' as Ref, - SetMilestone: '' as Ref, - SetLabels: '' as Ref, - EditRelatedTargets: '' as Ref + SetMilestone: '' as Ref>, + SetLabels: '' as Ref>, + EditRelatedTargets: '' as Ref> }, project: { DefaultProject: '' as Ref diff --git a/plugins/view-resources/src/components/EditDoc.svelte b/plugins/view-resources/src/components/EditDoc.svelte index bf0dcec71b..f88289cb7e 100644 --- a/plugins/view-resources/src/components/EditDoc.svelte +++ b/plugins/view-resources/src/components/EditDoc.svelte @@ -137,6 +137,7 @@ const editors: Array<{ key: KeyedAttribute, editor: AnyComponent, category: AttributeCategory }> = [] const newInplaceAttributes: string[] = [] + for (const k of collections) { if (allowedCollections.includes(k.key.key)) continue const editor = await getFieldEditor(k.key) @@ -206,7 +207,7 @@ } } - let title: string = '' + let title: string | undefined = undefined let rawTitle: string = '' $: if (object !== undefined) { @@ -332,14 +333,14 @@ - {#if mainEditor && mainEditor.pinned} + {#if mainEditor && mainEditor.editor && mainEditor.pinned}

{/if} - {#if mainEditor && !mainEditor.pinned} + {#if mainEditor && mainEditor.editor && !mainEditor.pinned}
@@ -362,6 +363,7 @@ {/if} {/each} + {#if editorFooter}
diff --git a/plugins/view/src/index.ts b/plugins/view/src/index.ts index e686258e10..8248135423 100644 --- a/plugins/view/src/index.ts +++ b/plugins/view/src/index.ts @@ -435,9 +435,21 @@ export type ViewActionInput = 'focus' | 'selection' | 'any' | 'none' /** * @public */ -export type ViewAction> = Resource< -(doc: Doc | Doc[] | undefined, evt: Event, params?: T) => Promise -> +export type ViewActionFunction> = ( + doc: T | T[] | undefined, + evt: Event, + params?: P +) => Promise + +/** + * @public + */ +export type ViewActionAvailabilityFunction = (doc: T | T[] | undefined) => Promise + +/** + * @public + */ +export type ViewAction

> = Resource> /** * @public @@ -457,7 +469,7 @@ export type ActionGroup = 'create' | 'edit' | 'associate' | 'copy' | 'tools' | ' */ export interface Action> extends Doc, UXObject { // Action implementation details - action: ViewAction

+ action: Resource> // Action implementation parameters actionProps?: P @@ -477,7 +489,7 @@ export interface Action> extends Do query?: DocumentQuery // Action is shown only if the check is passed - visibilityTester?: Resource<(doc?: Doc | Doc[]) => Promise> + visibilityTester?: Resource> // If defined, types should be matched to proposed list inputProps?: Record>> @@ -495,7 +507,7 @@ export interface Action> extends Do context: ViewContext // A list of actions replaced by this one. - // For example it could be global action and action for focus class, second one fill override first one. + // For example, it could be global action and action for focus class, second one fill override first one. override?: Ref[] // Avaible only for workspace owners diff --git a/pods/server/package.json b/pods/server/package.json index 5d4bbf8e24..3125376518 100644 --- a/pods/server/package.json +++ b/pods/server/package.json @@ -116,7 +116,6 @@ "@hcengineering/hr-assets": "^0.6.12", "@hcengineering/bitrix-assets": "^0.6.0", "@hcengineering/request-assets": "^0.6.0", - "@hcengineering/survey-assets": "^0.6.0", "@hcengineering/login": "^0.6.8", "@hcengineering/view": "^0.6.9", "@hcengineering/task": "^0.6.13", @@ -141,7 +140,6 @@ "@hcengineering/hr": "^0.6.12", "@hcengineering/bitrix": "^0.6.44", "@hcengineering/request": "^0.6.6", - "@hcengineering/support": "^0.6.1", - "@hcengineering/survey": "^0.6.0" + "@hcengineering/support": "^0.6.1" } } diff --git a/pods/server/src/server.ts b/pods/server/src/server.ts index 04548e9ad1..b4cea8ee2d 100644 --- a/pods/server/src/server.ts +++ b/pods/server/src/server.ts @@ -107,7 +107,6 @@ import { recruitId } from '@hcengineering/recruit' import { requestId } from '@hcengineering/request' import { settingId } from '@hcengineering/setting' import { supportId } from '@hcengineering/support' -import { surveyId } from '@hcengineering/survey' import { tagsId } from '@hcengineering/tags' import { taskId } from '@hcengineering/task' import { telegramId } from '@hcengineering/telegram' @@ -137,7 +136,6 @@ import recruitEn from '@hcengineering/recruit-assets/lang/en.json' import requestEn from '@hcengineering/request-assets/lang/en.json' import settingEn from '@hcengineering/setting-assets/lang/en.json' import supportEn from '@hcengineering/support-assets/lang/en.json' -import surveyEn from '@hcengineering/survey-assets/lang/en.json' import tagsEn from '@hcengineering/tags-assets/lang/en.json' import taskEn from '@hcengineering/task-assets/lang/en.json' import telegramEn from '@hcengineering/telegram-assets/lang/en.json' @@ -158,7 +156,6 @@ addStringsLoader(recruitId, async (lang: string) => recruitEn) addStringsLoader(activityId, async (lang: string) => activityEn) addStringsLoader(settingId, async (lang: string) => settingEn) addStringsLoader(supportId, async (lang: string) => supportEn) -addStringsLoader(surveyId, async (lang: string) => surveyEn) addStringsLoader(telegramId, async (lang: string) => telegramEn) addStringsLoader(leadId, async (lang: string) => leadEn) addStringsLoader(gmailId, async (lang: string) => gmailEn) diff --git a/rush.json b/rush.json index 96482d4eda..9ae74b4c9d 100644 --- a/rush.json +++ b/rush.json @@ -1501,26 +1501,6 @@ "packageName": "@hcengineering/support-resources", "projectFolder": "plugins/support-resources", "shouldPublish": false - }, - { - "packageName": "@hcengineering/model-survey", - "projectFolder": "models/survey", - "shouldPublish": false - }, - { - "packageName": "@hcengineering/survey", - "projectFolder": "plugins/survey", - "shouldPublish": true - }, - { - "packageName": "@hcengineering/survey-assets", - "projectFolder": "plugins/survey-assets", - "shouldPublish": true - }, - { - "packageName": "@hcengineering/survey-resources", - "projectFolder": "plugins/survey-resources", - "shouldPublish": false } ] }