diff --git a/.vscode/launch.json b/.vscode/launch.json index 9f4cda608a..87af79d1b6 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -37,10 +37,10 @@ // "FULLTEXT_URL": "http://localhost:4700", "FULLTEXT_URL": "http://host.docker.internal:4702", // "MONGO_URL": "mongodb://localhost:27017", - // "DB_URL": "mongodb://localhost:27017", + "DB_URL": "mongodb://localhost:27017", // "DB_URL": "postgresql://postgres:example@localhost:5432", - "DB_URL": "postgresql://root@host.docker.internal:26257/defaultdb?sslmode=disable", - "SERVER_PORT": "3332", + // "DB_URL": "postgresql://root@host.docker.internal:26257/defaultdb?sslmode=disable", + "SERVER_PORT": "3333", "APM_SERVER_URL2": "http://localhost:8200", "METRICS_CONSOLE": "false", "METRICS_FILE": "${workspaceRoot}/metrics.txt", // Show metrics in console evert 30 seconds., diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 98600b1128..0587374723 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -145,6 +145,15 @@ importers: '@rush-temp/calendar-resources': specifier: file:./projects/calendar-resources.tgz version: file:projects/calendar-resources.tgz(@babel/core@7.23.9)(@jest/types@29.6.3)(@types/node@20.11.19)(babel-jest@29.7.0(@babel/core@7.23.9))(esbuild@0.24.2)(postcss-load-config@4.0.2(postcss@8.4.35)(ts-node@10.9.2(@types/node@20.11.19)(typescript@5.3.3)))(postcss@8.4.35)(ts-node@10.9.2(@types/node@20.11.19)(typescript@5.3.3)) + '@rush-temp/card': + specifier: file:./projects/card.tgz + version: file:projects/card.tgz(@babel/core@7.23.9)(@jest/types@29.6.3)(@types/node@20.11.19)(babel-jest@29.7.0(@babel/core@7.23.9))(esbuild@0.24.2)(ts-node@10.9.2(@types/node@20.11.19)(typescript@5.3.3)) + '@rush-temp/card-assets': + specifier: file:./projects/card-assets.tgz + version: file:projects/card-assets.tgz(@babel/core@7.23.9)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.23.9))(esbuild@0.24.2)(ts-node@10.9.2(@types/node@20.11.19)(typescript@5.3.3)) + '@rush-temp/card-resources': + specifier: file:./projects/card-resources.tgz + version: file:projects/card-resources.tgz(@babel/core@7.23.9)(@jest/types@29.6.3)(@tiptap/pm@2.6.6)(@types/node@20.11.19)(babel-jest@29.7.0(@babel/core@7.23.9))(esbuild@0.24.2)(postcss-load-config@4.0.2(postcss@8.4.35)(ts-node@10.9.2(@types/node@20.11.19)(typescript@5.3.3)))(postcss@8.4.35)(ts-node@10.9.2(@types/node@20.11.19)(typescript@5.3.3)) '@rush-temp/chunter': specifier: file:./projects/chunter.tgz version: file:projects/chunter.tgz(@babel/core@7.23.9)(@jest/types@29.6.3)(@types/node@20.11.19)(babel-jest@29.7.0(@babel/core@7.23.9))(esbuild@0.24.2)(ts-node@10.9.2(@types/node@20.11.19)(typescript@5.3.3)) @@ -376,6 +385,9 @@ importers: '@rush-temp/model-calendar': specifier: file:./projects/model-calendar.tgz version: file:projects/model-calendar.tgz + '@rush-temp/model-card': + specifier: file:./projects/model-card.tgz + version: file:projects/model-card.tgz '@rush-temp/model-chunter': specifier: file:./projects/model-chunter.tgz version: file:projects/model-chunter.tgz @@ -3914,6 +3926,18 @@ packages: resolution: {integrity: sha512-SdjbhSZZy0608AVlNpqeBxStVEI/oCMnOW/aYR1fylUPDNejsQc/+VdgdU4NuwI9oNMvN9WFmSBDoFBTTNMZ0g==, tarball: file:projects/calendar.tgz} version: 0.0.0 + '@rush-temp/card-assets@file:projects/card-assets.tgz': + resolution: {integrity: sha512-SCfvJWYPsbkIyaV4s5LpZTiYYi/0DCqvpvwIfIQ/xnIX53VMIFZHbOMpcDgq6SEuBJQrKA2nV8w+r9y9+zkuSg==, tarball: file:projects/card-assets.tgz} + version: 0.0.0 + + '@rush-temp/card-resources@file:projects/card-resources.tgz': + resolution: {integrity: sha512-5XUIDT9Sm6CjX5nOi2lQxJlwTYrG4KDRkq1zzBjygbFTAZyUJoxXN+UJZJ+TdXvv5x3aGv9anI2M8OyQ4+ZQgg==, tarball: file:projects/card-resources.tgz} + version: 0.0.0 + + '@rush-temp/card@file:projects/card.tgz': + resolution: {integrity: sha512-rEy3T9z44ZC/94K3q01+0gbaZ0sJBlwB7KvmQuAbiZMU31t+pzS+yoIYkry7YHm/Ca7kd7H4uvcROiAr7yb91w==, tarball: file:projects/card.tgz} + version: 0.0.0 + '@rush-temp/chunter-assets@file:projects/chunter-assets.tgz': resolution: {integrity: sha512-cvDTBdx4bEvd+Bv01aNUJVclk4+Y48bAg6eE3Pllly5LTd3AThx+Txq6YlFo8YkbSiKlxwMfBBWt/XLlxSKhPA==, tarball: file:projects/chunter-assets.tgz} version: 0.0.0 @@ -3971,7 +3995,7 @@ packages: version: 0.0.0 '@rush-temp/controlled-documents-resources@file:projects/controlled-documents-resources.tgz': - resolution: {integrity: sha512-LJhHHpd6Y2VkH3akG1fZwZXiyAkPx2xXSWz2yEEYr+dVX/ckbeDcH8cWPMjQ/vwqMLisXe1vj0U314VsLkqoxw==, tarball: file:projects/controlled-documents-resources.tgz} + resolution: {integrity: sha512-nUtJ5JTDcB23saBWKWHexiY3m6IO3Lil4iZMx7KP57DHZJU5Apbeb/ZGSWmFhhaKYJqU4O0XI9pu0VfmrOH1og==, tarball: file:projects/controlled-documents-resources.tgz} version: 0.0.0 '@rush-temp/controlled-documents@file:projects/controlled-documents.tgz': @@ -4003,7 +4027,7 @@ packages: version: 0.0.0 '@rush-temp/desktop@file:projects/desktop.tgz': - resolution: {integrity: sha512-uh6lFeHjgPw/N/GA5iU+K8tdWjvda2LZYQ3zsTI50jOd3fQJA2x/YPvK9L/hHWTMEBB0sGjglGyLZK4SwfSuzA==, tarball: file:projects/desktop.tgz} + resolution: {integrity: sha512-eMzRgV4EJ9F+zFRY9JqL8PF9XFG8GsPaMdJ0w7e3O9CoondBikuDA0Mt3C6Rc4u3HHJQZU8AHxXSPktWJZ2Jtg==, tarball: file:projects/desktop.tgz} version: 0.0.0 '@rush-temp/devmodel-resources@file:projects/devmodel-resources.tgz': @@ -4195,7 +4219,7 @@ packages: version: 0.0.0 '@rush-temp/model-all@file:projects/model-all.tgz': - resolution: {integrity: sha512-FbsSTwILLsXpqZJPrJ55skNOUMi52egP1FjtCBEhh88k8MCw+d65wcb3VTSP5tzD8x4z2ZBZgL92PjLFB/vfNg==, tarball: file:projects/model-all.tgz} + resolution: {integrity: sha512-gkINR6HbfTB1ZSXTI2WHg9B+zIZtcSmb+Bb9fVxbGtq6e+RnxSlOlvjEBoru3ElfIO8x6SYd/KoQhRossQQKnQ==, tarball: file:projects/model-all.tgz} version: 0.0.0 '@rush-temp/model-analytics-collector@file:projects/model-analytics-collector.tgz': @@ -4218,6 +4242,10 @@ packages: resolution: {integrity: sha512-Q0DmE1izO/826KhQrg4QtMzmNsZMSdWq+/v86oJKysc03tiKlYALQRpmX77k6xq5QOTuOmw8ZmaMFabb4aPMEg==, tarball: file:projects/model-calendar.tgz} version: 0.0.0 + '@rush-temp/model-card@file:projects/model-card.tgz': + resolution: {integrity: sha512-7yhnpluYR/Gypgi3kKPtEVe1NpcG8YfE7S3ACF56GIqXideFnlXYWJ8PjUDQ9Ub5BHUulGYTXKsFUqcHRxQDZA==, tarball: file:projects/model-card.tgz} + version: 0.0.0 + '@rush-temp/model-chunter@file:projects/model-chunter.tgz': resolution: {integrity: sha512-es0oJ+MzCyOR75Kdx2An+tBhga3cZCaPV24k7V4LtlxXyxmboZjiDhZgh9/56psQwWgT7qqL6XBPzCR4nZBV1g==, tarball: file:projects/model-chunter.tgz} version: 0.0.0 @@ -4339,7 +4367,7 @@ packages: version: 0.0.0 '@rush-temp/model-server-controlled-documents@file:projects/model-server-controlled-documents.tgz': - resolution: {integrity: sha512-0s68xm5Kry85v4gkIM7lqNRWAbJZMAaVXm7n1BWMjr0AJOmeF5rryt9bfsHJ8n0hGGlM9GhkOpO3ivDsBDNXjA==, tarball: file:projects/model-server-controlled-documents.tgz} + resolution: {integrity: sha512-QvNZ/p8MWnbdoXH9EKxNzW4mSaZ0nz96lCTn+FE9Bw2tPQfJQy3Qps+Ir2V3LBv7GIQHJdGwVs7X2v+DNN8J4w==, tarball: file:projects/model-server-controlled-documents.tgz} version: 0.0.0 '@rush-temp/model-server-core@file:projects/model-server-core.tgz': @@ -4655,7 +4683,7 @@ packages: version: 0.0.0 '@rush-temp/prod@file:projects/prod.tgz': - resolution: {integrity: sha512-ywDWA6zqbf0N+pIglchMbAihpqdv5+C0/kGNCHr3+bnzbG4laM5uHYppzftEeMEJpchuuxmT5dDRFum4q7naIw==, tarball: file:projects/prod.tgz} + resolution: {integrity: sha512-LoYSjTvEdxhPgqQs+DOrNAK+Is2IToigzPvsFSMhsHqqgWohf2ZsZnDSHDZjzGzp2zypb+UyFbuNnJkiCIWDVw==, tarball: file:projects/prod.tgz} version: 0.0.0 '@rush-temp/products-assets@file:projects/products-assets.tgz': @@ -4815,7 +4843,7 @@ packages: version: 0.0.0 '@rush-temp/server-controlled-documents-resources@file:projects/server-controlled-documents-resources.tgz': - resolution: {integrity: sha512-mYK9xbNtII74MyRDJjutIBvUvdXfVeGwaixq9uRTVlqQsmb8oYvqVsTLLfmjL/e/eb1nmUPtnWh7sogkGYU/yA==, tarball: file:projects/server-controlled-documents-resources.tgz} + resolution: {integrity: sha512-atiXw3GqCij5FY7fbz+ZGWnfGVMrQmGOURz34OQbNGVoZRFVimUn7pdMApsU0MP3JZBWDEtairZYPGh2nvs5SA==, tarball: file:projects/server-controlled-documents-resources.tgz} version: 0.0.0 '@rush-temp/server-controlled-documents@file:projects/server-controlled-documents.tgz': @@ -4863,7 +4891,7 @@ packages: version: 0.0.0 '@rush-temp/server-gmail-resources@file:projects/server-gmail-resources.tgz': - resolution: {integrity: sha512-B+iAjGb/dbs1BhVc2MmYZxv2LrHQk/IH3UazglCC7v3Nu5x6ny4oMPCHXqv7W7MMVjIzqt60Wsw7spkvyS1CSA==, tarball: file:projects/server-gmail-resources.tgz} + resolution: {integrity: sha512-VUZuCBA60lmGBsC072eJNhPcfGLWGWaQKj6NmEZSutJt2M0dzchgdC5iWr+AX+fhE3pmDJhNW8hYdU06Y5FeZg==, tarball: file:projects/server-gmail-resources.tgz} version: 0.0.0 '@rush-temp/server-gmail@file:projects/server-gmail.tgz': @@ -5227,11 +5255,11 @@ packages: version: 0.0.0 '@rush-temp/view-assets@file:projects/view-assets.tgz': - resolution: {integrity: sha512-fUlJn33jw96g/rWFmQyp1LsAitTL2nt6T9N08Rp5S3FMggO3+e6HxUQIaQrKriCE/fRaf6SlJiBgH0W7kiNHMg==, tarball: file:projects/view-assets.tgz} + resolution: {integrity: sha512-z0nwxd7vykvG7TFFFTEXmVBGHDuPaxNWBTonuFVkplbOCNiLnWSBjQTnBZyxiwhe8LWbVPHBmaKIb12Wu/EDXA==, tarball: file:projects/view-assets.tgz} version: 0.0.0 '@rush-temp/view-resources@file:projects/view-resources.tgz': - resolution: {integrity: sha512-O6XInCrNaa2QL0Byzcun0cW76B1zeXDBXeaED9OGAh4c5L6uYA7S5gxDWXzUHA/GU0nPk+hosLZ1uczb1j9Tww==, tarball: file:projects/view-resources.tgz} + resolution: {integrity: sha512-VichPhfm94kp3QtBDE3MdF+BJdrSUpxcslAwRBEQ2wdDjuOkSljI+5WUcJgS2zXRgt91v71PM0a3Rcdo+KNhew==, tarball: file:projects/view-resources.tgz} version: 0.0.0 '@rush-temp/view@file:projects/view.tgz': @@ -16587,6 +16615,100 @@ snapshots: - supports-color - ts-node + '@rush-temp/card-assets@file:projects/card-assets.tgz(@babel/core@7.23.9)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.23.9))(esbuild@0.24.2)(ts-node@10.9.2(@types/node@20.11.19)(typescript@5.3.3))': + dependencies: + '@types/jest': 29.5.12 + '@types/node': 20.11.19 + '@typescript-eslint/eslint-plugin': 6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.3.3))(eslint@8.56.0)(typescript@5.6.2) + '@typescript-eslint/parser': 6.21.0(eslint@8.56.0)(typescript@5.6.2) + eslint: 8.56.0 + eslint-config-standard-with-typescript: 40.0.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.3.3))(eslint@8.56.0)(typescript@5.3.3))(eslint-plugin-import@2.29.1(eslint@8.56.0))(eslint-plugin-n@15.7.0(eslint@8.56.0))(eslint-plugin-promise@6.1.1(eslint@8.56.0))(eslint@8.56.0)(typescript@5.6.2) + eslint-plugin-import: 2.29.1(eslint@8.56.0) + eslint-plugin-n: 15.7.0(eslint@8.56.0) + eslint-plugin-promise: 6.1.1(eslint@8.56.0) + jest: 29.7.0(@types/node@20.11.19)(ts-node@10.9.2(@types/node@20.11.19)(typescript@5.3.3)) + prettier: 3.2.5 + ts-jest: 29.1.2(@babel/core@7.23.9)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.23.9))(esbuild@0.24.2)(jest@29.7.0(@types/node@20.11.19)(ts-node@10.9.2(@types/node@20.11.19)(typescript@5.3.3)))(typescript@5.6.2) + typescript: 5.6.2 + transitivePeerDependencies: + - '@babel/core' + - '@jest/types' + - babel-jest + - babel-plugin-macros + - esbuild + - node-notifier + - supports-color + - ts-node + + '@rush-temp/card-resources@file:projects/card-resources.tgz(@babel/core@7.23.9)(@jest/types@29.6.3)(@tiptap/pm@2.6.6)(@types/node@20.11.19)(babel-jest@29.7.0(@babel/core@7.23.9))(esbuild@0.24.2)(postcss-load-config@4.0.2(postcss@8.4.35)(ts-node@10.9.2(@types/node@20.11.19)(typescript@5.3.3)))(postcss@8.4.35)(ts-node@10.9.2(@types/node@20.11.19)(typescript@5.3.3))': + dependencies: + '@tiptap/core': 2.6.6(@tiptap/pm@2.6.6) + '@types/html-to-text': 8.1.1 + '@types/jest': 29.5.12 + '@typescript-eslint/eslint-plugin': 6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.3.3))(eslint@8.56.0)(typescript@5.6.2) + '@typescript-eslint/parser': 6.21.0(eslint@8.56.0)(typescript@5.6.2) + eslint: 8.56.0 + eslint-config-standard-with-typescript: 40.0.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.3.3))(eslint@8.56.0)(typescript@5.3.3))(eslint-plugin-import@2.29.1(eslint@8.56.0))(eslint-plugin-n@15.7.0(eslint@8.56.0))(eslint-plugin-promise@6.1.1(eslint@8.56.0))(eslint@8.56.0)(typescript@5.6.2) + eslint-plugin-import: 2.29.1(eslint@8.56.0) + eslint-plugin-n: 15.7.0(eslint@8.56.0) + eslint-plugin-promise: 6.1.1(eslint@8.56.0) + eslint-plugin-svelte: 2.35.1(eslint@8.56.0)(svelte@4.2.19)(ts-node@10.9.2(@types/node@20.11.19)(typescript@5.3.3)) + fast-equals: 5.0.1 + jest: 29.7.0(@types/node@20.11.19)(ts-node@10.9.2(@types/node@20.11.19)(typescript@5.3.3)) + prettier: 3.2.5 + prettier-plugin-svelte: 3.2.2(prettier@3.2.5)(svelte@4.2.19) + sass: 1.71.1 + svelte: 4.2.19 + svelte-check: 3.6.9(@babel/core@7.23.9)(postcss-load-config@4.0.2(postcss@8.4.35)(ts-node@10.9.2(@types/node@20.11.19)(typescript@5.3.3)))(postcss@8.4.35)(sass@1.71.1)(svelte@4.2.19) + svelte-eslint-parser: 0.33.1(svelte@4.2.19) + svelte-loader: 3.2.0(svelte@4.2.19) + svelte-preprocess: 5.1.3(@babel/core@7.23.9)(postcss-load-config@4.0.2(postcss@8.4.35)(ts-node@10.9.2(@types/node@20.11.19)(typescript@5.3.3)))(postcss@8.4.35)(sass@1.71.1)(svelte@4.2.19)(typescript@5.6.2) + ts-jest: 29.1.2(@babel/core@7.23.9)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.23.9))(esbuild@0.24.2)(jest@29.7.0(@types/node@20.11.19)(ts-node@10.9.2(@types/node@20.11.19)(typescript@5.3.3)))(typescript@5.6.2) + typescript: 5.6.2 + transitivePeerDependencies: + - '@babel/core' + - '@jest/types' + - '@tiptap/pm' + - '@types/node' + - babel-jest + - babel-plugin-macros + - coffeescript + - esbuild + - less + - node-notifier + - postcss + - postcss-load-config + - pug + - stylus + - sugarss + - supports-color + - ts-node + + '@rush-temp/card@file:projects/card.tgz(@babel/core@7.23.9)(@jest/types@29.6.3)(@types/node@20.11.19)(babel-jest@29.7.0(@babel/core@7.23.9))(esbuild@0.24.2)(ts-node@10.9.2(@types/node@20.11.19)(typescript@5.3.3))': + dependencies: + '@types/jest': 29.5.12 + '@typescript-eslint/eslint-plugin': 6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.3.3))(eslint@8.56.0)(typescript@5.6.2) + '@typescript-eslint/parser': 6.21.0(eslint@8.56.0)(typescript@5.6.2) + eslint: 8.56.0 + eslint-config-standard-with-typescript: 40.0.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.3.3))(eslint@8.56.0)(typescript@5.3.3))(eslint-plugin-import@2.29.1(eslint@8.56.0))(eslint-plugin-n@15.7.0(eslint@8.56.0))(eslint-plugin-promise@6.1.1(eslint@8.56.0))(eslint@8.56.0)(typescript@5.6.2) + eslint-plugin-import: 2.29.1(eslint@8.56.0) + eslint-plugin-n: 15.7.0(eslint@8.56.0) + eslint-plugin-promise: 6.1.1(eslint@8.56.0) + jest: 29.7.0(@types/node@20.11.19)(ts-node@10.9.2(@types/node@20.11.19)(typescript@5.3.3)) + prettier: 3.2.5 + ts-jest: 29.1.2(@babel/core@7.23.9)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.23.9))(esbuild@0.24.2)(jest@29.7.0(@types/node@20.11.19)(ts-node@10.9.2(@types/node@20.11.19)(typescript@5.3.3)))(typescript@5.6.2) + typescript: 5.6.2 + transitivePeerDependencies: + - '@babel/core' + - '@jest/types' + - '@types/node' + - babel-jest + - babel-plugin-macros + - esbuild + - node-notifier + - supports-color + - ts-node + '@rush-temp/chunter-assets@file:projects/chunter-assets.tgz(@babel/core@7.23.9)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.23.9))(esbuild@0.24.2)(ts-node@10.9.2(@types/node@20.11.19)(typescript@5.3.3))': dependencies: '@types/jest': 29.5.12 @@ -18871,6 +18993,20 @@ snapshots: transitivePeerDependencies: - supports-color + '@rush-temp/model-card@file:projects/model-card.tgz': + dependencies: + '@typescript-eslint/eslint-plugin': 6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.3.3))(eslint@8.56.0)(typescript@5.6.2) + '@typescript-eslint/parser': 6.21.0(eslint@8.56.0)(typescript@5.6.2) + eslint: 8.56.0 + eslint-config-standard-with-typescript: 40.0.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.3.3))(eslint@8.56.0)(typescript@5.3.3))(eslint-plugin-import@2.29.1(eslint@8.56.0))(eslint-plugin-n@15.7.0(eslint@8.56.0))(eslint-plugin-promise@6.1.1(eslint@8.56.0))(eslint@8.56.0)(typescript@5.6.2) + eslint-plugin-import: 2.29.1(eslint@8.56.0) + eslint-plugin-n: 15.7.0(eslint@8.56.0) + eslint-plugin-promise: 6.1.1(eslint@8.56.0) + prettier: 3.2.5 + typescript: 5.6.2 + transitivePeerDependencies: + - supports-color + '@rush-temp/model-chunter@file:projects/model-chunter.tgz': dependencies: '@typescript-eslint/eslint-plugin': 6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.3.3))(eslint@8.56.0)(typescript@5.3.3) diff --git a/desktop/package.json b/desktop/package.json index a99efbec67..5733be21eb 100644 --- a/desktop/package.json +++ b/desktop/package.json @@ -212,6 +212,9 @@ "@hcengineering/survey": "^0.6.0", "@hcengineering/survey-assets": "^0.6.0", "@hcengineering/survey-resources": "^0.6.0", + "@hcengineering/card": "^0.6.0", + "@hcengineering/card-assets": "^0.6.0", + "@hcengineering/card-resources": "^0.6.0", "electron-squirrel-startup": "~1.0.0", "dotenv": "~16.0.0", "electron-context-menu": "^4.0.4", diff --git a/desktop/src/ui/platform.ts b/desktop/src/ui/platform.ts index 1a3c0ef573..f8a31b0521 100644 --- a/desktop/src/ui/platform.ts +++ b/desktop/src/ui/platform.ts @@ -49,6 +49,7 @@ import { timeId } from '@hcengineering/time' import { desktopPreferencesId } from '@hcengineering/desktop-preferences' import guest, { guestId } from '@hcengineering/guest' import { bitrixId } from '@hcengineering/bitrix' +import { cardId } from '@hcengineering/card' import { productsId } from '@hcengineering/products' import { questionsId } from '@hcengineering/questions' import { trainingId } from '@hcengineering/training' @@ -99,6 +100,7 @@ import '@hcengineering/analytics-collector-assets' import '@hcengineering/text-editor-assets' import '@hcengineering/test-management-assets' import '@hcengineering/survey-assets' +import '@hcengineering/card-assets' import { coreId } from '@hcengineering/core' import presentation, { parsePreviewConfig, parseUploadConfig, presentationId } from '@hcengineering/presentation' @@ -192,6 +194,7 @@ function configureI18n (): void { addStringsLoader(analyticsCollectorId, async (lang: string) => await import(`@hcengineering/analytics-collector-assets/lang/${lang}.json`)) addStringsLoader(testManagementId, async (lang: string) => await import(`@hcengineering/test-management-assets/lang/${lang}.json`)) addStringsLoader(surveyId, async (lang: string) => await import(`@hcengineering/survey-assets/lang/${lang}.json`)) + addStringsLoader(cardId, async (lang: string) => await import(`@hcengineering/card-assets/lang/${lang}.json`)) } export async function configurePlatform (): Promise { @@ -318,6 +321,7 @@ export async function configurePlatform (): Promise { addLocation(textEditorId, () => import(/* webpackChunkName: "text-editor" */ '@hcengineering/text-editor-resources')) addLocation(testManagementId, () => import(/* webpackChunkName: "test-management" */ '@hcengineering/test-management-resources')) addLocation(surveyId, () => import(/* webpackChunkName: "survey" */ '@hcengineering/survey-resources')) + addLocation(cardId, () => import(/* webpackChunkName: "card" */ '@hcengineering/card-resources')) setMetadata(client.metadata.FilterModel, 'ui') setMetadata(client.metadata.ExtraPlugins, ['preference' as Plugin]) diff --git a/dev/prod/package.json b/dev/prod/package.json index de67b3542d..151a4f6500 100644 --- a/dev/prod/package.json +++ b/dev/prod/package.json @@ -243,6 +243,9 @@ "@hcengineering/survey": "^0.6.0", "@hcengineering/survey-assets": "^0.6.0", "@hcengineering/survey-resources": "^0.6.0", + "@hcengineering/card": "^0.6.0", + "@hcengineering/card-assets": "^0.6.0", + "@hcengineering/card-resources": "^0.6.0", "@sentry/svelte": "~7.101.0", "posthog-js": "~1.122.0" } diff --git a/dev/prod/src/platform.ts b/dev/prod/src/platform.ts index 12482bbaf6..cbca576b37 100644 --- a/dev/prod/src/platform.ts +++ b/dev/prod/src/platform.ts @@ -21,6 +21,7 @@ import analyticsCollector, { analyticsCollectorId } from '@hcengineering/analyti import { attachmentId } from '@hcengineering/attachment' import { boardId } from '@hcengineering/board' import calendar, { calendarId } from '@hcengineering/calendar' +import { cardId } from '@hcengineering/card' import { chunterId } from '@hcengineering/chunter' import client, { clientId } from '@hcengineering/client' import contactPlugin, { contactId } from '@hcengineering/contact' @@ -39,6 +40,7 @@ import login, { loginId } from '@hcengineering/login' import love, { loveId } from '@hcengineering/love' import notification, { notificationId } from '@hcengineering/notification' import onboard, { onboardId } from '@hcengineering/onboard' +import presence, { presenceId } from '@hcengineering/presence' import print, { printId } from '@hcengineering/print' import { productsId } from '@hcengineering/products' import { questionsId } from '@hcengineering/questions' @@ -48,10 +50,12 @@ import { requestId } from '@hcengineering/request' import setting, { settingId } from '@hcengineering/setting' import sign from '@hcengineering/sign' 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' import { templatesId } from '@hcengineering/templates' +import { testManagementId } from '@hcengineering/test-management' import textEditor, { textEditorId } from '@hcengineering/text-editor' import { timeId } from '@hcengineering/time' import tracker, { trackerId } from '@hcengineering/tracker' @@ -60,9 +64,6 @@ import uiPlugin from '@hcengineering/ui' import { uploaderId } from '@hcengineering/uploader' import { viewId } from '@hcengineering/view' import workbench, { workbenchId } from '@hcengineering/workbench' -import { testManagementId } from '@hcengineering/test-management' -import { surveyId } from '@hcengineering/survey' -import presence, { presenceId } from '@hcengineering/presence' import { bitrixId } from '@hcengineering/bitrix' @@ -72,6 +73,7 @@ import '@hcengineering/attachment-assets' import '@hcengineering/bitrix-assets' import '@hcengineering/board-assets' import '@hcengineering/calendar-assets' +import '@hcengineering/card-assets' import '@hcengineering/chunter-assets' import '@hcengineering/contact-assets' import '@hcengineering/controlled-documents-assets' @@ -95,10 +97,12 @@ 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' import '@hcengineering/templates-assets' +import '@hcengineering/test-management-assets' import '@hcengineering/text-editor-assets' import '@hcengineering/time-assets' import '@hcengineering/tracker-assets' @@ -106,8 +110,6 @@ import '@hcengineering/training-assets' import '@hcengineering/uploader-assets' import '@hcengineering/view-assets' import '@hcengineering/workbench-assets' -import '@hcengineering/test-management-assets' -import '@hcengineering/survey-assets' import github, { githubId } from '@hcengineering/github' import '@hcengineering/github-assets' @@ -123,7 +125,6 @@ import presentation, { import { setMetadata } from '@hcengineering/platform' import { initThemeStore, setDefaultLanguage } from '@hcengineering/theme' -import { Analytics } from '@hcengineering/analytics' import { preferenceId } from '@hcengineering/preference' import { uiId } from '@hcengineering/ui/src/plugin' import { configureAnalytics } from './analytics' @@ -231,56 +232,57 @@ const PASSWORD_REQUIREMENTS : Record await import(`@hcengineering/platform/lang/${lang}.json`)) - addStringsLoader(coreId, async (lang: string) => await import(`@hcengineering/core/lang/${lang}.json`)) - addStringsLoader(presentationId, async (lang: string) => await import(`@hcengineering/presentation/lang/${lang}.json`)) - addStringsLoader(textEditorId, async (lang: string) => await import(`@hcengineering/text-editor-assets/lang/${lang}.json`)) - addStringsLoader(uiId, async (lang: string) => await import(`@hcengineering/ui/lang/${lang}.json`)) - addStringsLoader(uploaderId, async (lang: string) => await import(`@hcengineering/uploader-assets/lang/${lang}.json`)) - addStringsLoader(activityId, async (lang: string) => await import(`@hcengineering/activity-assets/lang/${lang}.json`)) - addStringsLoader(attachmentId, async (lang: string) => await import(`@hcengineering/attachment-assets/lang/${lang}.json`)) - addStringsLoader(bitrixId, async (lang: string) => await import(`@hcengineering/bitrix-assets/lang/${lang}.json`)) - addStringsLoader(boardId, async (lang: string) => await import(`@hcengineering/board-assets/lang/${lang}.json`)) - addStringsLoader(calendarId, async (lang: string) => await import(`@hcengineering/calendar-assets/lang/${lang}.json`)) - addStringsLoader(chunterId, async (lang: string) => await import(`@hcengineering/chunter-assets/lang/${lang}.json`)) - addStringsLoader(contactId, async (lang: string) => await import(`@hcengineering/contact-assets/lang/${lang}.json`)) - addStringsLoader(driveId, async (lang: string) => await import(`@hcengineering/drive-assets/lang/${lang}.json`)) - addStringsLoader(gmailId, async (lang: string) => await import(`@hcengineering/gmail-assets/lang/${lang}.json`)) - addStringsLoader(hrId, async (lang: string) => await import(`@hcengineering/hr-assets/lang/${lang}.json`)) - addStringsLoader(inventoryId, async (lang: string) => await import(`@hcengineering/inventory-assets/lang/${lang}.json`)) - addStringsLoader(leadId, async (lang: string) => await import(`@hcengineering/lead-assets/lang/${lang}.json`)) - addStringsLoader(loginId, async (lang: string) => await import(`@hcengineering/login-assets/lang/${lang}.json`)) - addStringsLoader(notificationId, async (lang: string) => await import(`@hcengineering/notification-assets/lang/${lang}.json`)) - addStringsLoader(onboardId, async (lang: string) => await import(`@hcengineering/onboard-assets/lang/${lang}.json`)) - addStringsLoader(preferenceId, async (lang: string) => await import(`@hcengineering/preference-assets/lang/${lang}.json`)) - addStringsLoader(recruitId, async (lang: string) => await import(`@hcengineering/recruit-assets/lang/${lang}.json`)) - 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(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`)) - addStringsLoader(templatesId, async (lang: string) => await import(`@hcengineering/templates-assets/lang/${lang}.json`)) - addStringsLoader(trackerId, async (lang: string) => await import(`@hcengineering/tracker-assets/lang/${lang}.json`)) - addStringsLoader(viewId, async (lang: string) => await import(`@hcengineering/view-assets/lang/${lang}.json`)) - addStringsLoader(workbenchId, async (lang: string) => await import(`@hcengineering/workbench-assets/lang/${lang}.json`)) + //Add localization + addStringsLoader(platformId, async (lang: string) => await import(`@hcengineering/platform/lang/${lang}.json`)) + addStringsLoader(coreId, async (lang: string) => await import(`@hcengineering/core/lang/${lang}.json`)) + addStringsLoader(presentationId, async (lang: string) => await import(`@hcengineering/presentation/lang/${lang}.json`)) + addStringsLoader(textEditorId, async (lang: string) => await import(`@hcengineering/text-editor-assets/lang/${lang}.json`)) + addStringsLoader(uiId, async (lang: string) => await import(`@hcengineering/ui/lang/${lang}.json`)) + addStringsLoader(uploaderId, async (lang: string) => await import(`@hcengineering/uploader-assets/lang/${lang}.json`)) + addStringsLoader(activityId, async (lang: string) => await import(`@hcengineering/activity-assets/lang/${lang}.json`)) + addStringsLoader(attachmentId, async (lang: string) => await import(`@hcengineering/attachment-assets/lang/${lang}.json`)) + addStringsLoader(bitrixId, async (lang: string) => await import(`@hcengineering/bitrix-assets/lang/${lang}.json`)) + addStringsLoader(boardId, async (lang: string) => await import(`@hcengineering/board-assets/lang/${lang}.json`)) + addStringsLoader(calendarId, async (lang: string) => await import(`@hcengineering/calendar-assets/lang/${lang}.json`)) + addStringsLoader(chunterId, async (lang: string) => await import(`@hcengineering/chunter-assets/lang/${lang}.json`)) + addStringsLoader(contactId, async (lang: string) => await import(`@hcengineering/contact-assets/lang/${lang}.json`)) + addStringsLoader(driveId, async (lang: string) => await import(`@hcengineering/drive-assets/lang/${lang}.json`)) + addStringsLoader(gmailId, async (lang: string) => await import(`@hcengineering/gmail-assets/lang/${lang}.json`)) + addStringsLoader(hrId, async (lang: string) => await import(`@hcengineering/hr-assets/lang/${lang}.json`)) + addStringsLoader(inventoryId, async (lang: string) => await import(`@hcengineering/inventory-assets/lang/${lang}.json`)) + addStringsLoader(leadId, async (lang: string) => await import(`@hcengineering/lead-assets/lang/${lang}.json`)) + addStringsLoader(loginId, async (lang: string) => await import(`@hcengineering/login-assets/lang/${lang}.json`)) + addStringsLoader(notificationId, async (lang: string) => await import(`@hcengineering/notification-assets/lang/${lang}.json`)) + addStringsLoader(onboardId, async (lang: string) => await import(`@hcengineering/onboard-assets/lang/${lang}.json`)) + addStringsLoader(preferenceId, async (lang: string) => await import(`@hcengineering/preference-assets/lang/${lang}.json`)) + addStringsLoader(recruitId, async (lang: string) => await import(`@hcengineering/recruit-assets/lang/${lang}.json`)) + 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(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`)) + addStringsLoader(templatesId, async (lang: string) => await import(`@hcengineering/templates-assets/lang/${lang}.json`)) + addStringsLoader(trackerId, async (lang: string) => await import(`@hcengineering/tracker-assets/lang/${lang}.json`)) + addStringsLoader(viewId, async (lang: string) => await import(`@hcengineering/view-assets/lang/${lang}.json`)) + addStringsLoader(workbenchId, async (lang: string) => await import(`@hcengineering/workbench-assets/lang/${lang}.json`)) - addStringsLoader(desktopPreferencesId, async (lang: string) => await import(`@hcengineering/desktop-preferences-assets/lang/${lang}.json`)) - addStringsLoader(diffviewId, async (lang: string) => await import(`@hcengineering/diffview-assets/lang/${lang}.json`)) - addStringsLoader(documentId, async (lang: string) => await import(`@hcengineering/document-assets/lang/${lang}.json`)) - addStringsLoader(timeId, async (lang: string) => await import(`@hcengineering/time-assets/lang/${lang}.json`)) - addStringsLoader(githubId, async (lang: string) => await import(`@hcengineering/github-assets/lang/${lang}.json`)) - addStringsLoader(documentsId, async (lang: string) => await import(`@hcengineering/controlled-documents-assets/lang/${lang}.json`)) - addStringsLoader(productsId, async (lang: string) => await import(`@hcengineering/products-assets/lang/${lang}.json`)) - addStringsLoader(questionsId, async (lang: string) => await import(`@hcengineering/questions-assets/lang/${lang}.json`)) - addStringsLoader(trainingId, async (lang: string) => await import(`@hcengineering/training-assets/lang/${lang}.json`)) - addStringsLoader(guestId, async (lang: string) => await import(`@hcengineering/guest-assets/lang/${lang}.json`)) - addStringsLoader(loveId, async (lang: string) => await import(`@hcengineering/love-assets/lang/${lang}.json`)) - addStringsLoader(printId, async (lang: string) => await import(`@hcengineering/print-assets/lang/${lang}.json`)) - addStringsLoader(analyticsCollectorId, async (lang: string) => await import(`@hcengineering/analytics-collector-assets/lang/${lang}.json`)) - addStringsLoader(testManagementId, async (lang: string) => await import(`@hcengineering/test-management-assets/lang/${lang}.json`)) - addStringsLoader(surveyId, async (lang: string) => await import(`@hcengineering/survey-assets/lang/${lang}.json`)) + addStringsLoader(desktopPreferencesId, async (lang: string) => await import(`@hcengineering/desktop-preferences-assets/lang/${lang}.json`)) + addStringsLoader(diffviewId, async (lang: string) => await import(`@hcengineering/diffview-assets/lang/${lang}.json`)) + addStringsLoader(documentId, async (lang: string) => await import(`@hcengineering/document-assets/lang/${lang}.json`)) + addStringsLoader(timeId, async (lang: string) => await import(`@hcengineering/time-assets/lang/${lang}.json`)) + addStringsLoader(githubId, async (lang: string) => await import(`@hcengineering/github-assets/lang/${lang}.json`)) + addStringsLoader(documentsId, async (lang: string) => await import(`@hcengineering/controlled-documents-assets/lang/${lang}.json`)) + addStringsLoader(productsId, async (lang: string) => await import(`@hcengineering/products-assets/lang/${lang}.json`)) + addStringsLoader(questionsId, async (lang: string) => await import(`@hcengineering/questions-assets/lang/${lang}.json`)) + addStringsLoader(trainingId, async (lang: string) => await import(`@hcengineering/training-assets/lang/${lang}.json`)) + addStringsLoader(guestId, async (lang: string) => await import(`@hcengineering/guest-assets/lang/${lang}.json`)) + addStringsLoader(loveId, async (lang: string) => await import(`@hcengineering/love-assets/lang/${lang}.json`)) + addStringsLoader(printId, async (lang: string) => await import(`@hcengineering/print-assets/lang/${lang}.json`)) + addStringsLoader(analyticsCollectorId, async (lang: string) => await import(`@hcengineering/analytics-collector-assets/lang/${lang}.json`)) + addStringsLoader(testManagementId, async (lang: string) => await import(`@hcengineering/test-management-assets/lang/${lang}.json`)) + addStringsLoader(surveyId, async (lang: string) => await import(`@hcengineering/survey-assets/lang/${lang}.json`)) + addStringsLoader(cardId, async (lang: string) => await import(`@hcengineering/card-assets/lang/${lang}.json`)) } export async function configurePlatform() { @@ -450,6 +452,7 @@ export async function configurePlatform() { addLocation(testManagementId, () => import(/* webpackChunkName: "test-management" */ '@hcengineering/test-management-resources')) addLocation(surveyId, () => import(/* webpackChunkName: "survey" */ '@hcengineering/survey-resources')) addLocation(presenceId, () => import(/* webpackChunkName: "presence" */ '@hcengineering/presence-resources')) + addLocation(cardId, () => import(/* webpackChunkName: "card" */ '@hcengineering/card-resources')) setMetadata(client.metadata.FilterModel, 'ui') setMetadata(client.metadata.ExtraPlugins, ['preference' as Plugin]) diff --git a/models/all/package.json b/models/all/package.json index e773ceeb36..1333fcf4ab 100644 --- a/models/all/package.json +++ b/models/all/package.json @@ -113,6 +113,7 @@ "@hcengineering/model-server-fulltext": "^0.6.0", "@hcengineering/model-test-management": "^0.6.0", "@hcengineering/model-survey": "^0.6.0", - "@hcengineering/model-presence": "^0.6.0" + "@hcengineering/model-presence": "^0.6.0", + "@hcengineering/model-card": "^0.6.0" } } diff --git a/models/all/src/index.ts b/models/all/src/index.ts index 82fae83523..84af4267c5 100644 --- a/models/all/src/index.ts +++ b/models/all/src/index.ts @@ -75,6 +75,7 @@ import tracker, { trackerId, createModel as trackerModel } from '@hcengineering/ import { uploaderId, createModel as uploaderModel } from '@hcengineering/model-uploader' import view, { viewId, createModel as viewModel } from '@hcengineering/model-view' import workbench, { workbenchId, createModel as workbenchModel } from '@hcengineering/model-workbench' +import card, { cardId, createModel as cardModel } from '@hcengineering/model-card' import { desktopPreferencesId, createModel as desktopPreferencesModel } from '@hcengineering/model-desktop-preferences' import document, { documentId, createModel as documentModel } from '@hcengineering/model-document' @@ -144,7 +145,8 @@ export default function buildModel (enabled: string[] = ['*'], disabled: string[ notification.class.NotificationGroup, view.class.Action, contact.class.ChannelProvider, - setting.class.IntegrationType + setting.class.IntegrationType, + setting.class.WorkspaceSettingCategory ] const builders: BuilderConfig[] = [ @@ -257,17 +259,7 @@ export default function buildModel (enabled: string[] = ['*'], disabled: string[ [uploaderModel, uploaderId], [notificationModel, notificationId], [preferenceModel, preferenceId], - [ - analyticsCollectorModel, - analyticsCollectorId, - { - label: inventory.string.ConfigLabel, - description: inventory.string.ConfigDescription, - enabled: true, - beta: false, - classFilter: defaultFilter - } - ], + [analyticsCollectorModel, analyticsCollectorId], [ hrModel, hrId, @@ -368,6 +360,18 @@ export default function buildModel (enabled: string[] = ['*'], disabled: string[ ], [printModel, printId], [aiBotModel, aiBotId], + [ + cardModel, + cardId, + { + label: card.string.Cards, + description: card.string.ConfigDescription, + enabled: false, + beta: true, + icon: card.icon.Card, + classFilter: defaultFilter + } + ], [driveModel, driveId], [ documentsModel, diff --git a/models/attachment/src/index.ts b/models/attachment/src/index.ts index 87ed96ec97..8a0c853893 100644 --- a/models/attachment/src/index.ts +++ b/models/attachment/src/index.ts @@ -14,7 +14,14 @@ // import activity from '@hcengineering/activity' -import type { Attachment, AttachmentMetadata, Drawing, Photo, SavedAttachments } from '@hcengineering/attachment' +import type { + Attachment, + AttachmentMetadata, + Drawing, + Embedding, + Photo, + SavedAttachments +} from '@hcengineering/attachment' import { IndexKind, type Blob, type Class, type Doc, type Domain, type Ref } from '@hcengineering/core' import { Hidden, @@ -72,6 +79,10 @@ export class TAttachment extends TAttachedDoc implements Attachment { metadata?: AttachmentMetadata } +@Model(attachment.class.Embedding, attachment.class.Attachment) +@UX(attachment.string.Embeddings) +export class TEmbedding extends TAttachment implements Embedding {} + @Model(attachment.class.Photo, attachment.class.Attachment) @UX(attachment.string.Photo) export class TPhoto extends TAttachment implements Photo {} @@ -99,7 +110,7 @@ export class TDrawing extends TDoc implements Drawing { } export function createModel (builder: Builder): void { - builder.createModel(TAttachment, TDrawing, TPhoto, TSavedAttachments) + builder.createModel(TAttachment, TEmbedding, TDrawing, TPhoto, TSavedAttachments) builder.mixin(attachment.class.Attachment, core.class.Class, view.mixin.ObjectPresenter, { presenter: attachment.component.AttachmentPresenter diff --git a/models/board/src/plugin.ts b/models/board/src/plugin.ts index a1156e9c3e..d69408cc92 100644 --- a/models/board/src/plugin.ts +++ b/models/board/src/plugin.ts @@ -16,9 +16,9 @@ import { type Board, boardId } from '@hcengineering/board' import board from '@hcengineering/board-resources/src/plugin' -import type { Ref } from '@hcengineering/core' +import type { Ref, Sequence } from '@hcengineering/core' import { type IntlString, mergeIds } from '@hcengineering/platform' -import { type TaskTypeDescriptor, type ProjectType, type Sequence } from '@hcengineering/task' +import { type TaskTypeDescriptor, type ProjectType } from '@hcengineering/task' import type { AnyComponent } from '@hcengineering/ui/src/types' import { type Action, type ViewAction, type Viewlet, type ViewletDescriptor } from '@hcengineering/view' diff --git a/models/card/.eslintrc.js b/models/card/.eslintrc.js new file mode 100644 index 0000000000..c1cf82cba0 --- /dev/null +++ b/models/card/.eslintrc.js @@ -0,0 +1,7 @@ +module.exports = { + extends: ['./node_modules/@hcengineering/platform-rig/profiles/model/eslint.config.json'], + parserOptions: { + tsconfigRootDir: __dirname, + project: './tsconfig.json' + } +} diff --git a/models/card/.npmignore b/models/card/.npmignore new file mode 100644 index 0000000000..e3ec093c38 --- /dev/null +++ b/models/card/.npmignore @@ -0,0 +1,4 @@ +* +!/lib/** +!CHANGELOG.md +/lib/**/__tests__/ diff --git a/models/card/config/rig.json b/models/card/config/rig.json new file mode 100644 index 0000000000..2f6be36605 --- /dev/null +++ b/models/card/config/rig.json @@ -0,0 +1,5 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json", + "rigPackageName": "@hcengineering/platform-rig", + "rigProfile": "model" +} diff --git a/models/card/package.json b/models/card/package.json new file mode 100644 index 0000000000..bf728b4196 --- /dev/null +++ b/models/card/package.json @@ -0,0 +1,49 @@ +{ + "name": "@hcengineering/model-card", + "version": "0.6.0", + "main": "lib/index.js", + "svelte": "src/index.ts", + "types": "types/index.d.ts", + "author": "Copyright © Hardcore Engineering Inc.", + "template": "@hcengineering/model-package", + "license": "EPL-2.0", + "scripts": { + "build": "compile", + "build:watch": "compile", + "format": "format src", + "_phase:build": "compile transpile src", + "_phase:format": "format src", + "_phase:validate": "compile validate" + }, + "devDependencies": { + "@hcengineering/platform-rig": "^0.6.0", + "@typescript-eslint/eslint-plugin": "^6.11.0", + "eslint-plugin-import": "^2.26.0", + "eslint-plugin-promise": "^6.1.1", + "eslint-plugin-n": "^15.4.0", + "eslint": "^8.54.0", + "@typescript-eslint/parser": "^6.11.0", + "eslint-config-standard-with-typescript": "^40.0.0", + "prettier": "^3.1.0", + "typescript": "^5.3.3" + }, + "dependencies": { + "@hcengineering/activity": "^0.6.0", + "@hcengineering/core": "^0.6.32", + "@hcengineering/model": "^0.6.11", + "@hcengineering/chunter": "^0.6.20", + "@hcengineering/model-setting": "^0.6.0", + "@hcengineering/model-view": "^0.6.0", + "@hcengineering/model-core": "^0.6.0", + "@hcengineering/platform": "^0.6.11", + "@hcengineering/ui": "^0.6.15", + "@hcengineering/time": "^0.6.0", + "@hcengineering/card": "^0.6.0", + "@hcengineering/model-attachment": "^0.6.0", + "@hcengineering/model-presentation": "^0.6.0", + "@hcengineering/workbench": "^0.6.16", + "@hcengineering/model-workbench": "^0.6.1", + "@hcengineering/card-resources": "^0.6.0", + "@hcengineering/view": "^0.6.13" + } +} diff --git a/models/card/src/index.ts b/models/card/src/index.ts new file mode 100644 index 0000000000..6eb58610ec --- /dev/null +++ b/models/card/src/index.ts @@ -0,0 +1,260 @@ +// Copyright © 2025 Hardcore Engineering Inc. +// +// Licensed under the Eclipse Public License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. You may +// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. + +import activity from '@hcengineering/activity' +import { cardId, type Card, type MasterTag, type Tag } from '@hcengineering/card' +import chunter from '@hcengineering/chunter' +import core, { + AccountRole, + type CollectionSize, + type Domain, + type MarkupBlobRef, + type Rank, + type Ref +} from '@hcengineering/core' +import { + Collection, + Model, + Prop, + TypeCollaborativeDoc, + TypeRef, + TypeString, + UX, + type Builder +} from '@hcengineering/model' +import attachment from '@hcengineering/model-attachment' +import { TClass, TDoc, TMixin } from '@hcengineering/model-core' +import presentation from '@hcengineering/model-presentation' +import setting from '@hcengineering/model-setting' +import view, { createAction } from '@hcengineering/model-view' +import workbench from '@hcengineering/model-workbench' +import { getEmbeddedLabel } from '@hcengineering/platform' +import time, { type ToDo } from '@hcengineering/time' +import card from './plugin' + +export { cardId } from '@hcengineering/card' + +const DOMAIN_CARD = 'card' as Domain + +@Model(card.class.MasterTag, core.class.Class) +export class TMasterTag extends TClass implements MasterTag {} + +@Model(card.class.Tag, core.class.Mixin) +export class TTag extends TMixin implements Tag {} + +@Model(card.class.Card, core.class.Doc, DOMAIN_CARD) +@UX(card.string.Card) +export class TCard extends TDoc implements Card { + @Prop(TypeRef(card.class.MasterTag), card.string.MasterTag) + declare _class: Ref + + @Prop(TypeString(), core.string.Name) + title!: string + + @Prop(TypeCollaborativeDoc(), card.string.Content) + content!: MarkupBlobRef + + parent?: Ref | null + + @Prop(Collection(attachment.class.Attachment), attachment.string.Attachments, { shortLabel: attachment.string.Files }) + attachments?: number + + rank!: Rank + + @Prop(Collection(time.class.ToDo), getEmbeddedLabel('Action Items')) + todos?: CollectionSize +} + +export function createModel (builder: Builder): void { + builder.createModel(TMasterTag, TTag, TCard) + + builder.createDoc( + workbench.class.Application, + core.space.Model, + { + label: card.string.CardApplication, + icon: card.icon.Card, + accessLevel: AccountRole.User, + alias: cardId, + hidden: false, + locationResolver: card.resolver.Location, + locationDataResolver: card.resolver.LocationData, + component: card.component.Main + }, + card.app.Card + ) + + builder.createDoc( + view.class.Viewlet, + core.space.Model, + { + attachTo: card.class.Card, + descriptor: view.viewlet.Table, + configOptions: { + hiddenKeys: ['description', 'title'] + }, + config: [ + '', + '_class', + { key: '', presenter: view.component.RolePresenter, label: card.string.Tags, props: { fullSize: true } }, + 'modifiedOn' + ] + }, + card.viewlet.CardTable + ) + + builder.createDoc( + setting.class.WorkspaceSettingCategory, + core.space.Model, + { + name: 'masterTags', + label: card.string.Tags, + icon: card.icon.Tags, + role: AccountRole.User, + component: card.component.MasterTags, + order: 4400 + }, + card.ids.MasterTags + ) + + builder.mixin(card.class.Card, core.class.Class, view.mixin.ObjectPresenter, { + presenter: card.component.CardPresenter + }) + + builder.mixin(card.class.Card, core.class.Class, activity.mixin.ActivityDoc, {}) + + builder.createDoc(activity.class.ActivityExtension, core.space.Model, { + ofClass: card.class.Card, + components: { input: { component: chunter.component.ChatMessageInput } } + }) + + builder.mixin(card.class.Card, core.class.Class, setting.mixin.Editable, { + value: false + }) + + builder.mixin(card.class.Card, core.class.Class, view.mixin.ObjectPanel, { + component: card.component.EditCard + }) + + builder.mixin(card.class.Card, core.class.Class, view.mixin.ObjectEditor, { + editor: card.component.EditCard + }) + + builder.mixin(card.class.Card, core.class.Class, view.mixin.ObjectTitle, { + titleProvider: card.function.CardTitleProvider + }) + + builder.mixin(card.class.Card, core.class.Class, view.mixin.ObjectIdentifier, { + provider: card.function.CardIdProvider + }) + + builder.mixin(card.class.Card, core.class.Class, view.mixin.LinkProvider, { + encode: card.function.GetCardLink + }) + + createAction(builder, { + action: view.actionImpl.ShowPopup, + actionProps: { + component: card.component.CreateTag, + props: { + _class: card.class.Tag + }, + fillProps: { + _object: 'parent' + } + }, + label: card.string.CreateTag, + input: 'focus', + icon: view.icon.Add, + category: setting.category.Settings, + target: card.class.MasterTag, + context: { + mode: ['context', 'browser'], + group: 'edit' + } + }) + + createAction(builder, { + action: view.actionImpl.ShowPopup, + actionProps: { + component: card.component.CreateTag, + props: { + _class: card.class.Tag + }, + fillProps: { + _object: 'parent' + } + }, + label: card.string.CreateTag, + input: 'focus', + icon: view.icon.Add, + category: setting.category.Settings, + target: card.class.Tag, + context: { + mode: ['context', 'browser'], + group: 'edit' + } + }) + + builder.mixin(card.class.MasterTag, core.class.Class, view.mixin.IgnoreActions, { + actions: [setting.action.CreateMixin, view.action.OpenInNewTab] + }) + + builder.mixin(card.class.Tag, core.class.Class, view.mixin.IgnoreActions, { + actions: [setting.action.CreateMixin, view.action.OpenInNewTab] + }) + + createAction(builder, { + action: view.actionImpl.ShowPopup, + actionProps: { + component: card.component.CreateTag, + props: { + _class: card.class.MasterTag + }, + fillProps: { + _object: 'parent' + } + }, + label: card.string.CreateMasterTag, + input: 'focus', + icon: card.icon.MasterTag, + category: setting.category.Settings, + target: card.class.MasterTag, + context: { + mode: ['context', 'browser'], + group: 'edit' + } + }) + + builder.mixin(card.class.Card, core.class.Class, view.mixin.ClassFilters, { + filters: [], + ignoreKeys: ['parent'] + }) + + builder.createDoc( + presentation.class.ObjectSearchCategory, + core.space.Model, + { + icon: card.icon.Card, + label: card.string.SearchCard, + title: card.string.Cards, + query: card.completion.CardQuery, + context: ['search', 'mention', 'spotlight'], + classToSearch: card.class.Card, + priority: 500 + }, + card.completion.CardCategory + ) +} + +export default card diff --git a/models/card/src/plugin.ts b/models/card/src/plugin.ts new file mode 100644 index 0000000000..71c974037d --- /dev/null +++ b/models/card/src/plugin.ts @@ -0,0 +1,45 @@ +// +// Copyright © 2025 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 { cardId } from '@hcengineering/card' +import card from '@hcengineering/card-resources/src/plugin' +import type { Client, Doc, Ref } from '@hcengineering/core' +import {} from '@hcengineering/core' +import { mergeIds, type Resource } from '@hcengineering/platform' +import { type ObjectSearchCategory, type ObjectSearchFactory } from '@hcengineering/model-presentation' +import { type Location, type ResolvedLocation } from '@hcengineering/ui' +import { type LocationData } from '@hcengineering/workbench' + +export default mergeIds(cardId, card, { + app: { + Card: '' as Ref + }, + ids: { + MasterTags: '' as Ref + }, + completion: { + CardQuery: '' as Resource, + CardCategory: '' as Ref + }, + resolver: { + Location: '' as Resource<(loc: Location) => Promise>, + LocationData: '' as Resource<(loc: Location) => Promise> + }, + function: { + CardTitleProvider: '' as Resource<(client: Client, ref: Ref, doc?: Doc) => Promise>, + CardIdProvider: '' as Resource<(client: Client, ref: Ref, doc?: Doc) => Promise>, + GetCardLink: '' as Resource<(doc: Doc, props: Record) => Promise> + } +}) diff --git a/models/card/tsconfig.json b/models/card/tsconfig.json new file mode 100644 index 0000000000..9765b6086d --- /dev/null +++ b/models/card/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "./node_modules/@hcengineering/platform-rig/profiles/model/tsconfig.json", + + "compilerOptions": { + "rootDir": "./src", + "outDir": "./lib", + "declarationDir": "./types", + "tsBuildInfoFile": ".build/build.tsbuildinfo" + } +} \ No newline at end of file diff --git a/models/controlled-documents/src/index.ts b/models/controlled-documents/src/index.ts index 0f6085136d..fed07c2329 100644 --- a/models/controlled-documents/src/index.ts +++ b/models/controlled-documents/src/index.ts @@ -57,7 +57,6 @@ import { TDocumentCategory, TControlledDocument, TChangeControl, - TSequence, TDocumentRequest, TDocumentReviewRequest, TDocumentApprovalRequest, @@ -92,8 +91,6 @@ export function createModel (builder: Builder): void { TDocumentCategory, TControlledDocument, TChangeControl, - TSequence, - TDocumentRequest, TDocumentReviewRequest, TDocumentApprovalRequest, diff --git a/models/controlled-documents/src/migration.ts b/models/controlled-documents/src/migration.ts index 9f8cdfbb3e..a69e9e2f36 100644 --- a/models/controlled-documents/src/migration.ts +++ b/models/controlled-documents/src/migration.ts @@ -26,6 +26,7 @@ import { type Class, type Data, type Doc, + DOMAIN_SEQUENCE, DOMAIN_TX, generateId, makeDocCollabId, @@ -115,7 +116,7 @@ async function createProductChangeControlTemplate (tx: TxOperations): Promise { - const templateSeq = await tx.findOne(documents.class.Sequence, { + const templateSeq = await tx.findOne(core.class.Sequence, { _id: documents.sequence.Templates }) if (templateSeq === undefined) { await tx.createDoc( - documents.class.Sequence, + core.class.Sequence, documents.space.Documents, { attachedTo: documents.mixin.DocumentTemplate, @@ -417,6 +418,17 @@ export const documentsOperation: MigrateOperation = { { state: 'migrateProjectMetaRank', func: migrateProjectMetaRank + }, + { + state: 'migrateSequnce', + func: async (client: MigrationClient) => { + await client.update( + DOMAIN_DOCUMENTS, + { _class: 'documents:class:Sequence' as Ref> }, + { _class: core.class.Sequence } + ) + await client.move(DOMAIN_DOCUMENTS, { _class: core.class.Sequence }, DOMAIN_SEQUENCE) + } } ]) }, diff --git a/models/controlled-documents/src/types.ts b/models/controlled-documents/src/types.ts index 3d2b187ba1..30f809588e 100644 --- a/models/controlled-documents/src/types.ts +++ b/models/controlled-documents/src/types.ts @@ -30,7 +30,6 @@ import { type DocumentSpaceTypeDescriptor, type DocumentState, type DocumentTemplate, - type Sequence, type DocumentMeta, type ExternalSpace, type OrgSpace, @@ -49,7 +48,6 @@ import { IndexKind, type Class, type MarkupBlobRef, - type Doc, type Domain, type Ref, type Timestamp, @@ -459,12 +457,6 @@ export class TDocumentComment extends TChatMessage implements DocumentComment { index?: number } -@Model(documents.class.Sequence, core.class.Doc, DOMAIN_DOCUMENTS) -export class TSequence extends TDoc implements Sequence { - attachedTo!: Ref> - sequence!: number -} - @Model(documents.class.DocumentRequest, request.class.Request) @UX(documents.string.DocumentRequest) export class TDocumentRequest extends TRequest implements DocumentRequest {} diff --git a/models/core/src/core.ts b/models/core/src/core.ts index 06706406e4..67ddc55d0b 100644 --- a/models/core/src/core.ts +++ b/models/core/src/core.ts @@ -20,7 +20,6 @@ import { type Association, type AttachedDoc, type Blob, - type Card, type Class, type ClassifierKind, type Collection, @@ -43,7 +42,6 @@ import { type IndexingConfiguration, IndexKind, type Interface, - type MarkupBlobRef, type MigrationState, type Mixin, type Obj, @@ -52,11 +50,13 @@ import { type RefTo, type Relation, type Space, + type Sequence, type Timestamp, type TransientConfiguration, type Type, type TypeAny, - type Version + type Version, + DOMAIN_SEQUENCE } from '@hcengineering/core' import { Hidden, @@ -66,7 +66,6 @@ import { Prop, ReadOnly, TypeBoolean, - TypeCollaborativeDoc, TypeFileSize, TypeIntlString, TypeRef, @@ -117,22 +116,6 @@ export class TDoc extends TObj implements Doc { createdOn!: Timestamp } -@Model(core.class.Card, core.class.Doc) -@UX(core.string.Object) -export class TCard extends TDoc implements Card { - @Prop(TypeString(), core.string.Name) - title!: string - - @Prop(TypeCollaborativeDoc(), core.string.Description) - description!: MarkupBlobRef | null - - @Prop(TypeString(), core.string.Id) - identifier?: string | undefined - - @Prop(TypeRef(core.class.Card), core.string.AttachedTo) - parent?: Ref | null -} - @Model(core.class.AttachedDoc, core.class.Doc) export class TAttachedDoc extends TDoc implements AttachedDoc { @Prop(TypeRef(core.class.Doc), core.string.AttachedTo) @@ -407,3 +390,12 @@ export class TTransientConfiguration extends TClass implements TransientConfigur @Prop(TypeBoolean(), core.string.Private) broadcastOnly!: boolean } + +@Model(core.class.Sequence, core.class.Doc, DOMAIN_SEQUENCE) +export class TSequence extends TDoc implements Sequence { + @Prop(TypeRef(core.class.Class), core.string.AttachedTo) + @Index(IndexKind.Indexed) + attachedTo!: Ref> + + sequence!: number +} diff --git a/models/core/src/index.ts b/models/core/src/index.ts index 940a09cbac..f86265dca6 100644 --- a/models/core/src/index.ts +++ b/models/core/src/index.ts @@ -35,7 +35,6 @@ import { TAttachedDoc, TAttribute, TBlob, - TCard, TClass, TCollection, TConfiguration, @@ -71,7 +70,8 @@ import { TTypeRelatedDocument, TTypeString, TTypeTimestamp, - TVersion + TVersion, + TSequence } from './core' import { definePermissions } from './permissions' import { @@ -146,13 +146,13 @@ export function createModel (builder: Builder): void { TEnum, TTypeAny, TTypeRelatedDocument, - TCard, TDocIndexState, TFullTextSearchContext, TConfiguration, TConfigurationElement, TIndexConfiguration, TStatus, + TSequence, TDomainStatusPlaceholder, TStatusCategory, TMigrationState, diff --git a/models/document/src/index.ts b/models/document/src/index.ts index 29d0e74241..ab173e6bda 100644 --- a/models/document/src/index.ts +++ b/models/document/src/index.ts @@ -14,11 +14,10 @@ // import activity from '@hcengineering/activity' -import type { Class, CollectionSize, MarkupBlobRef, Domain, Rank, Role, RolesAssignment } from '@hcengineering/core' +import type { CollectionSize, Domain, MarkupBlobRef, Rank, Role, RolesAssignment } from '@hcengineering/core' import { Account, AccountRole, IndexKind, Ref } from '@hcengineering/core' import { type Document, - type DocumentEmbedding, type DocumentSnapshot, type SavedDocument, type Teamspace, @@ -39,7 +38,7 @@ import { TypeString, UX } from '@hcengineering/model' -import attachment, { TAttachment } from '@hcengineering/model-attachment' +import attachment from '@hcengineering/model-attachment' import chunter from '@hcengineering/model-chunter' import core, { TDoc, TTypedSpace } from '@hcengineering/model-core' import { createPublicLinkAction } from '@hcengineering/model-guest' @@ -62,13 +61,6 @@ export { document as default } export const DOMAIN_DOCUMENT = 'document' as Domain -@Model(document.class.DocumentEmbedding, attachment.class.Attachment) -@UX(document.string.Embedding) -export class TDocumentEmbedding extends TAttachment implements DocumentEmbedding { - declare attachedTo: Ref - declare attachedToClass: Ref> -} - @Model(document.class.Document, core.class.Doc, DOMAIN_DOCUMENT) @UX(document.string.Document, document.icon.Document, undefined, 'name', undefined, document.string.Documents) export class TDocument extends TDoc implements Document, Todoable { @@ -91,7 +83,7 @@ export class TDocument extends TDoc implements Document, Todoable { @Hidden() lockedBy?: Ref - @Prop(Collection(document.class.DocumentEmbedding), document.string.Embeddings) + @Prop(Collection(attachment.class.Embedding), attachment.string.Embeddings) embeddings?: number @Prop(Collection(attachment.class.Attachment), attachment.string.Attachments, { shortLabel: attachment.string.Files }) @@ -278,7 +270,7 @@ function defineTeamspace (builder: Builder): void { } function defineDocument (builder: Builder): void { - builder.createModel(TDocument, TDocumentSnapshot, TDocumentEmbedding, TSavedDocument, TDefaultTeamspaceTypeData) + builder.createModel(TDocument, TDocumentSnapshot, TSavedDocument, TDefaultTeamspaceTypeData) builder.mixin(document.class.Document, core.class.Class, time.mixin.ItemPresenter, { presenter: document.component.DocumentToDoPresenter diff --git a/models/document/src/migration.ts b/models/document/src/migration.ts index 79dcd9fd4a..dffaeb7a44 100644 --- a/models/document/src/migration.ts +++ b/models/document/src/migration.ts @@ -14,17 +14,17 @@ // import { + DOMAIN_MODEL_TX, + DOMAIN_TX, + makeDocCollabId, + MeasureMetricsContext, + SortingOrder, type Class, type CollaborativeDoc, type Doc, - type Ref, - DOMAIN_TX, - DOMAIN_MODEL_TX, - MeasureMetricsContext, - SortingOrder, - makeDocCollabId + type Ref } from '@hcengineering/core' -import { type DocumentSnapshot, type Document, type Teamspace } from '@hcengineering/document' +import { type Document, type DocumentSnapshot, type Teamspace } from '@hcengineering/document' import { migrateSpaceRanks, tryMigrate, @@ -41,6 +41,7 @@ import { type Asset } from '@hcengineering/platform' import { makeRank } from '@hcengineering/rank' import { loadCollabYdoc, saveCollabYdoc, yDocCopyXmlField } from '@hcengineering/collaboration' +import attachment, { DOMAIN_ATTACHMENT } from '@hcengineering/model-attachment' import document, { documentId, DOMAIN_DOCUMENT } from './index' async function migrateDocumentIcons (client: MigrationClient): Promise { @@ -350,9 +351,22 @@ export const documentOperation: MigrateOperation = { { state: 'removeOldClasses', func: removeOldClasses + }, + { + state: 'migrateEmbeddings', + func: migrateEmbeddings } ]) }, async upgrade (state: Map>, client: () => Promise): Promise {} } + +async function migrateEmbeddings (client: MigrationClient): Promise { + await client.update( + DOMAIN_DOCUMENT, + { _class: 'document:class:DocumentEmbedding' as Ref> }, + { _class: attachment.class.Embedding } + ) + await client.move(DOMAIN_DOCUMENT, { _class: attachment.class.Embedding }, DOMAIN_ATTACHMENT) +} diff --git a/models/drive/src/index.ts b/models/drive/src/index.ts index 4e2f5cbda3..d6d5bd7e4f 100644 --- a/models/drive/src/index.ts +++ b/models/drive/src/index.ts @@ -54,7 +54,7 @@ import { TypeTimestamp, UX } from '@hcengineering/model' -import { TAttachedDoc, TCard, TType, TTypedSpace } from '@hcengineering/model-core' +import { TAttachedDoc, TDoc, TType, TTypedSpace } from '@hcengineering/model-core' import presentation from '@hcengineering/model-presentation' import print from '@hcengineering/model-print' import tracker from '@hcengineering/model-tracker' @@ -84,19 +84,19 @@ export class TDefaultDriveTypeData extends TDrive implements RolesAssignment { [key: Ref]: Ref[] } -@Model(drive.class.Resource, core.class.Card, DOMAIN_DRIVE) +@Model(drive.class.Resource, core.class.Doc, DOMAIN_DRIVE) @UX(drive.string.Resource) -export class TResource extends TCard implements Resource { +export class TResource extends TDoc implements Resource { declare space: Ref @Prop(TypeString(), drive.string.Name) @Index(IndexKind.FullText) - declare title: string + title!: string @Prop(TypeRef(drive.class.Resource), drive.string.Parent) @Index(IndexKind.Indexed) @ReadOnly() - declare parent: Ref + parent!: Ref @Prop(TypeRef(drive.class.Resource), drive.string.Path) @ReadOnly() diff --git a/models/setting/src/index.ts b/models/setting/src/index.ts index 5d5bda6e90..5afe7b274b 100644 --- a/models/setting/src/index.ts +++ b/models/setting/src/index.ts @@ -445,24 +445,28 @@ export function createModel (builder: Builder): void { actions: [view.action.Delete] }) - createAction(builder, { - action: view.actionImpl.ShowPopup, - actionProps: { - component: setting.component.CreateMixin, - fillProps: { - _object: 'value' + createAction( + builder, + { + action: view.actionImpl.ShowPopup, + actionProps: { + component: setting.component.CreateMixin, + fillProps: { + _object: 'value' + } + }, + label: setting.string.CreateMixin, + input: 'focus', + icon: view.icon.Pin, + category: setting.category.Settings, + target: core.class.Class, + context: { + mode: ['context', 'browser'], + group: 'edit' } }, - label: setting.string.CreateMixin, - input: 'focus', - icon: view.icon.Pin, - category: setting.category.Settings, - target: core.class.Class, - context: { - mode: ['context', 'browser'], - group: 'edit' - } - }) + setting.action.CreateMixin + ) createAction( builder, diff --git a/models/setting/src/plugin.ts b/models/setting/src/plugin.ts index 936ffdcb07..6c87f0512d 100644 --- a/models/setting/src/plugin.ts +++ b/models/setting/src/plugin.ts @@ -54,6 +54,7 @@ export default mergeIds(settingId, setting, { Settings: '' as Ref }, action: { + CreateMixin: '' as Ref>, DeleteMixin: '' as Ref }, actionImpl: { diff --git a/models/task/src/index.ts b/models/task/src/index.ts index 0e4a37c7c2..ccc078d3d2 100644 --- a/models/task/src/index.ts +++ b/models/task/src/index.ts @@ -19,7 +19,6 @@ import { DOMAIN_MODEL, IndexKind, type Class, - type Doc, type Domain, type Ref, type Status, @@ -53,6 +52,7 @@ import core, { TSpaceTypeDescriptor, TTypedSpace } from '@hcengineering/model-core' +import { createPublicLinkAction } from '@hcengineering/model-guest' import view, { classPresenter, createAction, @@ -70,7 +70,6 @@ import { type ProjectTypeClass, type ProjectTypeDescriptor, type Rank, - type Sequence, type Task, type TaskType, type TaskTypeClass, @@ -79,16 +78,14 @@ import { } from '@hcengineering/task' import type { AnyComponent } from '@hcengineering/ui' import { PaletteColorIndexes } from '@hcengineering/ui/src/colors' -import { createPublicLinkAction } from '@hcengineering/model-guest' import task from './plugin' export { createProjectType, taskId } from '@hcengineering/task' -export { createSequence, taskOperation, migrateDefaultStatusesBase } from './migration' +export { createSequence, migrateDefaultStatusesBase, taskOperation } from './migration' export { default } from './plugin' export const DOMAIN_TASK = 'task' as Domain -export const DOMAIN_KANBAN = 'kanban' as Domain /** * @public @@ -237,12 +234,6 @@ export class TProjectTypeDescriptor extends TSpaceTypeDescriptor implements Proj declare baseClass: Ref> } -@Model(task.class.Sequence, core.class.Doc, DOMAIN_KANBAN) -export class TSequence extends TDoc implements Sequence { - attachedTo!: Ref> - sequence!: number -} - /** * @public */ @@ -259,7 +250,6 @@ export const actionTemplates = template({ export function createModel (builder: Builder): void { builder.createModel( TKanbanCard, - TSequence, TTask, TProject, TProjectType, @@ -566,16 +556,4 @@ export function createModel (builder: Builder): void { { priority: 1 } ] }) - builder.createDoc(core.class.DomainIndexConfiguration, core.space.Model, { - domain: DOMAIN_KANBAN, - disabled: [ - { space: 1 }, - { modifiedOn: 1 }, - { modifiedBy: 1 }, - { createdBy: 1 }, - { createdOn: -1 }, - { _class: 1 }, - { attachedToClass: 1 } - ] - }) } diff --git a/models/task/src/migration.ts b/models/task/src/migration.ts index 259d456fc0..4a868f19e6 100644 --- a/models/task/src/migration.ts +++ b/models/task/src/migration.ts @@ -16,6 +16,7 @@ import activity, { type DocUpdateMessage } from '@hcengineering/activity' import { DOMAIN_MODEL_TX, + DOMAIN_SEQUENCE, DOMAIN_STATUS, DOMAIN_TX, TxOperations, @@ -23,6 +24,7 @@ import { type Attribute, type Class, type Doc, + type Domain, type Ref, type Space, type Status, @@ -53,15 +55,15 @@ import { type TaskType } from '@hcengineering/task' -import { DOMAIN_KANBAN, DOMAIN_TASK } from '.' +import { DOMAIN_TASK } from '.' import task from './plugin' /** * @public */ export async function createSequence (tx: TxOperations, _class: Ref>): Promise { - if ((await tx.findOne(task.class.Sequence, { attachedTo: _class })) === undefined) { - await tx.createDoc(task.class.Sequence, core.space.Workspace, { + if ((await tx.findOne(core.class.Sequence, { attachedTo: _class })) === undefined) { + await tx.createDoc(core.class.Sequence, core.space.Workspace, { attachedTo: _class, sequence: 0 }) @@ -566,7 +568,7 @@ export const taskOperation: MigrateOperation = { { state: 'removeDeprecatedSpace', func: async (client: MigrationClient) => { - await migrateSpace(client, task.space.Sequence, core.space.Workspace, [DOMAIN_KANBAN]) + await migrateSpace(client, task.space.Sequence, core.space.Workspace, ['kanban' as Domain]) } }, { @@ -603,6 +605,17 @@ export const taskOperation: MigrateOperation = { } ) } + }, + { + state: 'migrateSequnce', + func: async (client: MigrationClient) => { + await client.update( + 'kanban' as Domain, + { _class: 'task:class:Sequence' as Ref> }, + { _class: core.class.Sequence } + ) + await client.move('kanban' as Domain, { _class: core.class.Sequence }, DOMAIN_SEQUENCE) + } } ]) }, diff --git a/models/training/src/index.ts b/models/training/src/index.ts index b7815b8301..fc25f209de 100644 --- a/models/training/src/index.ts +++ b/models/training/src/index.ts @@ -40,7 +40,6 @@ import view, { classPresenter, createAction } from '@hcengineering/model-view' import workbench from '@hcengineering/model-workbench' import training from './plugin' import { - TSequence, TTraining, TTrainingAttempt, TTrainingAttemptState, @@ -91,8 +90,6 @@ function defineBase (builder: Builder): void { }, presenter: training.component.TrainingRequestNotificationPresenter }) - - builder.createModel(TSequence) } function defineSpaceType (builder: Builder): void { diff --git a/models/training/src/migration.ts b/models/training/src/migration.ts index 918a7e12a8..5de33cc4dc 100644 --- a/models/training/src/migration.ts +++ b/models/training/src/migration.ts @@ -13,18 +13,34 @@ // limitations under the License. // -import { TxOperations, type Ref, type TypedSpace } from '@hcengineering/core' +import { Class, Doc, DOMAIN_SEQUENCE, Sequence, TxOperations, type Ref, type TypedSpace } from '@hcengineering/core' import { + tryMigrate, tryUpgrade, type MigrateOperation, type MigrationClient, type MigrationUpgradeClient } from '@hcengineering/model' import core from '@hcengineering/model-core' -import training, { trainingId, type Sequence } from '@hcengineering/training' +import training, { trainingId } from '@hcengineering/training' +import { DOMAIN_TRAINING } from './types' export const trainingOperation: MigrateOperation = { - async migrate (client: MigrationClient): Promise {}, + async migrate (client: MigrationClient): Promise { + await tryMigrate(client, trainingId, [ + { + state: 'migrateSequnce', + func: async (client: MigrationClient) => { + await client.update( + DOMAIN_TRAINING, + { _class: 'training:class:Sequence' as Ref> }, + { _class: core.class.Sequence } + ) + await client.move(DOMAIN_TRAINING, { _class: core.class.Sequence }, DOMAIN_SEQUENCE) + } + } + ]) + }, async upgrade (state: Map>, client: () => Promise): Promise { await tryUpgrade(state, client, trainingId, [ { @@ -65,7 +81,7 @@ async function ensureTypedSpace (tx: TxOperations): Promise> { } async function ensureSequence (tx: TxOperations): Promise> { - const existing = await tx.findOne(training.class.Sequence, { + const existing = await tx.findOne(core.class.Sequence, { attachedTo: training.class.Training }) @@ -73,7 +89,7 @@ async function ensureSequence (tx: TxOperations): Promise> { return existing._id } - return await tx.createDoc(training.class.Sequence, training.space.Trainings, { + return await tx.createDoc(core.class.Sequence, training.space.Trainings, { attachedTo: training.class.Training, sequence: 0 }) diff --git a/models/training/src/types.ts b/models/training/src/types.ts index 5f05543a79..21a595e2b9 100644 --- a/models/training/src/types.ts +++ b/models/training/src/types.ts @@ -18,7 +18,6 @@ import attachments from '@hcengineering/model-attachment' import questions, { TypePercentage } from '@hcengineering/model-questions' import type { Answer, Percentage, Question } from '@hcengineering/questions' import { - type Sequence, type Training, type TrainingAttempt, TrainingAttemptState, @@ -29,7 +28,6 @@ import contact, { type Employee } from '@hcengineering/contact' import core, { type Class, type CollectionSize, - type Doc, type Domain, IndexKind, type Markup, @@ -261,15 +259,6 @@ export class TTrainingAttempt extends TAttachedDoc implements TrainingAttempt { assessmentsPassed: number | null = null } -@Model(training.class.Sequence, core.class.Doc, DOMAIN_TRAINING) -export class TSequence extends TDoc implements Sequence { - @Prop(TypeRef(core.class.Doc), core.string.AttachedTo) - @Index(IndexKind.Indexed) - attachedTo!: Ref> - - sequence!: number -} - @Mixin(training.mixin.TrainingsTypeData, core.class.TypedSpace) @UX(getEmbeddedLabel('Default Trainings'), training.icon.TrainingApplication) export class TTrainingsTypeData extends TTypedSpace implements RolesAssignment { diff --git a/packages/collaborator-client/src/__tests__/utils.test.ts b/packages/collaborator-client/src/__tests__/utils.test.ts index 992e39c2bd..06ca9d9dde 100644 --- a/packages/collaborator-client/src/__tests__/utils.test.ts +++ b/packages/collaborator-client/src/__tests__/utils.test.ts @@ -19,18 +19,18 @@ import { encodeDocumentId, decodeDocumentId } from '../utils' describe('utils', () => { it('encodeDocumentId', () => { const doc: CollaborativeDoc = { - objectClass: core.class.Card, + objectClass: core.class.Doc, objectId: 'doc1' as Ref, objectAttr: 'description' } - expect(encodeDocumentId('ws1', doc)).toEqual('ws1|core:class:Card|doc1|description') + expect(encodeDocumentId('ws1', doc)).toEqual('ws1|core:class:Doc|doc1|description') }) describe('decodeDocumentId', () => { - expect(decodeDocumentId('ws1|core:class:Card|doc1|description')).toEqual({ + expect(decodeDocumentId('ws1|core:class:Doc|doc1|description')).toEqual({ workspaceId: 'ws1', documentId: { - objectClass: core.class.Card, + objectClass: core.class.Doc, objectId: 'doc1' as Ref, objectAttr: 'description' } diff --git a/packages/core/src/classes.ts b/packages/core/src/classes.ts index c9837ba006..4cbfc2311a 100644 --- a/packages/core/src/classes.ts +++ b/packages/core/src/classes.ts @@ -80,13 +80,6 @@ export interface Doc extends Obj { createdOn?: Timestamp // Marked as optional since it will be filled by platform. } -export interface Card extends Doc { - title: string - description?: MarkupBlobRef | null - identifier?: string - parent?: Ref | null -} - /** * @public */ @@ -398,6 +391,11 @@ export const DOMAIN_BLOB = 'blob' as Domain export const DOMAIN_DOC_INDEX_STATE = 'doc-index-state' as Domain +/** + * @public + */ +export const DOMAIN_SEQUENCE = 'sequence' as Domain + // S P A C E /** @@ -556,6 +554,14 @@ export interface DocIndexState extends Doc { removed: boolean } +/** + * @public + */ +export interface Sequence extends Doc { + attachedTo: Ref> + sequence: number +} + /** * @public * diff --git a/packages/core/src/component.ts b/packages/core/src/component.ts index 4a67a3cadc..db60627c65 100644 --- a/packages/core/src/component.ts +++ b/packages/core/src/component.ts @@ -12,9 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. // -import type { IntlString, Plugin, StatusCode } from '@hcengineering/platform' +import type { Asset, IntlString, Plugin, StatusCode } from '@hcengineering/platform' import { plugin } from '@hcengineering/platform' import { Mixin, Version, type Rank } from '.' +import type { BenchmarkDoc } from './benchmark' import type { Account, AnyAttribute, @@ -22,9 +23,7 @@ import type { Association, AttachedDoc, Blob, - Card, Class, - MarkupBlobRef, Collection, Configuration, ConfigurationElement, @@ -37,6 +36,7 @@ import type { Hyperlink, IndexingConfiguration, Interface, + MarkupBlobRef, MigrationState, Obj, Permission, @@ -46,6 +46,7 @@ import type { RelatedDocument, Relation, Role, + Sequence, Space, SpaceType, SpaceTypeDescriptor, @@ -69,7 +70,6 @@ import type { TxUpdateDoc, TxWorkspaceEvent } from './tx' -import type { BenchmarkDoc } from './benchmark' /** * @public @@ -85,7 +85,6 @@ export default plugin(coreId, { class: { Obj: '' as Ref>, Doc: '' as Ref>, - Card: '' as Ref>, Blob: '' as Ref>, AttachedDoc: '' as Ref>, Class: '' as Ref>>, @@ -146,7 +145,23 @@ export default plugin(coreId, { BenchmarkDoc: '' as Ref>, FullTextSearchContext: '' as Ref>, Association: '' as Ref>, - Relation: '' as Ref> + Relation: '' as Ref>, + Sequence: '' as Ref> + }, + icon: { + TypeString: '' as Asset, + TypeBlob: '' as Asset, + TypeHyperlink: '' as Asset, + TypeNumber: '' as Asset, + TypeMarkup: '' as Asset, + TypeRank: '' as Asset, + TypeRecord: '' as Asset, + TypeBoolean: '' as Asset, + TypeDate: '' as Asset, + TypeRef: '' as Asset, + TypeArray: '' as Asset, + TypeEnumOf: '' as Asset, + TypeCollection: '' as Asset }, mixin: { ConfigurationElement: '' as Ref>, diff --git a/packages/core/src/hierarchy.ts b/packages/core/src/hierarchy.ts index 2732481d0f..6a7efb168b 100644 --- a/packages/core/src/hierarchy.ts +++ b/packages/core/src/hierarchy.ts @@ -19,7 +19,7 @@ import { ClassifierKind } from './classes' import { clone as deepClone } from './clone' import core from './component' import { _createMixinProxy, _mixinClass, _toDoc, PROXY_MIXIN_CLASS_KEY } from './proxy' -import type { Tx, TxCreateDoc, TxMixin, TxRemoveDoc, TxUpdateDoc } from './tx' +import type { Tx, TxCreateDoc, TxCUD, TxMixin, TxRemoveDoc, TxUpdateDoc } from './tx' import { TxProcessor } from './tx' /** @@ -246,12 +246,13 @@ export class Hierarchy { } } + private isClassifierTx (tx: TxCUD): boolean { + const base = [core.class.Class, core.class.Mixin, core.class.Interface] + return base.includes(tx.objectClass) || this.isDerived(tx.objectClass, core.class.Class) + } + private txCreateDoc (tx: TxCreateDoc): void { - if ( - tx.objectClass === core.class.Class || - tx.objectClass === core.class.Interface || - tx.objectClass === core.class.Mixin - ) { + if (this.isClassifierTx(tx)) { const _id = tx.objectId as Ref this.classifiers.set(_id, TxProcessor.createDoc2Doc(tx as TxCreateDoc)) this.updateAncestors(_id) @@ -270,7 +271,7 @@ export class Hierarchy { this.addAttribute(TxProcessor.updateDoc2Doc(doc, updateTx)) this.classifierProperties.delete(doc.attributeOf) - } else if (tx.objectClass === core.class.Mixin || tx.objectClass === core.class.Class) { + } else if (this.isClassifierTx(tx)) { const updateTx = tx as TxUpdateDoc>> const doc = this.classifiers.get(updateTx.objectId) if (doc === undefined) return @@ -287,7 +288,7 @@ export class Hierarchy { const map = this.attributes.get(doc.attributeOf) map?.delete(doc.name) this.attributesById.delete(removeTx.objectId) - } else if (tx.objectClass === core.class.Mixin) { + } else if (this.isClassifierTx(tx)) { const removeTx = tx as TxRemoveDoc>> this.updateDescendant(removeTx.objectId, false) this.updateAncestors(removeTx.objectId, false) @@ -296,7 +297,7 @@ export class Hierarchy { } private txMixin (tx: TxMixin): void { - if (this.isDerived(tx.objectClass, core.class.Class)) { + if (this.isClassifierTx(tx)) { const obj = this.getClass(tx.objectId as Ref>) as any TxProcessor.updateMixin4Doc(obj, tx) } diff --git a/packages/core/src/tx.ts b/packages/core/src/tx.ts index 956cf15972..0df5846d4f 100644 --- a/packages/core/src/tx.ts +++ b/packages/core/src/tx.ts @@ -282,6 +282,7 @@ export type DocumentUpdate = Partial> & PushOptions & SetEmbeddedOptions & IncOptions & +UnsetOptions & SpaceUpdate /** diff --git a/packages/model/src/dsl.ts b/packages/model/src/dsl.ts index 6d0e98d34e..0f07a46dd0 100644 --- a/packages/model/src/dsl.ts +++ b/packages/model/src/dsl.ts @@ -385,98 +385,98 @@ export class Builder { * @public */ export function TypeString (): Type { - return { _class: core.class.TypeString, label: core.string.String } + return { _class: core.class.TypeString, label: core.string.String, icon: core.icon.TypeString } } /** * @public */ export function TypeRelation (): Type { - return { _class: core.class.TypeRelation, label: core.string.Relation } + return { _class: core.class.TypeRelation, label: core.string.Relation, icon: core.icon.TypeRef } } /** * @public */ export function TypeBlob (): Type { - return { _class: core.class.TypeBlob, label: core.string.String } + return { _class: core.class.TypeBlob, label: core.string.String, icon: core.icon.TypeBlob } } /** * @public */ export function TypeHyperlink (): Type { - return { _class: core.class.TypeHyperlink, label: core.string.Hyperlink } + return { _class: core.class.TypeHyperlink, label: core.string.Hyperlink, icon: core.icon.TypeHyperlink } } /** * @public */ export function TypeNumber (): Type { - return { _class: core.class.TypeNumber, label: core.string.Number } + return { _class: core.class.TypeNumber, label: core.string.Number, icon: core.icon.TypeNumber } } /** * @public */ export function TypeMarkup (): Type { - return { _class: core.class.TypeMarkup, label: core.string.Markup } + return { _class: core.class.TypeMarkup, label: core.string.Markup, icon: core.icon.TypeMarkup } } /** * @public */ -export function TypeRecord (): Type { - return { _class: core.class.TypeRecord, label: core.string.Record } +export function TypeRecord (): Type> { + return { _class: core.class.TypeRecord, label: core.string.Record, icon: core.icon.TypeRecord } } /** * @public */ export function TypeIntlString (): Type { - return { _class: core.class.TypeIntlString, label: core.string.IntlString } + return { _class: core.class.TypeIntlString, label: core.string.IntlString, icon: core.icon.TypeRef } } /** * @public */ export function TypeBoolean (): Type { - return { _class: core.class.TypeBoolean, label: core.string.Boolean } + return { _class: core.class.TypeBoolean, label: core.string.Boolean, icon: core.icon.TypeBoolean } } /** * @public */ export function TypeTimestamp (): Type { - return { _class: core.class.TypeTimestamp, label: core.string.Timestamp } + return { _class: core.class.TypeTimestamp, label: core.string.Timestamp, icon: core.icon.TypeDate } } /** * @public */ export function TypeDate (mode: DateRangeMode = DateRangeMode.DATE, withShift: boolean = true): TypeDateType { - return { _class: core.class.TypeDate, label: core.string.Date, mode, withShift } + return { _class: core.class.TypeDate, label: core.string.Date, icon: core.icon.TypeDate, mode, withShift } } /** * @public */ export function TypeRef (_class: Ref>): RefTo { - return { _class: core.class.RefTo, label: core.string.Ref, to: _class } + return { _class: core.class.RefTo, label: core.string.Ref, icon: core.icon.TypeRef, to: _class } } /** * @public */ export function TypeEnum (of: Ref): EnumOf { - return { _class: core.class.EnumOf, label: core.string.Enum, of } + return { _class: core.class.EnumOf, label: core.string.Enum, icon: core.icon.TypeEnumOf, of } } /** * @public */ export function TypeFileSize (): Type { - return { _class: core.class.TypeFileSize, label: core.string.Size } + return { _class: core.class.TypeFileSize, label: core.string.Size, icon: core.icon.TypeNumber } } /** @@ -494,26 +494,32 @@ export function TypeAny ( * @public */ export function Collection (clazz: Ref>, itemLabel?: IntlString): TypeCollection { - return { _class: core.class.Collection, label: core.string.Collection, of: clazz, itemLabel } + return { + _class: core.class.Collection, + label: core.string.Collection, + icon: core.icon.TypeCollection, + of: clazz, + itemLabel + } } /** * @public */ export function ArrOf> (type: Type): TypeArrOf { - return { _class: core.class.ArrOf, label: core.string.Array, of: type } + return { _class: core.class.ArrOf, label: core.string.Array, of: type, icon: core.icon.TypeArray } } /** * @public */ export function TypeCollaborativeDoc (): Type { - return { _class: core.class.TypeCollaborativeDoc, label: core.string.MarkupBlobRef } + return { _class: core.class.TypeCollaborativeDoc, label: core.string.MarkupBlobRef, icon: core.icon.TypeMarkup } } /** * @public */ export function TypeRank (): Type { - return { _class: core.class.TypeRank, label: core.string.Rank } + return { _class: core.class.TypeRank, label: core.string.Rank, icon: core.icon.TypeRank } } diff --git a/packages/presentation/src/components/AttributeBarEditor.svelte b/packages/presentation/src/components/AttributeBarEditor.svelte index a6490c69b2..6bb9fed1f4 100644 --- a/packages/presentation/src/components/AttributeBarEditor.svelte +++ b/packages/presentation/src/components/AttributeBarEditor.svelte @@ -16,11 +16,10 @@ {#if editor} @@ -77,7 +79,15 @@ component: Label, props: { label: attribute.label } }} - >