From a4af9388714ecadfb5b6973f0ccffddd2da931e7 Mon Sep 17 00:00:00 2001 From: Andrey Sobolev Date: Fri, 18 Mar 2022 13:37:49 +0700 Subject: [PATCH] Rework reviews (#1156) Signed-off-by: Andrey Sobolev --- common/config/rush/pnpm-lock.yaml | 166 ++++++++++++++++-- dev/docker-compose.yaml | 72 ++++---- dev/prod/package.json | 5 +- dev/prod/src/platform.ts | 3 + models/all/package.json | 3 +- models/all/src/index.ts | 2 + models/calendar/.eslintrc.js | 7 + models/calendar/.npmignore | 4 + models/calendar/config/rig.json | 18 ++ models/calendar/package.json | 46 +++++ models/calendar/src/index.ts | 90 ++++++++++ models/calendar/src/plugin.ts | 31 ++++ models/calendar/tsconfig.json | 8 + models/core/src/component.ts | 3 +- models/core/src/core.ts | 8 +- models/core/src/index.ts | 5 +- models/recruit/package.json | 1 + models/recruit/src/index.ts | 12 ++ models/recruit/src/migration.ts | 20 +++ models/recruit/src/plugin.ts | 1 + models/recruit/src/review-model.ts | 69 +++----- models/recruit/src/review.ts | 111 +++--------- models/view/src/index.ts | 4 + models/view/src/plugin.ts | 1 + packages/core/lang/en.json | 3 +- packages/core/lang/ru.json | 3 +- packages/core/src/classes.ts | 14 ++ packages/core/src/component.ts | 1 + packages/model/src/dsl.ts | 21 ++- .../src/components/AttributeBarEditor.svelte | 3 + .../presentation/src/components/Card.svelte | 3 +- .../src/components/UserBox.svelte | 3 +- .../src/components/UserBoxList.svelte | 5 +- .../src/components/StyledTextBox.svelte | 90 ++++++++-- .../src/components/StyledTextEditor.svelte | 21 ++- .../src/components/TextEditor.svelte | 12 ++ packages/theme/styles/components.scss | 8 +- packages/theme/styles/dialogs.scss | 4 +- packages/ui/src/components/DatePopup.svelte | 6 +- .../ui/src/components/DatePresenter.svelte | 2 +- plugins/calendar-assets/.eslintrc.js | 7 + plugins/calendar-assets/assets/icons.svg | 9 + plugins/calendar-assets/config/rig.json | 18 ++ plugins/calendar-assets/lang/en.json | 17 ++ plugins/calendar-assets/lang/ru.json | 17 ++ plugins/calendar-assets/package.json | 33 ++++ plugins/calendar-assets/src/index.ts | 25 +++ plugins/calendar-assets/tsconfig.json | 15 ++ plugins/calendar-resources/.eslintrc.js | 7 + plugins/calendar-resources/img/avatar.png | Bin 0 -> 2799 bytes plugins/calendar-resources/package.json | 47 +++++ plugins/calendar-resources/postcss.config.js | 5 + .../src/components/PersonsPresenter.svelte | 56 ++++++ plugins/calendar-resources/src/index.ts | 24 +++ plugins/calendar-resources/src/plugin.ts | 24 +++ plugins/calendar-resources/svelte.config.js | 5 + plugins/calendar-resources/tsconfig.json | 15 ++ plugins/calendar/.eslintrc.js | 7 + plugins/calendar/.npmignore | 4 + plugins/calendar/config/rig.json | 18 ++ plugins/calendar/package.json | 34 ++++ plugins/calendar/src/index.ts | 90 ++++++++++ plugins/calendar/tsconfig.json | 9 + .../components/OrganizationSelector.svelte | 3 + plugins/recruit-assets/lang/en.json | 5 +- plugins/recruit-assets/lang/ru.json | 5 +- plugins/recruit-resources/package.json | 3 +- .../src/components/review/CreateReview.svelte | 125 +++++++------ .../review/CreateReviewCategory.svelte | 30 +--- .../src/components/review/EditReview.svelte | 148 ++++++++-------- .../components/review/KanbanReviewCard.svelte | 90 ---------- .../review/ReviewCategoryPresenter.svelte | 37 ++++ .../components/review/ReviewPresenter.svelte | 2 +- .../src/components/review/Reviews.svelte | 10 +- plugins/recruit-resources/src/index.ts | 6 +- plugins/recruit-resources/src/plugin.ts | 5 +- plugins/recruit/package.json | 1 + plugins/recruit/src/index.ts | 21 +-- .../src/components/DateEditor.svelte | 10 +- .../src/components/DatePresenter.svelte | 4 +- .../src/components/IntlStringPresenter.svelte | 26 +++ plugins/view-resources/src/index.ts | 4 +- plugins/view-resources/src/utils.ts | 6 +- .../src/components/Archive.svelte | 8 +- rush.json | 20 +++ 85 files changed, 1422 insertions(+), 522 deletions(-) create mode 100644 models/calendar/.eslintrc.js create mode 100644 models/calendar/.npmignore create mode 100644 models/calendar/config/rig.json create mode 100644 models/calendar/package.json create mode 100644 models/calendar/src/index.ts create mode 100644 models/calendar/src/plugin.ts create mode 100644 models/calendar/tsconfig.json create mode 100644 plugins/calendar-assets/.eslintrc.js create mode 100644 plugins/calendar-assets/assets/icons.svg create mode 100644 plugins/calendar-assets/config/rig.json create mode 100644 plugins/calendar-assets/lang/en.json create mode 100644 plugins/calendar-assets/lang/ru.json create mode 100644 plugins/calendar-assets/package.json create mode 100644 plugins/calendar-assets/src/index.ts create mode 100644 plugins/calendar-assets/tsconfig.json create mode 100644 plugins/calendar-resources/.eslintrc.js create mode 100644 plugins/calendar-resources/img/avatar.png create mode 100644 plugins/calendar-resources/package.json create mode 100644 plugins/calendar-resources/postcss.config.js create mode 100644 plugins/calendar-resources/src/components/PersonsPresenter.svelte create mode 100644 plugins/calendar-resources/src/index.ts create mode 100644 plugins/calendar-resources/src/plugin.ts create mode 100644 plugins/calendar-resources/svelte.config.js create mode 100644 plugins/calendar-resources/tsconfig.json create mode 100644 plugins/calendar/.eslintrc.js create mode 100644 plugins/calendar/.npmignore create mode 100644 plugins/calendar/config/rig.json create mode 100644 plugins/calendar/package.json create mode 100644 plugins/calendar/src/index.ts create mode 100644 plugins/calendar/tsconfig.json delete mode 100644 plugins/recruit-resources/src/components/review/KanbanReviewCard.svelte create mode 100644 plugins/recruit-resources/src/components/review/ReviewCategoryPresenter.svelte create mode 100644 plugins/view-resources/src/components/IntlStringPresenter.svelte diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 79eec0fab9..ff44708cae 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -13,6 +13,9 @@ specifiers: '@rush-temp/attachment': file:./projects/attachment.tgz '@rush-temp/attachment-assets': file:./projects/attachment-assets.tgz '@rush-temp/attachment-resources': file:./projects/attachment-resources.tgz + '@rush-temp/calendar': file:./projects/calendar.tgz + '@rush-temp/calendar-assets': file:./projects/calendar-assets.tgz + '@rush-temp/calendar-resources': file:./projects/calendar-resources.tgz '@rush-temp/chunter': file:./projects/chunter.tgz '@rush-temp/chunter-assets': file:./projects/chunter-assets.tgz '@rush-temp/chunter-resources': file:./projects/chunter-resources.tgz @@ -50,6 +53,7 @@ specifiers: '@rush-temp/model-activity': file:./projects/model-activity.tgz '@rush-temp/model-all': file:./projects/model-all.tgz '@rush-temp/model-attachment': file:./projects/model-attachment.tgz + '@rush-temp/model-calendar': file:./projects/model-calendar.tgz '@rush-temp/model-chunter': file:./projects/model-chunter.tgz '@rush-temp/model-contact': file:./projects/model-contact.tgz '@rush-temp/model-core': file:./projects/model-core.tgz @@ -167,7 +171,6 @@ specifiers: '@types/koa__cors': ^3.0.3 '@types/mime-types': ~2.1.1 '@types/minio': ~7.0.11 - '@types/node': ~16.11.12 '@types/pdfkit': ~0.12.3 '@types/prosemirror-model': ~1.16.0 '@types/request': ~2.48.8 @@ -257,6 +260,9 @@ dependencies: '@rush-temp/attachment': file:projects/attachment.tgz '@rush-temp/attachment-assets': file:projects/attachment-assets.tgz_typescript@4.5.4 '@rush-temp/attachment-resources': file:projects/attachment-resources.tgz_096c09b0b673a57c275d9767a12070b1 + '@rush-temp/calendar': file:projects/calendar.tgz + '@rush-temp/calendar-assets': file:projects/calendar-assets.tgz_typescript@4.5.4 + '@rush-temp/calendar-resources': file:projects/calendar-resources.tgz_096c09b0b673a57c275d9767a12070b1 '@rush-temp/chunter': file:projects/chunter.tgz '@rush-temp/chunter-assets': file:projects/chunter-assets.tgz_typescript@4.5.4 '@rush-temp/chunter-resources': file:projects/chunter-resources.tgz_096c09b0b673a57c275d9767a12070b1 @@ -269,11 +275,11 @@ dependencies: '@rush-temp/core': file:projects/core.tgz '@rush-temp/dev-account': file:projects/dev-account.tgz '@rush-temp/dev-client-resources': file:projects/dev-client-resources.tgz - '@rush-temp/dev-server': file:projects/dev-server.tgz_@types+node@16.11.14 + '@rush-temp/dev-server': file:projects/dev-server.tgz '@rush-temp/dev-storage': file:projects/dev-storage.tgz '@rush-temp/devmodel': file:projects/devmodel.tgz_typescript@4.5.4 '@rush-temp/devmodel-resources': file:projects/devmodel-resources.tgz_6cae74ea501386c76c405ad0408e0339 - '@rush-temp/elastic': file:projects/elastic.tgz_@types+node@16.11.14 + '@rush-temp/elastic': file:projects/elastic.tgz '@rush-temp/front': file:projects/front.tgz '@rush-temp/generator': file:projects/generator.tgz '@rush-temp/gmail': file:projects/gmail.tgz @@ -294,6 +300,7 @@ dependencies: '@rush-temp/model-activity': file:projects/model-activity.tgz_typescript@4.5.4 '@rush-temp/model-all': file:projects/model-all.tgz_typescript@4.5.4 '@rush-temp/model-attachment': file:projects/model-attachment.tgz_typescript@4.5.4 + '@rush-temp/model-calendar': file:projects/model-calendar.tgz_typescript@4.5.4 '@rush-temp/model-chunter': file:projects/model-chunter.tgz_typescript@4.5.4 '@rush-temp/model-contact': file:projects/model-contact.tgz_typescript@4.5.4 '@rush-temp/model-core': file:projects/model-core.tgz_typescript@4.5.4 @@ -411,7 +418,6 @@ dependencies: '@types/koa__cors': 3.1.0 '@types/mime-types': 2.1.1 '@types/minio': 7.0.11 - '@types/node': 16.11.14 '@types/pdfkit': 0.12.3 '@types/prosemirror-model': 1.16.0 '@types/request': 2.48.8 @@ -478,7 +484,7 @@ dependencies: svgo-loader: 3.0.0 toposort: 2.0.2 ts-loader: 9.2.6_typescript@4.5.4+webpack@5.65.0 - ts-node: 10.5.0_5d12c2add188ff0e728b4ade3dacd39b + ts-node: 10.5.0_typescript@4.5.4 typescript: 4.5.4 uuid: 8.3.2 webpack: 5.65.0_9def3870c80213359789f9191dbd286a @@ -8563,7 +8569,7 @@ packages: dependencies: import-cwd: 3.0.0 lilconfig: 2.0.4 - ts-node: 10.5.0_5d12c2add188ff0e728b4ade3dacd39b + ts-node: 10.5.0_typescript@4.5.4 yaml: 1.10.2 dev: false @@ -10452,6 +10458,36 @@ packages: yn: 3.1.1 dev: false + /ts-node/10.5.0_typescript@4.5.4: + resolution: {integrity: sha512-6kEJKwVxAJ35W4akuiysfKwKmjkbYxwQMTBaAxo9KKAx/Yd26mPUyhGz3ji+EsJoAgrLqVsYHNuuYwQe22lbtw==} + hasBin: true + peerDependencies: + '@swc/core': '>=1.2.50' + '@swc/wasm': '>=1.2.50' + '@types/node': '*' + typescript: '>=2.7' + peerDependenciesMeta: + '@swc/core': + optional: true + '@swc/wasm': + optional: true + dependencies: + '@cspotcode/source-map-support': 0.7.0 + '@tsconfig/node10': 1.0.8 + '@tsconfig/node12': 1.0.9 + '@tsconfig/node14': 1.0.1 + '@tsconfig/node16': 1.0.2 + acorn: 8.6.0 + acorn-walk: 8.2.0 + arg: 4.1.3 + create-require: 1.1.1 + diff: 4.0.2 + make-error: 1.3.6 + typescript: 4.5.4 + v8-compile-cache-lib: 3.0.0 + yn: 3.1.1 + dev: false + /tsconfig-paths/3.12.0: resolution: {integrity: sha512-e5adrnOYT6zqVnWqZu7i/BQ3BnhzvGbjEjejFXO20lKIKpwTaupkCPgEfv4GZK1IBciJUEhYs3J3p75FdaTFVg==} dependencies: @@ -11416,6 +11452,83 @@ packages: - supports-color dev: false + file:projects/calendar-assets.tgz_typescript@4.5.4: + resolution: {integrity: sha512-muyoJ0EuKPUpsAEL1bLgdR90OqIoohgdfUFDwyWP1qmtAe9k1my76bJSIiU1JSfybyssHYiR8jpM/SuIonWg3Q==, tarball: file:projects/calendar-assets.tgz} + id: file:projects/calendar-assets.tgz + name: '@rush-temp/calendar-assets' + version: 0.0.0 + dependencies: + '@rushstack/heft': 0.41.8 + '@types/heft-jest': 1.0.2 + '@types/node': 16.11.14 + '@typescript-eslint/eslint-plugin': 5.7.0_c25e8c1f4f4f7aaed27aa6f9ce042237 + '@typescript-eslint/parser': 5.7.0_eslint@7.32.0+typescript@4.5.4 + eslint: 7.32.0 + eslint-config-standard-with-typescript: 21.0.1_ce2fa0c4dfa1c256100cababd749a13a + eslint-plugin-import: 2.25.3_eslint@7.32.0 + eslint-plugin-node: 11.1.0_eslint@7.32.0 + eslint-plugin-promise: 5.2.0_eslint@7.32.0 + prettier: 2.5.1 + transitivePeerDependencies: + - supports-color + - typescript + dev: false + + file:projects/calendar-resources.tgz_096c09b0b673a57c275d9767a12070b1: + resolution: {integrity: sha512-UZIMmHCGB+XoLDkyP1A/+ot4oc0POAPYCVOtiPI3vQtVWuTIPquMM4pPX3HxkvfpWqblXburuJx3j18rfA5Mgw==, tarball: file:projects/calendar-resources.tgz} + id: file:projects/calendar-resources.tgz + name: '@rush-temp/calendar-resources' + version: 0.0.0 + dependencies: + '@typescript-eslint/eslint-plugin': 5.7.0_c25e8c1f4f4f7aaed27aa6f9ce042237 + '@typescript-eslint/parser': 5.7.0_eslint@7.32.0+typescript@4.5.4 + eslint: 7.32.0 + eslint-config-standard-with-typescript: 21.0.1_ce2fa0c4dfa1c256100cababd749a13a + eslint-plugin-import: 2.25.3_eslint@7.32.0 + eslint-plugin-node: 11.1.0_eslint@7.32.0 + eslint-plugin-promise: 5.2.0_eslint@7.32.0 + eslint-plugin-svelte3: 3.2.1_eslint@7.32.0+svelte@3.44.3 + prettier: 2.5.1 + prettier-plugin-svelte: 2.5.1_prettier@2.5.1+svelte@3.44.3 + sass: 1.45.0 + svelte: 3.44.3 + svelte-check: 2.3.0_4374c622c67ed7479ff0e44c29d09bce + svelte-loader: 3.1.2_svelte@3.44.3 + svelte-preprocess: 4.10.3_14d64cad431e31f100de7363af24a44f + typescript: 4.5.4 + transitivePeerDependencies: + - '@babel/core' + - coffeescript + - less + - node-sass + - postcss + - postcss-load-config + - pug + - stylus + - sugarss + - supports-color + dev: false + + file:projects/calendar.tgz: + resolution: {integrity: sha512-mN4GfaHpyGzuLV59eFw3c3R6p2r4ewEumsIhzyifgeXaXSD9Bnm06LG5LvFgF5G5TmDquUFcIq88w3Zzd20cQA==, tarball: file:projects/calendar.tgz} + name: '@rush-temp/calendar' + version: 0.0.0 + dependencies: + '@rushstack/heft': 0.41.8 + '@types/heft-jest': 1.0.2 + '@typescript-eslint/eslint-plugin': 5.7.0_c25e8c1f4f4f7aaed27aa6f9ce042237 + '@typescript-eslint/parser': 5.7.0_eslint@7.32.0+typescript@4.5.4 + eslint: 7.32.0 + eslint-config-standard-with-typescript: 21.0.1_ce2fa0c4dfa1c256100cababd749a13a + eslint-plugin-import: 2.25.3_eslint@7.32.0 + eslint-plugin-node: 11.1.0_eslint@7.32.0 + eslint-plugin-promise: 5.2.0_eslint@7.32.0 + prettier: 2.5.1 + typescript: 4.5.4 + transitivePeerDependencies: + - supports-color + dev: false + file:projects/chunter-assets.tgz_typescript@4.5.4: resolution: {integrity: sha512-2EQgdQ62vXKYpX9iOtOaCRt1GZliFiJpPPBZbOMHjaeWLye+/zYXlffkBbjVUSfR894cBlrtZBVRapjJU2T3uA==, tarball: file:projects/chunter-assets.tgz} id: file:projects/chunter-assets.tgz @@ -11713,9 +11826,8 @@ packages: - supports-color dev: false - file:projects/dev-server.tgz_@types+node@16.11.14: + file:projects/dev-server.tgz: resolution: {integrity: sha512-pv0DpcojPAreq3xXTnbl3Rj2UwEy97zRPmXU2lJsM0pKc6dVpmicD+/Bq4laIWx5qhvzfLurbwjBV4/0mLeuYw==, tarball: file:projects/dev-server.tgz} - id: file:projects/dev-server.tgz name: '@rush-temp/dev-server' version: 0.0.0 dependencies: @@ -11730,7 +11842,7 @@ packages: eslint-plugin-promise: 5.2.0_eslint@7.32.0 jwt-simple: 0.5.6 prettier: 2.5.1 - ts-node: 10.5.0_5d12c2add188ff0e728b4ade3dacd39b + ts-node: 10.5.0_typescript@4.5.4 typescript: 4.5.4 transitivePeerDependencies: - '@swc/core' @@ -11815,9 +11927,8 @@ packages: - typescript dev: false - file:projects/elastic.tgz_@types+node@16.11.14: + file:projects/elastic.tgz: resolution: {integrity: sha512-CF8tie/n08Slnvw40pFZnaS4j/2JPQzs2xAxakNqpokb5x3ci9e0z2gzXNB6otQElk1NxW69QDHqNme+jHqWPA==, tarball: file:projects/elastic.tgz} - id: file:projects/elastic.tgz name: '@rush-temp/elastic' version: 0.0.0 dependencies: @@ -11832,7 +11943,7 @@ packages: eslint-plugin-node: 11.1.0_eslint@7.32.0 eslint-plugin-promise: 5.2.0_eslint@7.32.0 prettier: 2.5.1 - ts-node: 10.5.0_5d12c2add188ff0e728b4ade3dacd39b + ts-node: 10.5.0_typescript@4.5.4 typescript: 4.5.4 transitivePeerDependencies: - '@swc/core' @@ -12305,7 +12416,7 @@ packages: dev: false file:projects/model-all.tgz_typescript@4.5.4: - resolution: {integrity: sha512-Jll+Wp4p6/OjdvtbTqAGKbMUkOoAai5Se2+CSIOteRB6dDTgtlwy95fzQv2o5RHIBBiQXLQ2Csb8KgAluzTJ6w==, tarball: file:projects/model-all.tgz} + resolution: {integrity: sha512-LprNHSPgySvlj/zl9bkeSZ7Uh1wWyPPkQBW6knjBBD3cizpFpxPGBrSQnhDe/RP0uj6azKRYWWUcAPFOYe4TvQ==, tarball: file:projects/model-all.tgz} id: file:projects/model-all.tgz name: '@rush-temp/model-all' version: 0.0.0 @@ -12350,6 +12461,27 @@ packages: - typescript dev: false + file:projects/model-calendar.tgz_typescript@4.5.4: + resolution: {integrity: sha512-sI97CjbxdgK1qWGDrBViWm65NY+vwFzt1s94cGheRJP8CL/GqJNuaSyrJv0pqjfZgK6Z3IkcUq2ZUSSHwD+1gQ==, tarball: file:projects/model-calendar.tgz} + id: file:projects/model-calendar.tgz + name: '@rush-temp/model-calendar' + version: 0.0.0 + dependencies: + '@rushstack/heft': 0.41.8 + '@types/heft-jest': 1.0.2 + '@typescript-eslint/eslint-plugin': 5.7.0_c25e8c1f4f4f7aaed27aa6f9ce042237 + '@typescript-eslint/parser': 5.7.0_eslint@7.32.0+typescript@4.5.4 + eslint: 7.32.0 + eslint-config-standard-with-typescript: 21.0.1_ce2fa0c4dfa1c256100cababd749a13a + eslint-plugin-import: 2.25.3_eslint@7.32.0 + eslint-plugin-node: 11.1.0_eslint@7.32.0 + eslint-plugin-promise: 5.2.0_eslint@7.32.0 + prettier: 2.5.1 + transitivePeerDependencies: + - supports-color + - typescript + dev: false + file:projects/model-chunter.tgz_typescript@4.5.4: resolution: {integrity: sha512-bbKuovYnIkpRkU0YhE2x6UEx2gvwKM/OkCj7SH4rQhVR3vjdWisBd0/P71NsNdfcdR7Hl4fhHSNVZfW6KNNPog==, tarball: file:projects/model-chunter.tgz} id: file:projects/model-chunter.tgz @@ -12540,7 +12672,7 @@ packages: dev: false file:projects/model-recruit.tgz_typescript@4.5.4: - resolution: {integrity: sha512-t2mSCyFnB+YfsxFuAu0J8hNVhM+GP5SjiVevMe8tft+dCyyLeMpAJxTdEKkvRx6jV6yyxyPUmqZMAQCmm/pvuA==, tarball: file:projects/model-recruit.tgz} + resolution: {integrity: sha512-TtzOJVyFh5KY3RmQUTUUqeemhDDo/14R1RRrbQ7FoYun9yl+lv5b00OUuIbZ4rtYSJQLhiJaXFbZbxHl6pr3mA==, tarball: file:projects/model-recruit.tgz} id: file:projects/model-recruit.tgz name: '@rush-temp/model-recruit' version: 0.0.0 @@ -13235,7 +13367,7 @@ packages: dev: false file:projects/prod.tgz_a07ec81d4d975778878ca12202ea119e: - resolution: {integrity: sha512-R0Y2btm9DPFvRRGYAGC6ilCIcE5t+p2trcdARVBxyi+tH4XwcXZSt0NJJe+57vpiwkCV8hYPa2fI+Eul1wdrpQ==, tarball: file:projects/prod.tgz} + resolution: {integrity: sha512-mxkGGtPp108JHMkmnEgKKPNVrihu3xVv1wZqY/HTWhZ+v8Ct5RG92+Yg6NBhEsLmqCBBPTAHY/JapGi1oF9bWg==, tarball: file:projects/prod.tgz} id: file:projects/prod.tgz name: '@rush-temp/prod' version: 0.0.0 @@ -13329,7 +13461,7 @@ packages: dev: false file:projects/recruit-resources.tgz_096c09b0b673a57c275d9767a12070b1: - resolution: {integrity: sha512-EexKsB2ZRQ/VxlTABy5b5g3MLR51+549IMWW4g6+Xb/ZR6MZKCT6ocWPRgULW64EO3CTOJ37nIlXijj6Z/fPKw==, tarball: file:projects/recruit-resources.tgz} + resolution: {integrity: sha512-nvxkMBBQ9fPzCtIIQbUOlLaV+4wulVAKLg2iBOR5RuEiKZK/kwItpbzv0u6mS5Vb7/yFRp0GsRM+G7rv1tiGfg==, tarball: file:projects/recruit-resources.tgz} id: file:projects/recruit-resources.tgz name: '@rush-temp/recruit-resources' version: 0.0.0 @@ -13366,7 +13498,7 @@ packages: dev: false file:projects/recruit.tgz: - resolution: {integrity: sha512-wAgHbMEy+KVBNhYTiPdcBnN0O7BAsfxLMxK/gcjM1pkqeLbCzJ/SpRNMFpC2K0/TU+qsPqCzK3zx0VSvFXH05A==, tarball: file:projects/recruit.tgz} + resolution: {integrity: sha512-VAcfan3RLB0bq8DYryIS1waf0EiSSjbd1mdyq0IqMvlp9b8OBUGf0mOCfHDhkno9C4nf9fN8kCUDk9y82LfjZg==, tarball: file:projects/recruit.tgz} name: '@rush-temp/recruit' version: 0.0.0 dependencies: diff --git a/dev/docker-compose.yaml b/dev/docker-compose.yaml index 88894a0b41..ecd74188d6 100644 --- a/dev/docker-compose.yaml +++ b/dev/docker-compose.yaml @@ -82,7 +82,7 @@ services: - mongodb - elastic - minio - - apm-server + # - apm-server ports: - 3333:3333 environment: @@ -94,41 +94,41 @@ services: - MINIO_ENDPOINT=minio - MINIO_ACCESS_KEY=minioadmin - MINIO_SECRET_KEY=minioadmin - - APM_SERVER_URL=http://apm-server:8200 - apm-server: - image: docker.elastic.co/apm/apm-server:7.14.2 - depends_on: - - "elastic" - - "kibana" - cap_add: ["CHOWN", "DAC_OVERRIDE", "SETGID", "SETUID"] - cap_drop: ["ALL"] - ports: - - 8200:8200 - command: | - apm-server -e - -E apm-server.rum.enabled=true - -E setup.kibana.host=kibana:5601 - -E setup.template.settings.index.number_of_replicas=0 - -E apm-server.kibana.enabled=true - -E apm-server.kibana.host=kibana:5601 - -E output.elasticsearch.hosts=["elastic:9200"] - healthcheck: - interval: 10s - retries: 12 - test: curl --write-out 'HTTP %{http_code}' --fail --silent --output /dev/null http://localhost:8200/ - kibana: - image: docker.elastic.co/kibana/kibana:7.14.2 - depends_on: - - "elastic" - environment: - ELASTICSEARCH_URL: http://elastic:9200 - ELASTICSEARCH_HOSTS: http://elastic:9200 - ports: - - 5601:5601 - healthcheck: - interval: 10s - retries: 20 - test: curl --write-out 'HTTP %{http_code}' --fail --silent --output /dev/null http://localhost:5601/api/status + # - APM_SERVER_URL=http://apm-server:8200 + # apm-server: + # image: docker.elastic.co/apm/apm-server:7.14.2 + # depends_on: + # - "elastic" + # - "kibana" + # cap_add: ["CHOWN", "DAC_OVERRIDE", "SETGID", "SETUID"] + # cap_drop: ["ALL"] + # ports: + # - 8200:8200 + # command: | + # apm-server -e + # -E apm-server.rum.enabled=true + # -E setup.kibana.host=kibana:5601 + # -E setup.template.settings.index.number_of_replicas=0 + # -E apm-server.kibana.enabled=true + # -E apm-server.kibana.host=kibana:5601 + # -E output.elasticsearch.hosts=["elastic:9200"] + # healthcheck: + # interval: 10s + # retries: 12 + # test: curl --write-out 'HTTP %{http_code}' --fail --silent --output /dev/null http://localhost:8200/ + # kibana: + # image: docker.elastic.co/kibana/kibana:7.14.2 + # depends_on: + # - "elastic" + # environment: + # ELASTICSEARCH_URL: http://elastic:9200 + # ELASTICSEARCH_HOSTS: http://elastic:9200 + # ports: + # - 5601:5601 + # healthcheck: + # interval: 10s + # retries: 20 + # test: curl --write-out 'HTTP %{http_code}' --fail --silent --output /dev/null http://localhost:5601/api/status volumes: db: diff --git a/dev/prod/package.json b/dev/prod/package.json index b126d7846d..dc2c4e2a2e 100644 --- a/dev/prod/package.json +++ b/dev/prod/package.json @@ -119,6 +119,9 @@ "@anticrm/server-recruit": "~0.6.0", "@anticrm/server-recruit-resources": "~0.6.0", "@anticrm/server-task": "~0.6.0", - "@anticrm/server-task-resources": "~0.6.0" + "@anticrm/server-task-resources": "~0.6.0", + "@anticrm/calendar": "~0.6.0", + "@anticrm/calendar-assets": "~0.6.0", + "@anticrm/calendar-resources": "~0.6.0" } } diff --git a/dev/prod/src/platform.ts b/dev/prod/src/platform.ts index 2439971c32..9b1a950ce5 100644 --- a/dev/prod/src/platform.ts +++ b/dev/prod/src/platform.ts @@ -35,6 +35,7 @@ import { inventoryId } from '@anticrm/inventory' import { templatesId } from '@anticrm/templates' import { notificationId } from '@anticrm/notification' import { tagsId } from '@anticrm/tags' +import { calendarId } from '@anticrm/calendar' import rekoni from '@anticrm/rekoni' import '@anticrm/login-assets' @@ -54,6 +55,7 @@ import '@anticrm/inventory-assets' import '@anticrm/templates-assets' import '@anticrm/notification-assets' import '@anticrm/tags-assets' +import '@anticrm/calendar-assets' import { setMetadata } from '@anticrm/platform' export async function configurePlatform() { @@ -95,4 +97,5 @@ export async function configurePlatform() { addLocation(templatesId, () => import(/* webpackChunkName: "templates" */ '@anticrm/templates-resources')) addLocation(notificationId, () => import(/* webpackChunkName: "notification" */ '@anticrm/notification-resources')) addLocation(tagsId, () => import(/* webpackChunkName: "tags" */ '@anticrm/tags-resources')) + addLocation(calendarId, () => import(/* webpackChunkName: "calendar" */ '@anticrm/calendar-resources')) } diff --git a/models/all/package.json b/models/all/package.json index 4d00249377..5a277c9331 100644 --- a/models/all/package.json +++ b/models/all/package.json @@ -61,6 +61,7 @@ "@anticrm/model-notification": "~0.6.0", "@anticrm/model-text-editor": "~0.6.0", "@anticrm/core": "~0.6.16", - "@anticrm/model-tags": "~0.6.0" + "@anticrm/model-tags": "~0.6.0", + "@anticrm/model-calendar": "~0.6.0" } } diff --git a/models/all/src/index.ts b/models/all/src/index.ts index 62ab27f3cf..1719d755c3 100644 --- a/models/all/src/index.ts +++ b/models/all/src/index.ts @@ -47,6 +47,7 @@ import { createModel as viewModel } from '@anticrm/model-view' import { createModel as workbenchModel } from '@anticrm/model-workbench' import { createModel as notificationModel } from '@anticrm/model-notification' import { createModel as tagsModel } from '@anticrm/model-tags' +import { createModel as calendarModel } from '@anticrm/model-calendar' export const version: Data = jsonVersion as Data @@ -77,6 +78,7 @@ const builders = [ serverNotificationModel, serveSettingModel, tagsModel, + calendarModel, serverChunterModel, serverInventoryModel, serverLeadModel, diff --git a/models/calendar/.eslintrc.js b/models/calendar/.eslintrc.js new file mode 100644 index 0000000000..c3c2c49417 --- /dev/null +++ b/models/calendar/.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/calendar/.npmignore b/models/calendar/.npmignore new file mode 100644 index 0000000000..e3ec093c38 --- /dev/null +++ b/models/calendar/.npmignore @@ -0,0 +1,4 @@ +* +!/lib/** +!CHANGELOG.md +/lib/**/__tests__/ diff --git a/models/calendar/config/rig.json b/models/calendar/config/rig.json new file mode 100644 index 0000000000..e9a9ee9add --- /dev/null +++ b/models/calendar/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/calendar/package.json b/models/calendar/package.json new file mode 100644 index 0000000000..72d6c9d0b9 --- /dev/null +++ b/models/calendar/package.json @@ -0,0 +1,46 @@ +{ + "name": "@anticrm/model-calendar", + "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.4.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.41.1" + }, + "dependencies": { + "@anticrm/core": "~0.6.11", + "@anticrm/model": "~0.6.0", + "@anticrm/ui": "~0.6.0", + "@anticrm/view": "~0.6.0", + "@anticrm/model-attachment": "~0.6.0", + "@anticrm/model-task": "~0.6.0", + "@anticrm/calendar": "~0.6.0", + "@anticrm/calendar-resources": "~0.6.0", + "@anticrm/platform": "~0.6.5", + "@anticrm/model-core": "~0.6.0", + "@anticrm/model-view": "~0.6.0", + "@anticrm/model-workbench": "~0.6.1", + "@anticrm/activity": "~0.6.0", + "@anticrm/workbench": "~0.6.1", + "@anticrm/model-chunter": "~0.6.0", + "@anticrm/model-contact": "~0.6.1", + "@anticrm/contact": "~0.6.5" + } +} diff --git a/models/calendar/src/index.ts b/models/calendar/src/index.ts new file mode 100644 index 0000000000..f35f8387c1 --- /dev/null +++ b/models/calendar/src/index.ts @@ -0,0 +1,90 @@ +// +// Copyright © 2020, 2021 Anticrm Platform Contributors. +// +// 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 { Calendar, Event } from '@anticrm/calendar' +import { Employee } from '@anticrm/contact' +import type { Domain, Markup, Ref, Timestamp } from '@anticrm/core' +import { IndexKind } from '@anticrm/core' +import { Builder, Collection, Index, Model, Prop, TypeDate, TypeMarkup, TypeString, UX } from '@anticrm/model' +import attachment from '@anticrm/model-attachment' +import chunter from '@anticrm/model-chunter' +import contact from '@anticrm/model-contact' +import core, { TAttachedDoc } from '@anticrm/model-core' +import { TSpaceWithStates } from '@anticrm/model-task' +import workbench from '@anticrm/model-workbench' +import calendar from './plugin' + +export * from '@anticrm/calendar' + +export const DOMAIN_CALENDAR = 'calendar' as Domain + +@Model(calendar.class.Calendar, core.class.Space) +@UX(calendar.string.Calendar, calendar.icon.Calendar) +export class TCalendar extends TSpaceWithStates implements Calendar {} + +@Model(calendar.class.Event, core.class.AttachedDoc, DOMAIN_CALENDAR) +export class TEvent extends TAttachedDoc implements Event { + @Prop(TypeString(), calendar.string.Title) + @Index(IndexKind.FullText) + title!: string + + @Prop(TypeString(), calendar.string.EventNumber) + number!: number + + @Prop(TypeMarkup(), calendar.string.Description) + @Index(IndexKind.FullText) + description!: Markup + + @Prop(TypeString(), calendar.string.Location, calendar.icon.Location) + @Index(IndexKind.FullText) + location?: string + + @Prop(TypeDate(true), calendar.string.Date) + date!: Timestamp + + @Prop(TypeDate(true), calendar.string.DueTo) + dueDate!: Timestamp + + @Prop(Collection(attachment.class.Attachment), attachment.string.Attachments) + attachments?: number + + @Prop(Collection(chunter.class.Comment), chunter.string.Comments) + comments?: number + + @Prop(Collection(contact.class.Employee), calendar.string.Participants) + participants!: Ref[] +} + +export function createModel (builder: Builder): void { + builder.createModel(TCalendar, TEvent) + + builder.createDoc(workbench.class.Application, core.space.Model, { + label: calendar.string.ApplicationLabelCalendar, + icon: calendar.icon.Calendar, + hidden: true, + navigatorModel: { + spaces: [ + { + label: calendar.string.Calendars, + spaceClass: calendar.class.Calendar, + addSpaceLabel: calendar.string.CreateCalendar, + createComponent: calendar.component.CreateCalendar + } + ] + } + }, calendar.app.Calendar) +} + +export default calendar diff --git a/models/calendar/src/plugin.ts b/models/calendar/src/plugin.ts new file mode 100644 index 0000000000..8e06bf53d7 --- /dev/null +++ b/models/calendar/src/plugin.ts @@ -0,0 +1,31 @@ +// +// Copyright © 2020 Anticrm Platform Contributors. +// +// 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 { calendarId } from '@anticrm/calendar' +import calendar from '@anticrm/calendar-resources/src/plugin' +import type { IntlString } from '@anticrm/platform' +import { mergeIds } from '@anticrm/platform' +import { AnyComponent } from '@anticrm/ui' + +export default mergeIds(calendarId, calendar, { + component: { + CreateCalendar: '' as AnyComponent + }, + string: { + ApplicationLabelCalendar: '' as IntlString + }, + space: { + } +}) diff --git a/models/calendar/tsconfig.json b/models/calendar/tsconfig.json new file mode 100644 index 0000000000..1d60db76b4 --- /dev/null +++ b/models/calendar/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/models/core/src/component.ts b/models/core/src/component.ts index b83cffc614..e07a36310d 100644 --- a/models/core/src/component.ts +++ b/models/core/src/component.ts @@ -25,6 +25,7 @@ export default mergeIds(coreId, core, { Name: '' as IntlString, Description: '' as IntlString, Private: '' as IntlString, - Archived: '' as IntlString + Archived: '' as IntlString, + ClassLabel: '' as IntlString } }) diff --git a/models/core/src/core.ts b/models/core/src/core.ts index 5b66ce0b2e..f601d9da55 100644 --- a/models/core/src/core.ts +++ b/models/core/src/core.ts @@ -24,7 +24,7 @@ import { Timestamp, Type, Version } from '@anticrm/core' -import { Index, Model, Prop, TypeRef, TypeString, TypeTimestamp } from '@anticrm/model' +import { Index, Model, Prop, TypeIntlString, TypeRef, TypeString, TypeTimestamp } from '@anticrm/model' import type { IntlString } from '@anticrm/platform' import core from './component' @@ -70,7 +70,10 @@ export class TAttachedDoc extends TDoc implements AttachedDoc { @Model(core.class.Class, core.class.Doc, DOMAIN_MODEL) export class TClass extends TDoc implements Class { kind!: ClassifierKind + + @Prop(TypeIntlString(), core.string.ClassLabel) label!: IntlString + extends!: Ref> domain!: Domain } @@ -101,6 +104,9 @@ export class TType extends TObj implements Type { @Model(core.class.TypeString, core.class.Type) export class TTypeString extends TType {} +@Model(core.class.TypeIntlString, core.class.Type) +export class TTypeIntlString extends TType {} + @Model(core.class.TypeNumber, core.class.Type) export class TTypeNumber extends TType {} diff --git a/models/core/src/index.ts b/models/core/src/index.ts index d5861549e2..d38ce30264 100644 --- a/models/core/src/index.ts +++ b/models/core/src/index.ts @@ -28,7 +28,7 @@ import { TRefTo, TType, TTypeBoolean, - TTypeDate, TTypeMarkup, TTypeNumber, TTypeString, TTypeTimestamp, + TTypeDate, TTypeIntlString, TTypeMarkup, TTypeNumber, TTypeString, TTypeTimestamp, TVersion } from './core' import { TAccount, TSpace } from './security' @@ -80,6 +80,7 @@ export function createModel (builder: Builder): void { TTypeDate, TArrOf, TVersion, - TTypeNumber + TTypeNumber, + TTypeIntlString ) } diff --git a/models/recruit/package.json b/models/recruit/package.json index c65ad5a36c..252e6ff028 100644 --- a/models/recruit/package.json +++ b/models/recruit/package.json @@ -44,6 +44,7 @@ "@anticrm/model-task": "~0.6.0", "@anticrm/workbench": "~0.6.1", "@anticrm/model-presentation": "~0.6.0", + "@anticrm/model-calendar": "~0.6.0", "@anticrm/model-tags": "~0.6.0", "@anticrm/skillset": "^0.6.0" } diff --git a/models/recruit/src/index.ts b/models/recruit/src/index.ts index 771590b13c..1c24d07647 100644 --- a/models/recruit/src/index.ts +++ b/models/recruit/src/index.ts @@ -303,6 +303,10 @@ export function createModel (builder: Builder): void { presenter: recruit.component.VacancyPresenter }) + builder.mixin(recruit.class.ReviewCategory, core.class.Class, view.mixin.AttributePresenter, { + presenter: recruit.component.ReviewCategoryPresenter + }) + builder.mixin(recruit.class.Applicant, core.class.Class, view.mixin.ObjectValidator, { validator: recruit.validator.ApplicantValidator }) @@ -366,6 +370,14 @@ export function createModel (builder: Builder): void { } }) + builder.createDoc(view.class.ActionTarget, core.space.Model, { + target: recruit.class.ReviewCategory, + action: task.action.UnarchiveSpace, + query: { + archived: true + } + }) + builder.createDoc( view.class.Action, core.space.Model, diff --git a/models/recruit/src/migration.ts b/models/recruit/src/migration.ts index d61bf47478..9e346bbb49 100644 --- a/models/recruit/src/migration.ts +++ b/models/recruit/src/migration.ts @@ -17,6 +17,7 @@ import { Person } from '@anticrm/contact' import core, { AttachedDoc, Class, Doc, DocumentQuery, DOMAIN_TX, MixinData, Ref, TxCollectionCUD, TxCreateDoc, TxMixin, TxOperations, TxUpdateDoc } from '@anticrm/core' import { createOrUpdate, MigrateOperation, MigrationClient, MigrationUpgradeClient } from '@anticrm/model' import { DOMAIN_ATTACHMENT } from '@anticrm/model-attachment' +import { DOMAIN_CALENDAR } from '@anticrm/model-calendar' import { DOMAIN_COMMENT } from '@anticrm/model-chunter' import contact, { DOMAIN_CONTACT } from '@anticrm/model-contact' import tags, { DOMAIN_TAGS, TagCategory, TagElement } from '@anticrm/model-tags' @@ -157,6 +158,25 @@ export const recruitOperation: MigrateOperation = { }) } } + + // Migrate reviews + + await client.update(DOMAIN_TASK, { + _class: recruit.class.Review + }, { + $rename: { + startDate: 'date' + } + }) + + await client.update(DOMAIN_TASK, { + _class: recruit.class.Review, + title: { $exists: false } + }, { + title: '' + }) + + await client.move(DOMAIN_TASK, { _class: recruit.class.Review }, DOMAIN_CALENDAR) }, async upgrade (client: MigrationUpgradeClient): Promise { const tx = new TxOperations(client, core.account.System) diff --git a/models/recruit/src/plugin.ts b/models/recruit/src/plugin.ts index 43cb7e16b3..ca97d047a2 100644 --- a/models/recruit/src/plugin.ts +++ b/models/recruit/src/plugin.ts @@ -61,6 +61,7 @@ export default mergeIds(recruitId, recruit, { ApplicationPresenter: '' as AnyComponent, ApplicationsPresenter: '' as AnyComponent, VacancyPresenter: '' as AnyComponent, + ReviewCategoryPresenter: '' as AnyComponent, EditApplication: '' as AnyComponent, TemplatesIcon: '' as AnyComponent, Applications: '' as AnyComponent, diff --git a/models/recruit/src/review-model.ts b/models/recruit/src/review-model.ts index 13d77c7bc2..480be11083 100644 --- a/models/recruit/src/review-model.ts +++ b/models/recruit/src/review-model.ts @@ -1,67 +1,38 @@ -import { Employee, Organization } from '@anticrm/contact' -import { Domain, IndexKind, Ref, Timestamp } from '@anticrm/core' -import { Collection, Index, Model, Prop, TypeDate, TypeMarkup, TypeRef, TypeString, UX } from '@anticrm/model' +import { Organization } from '@anticrm/contact' +import { Domain, IndexKind, Ref } from '@anticrm/core' +import { Collection, Index, Model, Prop, TypeMarkup, TypeRef, TypeString, UX } from '@anticrm/model' import attachment from '@anticrm/model-attachment' +import calendar, { TEvent } from '@anticrm/model-calendar' import chunter from '@anticrm/model-chunter' import contact from '@anticrm/model-contact' -import core, { TAttachedDoc } from '@anticrm/model-core' -import task, { TSpaceWithStates, TTask } from '@anticrm/model-task' +import core, { TAttachedDoc, TSpace } from '@anticrm/model-core' +import task from '@anticrm/model-task' import { Candidate, Opinion, Review, ReviewCategory } from '@anticrm/recruit' import recruit from './plugin' -@Model(recruit.class.ReviewCategory, task.class.SpaceWithStates) +@Model(recruit.class.ReviewCategory, core.class.Space) @UX(recruit.string.ReviewCategory, recruit.icon.Review) -export class TReviewCategory extends TSpaceWithStates implements ReviewCategory { +export class TReviewCategory extends TSpace implements ReviewCategory { @Prop(TypeString(), recruit.string.FullDescription) fullDescription?: string +} + +@Model(recruit.class.Review, calendar.class.Event) +@UX(recruit.string.Review, recruit.icon.Review, recruit.string.ReviewShortLabel, 'number') +export class TReview extends TEvent implements Review { + // We need to declare, to provide property with label + @Prop(TypeRef(recruit.mixin.Candidate), recruit.string.Candidate) + declare attachedTo: Ref + + @Prop(TypeString(), recruit.string.Verdict) + @Index(IndexKind.FullText) + verdict!: string @Prop(TypeRef(contact.class.Organization), recruit.string.Company, contact.icon.Company) company?: Ref -} - -@Model(recruit.class.Review, task.class.Task) -@UX(recruit.string.Review, recruit.icon.Review, recruit.string.ReviewShortLabel, 'number') -export class TReview extends TTask implements Review { - // We need to declare, to provide property with label - @Prop(TypeRef(recruit.class.Applicant), recruit.string.Candidate) - declare attachedTo: Ref - - @Prop(TypeRef(contact.class.Employee), recruit.string.AssignedRecruiter) - declare assignee: Ref | null - - @Prop(TypeMarkup(), recruit.string.Description) - @Index(IndexKind.FullText) - description!: string - - @Index(IndexKind.FullText) - @Prop(TypeMarkup(), recruit.string.Verdict) - verdict!: string - - @Index(IndexKind.FullText) - @Prop(TypeString(), recruit.string.Location, recruit.icon.Location) - location?: string - - @Index(IndexKind.FullText) - @Prop(TypeString(), recruit.string.Company, contact.icon.Company) - company?: string - - @Prop(TypeDate(), recruit.string.StartDate) - startDate!: Timestamp | null - - @Prop(TypeDate(), recruit.string.DueDate) - dueDate!: Timestamp | null @Prop(Collection(recruit.class.Opinion), recruit.string.Opinions) opinions?: number - - @Prop(Collection(attachment.class.Attachment), attachment.string.Attachments) - attachments?: number - - @Prop(Collection(chunter.class.Comment), chunter.string.Comments) - comments?: number - - @Prop(Collection(contact.class.Employee), recruit.string.Participants) - participants!: Ref[] } @Model(recruit.class.Opinion, core.class.AttachedDoc, 'recruit' as Domain) diff --git a/models/recruit/src/review.ts b/models/recruit/src/review.ts index 08c3f47104..bd6c19d1b8 100644 --- a/models/recruit/src/review.ts +++ b/models/recruit/src/review.ts @@ -6,6 +6,7 @@ import task from '@anticrm/model-task' import view from '@anticrm/model-view' import workbench from '@anticrm/model-workbench' import recruit from './plugin' +import calendar from '@anticrm/model-calendar' export function createReviewModel (builder: Builder): void { builder.mixin(recruit.class.ReviewCategory, core.class.Class, workbench.mixin.SpaceView, { @@ -21,11 +22,21 @@ export function createReviewModel (builder: Builder): void { }) createTableViewlet(builder) - createKanbanViewlet(builder) - createStatusTableViewlet(builder) - builder.mixin(recruit.class.Review, core.class.Class, task.mixin.KanbanCard, { - card: recruit.component.KanbanReviewCard + builder.createDoc( + view.class.Action, + core.space.Model, + { + label: recruit.string.CreateOpinion, + icon: recruit.icon.Create, + action: recruit.actionImpl.CreateOpinion + }, + recruit.action.CreateOpinion + ) + + builder.createDoc(view.class.ActionTarget, core.space.Model, { + target: recruit.class.Review, + action: recruit.action.CreateOpinion }) builder.mixin(recruit.class.Review, core.class.Class, view.mixin.ObjectEditor, { @@ -63,17 +74,6 @@ export function createReviewModel (builder: Builder): void { action: recruit.action.CreateReview }) - builder.createDoc( - task.class.KanbanTemplateSpace, - core.space.Model, - { - name: recruit.string.ReviewCategory, - description: task.string.ManageStatusesWithin, - icon: recruit.component.TemplatesIcon - }, - recruit.space.ReviewTemplates - ) - builder.createDoc(view.class.ActionTarget, core.space.Model, { target: recruit.class.ReviewCategory, action: task.action.ArchiveSpace, @@ -82,69 +82,6 @@ export function createReviewModel (builder: Builder): void { } }) } -function createStatusTableViewlet (builder: Builder): void { - builder.createDoc(view.class.Viewlet, core.space.Model, { - attachTo: recruit.class.Review, - descriptor: task.viewlet.StatusTable, - // eslint-disable-next-line @typescript-eslint/consistent-type-assertions - options: { - lookup: { - attachedTo: recruit.mixin.Candidate, - state: task.class.State, - assignee: contact.class.Employee, - doneState: task.class.DoneState, - participants: contact.class.Employee - } - } as FindOptions, - config: [ - '', - '$lookup.attachedTo', - { key: '$lookup.participants', presenter: recruit.component.PersonsPresenter, label: recruit.string.Participants, sortingKey: '$lookup.participants' }, - // 'location', - 'company', - 'dueDate', - { key: '', presenter: recruit.component.OpinionsPresenter, label: recruit.string.Opinions, sortingKey: 'opinions' }, - '$lookup.state', - '$lookup.doneState', - // { presenter: attachment.component.AttachmentsPresenter, label: attachment.string.Files, sortingKey: 'attachments' }, - // { presenter: chunter.component.CommentsPresenter, label: chunter.string.Comments, sortingKey: 'comments' }, - 'modifiedOn' - ] - }) - - builder.createDoc( - view.class.Action, - core.space.Model, - { - label: recruit.string.CreateOpinion, - icon: recruit.icon.Create, - action: recruit.actionImpl.CreateOpinion - }, - recruit.action.CreateOpinion - ) - - builder.createDoc(view.class.ActionTarget, core.space.Model, { - target: recruit.class.Review, - action: recruit.action.CreateOpinion - }) -} - -function createKanbanViewlet (builder: Builder): void { - builder.createDoc(view.class.Viewlet, core.space.Model, { - attachTo: recruit.class.Review, - descriptor: task.viewlet.Kanban, - // eslint-disable-next-line @typescript-eslint/consistent-type-assertions - options: { - lookup: { - attachedTo: recruit.mixin.Candidate, - state: task.class.State, - assignee: contact.class.Employee, - participants: contact.class.Employee - } - } as FindOptions, - config: ['$lookup.attachedTo', '$lookup.state', '$lookup.participants', '$lookup.assignee'] - }) -} function createTableViewlet (builder: Builder): void { builder.createDoc(view.class.Viewlet, core.space.Model, { @@ -154,22 +91,20 @@ function createTableViewlet (builder: Builder): void { options: { lookup: { attachedTo: recruit.mixin.Candidate, - state: task.class.State, - assignee: contact.class.Employee, - doneState: task.class.DoneState, - participants: contact.class.Employee + participants: contact.class.Employee, + company: contact.class.Organization } } as FindOptions, config: [ '', + 'title', '$lookup.attachedTo', - { key: '$lookup.participants', presenter: recruit.component.PersonsPresenter, label: recruit.string.Participants, sortingKey: '$lookup.participants' }, - // 'location', - 'company', - 'dueDate', + 'verdict', { key: '', presenter: recruit.component.OpinionsPresenter, label: recruit.string.Opinions, sortingKey: 'opinions' }, - '$lookup.state', - '$lookup.doneState', + { key: '$lookup.participants', presenter: calendar.component.PersonsPresenter, label: calendar.string.Participants, sortingKey: '$lookup.participants' }, + '$lookup.company', + 'date', + 'dueDate', // { presenter: attachment.component.AttachmentsPresenter, label: attachment.string.Files, sortingKey: 'attachments' }, // { presenter: chunter.component.CommentsPresenter, label: chunter.string.Comments, sortingKey: 'comments' }, 'modifiedOn' diff --git a/models/view/src/index.ts b/models/view/src/index.ts index ee70d9fcfc..a56a17928a 100644 --- a/models/view/src/index.ts +++ b/models/view/src/index.ts @@ -142,6 +142,10 @@ export function createModel (builder: Builder): void { presenter: view.component.StringPresenter }) + builder.mixin(core.class.TypeIntlString, core.class.Class, view.mixin.AttributePresenter, { + presenter: view.component.IntlStringPresenter + }) + builder.mixin(core.class.TypeNumber, core.class.Class, view.mixin.AttributeEditor, { editor: view.component.NumberEditor }) diff --git a/models/view/src/plugin.ts b/models/view/src/plugin.ts index 97e275fbfd..1636f971bb 100644 --- a/models/view/src/plugin.ts +++ b/models/view/src/plugin.ts @@ -31,6 +31,7 @@ export default mergeIds(viewId, view, { component: { StringEditor: '' as AnyComponent, StringPresenter: '' as AnyComponent, + IntlStringPresenter: '' as AnyComponent, NumberEditor: '' as AnyComponent, NumberPresenter: '' as AnyComponent, HTMLPresenter: '' as AnyComponent, diff --git a/packages/core/lang/en.json b/packages/core/lang/en.json index d3899cf1d1..01e9e4ea99 100644 --- a/packages/core/lang/en.json +++ b/packages/core/lang/en.json @@ -10,6 +10,7 @@ "Name": "Name", "Description": "Description", "Private": "Private", - "Archived": "Archived" + "Archived": "Archived", + "ClassLabel": "Label" } } diff --git a/packages/core/lang/ru.json b/packages/core/lang/ru.json index 3157196808..9c4ddfafad 100644 --- a/packages/core/lang/ru.json +++ b/packages/core/lang/ru.json @@ -10,6 +10,7 @@ "Name": "Название", "Description": "Описание", "Private": "Личный", - "Archived": "Архивный" + "Archived": "Архивный", + "ClassLabel": "Тип" } } \ No newline at end of file diff --git a/packages/core/src/classes.ts b/packages/core/src/classes.ts index 6c6801d3f3..0c6603e0fe 100644 --- a/packages/core/src/classes.ts +++ b/packages/core/src/classes.ts @@ -31,6 +31,11 @@ export type PrimitiveType = number | string | boolean | undefined | Ref */ export type Timestamp = number +/** + * @public + */ +export type Markup = string + /** * @public */ @@ -160,6 +165,15 @@ export type AttachedData = Omit // T Y P E S +/** + * @public + */ + +export interface TypeDate extends Type { + // If not set to true, will be false + withTime?: boolean +} + /** * @public */ diff --git a/packages/core/src/component.ts b/packages/core/src/component.ts index fa98292580..e1877f194a 100644 --- a/packages/core/src/component.ts +++ b/packages/core/src/component.ts @@ -44,6 +44,7 @@ export default plugin(coreId, { Space: '' as Ref>, Account: '' as Ref>, TypeString: '' as Ref>>, + TypeIntlString: '' as Ref>>, TypeNumber: '' as Ref>>, TypeMarkup: '' as Ref>>, TypeBoolean: '' as Ref>>, diff --git a/packages/model/src/dsl.ts b/packages/model/src/dsl.ts index 3e076a9eac..f7ee2be182 100644 --- a/packages/model/src/dsl.ts +++ b/packages/model/src/dsl.ts @@ -14,7 +14,7 @@ // import core, { - Account, ArrOf as TypeArrOf, AttachedDoc, Attribute, Class, Classifier, ClassifierKind, Collection as TypeCollection, Data, Doc, Domain, generateId, IndexKind, Interface, Mixin as IMixin, MixinUpdate, Obj, PropertyType, Ref, RefTo, Space, Tx, TxCreateDoc, TxFactory, TxProcessor, Type + Account, ArrOf as TypeArrOf, AttachedDoc, Attribute, Class, Classifier, ClassifierKind, Collection as TypeCollection, Data, Doc, Domain, generateId, IndexKind, Interface, Markup, Mixin as IMixin, MixinUpdate, Obj, PropertyType, Ref, RefTo, Space, Timestamp, Tx, TxCreateDoc, TxFactory, TxProcessor, Type, TypeDate as TypeDateType } from '@anticrm/core' import type { Asset, IntlString } from '@anticrm/platform' import toposort from 'toposort' @@ -331,36 +331,43 @@ export function TypeString (): Type { /** * @public */ -export function TypeNumber (): Type { +export function TypeNumber (): Type { return { _class: core.class.TypeNumber, label: 'TypeNumber' as IntlString } } /** * @public */ -export function TypeMarkup (): Type { +export function TypeMarkup (): Type { return { _class: core.class.TypeMarkup, label: 'TypeMarkup' as IntlString } } /** * @public */ -export function TypeBoolean (): Type { +export function TypeIntlString (): Type { + return { _class: core.class.TypeIntlString, label: 'TypeIntlString' as IntlString } +} + +/** + * @public + */ +export function TypeBoolean (): Type { return { _class: core.class.TypeBoolean, label: 'TypeBoolean' as IntlString } } /** * @public */ -export function TypeTimestamp (): Type { +export function TypeTimestamp (): Type { return { _class: core.class.TypeTimestamp, label: 'TypeTimestamp' as IntlString } } /** * @public */ -export function TypeDate (): Type { - return { _class: core.class.TypeDate, label: 'TypeDate' as IntlString } +export function TypeDate (withTime?: boolean): TypeDateType { + return { _class: core.class.TypeDate, label: 'TypeDate' as IntlString, withTime } } /** diff --git a/packages/presentation/src/components/AttributeBarEditor.svelte b/packages/presentation/src/components/AttributeBarEditor.svelte index b5f558b19d..c3a2e9a99f 100644 --- a/packages/presentation/src/components/AttributeBarEditor.svelte +++ b/packages/presentation/src/components/AttributeBarEditor.svelte @@ -76,6 +76,7 @@ placeholder={attribute?.label} {maxWidth} value={getAttribute(client, object, { key: attributeKey, attr: attribute })} + attributeType={attribute.type} space={object.space} {onChange} {focus} @@ -94,6 +95,7 @@ placeholder={attribute?.label} {maxWidth} value={getAttribute(client, object, { key: attributeKey, attr: attribute })} + attributeType={attribute.type} space={object.space} {onChange} {focus} @@ -105,6 +107,7 @@ this={instance} {maxWidth} value={getAttribute(client, object, { key: attributeKey, attr: attribute })} + attributeType={attribute.type} space={object.space} {onChange} {focus} diff --git a/packages/presentation/src/components/Card.svelte b/packages/presentation/src/components/Card.svelte index 676f724caf..75de843e88 100644 --- a/packages/presentation/src/components/Card.svelte +++ b/packages/presentation/src/components/Card.svelte @@ -33,6 +33,7 @@ export let labelProps: any | undefined = undefined export let okAction: () => void export let canSave: boolean = false + export let size: 'small'| 'medium' = 'small' export let okLabel: IntlString = presentation.string.Create export let cancelLabel: IntlString = presentation.string.Cancel @@ -40,7 +41,7 @@ const dispatch = createEventDispatcher() -
{} }> + {} }>
{#if $$slots.error} diff --git a/packages/presentation/src/components/UserBox.svelte b/packages/presentation/src/components/UserBox.svelte index c70ec8e34a..ff4ca1c754 100644 --- a/packages/presentation/src/components/UserBox.svelte +++ b/packages/presentation/src/components/UserBox.svelte @@ -35,6 +35,7 @@ export let show: boolean = false export let allowDeselect = false export let titleDeselect: IntlString | undefined = undefined + export let readonly = false const dispatch = createEventDispatcher() @@ -69,7 +70,7 @@
{ btn.focus() - if (!opened) { + if (!opened && !readonly) { opened = true showPopup(UsersPopup, { _class, title, caption, allowDeselect, selected: value, titleDeselect }, container, (result) => { if (result === null) { diff --git a/packages/presentation/src/components/UserBoxList.svelte b/packages/presentation/src/components/UserBoxList.svelte index 382e453109..c228d0c414 100644 --- a/packages/presentation/src/components/UserBoxList.svelte +++ b/packages/presentation/src/components/UserBoxList.svelte @@ -78,7 +78,7 @@
{/if} {#each persons as person} -
+
removePerson(person)} /> @@ -104,4 +104,7 @@ display: flex; flex-wrap: wrap; } + .margin_025 { + margin: 0.25rem; + } diff --git a/packages/text-editor/src/components/StyledTextBox.svelte b/packages/text-editor/src/components/StyledTextBox.svelte index bd451b66b4..0120e56043 100644 --- a/packages/text-editor/src/components/StyledTextBox.svelte +++ b/packages/text-editor/src/components/StyledTextBox.svelte @@ -1,13 +1,19 @@ -
- {#if mode !== Mode.View} +
{ + if (alwaysEdit && focused) { + textEditor?.focus() + } +}}> + {#if label} +
+ {/if} + {#if mode !== Mode.View || alwaysEdit} { + focused = true + }} + on:blur={() => { + focused = false + }} on:value={(evt) => { rawValue = evt.detail }} > + {#if !alwaysEdit}
@@ -59,6 +88,7 @@ }} />
+ {/if} {:else}
@@ -66,28 +96,58 @@ {/if}
-
- { - rawValue = content ?? '' - mode = Mode.Edit - }} - /> -
+ {#if !alwaysEdit} +
+ { + rawValue = content ?? '' + needFocus = true + mode = Mode.Edit + }} + /> +
+ {/if} {/if}
diff --git a/packages/text-editor/src/components/StyledTextEditor.svelte b/packages/text-editor/src/components/StyledTextEditor.svelte index 0fb6564660..a34d7ac44f 100644 --- a/packages/text-editor/src/components/StyledTextEditor.svelte +++ b/packages/text-editor/src/components/StyledTextEditor.svelte @@ -27,12 +27,16 @@ export let content: string = '' export let placeholder: IntlString = textEditorPlugin.string.EditorPlaceholder + export let showButtons = true let textEditor: TextEditor export function submit (): void { textEditor.submit() } + export function focus (): void { + textEditor.focus() + }
@@ -50,28 +54,37 @@ textEditor.clear() }} on:blur + on:focus supportSubmit={false} />
-
+
-
-
+
+
- \ No newline at end of file diff --git a/plugins/calendar-resources/src/index.ts b/plugins/calendar-resources/src/index.ts new file mode 100644 index 0000000000..9445047994 --- /dev/null +++ b/plugins/calendar-resources/src/index.ts @@ -0,0 +1,24 @@ +// +// Copyright © 2020 Anticrm Platform Contributors. +// +// 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 { Resources } from '@anticrm/platform' + +import PersonsPresenter from './components/PersonsPresenter.svelte' + +export default async (): Promise => ({ + component: { + PersonsPresenter + } +}) diff --git a/plugins/calendar-resources/src/plugin.ts b/plugins/calendar-resources/src/plugin.ts new file mode 100644 index 0000000000..d3a2ab7a18 --- /dev/null +++ b/plugins/calendar-resources/src/plugin.ts @@ -0,0 +1,24 @@ +// +// Copyright © 2020 Anticrm Platform Contributors. +// +// 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 calendar, { calendarId } from '@anticrm/calendar' +import { mergeIds } from '@anticrm/platform' + +export default mergeIds(calendarId, calendar, { + component: { + }, + string: { + } +}) diff --git a/plugins/calendar-resources/svelte.config.js b/plugins/calendar-resources/svelte.config.js new file mode 100644 index 0000000000..944a06f73e --- /dev/null +++ b/plugins/calendar-resources/svelte.config.js @@ -0,0 +1,5 @@ +const sveltePreprocess = require('svelte-preprocess') + +module.exports = { + preprocess: sveltePreprocess() +}; \ No newline at end of file diff --git a/plugins/calendar-resources/tsconfig.json b/plugins/calendar-resources/tsconfig.json new file mode 100644 index 0000000000..cabe5aefad --- /dev/null +++ b/plugins/calendar-resources/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "moduleResolution": "node", + "target": "esnext", + "module": "esnext", + "declaration": true, + "outDir": "./lib", + "strict": true, + "esModuleInterop": true, + "lib": [ + "esnext", + "dom" + ] + } +} \ No newline at end of file diff --git a/plugins/calendar/.eslintrc.js b/plugins/calendar/.eslintrc.js new file mode 100644 index 0000000000..5da5872d4a --- /dev/null +++ b/plugins/calendar/.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/plugins/calendar/.npmignore b/plugins/calendar/.npmignore new file mode 100644 index 0000000000..e3ec093c38 --- /dev/null +++ b/plugins/calendar/.npmignore @@ -0,0 +1,4 @@ +* +!/lib/** +!CHANGELOG.md +/lib/**/__tests__/ diff --git a/plugins/calendar/config/rig.json b/plugins/calendar/config/rig.json new file mode 100644 index 0000000000..af1257a896 --- /dev/null +++ b/plugins/calendar/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/plugins/calendar/package.json b/plugins/calendar/package.json new file mode 100644 index 0000000000..45d625e56f --- /dev/null +++ b/plugins/calendar/package.json @@ -0,0 +1,34 @@ +{ + "name": "@anticrm/calendar", + "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.4.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.41.1", + "typescript": "^4.3.5" + }, + "dependencies": { + "@anticrm/platform": "~0.6.5", + "@anticrm/ui": "~0.6.0", + "@anticrm/core": "~0.6.11", + "@anticrm/contact": "~0.6.5" + } +} diff --git a/plugins/calendar/src/index.ts b/plugins/calendar/src/index.ts new file mode 100644 index 0000000000..acaec40e3e --- /dev/null +++ b/plugins/calendar/src/index.ts @@ -0,0 +1,90 @@ +// 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 { Employee } from '@anticrm/contact' +import type { AttachedDoc, Class, Doc, Markup, Ref, Space, Timestamp } from '@anticrm/core' +import type { Asset, IntlString, Plugin } from '@anticrm/platform' +import { plugin } from '@anticrm/platform' +import { AnyComponent } from '@anticrm/ui' + +/** + * @public + */ +export interface Calendar extends Space {} + +/** + * @public + */ +export interface Event extends AttachedDoc { + title: string + number: number + description: Markup + + location?: string + + // Event scheduled date + date: Timestamp + + // Event due date for long events. + dueDate?: Timestamp + + attachments?: number + comments?: number + + participants?: Ref[] +} + +/** + * @public + */ +export const calendarId = 'calendar' as Plugin + +/** + * @public + */ +const calendarPlugin = plugin(calendarId, { + class: { + Calendar: '' as Ref>, + Event: '' as Ref> + }, + icon: { + Calendar: '' as Asset, + Location: '' as Asset + }, + space: { + // Space for all personal events. + PersonalEvents: '' as Ref + }, + app: { + Calendar: '' as Ref + }, + component: { + PersonsPresenter: '' as AnyComponent + }, + string: { + Title: '' as IntlString, + Calendar: '' as IntlString, + Description: '' as IntlString, + Date: '' as IntlString, + DueTo: '' as IntlString, + Calendars: '' as IntlString, + CreateCalendar: '' as IntlString, + Location: '' as IntlString, + Participants: '' as IntlString, + NoParticipants: '' as IntlString, + PersonsLabel: '' as IntlString, + EventNumber: '' as IntlString + } +}) + +export default calendarPlugin diff --git a/plugins/calendar/tsconfig.json b/plugins/calendar/tsconfig.json new file mode 100644 index 0000000000..32045300ce --- /dev/null +++ b/plugins/calendar/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "./node_modules/@anticrm/platform-rig/profiles/default/tsconfig.json", + + "compilerOptions": { + "rootDir": "./src", + "outDir": "./lib", + "lib": ["esnext", "dom"] + } +} \ No newline at end of file diff --git a/plugins/contact-resources/src/components/OrganizationSelector.svelte b/plugins/contact-resources/src/components/OrganizationSelector.svelte index f5e9d2d9e0..80a1063cd7 100644 --- a/plugins/contact-resources/src/components/OrganizationSelector.svelte +++ b/plugins/contact-resources/src/components/OrganizationSelector.svelte @@ -20,6 +20,7 @@ import { createQuery } from '@anticrm/presentation' import { Dropdown } from '@anticrm/ui' import { ListItem } from '@anticrm/ui/src/types' + import { createEventDispatcher } from 'svelte' import contact from '../plugin' import Company from './icons/Company.svelte' @@ -27,6 +28,7 @@ export let label: IntlString = contact.string.Organization const query = createQuery() + const dispatch = createEventDispatcher() query.query(contact.class.Organization, {}, (res) => { items = res.map((org) => { @@ -52,6 +54,7 @@ } else { value = selected._id as Ref } + dispatch('change', value) } diff --git a/plugins/recruit-assets/lang/en.json b/plugins/recruit-assets/lang/en.json index f6bb603c66..3145073d95 100644 --- a/plugins/recruit-assets/lang/en.json +++ b/plugins/recruit-assets/lang/en.json @@ -62,7 +62,7 @@ "ReviewCategory": "Reviews", "ReviewCategoryDescription": "Description", "ThisReviewCategoryIsPrivate": "This category is private", - "CreateReview": "Create review", + "CreateReview": "Schedule {label}", "SelectReviewCategory": "select category", "Reviews": "Reviews", "Review": "Review", @@ -84,7 +84,8 @@ "OpinionValuePlaceholder": "10/10", "Participants": "Participants", "NoParticipants": "No participants added", - "PersonsLabel": "{name}" + "PersonsLabel": "{name}", + "AddDescription": "Add description" }, "status": { "CandidateRequired": "Please select candidate", diff --git a/plugins/recruit-assets/lang/ru.json b/plugins/recruit-assets/lang/ru.json index 5d83fbaf1a..779850b745 100644 --- a/plugins/recruit-assets/lang/ru.json +++ b/plugins/recruit-assets/lang/ru.json @@ -63,7 +63,7 @@ "ReviewCategory": "Оценки", "ReviewCategoryDescription": "Описание", "ThisReviewCategoryIsPrivate": "Эта категория личная", - "CreateReview": "Запланировать оценку", + "CreateReview": "Запланировать {label}", "SelectReviewCategory": "выбрать категорию", "Reviews": "Оценки", "Review": "Оценка", @@ -85,7 +85,8 @@ "OpinionValuePlaceholder": "10/10", "Participants": "Участники", "NoParticipants": "Участники не добавлены", - "PersonsLabel": "{name}" + "PersonsLabel": "{name}", + "AddDescription": "Add description" }, "status": { "CandidateRequired": "Пожалуйста выберите кандидата", diff --git a/plugins/recruit-resources/package.json b/plugins/recruit-resources/package.json index a256b9d71f..e15a796c8b 100644 --- a/plugins/recruit-resources/package.json +++ b/plugins/recruit-resources/package.json @@ -55,6 +55,7 @@ "@anticrm/contact-resources": "~0.6.0", "@anticrm/rekoni": "~0.6.0", "@anticrm/notification": "~0.6.0", - "@anticrm/tags": "~0.6.0" + "@anticrm/tags": "~0.6.0", + "@anticrm/calendar": "~0.6.0" } } diff --git a/plugins/recruit-resources/src/components/review/CreateReview.svelte b/plugins/recruit-resources/src/components/review/CreateReview.svelte index 22fdaf2b81..f69fba441f 100644 --- a/plugins/recruit-resources/src/components/review/CreateReview.svelte +++ b/plugins/recruit-resources/src/components/review/CreateReview.svelte @@ -13,36 +13,36 @@ // limitations under the License. --> 0} spaceClass={recruit.class.ReviewCategory} spaceQuery={{ archived: false }} spaceLabel={recruit.string.ReviewCategory} @@ -143,19 +151,38 @@ }} > + - {#if !preserveCandidate} - - {/if} - + + {#if !preserveCandidate} +
+ +
+ {/if} +
+ - - + + + + +
+ +
+
+ +
diff --git a/plugins/recruit-resources/src/components/review/CreateReviewCategory.svelte b/plugins/recruit-resources/src/components/review/CreateReviewCategory.svelte index 2995fdfa52..79cc0050b1 100644 --- a/plugins/recruit-resources/src/components/review/CreateReviewCategory.svelte +++ b/plugins/recruit-resources/src/components/review/CreateReviewCategory.svelte @@ -14,44 +14,32 @@ --> @@ -63,13 +51,5 @@ > - - - { - templateId = evt.detail - }}/> diff --git a/plugins/recruit-resources/src/components/review/EditReview.svelte b/plugins/recruit-resources/src/components/review/EditReview.svelte index 5e4858f07a..ddc3dbf89a 100644 --- a/plugins/recruit-resources/src/components/review/EditReview.svelte +++ b/plugins/recruit-resources/src/components/review/EditReview.svelte @@ -14,117 +14,111 @@ // limitations under the License. --> -{#if object !== undefined && candidate !== undefined} -
-
-
-
-
- -
- - client.update(object, { company: object.company })} +{#if object !== undefined} +
+
+ + client.update(object, { title: object.title })} + /> +
{ + if (candidate !== undefined) { + showPanel(view.component.EditDoc, candidate._id, candidate._class, 'full') + } + }}> + +
+
+
+
+ { + console.log(evt.detail) + client.update(object, { description: evt.detail }) + }} /> - + + + client.update(object, { location: object.location })} /> +
+ client.update(object, { company: object.company })} + /> +
-
{ client.update(object, { $push: { participants: evt.detail._id } }) }} on:delete={(evt) => { client.update(object, { $pull: { participants: evt.detail._id } }) }} - noItems={recruit.string.NoParticipants} + noItems={calendar.string.NoParticipants} />
-
-
-
- { - console.log(evt.detail) - client.update(object, { description: evt.detail }) - }} - /> -
- -
-
-
- { - client.update(object, { verdict: evt.detail }) - }} - /> -
+ client.update(object, { verdict: object.verdict })} + /> {/if} diff --git a/plugins/recruit-resources/src/components/review/KanbanReviewCard.svelte b/plugins/recruit-resources/src/components/review/KanbanReviewCard.svelte deleted file mode 100644 index f656c8f290..0000000000 --- a/plugins/recruit-resources/src/components/review/KanbanReviewCard.svelte +++ /dev/null @@ -1,90 +0,0 @@ - - - -
-
- -
-
- {#if object.$lookup?.attachedTo} - {formatName(object.$lookup?.attachedTo?.name)} - {/if} -
-
{object.$lookup?.attachedTo?.title ?? ''}
-
-
-
-
-
-
- -
- {#if (object.attachments ?? 0) > 0} -
- {/if} - {#if (object.comments ?? 0) > 0} -
- {/if} -
- {#if object.$lookup?.participants || object.$lookup?.assignee} - - {/if} -
-
- - diff --git a/plugins/recruit-resources/src/components/review/ReviewCategoryPresenter.svelte b/plugins/recruit-resources/src/components/review/ReviewCategoryPresenter.svelte new file mode 100644 index 0000000000..79e046fed0 --- /dev/null +++ b/plugins/recruit-resources/src/components/review/ReviewCategoryPresenter.svelte @@ -0,0 +1,37 @@ + + + +{#if value} +
+
+ +
+ {value.name} +
+{/if} diff --git a/plugins/recruit-resources/src/components/review/ReviewPresenter.svelte b/plugins/recruit-resources/src/components/review/ReviewPresenter.svelte index 0c31560f23..f36ef862b2 100644 --- a/plugins/recruit-resources/src/components/review/ReviewPresenter.svelte +++ b/plugins/recruit-resources/src/components/review/ReviewPresenter.svelte @@ -37,7 +37,7 @@ function show () { closeTooltip() - showPanel(view.component.EditDoc, value._id, value._class, 'full') + showPanel(view.component.EditDoc, value._id, value._class, 'right') } diff --git a/plugins/recruit-resources/src/components/review/Reviews.svelte b/plugins/recruit-resources/src/components/review/Reviews.svelte index 31907f8f17..9719883cfe 100644 --- a/plugins/recruit-resources/src/components/review/Reviews.svelte +++ b/plugins/recruit-resources/src/components/review/Reviews.svelte @@ -43,21 +43,19 @@ config={[ '', { key: '$lookup.space.name', label: recruit.string.ReviewCategoryTitle }, - 'dueDate', + 'verdict', { key: '', presenter: recruit.component.OpinionsPresenter, label: recruit.string.Opinions, sortingKey: 'opinions' }, - '$lookup.state', - '$lookup.doneState' + 'date', + 'dueDate' ]} options={{ lookup: { - state: task.class.State, - space: core.class.Space, - doneState: task.class.DoneState + space: core.class.Space } }} query={{ attachedTo: objectId }} diff --git a/plugins/recruit-resources/src/index.ts b/plugins/recruit-resources/src/index.ts index 57b5828eee..6b4e598862 100644 --- a/plugins/recruit-resources/src/index.ts +++ b/plugins/recruit-resources/src/index.ts @@ -35,7 +35,6 @@ import CreateOpinion from './components/review/CreateOpinion.svelte' import CreateReviewCategory from './components/review/CreateReviewCategory.svelte' import EditReview from './components/review/EditReview.svelte' import EditReviewCategory from './components/review/EditReviewCategory.svelte' -import KanbanReviewCard from './components/review/KanbanReviewCard.svelte' import OpinionPresenter from './components/review/OpinionPresenter.svelte' import OpinionsPresenter from './components/review/OpinionsPresenter.svelte' import Opinions from './components/review/Opinions.svelte' @@ -48,8 +47,8 @@ import VacancyItemPresenter from './components/VacancyItemPresenter.svelte' import VacancyPresenter from './components/VacancyPresenter.svelte' import VacancyCountPresenter from './components/VacancyCountPresenter.svelte' import VacancyModifiedPresenter from './components/VacancyModifiedPresenter.svelte' +import ReviewCategoryPresenter from './components/review/ReviewCategoryPresenter.svelte' import recruit from './plugin' -import PersonsPresenter from './components/review/PersonsPresenter.svelte' async function createApplication (object: Doc): Promise { showPopup(CreateApplication, { candidate: object._id, preserveCandidate: true }) @@ -163,12 +162,11 @@ export default async (): Promise => ({ CreateReview, ReviewPresenter, EditReview, - KanbanReviewCard, Reviews, Opinions, OpinionPresenter, OpinionsPresenter, - PersonsPresenter + ReviewCategoryPresenter }, completion: { ApplicationQuery: async (client: Client, query: string) => await queryApplication(client, query) diff --git a/plugins/recruit-resources/src/plugin.ts b/plugins/recruit-resources/src/plugin.ts index d0765b3b04..dea5f97b8f 100644 --- a/plugins/recruit-resources/src/plugin.ts +++ b/plugins/recruit-resources/src/plugin.ts @@ -101,9 +101,7 @@ export default mergeIds(recruitId, recruit, { StartDate: '' as IntlString, DueDate: '' as IntlString, CandidateReviews: '' as IntlString, - Participants: '' as IntlString, - NoParticipants: '' as IntlString, - PersonsLabel: '' as IntlString + AddDescription: '' as IntlString }, space: { CandidatesPublic: '' as Ref @@ -116,7 +114,6 @@ export default mergeIds(recruitId, recruit, { VacancyItemPresenter: '' as AnyComponent, VacancyCountPresenter: '' as AnyComponent, OpinionsPresenter: '' as AnyComponent, - PersonsPresenter: '' as AnyComponent, VacancyModifiedPresenter: '' as AnyComponent } }) diff --git a/plugins/recruit/package.json b/plugins/recruit/package.json index 7a14dc4d4c..6db3b70d29 100644 --- a/plugins/recruit/package.json +++ b/plugins/recruit/package.json @@ -31,6 +31,7 @@ "@anticrm/contact": "~0.6.5", "@anticrm/chunter": "~0.6.1", "@anticrm/task": "~0.6.0", + "@anticrm/calendar": "~0.6.0", "@anticrm/ui": "~0.6.0" } } diff --git a/plugins/recruit/src/index.ts b/plugins/recruit/src/index.ts index cfcc496ea1..f916bfd67d 100644 --- a/plugins/recruit/src/index.ts +++ b/plugins/recruit/src/index.ts @@ -13,7 +13,8 @@ // limitations under the License. // -import type { Employee, Organization, Person } from '@anticrm/contact' +import { Calendar, Event } from '@anticrm/calendar' +import type { Organization, Person } from '@anticrm/contact' import type { AttachedDoc, Class, Doc, Mixin, Ref, Space, Timestamp } from '@anticrm/core' import type { Asset, Plugin } from '@anticrm/platform' import { plugin } from '@anticrm/platform' @@ -34,10 +35,10 @@ export interface Vacancy extends SpaceWithStates { /** * @public */ -export interface ReviewCategory extends SpaceWithStates { +export interface ReviewCategory extends Calendar { fullDescription?: string attachments?: number - company?: Ref + comments?: number } /** @@ -70,22 +71,14 @@ export interface Applicant extends Task { /** * @public */ -export interface Review extends Task { +export interface Review extends Event { attachedTo: Ref - attachments?: number - comments?: number - description: string + verdict: string - location?: string - company?: string - - startDate: Timestamp | null - dueDate: Timestamp | null + company?: Ref opinions?: number - - participants?: Ref[] } /** diff --git a/plugins/view-resources/src/components/DateEditor.svelte b/plugins/view-resources/src/components/DateEditor.svelte index 157894b58a..b288a24773 100644 --- a/plugins/view-resources/src/components/DateEditor.svelte +++ b/plugins/view-resources/src/components/DateEditor.svelte @@ -15,6 +15,7 @@ -->
{#if date} - + {:else} No date {/if} diff --git a/plugins/view-resources/src/components/IntlStringPresenter.svelte b/plugins/view-resources/src/components/IntlStringPresenter.svelte new file mode 100644 index 0000000000..9e479e76eb --- /dev/null +++ b/plugins/view-resources/src/components/IntlStringPresenter.svelte @@ -0,0 +1,26 @@ + + + + + + diff --git a/plugins/view-resources/src/index.ts b/plugins/view-resources/src/index.ts index 038eff1773..01702ca96b 100644 --- a/plugins/view-resources/src/index.ts +++ b/plugins/view-resources/src/index.ts @@ -23,6 +23,7 @@ import DateEditor from './components/DateEditor.svelte' import DatePresenter from './components/DatePresenter.svelte' import StringEditor from './components/StringEditor.svelte' import StringPresenter from './components/StringPresenter.svelte' +import IntlStringPresenter from './components/IntlStringPresenter.svelte' import NumberEditor from './components/NumberEditor.svelte' import NumberPresenter from './components/NumberPresenter.svelte' import Table from './components/Table.svelte' @@ -80,6 +81,7 @@ export default async (): Promise => ({ RolePresenter, ObjectPresenter, EditDoc, - HTMLPresenter + HTMLPresenter, + IntlStringPresenter } }) diff --git a/plugins/view-resources/src/utils.ts b/plugins/view-resources/src/utils.ts index ba5c6a2a50..1fa838889d 100644 --- a/plugins/view-resources/src/utils.ts +++ b/plugins/view-resources/src/utils.ts @@ -98,12 +98,14 @@ async function getAttributePresenter ( const resultKey = preserveKey.sortingKey ?? preserveKey.key const sortingKey = attribute.type._class === core.class.ArrOf ? resultKey + '.length' : resultKey const presenter = await getResource(presenterMixin.presenter) + return { key: preserveKey.key, sortingKey, _class: attrClass, label: preserveKey.label ?? attribute.label, presenter, + props: { attributeType: attribute.type }, icon: presenterMixin.icon, attribute } @@ -215,7 +217,7 @@ export async function getActions ( export async function deleteObject (client: TxOperations, object: Doc): Promise { const hierarchy = client.getHierarchy() - const promises: Promise[] = [] + const promises: Array> = [] if (client.getHierarchy().isDerived(object._class, core.class.AttachedDoc)) { const adoc = object as AttachedDoc promises.push(client.removeCollection(object._class, object.space, adoc._id, adoc.attachedTo, adoc.attachedToClass, adoc.collection).catch(err => console.error(err))) @@ -261,7 +263,7 @@ function getParentClass (hierarchy: Hierarchy, _class: Ref>): Ref>, object: Doc): Ref>[] { +function getMixins (hierarchy: Hierarchy, _class: Ref>, object: Doc): Array>> { const parentClass = getParentClass(hierarchy, _class) const descendants = hierarchy.getDescendants(parentClass) return descendants.filter( diff --git a/plugins/workbench-resources/src/components/Archive.svelte b/plugins/workbench-resources/src/components/Archive.svelte index 2b6bbf7ef0..7977bb128f 100644 --- a/plugins/workbench-resources/src/components/Archive.svelte +++ b/plugins/workbench-resources/src/components/Archive.svelte @@ -65,8 +65,12 @@ {#if spaceSample !== undefined && model}