UBERF-4632: refactor activity classes structure (#4190)

Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
Kristina 2023-12-13 19:59:11 +04:00 committed by GitHub
parent d54422d737
commit 2bf1a03907
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
174 changed files with 2535 additions and 2134 deletions

View File

@ -248,6 +248,9 @@ dependencies:
'@rush-temp/model-request': '@rush-temp/model-request':
specifier: file:./projects/model-request.tgz specifier: file:./projects/model-request.tgz
version: file:projects/model-request.tgz(svelte@4.2.5)(typescript@5.2.2) version: file:projects/model-request.tgz(svelte@4.2.5)(typescript@5.2.2)
'@rush-temp/model-server-activity':
specifier: file:./projects/model-server-activity.tgz
version: file:projects/model-server-activity.tgz(svelte@4.2.5)(typescript@5.2.2)
'@rush-temp/model-server-attachment': '@rush-temp/model-server-attachment':
specifier: file:./projects/model-server-attachment.tgz specifier: file:./projects/model-server-attachment.tgz
version: file:projects/model-server-attachment.tgz(svelte@4.2.5)(typescript@5.2.2) version: file:projects/model-server-attachment.tgz(svelte@4.2.5)(typescript@5.2.2)
@ -419,6 +422,12 @@ dependencies:
'@rush-temp/server': '@rush-temp/server':
specifier: file:./projects/server.tgz specifier: file:./projects/server.tgz
version: file:projects/server.tgz(esbuild@0.16.17)(svelte@4.2.5) version: file:projects/server.tgz(esbuild@0.16.17)(svelte@4.2.5)
'@rush-temp/server-activity':
specifier: file:./projects/server-activity.tgz
version: file:projects/server-activity.tgz(esbuild@0.16.17)(svelte@4.2.5)(ts-node@10.9.1)
'@rush-temp/server-activity-resources':
specifier: file:./projects/server-activity-resources.tgz
version: file:projects/server-activity-resources.tgz(@types/node@16.11.68)(esbuild@0.16.17)(svelte@4.2.5)(ts-node@10.9.1)
'@rush-temp/server-attachment': '@rush-temp/server-attachment':
specifier: file:./projects/server-attachment.tgz specifier: file:./projects/server-attachment.tgz
version: file:projects/server-attachment.tgz(esbuild@0.16.17)(svelte@4.2.5)(ts-node@10.9.1) version: file:projects/server-attachment.tgz(esbuild@0.16.17)(svelte@4.2.5)(ts-node@10.9.1)
@ -17385,7 +17394,7 @@ packages:
dev: false dev: false
file:projects/activity-resources.tgz(@types/node@16.11.68)(esbuild@0.16.17)(postcss-load-config@4.0.1)(postcss@8.4.31)(ts-node@10.9.1): file:projects/activity-resources.tgz(@types/node@16.11.68)(esbuild@0.16.17)(postcss-load-config@4.0.1)(postcss@8.4.31)(ts-node@10.9.1):
resolution: {integrity: sha512-DVHj9i9C5lbJ32UBOF+g2PFNkto0xeOjjTO3q0lfOUw/pyRji3eDOomUlQowQF/Ssfj2ENj2zbVf0qfwkajqFg==, tarball: file:projects/activity-resources.tgz} resolution: {integrity: sha512-F4DXewrthjnPi36RuMEgym+/VACMDSyCmP8QvXHUPvwu7x113/rtbhzOhSPSaj+jwZCzMiKTKXOU68B8Q1j+fw==, tarball: file:projects/activity-resources.tgz}
id: file:projects/activity-resources.tgz id: file:projects/activity-resources.tgz
name: '@rush-temp/activity-resources' name: '@rush-temp/activity-resources'
version: 0.0.0 version: 0.0.0
@ -17431,7 +17440,7 @@ packages:
dev: false dev: false
file:projects/activity.tgz(@types/node@16.11.68)(esbuild@0.16.17)(svelte@4.2.5)(ts-node@10.9.1): file:projects/activity.tgz(@types/node@16.11.68)(esbuild@0.16.17)(svelte@4.2.5)(ts-node@10.9.1):
resolution: {integrity: sha512-h7I/WsfTBnPccjlbHUvZmZk8FQLucSPZ7kHmei9tY1rqKMX6MgDYnRN5sDQlrcKOJSwxoGRBK63OU1L2WBnzZg==, tarball: file:projects/activity.tgz} resolution: {integrity: sha512-DwKYrRwF0ueeZMJ/FS/LEg+r/HhwqApV4K8cCmy0snR8ANFai7ySCs+4kswontH7boYtqqYXPc0Mh3GbJt9PKw==, tarball: file:projects/activity.tgz}
id: file:projects/activity.tgz id: file:projects/activity.tgz
name: '@rush-temp/activity' name: '@rush-temp/activity'
version: 0.0.0 version: 0.0.0
@ -17529,7 +17538,7 @@ packages:
dev: false dev: false
file:projects/attachment-resources.tgz(@types/node@16.11.68)(esbuild@0.16.17)(postcss-load-config@4.0.1)(postcss@8.4.31)(ts-node@10.9.1): file:projects/attachment-resources.tgz(@types/node@16.11.68)(esbuild@0.16.17)(postcss-load-config@4.0.1)(postcss@8.4.31)(ts-node@10.9.1):
resolution: {integrity: sha512-QPfn6dtMu8QvYwO0UoayUlCuk6qMfyOo836hndO4KKPvt71Q+1uTw5c2Q4vMNckG50tOH65S/gmTuPuNm9DQug==, tarball: file:projects/attachment-resources.tgz} resolution: {integrity: sha512-+Zr0eBeCAPnbhW+YAVY53/OQ0IY+ORNdIJXxWONDojcEvg7ANDm7EL/P/fyXMC6zst21/rJK/Wr+QDSK0zxQXA==, tarball: file:projects/attachment-resources.tgz}
id: file:projects/attachment-resources.tgz id: file:projects/attachment-resources.tgz
name: '@rush-temp/attachment-resources' name: '@rush-temp/attachment-resources'
version: 0.0.0 version: 0.0.0
@ -17690,7 +17699,7 @@ packages:
dev: false dev: false
file:projects/bitrix.tgz(@types/node@16.11.68)(esbuild@0.16.17)(svelte@4.2.5)(ts-node@10.9.1): file:projects/bitrix.tgz(@types/node@16.11.68)(esbuild@0.16.17)(svelte@4.2.5)(ts-node@10.9.1):
resolution: {integrity: sha512-KSTAiioVIT5On4ssg74B1eLoBrcbAMC7iO6LIoIIvVZu9bftEF+3jJ443j4x9mdgUPABKo/c31bRwLNxl+K+Lw==, tarball: file:projects/bitrix.tgz} resolution: {integrity: sha512-b6hu02DfbmNCgR4rJ3btQJeOMKvH5Ce/+ctqexUT48rqdVQCcETVqLM7OU1oUKekwU5wRpiW5lhwXKeYqwh5Sw==, tarball: file:projects/bitrix.tgz}
id: file:projects/bitrix.tgz id: file:projects/bitrix.tgz
name: '@rush-temp/bitrix' name: '@rush-temp/bitrix'
version: 0.0.0 version: 0.0.0
@ -17979,7 +17988,7 @@ packages:
dev: false dev: false
file:projects/chunter-resources.tgz(@types/node@16.11.68)(esbuild@0.16.17)(postcss-load-config@4.0.1)(postcss@8.4.31)(ts-node@10.9.1): file:projects/chunter-resources.tgz(@types/node@16.11.68)(esbuild@0.16.17)(postcss-load-config@4.0.1)(postcss@8.4.31)(ts-node@10.9.1):
resolution: {integrity: sha512-gjwoANHcUvGbxTXLdl0tFOzdiSsOMVy7Jm2zzArXY9+EVyrURwq2qEjgnA36KnkWHd7mUEpEUJBd8MWndKCJgA==, tarball: file:projects/chunter-resources.tgz} resolution: {integrity: sha512-IW9B1wnQQ6r603qhRGUI498gj5Cn4qsdnRmbd/z6F+6nYCCw2vfYDY1SihlRZBfs31U8f6qgJNov5rGhjhv5ZQ==, tarball: file:projects/chunter-resources.tgz}
id: file:projects/chunter-resources.tgz id: file:projects/chunter-resources.tgz
name: '@rush-temp/chunter-resources' name: '@rush-temp/chunter-resources'
version: 0.0.0 version: 0.0.0
@ -18026,7 +18035,7 @@ packages:
dev: false dev: false
file:projects/chunter.tgz(@types/node@16.11.68)(esbuild@0.16.17)(svelte@4.2.5)(ts-node@10.9.1): file:projects/chunter.tgz(@types/node@16.11.68)(esbuild@0.16.17)(svelte@4.2.5)(ts-node@10.9.1):
resolution: {integrity: sha512-B2Pz7GnpUA31Hb83fZQ1q9X6/iOcEkczKPZQKCD1Nrht24HS9Z6i7SE72vXcUPFsdX0UPaSmla7CI0P3oKc/Mg==, tarball: file:projects/chunter.tgz} resolution: {integrity: sha512-smJiIU6iEoGU0Oz30Mor08eJ2/ZIlXH04X79HJqzD9q1rIBvq4KLR+iNv9j4TjExVNpehJYuTq2zqNBgBGSM9w==, tarball: file:projects/chunter.tgz}
id: file:projects/chunter.tgz id: file:projects/chunter.tgz
name: '@rush-temp/chunter' name: '@rush-temp/chunter'
version: 0.0.0 version: 0.0.0
@ -18205,7 +18214,7 @@ packages:
dev: false dev: false
file:projects/contact-resources.tgz(@types/node@16.11.68)(esbuild@0.16.17)(postcss-load-config@4.0.1)(postcss@8.4.31)(ts-node@10.9.1): file:projects/contact-resources.tgz(@types/node@16.11.68)(esbuild@0.16.17)(postcss-load-config@4.0.1)(postcss@8.4.31)(ts-node@10.9.1):
resolution: {integrity: sha512-NNyNiZh6k3d0hvff3u/ACdOhijULgmE+SxgjNWdVyptGY0/IP8uLu2CNwDSnq3M5j+yZ4gywPIZkKdPZ4FG5IQ==, tarball: file:projects/contact-resources.tgz} resolution: {integrity: sha512-4UeqrLhyCcUboXTol2cKsbL3WlG4SA8CWSDhlgIwEmAC3UQqowbGnHmjMkf+pDree4znfESF0Sch1pho04SDDg==, tarball: file:projects/contact-resources.tgz}
id: file:projects/contact-resources.tgz id: file:projects/contact-resources.tgz
name: '@rush-temp/contact-resources' name: '@rush-temp/contact-resources'
version: 0.0.0 version: 0.0.0
@ -18614,7 +18623,7 @@ packages:
dev: false dev: false
file:projects/generator.tgz(bufferutil@4.0.7)(svelte@4.2.5): file:projects/generator.tgz(bufferutil@4.0.7)(svelte@4.2.5):
resolution: {integrity: sha512-WqJiSVlaQiwgbKKdFJwEQPa2Ush2vKE2fpdG7g7YHA9dutOf15zJRRmsHh2tOPB3uXMK9Zuwt/6Z86VaCtLcvQ==, tarball: file:projects/generator.tgz} resolution: {integrity: sha512-bCdu7ucZf1ZuL61Q87kjGOzabTM8XkD11vvWNi7o7DPDr8ud3/aHp6y4SICqjMbUhrl/2ZEgLkUPYVCvfPifqw==, tarball: file:projects/generator.tgz}
id: file:projects/generator.tgz id: file:projects/generator.tgz
name: '@rush-temp/generator' name: '@rush-temp/generator'
version: 0.0.0 version: 0.0.0
@ -19405,7 +19414,7 @@ packages:
dev: false dev: false
file:projects/model-activity.tgz(svelte@4.2.5)(typescript@5.2.2): file:projects/model-activity.tgz(svelte@4.2.5)(typescript@5.2.2):
resolution: {integrity: sha512-h99S1TU2W/00QUaigRyLYFQRVkDEVgftPYEQQ9rDFBriWC+jXu7A0ki5kn2DBOhMXElrVt29fH6u1apC3VSn/Q==, tarball: file:projects/model-activity.tgz} resolution: {integrity: sha512-Fx/yJE88VjyIbfkipf4pXcHNPE7mis0NAl7OuOnSpHfDwrIwmroHlqiK39MFkhdaGNG7jXq0mS5IS6E3/Gp7Qg==, tarball: file:projects/model-activity.tgz}
id: file:projects/model-activity.tgz id: file:projects/model-activity.tgz
name: '@rush-temp/model-activity' name: '@rush-temp/model-activity'
version: 0.0.0 version: 0.0.0
@ -19426,7 +19435,7 @@ packages:
dev: false dev: false
file:projects/model-all.tgz(svelte@4.2.5)(typescript@5.2.2): file:projects/model-all.tgz(svelte@4.2.5)(typescript@5.2.2):
resolution: {integrity: sha512-Rkcl3FSS5XChGZeskMQWLQDsT0AH9qgeWXwmIdIZs13ZlCjEZnPdRyRu354eRIFbwiY9f0atB/Oesw1RlL5R0A==, tarball: file:projects/model-all.tgz} resolution: {integrity: sha512-PEl4zAGjvSsQ5stSRUuj2PYcZ0BdWTkxyaJNP63dbX4U6QA5sf7BuXamJRgETTD74jA40pGRXUAMnprS6t9z4w==, tarball: file:projects/model-all.tgz}
id: file:projects/model-all.tgz id: file:projects/model-all.tgz
name: '@rush-temp/model-all' name: '@rush-temp/model-all'
version: 0.0.0 version: 0.0.0
@ -19451,7 +19460,7 @@ packages:
dev: false dev: false
file:projects/model-attachment.tgz(svelte@4.2.5)(typescript@5.2.2): file:projects/model-attachment.tgz(svelte@4.2.5)(typescript@5.2.2):
resolution: {integrity: sha512-ScJBJ4HDMgGndwGTTm/BcYC2YRSdWn8L2OgZkWtWL4B5BtcKOGoiA5u9DZkov/zNHquW35XsT32zY2zCxpCqXQ==, tarball: file:projects/model-attachment.tgz} resolution: {integrity: sha512-tfIKh4gsy4ZnW70ClMfiKnGFIOz6S/vrzhJL7/Duz5CyR74+8woJjkXWS5iEO6d8XeuC1T3mpWVg2wb2FFLhmg==, tarball: file:projects/model-attachment.tgz}
id: file:projects/model-attachment.tgz id: file:projects/model-attachment.tgz
name: '@rush-temp/model-attachment' name: '@rush-temp/model-attachment'
version: 0.0.0 version: 0.0.0
@ -19535,7 +19544,7 @@ packages:
dev: false dev: false
file:projects/model-chunter.tgz(svelte@4.2.5)(typescript@5.2.2): file:projects/model-chunter.tgz(svelte@4.2.5)(typescript@5.2.2):
resolution: {integrity: sha512-krEyc8zzxs/qe5tQdmEK6rzvW/unCd4dl6VyVev0QPucCbW2KAsT6jSTgQx99RoG4qL5bDuNpZQVeKPJ4mVZVg==, tarball: file:projects/model-chunter.tgz} resolution: {integrity: sha512-dKEGvo+qbnjpaBnAkCoQp5V+DRidHKAnUkaxpM87AVMf86KgbMXyauA9I5MMsiYxntETGbYKvtm+t86WHUKvsw==, tarball: file:projects/model-chunter.tgz}
id: file:projects/model-chunter.tgz id: file:projects/model-chunter.tgz
name: '@rush-temp/model-chunter' name: '@rush-temp/model-chunter'
version: 0.0.0 version: 0.0.0
@ -19556,7 +19565,7 @@ packages:
dev: false dev: false
file:projects/model-contact.tgz(svelte@4.2.5)(typescript@5.2.2): file:projects/model-contact.tgz(svelte@4.2.5)(typescript@5.2.2):
resolution: {integrity: sha512-L8P7WOkR+5RqHAuVB+TTReXzNT3c2ZIEEACc6/6QG1Y7dRyg4tUAlVJC2dZsJDx3seIkT4x1K33MdQZUqZ8vng==, tarball: file:projects/model-contact.tgz} resolution: {integrity: sha512-M46mpKqdQgbjeeHdXvxnczaR0jNyeeeCjNeIHZKbei23cva8BKI9X2CPgAKtR3UtMlpW3WMjES0YaYllG4XSzw==, tarball: file:projects/model-contact.tgz}
id: file:projects/model-contact.tgz id: file:projects/model-contact.tgz
name: '@rush-temp/model-contact' name: '@rush-temp/model-contact'
version: 0.0.0 version: 0.0.0
@ -19621,7 +19630,7 @@ packages:
dev: false dev: false
file:projects/model-hr.tgz(svelte@4.2.5)(typescript@5.2.2): file:projects/model-hr.tgz(svelte@4.2.5)(typescript@5.2.2):
resolution: {integrity: sha512-XAFnodBxPnnUfZ6BoXhKfgOsZdorvnDHcD4SB4RcBuxCaiqEcGvwLIM8Ju1fRS9ve8Vw8vYID8DDV3SHG0zUcw==, tarball: file:projects/model-hr.tgz} resolution: {integrity: sha512-UBeHLgRS2KIY+XTo/250tjhfqPD7zLv3cBGLK2FcV0hV+X/a6/6prm5d3NvK1vtO5TLwXmKRbws2Ceu1TlqlHA==, tarball: file:projects/model-hr.tgz}
id: file:projects/model-hr.tgz id: file:projects/model-hr.tgz
name: '@rush-temp/model-hr' name: '@rush-temp/model-hr'
version: 0.0.0 version: 0.0.0
@ -19642,7 +19651,7 @@ packages:
dev: false dev: false
file:projects/model-inventory.tgz(svelte@4.2.5)(typescript@5.2.2): file:projects/model-inventory.tgz(svelte@4.2.5)(typescript@5.2.2):
resolution: {integrity: sha512-yeVONwzUERSl/byljh8wOhy3bIrJtgDrVm8acBe3labVP1c0N+OZI5hKw8vuNwit0eZfWrSN7XROBq1J/D4lqA==, tarball: file:projects/model-inventory.tgz} resolution: {integrity: sha512-qYr/7r2WlSUcUtcN3oWdUrPd6uyTx8JiKjpsbFOX+vcqTZpZdhDQJSswbk6g5NSdw7MsZfFoA7l4h9vCXI0OIg==, tarball: file:projects/model-inventory.tgz}
id: file:projects/model-inventory.tgz id: file:projects/model-inventory.tgz
name: '@rush-temp/model-inventory' name: '@rush-temp/model-inventory'
version: 0.0.0 version: 0.0.0
@ -19663,7 +19672,7 @@ packages:
dev: false dev: false
file:projects/model-lead.tgz(svelte@4.2.5)(typescript@5.2.2): file:projects/model-lead.tgz(svelte@4.2.5)(typescript@5.2.2):
resolution: {integrity: sha512-bWWfPoFmx7IpwRci83NyRUA5Eb3Cq4UXlXbMQUZo8oEcaslbN+6r720qxt6UrbInutM+FKG5H/O0LVh3vebEXQ==, tarball: file:projects/model-lead.tgz} resolution: {integrity: sha512-WYB9YatMv90U6eoANMNLyRGiiggqyG2e0R8X8HlKTQ0fuuvuC5WXCJb+cJpobKbPTLiFKQ/yw2tHKjiXxgzyQA==, tarball: file:projects/model-lead.tgz}
id: file:projects/model-lead.tgz id: file:projects/model-lead.tgz
name: '@rush-temp/model-lead' name: '@rush-temp/model-lead'
version: 0.0.0 version: 0.0.0
@ -19747,7 +19756,7 @@ packages:
dev: false dev: false
file:projects/model-recruit.tgz(svelte@4.2.5)(typescript@5.2.2): file:projects/model-recruit.tgz(svelte@4.2.5)(typescript@5.2.2):
resolution: {integrity: sha512-GhR4U4IsfC7Vf9izqW7yNlHyF3eiG/IhzQBdj44KaHk9nc8Kli4OR/Z0V08M8IIxAVWW1hrkuzw7fTbNZCk6LA==, tarball: file:projects/model-recruit.tgz} resolution: {integrity: sha512-JQlaVZDojvVRJ4gGlmdZBnXGM2vXijUYOuAS06+s4TBrw1JzZ8dLpkVat38F+sys6uSR05sIC9dLU89EyewfLg==, tarball: file:projects/model-recruit.tgz}
id: file:projects/model-recruit.tgz id: file:projects/model-recruit.tgz
name: '@rush-temp/model-recruit' name: '@rush-temp/model-recruit'
version: 0.0.0 version: 0.0.0
@ -19789,6 +19798,27 @@ packages:
- typescript - typescript
dev: false dev: false
file:projects/model-server-activity.tgz(svelte@4.2.5)(typescript@5.2.2):
resolution: {integrity: sha512-ddPj4Y8/1G2ItDMmgLbaasdkjTTY66I3XKmyV3KfZNjeRq7DJZquF5VG1GM09TpfAkQkLJBJcoHoqtqQ9OgluA==, tarball: file:projects/model-server-activity.tgz}
id: file:projects/model-server-activity.tgz
name: '@rush-temp/model-server-activity'
version: 0.0.0
dependencies:
'@typescript-eslint/eslint-plugin': 6.11.0(@typescript-eslint/parser@6.11.0)(eslint@8.54.0)(typescript@5.2.2)
'@typescript-eslint/parser': 6.11.0(eslint@8.54.0)(typescript@5.2.2)
eslint: 8.54.0
eslint-config-standard-with-typescript: 40.0.0(@typescript-eslint/eslint-plugin@6.11.0)(eslint-plugin-import@2.28.1)(eslint-plugin-n@15.7.0)(eslint-plugin-promise@6.1.1)(eslint@8.54.0)(typescript@5.2.2)
eslint-plugin-import: 2.28.1(eslint@8.54.0)
eslint-plugin-n: 15.7.0(eslint@8.54.0)
eslint-plugin-promise: 6.1.1(eslint@8.54.0)
prettier: 3.1.0
prettier-plugin-svelte: 3.1.0(prettier@3.1.0)(svelte@4.2.5)
transitivePeerDependencies:
- supports-color
- svelte
- typescript
dev: false
file:projects/model-server-attachment.tgz(svelte@4.2.5)(typescript@5.2.2): file:projects/model-server-attachment.tgz(svelte@4.2.5)(typescript@5.2.2):
resolution: {integrity: sha512-n2Qsi8ZMslvChqvzREluoqFZUIn0NKrOini0P+lYqCnQpWdhT5GRUFdcq0uzw5WXSssyh5su2Hv7B9PWmK23pA==, tarball: file:projects/model-server-attachment.tgz} resolution: {integrity: sha512-n2Qsi8ZMslvChqvzREluoqFZUIn0NKrOini0P+lYqCnQpWdhT5GRUFdcq0uzw5WXSssyh5su2Hv7B9PWmK23pA==, tarball: file:projects/model-server-attachment.tgz}
id: file:projects/model-server-attachment.tgz id: file:projects/model-server-attachment.tgz
@ -19979,7 +20009,7 @@ packages:
dev: false dev: false
file:projects/model-server-notification.tgz(svelte@4.2.5)(typescript@5.2.2): file:projects/model-server-notification.tgz(svelte@4.2.5)(typescript@5.2.2):
resolution: {integrity: sha512-4F8IILvkrQD0AD9NOXKjHQLO/vEmgqbGAFg97Jg1KSgQQCLTbai0Igh67eP+CQEolOIKNgn2Jy315UlUd+ZmEw==, tarball: file:projects/model-server-notification.tgz} resolution: {integrity: sha512-BmWHvQtuRizjJE87k3thPWrhHJBfOEx1tg62HmPHUMsWxoS6nBKVzTa4zzwFqHPb4tlzBS7S8ux1n5tTwtJiMQ==, tarball: file:projects/model-server-notification.tgz}
id: file:projects/model-server-notification.tgz id: file:projects/model-server-notification.tgz
name: '@rush-temp/model-server-notification' name: '@rush-temp/model-server-notification'
version: 0.0.0 version: 0.0.0
@ -20000,7 +20030,7 @@ packages:
dev: false dev: false
file:projects/model-server-openai.tgz(svelte@4.2.5)(typescript@5.2.2): file:projects/model-server-openai.tgz(svelte@4.2.5)(typescript@5.2.2):
resolution: {integrity: sha512-F3GyJcngnQm+XiZOom711tSgbyDnxPesEMrF5E99OcAo/OSAuq5FRuQApJIiSvIzxG3OkY5d9xg1fdqa/se27A==, tarball: file:projects/model-server-openai.tgz} resolution: {integrity: sha512-Y1pj31vk0lLKbre1OFF7s/GCeeaybWeJz2OAecowV5DvM4TV6kmhdbzy/Yxm/OpSdSv5eeNQt0NMMg+OhBkPHQ==, tarball: file:projects/model-server-openai.tgz}
id: file:projects/model-server-openai.tgz id: file:projects/model-server-openai.tgz
name: '@rush-temp/model-server-openai' name: '@rush-temp/model-server-openai'
version: 0.0.0 version: 0.0.0
@ -20273,7 +20303,7 @@ packages:
dev: false dev: false
file:projects/model-task.tgz(svelte@4.2.5)(typescript@5.2.2): file:projects/model-task.tgz(svelte@4.2.5)(typescript@5.2.2):
resolution: {integrity: sha512-/XjIgfOs85WSw9zRSG1qO85SgLU+V0H4BWMSg7bRznAPcikjvgpcItgaNslZZfU7+k/QSyKl+1CF97TdXqH0dQ==, tarball: file:projects/model-task.tgz} resolution: {integrity: sha512-56qSfouGLl0idf3X7qFQVjeAmCT0eg2iDPoErUQzeQpaYgJ2sbI1wp0Czj3hDm83NlA0eiIYkOIgqtHuSULM7w==, tarball: file:projects/model-task.tgz}
id: file:projects/model-task.tgz id: file:projects/model-task.tgz
name: '@rush-temp/model-task' name: '@rush-temp/model-task'
version: 0.0.0 version: 0.0.0
@ -20357,7 +20387,7 @@ packages:
dev: false dev: false
file:projects/model-tracker.tgz(svelte@4.2.5)(typescript@5.2.2): file:projects/model-tracker.tgz(svelte@4.2.5)(typescript@5.2.2):
resolution: {integrity: sha512-Y2c+Z8HD/+Y1TM/YunTdFgA7psJjgf6SPFXREQSFXE8Xl+lEFg9UCiQlNDEjuyYEVbwgTWKw96jdTlcZnW7p6w==, tarball: file:projects/model-tracker.tgz} resolution: {integrity: sha512-m+LFruPo0Q57JMp+IgOv3junFBwLU8sDR/rNtCJS/5ZP8RyR95iTVex5LhzuExj1G5vvrpanWyuO8DXoA+DEmg==, tarball: file:projects/model-tracker.tgz}
id: file:projects/model-tracker.tgz id: file:projects/model-tracker.tgz
name: '@rush-temp/model-tracker' name: '@rush-temp/model-tracker'
version: 0.0.0 version: 0.0.0
@ -20567,7 +20597,7 @@ packages:
dev: false dev: false
file:projects/notification.tgz(@types/node@16.11.68)(esbuild@0.16.17)(postcss-load-config@4.0.1)(postcss@8.4.31)(svelte@4.2.5)(ts-node@10.9.1)(typescript@5.2.2): file:projects/notification.tgz(@types/node@16.11.68)(esbuild@0.16.17)(postcss-load-config@4.0.1)(postcss@8.4.31)(svelte@4.2.5)(ts-node@10.9.1)(typescript@5.2.2):
resolution: {integrity: sha512-oNhayGgvuFovvHZ4jXtAQg4j2EvLraxND2eh1kFBvkwgIMN7yE6Y2Fu+298r4A6Es69WO9tKicFJN8HXMxnUFw==, tarball: file:projects/notification.tgz} resolution: {integrity: sha512-ar2cczMbBPlEJLB9iMq+CyXItQyV5U1AFGt0XDpV2VtotNt0zGvRX9xNddmhZR3WnfPoiJ+dgK+9zErCsOKUVQ==, tarball: file:projects/notification.tgz}
id: file:projects/notification.tgz id: file:projects/notification.tgz
name: '@rush-temp/notification' name: '@rush-temp/notification'
version: 0.0.0 version: 0.0.0
@ -20611,7 +20641,7 @@ packages:
dev: false dev: false
file:projects/openai.tgz(esbuild@0.16.17)(svelte@4.2.5)(ts-node@10.9.1): file:projects/openai.tgz(esbuild@0.16.17)(svelte@4.2.5)(ts-node@10.9.1):
resolution: {integrity: sha512-2CuxM12rHcF5scfPqNHy+a6+Zb0f7Ff1Pi2jxSitF3QCVlxjc/RRemwcBBlnbqDVK3OMooYsGhIvFaV5c4b3AA==, tarball: file:projects/openai.tgz} resolution: {integrity: sha512-UHhuZXtZmgJWqGKl5NeenuYo69rrXtEsdind7OXNXM7MRmli9p0l66mX2fqAKgioALCU6nYFqtB1VCSPO4w+OQ==, tarball: file:projects/openai.tgz}
id: file:projects/openai.tgz id: file:projects/openai.tgz
name: '@rush-temp/openai' name: '@rush-temp/openai'
version: 0.0.0 version: 0.0.0
@ -20914,7 +20944,7 @@ packages:
dev: false dev: false
file:projects/pod-server.tgz(svelte@4.2.5): file:projects/pod-server.tgz(svelte@4.2.5):
resolution: {integrity: sha512-KcjxWIMH/sM3O1t4304w4M8u6lR5S4s8SD12ffCTtZvtAKcp69LQm+qa4BQyz+rxw3Z5VYWE5A27wOZdk4Zyng==, tarball: file:projects/pod-server.tgz} resolution: {integrity: sha512-7Griqc83Xh/jubUWlO8qA+Cx1+2pjzZgouGteeQZXfCokol6X813h3O5vkKO3fenjg6doFII5zI+DJx1R4jBnQ==, tarball: file:projects/pod-server.tgz}
id: file:projects/pod-server.tgz id: file:projects/pod-server.tgz
name: '@rush-temp/pod-server' name: '@rush-temp/pod-server'
version: 0.0.0 version: 0.0.0
@ -21062,7 +21092,7 @@ packages:
dev: false dev: false
file:projects/prod.tgz(bufferutil@4.0.7)(esbuild@0.16.17)(sass@1.69.0)(ts-node@10.9.1)(typescript@5.2.2): file:projects/prod.tgz(bufferutil@4.0.7)(esbuild@0.16.17)(sass@1.69.0)(ts-node@10.9.1)(typescript@5.2.2):
resolution: {integrity: sha512-x0wE4A9teW8YW6GDoACqUW5C+62fV944pyLE6JdqfVgqQJekR8lraKzh/R+refqKGjiUoZE2oHjj53Jc7w/n/g==, tarball: file:projects/prod.tgz} resolution: {integrity: sha512-AMQUJ8O71HSvI9iGDSj/32iyRs75Qepku6ir0Xq6n2/IwVW4BE3n0Fzhh5tfFTsbPtjL2p4qcA0mmJ0zg28D+g==, tarball: file:projects/prod.tgz}
id: file:projects/prod.tgz id: file:projects/prod.tgz
name: '@rush-temp/prod' name: '@rush-temp/prod'
version: 0.0.0 version: 0.0.0
@ -21365,7 +21395,7 @@ packages:
dev: false dev: false
file:projects/request.tgz(@types/node@16.11.68)(esbuild@0.16.17)(svelte@4.2.5)(ts-node@10.9.1): file:projects/request.tgz(@types/node@16.11.68)(esbuild@0.16.17)(svelte@4.2.5)(ts-node@10.9.1):
resolution: {integrity: sha512-zd3j5QUy82jmuGhaPB2ZvI0kR1kE8m0IUdU7ICnsFYfwk1UL3IPYZ1tkAPlYmNwWpYJ16Ll6pkq96hXNXdOIbg==, tarball: file:projects/request.tgz} resolution: {integrity: sha512-RH9Wtmwqxgp8ByBW5JJmLNai8oD3GYCgGJQqQHRJKmoU0h+nOBA6apNFp42PRE0U4GIyD0U88hILq1VILae7aA==, tarball: file:projects/request.tgz}
id: file:projects/request.tgz id: file:projects/request.tgz
name: '@rush-temp/request' name: '@rush-temp/request'
version: 0.0.0 version: 0.0.0
@ -21430,6 +21460,70 @@ packages:
- ts-node - ts-node
dev: false dev: false
file:projects/server-activity-resources.tgz(@types/node@16.11.68)(esbuild@0.16.17)(svelte@4.2.5)(ts-node@10.9.1):
resolution: {integrity: sha512-NJwDYiOdiOtH/MMY/pcUduYzJIBgDHdVwmquqQ82r0Dg39c/Zz8de7At1VrAnvnfpbSSKFZLsBC8GtfGwdIHRA==, tarball: file:projects/server-activity-resources.tgz}
id: file:projects/server-activity-resources.tgz
name: '@rush-temp/server-activity-resources'
version: 0.0.0
dependencies:
'@types/jest': 29.5.5
'@typescript-eslint/eslint-plugin': 6.11.0(@typescript-eslint/parser@6.11.0)(eslint@8.54.0)(typescript@5.2.2)
'@typescript-eslint/parser': 6.11.0(eslint@8.54.0)(typescript@5.2.2)
eslint: 8.54.0
eslint-config-standard-with-typescript: 40.0.0(@typescript-eslint/eslint-plugin@6.11.0)(eslint-plugin-import@2.28.1)(eslint-plugin-n@15.7.0)(eslint-plugin-promise@6.1.1)(eslint@8.54.0)(typescript@5.2.2)
eslint-plugin-import: 2.28.1(eslint@8.54.0)
eslint-plugin-n: 15.7.0(eslint@8.54.0)
eslint-plugin-promise: 6.1.1(eslint@8.54.0)
jest: 29.7.0(@types/node@16.11.68)(ts-node@10.9.1)
prettier: 3.1.0
prettier-plugin-svelte: 3.1.0(prettier@3.1.0)(svelte@4.2.5)
ts-jest: 29.1.1(esbuild@0.16.17)(jest@29.7.0)(typescript@5.2.2)
typescript: 5.2.2
transitivePeerDependencies:
- '@babel/core'
- '@jest/types'
- '@types/node'
- babel-jest
- babel-plugin-macros
- esbuild
- node-notifier
- supports-color
- svelte
- ts-node
dev: false
file:projects/server-activity.tgz(esbuild@0.16.17)(svelte@4.2.5)(ts-node@10.9.1):
resolution: {integrity: sha512-DneWyxHhW1vXrtKGwcLBuE7tkcbRkQVg4L/X4YamviGOuSWNSwUMb4KeJk7tqRhNwt0ldg3GcXvP7p01oPyVnA==, tarball: file:projects/server-activity.tgz}
id: file:projects/server-activity.tgz
name: '@rush-temp/server-activity'
version: 0.0.0
dependencies:
'@types/jest': 29.5.5
'@types/node': 16.11.68
'@typescript-eslint/eslint-plugin': 6.11.0(@typescript-eslint/parser@6.11.0)(eslint@8.54.0)(typescript@5.2.2)
'@typescript-eslint/parser': 6.11.0(eslint@8.54.0)(typescript@5.2.2)
eslint: 8.54.0
eslint-config-standard-with-typescript: 40.0.0(@typescript-eslint/eslint-plugin@6.11.0)(eslint-plugin-import@2.28.1)(eslint-plugin-n@15.7.0)(eslint-plugin-promise@6.1.1)(eslint@8.54.0)(typescript@5.2.2)
eslint-plugin-import: 2.28.1(eslint@8.54.0)
eslint-plugin-n: 15.7.0(eslint@8.54.0)
eslint-plugin-promise: 6.1.1(eslint@8.54.0)
jest: 29.7.0(@types/node@16.11.68)(ts-node@10.9.1)
prettier: 3.1.0
prettier-plugin-svelte: 3.1.0(prettier@3.1.0)(svelte@4.2.5)
ts-jest: 29.1.1(esbuild@0.16.17)(jest@29.7.0)(typescript@5.2.2)
typescript: 5.2.2
transitivePeerDependencies:
- '@babel/core'
- '@jest/types'
- babel-jest
- babel-plugin-macros
- esbuild
- node-notifier
- supports-color
- svelte
- ts-node
dev: false
file:projects/server-attachment-resources.tgz(@types/node@16.11.68)(esbuild@0.16.17)(svelte@4.2.5)(ts-node@10.9.1): file:projects/server-attachment-resources.tgz(@types/node@16.11.68)(esbuild@0.16.17)(svelte@4.2.5)(ts-node@10.9.1):
resolution: {integrity: sha512-25yaizWNA1rXmhGvsw6fz5Vg03LXTF2uL+oLaM56GxI5gZnP2t/vixxD+7G1CJT2YNcFaK1HiqCDUrjMN2zQ5g==, tarball: file:projects/server-attachment-resources.tgz} resolution: {integrity: sha512-25yaizWNA1rXmhGvsw6fz5Vg03LXTF2uL+oLaM56GxI5gZnP2t/vixxD+7G1CJT2YNcFaK1HiqCDUrjMN2zQ5g==, tarball: file:projects/server-attachment-resources.tgz}
id: file:projects/server-attachment-resources.tgz id: file:projects/server-attachment-resources.tgz
@ -22012,7 +22106,7 @@ packages:
dev: false dev: false
file:projects/server-notification-resources.tgz(@types/node@16.11.68)(esbuild@0.16.17)(svelte@4.2.5)(ts-node@10.9.1): file:projects/server-notification-resources.tgz(@types/node@16.11.68)(esbuild@0.16.17)(svelte@4.2.5)(ts-node@10.9.1):
resolution: {integrity: sha512-ULb1Qwv/+6OqeJCA3DxrvUmzQg9yAGMO5vioAc/C+l0aVzNpfVJPKIX03NGlGe7CvT4Ys3w0xXEusFJ7+pawhw==, tarball: file:projects/server-notification-resources.tgz} resolution: {integrity: sha512-MB40NnTz/EsrbX5vaVJp4Ste2YhwqLP9MXzH/9Vw3gfL/2hbbegKWzemMKiH8lU4/EQoTd0ay6YhVUWLSe1eBA==, tarball: file:projects/server-notification-resources.tgz}
id: file:projects/server-notification-resources.tgz id: file:projects/server-notification-resources.tgz
name: '@rush-temp/server-notification-resources' name: '@rush-temp/server-notification-resources'
version: 0.0.0 version: 0.0.0
@ -22563,7 +22657,7 @@ packages:
dev: false dev: false
file:projects/server-tracker-resources.tgz(@types/node@16.11.68)(esbuild@0.16.17)(svelte@4.2.5)(ts-node@10.9.1): file:projects/server-tracker-resources.tgz(@types/node@16.11.68)(esbuild@0.16.17)(svelte@4.2.5)(ts-node@10.9.1):
resolution: {integrity: sha512-rzxlBU4Qtlyl6AO2W9zl7OY1GqKFrsbcZeenImwi2A3L+d79DYg2IWm+3ay8feGL6TVsOYZTwapA/yTyBD/1eg==, tarball: file:projects/server-tracker-resources.tgz} resolution: {integrity: sha512-eP7iOhbsVOTizFoVY89Fk5u29U3U9y1EqKA9thJX/xy7E6WIsB9FZv0pfyBNPR0RTbvEEOb8lAhJmogmKijaoQ==, tarball: file:projects/server-tracker-resources.tgz}
id: file:projects/server-tracker-resources.tgz id: file:projects/server-tracker-resources.tgz
name: '@rush-temp/server-tracker-resources' name: '@rush-temp/server-tracker-resources'
version: 0.0.0 version: 0.0.0
@ -23697,7 +23791,7 @@ packages:
dev: false dev: false
file:projects/tool.tgz(bufferutil@4.0.7)(svelte@4.2.5): file:projects/tool.tgz(bufferutil@4.0.7)(svelte@4.2.5):
resolution: {integrity: sha512-YiOLUsyhvShU6cXfy9vf+CMJ+i0fQlj/nP5izXKEgU3/pzMwCnbWDlwkk5HKVplbPh1o/mx5s6m9cFt4Gp5Tng==, tarball: file:projects/tool.tgz} resolution: {integrity: sha512-/U8HgaP/9AhnOrrWwdMZEkYyQtGxiUbTFjywYBbPv4LMgEB9YdAhgGF3N/nO/QbeSEgTWGVEn25pbGv7GT5I0Q==, tarball: file:projects/tool.tgz}
id: file:projects/tool.tgz id: file:projects/tool.tgz
name: '@rush-temp/tool' name: '@rush-temp/tool'
version: 0.0.0 version: 0.0.0

View File

@ -39,6 +39,7 @@
"dependencies": { "dependencies": {
"@hcengineering/account": "^0.6.0", "@hcengineering/account": "^0.6.0",
"@hcengineering/attachment": "^0.6.9", "@hcengineering/attachment": "^0.6.9",
"@hcengineering/chunter": "^0.6.12",
"@hcengineering/client": "^0.6.14", "@hcengineering/client": "^0.6.14",
"@hcengineering/client-resources": "^0.6.23", "@hcengineering/client-resources": "^0.6.23",
"@hcengineering/contact": "^0.6.20", "@hcengineering/contact": "^0.6.20",
@ -54,7 +55,6 @@
"@hcengineering/task": "^0.6.13", "@hcengineering/task": "^0.6.13",
"@hcengineering/telegram": "^0.6.14", "@hcengineering/telegram": "^0.6.14",
"@hcengineering/tracker": "^0.6.13", "@hcengineering/tracker": "^0.6.13",
"@hcengineering/notification": "^0.6.16",
"@types/pdfkit": "~0.12.3", "@types/pdfkit": "~0.12.3",
"commander": "^8.1.0", "commander": "^8.1.0",
"faker": "~5.5.3", "faker": "~5.5.3",

View File

@ -1,5 +1,5 @@
import chunter, { ChatMessage } from '@hcengineering/chunter'
import { AttachedData, Class, Doc, generateId, Ref, Space, TxOperations } from '@hcengineering/core' import { AttachedData, Class, Doc, generateId, Ref, Space, TxOperations } from '@hcengineering/core'
import notification, { ChatMessage } from '@hcengineering/notification'
import faker from 'faker' import faker from 'faker'
export interface CommentOptions { export interface CommentOptions {
@ -25,20 +25,12 @@ export async function addComments<T extends Doc> (
const commentData: AttachedData<ChatMessage> = { const commentData: AttachedData<ChatMessage> = {
message: faker.lorem.paragraphs(options.paragraphMin + faker.datatype.number(options.paragraphMax)) message: faker.lorem.paragraphs(options.paragraphMin + faker.datatype.number(options.paragraphMax))
} }
await client.addCollection( await client.addCollection(chunter.class.ChatMessage, space, objectId, _class, collection, commentData, commentId)
notification.class.ChatMessage,
space,
objectId,
_class,
collection,
commentData,
commentId
)
if (faker.datatype.number(100) > options.updateFactor) { if (faker.datatype.number(100) > options.updateFactor) {
const updateMsg = faker.lorem.paragraphs(options.paragraphMin + faker.datatype.number(options.paragraphMax)) const updateMsg = faker.lorem.paragraphs(options.paragraphMin + faker.datatype.number(options.paragraphMax))
await client.updateCollection(notification.class.ChatMessage, space, commentId, objectId, _class, collection, { await client.updateCollection(chunter.class.ChatMessage, space, commentId, objectId, _class, collection, {
message: updateMsg message: updateMsg
}) })
} }

View File

@ -167,6 +167,8 @@
"@hcengineering/server-request": "^0.6.0", "@hcengineering/server-request": "^0.6.0",
"@hcengineering/server-request-resources": "^0.6.0", "@hcengineering/server-request-resources": "^0.6.0",
"@hcengineering/server-view": "^0.6.0", "@hcengineering/server-view": "^0.6.0",
"@hcengineering/server-view-resources": "^0.6.0" "@hcengineering/server-view-resources": "^0.6.0",
"@hcengineering/server-activity": "^0.6.0",
"@hcengineering/server-activity-resources": "^0.6.0"
} }
} }

View File

@ -49,6 +49,7 @@
"@elastic/elasticsearch": "^7.14.0", "@elastic/elasticsearch": "^7.14.0",
"@hcengineering/account": "^0.6.0", "@hcengineering/account": "^0.6.0",
"@hcengineering/attachment": "^0.6.9", "@hcengineering/attachment": "^0.6.9",
"@hcengineering/chunter": "^0.6.12",
"@hcengineering/client": "^0.6.14", "@hcengineering/client": "^0.6.14",
"@hcengineering/client-resources": "^0.6.23", "@hcengineering/client-resources": "^0.6.23",
"@hcengineering/contact": "^0.6.20", "@hcengineering/contact": "^0.6.20",
@ -64,7 +65,6 @@
"@hcengineering/model-recruit": "^0.6.0", "@hcengineering/model-recruit": "^0.6.0",
"@hcengineering/model-telegram": "^0.6.0", "@hcengineering/model-telegram": "^0.6.0",
"@hcengineering/mongo": "^0.6.1", "@hcengineering/mongo": "^0.6.1",
"@hcengineering/notification": "^0.6.16",
"@hcengineering/openai": "^0.6.0", "@hcengineering/openai": "^0.6.0",
"@hcengineering/platform": "^0.6.9", "@hcengineering/platform": "^0.6.9",
"@hcengineering/recruit": "^0.6.21", "@hcengineering/recruit": "^0.6.21",
@ -107,6 +107,8 @@
"@hcengineering/server-tracker-resources": "^0.6.0", "@hcengineering/server-tracker-resources": "^0.6.0",
"@hcengineering/server-view": "^0.6.0", "@hcengineering/server-view": "^0.6.0",
"@hcengineering/server-view-resources": "^0.6.0", "@hcengineering/server-view-resources": "^0.6.0",
"@hcengineering/server-activity": "^0.6.0",
"@hcengineering/server-activity-resources": "^0.6.0",
"@hcengineering/setting": "^0.6.11", "@hcengineering/setting": "^0.6.11",
"@hcengineering/tags": "^0.6.12", "@hcengineering/tags": "^0.6.12",
"@hcengineering/task": "^0.6.13", "@hcengineering/task": "^0.6.13",

View File

@ -22,6 +22,7 @@ import builder, { migrateOperations, version } from '@hcengineering/model-all'
import { devTool } from '.' import { devTool } from '.'
import { addLocation } from '@hcengineering/platform' import { addLocation } from '@hcengineering/platform'
import { serverActivityId } from '@hcengineering/server-activity'
import { serverAttachmentId } from '@hcengineering/server-attachment' import { serverAttachmentId } from '@hcengineering/server-attachment'
import { serverCalendarId } from '@hcengineering/server-calendar' import { serverCalendarId } from '@hcengineering/server-calendar'
import { serverChunterId } from '@hcengineering/server-chunter' import { serverChunterId } from '@hcengineering/server-chunter'
@ -40,6 +41,7 @@ import { serverTelegramId } from '@hcengineering/server-telegram'
import { serverTrackerId } from '@hcengineering/server-tracker' import { serverTrackerId } from '@hcengineering/server-tracker'
import { serverViewId } from '@hcengineering/server-view' import { serverViewId } from '@hcengineering/server-view'
addLocation(serverActivityId, () => import('@hcengineering/server-activity-resources'))
addLocation(serverAttachmentId, () => import('@hcengineering/server-attachment-resources')) addLocation(serverAttachmentId, () => import('@hcengineering/server-attachment-resources'))
addLocation(serverContactId, () => import('@hcengineering/server-contact-resources')) addLocation(serverContactId, () => import('@hcengineering/server-contact-resources'))
addLocation(serverNotificationId, () => import('@hcengineering/server-notification-resources')) addLocation(serverNotificationId, () => import('@hcengineering/server-notification-resources'))

View File

@ -38,9 +38,9 @@ import { connect } from '@hcengineering/server-tool'
import tracker from '@hcengineering/tracker' import tracker from '@hcengineering/tracker'
import tags, { TagCategory, TagElement, TagReference } from '@hcengineering/tags' import tags, { TagCategory, TagElement, TagReference } from '@hcengineering/tags'
import { MongoClient } from 'mongodb' import { MongoClient } from 'mongodb'
import notification, { ChatMessage } from '@hcengineering/notification' import chunter, { ChatMessage } from '@hcengineering/chunter'
export const DOMAIN_COMMENT = 'comment' as Domain export const DOMAIN_CHUNTER = 'chunter' as Domain
export async function cleanWorkspace ( export async function cleanWorkspace (
mongoUrl: string, mongoUrl: string,
@ -322,11 +322,11 @@ export async function fixCommentDoubleIdCreate (workspaceId: WorkspaceId, transa
try { try {
const commentTxes = await connection.findAll(core.class.TxCollectionCUD, { const commentTxes = await connection.findAll(core.class.TxCollectionCUD, {
'tx._class': core.class.TxCreateDoc, 'tx._class': core.class.TxCreateDoc,
'tx.objectClass': notification.class.ChatMessage 'tx.objectClass': chunter.class.ChatMessage
}) })
const commentTxesRemoved = await connection.findAll(core.class.TxCollectionCUD, { const commentTxesRemoved = await connection.findAll(core.class.TxCollectionCUD, {
'tx._class': core.class.TxRemoveDoc, 'tx._class': core.class.TxRemoveDoc,
'tx.objectClass': notification.class.ChatMessage 'tx.objectClass': chunter.class.ChatMessage
}) })
const removed = new Map(commentTxesRemoved.map((it) => [it.tx.objectId, it])) const removed = new Map(commentTxesRemoved.map((it) => [it.tx.objectId, it]))
// Do not checked removed // Do not checked removed
@ -354,7 +354,7 @@ export async function fixCommentDoubleIdCreate (workspaceId: WorkspaceId, transa
doc._id = c.tx.objectId as Ref<ChatMessage> doc._id = c.tx.objectId as Ref<ChatMessage>
await connection.upload(DOMAIN_TX, [c]) await connection.upload(DOMAIN_TX, [c])
// Also we need to create snapsot // Also we need to create snapsot
await connection.upload(DOMAIN_COMMENT, [doc]) await connection.upload(DOMAIN_CHUNTER, [doc])
} }
} }
} }

View File

@ -31,8 +31,6 @@ import { getWorkspaceDB } from '@hcengineering/mongo'
import { connect } from '@hcengineering/server-tool' import { connect } from '@hcengineering/server-tool'
import { MongoClient } from 'mongodb' import { MongoClient } from 'mongodb'
export const DOMAIN_COMMENT = 'comment' as Domain
interface PropertyInfo { interface PropertyInfo {
name: string name: string
cValue: any cValue: any

View File

@ -31,6 +31,7 @@
"@hcengineering/model": "^0.6.7", "@hcengineering/model": "^0.6.7",
"@hcengineering/model-core": "^0.6.0", "@hcengineering/model-core": "^0.6.0",
"@hcengineering/platform": "^0.6.9", "@hcengineering/platform": "^0.6.9",
"@hcengineering/ui": "^0.6.11" "@hcengineering/ui": "^0.6.11",
"@hcengineering/model-view": "^0.6.0"
} }
} }

View File

@ -13,17 +13,63 @@
// limitations under the License. // limitations under the License.
// //
import type { TxViewlet } from '@hcengineering/activity' import {
import core, { DOMAIN_MODEL, type Class, type Doc, type DocumentQuery, type Ref, type Tx } from '@hcengineering/core' type ActivityDoc,
import { Model, type Builder } from '@hcengineering/model' type ActivityExtension,
import { TDoc } from '@hcengineering/model-core' type ActivityExtensionKind,
import type { Asset, IntlString } from '@hcengineering/platform' type ActivityMessage,
type ActivityMessageExtension,
type ActivityMessageExtensionKind,
type ActivityMessagesFilter,
type DocAttributeUpdates,
type DocUpdateAction,
type DocUpdateMessage,
type DocUpdateMessageViewlet,
type DocUpdateMessageViewletAttributesConfig,
type Reaction,
type TxViewlet
} from '@hcengineering/activity'
import core, {
DOMAIN_MODEL,
type Class,
type Doc,
type DocumentQuery,
type Ref,
type Tx,
IndexKind,
type TxCUD,
type Domain,
type Account
} from '@hcengineering/core'
import {
Model,
type Builder,
Prop,
Index,
TypeRef,
TypeString,
Mixin,
Collection,
TypeBoolean
} from '@hcengineering/model'
import { TAttachedDoc, TClass, TDoc } from '@hcengineering/model-core'
import type { Asset, IntlString, Resource } from '@hcengineering/platform'
import { type AnyComponent } from '@hcengineering/ui/src/types' import { type AnyComponent } from '@hcengineering/ui/src/types'
import activity from './plugin' import activity from './plugin'
import view from '@hcengineering/model-view'
export { activityOperation } from './migration'
export { activityId } from '@hcengineering/activity' export { activityId } from '@hcengineering/activity'
export const DOMAIN_ACTIVITY = 'activity' as Domain
@Mixin(activity.mixin.ActivityDoc, core.class.Class)
export class TActivityDoc extends TClass implements ActivityDoc {
preposition?: IntlString
ignoreCollections?: string[]
}
@Model(activity.class.TxViewlet, core.class.Doc, DOMAIN_MODEL) @Model(activity.class.TxViewlet, core.class.Doc, DOMAIN_MODEL)
export class TTxViewlet extends TDoc implements TxViewlet { export class TTxViewlet extends TDoc implements TxViewlet {
icon!: Asset icon!: Asset
@ -39,8 +85,141 @@ export class TTxViewlet extends TDoc implements TxViewlet {
hideOnRemove!: boolean hideOnRemove!: boolean
} }
@Model(activity.class.ActivityMessage, core.class.AttachedDoc, DOMAIN_ACTIVITY)
export class TActivityMessage extends TAttachedDoc implements ActivityMessage {
@Prop(TypeBoolean(), activity.string.Pinned)
isPinned?: boolean
@Prop(Collection(activity.class.Reaction), activity.string.Reactions)
reactions?: number
}
@Model(activity.class.DocUpdateMessage, activity.class.ActivityMessage, DOMAIN_ACTIVITY)
export class TDocUpdateMessage extends TActivityMessage implements DocUpdateMessage {
@Prop(TypeRef(core.class.Doc), core.string.Object)
@Index(IndexKind.Indexed)
objectId!: Ref<Doc>
@Prop(TypeRef(core.class.Class), core.string.Class)
@Index(IndexKind.Indexed)
objectClass!: Ref<Class<Doc>>
@Prop(TypeRef(core.class.TxCUD), core.string.Object)
@Index(IndexKind.Indexed)
txId!: Ref<TxCUD<Doc>>
action!: DocUpdateAction
updateCollection?: string
attributeUpdates?: DocAttributeUpdates
}
@Model(activity.class.DocUpdateMessageViewlet, core.class.Doc, DOMAIN_MODEL)
export class TDocUpdateMessageViewlet extends TDoc implements DocUpdateMessageViewlet {
@Prop(TypeRef(core.class.Doc), core.string.Class)
@Index(IndexKind.Indexed)
objectClass!: Ref<Class<Doc>>
@Prop(TypeString(), core.string.String)
@Index(IndexKind.Indexed)
action!: DocUpdateAction
label?: IntlString
labelComponent?: AnyComponent
valueAttr?: string
icon?: Asset
component?: AnyComponent
config?: DocUpdateMessageViewletAttributesConfig
hideIfRemoved?: boolean
onlyWithParent?: boolean
}
@Model(activity.class.ActivityMessageExtension, core.class.Doc, DOMAIN_MODEL)
export class TActivityMessageExtension extends TDoc implements ActivityMessageExtension {
@Prop(TypeRef(activity.class.ActivityMessage), core.string.Class)
@Index(IndexKind.Indexed)
ofMessage!: Ref<Class<ActivityMessage>>
components!: { kind: ActivityMessageExtensionKind, component: AnyComponent }[]
}
@Model(activity.class.ActivityExtension, core.class.Doc, DOMAIN_MODEL)
export class TActivityExtension extends TDoc implements ActivityExtension {
@Prop(TypeRef(core.class.Class), core.string.Class)
@Index(IndexKind.Indexed)
ofClass!: Ref<Class<Doc>>
components!: Record<ActivityExtensionKind, AnyComponent>
}
@Model(activity.class.ActivityMessagesFilter, core.class.Doc, DOMAIN_MODEL)
export class TActivityMessagesFilter extends TDoc implements ActivityMessagesFilter {
label!: IntlString
filter!: Resource<(message: ActivityMessage, _class?: Ref<Doc>) => boolean>
}
@Model(activity.class.Reaction, core.class.AttachedDoc, DOMAIN_ACTIVITY)
export class TReaction extends TAttachedDoc implements Reaction {
@Prop(TypeString(), activity.string.Emoji)
emoji!: string
@Prop(TypeRef(core.class.Account), view.string.Created)
createBy!: Ref<Account>
}
export function createModel (builder: Builder): void { export function createModel (builder: Builder): void {
builder.createModel(TTxViewlet) builder.createModel(
TTxViewlet,
TActivityDoc,
TActivityMessagesFilter,
TActivityMessageExtension,
TActivityMessage,
TDocUpdateMessage,
TDocUpdateMessageViewlet,
TActivityExtension,
TReaction
)
builder.mixin(activity.class.DocUpdateMessage, core.class.Class, activity.mixin.ActivityDoc, {})
builder.mixin(activity.class.DocUpdateMessage, core.class.Class, view.mixin.ObjectPresenter, {
presenter: activity.component.DocUpdateMessagePresenter
})
builder.createDoc(activity.class.ActivityMessagesFilter, core.space.Model, {
label: activity.string.Attributes,
filter: activity.filter.AttributesFilter
})
builder.createDoc(activity.class.ActivityMessagesFilter, core.space.Model, {
label: activity.string.Pinned,
filter: activity.filter.PinnedFilter
})
builder.createDoc(
activity.class.DocUpdateMessageViewlet,
core.space.Model,
{
objectClass: activity.class.Reaction,
action: 'create',
component: activity.component.ReactionAddedMessage,
label: activity.string.Reacted,
onlyWithParent: true,
hideIfRemoved: true
},
activity.ids.ReactionAddedActivityViewlet
)
builder.createDoc(
activity.class.DocUpdateMessageViewlet,
core.space.Model,
{
objectClass: activity.class.Reaction,
action: 'remove',
hideIfRemoved: true
},
activity.ids.ReactionRemovedActivityViewlet
)
} }
export default activity export default activity

View File

@ -0,0 +1,48 @@
//
// Copyright © 2022 Hardcore Engineering Inc.
//
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. You may
// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
import { type Class, type Doc, type Domain, type Ref } from '@hcengineering/core'
import {
type MigrateOperation,
type MigrationClient,
type MigrationUpgradeClient,
tryMigrate
} from '@hcengineering/model'
import activity from './plugin'
import { activityId, DOMAIN_ACTIVITY } from './index'
const DOMAIN_CHUNTER = 'chunter' as Domain
async function migrateReactions (client: MigrationClient): Promise<void> {
await client.update(
DOMAIN_CHUNTER,
{ _class: 'chunter:class:Reaction' as Ref<Class<Doc>> },
{ _class: activity.class.Reaction }
)
await client.move(DOMAIN_CHUNTER, { _class: activity.class.Reaction }, DOMAIN_ACTIVITY)
}
export const activityOperation: MigrateOperation = {
async migrate (client: MigrationClient): Promise<void> {
await tryMigrate(client, activityId, [
{
state: 'reactions',
func: migrateReactions
}
])
},
async upgrade (client: MigrationUpgradeClient): Promise<void> {}
}

View File

@ -12,8 +12,24 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
// //
import { activityId } from '@hcengineering/activity' import { activityId, type ActivityMessage, type DocUpdateMessageViewlet } from '@hcengineering/activity'
import activity from '@hcengineering/activity-resources/src/plugin' import activity from '@hcengineering/activity-resources/src/plugin'
import { mergeIds } from '@hcengineering/platform' import { type IntlString, mergeIds, type Resource } from '@hcengineering/platform'
import { type Doc, type Ref } from '@hcengineering/core'
export default mergeIds(activityId, activity, {}) export default mergeIds(activityId, activity, {
string: {
Attributes: '' as IntlString,
Pinned: '' as IntlString,
Emoji: '' as IntlString,
Reacted: '' as IntlString
},
filter: {
AttributesFilter: '' as Resource<(message: ActivityMessage, _class?: Ref<Doc>) => boolean>,
PinnedFilter: '' as Resource<(message: ActivityMessage, _class?: Ref<Doc>) => boolean>
},
ids: {
ReactionAddedActivityViewlet: '' as Ref<DocUpdateMessageViewlet>,
ReactionRemovedActivityViewlet: '' as Ref<DocUpdateMessageViewlet>
}
})

View File

@ -77,6 +77,7 @@
"@hcengineering/model-request": "^0.6.0", "@hcengineering/model-request": "^0.6.0",
"@hcengineering/model-server-request": "^0.6.0", "@hcengineering/model-server-request": "^0.6.0",
"@hcengineering/model-server-view": "^0.6.0", "@hcengineering/model-server-view": "^0.6.0",
"@hcengineering/model-server-activity": "^0.6.0",
"@hcengineering/model-server-openai": "^0.6.0", "@hcengineering/model-server-openai": "^0.6.0",
"@hcengineering/model-server-translate": "^0.6.0", "@hcengineering/model-server-translate": "^0.6.0",
"@hcengineering/model-support": "^0.6.0" "@hcengineering/model-support": "^0.6.0"

View File

@ -52,6 +52,7 @@ import { serverTaskId, createModel as serverTaskModel } from '@hcengineering/mod
import { serverTelegramId, createModel as serverTelegramModel } from '@hcengineering/model-server-telegram' import { serverTelegramId, createModel as serverTelegramModel } from '@hcengineering/model-server-telegram'
import { serverTrackerId, createModel as serverTrackerModel } from '@hcengineering/model-server-tracker' import { serverTrackerId, createModel as serverTrackerModel } from '@hcengineering/model-server-tracker'
import { serverViewId, createModel as serverViewModel } from '@hcengineering/model-server-view' import { serverViewId, createModel as serverViewModel } from '@hcengineering/model-server-view'
import { serverActivityId, createModel as serverActivityModel } from '@hcengineering/model-server-activity'
import setting, { settingId, createModel as settingModel } from '@hcengineering/model-setting' import setting, { settingId, createModel as settingModel } from '@hcengineering/model-setting'
import { supportId, createModel as supportModel } from '@hcengineering/model-support' import { supportId, createModel as supportModel } from '@hcengineering/model-support'
import { tagsId, createModel as tagsModel } from '@hcengineering/model-tags' import { tagsId, createModel as tagsModel } from '@hcengineering/model-tags'
@ -279,7 +280,7 @@ export default function buildModel (enabled: string[] = ['*'], disabled: string[
[serverNotificationModel, serverNotificationId], [serverNotificationModel, serverNotificationId],
[serverRequestModel, serverRequestId], [serverRequestModel, serverRequestId],
[serverViewModel, serverViewId], [serverViewModel, serverViewId],
[serverActivityModel, serverActivityId],
[serverTranslate, translateId], [serverTranslate, translateId],
[serverOpenAI, openAIId] [serverOpenAI, openAIId]
] ]

View File

@ -36,10 +36,12 @@ import { boardOperation } from '@hcengineering/model-board'
import { hrOperation } from '@hcengineering/model-hr' import { hrOperation } from '@hcengineering/model-hr'
import { bitrixOperation } from '@hcengineering/model-bitrix' import { bitrixOperation } from '@hcengineering/model-bitrix'
import { calendarOperation } from '@hcengineering/model-calendar' import { calendarOperation } from '@hcengineering/model-calendar'
import { notificationServerOperation } from '@hcengineering/model-server-notification' import { activityOperation } from '@hcengineering/model-activity'
import { activityServerOperation } from '@hcengineering/model-server-activity'
export const migrateOperations: [string, MigrateOperation][] = [ export const migrateOperations: [string, MigrateOperation][] = [
['core', coreOperation], ['core', coreOperation],
['activity', activityOperation],
['chunter', chunterOperation], ['chunter', chunterOperation],
['calendar', calendarOperation], ['calendar', calendarOperation],
['gmail', gmailOperation], ['gmail', gmailOperation],
@ -60,5 +62,5 @@ export const migrateOperations: [string, MigrateOperation][] = [
['hr', hrOperation], ['hr', hrOperation],
['bitrix', bitrixOperation], ['bitrix', bitrixOperation],
['inventiry', inventoryOperation], ['inventiry', inventoryOperation],
['notificationServer', notificationServerOperation] ['activityServer', activityServerOperation]
] ]

View File

@ -33,7 +33,6 @@
"@hcengineering/model-core": "^0.6.0", "@hcengineering/model-core": "^0.6.0",
"@hcengineering/model-preference": "^0.6.0", "@hcengineering/model-preference": "^0.6.0",
"@hcengineering/model-view": "^0.6.0", "@hcengineering/model-view": "^0.6.0",
"@hcengineering/notification": "^0.6.16",
"@hcengineering/platform": "^0.6.9", "@hcengineering/platform": "^0.6.9",
"@hcengineering/ui": "^0.6.11", "@hcengineering/ui": "^0.6.11",
"@hcengineering/view": "^0.6.9" "@hcengineering/view": "^0.6.9"

View File

@ -32,7 +32,6 @@ import core, { TAttachedDoc } from '@hcengineering/model-core'
import preference, { TPreference } from '@hcengineering/model-preference' import preference, { TPreference } from '@hcengineering/model-preference'
import view, { createAction } from '@hcengineering/model-view' import view, { createAction } from '@hcengineering/model-view'
import attachment from './plugin' import attachment from './plugin'
import notification from '@hcengineering/notification'
export { attachmentId } from '@hcengineering/attachment' export { attachmentId } from '@hcengineering/attachment'
export { attachmentOperation } from './migration' export { attachmentOperation } from './migration'
@ -124,32 +123,32 @@ export function createModel (builder: Builder): void {
) )
builder.createDoc( builder.createDoc(
notification.class.DocUpdateMessageViewlet, activity.class.DocUpdateMessageViewlet,
core.space.Model, core.space.Model,
{ {
objectClass: attachment.class.Attachment, objectClass: attachment.class.Attachment,
action: 'create', action: 'create',
icon: attachment.icon.Attachment, icon: attachment.icon.Attachment,
label: attachment.string.AddAttachment, label: attachment.string.AddAttachment,
component: attachment.notification.NotificationAttachmentChanged component: attachment.activity.AttachmentsUpdatedMessage
}, },
attachment.ids.NotificationAttachmentCreated attachment.ids.AttachmentCreatedActivityViewlet
) )
builder.createDoc( builder.createDoc(
notification.class.DocUpdateMessageViewlet, activity.class.DocUpdateMessageViewlet,
core.space.Model, core.space.Model,
{ {
objectClass: attachment.class.Attachment, objectClass: attachment.class.Attachment,
action: 'remove', action: 'remove',
icon: attachment.icon.Attachment, icon: attachment.icon.Attachment,
label: attachment.string.RemovedAttachment, label: attachment.string.RemovedAttachment,
component: attachment.notification.NotificationAttachmentChanged component: attachment.activity.AttachmentsUpdatedMessage
}, },
attachment.ids.NotificationAttachmentRemoved attachment.ids.AttachmentRemovedActivityViewlet
) )
builder.createDoc(notification.class.ActivityMessagesFilter, core.space.Model, { builder.createDoc(activity.class.ActivityMessagesFilter, core.space.Model, {
label: attachment.string.FilterAttachments, label: attachment.string.FilterAttachments,
filter: attachment.filter.AttachmentsFilter filter: attachment.filter.AttachmentsFilter
}) })

View File

@ -13,7 +13,7 @@
// limitations under the License. // limitations under the License.
// //
import type { TxViewlet } from '@hcengineering/activity' import type { TxViewlet, ActivityMessage, DocUpdateMessageViewlet } from '@hcengineering/activity'
import { attachmentId } from '@hcengineering/attachment' import { attachmentId } from '@hcengineering/attachment'
import attachment from '@hcengineering/attachment-resources/src/plugin' import attachment from '@hcengineering/attachment-resources/src/plugin'
import type { Ref, Doc } from '@hcengineering/core' import type { Ref, Doc } from '@hcengineering/core'
@ -21,7 +21,6 @@ import type { IntlString, Resource } from '@hcengineering/platform'
import { mergeIds } from '@hcengineering/platform' import { mergeIds } from '@hcengineering/platform'
import type { AnyComponent } from '@hcengineering/ui/src/types' import type { AnyComponent } from '@hcengineering/ui/src/types'
import type { ActionCategory } from '@hcengineering/view' import type { ActionCategory } from '@hcengineering/view'
import { type ActivityMessage, type DocUpdateMessageViewlet } from '@hcengineering/notification'
export default mergeIds(attachmentId, attachment, { export default mergeIds(attachmentId, attachment, {
component: { component: {
@ -47,14 +46,12 @@ export default mergeIds(attachmentId, attachment, {
ids: { ids: {
TxAttachmentCreate: '' as Ref<TxViewlet>, TxAttachmentCreate: '' as Ref<TxViewlet>,
TxAttachmentRemove: '' as Ref<TxViewlet>, TxAttachmentRemove: '' as Ref<TxViewlet>,
NotificationAttachmentCreated: '' as Ref<DocUpdateMessageViewlet>, AttachmentCreatedActivityViewlet: '' as Ref<DocUpdateMessageViewlet>,
NotificationAttachmentRemoved: '' as Ref<DocUpdateMessageViewlet> AttachmentRemovedActivityViewlet: '' as Ref<DocUpdateMessageViewlet>
}, },
activity: { activity: {
TxAttachmentCreate: '' as AnyComponent TxAttachmentCreate: '' as AnyComponent,
}, AttachmentsUpdatedMessage: '' as AnyComponent
notification: {
NotificationAttachmentChanged: '' as AnyComponent
}, },
category: { category: {
Attachments: '' as Ref<ActionCategory> Attachments: '' as Ref<ActionCategory>

View File

@ -244,7 +244,7 @@ export function createModel (builder: Builder): void {
) )
builder.createDoc( builder.createDoc(
notification.class.DocUpdateMessageViewlet, activity.class.DocUpdateMessageViewlet,
core.space.Model, core.space.Model,
{ {
objectClass: calendar.class.Event, objectClass: calendar.class.Event,
@ -252,7 +252,7 @@ export function createModel (builder: Builder): void {
action: 'update', action: 'update',
hideIfRemoved: true hideIfRemoved: true
}, },
calendar.ids.UpdateRemainderNotificationViewlet calendar.ids.UpdateRemainderActivityViewlet
) )
builder.createDoc( builder.createDoc(

View File

@ -13,11 +13,11 @@
// limitations under the License. // limitations under the License.
// //
import { type TxViewlet } from '@hcengineering/activity' import { type DocUpdateMessageViewlet, type TxViewlet } from '@hcengineering/activity'
import { calendarId } from '@hcengineering/calendar' import { calendarId } from '@hcengineering/calendar'
import calendar from '@hcengineering/calendar-resources/src/plugin' import calendar from '@hcengineering/calendar-resources/src/plugin'
import { type Ref } from '@hcengineering/core' import { type Ref } from '@hcengineering/core'
import { type DocUpdateMessageViewlet, type NotificationGroup } from '@hcengineering/notification' import { type NotificationGroup } from '@hcengineering/notification'
import type { IntlString } from '@hcengineering/platform' import type { IntlString } from '@hcengineering/platform'
import { mergeIds } from '@hcengineering/platform' import { mergeIds } from '@hcengineering/platform'
import { type AnyComponent } from '@hcengineering/ui/src/types' import { type AnyComponent } from '@hcengineering/ui/src/types'
@ -66,7 +66,7 @@ export default mergeIds(calendarId, calendar, {
}, },
ids: { ids: {
ReminderViewlet: '' as Ref<TxViewlet>, ReminderViewlet: '' as Ref<TxViewlet>,
UpdateRemainderNotificationViewlet: '' as Ref<DocUpdateMessageViewlet>, UpdateRemainderActivityViewlet: '' as Ref<DocUpdateMessageViewlet>,
CalendarNotificationGroup: '' as Ref<NotificationGroup> CalendarNotificationGroup: '' as Ref<NotificationGroup>
} }
}) })

View File

@ -33,6 +33,7 @@
"@hcengineering/core": "^0.6.28", "@hcengineering/core": "^0.6.28",
"@hcengineering/model": "^0.6.7", "@hcengineering/model": "^0.6.7",
"@hcengineering/model-attachment": "^0.6.0", "@hcengineering/model-attachment": "^0.6.0",
"@hcengineering/model-activity": "^0.6.0",
"@hcengineering/model-core": "^0.6.0", "@hcengineering/model-core": "^0.6.0",
"@hcengineering/model-notification": "^0.6.0", "@hcengineering/model-notification": "^0.6.0",
"@hcengineering/model-preference": "^0.6.0", "@hcengineering/model-preference": "^0.6.0",

View File

@ -24,17 +24,28 @@ import {
type Comment, type Comment,
type DirectMessage, type DirectMessage,
type Message, type Message,
type Reaction,
type SavedMessages, type SavedMessages,
type ThreadMessage, type ThreadMessage,
type DirectMessageInput type DirectMessageInput,
type ChatMessage,
type ChatMessageViewlet
} from '@hcengineering/chunter' } from '@hcengineering/chunter'
import contact, { type Person } from '@hcengineering/contact' import contact, { type Person } from '@hcengineering/contact'
import type { Account, Class, Doc, Domain, Ref, Space, Timestamp } from '@hcengineering/core' import {
import { IndexKind } from '@hcengineering/core' type Account,
type Class,
type Doc,
type Domain,
DOMAIN_MODEL,
type Ref,
type Space,
type Timestamp,
IndexKind
} from '@hcengineering/core'
import { import {
ArrOf, ArrOf,
type Builder, type Builder,
Collection as PropCollection,
Collection, Collection,
Index, Index,
Mixin, Mixin,
@ -48,7 +59,7 @@ import {
UX UX
} from '@hcengineering/model' } from '@hcengineering/model'
import attachment from '@hcengineering/model-attachment' import attachment from '@hcengineering/model-attachment'
import core, { TAttachedDoc, TClass, TSpace } from '@hcengineering/model-core' import core, { TAttachedDoc, TClass, TDoc, TSpace } from '@hcengineering/model-core'
import notification from '@hcengineering/model-notification' import notification from '@hcengineering/model-notification'
import preference, { TPreference } from '@hcengineering/model-preference' import preference, { TPreference } from '@hcengineering/model-preference'
import view, { createAction, actionTemplates as viewTemplates } from '@hcengineering/model-view' import view, { createAction, actionTemplates as viewTemplates } from '@hcengineering/model-view'
@ -56,6 +67,8 @@ import workbench from '@hcengineering/model-workbench'
import chunter from './plugin' import chunter from './plugin'
import { type AnyComponent } from '@hcengineering/ui/src/types' import { type AnyComponent } from '@hcengineering/ui/src/types'
import { TypeBoolean } from '@hcengineering/model' import { TypeBoolean } from '@hcengineering/model'
import type { IntlString } from '@hcengineering/platform'
import { TActivityMessage } from '@hcengineering/model-activity'
export { chunterId } from '@hcengineering/chunter' export { chunterId } from '@hcengineering/chunter'
export { chunterOperation } from './migration' export { chunterOperation } from './migration'
@ -99,7 +112,7 @@ export class TChunterMessage extends TAttachedDoc implements ChunterMessage {
@Prop(TypeTimestamp(), chunter.string.Edit) @Prop(TypeTimestamp(), chunter.string.Edit)
editedOn?: Timestamp editedOn?: Timestamp
@Prop(Collection(chunter.class.Reaction), chunter.string.Reactions) @Prop(Collection(activity.class.Reaction), activity.string.Reactions)
reactions?: number reactions?: number
} }
@ -130,18 +143,6 @@ export class TMessage extends TChunterMessage implements Message {
lastReply?: Timestamp lastReply?: Timestamp
} }
@Model(chunter.class.Reaction, core.class.AttachedDoc, DOMAIN_CHUNTER)
export class TReaction extends TAttachedDoc implements Reaction {
@Prop(TypeString(), chunter.string.Emoji)
emoji!: string
@Prop(TypeRef(core.class.Account), chunter.string.CreateBy)
createBy!: Ref<Account>
declare attachedTo: Ref<ChunterMessage>
declare attachedToClass: Ref<Class<ChunterMessage>>
}
@Model(chunter.class.Comment, core.class.AttachedDoc, DOMAIN_COMMENT) @Model(chunter.class.Comment, core.class.AttachedDoc, DOMAIN_COMMENT)
@UX(chunter.string.Comment, undefined, 'COM') @UX(chunter.string.Comment, undefined, 'COM')
export class TComment extends TAttachedDoc implements Comment { export class TComment extends TAttachedDoc implements Comment {
@ -152,7 +153,7 @@ export class TComment extends TAttachedDoc implements Comment {
@Prop(Collection(attachment.class.Attachment), attachment.string.Attachments, { shortLabel: attachment.string.Files }) @Prop(Collection(attachment.class.Attachment), attachment.string.Attachments, { shortLabel: attachment.string.Files })
attachments?: number attachments?: number
@Prop(Collection(chunter.class.Reaction), chunter.string.Reactions) @Prop(Collection(activity.class.Reaction), activity.string.Reactions)
reactions?: number reactions?: number
@Prop(TypeBoolean(), chunter.string.PinMessage) @Prop(TypeBoolean(), chunter.string.PinMessage)
@ -177,6 +178,31 @@ export class TDirectMessageInput extends TClass implements DirectMessageInput {
component!: AnyComponent component!: AnyComponent
} }
@Model(chunter.class.ChatMessage, activity.class.ActivityMessage, DOMAIN_CHUNTER)
export class TChatMessage extends TActivityMessage implements ChatMessage {
@Prop(TypeMarkup(), chunter.string.Message)
@Index(IndexKind.FullText)
message!: string
@Prop(PropCollection(attachment.class.Attachment), attachment.string.Attachments, {
shortLabel: attachment.string.Files
})
attachments?: number
@Prop(TypeBoolean(), core.string.Boolean)
isEdited?: boolean
}
@Model(chunter.class.ChatMessageViewlet, core.class.Doc, DOMAIN_MODEL)
export class TChatMessageViewlet extends TDoc implements ChatMessageViewlet {
@Prop(TypeRef(core.class.Doc), core.string.Class)
@Index(IndexKind.Indexed)
objectClass!: Ref<Class<Doc>>
label?: IntlString
onlyWithParent?: boolean
}
export function createModel (builder: Builder, options = { addApplication: true }): void { export function createModel (builder: Builder, options = { addApplication: true }): void {
builder.createModel( builder.createModel(
TChunterSpace, TChunterSpace,
@ -189,13 +215,14 @@ export function createModel (builder: Builder, options = { addApplication: true
TBacklink, TBacklink,
TDirectMessage, TDirectMessage,
TSavedMessages, TSavedMessages,
TReaction, TDirectMessageInput,
TDirectMessageInput TChatMessage,
TChatMessageViewlet
) )
const spaceClasses = [chunter.class.Channel, chunter.class.DirectMessage] const spaceClasses = [chunter.class.Channel, chunter.class.DirectMessage]
spaceClasses.forEach((spaceClass) => { spaceClasses.forEach((spaceClass) => {
builder.mixin(spaceClass, core.class.Class, notification.mixin.ActivityDoc, {}) builder.mixin(spaceClass, core.class.Class, activity.mixin.ActivityDoc, {})
builder.mixin(spaceClass, core.class.Class, workbench.mixin.SpaceView, { builder.mixin(spaceClass, core.class.Class, workbench.mixin.SpaceView, {
view: { view: {
@ -497,7 +524,7 @@ export function createModel (builder: Builder, options = { addApplication: true
activity.class.TxViewlet, activity.class.TxViewlet,
core.space.Model, core.space.Model,
{ {
objectClass: notification.class.ChatMessage, objectClass: chunter.class.ChatMessage,
icon: chunter.icon.Chunter, icon: chunter.icon.Chunter,
txClass: core.class.TxCreateDoc, txClass: core.class.TxCreateDoc,
component: chunter.activity.TxCommentCreate, component: chunter.activity.TxCommentCreate,
@ -616,7 +643,7 @@ export function createModel (builder: Builder, options = { addApplication: true
activity.class.TxViewlet, activity.class.TxViewlet,
core.space.Model, core.space.Model,
{ {
objectClass: notification.class.ChatMessage, objectClass: chunter.class.ChatMessage,
icon: chunter.icon.Chunter, icon: chunter.icon.Chunter,
txClass: core.class.TxRemoveDoc, txClass: core.class.TxRemoveDoc,
display: 'inline', display: 'inline',
@ -672,7 +699,7 @@ export function createModel (builder: Builder, options = { addApplication: true
chunter.ids.TxBacklinkRemove chunter.ids.TxBacklinkRemove
) )
builder.createDoc(notification.class.ActivityMessagesFilter, core.space.Model, { builder.createDoc(activity.class.ActivityMessagesFilter, core.space.Model, {
label: chunter.string.FilterBacklinks, label: chunter.string.FilterBacklinks,
filter: chunter.filter.BacklinksFilter filter: chunter.filter.BacklinksFilter
}) })
@ -758,44 +785,6 @@ export function createModel (builder: Builder, options = { addApplication: true
chunter.ids.ChannelNotification chunter.ids.ChannelNotification
) )
builder.createDoc(
notification.class.ActivityMessageExtension,
core.space.Model,
{
ofMessage: notification.class.DocUpdateMessage,
components: [
{
kind: 'footer',
component: chunter.component.ReactionsPresenter
},
{
kind: 'action',
component: chunter.component.ActivityMessageReactionsAction
}
]
},
chunter.ids.DocUpdateMessageExtension
)
builder.createDoc(
notification.class.ActivityMessageExtension,
core.space.Model,
{
ofMessage: notification.class.ChatMessage,
components: [
{
kind: 'footer',
component: chunter.component.ReactionsPresenter
},
{
kind: 'action',
component: chunter.component.ActivityMessageReactionsAction
}
]
},
chunter.ids.ChatMessageExtension
)
builder.createDoc( builder.createDoc(
notification.class.NotificationType, notification.class.NotificationType,
core.space.Model, core.space.Model,
@ -814,52 +803,27 @@ export function createModel (builder: Builder, options = { addApplication: true
) )
builder.createDoc( builder.createDoc(
notification.class.DocUpdateMessageViewlet, activity.class.DocUpdateMessageViewlet,
core.space.Model, core.space.Model,
{ {
objectClass: chunter.class.Backlink, objectClass: chunter.class.Backlink,
action: 'create', action: 'create',
component: chunter.component.BacklinkContent, component: chunter.component.BacklinkContent,
labelComponent: chunter.component.NotificationBacklinkLabel, labelComponent: chunter.activity.BacklinkCreatedLabel,
hideIfRemoved: true hideIfRemoved: true
}, },
chunter.ids.NotificationBacklinkCreated chunter.ids.BacklinkCreatedActivityViewlet
) )
builder.createDoc( builder.createDoc(
notification.class.DocUpdateMessageViewlet, activity.class.DocUpdateMessageViewlet,
core.space.Model, core.space.Model,
{ {
objectClass: chunter.class.Backlink, objectClass: chunter.class.Backlink,
action: 'remove', action: 'remove',
hideIfRemoved: true hideIfRemoved: true
}, },
chunter.ids.NotificationBacklinkRemoved chunter.ids.BacklinkRemovedActivityViewlet
)
builder.createDoc(
notification.class.DocUpdateMessageViewlet,
core.space.Model,
{
objectClass: chunter.class.Reaction,
action: 'create',
component: chunter.component.NotificationReactionCreated,
label: chunter.string.Reacted,
onlyWithParent: true,
hideIfRemoved: true
},
chunter.ids.NotificationReactionCreated
)
builder.createDoc(
notification.class.DocUpdateMessageViewlet,
core.space.Model,
{
objectClass: chunter.class.Reaction,
action: 'remove',
hideIfRemoved: true
},
chunter.ids.NotificationReactionRemoved
) )
createAction(builder, { createAction(builder, {
@ -874,6 +838,35 @@ export function createModel (builder: Builder, options = { addApplication: true
mode: 'space' mode: 'space'
} }
}) })
builder.createDoc(activity.class.ActivityMessagesFilter, core.space.Model, {
label: chunter.string.Comments,
filter: chunter.filter.ChatMessagesFilter
})
builder.mixin(chunter.class.ChatMessage, core.class.Class, activity.mixin.ActivityDoc, {})
builder.mixin(chunter.class.ChatMessage, core.class.Class, view.mixin.CollectionPresenter, {
presenter: chunter.component.ChatMessagesPresenter
})
builder.mixin(chunter.class.ChatMessage, core.class.Class, view.mixin.ObjectPresenter, {
presenter: chunter.component.ChatMessagePresenter
})
createAction(
builder,
{
action: chunter.actionImpl.DeleteChatMessage,
label: view.string.Delete,
icon: view.icon.Delete,
input: 'focus',
keyBinding: ['Backspace'],
category: chunter.category.Chunter,
target: chunter.class.ChatMessage,
context: { mode: ['context', 'browser'], group: 'edit' }
},
chunter.action.DeleteChatMessage
)
} }
export default chunter export default chunter

View File

@ -21,7 +21,6 @@ import {
tryMigrate tryMigrate
} from '@hcengineering/model' } from '@hcengineering/model'
import { chunterId } from '@hcengineering/chunter' import { chunterId } from '@hcengineering/chunter'
import notification from '@hcengineering/notification'
import { DOMAIN_NOTIFICATION } from '@hcengineering/model-notification' import { DOMAIN_NOTIFICATION } from '@hcengineering/model-notification'
import { DOMAIN_COMMENT } from './index' import { DOMAIN_COMMENT } from './index'
@ -90,8 +89,8 @@ async function createBacklink (tx: TxOperations): Promise<void> {
} }
async function convertCommentsToChatMessages (client: MigrationClient): Promise<void> { async function convertCommentsToChatMessages (client: MigrationClient): Promise<void> {
await client.update(DOMAIN_COMMENT, { _class: chunter.class.Comment }, { _class: notification.class.ChatMessage }) await client.update(DOMAIN_COMMENT, { _class: chunter.class.Comment }, { _class: chunter.class.ChatMessage })
await client.move(DOMAIN_COMMENT, { _class: notification.class.ChatMessage }, DOMAIN_NOTIFICATION) await client.move(DOMAIN_COMMENT, { _class: chunter.class.ChatMessage }, DOMAIN_NOTIFICATION)
} }
export const chunterOperation: MigrateOperation = { export const chunterOperation: MigrateOperation = {

View File

@ -13,16 +13,11 @@
// limitations under the License. // limitations under the License.
// //
import type { TxViewlet } from '@hcengineering/activity' import type { ActivityMessage, DocUpdateMessageViewlet, TxViewlet } from '@hcengineering/activity'
import { chunterId, type Channel } from '@hcengineering/chunter' import { chunterId, type Channel } from '@hcengineering/chunter'
import chunter from '@hcengineering/chunter-resources/src/plugin' import chunter from '@hcengineering/chunter-resources/src/plugin'
import type { Doc, Ref, Space } from '@hcengineering/core' import type { Doc, Ref, Space } from '@hcengineering/core'
import { import { type NotificationGroup } from '@hcengineering/notification'
type ActivityMessage,
type ActivityMessageExtension,
type DocUpdateMessageViewlet,
type NotificationGroup
} from '@hcengineering/notification'
import type { IntlString, Resource } from '@hcengineering/platform' import type { IntlString, Resource } from '@hcengineering/platform'
import { mergeIds } from '@hcengineering/platform' import { mergeIds } from '@hcengineering/platform'
import type { AnyComponent, Location } from '@hcengineering/ui/src/types' import type { AnyComponent, Location } from '@hcengineering/ui/src/types'
@ -37,9 +32,6 @@ export default mergeIds(chunterId, chunter, {
Threads: '' as AnyComponent, Threads: '' as AnyComponent,
SavedMessages: '' as AnyComponent, SavedMessages: '' as AnyComponent,
ChunterBrowser: '' as AnyComponent, ChunterBrowser: '' as AnyComponent,
ReactionsPresenter: '' as AnyComponent,
ReactionsAction: '' as AnyComponent,
ActivityMessageReactionsAction: '' as AnyComponent,
BacklinkContent: '' as AnyComponent, BacklinkContent: '' as AnyComponent,
BacklinkReference: '' as AnyComponent BacklinkReference: '' as AnyComponent
}, },
@ -58,14 +50,14 @@ export default mergeIds(chunterId, chunter, {
MarkCommentUnread: '' as ViewAction, MarkCommentUnread: '' as ViewAction,
ArchiveChannel: '' as ViewAction, ArchiveChannel: '' as ViewAction,
UnarchiveChannel: '' as ViewAction, UnarchiveChannel: '' as ViewAction,
ConvertDmToPrivateChannel: '' as ViewAction ConvertDmToPrivateChannel: '' as ViewAction,
DeleteChatMessage: '' as ViewAction
}, },
category: { category: {
Chunter: '' as Ref<ActionCategory> Chunter: '' as Ref<ActionCategory>
}, },
string: { string: {
ApplicationLabelChunter: '' as IntlString, ApplicationLabelChunter: '' as IntlString,
LeftComment: '' as IntlString,
MentionedIn: '' as IntlString, MentionedIn: '' as IntlString,
Content: '' as IntlString, Content: '' as IntlString,
Comment: '' as IntlString, Comment: '' as IntlString,
@ -100,16 +92,13 @@ export default mergeIds(chunterId, chunter, {
TxChatMessageCreate: '' as Ref<TxViewlet>, TxChatMessageCreate: '' as Ref<TxViewlet>,
TxChatMessageRemove: '' as Ref<TxViewlet>, TxChatMessageRemove: '' as Ref<TxViewlet>,
ChunterNotificationGroup: '' as Ref<NotificationGroup>, ChunterNotificationGroup: '' as Ref<NotificationGroup>,
DocUpdateMessageExtension: '' as Ref<ActivityMessageExtension>, BacklinkCreatedActivityViewlet: '' as Ref<DocUpdateMessageViewlet>,
ChatMessageExtension: '' as Ref<ActivityMessageExtension>, BacklinkRemovedActivityViewlet: '' as Ref<DocUpdateMessageViewlet>
NotificationBacklinkCreated: '' as Ref<DocUpdateMessageViewlet>,
NotificationBacklinkRemoved: '' as Ref<DocUpdateMessageViewlet>,
NotificationReactionCreated: '' as Ref<DocUpdateMessageViewlet>,
NotificationReactionRemoved: '' as Ref<DocUpdateMessageViewlet>
}, },
activity: { activity: {
TxCommentCreate: '' as AnyComponent, TxCommentCreate: '' as AnyComponent,
TxMessageCreate: '' as AnyComponent TxMessageCreate: '' as AnyComponent,
BacklinkCreatedLabel: '' as AnyComponent
}, },
space: { space: {
General: '' as Ref<Channel>, General: '' as Ref<Channel>,
@ -121,6 +110,7 @@ export default mergeIds(chunterId, chunter, {
GetFragment: '' as Resource<(doc: Doc, props: Record<string, any>) => Promise<Location>> GetFragment: '' as Resource<(doc: Doc, props: Record<string, any>) => Promise<Location>>
}, },
filter: { filter: {
BacklinksFilter: '' as Resource<(message: ActivityMessage, _class?: Ref<Doc>) => boolean> BacklinksFilter: '' as Resource<(message: ActivityMessage, _class?: Ref<Doc>) => boolean>,
ChatMessagesFilter: '' as Resource<(message: ActivityMessage, _class?: Ref<Doc>) => boolean>
} }
}) })

View File

@ -25,24 +25,25 @@
"prettier-plugin-svelte": "^3.1.0" "prettier-plugin-svelte": "^3.1.0"
}, },
"dependencies": { "dependencies": {
"@hcengineering/model-core": "^0.6.0",
"@hcengineering/model-chunter": "^0.6.0",
"@hcengineering/model-workbench": "^0.6.1",
"@hcengineering/model-attachment": "^0.6.0",
"@hcengineering/model-notification": "^0.6.0",
"@hcengineering/model-view": "^0.6.0",
"@hcengineering/model-presentation": "^0.6.0",
"@hcengineering/model": "^0.6.7",
"@hcengineering/setting": "^0.6.11",
"@hcengineering/core": "^0.6.28",
"@hcengineering/ui": "^0.6.11",
"@hcengineering/platform": "^0.6.9",
"@hcengineering/activity": "^0.6.0", "@hcengineering/activity": "^0.6.0",
"@hcengineering/chunter": "^0.6.12",
"@hcengineering/contact": "^0.6.20", "@hcengineering/contact": "^0.6.20",
"@hcengineering/notification": "^0.6.16",
"@hcengineering/contact-resources": "^0.6.0", "@hcengineering/contact-resources": "^0.6.0",
"@hcengineering/core": "^0.6.28",
"@hcengineering/model": "^0.6.7",
"@hcengineering/model-attachment": "^0.6.0",
"@hcengineering/model-chunter": "^0.6.0",
"@hcengineering/model-core": "^0.6.0",
"@hcengineering/model-notification": "^0.6.0",
"@hcengineering/model-presentation": "^0.6.0",
"@hcengineering/model-view": "^0.6.0",
"@hcengineering/model-workbench": "^0.6.1",
"@hcengineering/notification": "^0.6.16",
"@hcengineering/platform": "^0.6.9",
"@hcengineering/setting": "^0.6.11",
"@hcengineering/templates": "^0.6.7",
"@hcengineering/ui": "^0.6.11",
"@hcengineering/view": "^0.6.9", "@hcengineering/view": "^0.6.9",
"cross-fetch": "^3.1.5", "cross-fetch": "^3.1.5"
"@hcengineering/templates": "^0.6.7"
} }
} }

View File

@ -112,7 +112,7 @@ export class TContact extends TDoc implements Contact {
@Prop(Collection(attachment.class.Attachment), attachment.string.Attachments, { shortLabel: attachment.string.Files }) @Prop(Collection(attachment.class.Attachment), attachment.string.Attachments, { shortLabel: attachment.string.Files })
attachments?: number attachments?: number
@Prop(Collection(notification.class.ChatMessage), notification.string.Comments) @Prop(Collection(chunter.class.ChatMessage), chunter.string.Comments)
comments?: number comments?: number
@Prop(TypeString(), contact.string.Location) @Prop(TypeString(), contact.string.Location)
@ -221,24 +221,37 @@ export function createModel (builder: Builder): void {
TContactsTab TContactsTab
) )
builder.mixin(contact.class.Contact, core.class.Class, notification.mixin.ActivityDoc, { builder.mixin(contact.class.Contact, core.class.Class, activity.mixin.ActivityDoc, {
ignoreCollections: ['comments']
})
builder.mixin(contact.class.Person, core.class.Class, notification.mixin.ActivityDoc, {
ignoreCollections: ['comments']
})
builder.mixin(contact.mixin.Employee, core.class.Class, notification.mixin.ActivityDoc, {
ignoreCollections: ['comments']
})
builder.mixin(contact.class.Organization, core.class.Class, notification.mixin.ActivityDoc, {
ignoreCollections: ['comments'] ignoreCollections: ['comments']
}) })
builder.mixin(contact.class.Person, core.class.Class, notification.mixin.NotificationObjectPreposition, { builder.mixin(contact.class.Person, core.class.Class, activity.mixin.ActivityDoc, {
preposition: contact.string.For preposition: contact.string.For,
ignoreCollections: ['comments']
}) })
builder.mixin(contact.mixin.Employee, core.class.Class, notification.mixin.NotificationObjectPreposition, {
preposition: contact.string.For builder.mixin(contact.mixin.Employee, core.class.Class, activity.mixin.ActivityDoc, {
preposition: contact.string.For,
ignoreCollections: ['comments']
})
builder.mixin(contact.class.Organization, core.class.Class, activity.mixin.ActivityDoc, {
ignoreCollections: ['comments']
})
builder.createDoc(activity.class.ActivityExtension, core.space.Model, {
ofClass: contact.class.Contact,
components: { input: chunter.component.ChatMessageInput }
})
builder.createDoc(activity.class.ActivityExtension, core.space.Model, {
ofClass: contact.class.Person,
components: { input: chunter.component.ChatMessageInput }
})
builder.createDoc(activity.class.ActivityExtension, core.space.Model, {
ofClass: contact.class.Organization,
components: { input: chunter.component.ChatMessageInput }
}) })
builder.mixin(contact.mixin.Employee, core.class.Class, view.mixin.ObjectFactory, { builder.mixin(contact.mixin.Employee, core.class.Class, view.mixin.ObjectFactory, {
@ -329,12 +342,12 @@ export function createModel (builder: Builder): void {
match: { 'operations.name': { $exists: true } } match: { 'operations.name': { $exists: true } }
}) })
builder.createDoc(notification.class.DocUpdateMessageViewlet, core.space.Model, { builder.createDoc(activity.class.DocUpdateMessageViewlet, core.space.Model, {
objectClass: contact.class.Person, objectClass: contact.class.Person,
action: 'update', action: 'update',
config: { config: {
name: { name: {
presenter: contact.notification.NotificationNameChanged presenter: contact.activity.NameChangedActivityMessage
} }
} }
}) })
@ -968,7 +981,7 @@ export function createModel (builder: Builder): void {
) )
builder.createDoc( builder.createDoc(
notification.class.ChatMessageViewlet, chunter.class.ChatMessageViewlet,
core.space.Model, core.space.Model,
{ {
objectClass: contact.class.Person, objectClass: contact.class.Person,
@ -978,7 +991,7 @@ export function createModel (builder: Builder): void {
) )
builder.createDoc( builder.createDoc(
notification.class.ChatMessageViewlet, chunter.class.ChatMessageViewlet,
core.space.Model, core.space.Model,
{ {
objectClass: contact.mixin.Employee, objectClass: contact.mixin.Employee,
@ -988,7 +1001,7 @@ export function createModel (builder: Builder): void {
) )
builder.createDoc( builder.createDoc(
notification.class.ChatMessageViewlet, chunter.class.ChatMessageViewlet,
core.space.Model, core.space.Model,
{ {
objectClass: contact.class.Organization, objectClass: contact.class.Organization,

View File

@ -18,18 +18,17 @@ import { contactId } from '@hcengineering/contact'
import contact from '@hcengineering/contact-resources/src/plugin' import contact from '@hcengineering/contact-resources/src/plugin'
import type { Client, Doc, Ref } from '@hcengineering/core' import type { Client, Doc, Ref } from '@hcengineering/core'
import { type ObjectSearchCategory, type ObjectSearchFactory } from '@hcengineering/model-presentation' import { type ObjectSearchCategory, type ObjectSearchFactory } from '@hcengineering/model-presentation'
import { type ChatMessageViewlet, type NotificationGroup } from '@hcengineering/notification' import { type NotificationGroup } from '@hcengineering/notification'
import { type IntlString, mergeIds, type Resource } from '@hcengineering/platform' import { type IntlString, mergeIds, type Resource } from '@hcengineering/platform'
import { type TemplateFieldFunc } from '@hcengineering/templates' import { type TemplateFieldFunc } from '@hcengineering/templates'
import type { AnyComponent } from '@hcengineering/ui/src/types' import type { AnyComponent } from '@hcengineering/ui/src/types'
import { type Action, type ActionCategory, type ViewAction } from '@hcengineering/view' import { type Action, type ActionCategory, type ViewAction } from '@hcengineering/view'
import { type ChatMessageViewlet } from '@hcengineering/chunter'
export default mergeIds(contactId, contact, { export default mergeIds(contactId, contact, {
activity: { activity: {
TxNameChange: '' as AnyComponent TxNameChange: '' as AnyComponent,
}, NameChangedActivityMessage: '' as AnyComponent
notification: {
NotificationNameChanged: '' as AnyComponent
}, },
component: { component: {
PersonPresenter: '' as AnyComponent, PersonPresenter: '' as AnyComponent,

View File

@ -25,20 +25,21 @@
"prettier-plugin-svelte": "^3.1.0" "prettier-plugin-svelte": "^3.1.0"
}, },
"dependencies": { "dependencies": {
"@hcengineering/core": "^0.6.28",
"@hcengineering/model": "^0.6.7",
"@hcengineering/ui": "^0.6.11",
"@hcengineering/contact": "^0.6.20", "@hcengineering/contact": "^0.6.20",
"@hcengineering/platform": "^0.6.9", "@hcengineering/core": "^0.6.28",
"@hcengineering/model-core": "^0.6.0",
"@hcengineering/notification": "^0.6.16",
"@hcengineering/model-view": "^0.6.0",
"@hcengineering/model-workbench": "^0.6.1",
"@hcengineering/model-contact": "^0.6.1",
"@hcengineering/model-calendar": "^0.6.0",
"@hcengineering/model-attachment": "^0.6.0",
"@hcengineering/hr": "^0.6.12", "@hcengineering/hr": "^0.6.12",
"@hcengineering/hr-resources": "^0.6.0", "@hcengineering/hr-resources": "^0.6.0",
"@hcengineering/model": "^0.6.7",
"@hcengineering/model-attachment": "^0.6.0",
"@hcengineering/model-calendar": "^0.6.0",
"@hcengineering/model-chunter": "^0.6.0",
"@hcengineering/model-contact": "^0.6.1",
"@hcengineering/model-core": "^0.6.0",
"@hcengineering/model-view": "^0.6.0",
"@hcengineering/model-workbench": "^0.6.1",
"@hcengineering/notification": "^0.6.16",
"@hcengineering/platform": "^0.6.9",
"@hcengineering/ui": "^0.6.11",
"@hcengineering/view": "^0.6.9" "@hcengineering/view": "^0.6.9"
} }
} }

View File

@ -59,6 +59,7 @@ import notification from '@hcengineering/notification'
import { type Asset, type IntlString } from '@hcengineering/platform' import { type Asset, type IntlString } from '@hcengineering/platform'
import hr from './plugin' import hr from './plugin'
import { PaletteColorIndexes } from '@hcengineering/ui/src/colors' import { PaletteColorIndexes } from '@hcengineering/ui/src/colors'
import chunter from '@hcengineering/model-chunter'
export { hrId } from '@hcengineering/hr' export { hrId } from '@hcengineering/hr'
export { hrOperation } from './migration' export { hrOperation } from './migration'
@ -83,7 +84,7 @@ export class TDepartment extends TSpace implements Department {
@Prop(Collection(attachment.class.Attachment), attachment.string.Attachments, { shortLabel: attachment.string.Files }) @Prop(Collection(attachment.class.Attachment), attachment.string.Attachments, { shortLabel: attachment.string.Files })
attachments?: number attachments?: number
@Prop(Collection(notification.class.ChatMessage), notification.string.Comments) @Prop(Collection(chunter.class.ChatMessage), chunter.string.Comments)
comments?: number comments?: number
avatar?: string | null avatar?: string | null
@ -157,7 +158,7 @@ export class TRequest extends TAttachedDoc implements Request {
@Hidden() @Hidden()
type!: Ref<RequestType> type!: Ref<RequestType>
@Prop(Collection(notification.class.ChatMessage), notification.string.Comments) @Prop(Collection(chunter.class.ChatMessage), chunter.string.Comments)
comments?: number comments?: number
@Prop(Collection(attachment.class.Attachment), attachment.string.Attachments, { shortLabel: attachment.string.Files }) @Prop(Collection(attachment.class.Attachment), attachment.string.Attachments, { shortLabel: attachment.string.Files })

View File

@ -25,20 +25,21 @@
"prettier-plugin-svelte": "^3.1.0" "prettier-plugin-svelte": "^3.1.0"
}, },
"dependencies": { "dependencies": {
"@hcengineering/activity": "^0.6.0",
"@hcengineering/chunter": "^0.6.12",
"@hcengineering/core": "^0.6.28", "@hcengineering/core": "^0.6.28",
"@hcengineering/model": "^0.6.7",
"@hcengineering/model-workbench": "^0.6.1",
"@hcengineering/model-attachment": "^0.6.0",
"@hcengineering/model-core": "^0.6.0",
"@hcengineering/ui": "^0.6.11",
"@hcengineering/platform": "^0.6.9",
"@hcengineering/notification": "^0.6.16",
"@hcengineering/inventory": "^0.6.7", "@hcengineering/inventory": "^0.6.7",
"@hcengineering/inventory-resources": "^0.6.0", "@hcengineering/inventory-resources": "^0.6.0",
"@hcengineering/view": "^0.6.9", "@hcengineering/model": "^0.6.7",
"@hcengineering/setting": "^0.6.11", "@hcengineering/model-attachment": "^0.6.0",
"@hcengineering/workbench": "^0.6.9", "@hcengineering/model-chunter": "^0.6.0",
"@hcengineering/model-core": "^0.6.0",
"@hcengineering/model-view": "^0.6.0", "@hcengineering/model-view": "^0.6.0",
"@hcengineering/model-chunter": "^0.6.0" "@hcengineering/model-workbench": "^0.6.1",
"@hcengineering/platform": "^0.6.9",
"@hcengineering/setting": "^0.6.11",
"@hcengineering/ui": "^0.6.11",
"@hcengineering/view": "^0.6.9",
"@hcengineering/workbench": "^0.6.9"
} }
} }

View File

@ -22,8 +22,8 @@ import { createAction } from '@hcengineering/model-view'
import workbench from '@hcengineering/model-workbench' import workbench from '@hcengineering/model-workbench'
import setting from '@hcengineering/setting' import setting from '@hcengineering/setting'
import view, { type Viewlet } from '@hcengineering/view' import view, { type Viewlet } from '@hcengineering/view'
import notification from '@hcengineering/notification'
import chunter from '@hcengineering/model-chunter' import chunter from '@hcengineering/model-chunter'
import activity from '@hcengineering/activity'
import inventory from './plugin' import inventory from './plugin'
export { inventoryId } from '@hcengineering/inventory' export { inventoryId } from '@hcengineering/inventory'
@ -79,9 +79,24 @@ export class TVariant extends TAttachedDoc implements Variant {
export function createModel (builder: Builder): void { export function createModel (builder: Builder): void {
builder.createModel(TCategory, TProduct, TVariant) builder.createModel(TCategory, TProduct, TVariant)
builder.mixin(inventory.class.Product, core.class.Class, notification.mixin.ActivityDoc, {}) builder.mixin(inventory.class.Product, core.class.Class, activity.mixin.ActivityDoc, {})
builder.mixin(inventory.class.Category, core.class.Class, notification.mixin.ActivityDoc, {}) builder.mixin(inventory.class.Category, core.class.Class, activity.mixin.ActivityDoc, {})
builder.mixin(inventory.class.Variant, core.class.Class, notification.mixin.ActivityDoc, {}) builder.mixin(inventory.class.Variant, core.class.Class, activity.mixin.ActivityDoc, {})
builder.createDoc(activity.class.ActivityExtension, core.space.Model, {
ofClass: inventory.class.Product,
components: { input: chunter.component.ChatMessageInput }
})
builder.createDoc(activity.class.ActivityExtension, core.space.Model, {
ofClass: inventory.class.Category,
components: { input: chunter.component.ChatMessageInput }
})
builder.createDoc(activity.class.ActivityExtension, core.space.Model, {
ofClass: inventory.class.Variant,
components: { input: chunter.component.ChatMessageInput }
})
builder.mixin(inventory.class.Category, core.class.Class, view.mixin.ObjectPresenter, { builder.mixin(inventory.class.Category, core.class.Class, view.mixin.ObjectPresenter, {
presenter: inventory.component.CategoryPresenter presenter: inventory.component.CategoryPresenter
@ -169,7 +184,7 @@ export function createModel (builder: Builder): void {
) )
builder.createDoc( builder.createDoc(
notification.class.ChatMessageViewlet, chunter.class.ChatMessageViewlet,
core.space.Model, core.space.Model,
{ {
objectClass: inventory.class.Product, objectClass: inventory.class.Product,
@ -179,7 +194,7 @@ export function createModel (builder: Builder): void {
) )
builder.createDoc( builder.createDoc(
notification.class.ChatMessageViewlet, chunter.class.ChatMessageViewlet,
core.space.Model, core.space.Model,
{ {
objectClass: inventory.class.Category, objectClass: inventory.class.Category,

View File

@ -14,13 +14,13 @@
// limitations under the License. // limitations under the License.
// //
import { type ChatMessageViewlet } from '@hcengineering/chunter'
import type { Ref } from '@hcengineering/core' import type { Ref } from '@hcengineering/core'
import { inventoryId } from '@hcengineering/inventory' import { inventoryId } from '@hcengineering/inventory'
import inventory from '@hcengineering/inventory-resources/src/plugin' import inventory from '@hcengineering/inventory-resources/src/plugin'
import { type IntlString, mergeIds } from '@hcengineering/platform' import { type IntlString, mergeIds } from '@hcengineering/platform'
import type { AnyComponent } from '@hcengineering/ui/src/types' import type { AnyComponent } from '@hcengineering/ui/src/types'
import { type Action, type ActionCategory, type ViewAction, type Viewlet } from '@hcengineering/view' import { type Action, type ActionCategory, type ViewAction, type Viewlet } from '@hcengineering/view'
import { type ChatMessageViewlet } from '@hcengineering/notification'
export default mergeIds(inventoryId, inventory, { export default mergeIds(inventoryId, inventory, {
action: { action: {
CreateSubcategory: '' as Ref<Action> CreateSubcategory: '' as Ref<Action>

View File

@ -25,26 +25,28 @@
"prettier-plugin-svelte": "^3.1.0" "prettier-plugin-svelte": "^3.1.0"
}, },
"dependencies": { "dependencies": {
"@hcengineering/core": "^0.6.28", "@hcengineering/activity": "^0.6.0",
"@hcengineering/model": "^0.6.7",
"@hcengineering/ui": "^0.6.11",
"@hcengineering/contact": "^0.6.20", "@hcengineering/contact": "^0.6.20",
"@hcengineering/platform": "^0.6.9", "@hcengineering/core": "^0.6.28",
"@hcengineering/lead": "^0.6.0",
"@hcengineering/chunter": "^0.6.12",
"@hcengineering/lead-resources": "^0.6.0",
"@hcengineering/model": "^0.6.7",
"@hcengineering/model-attachment": "^0.6.0",
"@hcengineering/model-chunter": "^0.6.0",
"@hcengineering/model-contact": "^0.6.1",
"@hcengineering/model-core": "^0.6.0", "@hcengineering/model-core": "^0.6.0",
"@hcengineering/model-notification": "^0.6.0",
"@hcengineering/model-task": "^0.6.0",
"@hcengineering/model-tracker": "^0.6.0",
"@hcengineering/model-view": "^0.6.0", "@hcengineering/model-view": "^0.6.0",
"@hcengineering/model-workbench": "^0.6.1", "@hcengineering/model-workbench": "^0.6.1",
"@hcengineering/model-contact": "^0.6.1",
"@hcengineering/model-chunter": "^0.6.0",
"@hcengineering/model-attachment": "^0.6.0",
"@hcengineering/lead": "^0.6.0",
"@hcengineering/lead-resources": "^0.6.0",
"@hcengineering/setting": "^0.6.11",
"@hcengineering/view": "^0.6.9",
"@hcengineering/task": "^0.6.13",
"@hcengineering/model-notification": "^0.6.0",
"@hcengineering/notification": "^0.6.16", "@hcengineering/notification": "^0.6.16",
"@hcengineering/model-task": "^0.6.0", "@hcengineering/platform": "^0.6.9",
"@hcengineering/workbench": "^0.6.9", "@hcengineering/setting": "^0.6.11",
"@hcengineering/model-tracker": "^0.6.0" "@hcengineering/task": "^0.6.13",
"@hcengineering/ui": "^0.6.11",
"@hcengineering/view": "^0.6.9",
"@hcengineering/workbench": "^0.6.9"
} }
} }

View File

@ -43,6 +43,8 @@ import workbench from '@hcengineering/model-workbench'
import notification from '@hcengineering/notification' import notification from '@hcengineering/notification'
import setting from '@hcengineering/setting' import setting from '@hcengineering/setting'
import { type ViewOptionsModel } from '@hcengineering/view' import { type ViewOptionsModel } from '@hcengineering/view'
import activity from '@hcengineering/activity'
import lead from './plugin' import lead from './plugin'
export { leadId } from '@hcengineering/lead' export { leadId } from '@hcengineering/lead'
@ -59,7 +61,7 @@ export class TFunnel extends TProject implements Funnel {
@Prop(Collection(attachment.class.Attachment), attachment.string.Attachments, { shortLabel: attachment.string.Files }) @Prop(Collection(attachment.class.Attachment), attachment.string.Attachments, { shortLabel: attachment.string.Files })
attachments?: number attachments?: number
@Prop(Collection(notification.class.ChatMessage), notification.string.Comments) @Prop(Collection(chunter.class.ChatMessage), chunter.string.Comments)
comments?: number comments?: number
} }
@ -102,13 +104,25 @@ export function createModel (builder: Builder): void {
builder.createModel(TFunnel, TLead, TCustomer) builder.createModel(TFunnel, TLead, TCustomer)
builder.mixin(lead.class.Lead, core.class.Class, notification.mixin.ActivityDoc, { builder.mixin(lead.class.Lead, core.class.Class, activity.mixin.ActivityDoc, {
ignoreCollections: ['comments'] ignoreCollections: ['comments']
}) })
builder.mixin(lead.mixin.Customer, core.class.Class, notification.mixin.ActivityDoc, {
builder.mixin(lead.mixin.Customer, core.class.Class, activity.mixin.ActivityDoc, {
ignoreCollections: ['comments'] ignoreCollections: ['comments']
}) })
builder.mixin(lead.class.Funnel, core.class.Class, notification.mixin.ActivityDoc, {})
builder.mixin(lead.class.Funnel, core.class.Class, activity.mixin.ActivityDoc, {})
builder.createDoc(activity.class.ActivityExtension, core.space.Model, {
ofClass: lead.class.Lead,
components: { input: chunter.component.ChatMessageInput }
})
builder.createDoc(activity.class.ActivityExtension, core.space.Model, {
ofClass: lead.class.Funnel,
components: { input: chunter.component.ChatMessageInput }
})
builder.mixin(lead.class.Funnel, core.class.Class, workbench.mixin.SpaceView, { builder.mixin(lead.class.Funnel, core.class.Class, workbench.mixin.SpaceView, {
view: { view: {
@ -518,7 +532,7 @@ export function createModel (builder: Builder): void {
) )
builder.createDoc( builder.createDoc(
notification.class.ChatMessageViewlet, chunter.class.ChatMessageViewlet,
core.space.Model, core.space.Model,
{ {
objectClass: lead.class.Lead, objectClass: lead.class.Lead,

View File

@ -14,10 +14,11 @@
// limitations under the License. // limitations under the License.
// //
import { type ChatMessageViewlet } from '@hcengineering/chunter'
import type { Ref } from '@hcengineering/core' import type { Ref } from '@hcengineering/core'
import { type Funnel, leadId } from '@hcengineering/lead' import { type Funnel, leadId } from '@hcengineering/lead'
import lead from '@hcengineering/lead-resources/src/plugin' import lead from '@hcengineering/lead-resources/src/plugin'
import { type ChatMessageViewlet, type NotificationGroup, type NotificationType } from '@hcengineering/notification' import { type NotificationGroup, type NotificationType } from '@hcengineering/notification'
import type { IntlString } from '@hcengineering/platform' import type { IntlString } from '@hcengineering/platform'
import { mergeIds } from '@hcengineering/platform' import { mergeIds } from '@hcengineering/platform'
import { type ProjectType } from '@hcengineering/task' import { type ProjectType } from '@hcengineering/task'

View File

@ -1,148 +0,0 @@
import { type Builder } from '@hcengineering/model'
import view, { createAction } from '@hcengineering/model-view'
import core from '@hcengineering/model-core'
import notification from './plugin'
export function buildActivityMessages (builder: Builder): void {
builder.mixin(notification.class.DocUpdateMessage, core.class.Class, notification.mixin.ActivityDoc, {})
builder.mixin(notification.class.ChatMessage, core.class.Class, notification.mixin.ActivityDoc, {})
builder.mixin(notification.class.ChatMessage, core.class.Class, view.mixin.CollectionPresenter, {
presenter: notification.component.ChatMessagesPresenter
})
builder.mixin(notification.class.ChatMessage, core.class.Class, view.mixin.ObjectPresenter, {
presenter: notification.component.ChatMessagePresenter
})
builder.mixin(notification.class.DocUpdateMessage, core.class.Class, view.mixin.ObjectPresenter, {
presenter: notification.component.DocUpdateMessagePresenter
})
builder.createDoc(
notification.class.ActivityMessageExtension,
core.space.Model,
{
ofMessage: notification.class.DocUpdateMessage,
components: [
{
kind: 'action',
component: notification.component.PinMessageAction
}
]
},
notification.ids.DocUpdateMessagePinExtension
)
builder.createDoc(
notification.class.ActivityMessageExtension,
core.space.Model,
{
ofMessage: notification.class.ChatMessage,
components: [
{
kind: 'action',
component: notification.component.PinMessageAction
}
]
},
notification.ids.ChatMessagePinExtension
)
builder.createDoc(
notification.class.DocUpdateMessageViewlet,
core.space.Model,
{
objectClass: notification.mixin.Collaborators,
action: 'update',
icon: notification.icon.Notifications,
component: notification.activity.TxCollaboratorsChange,
label: notification.string.ChangeCollaborators
},
notification.ids.NotificationCollaboratorsChanged
)
builder.mixin(notification.mixin.Collaborators, core.class.Class, notification.mixin.NotificationAttributePresenter, {
presenter: notification.component.NotificationCollaboratorsChanged
})
builder.createDoc(notification.class.ActivityMessagesFilter, core.space.Model, {
label: notification.string.Attributes,
filter: notification.filter.AttributesFilter
})
builder.createDoc(notification.class.ActivityMessagesFilter, core.space.Model, {
label: notification.string.Pinned,
filter: notification.filter.PinnedFilter
})
builder.createDoc(notification.class.ActivityMessagesFilter, core.space.Model, {
label: notification.string.Comments,
filter: notification.filter.ChatMessagesFilter
})
buildActions(builder)
}
function buildActions (builder: Builder): void {
createAction(
builder,
{
action: notification.actionImpl.DeleteChatMessage,
label: view.string.Delete,
icon: view.icon.Delete,
input: 'focus',
keyBinding: ['Backspace'],
category: notification.category.Notification,
target: notification.class.ChatMessage,
context: { mode: ['context', 'browser'], group: 'edit' }
},
notification.action.DeleteChatMessage
)
createAction(
builder,
{
action: notification.actionImpl.MarkAsReadInboxNotification,
label: notification.string.MarkAsRead,
icon: notification.icon.Notifications,
input: 'focus',
visibilityTester: notification.function.HasInboxNotifications,
category: notification.category.Notification,
target: notification.class.ActivityMessage,
context: { mode: 'context', application: notification.app.Notification, group: 'edit' }
},
notification.action.MarkAsReadInboxNotification
)
createAction(
builder,
{
action: notification.actionImpl.MarkAsUnreadInboxNotification,
label: notification.string.MarkAsUnread,
icon: notification.icon.Track,
input: 'focus',
visibilityTester: notification.function.HasntInboxNotifications,
category: notification.category.Notification,
target: notification.class.ActivityMessage,
context: { mode: 'context', application: notification.app.Notification, group: 'edit' }
},
notification.action.MarkAsUnreadInboxNotification
)
createAction(
builder,
{
action: notification.actionImpl.DeleteInboxNotification,
label: notification.string.Archive,
icon: view.icon.Archive,
input: 'focus',
keyBinding: ['Backspace'],
category: notification.category.Notification,
target: notification.class.ActivityMessage,
context: { mode: ['context', 'browser'], group: 'edit' }
},
notification.action.DeleteInboxNotification
)
}

View File

@ -14,7 +14,7 @@
// limitations under the License. // limitations under the License.
// //
import activity from '@hcengineering/activity' import activity, { type ActivityMessage } from '@hcengineering/activity'
import chunter from '@hcengineering/chunter' import chunter from '@hcengineering/chunter'
import { import {
type Account, type Account,
@ -39,11 +39,9 @@ import {
Mixin, Mixin,
Model, Model,
Prop, Prop,
TypeMarkup,
TypeRef, TypeRef,
TypeString, TypeString,
UX, UX,
Collection as PropCollection,
TypeBoolean, TypeBoolean,
TypeDate TypeDate
} from '@hcengineering/model' } from '@hcengineering/model'
@ -52,16 +50,6 @@ import preference, { TPreference } from '@hcengineering/model-preference'
import view, { createAction } from '@hcengineering/model-view' import view, { createAction } from '@hcengineering/model-view'
import workbench from '@hcengineering/model-workbench' import workbench from '@hcengineering/model-workbench'
import { import {
type ActivityMessage,
type ActivityMessageExtension,
type ActivityMessageExtensionKind,
type ChatMessage,
type ChatMessageViewlet,
type DocUpdateAction,
type DocAttributeUpdates,
type DocUpdateMessage,
type DocUpdateMessageViewlet,
type DocUpdateMessageViewletAttributesConfig,
type DocUpdates, type DocUpdates,
type DocUpdateTx, type DocUpdateTx,
inboxId, inboxId,
@ -69,7 +57,6 @@ import {
type DocNotifyContext, type DocNotifyContext,
type Notification, type Notification,
type NotificationGroup, type NotificationGroup,
type NotificationObjectPresenter,
type NotificationPreferencesGroup, type NotificationPreferencesGroup,
type NotificationPreview, type NotificationPreview,
type NotificationProvider, type NotificationProvider,
@ -77,19 +64,14 @@ import {
type NotificationStatus, type NotificationStatus,
type NotificationTemplate, type NotificationTemplate,
type NotificationType, type NotificationType,
type ActivityMessagesFilter, notificationId,
type ActivityDoc, type NotificationObjectPresenter
type NotificationObjectPreposition,
notificationId
} from '@hcengineering/notification' } from '@hcengineering/notification'
import { type Asset, type IntlString, type Resource } from '@hcengineering/platform' import { type Asset, type IntlString } from '@hcengineering/platform'
import setting from '@hcengineering/setting' import setting from '@hcengineering/setting'
import { type AnyComponent } from '@hcengineering/ui/src/types' import { type AnyComponent } from '@hcengineering/ui/src/types'
import attachment from '@hcengineering/model-attachment'
import { type NotificationAttributePresenter } from '@hcengineering/view'
import notification from './plugin' import notification from './plugin'
import { buildActivityMessages } from './activityMessages'
export { notificationId } from '@hcengineering/notification' export { notificationId } from '@hcengineering/notification'
export { notificationOperation } from './migration' export { notificationOperation } from './migration'
@ -174,21 +156,6 @@ export class TNotificationPreview extends TClass implements NotificationPreview
presenter!: AnyComponent presenter!: AnyComponent
} }
@Mixin(notification.mixin.ActivityDoc, core.class.Class)
export class TActivityDoc extends TClass implements ActivityDoc {
ignoreCollections?: string[]
}
@Mixin(notification.mixin.NotificationObjectPreposition, core.class.Class)
export class TNotificationObjectPreposition extends TClass implements NotificationObjectPreposition {
preposition!: IntlString
}
@Mixin(notification.mixin.NotificationAttributePresenter, core.class.Class)
export class TNotificationAttributePresenter extends TClass implements NotificationAttributePresenter {
presenter!: AnyComponent
}
@Model(notification.class.DocUpdates, core.class.Doc, DOMAIN_NOTIFICATION) @Model(notification.class.DocUpdates, core.class.Doc, DOMAIN_NOTIFICATION)
export class TDocUpdates extends TDoc implements DocUpdates { export class TDocUpdates extends TDoc implements DocUpdates {
@Index(IndexKind.Indexed) @Index(IndexKind.Indexed)
@ -232,58 +199,13 @@ export class TDocNotifyContext extends TDoc implements DocNotifyContext {
lastUpdateTimestamp?: Timestamp lastUpdateTimestamp?: Timestamp
} }
@Model(notification.class.ActivityMessage, core.class.AttachedDoc, DOMAIN_NOTIFICATION)
export class TActivityMessage extends TAttachedDoc implements ActivityMessage {
@Prop(TypeBoolean(), notification.string.Pinned)
@Index(IndexKind.Indexed)
isPinned?: boolean
@Prop(PropCollection(chunter.class.Reaction), chunter.string.Reactions)
reactions?: number
}
@Model(notification.class.DocUpdateMessage, notification.class.ActivityMessage, DOMAIN_NOTIFICATION)
export class TDocUpdateMessage extends TActivityMessage implements DocUpdateMessage {
@Prop(TypeRef(core.class.Doc), core.string.Object)
@Index(IndexKind.Indexed)
objectId!: Ref<Doc>
@Prop(TypeRef(core.class.Class), core.string.Class)
@Index(IndexKind.Indexed)
objectClass!: Ref<Class<Doc>>
@Prop(TypeRef(core.class.TxCUD), core.string.Object)
@Index(IndexKind.Indexed)
txId!: Ref<TxCUD<Doc>>
action!: DocUpdateAction
updateCollection?: string
attributeUpdates?: DocAttributeUpdates
}
@Model(notification.class.ChatMessage, notification.class.ActivityMessage, DOMAIN_NOTIFICATION)
export class TChatMessage extends TActivityMessage implements ChatMessage {
@Prop(TypeMarkup(), chunter.string.Message)
@Index(IndexKind.FullText)
message!: string
@Prop(PropCollection(attachment.class.Attachment), attachment.string.Attachments, {
shortLabel: attachment.string.Files
})
attachments?: number
@Prop(TypeBoolean(), core.string.Boolean)
@Index(IndexKind.Indexed)
isEdited?: boolean
}
@Model(notification.class.InboxNotification, core.class.Doc, DOMAIN_NOTIFICATION) @Model(notification.class.InboxNotification, core.class.Doc, DOMAIN_NOTIFICATION)
export class TInboxNotification extends TDoc implements InboxNotification { export class TInboxNotification extends TDoc implements InboxNotification {
@Prop(TypeRef(notification.class.ActivityMessage), core.string.AttachedTo) @Prop(TypeRef(activity.class.ActivityMessage), core.string.AttachedTo)
@Index(IndexKind.Indexed) @Index(IndexKind.Indexed)
attachedTo!: Ref<ActivityMessage> attachedTo!: Ref<ActivityMessage>
@Prop(TypeRef(notification.class.ActivityMessage), core.string.AttachedToClass) @Prop(TypeRef(activity.class.ActivityMessage), core.string.AttachedToClass)
@Index(IndexKind.Indexed) @Index(IndexKind.Indexed)
attachedToClass!: Ref<Class<ActivityMessage>> attachedToClass!: Ref<Class<ActivityMessage>>
@ -300,54 +222,6 @@ export class TInboxNotification extends TDoc implements InboxNotification {
isViewed!: boolean isViewed!: boolean
} }
@Model(notification.class.DocUpdateMessageViewlet, core.class.Doc, DOMAIN_MODEL)
export class TDocUpdateMessageViewlet extends TDoc implements DocUpdateMessageViewlet {
@Prop(TypeRef(core.class.Doc), core.string.Class)
@Index(IndexKind.Indexed)
objectClass!: Ref<Class<Doc>>
@Prop(TypeString(), core.string.String)
@Index(IndexKind.Indexed)
action!: DocUpdateAction
label?: IntlString
labelComponent?: AnyComponent
valueAttr?: string
icon?: Asset
component?: AnyComponent
config?: DocUpdateMessageViewletAttributesConfig
hideIfRemoved?: boolean
onlyWithParent?: boolean
}
@Model(notification.class.ChatMessageViewlet, core.class.Doc, DOMAIN_MODEL)
export class TChatMessageViewlet extends TDoc implements ChatMessageViewlet {
@Prop(TypeRef(core.class.Doc), core.string.Class)
@Index(IndexKind.Indexed)
objectClass!: Ref<Class<Doc>>
label?: IntlString
hidden?: boolean
onlyWithParent?: boolean
}
@Model(notification.class.ActivityMessageExtension, core.class.Doc, DOMAIN_MODEL)
export class TActivityMessageExtension extends TDoc implements ActivityMessageExtension {
@Prop(TypeRef(notification.class.ActivityMessage), core.string.Class)
@Index(IndexKind.Indexed)
ofMessage!: Ref<Class<ActivityMessage>>
components!: { kind: ActivityMessageExtensionKind, component: AnyComponent }[]
}
@Model(notification.class.ActivityMessagesFilter, core.class.Doc, DOMAIN_MODEL)
export class TActivityMessagesFilter extends TDoc implements ActivityMessagesFilter {
label!: IntlString
filter!: Resource<(message: ActivityMessage, _class?: Ref<Doc>) => boolean>
}
export function createModel (builder: Builder): void { export function createModel (builder: Builder): void {
builder.createModel( builder.createModel(
TNotification, TNotification,
@ -362,17 +236,7 @@ export function createModel (builder: Builder): void {
TNotificationObjectPresenter, TNotificationObjectPresenter,
TNotificationPreview, TNotificationPreview,
TDocNotifyContext, TDocNotifyContext,
TDocUpdateMessage, TInboxNotification
TChatMessage,
TActivityMessage,
TInboxNotification,
TDocUpdateMessageViewlet,
TActivityMessageExtension,
TChatMessageViewlet,
TActivityMessagesFilter,
TActivityDoc,
TNotificationObjectPreposition,
TNotificationAttributePresenter
) )
// Temporarily disabled, we should think about it // Temporarily disabled, we should think about it
@ -449,21 +313,21 @@ export function createModel (builder: Builder): void {
{ {
id: 'all', id: 'all',
component: notification.component.NewInbox, component: notification.component.NewInbox,
icon: notification.icon.Activity, icon: activity.icon.Activity,
label: notification.string.AllActivity, label: activity.string.AllActivity,
componentProps: { componentProps: {
type: 'all', type: 'all',
label: notification.string.AllActivity label: activity.string.AllActivity
} }
}, },
{ {
id: 'reactions', id: 'reactions',
component: notification.component.NewInbox, component: notification.component.NewInbox,
icon: notification.icon.Emoji, icon: activity.icon.Emoji,
label: notification.string.Reactions, label: activity.string.Reactions,
componentProps: { componentProps: {
_class: chunter.class.Reaction, _class: activity.class.Reaction,
label: notification.string.Reactions label: activity.string.Reactions
} }
} }
] ]
@ -597,7 +461,68 @@ export function createModel (builder: Builder): void {
notification.ids.TxDmCreation notification.ids.TxDmCreation
) )
buildActivityMessages(builder) builder.createDoc(
activity.class.DocUpdateMessageViewlet,
core.space.Model,
{
objectClass: notification.mixin.Collaborators,
action: 'update',
icon: notification.icon.Notifications,
component: notification.activity.TxCollaboratorsChange,
label: notification.string.ChangeCollaborators
},
notification.ids.NotificationCollaboratorsChanged
)
builder.mixin(notification.mixin.Collaborators, core.class.Class, view.mixin.ActivityAttributePresenter, {
presenter: notification.component.NotificationCollaboratorsChanged
})
createAction(
builder,
{
action: notification.actionImpl.MarkAsReadInboxNotification,
label: notification.string.MarkAsRead,
icon: notification.icon.Notifications,
input: 'focus',
visibilityTester: notification.function.HasMarkAsReadAction,
category: notification.category.Notification,
target: activity.class.ActivityMessage,
context: { mode: 'context', application: notification.app.Notification, group: 'edit' }
},
notification.action.MarkAsReadInboxNotification
)
createAction(
builder,
{
action: notification.actionImpl.MarkAsUnreadInboxNotification,
label: notification.string.MarkAsUnread,
icon: notification.icon.Track,
input: 'focus',
visibilityTester: notification.function.HasMarkAsUnreadAction,
category: notification.category.Notification,
target: activity.class.ActivityMessage,
context: { mode: 'context', application: notification.app.Notification, group: 'edit' }
},
notification.action.MarkAsUnreadInboxNotification
)
createAction(
builder,
{
action: notification.actionImpl.DeleteInboxNotification,
label: notification.string.Archive,
icon: view.icon.Archive,
input: 'focus',
keyBinding: ['Backspace'],
category: notification.category.Notification,
visibilityTester: notification.function.HasDeleteNotificationAction,
target: activity.class.ActivityMessage,
context: { mode: ['context', 'browser'], group: 'edit' }
},
notification.action.DeleteInboxNotification
)
} }
export function generateClassNotificationTypes ( export function generateClassNotificationTypes (

View File

@ -15,16 +15,12 @@
// //
import { type Doc, type Ref } from '@hcengineering/core' import { type Doc, type Ref } from '@hcengineering/core'
import notification, { import notification, { notificationId } from '@hcengineering/notification'
type ActivityMessageExtension,
type DocUpdateMessageViewlet,
notificationId
} from '@hcengineering/notification'
import { type IntlString, type Resource, mergeIds } from '@hcengineering/platform' import { type IntlString, type Resource, mergeIds } from '@hcengineering/platform'
import { type AnyComponent } from '@hcengineering/ui/src/types' import { type AnyComponent } from '@hcengineering/ui/src/types'
import { type Action, type ActionCategory, type ViewAction } from '@hcengineering/view' import { type Action, type ActionCategory, type ViewAction } from '@hcengineering/view'
import { type Application } from '@hcengineering/workbench' import { type Application } from '@hcengineering/workbench'
import { type TxViewlet } from '@hcengineering/activity' import { type DocUpdateMessageViewlet, type TxViewlet } from '@hcengineering/activity'
export default mergeIds(notificationId, notification, { export default mergeIds(notificationId, notification, {
string: { string: {
@ -35,11 +31,7 @@ export default mergeIds(notificationId, notification, {
Archive: '' as IntlString, Archive: '' as IntlString,
MarkAsUnread: '' as IntlString, MarkAsUnread: '' as IntlString,
MarkAsRead: '' as IntlString, MarkAsRead: '' as IntlString,
ChangeCollaborators: '' as IntlString, ChangeCollaborators: '' as IntlString
AllActivity: '' as IntlString,
Threads: '' as IntlString,
Mentions: '' as IntlString,
Reactions: '' as IntlString
}, },
app: { app: {
Notification: '' as Ref<Application>, Notification: '' as Ref<Application>,
@ -51,9 +43,7 @@ export default mergeIds(notificationId, notification, {
ids: { ids: {
TxCollaboratorsChange: '' as Ref<TxViewlet>, TxCollaboratorsChange: '' as Ref<TxViewlet>,
TxDmCreation: '' as Ref<TxViewlet>, TxDmCreation: '' as Ref<TxViewlet>,
NotificationCollaboratorsChanged: '' as Ref<DocUpdateMessageViewlet>, NotificationCollaboratorsChanged: '' as Ref<DocUpdateMessageViewlet>
DocUpdateMessagePinExtension: '' as Ref<ActivityMessageExtension>,
ChatMessagePinExtension: '' as Ref<ActivityMessageExtension>
}, },
component: { component: {
NotificationSettings: '' as AnyComponent, NotificationSettings: '' as AnyComponent,
@ -64,8 +54,9 @@ export default mergeIds(notificationId, notification, {
}, },
function: { function: {
HasntNotifications: '' as Resource<(doc?: Doc | Doc[]) => Promise<boolean>>, HasntNotifications: '' as Resource<(doc?: Doc | Doc[]) => Promise<boolean>>,
HasntInboxNotifications: '' as Resource<(doc?: Doc | Doc[]) => Promise<boolean>>, HasMarkAsUnreadAction: '' as Resource<(doc?: Doc | Doc[]) => Promise<boolean>>,
HasInboxNotifications: '' as Resource<(doc?: Doc | Doc[]) => Promise<boolean>> HasMarkAsReadAction: '' as Resource<(doc?: Doc | Doc[]) => Promise<boolean>>,
HasDeleteNotificationAction: '' as Resource<(doc?: Doc | Doc[]) => Promise<boolean>>
}, },
category: { category: {
Notification: '' as Ref<ActionCategory> Notification: '' as Ref<ActionCategory>
@ -82,7 +73,6 @@ export default mergeIds(notificationId, notification, {
MarkAsUnread: '' as ViewAction, MarkAsUnread: '' as ViewAction,
MarkAsUnreadInboxNotification: '' as ViewAction, MarkAsUnreadInboxNotification: '' as ViewAction,
MarkAsReadInboxNotification: '' as ViewAction, MarkAsReadInboxNotification: '' as ViewAction,
DeleteInboxNotification: '' as ViewAction, DeleteInboxNotification: '' as ViewAction
DeleteChatMessage: '' as ViewAction
} }
}) })

View File

@ -26,6 +26,8 @@
}, },
"dependencies": { "dependencies": {
"@anticrm/skillset": "^0.6.0", "@anticrm/skillset": "^0.6.0",
"@hcengineering/activity": "^0.6.0",
"@hcengineering/chunter": "^0.6.12",
"@hcengineering/contact": "^0.6.20", "@hcengineering/contact": "^0.6.20",
"@hcengineering/core": "^0.6.28", "@hcengineering/core": "^0.6.28",
"@hcengineering/model": "^0.6.7", "@hcengineering/model": "^0.6.7",

View File

@ -56,6 +56,7 @@ import {
} from '@hcengineering/recruit' } from '@hcengineering/recruit'
import setting from '@hcengineering/setting' import setting from '@hcengineering/setting'
import { type KeyBinding, type ViewOptionModel, type ViewOptionsModel } from '@hcengineering/view' import { type KeyBinding, type ViewOptionModel, type ViewOptionsModel } from '@hcengineering/view'
import activity from '@hcengineering/activity'
import recruit from './plugin' import recruit from './plugin'
import { createReviewModel, reviewTableConfig, reviewTableOptions } from './review' import { createReviewModel, reviewTableConfig, reviewTableOptions } from './review'
@ -85,7 +86,7 @@ export class TVacancy extends TProject implements Vacancy {
@Prop(TypeRef(contact.class.Organization), recruit.string.Company, { icon: contact.icon.Company }) @Prop(TypeRef(contact.class.Organization), recruit.string.Company, { icon: contact.icon.Company })
company?: Ref<Organization> company?: Ref<Organization>
@Prop(Collection(notification.class.ChatMessage), notification.string.Comments) @Prop(Collection(chunter.class.ChatMessage), chunter.string.Comments)
comments?: number comments?: number
@Prop(TypeString(), recruit.string.Vacancy) @Prop(TypeString(), recruit.string.Vacancy)
@ -197,18 +198,33 @@ export class TApplicantMatch extends TAttachedDoc implements ApplicantMatch {
export function createModel (builder: Builder): void { export function createModel (builder: Builder): void {
builder.createModel(TVacancy, TCandidates, TCandidate, TApplicant, TReview, TOpinion, TVacancyList, TApplicantMatch) builder.createModel(TVacancy, TCandidates, TCandidate, TApplicant, TReview, TOpinion, TVacancyList, TApplicantMatch)
builder.mixin(recruit.class.Vacancy, core.class.Class, notification.mixin.ActivityDoc, { builder.mixin(recruit.class.Vacancy, core.class.Class, activity.mixin.ActivityDoc, {
ignoreCollections: ['comments'] ignoreCollections: ['comments']
}) })
builder.mixin(recruit.class.Applicant, core.class.Class, notification.mixin.ActivityDoc, { builder.mixin(recruit.class.Applicant, core.class.Class, activity.mixin.ActivityDoc, {
ignoreCollections: ['comments'] ignoreCollections: ['comments']
}) })
builder.mixin(recruit.class.Review, core.class.Class, notification.mixin.ActivityDoc, {}) builder.mixin(recruit.class.Review, core.class.Class, activity.mixin.ActivityDoc, {})
builder.mixin(recruit.mixin.Candidate, core.class.Class, notification.mixin.ActivityDoc, { builder.mixin(recruit.mixin.Candidate, core.class.Class, activity.mixin.ActivityDoc, {
ignoreCollections: ['comments'] ignoreCollections: ['comments']
}) })
builder.createDoc(activity.class.ActivityExtension, core.space.Model, {
ofClass: recruit.class.Vacancy,
components: { input: chunter.component.ChatMessageInput }
})
builder.createDoc(activity.class.ActivityExtension, core.space.Model, {
ofClass: recruit.class.Applicant,
components: { input: chunter.component.ChatMessageInput }
})
builder.createDoc(activity.class.ActivityExtension, core.space.Model, {
ofClass: recruit.class.Review,
components: { input: chunter.component.ChatMessageInput }
})
builder.mixin(recruit.class.Vacancy, core.class.Class, workbench.mixin.SpaceView, { builder.mixin(recruit.class.Vacancy, core.class.Class, workbench.mixin.SpaceView, {
view: { view: {
class: recruit.class.Applicant, class: recruit.class.Applicant,
@ -1585,7 +1601,7 @@ export function createModel (builder: Builder): void {
) )
builder.createDoc( builder.createDoc(
notification.class.ChatMessageViewlet, chunter.class.ChatMessageViewlet,
core.space.Model, core.space.Model,
{ {
objectClass: recruit.class.Vacancy, objectClass: recruit.class.Vacancy,
@ -1595,7 +1611,7 @@ export function createModel (builder: Builder): void {
) )
builder.createDoc( builder.createDoc(
notification.class.ChatMessageViewlet, chunter.class.ChatMessageViewlet,
core.space.Model, core.space.Model,
{ {
objectClass: recruit.class.Applicant, objectClass: recruit.class.Applicant,
@ -1605,7 +1621,7 @@ export function createModel (builder: Builder): void {
) )
builder.createDoc( builder.createDoc(
notification.class.ChatMessageViewlet, chunter.class.ChatMessageViewlet,
core.space.Model, core.space.Model,
{ {
objectClass: recruit.class.Review, objectClass: recruit.class.Review,
@ -1625,7 +1641,7 @@ export function createModel (builder: Builder): void {
propagate: [recruit.class.Applicant], propagate: [recruit.class.Applicant],
propagateClasses: [ propagateClasses: [
tags.class.TagReference, tags.class.TagReference,
notification.class.ChatMessage, chunter.class.ChatMessage,
attachment.class.Attachment, attachment.class.Attachment,
contact.class.Channel contact.class.Channel
] ]
@ -1679,7 +1695,7 @@ export function createModel (builder: Builder): void {
}) })
builder.createDoc( builder.createDoc(
notification.class.DocUpdateMessageViewlet, activity.class.DocUpdateMessageViewlet,
core.space.Model, core.space.Model,
{ {
objectClass: recruit.class.Applicant, objectClass: recruit.class.Applicant,
@ -1690,7 +1706,7 @@ export function createModel (builder: Builder): void {
} }
} }
}, },
recruit.ids.NotificationApplicantUpdated recruit.ids.ApplicantUpdatedActivityViewlet
) )
createAction( createAction(

View File

@ -14,12 +14,7 @@
// //
import type { Client, Doc, Ref } from '@hcengineering/core' import type { Client, Doc, Ref } from '@hcengineering/core'
import { import { type NotificationGroup, type NotificationType } from '@hcengineering/notification'
type ChatMessageViewlet,
type DocUpdateMessageViewlet,
type NotificationGroup,
type NotificationType
} from '@hcengineering/notification'
import type { IntlString, Resource, Status } from '@hcengineering/platform' import type { IntlString, Resource, Status } from '@hcengineering/platform'
import { mergeIds } from '@hcengineering/platform' import { mergeIds } from '@hcengineering/platform'
import { recruitId } from '@hcengineering/recruit' import { recruitId } from '@hcengineering/recruit'
@ -27,6 +22,8 @@ import recruit from '@hcengineering/recruit-resources/src/plugin'
import { type ProjectType } from '@hcengineering/task' import { type ProjectType } from '@hcengineering/task'
import type { AnyComponent, Location } from '@hcengineering/ui/src/types' import type { AnyComponent, Location } from '@hcengineering/ui/src/types'
import type { Action, ActionCategory, ViewAction, ViewQueryAction, Viewlet } from '@hcengineering/view' import type { Action, ActionCategory, ViewAction, ViewQueryAction, Viewlet } from '@hcengineering/view'
import { type DocUpdateMessageViewlet } from '@hcengineering/activity'
import { type ChatMessageViewlet } from '@hcengineering/chunter'
export default mergeIds(recruitId, recruit, { export default mergeIds(recruitId, recruit, {
action: { action: {
@ -88,7 +85,7 @@ export default mergeIds(recruitId, recruit, {
AssigneeNotification: '' as Ref<NotificationType>, AssigneeNotification: '' as Ref<NotificationType>,
ApplicationCreateNotification: '' as Ref<NotificationType>, ApplicationCreateNotification: '' as Ref<NotificationType>,
ReviewCreateNotification: '' as Ref<NotificationType>, ReviewCreateNotification: '' as Ref<NotificationType>,
NotificationApplicantUpdated: '' as Ref<DocUpdateMessageViewlet>, ApplicantUpdatedActivityViewlet: '' as Ref<DocUpdateMessageViewlet>,
ApplicantChatMessageViewlet: '' as Ref<ChatMessageViewlet>, ApplicantChatMessageViewlet: '' as Ref<ChatMessageViewlet>,
VacancyChatMessageViewlet: '' as Ref<ChatMessageViewlet>, VacancyChatMessageViewlet: '' as Ref<ChatMessageViewlet>,
ReviewChatMessageViewlet: '' as Ref<ChatMessageViewlet> ReviewChatMessageViewlet: '' as Ref<ChatMessageViewlet>

View File

@ -7,8 +7,9 @@ import contact from '@hcengineering/model-contact'
import core, { TAttachedDoc } from '@hcengineering/model-core' import core, { TAttachedDoc } from '@hcengineering/model-core'
import task from '@hcengineering/model-task' import task from '@hcengineering/model-task'
import { type Applicant, type Candidate, type Opinion, type Review } from '@hcengineering/recruit' import { type Applicant, type Candidate, type Opinion, type Review } from '@hcengineering/recruit'
import chunter from '@hcengineering/model-chunter'
import recruit from './plugin' import recruit from './plugin'
import notification from '@hcengineering/notification'
@Model(recruit.class.Review, calendar.class.Event) @Model(recruit.class.Review, calendar.class.Event)
@UX(recruit.string.Review, recruit.icon.Review, 'RVE', 'number') @UX(recruit.string.Review, recruit.icon.Review, 'RVE', 'number')
@ -47,7 +48,7 @@ export class TOpinion extends TAttachedDoc implements Opinion {
@Prop(Collection(attachment.class.Attachment), attachment.string.Attachments, { shortLabel: attachment.string.Files }) @Prop(Collection(attachment.class.Attachment), attachment.string.Attachments, { shortLabel: attachment.string.Files })
attachments?: number attachments?: number
@Prop(Collection(notification.class.ChatMessage), notification.string.Comments) @Prop(Collection(chunter.class.ChatMessage), chunter.string.Comments)
comments?: number comments?: number
@Prop(TypeMarkup(), recruit.string.Description) @Prop(TypeMarkup(), recruit.string.Description)

View File

@ -30,7 +30,7 @@ import {
TypeString, TypeString,
UX UX
} from '@hcengineering/model' } from '@hcengineering/model'
import { TComment } from '@hcengineering/model-chunter' import chunter, { TComment } from '@hcengineering/model-chunter'
import core, { TAttachedDoc, TClass } from '@hcengineering/model-core' import core, { TAttachedDoc, TClass } from '@hcengineering/model-core'
import { generateClassNotificationTypes } from '@hcengineering/model-notification' import { generateClassNotificationTypes } from '@hcengineering/model-notification'
import view from '@hcengineering/model-view' import view from '@hcengineering/model-view'
@ -72,11 +72,11 @@ export class TRequest extends TAttachedDoc implements Request {
@ReadOnly() @ReadOnly()
rejected?: Ref<PersonAccount> rejected?: Ref<PersonAccount>
@Prop(Collection(notification.class.ChatMessage), notification.string.Comments) @Prop(Collection(chunter.class.ChatMessage), chunter.string.Comments)
comments?: number comments?: number
} }
@Mixin(request.mixin.RequestDecisionComment, notification.class.ChatMessage) @Mixin(request.mixin.RequestDecisionComment, chunter.class.ChatMessage)
export class TRequestDecisionComment extends TComment implements RequestDecisionComment {} export class TRequestDecisionComment extends TComment implements RequestDecisionComment {}
@Mixin(request.mixin.RequestPresenter, core.class.Class) @Mixin(request.mixin.RequestPresenter, core.class.Class)

View File

@ -0,0 +1,7 @@
module.exports = {
extends: ['./node_modules/@hcengineering/platform-rig/profiles/model/eslint.config.json'],
parserOptions: {
tsconfigRootDir: __dirname,
project: './tsconfig.json'
}
}

View File

@ -0,0 +1,4 @@
*
!/lib/**
!CHANGELOG.md
/lib/**/__tests__/

View File

@ -0,0 +1,5 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json",
"rigPackageName": "@hcengineering/platform-rig",
"rigProfile": "model"
}

View File

@ -0,0 +1,36 @@
{
"name": "@hcengineering/model-server-activity",
"version": "0.6.0",
"main": "lib/index.js",
"author": "Anticrm Platform Contributors",
"license": "EPL-2.0",
"scripts": {
"build": "tsc",
"build:watch": "tsc",
"lint:fix": "eslint --fix src",
"lint": "eslint src",
"format": "format src"
},
"template": "@hcengineering/model-package",
"devDependencies": {
"@hcengineering/platform-rig": "^0.6.0",
"@typescript-eslint/eslint-plugin": "^6.11.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-n": "^15.4.0",
"eslint": "^8.54.0",
"@typescript-eslint/parser": "^6.11.0",
"eslint-config-standard-with-typescript": "^40.0.0",
"prettier": "^3.1.0",
"prettier-plugin-svelte": "^3.1.0"
},
"dependencies": {
"@hcengineering/activity": "^0.6.0",
"@hcengineering/core": "^0.6.28",
"@hcengineering/model": "^0.6.7",
"@hcengineering/platform": "^0.6.9",
"@hcengineering/server-activity": "^0.6.0",
"@hcengineering/server-activity-resources": "^0.6.0",
"@hcengineering/server-core": "^0.6.1"
}
}

View File

@ -0,0 +1,38 @@
//
// Copyright © 2023 Hardcore Engineering Inc.
//
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. You may
// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
import { type Builder } from '@hcengineering/model'
import serverCore from '@hcengineering/server-core'
import core from '@hcengineering/core/lib/component'
import serverActivity from '@hcengineering/server-activity'
export { activityServerOperation } from './migration'
export { serverActivityId } from '@hcengineering/server-activity'
export function createModel (builder: Builder): void {
// NOTE: temporarily disabled
// builder.createDoc(serverCore.class.Trigger, core.space.Model, {
// trigger: serverNotification.trigger.OnReactionChanged,
// txMatch: {
// collection: 'reactions',
// objectClass: activity.class.ActivityMessage,
// _class: core.class.TxCollectionCUD
// }
// })
builder.createDoc(serverCore.class.Trigger, core.space.Model, {
trigger: serverActivity.trigger.ActivityMessagesHandler
})
}

View File

@ -14,25 +14,30 @@
// //
import core, { import core, {
SortingOrder,
TxFactory,
toFindResult,
toIdMap,
type AttachedDoc, type AttachedDoc,
type Class, type Class,
type Doc, type Doc,
type Ref, type Ref,
type TxCUD, type TxCUD,
type TxCollectionCUD, type TxCollectionCUD,
type TxCreateDoc, TxProcessor,
TxProcessor toIdMap,
SortingOrder,
TxFactory,
toFindResult,
type TxCreateDoc
} from '@hcengineering/core' } from '@hcengineering/core'
import { type MigrateOperation, type MigrationClient, type MigrationIterator, tryMigrate } from '@hcengineering/model' import activity, { type DocUpdateMessage } from '@hcengineering/activity'
import notification, { type DocUpdateMessage } from '@hcengineering/notification' import { tryMigrate, type MigrateOperation, type MigrationClient, type MigrationIterator } from '@hcengineering/model'
import { getAllObjectTransactions, type DocObjectCache, serverNotificationId } from '@hcengineering/server-notification' import {
import { generateDocUpdateMessages, type NotificationControl } from '@hcengineering/server-notification-resources' type ActivityControl,
type DocObjectCache,
getAllObjectTransactions,
serverActivityId
} from '@hcengineering/server-activity'
import { generateDocUpdateMessages } from '@hcengineering/server-activity-resources'
function getNotificationControl (client: MigrationClient): NotificationControl { function getActivityControl (client: MigrationClient): ActivityControl {
const txFactory = new TxFactory(core.account.System, false) const txFactory = new TxFactory(core.account.System, false)
return { return {
@ -46,7 +51,7 @@ function getNotificationControl (client: MigrationClient): NotificationControl {
async function generateDocUpdateMessageByTx ( async function generateDocUpdateMessageByTx (
tx: TxCUD<Doc>, tx: TxCUD<Doc>,
control: NotificationControl, control: ActivityControl,
client: MigrationClient, client: MigrationClient,
objectCache?: DocObjectCache objectCache?: DocObjectCache
): Promise<void> { ): Promise<void> {
@ -70,14 +75,14 @@ async function generateDocUpdateMessageByTx (
} }
async function createDocUpdateMessages (client: MigrationClient): Promise<void> { async function createDocUpdateMessages (client: MigrationClient): Promise<void> {
const activityDocs = await client.model.findAll(notification.mixin.ActivityDoc, { const activityDocs = await client.model.findAll(activity.mixin.ActivityDoc, {})
_id: { $nin: [notification.class.DocUpdateMessage, notification.class.ChatMessage] } const activityDocClasses = activityDocs
}) .map(({ _id }) => _id)
const activityDocClasses = activityDocs.map(({ _id }) => _id) .filter((_class) => !client.hierarchy.isDerived(_class, activity.class.ActivityMessage))
const notificationControl = getNotificationControl(client) const notificationControl = getActivityControl(client)
const txClient: Pick<NotificationControl, 'hierarchy' | 'findAll'> = { const txClient: Pick<ActivityControl, 'hierarchy' | 'findAll'> = {
hierarchy: notificationControl.hierarchy, hierarchy: notificationControl.hierarchy,
findAll: notificationControl.findAll findAll: notificationControl.findAll
} }
@ -197,11 +202,11 @@ async function createDocUpdateMessages (client: MigrationClient): Promise<void>
console.log('process-finished', processed) console.log('process-finished', processed)
} }
export const notificationServerOperation: MigrateOperation = { export const activityServerOperation: MigrateOperation = {
async migrate (client: MigrationClient): Promise<void> { async migrate (client: MigrationClient): Promise<void> {
await tryMigrate(client, serverNotificationId, [ await tryMigrate(client, serverActivityId, [
{ {
state: 'notifications', state: 'activity-messages',
func: createDocUpdateMessages func: createDocUpdateMessages
} }
]) ])

View File

@ -0,0 +1,9 @@
{
"extends": "./node_modules/@hcengineering/platform-rig/profiles/model/tsconfig.json",
"compilerOptions": {
"rootDir": "./src",
"outDir": "./lib",
"tsBuildInfoFile": ".build/build.tsbuildinfo"
}
}

View File

@ -33,7 +33,7 @@ export function createModel (builder: Builder): void {
}) })
builder.mixin<Class<Doc>, ObjectDDParticipant>( builder.mixin<Class<Doc>, ObjectDDParticipant>(
notification.class.ChatMessage, chunter.class.ChatMessage,
core.class.Class, core.class.Class,
serverCore.mixin.ObjectDDParticipant, serverCore.mixin.ObjectDDParticipant,
{ {

View File

@ -25,14 +25,15 @@
"prettier-plugin-svelte": "^3.1.0" "prettier-plugin-svelte": "^3.1.0"
}, },
"dependencies": { "dependencies": {
"@hcengineering/activity": "^0.6.0",
"@hcengineering/core": "^0.6.28", "@hcengineering/core": "^0.6.28",
"@hcengineering/model": "^0.6.7", "@hcengineering/model": "^0.6.7",
"@hcengineering/model-chunter": "^0.6.0",
"@hcengineering/model-core": "^0.6.0", "@hcengineering/model-core": "^0.6.0",
"@hcengineering/model-notification": "^0.6.0", "@hcengineering/model-notification": "^0.6.0",
"@hcengineering/notification": "^0.6.16", "@hcengineering/notification": "^0.6.16",
"@hcengineering/platform": "^0.6.9", "@hcengineering/platform": "^0.6.9",
"@hcengineering/server-core": "^0.6.1", "@hcengineering/server-core": "^0.6.1",
"@hcengineering/server-notification": "^0.6.1", "@hcengineering/server-notification": "^0.6.1"
"@hcengineering/server-notification-resources": "^0.6.0"
} }
} }

View File

@ -30,9 +30,9 @@ import serverNotification, {
type TypeMatch, type TypeMatch,
type NotificationContentProvider type NotificationContentProvider
} from '@hcengineering/server-notification' } from '@hcengineering/server-notification'
import chunter from '@hcengineering/model-chunter'
export { serverNotificationId } from '@hcengineering/server-notification' export { serverNotificationId } from '@hcengineering/server-notification'
export { notificationServerOperation } from './migration'
@Mixin(serverNotification.mixin.HTMLPresenter, core.class.Class) @Mixin(serverNotification.mixin.HTMLPresenter, core.class.Class)
export class THTMLPresenter extends TClass implements HTMLPresenter { export class THTMLPresenter extends TClass implements HTMLPresenter {
@ -63,16 +63,6 @@ export function createModel (builder: Builder): void {
trigger: serverNotification.trigger.OnBacklinkCreate trigger: serverNotification.trigger.OnBacklinkCreate
}) })
// NOTE: temporarily disabled
// builder.createDoc(serverCore.class.Trigger, core.space.Model, {
// trigger: serverNotification.trigger.OnReactionChanged,
// txMatch: {
// collection: 'reactions',
// objectClass: notification.class.ActivityMessage,
// _class: core.class.TxCollectionCUD
// }
// })
builder.createDoc(serverCore.class.Trigger, core.space.Model, { builder.createDoc(serverCore.class.Trigger, core.space.Model, {
trigger: serverNotification.trigger.NotificationMessagesHandler trigger: serverNotification.trigger.NotificationMessagesHandler
}) })
@ -80,7 +70,7 @@ export function createModel (builder: Builder): void {
builder.createDoc(serverCore.class.Trigger, core.space.Model, { builder.createDoc(serverCore.class.Trigger, core.space.Model, {
trigger: serverNotification.trigger.OnChatMessageSent, trigger: serverNotification.trigger.OnChatMessageSent,
txMatch: { txMatch: {
objectClass: notification.class.ChatMessage objectClass: chunter.class.ChatMessage
} }
}) })

View File

@ -27,9 +27,9 @@
"dependencies": { "dependencies": {
"@hcengineering/core": "^0.6.28", "@hcengineering/core": "^0.6.28",
"@hcengineering/model": "^0.6.7", "@hcengineering/model": "^0.6.7",
"@hcengineering/model-chunter": "^0.6.0",
"@hcengineering/model-core": "^0.6.0", "@hcengineering/model-core": "^0.6.0",
"@hcengineering/model-recruit": "^0.6.0", "@hcengineering/model-recruit": "^0.6.0",
"@hcengineering/notification": "^0.6.16",
"@hcengineering/openai": "^0.6.0", "@hcengineering/openai": "^0.6.0",
"@hcengineering/platform": "^0.6.9", "@hcengineering/platform": "^0.6.9",
"@hcengineering/server-core": "^0.6.1" "@hcengineering/server-core": "^0.6.1"

View File

@ -23,7 +23,7 @@ import openai, { type OpenAIConfiguration } from '@hcengineering/openai/src/plug
import serverCore from '@hcengineering/server-core' import serverCore from '@hcengineering/server-core'
import recruit from '@hcengineering/model-recruit' import recruit from '@hcengineering/model-recruit'
import notification from '@hcengineering/notification' import chunter from '@hcengineering/model-chunter'
export { openAIId } from '@hcengineering/openai/src/plugin' export { openAIId } from '@hcengineering/openai/src/plugin'
@ -49,7 +49,7 @@ export function createModel (builder: Builder): void {
builder.createDoc(serverCore.class.Trigger, core.space.Model, { builder.createDoc(serverCore.class.Trigger, core.space.Model, {
trigger: openai.trigger.AsyncOnGPTRequest, trigger: openai.trigger.AsyncOnGPTRequest,
txMatch: { txMatch: {
objectClass: { $in: [notification.class.ChatMessage, recruit.class.ApplicantMatch] }, objectClass: { $in: [chunter.class.ChatMessage, recruit.class.ApplicantMatch] },
_class: core.class.TxCreateDoc _class: core.class.TxCreateDoc
} }
}) })

View File

@ -329,7 +329,7 @@ export function createModel (builder: Builder): void {
) )
builder.createDoc( builder.createDoc(
notification.class.DocUpdateMessageViewlet, activity.class.DocUpdateMessageViewlet,
core.space.Model, core.space.Model,
{ {
objectClass: setting.class.Integration, objectClass: setting.class.Integration,
@ -338,7 +338,7 @@ export function createModel (builder: Builder): void {
action: 'update', action: 'update',
hideIfRemoved: true hideIfRemoved: true
}, },
setting.ids.UpdateIntegrationNotificationViewlet setting.ids.UpdateIntegrationActivityViewlet
) )
builder.mixin(core.class.TypeString, core.class.Class, view.mixin.ObjectEditor, { builder.mixin(core.class.TypeString, core.class.Class, view.mixin.ObjectEditor, {

View File

@ -13,7 +13,7 @@
// limitations under the License. // limitations under the License.
// //
import type { TxViewlet } from '@hcengineering/activity' import type { DocUpdateMessageViewlet, TxViewlet } from '@hcengineering/activity'
import { type Doc, type Ref } from '@hcengineering/core' import { type Doc, type Ref } from '@hcengineering/core'
import { type IntlString, mergeIds, type Resource } from '@hcengineering/platform' import { type IntlString, mergeIds, type Resource } from '@hcengineering/platform'
import { settingId } from '@hcengineering/setting' import { settingId } from '@hcengineering/setting'
@ -21,11 +21,7 @@ import setting from '@hcengineering/setting-resources/src/plugin'
import { type AnyComponent } from '@hcengineering/ui/src/types' import { type AnyComponent } from '@hcengineering/ui/src/types'
import { type Action, type ActionCategory, type ViewAction } from '@hcengineering/view' import { type Action, type ActionCategory, type ViewAction } from '@hcengineering/view'
import { type TemplateFieldFunc } from '@hcengineering/templates' import { type TemplateFieldFunc } from '@hcengineering/templates'
import { import { type NotificationGroup, type NotificationType } from '@hcengineering/notification'
type DocUpdateMessageViewlet,
type NotificationGroup,
type NotificationType
} from '@hcengineering/notification'
export default mergeIds(settingId, setting, { export default mergeIds(settingId, setting, {
activity: { activity: {
@ -37,7 +33,7 @@ export default mergeIds(settingId, setting, {
Configure: '' as Ref<Doc>, Configure: '' as Ref<Doc>,
SettingNotificationGroup: '' as Ref<NotificationGroup>, SettingNotificationGroup: '' as Ref<NotificationGroup>,
IntegrationDisabledNotification: '' as Ref<NotificationType>, IntegrationDisabledNotification: '' as Ref<NotificationType>,
UpdateIntegrationNotificationViewlet: '' as Ref<DocUpdateMessageViewlet> UpdateIntegrationActivityViewlet: '' as Ref<DocUpdateMessageViewlet>
}, },
component: { component: {
EnumSetting: '' as AnyComponent, EnumSetting: '' as AnyComponent,

View File

@ -29,13 +29,13 @@
"@hcengineering/core": "^0.6.28", "@hcengineering/core": "^0.6.28",
"@hcengineering/model": "^0.6.7", "@hcengineering/model": "^0.6.7",
"@hcengineering/model-attachment": "^0.6.0", "@hcengineering/model-attachment": "^0.6.0",
"@hcengineering/model-chunter": "^0.6.0",
"@hcengineering/model-contact": "^0.6.1", "@hcengineering/model-contact": "^0.6.1",
"@hcengineering/model-core": "^0.6.0", "@hcengineering/model-core": "^0.6.0",
"@hcengineering/model-presentation": "^0.6.0", "@hcengineering/model-presentation": "^0.6.0",
"@hcengineering/model-tags": "^0.6.0", "@hcengineering/model-tags": "^0.6.0",
"@hcengineering/model-view": "^0.6.0", "@hcengineering/model-view": "^0.6.0",
"@hcengineering/model-workbench": "^0.6.1", "@hcengineering/model-workbench": "^0.6.1",
"@hcengineering/notification": "^0.6.16",
"@hcengineering/platform": "^0.6.9", "@hcengineering/platform": "^0.6.9",
"@hcengineering/tags": "^0.6.12", "@hcengineering/tags": "^0.6.12",
"@hcengineering/task": "^0.6.13", "@hcengineering/task": "^0.6.13",

View File

@ -59,8 +59,9 @@ import {
} from '@hcengineering/task' } from '@hcengineering/task'
import type { AnyComponent } from '@hcengineering/ui/src/types' import type { AnyComponent } from '@hcengineering/ui/src/types'
import { type ViewAction } from '@hcengineering/view' import { type ViewAction } from '@hcengineering/view'
import chunter from '@hcengineering/model-chunter'
import task from './plugin' import task from './plugin'
import notification from '@hcengineering/notification'
export { taskId } from '@hcengineering/task' export { taskId } from '@hcengineering/task'
export { createProjectType, createSequence, taskOperation } from './migration' export { createProjectType, createSequence, taskOperation } from './migration'
@ -95,7 +96,7 @@ export class TTask extends TAttachedDoc implements Task {
@Prop(Collection(tags.class.TagReference, task.string.TaskLabels), task.string.TaskLabels) @Prop(Collection(tags.class.TagReference, task.string.TaskLabels), task.string.TaskLabels)
labels?: number labels?: number
@Prop(Collection(notification.class.ChatMessage), notification.string.Comments) @Prop(Collection(chunter.class.ChatMessage), chunter.string.Comments)
comments?: number comments?: number
@Prop(Collection(attachment.class.Attachment), attachment.string.Attachments, { shortLabel: attachment.string.Files }) @Prop(Collection(attachment.class.Attachment), attachment.string.Attachments, { shortLabel: attachment.string.Files })

View File

@ -21,7 +21,6 @@ import { taskId } from '@hcengineering/task'
import task from '@hcengineering/task-resources/src/plugin' import task from '@hcengineering/task-resources/src/plugin'
import type { AnyComponent } from '@hcengineering/ui/src/types' import type { AnyComponent } from '@hcengineering/ui/src/types'
import type { Action, ActionCategory, ViewAction, Viewlet } from '@hcengineering/view' import type { Action, ActionCategory, ViewAction, Viewlet } from '@hcengineering/view'
import {} from '@hcengineering/notification'
export default mergeIds(taskId, task, { export default mergeIds(taskId, task, {
action: { action: {

View File

@ -134,7 +134,7 @@ export function createModel (builder: Builder): void {
) )
builder.createDoc( builder.createDoc(
notification.class.DocUpdateMessageViewlet, activity.class.DocUpdateMessageViewlet,
core.space.Model, core.space.Model,
{ {
objectClass: telegram.class.Message, objectClass: telegram.class.Message,
@ -143,7 +143,7 @@ export function createModel (builder: Builder): void {
component: telegram.notification.NotificationMessageCreated, component: telegram.notification.NotificationMessageCreated,
label: telegram.string.SharedMessages label: telegram.string.SharedMessages
}, },
telegram.ids.NotificationMessageCreated telegram.ids.TelegramMessageCreatedActivityViewlet
) )
builder.createDoc( builder.createDoc(
@ -191,7 +191,7 @@ export function createModel (builder: Builder): void {
) )
builder.createDoc( builder.createDoc(
notification.class.DocUpdateMessageViewlet, activity.class.DocUpdateMessageViewlet,
core.space.Model, core.space.Model,
{ {
objectClass: telegram.class.SharedMessages, objectClass: telegram.class.SharedMessages,
@ -201,7 +201,7 @@ export function createModel (builder: Builder): void {
label: telegram.string.SharedMessages, label: telegram.string.SharedMessages,
hideIfRemoved: true hideIfRemoved: true
}, },
telegram.ids.NotificationMessageShared telegram.ids.TelegramMessageSharedActivityViewlet
) )
builder.createDoc( builder.createDoc(

View File

@ -19,9 +19,9 @@ import { type IntlString, type Resource, mergeIds } from '@hcengineering/platfor
import { telegramId } from '@hcengineering/telegram' import { telegramId } from '@hcengineering/telegram'
import telegram from '@hcengineering/telegram-resources/src/plugin' import telegram from '@hcengineering/telegram-resources/src/plugin'
import type { AnyComponent } from '@hcengineering/ui/src/types' import type { AnyComponent } from '@hcengineering/ui/src/types'
import type { TxViewlet } from '@hcengineering/activity' import type { DocUpdateMessageViewlet, TxViewlet } from '@hcengineering/activity'
import { type TemplateFieldFunc } from '@hcengineering/templates' import { type TemplateFieldFunc } from '@hcengineering/templates'
import { type DocUpdateMessageViewlet, type NotificationGroup } from '@hcengineering/notification' import { type NotificationGroup } from '@hcengineering/notification'
export default mergeIds(telegramId, telegram, { export default mergeIds(telegramId, telegram, {
string: { string: {
@ -43,8 +43,8 @@ export default mergeIds(telegramId, telegram, {
TxSharedCreate: '' as Ref<TxViewlet>, TxSharedCreate: '' as Ref<TxViewlet>,
NewMessageNotificationViewlet: '' as Ref<TxViewlet>, NewMessageNotificationViewlet: '' as Ref<TxViewlet>,
NotificationGroup: '' as Ref<NotificationGroup>, NotificationGroup: '' as Ref<NotificationGroup>,
NotificationMessageShared: '' as Ref<DocUpdateMessageViewlet>, TelegramMessageSharedActivityViewlet: '' as Ref<DocUpdateMessageViewlet>,
NotificationMessageCreated: '' as Ref<DocUpdateMessageViewlet> TelegramMessageCreatedActivityViewlet: '' as Ref<DocUpdateMessageViewlet>
}, },
function: { function: {
GetCurrentEmployeeTG: '' as Resource<TemplateFieldFunc>, GetCurrentEmployeeTG: '' as Resource<TemplateFieldFunc>,

View File

@ -26,6 +26,7 @@
}, },
"dependencies": { "dependencies": {
"@hcengineering/activity": "^0.6.0", "@hcengineering/activity": "^0.6.0",
"@hcengineering/chunter": "^0.6.12",
"@hcengineering/contact": "^0.6.20", "@hcengineering/contact": "^0.6.20",
"@hcengineering/core": "^0.6.28", "@hcengineering/core": "^0.6.28",
"@hcengineering/model": "^0.6.7", "@hcengineering/model": "^0.6.7",

View File

@ -22,11 +22,12 @@ import workbench from '@hcengineering/model-workbench'
import notification from '@hcengineering/notification' import notification from '@hcengineering/notification'
import setting from '@hcengineering/setting' import setting from '@hcengineering/setting'
import { trackerId } from '@hcengineering/tracker' import { trackerId } from '@hcengineering/tracker'
import tracker from './plugin'
import { generateClassNotificationTypes } from '@hcengineering/model-notification' import { generateClassNotificationTypes } from '@hcengineering/model-notification'
import presentation from '@hcengineering/model-presentation' import presentation from '@hcengineering/model-presentation'
import { PaletteColorIndexes } from '@hcengineering/ui/src/colors' import { PaletteColorIndexes } from '@hcengineering/ui/src/colors'
import chunter from '@hcengineering/chunter'
import tracker from './plugin'
import { createActions as defineActions } from './actions' import { createActions as defineActions } from './actions'
import { definePresenters } from './presenters' import { definePresenters } from './presenters'
import { import {
@ -445,20 +446,40 @@ export function createModel (builder: Builder): void {
TTypeRemainingTime TTypeRemainingTime
) )
builder.mixin(tracker.class.Project, core.class.Class, notification.mixin.ActivityDoc, {}) builder.mixin(tracker.class.Project, core.class.Class, activity.mixin.ActivityDoc, {})
builder.mixin(tracker.class.Issue, core.class.Class, notification.mixin.ActivityDoc, { builder.mixin(tracker.class.Issue, core.class.Class, activity.mixin.ActivityDoc, {
ignoreCollections: ['comments'] ignoreCollections: ['comments']
}) })
builder.mixin(tracker.class.Milestone, core.class.Class, notification.mixin.ActivityDoc, { builder.mixin(tracker.class.Milestone, core.class.Class, activity.mixin.ActivityDoc, {
ignoreCollections: ['comments'] ignoreCollections: ['comments']
}) })
builder.mixin(tracker.class.Component, core.class.Class, notification.mixin.ActivityDoc, { builder.mixin(tracker.class.Component, core.class.Class, activity.mixin.ActivityDoc, {
ignoreCollections: ['comments'] ignoreCollections: ['comments']
}) })
builder.mixin(tracker.class.IssueTemplate, core.class.Class, notification.mixin.ActivityDoc, { builder.mixin(tracker.class.IssueTemplate, core.class.Class, activity.mixin.ActivityDoc, {
ignoreCollections: ['comments'] ignoreCollections: ['comments']
}) })
builder.createDoc(activity.class.ActivityExtension, core.space.Model, {
ofClass: tracker.class.Issue,
components: { input: chunter.component.ChatMessageInput }
})
builder.createDoc(activity.class.ActivityExtension, core.space.Model, {
ofClass: tracker.class.Milestone,
components: { input: chunter.component.ChatMessageInput }
})
builder.createDoc(activity.class.ActivityExtension, core.space.Model, {
ofClass: tracker.class.Component,
components: { input: chunter.component.ChatMessageInput }
})
builder.createDoc(activity.class.ActivityExtension, core.space.Model, {
ofClass: tracker.class.IssueTemplate,
components: { input: chunter.component.ChatMessageInput }
})
defineViewlets(builder) defineViewlets(builder)
defineStatusCategories(builder) defineStatusCategories(builder)
@ -517,7 +538,7 @@ export function createModel (builder: Builder): void {
) )
builder.createDoc( builder.createDoc(
notification.class.DocUpdateMessageViewlet, activity.class.DocUpdateMessageViewlet,
core.space.Model, core.space.Model,
{ {
objectClass: tracker.class.Issue, objectClass: tracker.class.Issue,
@ -535,11 +556,11 @@ export function createModel (builder: Builder): void {
} }
} }
}, },
tracker.ids.NotificationIssueUpdated tracker.ids.IssueUpdatedActivityViewlet
) )
builder.createDoc( builder.createDoc(
notification.class.DocUpdateMessageViewlet, activity.class.DocUpdateMessageViewlet,
core.space.Model, core.space.Model,
{ {
objectClass: tracker.class.Issue, objectClass: tracker.class.Issue,
@ -547,11 +568,11 @@ export function createModel (builder: Builder): void {
icon: tracker.icon.Issue, icon: tracker.icon.Issue,
valueAttr: 'title' valueAttr: 'title'
}, },
tracker.ids.NotificationIssueCreated tracker.ids.IssueCreatedActivityViewlet
) )
builder.createDoc( builder.createDoc(
notification.class.DocUpdateMessageViewlet, activity.class.DocUpdateMessageViewlet,
core.space.Model, core.space.Model,
{ {
objectClass: tracker.class.Issue, objectClass: tracker.class.Issue,
@ -559,11 +580,11 @@ export function createModel (builder: Builder): void {
icon: tracker.icon.Issue, icon: tracker.icon.Issue,
valueAttr: 'title' valueAttr: 'title'
}, },
tracker.ids.NotificationIssueRemoved tracker.ids.IssueRemovedActivityViewlet
) )
builder.createDoc( builder.createDoc(
notification.class.DocUpdateMessageViewlet, activity.class.DocUpdateMessageViewlet,
core.space.Model, core.space.Model,
{ {
objectClass: tracker.class.Milestone, objectClass: tracker.class.Milestone,
@ -574,11 +595,11 @@ export function createModel (builder: Builder): void {
} }
} }
}, },
tracker.ids.NotificationMilestoneUpdated tracker.ids.MilestionUpdatedActivityViewlet
) )
builder.createDoc( builder.createDoc(
notification.class.DocUpdateMessageViewlet, activity.class.DocUpdateMessageViewlet,
core.space.Model, core.space.Model,
{ {
objectClass: tracker.class.IssueTemplate, objectClass: tracker.class.IssueTemplate,
@ -589,7 +610,7 @@ export function createModel (builder: Builder): void {
} }
} }
}, },
tracker.ids.NotificationIssueTemplateUpdated tracker.ids.IssueTemplateUpdatedActivityViewlet
) )
defineApplication(builder, { myIssuesId, allIssuesId, issuesId, componentsId, milestonesId, templatesId }) defineApplication(builder, { myIssuesId, allIssuesId, issuesId, componentsId, milestonesId, templatesId })
@ -625,41 +646,41 @@ export function createModel (builder: Builder): void {
}) })
builder.createDoc( builder.createDoc(
notification.class.ChatMessageViewlet, chunter.class.ChatMessageViewlet,
core.space.Model, core.space.Model,
{ {
objectClass: tracker.class.Issue, objectClass: tracker.class.Issue,
label: notification.string.LeftComment label: chunter.string.LeftComment
}, },
tracker.ids.IssueChatMessageViewlet tracker.ids.IssueChatMessageViewlet
) )
builder.createDoc( builder.createDoc(
notification.class.ChatMessageViewlet, chunter.class.ChatMessageViewlet,
core.space.Model, core.space.Model,
{ {
objectClass: tracker.class.IssueTemplate, objectClass: tracker.class.IssueTemplate,
label: notification.string.LeftComment label: chunter.string.LeftComment
}, },
tracker.ids.IssueTemplateChatMessageViewlet tracker.ids.IssueTemplateChatMessageViewlet
) )
builder.createDoc( builder.createDoc(
notification.class.ChatMessageViewlet, chunter.class.ChatMessageViewlet,
core.space.Model, core.space.Model,
{ {
objectClass: tracker.class.Component, objectClass: tracker.class.Component,
label: notification.string.LeftComment label: chunter.string.LeftComment
}, },
tracker.ids.ComponentChatMessageViewlet tracker.ids.ComponentChatMessageViewlet
) )
builder.createDoc( builder.createDoc(
notification.class.ChatMessageViewlet, chunter.class.ChatMessageViewlet,
core.space.Model, core.space.Model,
{ {
objectClass: tracker.class.Milestone, objectClass: tracker.class.Milestone,
label: notification.string.LeftComment label: chunter.string.LeftComment
}, },
tracker.ids.MilestoneChatMessageViewlet tracker.ids.MilestoneChatMessageViewlet
) )

View File

@ -22,13 +22,9 @@ import tracker from '@hcengineering/tracker-resources/src/plugin'
import type { AnyComponent } from '@hcengineering/ui/src/types' import type { AnyComponent } from '@hcengineering/ui/src/types'
import { type Action, type ViewAction, type Viewlet } from '@hcengineering/view' import { type Action, type ViewAction, type Viewlet } from '@hcengineering/view'
import { type Application } from '@hcengineering/workbench' import { type Application } from '@hcengineering/workbench'
import { type TxViewlet } from '@hcengineering/activity' import { type DocUpdateMessageViewlet, type TxViewlet } from '@hcengineering/activity'
import { import { type NotificationGroup, type NotificationType } from '@hcengineering/notification'
type ChatMessageViewlet, import { type ChatMessageViewlet } from '@hcengineering/chunter'
type DocUpdateMessageViewlet,
type NotificationGroup,
type NotificationType
} from '@hcengineering/notification'
export default mergeIds(trackerId, tracker, { export default mergeIds(trackerId, tracker, {
string: { string: {
@ -81,11 +77,11 @@ export default mergeIds(trackerId, tracker, {
TrackerNotificationGroup: '' as Ref<NotificationGroup>, TrackerNotificationGroup: '' as Ref<NotificationGroup>,
AssigneeNotification: '' as Ref<NotificationType>, AssigneeNotification: '' as Ref<NotificationType>,
BaseProjectType: '' as Ref<ProjectType>, BaseProjectType: '' as Ref<ProjectType>,
NotificationIssueUpdated: '' as Ref<DocUpdateMessageViewlet>, IssueUpdatedActivityViewlet: '' as Ref<DocUpdateMessageViewlet>,
NotificationIssueCreated: '' as Ref<DocUpdateMessageViewlet>, IssueCreatedActivityViewlet: '' as Ref<DocUpdateMessageViewlet>,
NotificationIssueRemoved: '' as Ref<DocUpdateMessageViewlet>, IssueRemovedActivityViewlet: '' as Ref<DocUpdateMessageViewlet>,
NotificationMilestoneUpdated: '' as Ref<DocUpdateMessageViewlet>, MilestionUpdatedActivityViewlet: '' as Ref<DocUpdateMessageViewlet>,
NotificationIssueTemplateUpdated: '' as Ref<DocUpdateMessageViewlet>, IssueTemplateUpdatedActivityViewlet: '' as Ref<DocUpdateMessageViewlet>,
IssueChatMessageViewlet: '' as Ref<ChatMessageViewlet>, IssueChatMessageViewlet: '' as Ref<ChatMessageViewlet>,
IssueTemplateChatMessageViewlet: '' as Ref<ChatMessageViewlet>, IssueTemplateChatMessageViewlet: '' as Ref<ChatMessageViewlet>,
ComponentChatMessageViewlet: '' as Ref<ChatMessageViewlet>, ComponentChatMessageViewlet: '' as Ref<ChatMessageViewlet>,

View File

@ -64,7 +64,7 @@ import {
type TimeSpendReport type TimeSpendReport
} from '@hcengineering/tracker' } from '@hcengineering/tracker'
import tracker from './plugin' import tracker from './plugin'
import notification from '@hcengineering/notification' import chunter from '@hcengineering/chunter'
export const DOMAIN_TRACKER = 'tracker' as Domain export const DOMAIN_TRACKER = 'tracker' as Domain
@ -288,7 +288,7 @@ export class TIssueTemplate extends TDoc implements IssueTemplate {
@Prop(ArrOf(TypeRef(tracker.class.IssueTemplate)), tracker.string.IssueTemplate) @Prop(ArrOf(TypeRef(tracker.class.IssueTemplate)), tracker.string.IssueTemplate)
children!: IssueTemplateChild[] children!: IssueTemplateChild[]
@Prop(Collection(notification.class.ChatMessage), tracker.string.Comments) @Prop(Collection(chunter.class.ChatMessage), tracker.string.Comments)
comments!: number comments!: number
@Prop(Collection(attachment.class.Attachment), tracker.string.Attachments) @Prop(Collection(attachment.class.Attachment), tracker.string.Attachments)
@ -336,7 +336,7 @@ export class TComponent extends TDoc implements Component {
@Prop(TypeRef(contact.mixin.Employee), tracker.string.ComponentLead) @Prop(TypeRef(contact.mixin.Employee), tracker.string.ComponentLead)
lead!: Ref<Employee> | null lead!: Ref<Employee> | null
@Prop(Collection(notification.class.ChatMessage), notification.string.Comments) @Prop(Collection(chunter.class.ChatMessage), chunter.string.Comments)
comments!: number comments!: number
@Prop(Collection(attachment.class.Attachment), attachment.string.Attachments, { shortLabel: attachment.string.Files }) @Prop(Collection(attachment.class.Attachment), attachment.string.Attachments, { shortLabel: attachment.string.Files })
@ -362,7 +362,7 @@ export class TMilestone extends TDoc implements Milestone {
@Index(IndexKind.Indexed) @Index(IndexKind.Indexed)
status!: MilestoneStatus status!: MilestoneStatus
@Prop(Collection(notification.class.ChatMessage), notification.string.Comments) @Prop(Collection(chunter.class.ChatMessage), chunter.string.Comments)
comments!: number comments!: number
@Prop(Collection(attachment.class.Attachment), attachment.string.Attachments, { shortLabel: attachment.string.Files }) @Prop(Collection(attachment.class.Attachment), attachment.string.Attachments, { shortLabel: attachment.string.Files })

View File

@ -85,7 +85,6 @@ import {
type Viewlet, type Viewlet,
type ViewletDescriptor, type ViewletDescriptor,
type ViewletPreference, type ViewletPreference,
type NotificationAttributePresenter,
type ObjectIdentifier type ObjectIdentifier
} from '@hcengineering/view' } from '@hcengineering/view'
@ -127,9 +126,6 @@ export function classPresenter (
builder.mixin(_class, core.class.Class, view.mixin.ActivityAttributePresenter, { builder.mixin(_class, core.class.Class, view.mixin.ActivityAttributePresenter, {
presenter: activity presenter: activity
}) })
builder.mixin(_class, core.class.Class, view.mixin.NotificationAttributePresenter, {
presenter: activity
})
} }
} }
@ -210,11 +206,6 @@ export class TActivityAttributePresenter extends TClass implements ActivityAttri
presenter!: AnyComponent presenter!: AnyComponent
} }
@Mixin(view.mixin.NotificationAttributePresenter, core.class.Class)
export class TNotificationAttributePresenter extends TClass implements NotificationAttributePresenter {
presenter!: AnyComponent
}
@Mixin(view.mixin.SpacePresenter, core.class.Class) @Mixin(view.mixin.SpacePresenter, core.class.Class)
export class TSpacePresenter extends TClass implements SpacePresenter { export class TSpacePresenter extends TClass implements SpacePresenter {
presenter!: AnyComponent presenter!: AnyComponent
@ -424,7 +415,6 @@ export function createModel (builder: Builder): void {
TAttributePresenter, TAttributePresenter,
TAttributeFilterPresenter, TAttributeFilterPresenter,
TActivityAttributePresenter, TActivityAttributePresenter,
TNotificationAttributePresenter,
TListItemPresenter, TListItemPresenter,
TCollectionEditor, TCollectionEditor,
TCollectionPresenter, TCollectionPresenter,
@ -479,8 +469,7 @@ export function createModel (builder: Builder): void {
core.class.TypeMarkup, core.class.TypeMarkup,
view.component.MarkupPresenter, view.component.MarkupPresenter,
view.component.MarkupEditor, view.component.MarkupEditor,
view.component.MarkupEditorPopup, view.component.MarkupEditorPopup
view.component.MarkupDiffPresenter
) )
builder.mixin(core.class.TypeMarkup, core.class.Class, view.mixin.InlineAttributEditor, { builder.mixin(core.class.TypeMarkup, core.class.Class, view.mixin.InlineAttributEditor, {

View File

@ -20,19 +20,19 @@
}, },
"devDependencies": { "devDependencies": {
"@hcengineering/platform-rig": "^0.6.0", "@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.2.2",
"jest": "^29.7.0",
"ts-jest": "^29.1.1",
"@types/jest": "^29.5.5", "@types/jest": "^29.5.5",
"prettier-plugin-svelte": "^3.1.0" "@typescript-eslint/eslint-plugin": "^6.11.0",
"@typescript-eslint/parser": "^6.11.0",
"eslint": "^8.54.0",
"eslint-config-standard-with-typescript": "^40.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-n": "^15.4.0",
"eslint-plugin-promise": "^6.1.1",
"jest": "^29.7.0",
"prettier": "^3.1.0",
"prettier-plugin-svelte": "^3.1.0",
"ts-jest": "^29.1.1",
"typescript": "^5.2.2"
}, },
"dependencies": { "dependencies": {
"intl-messageformat": "^9.7.1" "intl-messageformat": "^9.7.1"

View File

@ -4,4 +4,9 @@
<path d="M13.3,4.7c1,0,1.9-0.8,1.9-1.9c0-1-0.8-1.9-1.9-1.9s-1.9,0.8-1.9,1.9C11.4,3.8,12.3,4.7,13.3,4.7z M13.3,2.1 c0.4,0,0.7,0.3,0.7,0.7c0,0.4-0.3,0.7-0.7,0.7s-0.7-0.3-0.7-0.7C12.6,2.4,13,2.1,13.3,2.1z"/> <path d="M13.3,4.7c1,0,1.9-0.8,1.9-1.9c0-1-0.8-1.9-1.9-1.9s-1.9,0.8-1.9,1.9C11.4,3.8,12.3,4.7,13.3,4.7z M13.3,2.1 c0.4,0,0.7,0.3,0.7,0.7c0,0.4-0.3,0.7-0.7,0.7s-0.7-0.3-0.7-0.7C12.6,2.4,13,2.1,13.3,2.1z"/>
<path d="M14.1,5.6c-0.3,0-0.6,0.3-0.6,0.6v4.7c0,1.7-1,2.8-2.7,2.8H5.1c-1.6,0-2.7-1.1-2.7-2.8V5.5c0-1.7,1-2.8,2.7-2.8h4.8 c0.3,0,0.6-0.3,0.6-0.6s-0.3-0.6-0.6-0.6H5.1c-2.3,0-3.9,1.6-3.9,4v5.4c0,2.4,1.5,4,3.9,4h5.7c2.3,0,3.9-1.6,3.9-4V6.2 C14.7,5.9,14.4,5.6,14.1,5.6z"/> <path d="M14.1,5.6c-0.3,0-0.6,0.3-0.6,0.6v4.7c0,1.7-1,2.8-2.7,2.8H5.1c-1.6,0-2.7-1.1-2.7-2.8V5.5c0-1.7,1-2.8,2.7-2.8h4.8 c0.3,0,0.6-0.3,0.6-0.6s-0.3-0.6-0.6-0.6H5.1c-2.3,0-3.9,1.6-3.9,4v5.4c0,2.4,1.5,4,3.9,4h5.7c2.3,0,3.9-1.6,3.9-4V6.2 C14.7,5.9,14.4,5.6,14.1,5.6z"/>
</symbol> </symbol>
<symbol id="emoji" viewBox="0 0 24 24">
<path
d="M10 2C14.4183 2 18 5.58172 18 10C18 14.4183 14.4183 18 10 18C5.58172 18 2 14.4183 2 10C2 5.58172 5.58172 2 10 2ZM10 3C6.13401 3 3 6.13401 3 10C3 13.866 6.13401 17 10 17C13.866 17 17 13.866 17 10C17 6.13401 13.866 3 10 3ZM7.15467 12.4273C8.66416 13.9463 11.0877 14.0045 12.6671 12.5961L12.8453 12.4273C13.04 12.2314 13.3566 12.2304 13.5524 12.4251C13.7265 12.5981 13.7467 12.8674 13.6123 13.0627L13.5547 13.1322L13.5323 13.1545C11.5691 15.1054 8.39616 15.0953 6.44533 13.1322C6.25069 12.9363 6.25169 12.6197 6.44757 12.4251C6.64344 12.2304 6.96002 12.2314 7.15467 12.4273ZM12.5 7.5C13.0523 7.5 13.5 7.94772 13.5 8.5C13.5 9.05228 13.0523 9.5 12.5 9.5C11.9477 9.5 11.5 9.05228 11.5 8.5C11.5 7.94772 11.9477 7.5 12.5 7.5ZM7.5 7.5C8.05228 7.5 8.5 7.94772 8.5 8.5C8.5 9.05228 8.05228 9.5 7.5 9.5C6.94772 9.5 6.5 9.05228 6.5 8.5C6.5 7.94772 6.94772 7.5 7.5 7.5Z"
/>
</symbol>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 891 B

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -3,15 +3,31 @@
"Activity": "Activity", "Activity": "Activity",
"Added": "added", "Added": "added",
"All": "All", "All": "All",
"AllActivity": "All activity",
"Attributes": "Attributes",
"Changed": "changed", "Changed": "changed",
"CollectionUpdated": "Update {collection}", "CollectionUpdated": "Update {collection}",
"Created": "Created",
"DocAdded": "added {_class}", "DocAdded": "added {_class}",
"DocCreated": "created {_class}", "DocCreated": "created {_class}",
"DocDeleted": "deleted {_class}", "DocDeleted": "deleted {_class}",
"Edited": "edited", "Edit": "Edit",
"Edited": "Edited",
"Emoji": "Emoji",
"For": "For",
"From": "from", "From": "from",
"In": "In",
"New": "New",
"NewestFirst": "Newest first",
"Pinned": "Pinned",
"Reacted": "Reacted",
"Reactions": "Reactions",
"Removed": "removed", "Removed": "removed",
"Set": "set",
"To": "to", "To": "to",
"Unset": "unset" "Unset": "Unset",
"Update": "Update",
"Updated": "Updated",
"UpdatedCollection": "Updated"
} }
} }

View File

@ -1,17 +1,33 @@
{ {
"string": { "string": {
"Activity": "Активность", "Activity": "Активность",
"Added": "добавила(а)", "Added": "Добавила(а)",
"All": "Все", "All": "Все",
"Changed": "изменил(а)", "AllActivity": "Вся активнось",
"Attributes": "Атрибуты",
"Changed": "Изменил(а)",
"CollectionUpdated": "Обновлена {collection}", "CollectionUpdated": "Обновлена {collection}",
"Created": "Создал(a)",
"DocAdded": "добавил(а) {_class}", "DocAdded": "добавил(а) {_class}",
"DocCreated": "создал(а) {_class}", "DocCreated": "создал(а) {_class}",
"DocDeleted": "удалил(а) {_class}", "DocDeleted": "удалил(а) {_class}",
"Edited": "отредактировал(а)", "Edit": "Редактировать",
"Edited": "Изменено",
"Emoji": "Эмодзи",
"For": "Для",
"From": "из", "From": "из",
"Removed": "удалил(а)", "In": "В",
"New": "Новые",
"NewestFirst": "Сначала новые",
"Pinned": "Закрепленные",
"Reacted": "Отреагировал(а)",
"Reactions": "Реакции",
"Removed": "Удалил(а)",
"Set": "установлен",
"To": "на", "To": "на",
"Unset": "сбросил" "Unset": "Cбросил",
"Update": "Обновить",
"Updated": "Обновил(а)",
"UpdatedCollection": "Обновленные"
} }
} }

View File

@ -18,5 +18,6 @@ import { loadMetadata } from '@hcengineering/platform'
const icons = require('../assets/icons.svg') as string // eslint-disable-line const icons = require('../assets/icons.svg') as string // eslint-disable-line
loadMetadata(activity.icon, { loadMetadata(activity.icon, {
Activity: `${icons}#activity` Activity: `${icons}#activity`,
Emoji: `${icons}#emoji`
}) })

View File

@ -36,8 +36,9 @@
}, },
"dependencies": { "dependencies": {
"@hcengineering/activity": "^0.6.0", "@hcengineering/activity": "^0.6.0",
"@hcengineering/contact": "^0.6.20",
"@hcengineering/contact-resources": "^0.6.0",
"@hcengineering/core": "^0.6.28", "@hcengineering/core": "^0.6.28",
"@hcengineering/notification": "^0.6.16",
"@hcengineering/platform": "^0.6.9", "@hcengineering/platform": "^0.6.9",
"@hcengineering/presentation": "^0.6.2", "@hcengineering/presentation": "^0.6.2",
"@hcengineering/ui": "^0.6.11", "@hcengineering/ui": "^0.6.11",

View File

@ -28,19 +28,8 @@ import core, {
type TxCUD, type TxCUD,
type TxMixin, type TxMixin,
TxProcessor, TxProcessor,
type TxUpdateDoc, type TxUpdateDoc
type WithLookup
} from '@hcengineering/core' } from '@hcengineering/core'
import notification, {
type ActivityMessage,
type ChatMessage,
type DisplayActivityMessage,
type DisplayDocUpdateMessage,
type DocAttributeUpdates,
type DocNotifyContext,
type DocUpdateMessage,
type InboxNotification
} from '@hcengineering/notification'
import view, { type AttributeModel } from '@hcengineering/view' import view, { type AttributeModel } from '@hcengineering/view'
import { getClient, getFiltredKeys } from '@hcengineering/presentation' import { getClient, getFiltredKeys } from '@hcengineering/presentation'
import { getAttributePresenter, getDocLinkTitle } from '@hcengineering/view-resources' import { getAttributePresenter, getDocLinkTitle } from '@hcengineering/view-resources'
@ -49,6 +38,13 @@ import { type IntlString } from '@hcengineering/platform'
import { type AnyComponent } from '@hcengineering/ui' import { type AnyComponent } from '@hcengineering/ui'
import { get } from 'svelte/store' import { get } from 'svelte/store'
import { personAccountByIdStore } from '@hcengineering/contact-resources' import { personAccountByIdStore } from '@hcengineering/contact-resources'
import activity, {
type ActivityMessage,
type DisplayActivityMessage,
type DisplayDocUpdateMessage,
type DocAttributeUpdates,
type DocUpdateMessage
} from '@hcengineering/activity'
// Use 5 minutes to combine similar messages // Use 5 minutes to combine similar messages
const combineThresholdMs = 5 * 60 * 1000 const combineThresholdMs = 5 * 60 * 1000
@ -131,7 +127,7 @@ export function getCollectionAttribute (
return undefined return undefined
} }
export async function getNotificationObject ( export async function getActivityObject (
client: Client, client: Client,
objectId: Ref<Doc>, objectId: Ref<Doc>,
objectClass: Ref<Class<Doc>> objectClass: Ref<Class<Doc>>
@ -176,65 +172,20 @@ export async function getAttributeModel (
attrObjectClass, attrObjectClass,
attrKey, attrKey,
{ key: attrKey }, { key: attrKey },
view.mixin.NotificationAttributePresenter view.mixin.ActivityAttributePresenter
) )
} catch (e) { } catch (e) {
// ignore error // ignore error
} }
} }
function activityMessagesComparator (message1: ActivityMessage, message2: ActivityMessage): number { export function activityMessagesComparator (message1: ActivityMessage, message2: ActivityMessage): number {
const time1 = getMessageTime(message1) const time1 = getMessageTime(message1)
const time2 = getMessageTime(message2) const time2 = getMessageTime(message2)
return time1 - time2 return time1 - time2
} }
export function getDisplayActivityMessagesByNotifications (
inboxNotifications: Array<WithLookup<InboxNotification>>,
docNotifyContextById: Map<Ref<DocNotifyContext>, DocNotifyContext>,
filter: 'all' | 'read' | 'unread',
objectClass?: Ref<Class<Doc>>
): DisplayActivityMessage[] {
const messages = inboxNotifications
.filter(({ docNotifyContext, isViewed }) => {
const update = docNotifyContextById.get(docNotifyContext)
const isVisible = update !== undefined && !update.hidden
if (!isVisible) {
return false
}
switch (filter) {
case 'unread':
return !isViewed
case 'all':
return true
case 'read':
return !!isViewed
}
return false
})
.map(({ $lookup }) => $lookup?.attachedTo)
.filter((message): message is ActivityMessage => {
if (message === undefined) {
return false
}
if (objectClass === undefined) {
return true
}
if (message._class === notification.class.ChatMessage) {
return false
}
return (message as DocUpdateMessage).objectClass === objectClass
})
.sort(activityMessagesComparator)
return combineActivityMessages(messages, SortingOrder.Descending)
}
function getMessageTime (message: ActivityMessage): number { function getMessageTime (message: ActivityMessage): number {
return message.createdOn ?? message.modifiedOn return message.createdOn ?? message.modifiedOn
} }
@ -265,15 +216,13 @@ export function combineActivityMessages (
messages: ActivityMessage[], messages: ActivityMessage[],
sortingOrder: SortingOrder = SortingOrder.Ascending sortingOrder: SortingOrder = SortingOrder.Ascending
): DisplayActivityMessage[] { ): DisplayActivityMessage[] {
const chatMessages = messages.filter( const uncombinedMessages = messages.filter((message) => message._class !== activity.class.DocUpdateMessage)
(message): message is ChatMessage => message._class === notification.class.ChatMessage
)
const docUpdateMessages = combineByCreateThreshold( const docUpdateMessages = combineByCreateThreshold(
messages.filter((message): message is DocUpdateMessage => message._class === notification.class.DocUpdateMessage) messages.filter((message): message is DocUpdateMessage => message._class === activity.class.DocUpdateMessage)
) )
const result: DisplayActivityMessage[] = [...chatMessages] const result: DisplayActivityMessage[] = [...uncombinedMessages]
const groupedByType: Map<string, DocUpdateMessage[]> = groupByArray(docUpdateMessages, getDocUpdateMessageKey) const groupedByType: Map<string, DocUpdateMessage[]> = groupByArray(docUpdateMessages, getDocUpdateMessageKey)
@ -473,17 +422,13 @@ function getAttributeUpdatesKey (message: DocUpdateMessage): string {
} }
export function attributesFilter (message: ActivityMessage, _class?: Ref<Doc>): boolean { export function attributesFilter (message: ActivityMessage, _class?: Ref<Doc>): boolean {
if (message._class === notification.class.DocUpdateMessage) { if (message._class === activity.class.DocUpdateMessage) {
return (message as DocUpdateMessage).objectClass === _class return (message as DocUpdateMessage).objectClass === _class
} }
return false return false
} }
export function chatMessagesFilter (message: ActivityMessage): boolean {
return message._class === notification.class.ChatMessage
}
export function pinnedFilter (message: ActivityMessage, _class?: Ref<Doc>): boolean { export function pinnedFilter (message: ActivityMessage, _class?: Ref<Doc>): boolean {
return message.isPinned === true return message.isPinned === true
} }
@ -506,9 +451,9 @@ export async function getLinkData (
let linkObject: Doc | undefined let linkObject: Doc | undefined
if (hierarchy.isDerived(message.attachedToClass, notification.class.ActivityMessage)) { if (hierarchy.isDerived(message.attachedToClass, activity.class.ActivityMessage)) {
linkObject = parentObject linkObject = parentObject
} else if (message._class === notification.class.DocUpdateMessage) { } else if (message._class === activity.class.DocUpdateMessage) {
linkObject = (message as DocUpdateMessage).action === 'update' ? object : parentObject ?? object linkObject = (message as DocUpdateMessage).action === 'update' ? object : parentObject ?? object
} else { } else {
linkObject = parentObject ?? object linkObject = parentObject ?? object
@ -524,13 +469,12 @@ export async function getLinkData (
const title = await getDocLinkTitle(client, linkObject._id, linkObject._class, linkObject) const title = await getDocLinkTitle(client, linkObject._id, linkObject._class, linkObject)
const preposition = hierarchy.classHierarchyMixin(linkObject._class, notification.mixin.NotificationObjectPreposition) const preposition = hierarchy.classHierarchyMixin(linkObject._class, activity.mixin.ActivityDoc)?.preposition
?.preposition
const panelComponent = hierarchy.classHierarchyMixin(linkObject._class, view.mixin.ObjectPanel) const panelComponent = hierarchy.classHierarchyMixin(linkObject._class, view.mixin.ObjectPanel)
return { return {
title, title,
preposition: preposition ?? notification.string.In, preposition: preposition ?? activity.string.In,
panelComponent: panelComponent?.component ?? view.component.EditDoc, panelComponent: panelComponent?.component ?? view.component.EditDoc,
object: linkObject object: linkObject
} }

View File

@ -13,14 +13,14 @@
// limitations under the License. // limitations under the License.
--> -->
<script lang="ts"> <script lang="ts">
import activity from '@hcengineering/activity' import activity, { ActivityExtension, ActivityMessage, DisplayActivityMessage } from '@hcengineering/activity'
import { Doc, Ref, SortingOrder } from '@hcengineering/core' import { Doc, Ref, SortingOrder } from '@hcengineering/core'
import notification, { DisplayActivityMessage, ActivityMessage } from '@hcengineering/notification' import { createQuery, getClient } from '@hcengineering/presentation'
import { getResource } from '@hcengineering/platform'
import { createQuery } from '@hcengineering/presentation'
import { Component, Grid, Label, Lazy, Spinner } from '@hcengineering/ui' import { Component, Grid, Label, Lazy, Spinner } from '@hcengineering/ui'
import ActivityExtensionComponent from './ActivityExtension.svelte'
import ActivityFilter from './ActivityFilter.svelte' import ActivityFilter from './ActivityFilter.svelte'
import { combineActivityMessages } from '../activityMessagesUtils'
export let object: Doc export let object: Doc
export let showCommenInput: boolean = true export let showCommenInput: boolean = true
@ -28,23 +28,29 @@
export let focusIndex: number = -1 export let focusIndex: number = -1
export let boundary: HTMLElement | undefined = undefined export let boundary: HTMLElement | undefined = undefined
const client = getClient()
const activityMessagesQuery = createQuery() const activityMessagesQuery = createQuery()
let extensions: ActivityExtension[] = []
let filteredMessages: DisplayActivityMessage[] = [] let filteredMessages: DisplayActivityMessage[] = []
let activityMessages: ActivityMessage[] = [] let activityMessages: ActivityMessage[] = []
let isLoading = false let isLoading = false
let isNewestFirst = JSON.parse(localStorage.getItem('activity-newest-first') ?? 'false') let isNewestFirst = JSON.parse(localStorage.getItem('activity-newest-first') ?? 'false')
$: client.findAll(activity.class.ActivityExtension, { ofClass: object._class }).then((res) => {
extensions = res
})
async function updateActivityMessages (objectId: Ref<Doc>, order: SortingOrder): Promise<void> { async function updateActivityMessages (objectId: Ref<Doc>, order: SortingOrder): Promise<void> {
isLoading = true isLoading = true
const combineMessagesFn = await getResource(notification.function.CombineActivityMessages)
const res = activityMessagesQuery.query( const res = activityMessagesQuery.query(
notification.class.ActivityMessage, activity.class.ActivityMessage,
{ attachedTo: objectId }, { attachedTo: objectId },
(result: ActivityMessage[]) => { (result: ActivityMessage[]) => {
activityMessages = combineMessagesFn(result, order) activityMessages = combineActivityMessages(result, order)
isLoading = false isLoading = false
}, },
{ {
@ -85,7 +91,7 @@
{#each filteredMessages as message} {#each filteredMessages as message}
<Lazy> <Lazy>
<Component <Component
is={notification.component.ActivityMessagePresenter} is={activity.component.ActivityMessagePresenter}
props={{ props={{
value: message, value: message,
boundary boundary
@ -98,7 +104,7 @@
</div> </div>
{#if showCommenInput} {#if showCommenInput}
<div class="ref-input"> <div class="ref-input">
<Component is={notification.component.ChatMessageInput} props={{ object, boundary, focusIndex }} /> <ActivityExtensionComponent kind="input" {extensions} props={{ object, boundary, focusIndex }} />
</div> </div>
{/if} {/if}

View File

@ -13,18 +13,16 @@
// limitations under the License. // limitations under the License.
--> -->
<script lang="ts"> <script lang="ts">
import { getClient } from '@hcengineering/presentation' import { ActivityExtension, ActivityExtensionKind } from '@hcengineering/activity'
import { Component } from '@hcengineering/ui'
import ReactionsAction from '../ReactionsAction.svelte' export let kind: ActivityExtensionKind
import notification, { ActivityMessage } from '@hcengineering/notification' export let extensions: ActivityExtension[] = []
export let props: Record<string, any> = {}
export let object: ActivityMessage | undefined = undefined $: extension = extensions.find((e) => e.components[kind] !== undefined)
const client = getClient()
$: isVisible =
object !== undefined && !client.getHierarchy().isDerived(object.attachedToClass, notification.class.ActivityMessage)
</script> </script>
{#if isVisible} {#if extension}
<ReactionsAction {object} /> <Component is={extension.components[kind]} {props} on:close on:open />
{/if} {/if}

View File

@ -18,12 +18,13 @@
import { getResource } from '@hcengineering/platform' import { getResource } from '@hcengineering/platform'
import { getClient } from '@hcengineering/presentation' import { getClient } from '@hcengineering/presentation'
import { ActionIcon, eventToHTMLElement, Icon, Label, showPopup } from '@hcengineering/ui' import { ActionIcon, eventToHTMLElement, Icon, Label, showPopup } from '@hcengineering/ui'
import notification, { ActivityMessage, ActivityMessagesFilter } from '@hcengineering/notification' import { ActivityMessage, ActivityMessagesFilter } from '@hcengineering/activity'
import activity from '../plugin' import activity from '../plugin'
import FilterPopup from './FilterPopup.svelte' import FilterPopup from './FilterPopup.svelte'
import IconClose from './icons/Close.svelte' import IconClose from './icons/Close.svelte'
import IconFilter from './icons/Filter.svelte' import IconFilter from './icons/Filter.svelte'
import { sortActivityMessages } from '../activityMessagesUtils'
export let messages: ActivityMessage[] export let messages: ActivityMessage[]
export let object: Doc export let object: Doc
@ -40,7 +41,7 @@
$: localStorage.setItem('activity-filter', JSON.stringify(selectedFiltersRefs)) $: localStorage.setItem('activity-filter', JSON.stringify(selectedFiltersRefs))
$: localStorage.setItem('activity-newest-first', JSON.stringify(isNewestFirst)) $: localStorage.setItem('activity-newest-first', JSON.stringify(isNewestFirst))
client.findAll(notification.class.ActivityMessagesFilter, {}).then((res) => { client.findAll(activity.class.ActivityMessagesFilter, {}).then((res) => {
filters = res filters = res
if (saved !== null && saved !== undefined) { if (saved !== null && saved !== undefined) {
@ -83,9 +84,7 @@
selected: Ref<Doc>[] | 'All', selected: Ref<Doc>[] | 'All',
sortOrder: SortingOrder sortOrder: SortingOrder
): Promise<void> { ): Promise<void> {
const sortMessagesFn = await getResource(notification.function.SortActivityMessages) const sortedMessages = sortActivityMessages(messages, sortOrder).sort(({ isPinned }) =>
const sortedMessages = sortMessagesFn(messages, sortOrder).sort(({ isPinned }) =>
isPinned && sortOrder === SortingOrder.Ascending ? -1 : 1 isPinned && sortOrder === SortingOrder.Ascending ? -1 : 1
) )

View File

@ -17,7 +17,7 @@
import { IntlString } from '@hcengineering/platform' import { IntlString } from '@hcengineering/platform'
import { Label, resizeObserver, CheckBox, MiniToggle } from '@hcengineering/ui' import { Label, resizeObserver, CheckBox, MiniToggle } from '@hcengineering/ui'
import { Doc, Ref } from '@hcengineering/core' import { Doc, Ref } from '@hcengineering/core'
import notification, { ActivityMessagesFilter } from '@hcengineering/notification' import { ActivityMessagesFilter } from '@hcengineering/activity'
import activity from '../plugin' import activity from '../plugin'
@ -132,7 +132,7 @@
<div class="ml-3 mt-2 mb-2 mr-3"> <div class="ml-3 mt-2 mb-2 mr-3">
<MiniToggle <MiniToggle
bind:on={activityOrderNewestFirst} bind:on={activityOrderNewestFirst}
label={notification.string.NewestFirst} label={activity.string.NewestFirst}
on:change={() => { on:change={() => {
dispatch('update', { action: 'toggle', value: activityOrderNewestFirst }) dispatch('update', { action: 'toggle', value: activityOrderNewestFirst })
}} }}

View File

@ -13,7 +13,7 @@
// limitations under the License. // limitations under the License.
--> -->
<script lang="ts"> <script lang="ts">
import { ActivityMessageExtension, ActivityMessageExtensionKind } from '@hcengineering/notification' import { ActivityMessageExtension, ActivityMessageExtensionKind } from '@hcengineering/activity'
import { Component } from '@hcengineering/ui' import { Component } from '@hcengineering/ui'
export let kind: ActivityMessageExtensionKind export let kind: ActivityMessageExtensionKind

View File

@ -13,7 +13,7 @@
// limitations under the License. // limitations under the License.
--> -->
<script lang="ts"> <script lang="ts">
import { DisplayActivityMessage } from '@hcengineering/notification' import { DisplayActivityMessage } from '@hcengineering/activity'
import view from '@hcengineering/view' import view from '@hcengineering/view'
import { getClient } from '@hcengineering/presentation' import { getClient } from '@hcengineering/presentation'
import { Component } from '@hcengineering/ui' import { Component } from '@hcengineering/ui'
@ -26,7 +26,6 @@
export let shouldScroll: boolean = false export let shouldScroll: boolean = false
export let embedded: boolean = false export let embedded: boolean = false
export let hasActionsMenu: boolean = true export let hasActionsMenu: boolean = true
export let hasNotifyActions = false
export let onClick: (() => void) | undefined = undefined export let onClick: (() => void) | undefined = undefined
const client = getClient() const client = getClient()
@ -46,7 +45,6 @@
shouldScroll, shouldScroll,
embedded, embedded,
hasActionsMenu, hasActionsMenu,
hasNotifyActions,
onClick onClick
}} }}
/> />

View File

@ -17,26 +17,28 @@
import { Avatar, EmployeePresenter, SystemAvatar } from '@hcengineering/contact-resources' import { Avatar, EmployeePresenter, SystemAvatar } from '@hcengineering/contact-resources'
import { getClient } from '@hcengineering/presentation' import { getClient } from '@hcengineering/presentation'
import core from '@hcengineering/core/lib/component' import core from '@hcengineering/core/lib/component'
import notification, { import activity, {
DisplayActivityMessage, DisplayActivityMessage,
ActivityMessageExtension, ActivityMessageExtension,
DocUpdateMessageViewlet, ActivityMessageViewlet
ChatMessageViewlet } from '@hcengineering/activity'
} from '@hcengineering/notification'
import { Action, ActionIcon, IconMoreH, Label, showPopup } from '@hcengineering/ui' import { Action, ActionIcon, IconMoreH, Label, showPopup } from '@hcengineering/ui'
import { getActions, Menu } from '@hcengineering/view-resources' import { getActions, Menu } from '@hcengineering/view-resources'
import { getDisplayTime } from '@hcengineering/core' import { getDisplayTime } from '@hcengineering/core'
import ActivityMessageExtensionComponent from './ActivityMessageExtension.svelte' import ActivityMessageExtensionComponent from './ActivityMessageExtension.svelte'
import ActivityMessagePresenter from './ActivityMessagePresenter.svelte' import ActivityMessagePresenter from './ActivityMessagePresenter.svelte'
import AddReactionAction from '../reactions/AddReactionAction.svelte'
import ReactionsPresenter from '../reactions/ReactionsPresenter.svelte'
import PinMessageAction from './PinMessageAction.svelte'
export let message: DisplayActivityMessage export let message: DisplayActivityMessage
export let parentMessage: DisplayActivityMessage | undefined export let parentMessage: DisplayActivityMessage | undefined
export let viewlet: DocUpdateMessageViewlet | ChatMessageViewlet | undefined
export let viewlet: ActivityMessageViewlet | undefined
export let person: Person | undefined = undefined export let person: Person | undefined = undefined
export let actions: Action[] = [] export let actions: Action[] = []
export let excludedActions: string[] = [] export let excludedActions: string[] = []
export let hasNotifyActions = false
export let showNotify: boolean = false export let showNotify: boolean = false
export let isHighlighted: boolean = false export let isHighlighted: boolean = false
export let isSelected: boolean = false export let isSelected: boolean = false
@ -47,17 +49,12 @@
const client = getClient() const client = getClient()
let allActionIds: string[] = [] let allActionIds: string[] = []
const notifyActions = [
notification.action.MarkAsUnreadInboxNotification,
notification.action.MarkAsReadInboxNotification,
notification.action.DeleteInboxNotification
]
let element: HTMLDivElement | undefined = undefined let element: HTMLDivElement | undefined = undefined
let extensions: ActivityMessageExtension[] = [] let extensions: ActivityMessageExtension[] = []
let isActionMenuOpened = false let isActionMenuOpened = false
$: getActions(client, message, notification.class.ActivityMessage).then((res) => { $: getActions(client, message, activity.class.ActivityMessage).then((res) => {
allActionIds = res.map(({ _id }) => _id) allActionIds = res.map(({ _id }) => _id)
}) })
@ -73,7 +70,7 @@
} }
client client
.findAll(notification.class.ActivityMessageExtension, { ofMessage: message._class }) .findAll(activity.class.ActivityMessageExtension, { ofMessage: message._class })
.then((res: ActivityMessageExtension[]) => { .then((res: ActivityMessageExtension[]) => {
extensions = res extensions = res
}) })
@ -87,15 +84,14 @@
} }
$: key = parentMessage ? `${message._id}_${parentMessage._id}` : message._id $: key = parentMessage ? `${message._id}_${parentMessage._id}` : message._id
$: actualExcludedActions = hasNotifyActions ? excludedActions : [...notifyActions, ...excludedActions]
function showMenu (ev: MouseEvent) { function showMenu (ev: MouseEvent) {
showPopup( showPopup(
Menu, Menu,
{ {
object: message, object: message,
baseMenuClass: notification.class.ActivityMessage, baseMenuClass: activity.class.ActivityMessage,
excludedActions: actualExcludedActions, excludedActions,
actions actions
}, },
ev.target as HTMLElement, ev.target as HTMLElement,
@ -106,13 +102,12 @@
$: isHidden = !!viewlet?.onlyWithParent && parentMessage === undefined $: isHidden = !!viewlet?.onlyWithParent && parentMessage === undefined
$: withActionMenu = $: withActionMenu =
!embedded && !embedded && hasActionsMenu && (actions.length > 0 || allActionIds.some((id) => !excludedActions.includes(id)))
hasActionsMenu &&
(actions.length > 0 || allActionIds.some((id) => !actualExcludedActions.includes(id)))
</script> </script>
{#if !isHidden} {#if !isHidden}
{#key key} {#key key}
<!-- svelte-ignore a11y-no-static-element-interactions -->
<!-- svelte-ignore a11y-click-events-have-key-events --> <!-- svelte-ignore a11y-click-events-have-key-events -->
<div <div
bind:this={element} bind:this={element}
@ -157,6 +152,8 @@
<ActivityMessageExtensionComponent kind="footer" {extensions} props={{ object: message }} /> <ActivityMessageExtensionComponent kind="footer" {extensions} props={{ object: message }} />
<ReactionsPresenter object={message} />
{#if parentMessage} {#if parentMessage}
<div class="mt-2" /> <div class="mt-2" />
<ActivityMessagePresenter value={parentMessage} embedded /> <ActivityMessagePresenter value={parentMessage} embedded />
@ -167,6 +164,9 @@
class="actions clear-mins flex flex-gap-2 items-center" class="actions clear-mins flex flex-gap-2 items-center"
class:menuShowed={isActionMenuOpened || message.isPinned} class:menuShowed={isActionMenuOpened || message.isPinned}
> >
<AddReactionAction object={message} />
<PinMessageAction object={message} />
<ActivityMessageExtensionComponent <ActivityMessageExtensionComponent
kind="action" kind="action"
{extensions} {extensions}

View File

@ -16,7 +16,7 @@
import { ActionIcon } from '@hcengineering/ui' import { ActionIcon } from '@hcengineering/ui'
import { getClient } from '@hcengineering/presentation' import { getClient } from '@hcengineering/presentation'
import view from '@hcengineering/view' import view from '@hcengineering/view'
import { ActivityMessage } from '@hcengineering/notification' import { ActivityMessage } from '@hcengineering/activity'
export let object: ActivityMessage export let object: ActivityMessage

View File

@ -13,10 +13,10 @@
// limitations under the License. // limitations under the License.
--> -->
<script lang="ts"> <script lang="ts">
import notification, { DocAttributeUpdates, DocUpdateMessageViewlet } from '@hcengineering/notification'
import { Component } from '@hcengineering/ui' import { Component } from '@hcengineering/ui'
import { AttributeModel } from '@hcengineering/view' import view, { AttributeModel } from '@hcengineering/view'
import { getClient } from '@hcengineering/presentation' import { getClient } from '@hcengineering/presentation'
import { DocAttributeUpdates, DocUpdateMessageViewlet } from '@hcengineering/activity'
import AddedAttributesPresenter from './attributes/AddedAttributesPresenter.svelte' import AddedAttributesPresenter from './attributes/AddedAttributesPresenter.svelte'
import RemovedAttributesPresenter from './attributes/RemovedAttributesPresenter.svelte' import RemovedAttributesPresenter from './attributes/RemovedAttributesPresenter.svelte'
@ -31,8 +31,7 @@
$: presenter = $: presenter =
viewlet?.config?.[attributeModel.key]?.presenter ?? viewlet?.config?.[attributeModel.key]?.presenter ??
hierarchy.classHierarchyMixin(attributeUpdates.attrClass, notification.mixin.NotificationAttributePresenter) hierarchy.classHierarchyMixin(attributeUpdates.attrClass, view.mixin.ActivityAttributePresenter)?.presenter
?.presenter
</script> </script>
{#if presenter} {#if presenter}

View File

@ -15,14 +15,10 @@
<script lang="ts"> <script lang="ts">
import { AttachedDoc, Attribute, Class, Collection, Doc, Ref } from '@hcengineering/core' import { AttachedDoc, Attribute, Class, Collection, Doc, Ref } from '@hcengineering/core'
import { Icon, Label } from '@hcengineering/ui' import { Icon, Label } from '@hcengineering/ui'
import notification, {
DocUpdateMessageViewlet,
DisplayDocUpdateMessage,
DocUpdateMessage
} from '@hcengineering/notification'
import { IntlString } from '@hcengineering/platform' import { IntlString } from '@hcengineering/platform'
import { getClient } from '@hcengineering/presentation' import { getClient } from '@hcengineering/presentation'
import view from '@hcengineering/view' import view from '@hcengineering/view'
import activity, { DisplayDocUpdateMessage, DocUpdateMessage, DocUpdateMessageViewlet } from '@hcengineering/activity'
import NotificationObjectValue from './DocUpdateMessageObjectValue.svelte' import NotificationObjectValue from './DocUpdateMessageObjectValue.svelte'
@ -46,7 +42,8 @@
$: valueMessages = message.previousMessages?.length ? [...message.previousMessages, message] : [message] $: valueMessages = message.previousMessages?.length ? [...message.previousMessages, message] : [message]
$: hasDifferentActions = message.previousMessages?.some(({ action }) => action !== message.action) $: hasDifferentActions = message.previousMessages?.some(({ action }) => action !== message.action)
$: icon = viewlet?.icon ?? collectionAttribute?.icon ?? clazz.icon ?? notification.icon.Notifications // TODO: use AcrivityIcon
$: icon = viewlet?.icon ?? collectionAttribute?.icon ?? clazz.icon ?? activity.icon.Activity
</script> </script>
<div class="content"> <div class="content">
@ -54,11 +51,11 @@
<Icon {icon} size="small" /> <Icon {icon} size="small" />
</span> </span>
{#if hasDifferentActions} {#if hasDifferentActions}
<Label label={notification.string.UpdatedCollection} /> <Label label={activity.string.UpdatedCollection} />
{:else if message.action === 'create'} {:else if message.action === 'create'}
<Label label={notification.string.New} /> <Label label={activity.string.New} />
{:else if message.action === 'remove' && message.updateCollection} {:else if message.action === 'remove' && message.updateCollection}
<Label label={notification.string.Removed} /> <Label label={activity.string.Removed} />
{/if} {/if}
<span class="lower"> <span class="lower">
{#if collectionName && (message.previousMessages?.length || !isOwn)} {#if collectionName && (message.previousMessages?.length || !isOwn)}

View File

@ -16,9 +16,9 @@
import { DocNavLink } from '@hcengineering/view-resources' import { DocNavLink } from '@hcengineering/view-resources'
import { Doc } from '@hcengineering/core' import { Doc } from '@hcengineering/core'
import { Label } from '@hcengineering/ui' import { Label } from '@hcengineering/ui'
import notification, { DocUpdateMessageViewlet, DisplayDocUpdateMessage } from '@hcengineering/notification'
import { IntlString } from '@hcengineering/platform' import { IntlString } from '@hcengineering/platform'
import { AttributeModel } from '@hcengineering/view' import { AttributeModel } from '@hcengineering/view'
import activity, { DisplayDocUpdateMessage, DocUpdateMessageViewlet } from '@hcengineering/activity'
import { Person } from '@hcengineering/contact' import { Person } from '@hcengineering/contact'
import { LinkData, getLinkData } from '../../activityMessagesUtils' import { LinkData, getLinkData } from '../../activityMessagesUtils'
@ -46,13 +46,13 @@
const removed = attributeUpdates?.removed ?? [] const removed = attributeUpdates?.removed ?? []
if (added.length > 0 && removed.length === 0) { if (added.length > 0 && removed.length === 0) {
return notification.string.Added return activity.string.Added
} }
if (removed.length > 0 && added.length === 0) { if (removed.length > 0 && added.length === 0) {
return notification.string.Removed return activity.string.Removed
} }
return notification.string.Changed return activity.string.Changed
} }
</script> </script>
@ -61,14 +61,14 @@
{:else if message.previousMessages?.some(({ action }) => action !== message.action)} {:else if message.previousMessages?.some(({ action }) => action !== message.action)}
{@const name = collectionName ?? objectName} {@const name = collectionName ?? objectName}
<span class="text-sm lower"> <span class="text-sm lower">
<Label label={notification.string.Updated} /> <Label label={activity.string.Updated} />
{#if name} {#if name}
<Label label={name} /> <Label label={name} />
{/if} {/if}
</span> </span>
{:else if message.action === 'create' && objectName} {:else if message.action === 'create' && objectName}
<span class="text-sm lower"> <span class="text-sm lower">
<Label label={isOwn ? notification.string.Created : notification.string.Added} /> <Label label={isOwn ? activity.string.Created : activity.string.Added} />
{#if collectionName && (!isOwn || message.previousMessages?.length)} {#if collectionName && (!isOwn || message.previousMessages?.length)}
<Label label={collectionName} /> <Label label={collectionName} />
{:else} {:else}
@ -77,7 +77,7 @@
</span> </span>
{:else if message.action === 'remove' && objectName} {:else if message.action === 'remove' && objectName}
<span class="text-sm lower"> <span class="text-sm lower">
<Label label={notification.string.Removed} /> <Label label={activity.string.Removed} />
{#if collectionName && message.previousMessages?.length} {#if collectionName && message.previousMessages?.length}
<Label label={collectionName} /> <Label label={collectionName} />
{:else} {:else}

View File

@ -15,12 +15,12 @@
<script lang="ts"> <script lang="ts">
import { DocNavLink, getDocLinkTitle } from '@hcengineering/view-resources' import { DocNavLink, getDocLinkTitle } from '@hcengineering/view-resources'
import { Component, Icon, IconAdd, IconDelete } from '@hcengineering/ui' import { Component, Icon, IconAdd, IconDelete } from '@hcengineering/ui'
import { DocUpdateMessageViewlet, DisplayDocUpdateMessage } from '@hcengineering/notification'
import { getClient } from '@hcengineering/presentation' import { getClient } from '@hcengineering/presentation'
import view, { ObjectPanel, ObjectPresenter } from '@hcengineering/view' import view, { ObjectPanel, ObjectPresenter } from '@hcengineering/view'
import { Doc } from '@hcengineering/core' import { Doc } from '@hcengineering/core'
import { DisplayDocUpdateMessage, DocUpdateMessageViewlet } from '@hcengineering/activity'
import { getNotificationObject } from '../../activityMessagesUtils' import { getActivityObject } from '../../activityMessagesUtils'
export let message: DisplayDocUpdateMessage export let message: DisplayDocUpdateMessage
export let viewlet: DocUpdateMessageViewlet | undefined export let viewlet: DocUpdateMessageViewlet | undefined
@ -44,7 +44,7 @@
} }
</script> </script>
{#await getNotificationObject(client, message.objectId, message.objectClass) then { object }} {#await getActivityObject(client, message.objectId, message.objectClass) then { object }}
{#await getValue(object) then value} {#await getValue(object) then value}
{#if withIcon && message.action === 'create'} {#if withIcon && message.action === 'create'}
<Icon icon={IconAdd} size="x-small" /> <Icon icon={IconAdd} size="x-small" />

View File

@ -17,28 +17,27 @@
import { personByIdStore } from '@hcengineering/contact-resources' import { personByIdStore } from '@hcengineering/contact-resources'
import { Account, AttachedDoc, Class, Collection, Doc, Ref } from '@hcengineering/core' import { Account, AttachedDoc, Class, Collection, Doc, Ref } from '@hcengineering/core'
import { createQuery, getClient } from '@hcengineering/presentation' import { createQuery, getClient } from '@hcengineering/presentation'
import notification, {
ActivityMessage,
DocUpdateMessageViewlet,
DocUpdateMessage,
DisplayDocUpdateMessage,
DisplayActivityMessage,
DocUpdateAction
} from '@hcengineering/notification'
import core from '@hcengineering/core/lib/component' import core from '@hcengineering/core/lib/component'
import { AttributeModel } from '@hcengineering/view' import { AttributeModel } from '@hcengineering/view'
import { IntlString } from '@hcengineering/platform' import { IntlString } from '@hcengineering/platform'
import { Component, ShowMore } from '@hcengineering/ui' import { Component, ShowMore } from '@hcengineering/ui'
import activity, {
ActivityMessage,
DisplayActivityMessage,
DisplayDocUpdateMessage,
DocUpdateAction,
DocUpdateMessage,
DocUpdateMessageViewlet
} from '@hcengineering/activity'
import ActivityMessageTemplate from '../activity-message/ActivityMessageTemplate.svelte' import ActivityMessageTemplate from '../activity-message/ActivityMessageTemplate.svelte'
import DocUpdateMessageHeader from './DocUpdateMessageHeader.svelte' import DocUpdateMessageHeader from './DocUpdateMessageHeader.svelte'
import DocUpdateMessageContent from './DocUpdateMessageContent.svelte' import DocUpdateMessageContent from './DocUpdateMessageContent.svelte'
import DocUpdateMessageAttributes from './DocUpdateMessageAttributes.svelte' import DocUpdateMessageAttributes from './DocUpdateMessageAttributes.svelte'
import { getAttributeModel, getCollectionAttribute, getNotificationObject } from '../../activityMessagesUtils' import { getAttributeModel, getCollectionAttribute, getActivityObject } from '../../activityMessagesUtils'
export let value: DisplayDocUpdateMessage export let value: DisplayDocUpdateMessage
export let hasNotifyActions = false
export let showNotify: boolean = false export let showNotify: boolean = false
export let isHighlighted: boolean = false export let isHighlighted: boolean = false
export let isSelected: boolean = false export let isSelected: boolean = false
@ -79,7 +78,7 @@
isViewletLoading = true isViewletLoading = true
const res = viewletQuery.query( const res = viewletQuery.query(
notification.class.DocUpdateMessageViewlet, activity.class.DocUpdateMessageViewlet,
{ action, objectClass }, { action, objectClass },
(result: DocUpdateMessageViewlet[]) => { (result: DocUpdateMessageViewlet[]) => {
viewlet = result[0] viewlet = result[0]
@ -97,8 +96,8 @@
}) })
async function getParentMessage (_class: Ref<Class<Doc>>, _id: Ref<Doc>): Promise<ActivityMessage | undefined> { async function getParentMessage (_class: Ref<Class<Doc>>, _id: Ref<Doc>): Promise<ActivityMessage | undefined> {
if (hierarchy.isDerived(_class, notification.class.ActivityMessage)) { if (hierarchy.isDerived(_class, activity.class.ActivityMessage)) {
return await client.findOne(notification.class.ActivityMessage, { _id: _id as Ref<ActivityMessage> }) return await client.findOne(activity.class.ActivityMessage, { _id: _id as Ref<ActivityMessage> })
} }
} }
@ -112,7 +111,7 @@
$: person = user?.person && $personByIdStore.get(user.person) $: person = user?.person && $personByIdStore.get(user.person)
$: getNotificationObject(client, value.objectId, value.objectClass).then((result) => { $: getActivityObject(client, value.objectId, value.objectClass).then((result) => {
isObjectLoading = false isObjectLoading = false
object = result.object object = result.object
isObjectRemoved = result.isRemoved isObjectRemoved = result.isRemoved
@ -124,14 +123,14 @@
async function getParentObject (message: DocUpdateMessage, parentMessage?: ActivityMessage) { async function getParentObject (message: DocUpdateMessage, parentMessage?: ActivityMessage) {
if (parentMessage) { if (parentMessage) {
return await getNotificationObject(client, parentMessage.attachedTo, parentMessage.attachedToClass) return await getActivityObject(client, parentMessage.attachedTo, parentMessage.attachedToClass)
} }
if (message.objectId === message.attachedTo) { if (message.objectId === message.attachedTo) {
return return
} }
return await getNotificationObject(client, message.attachedTo, message.attachedToClass) return await getActivityObject(client, message.attachedTo, message.attachedToClass)
} }
$: if (object && value.objectClass !== object._class) { $: if (object && value.objectClass !== object._class) {
@ -151,7 +150,6 @@
{embedded} {embedded}
{hasActionsMenu} {hasActionsMenu}
{viewlet} {viewlet}
{hasNotifyActions}
{onClick} {onClick}
> >
<svelte:fragment slot="header"> <svelte:fragment slot="header">
@ -175,7 +173,7 @@
<ShowMore> <ShowMore>
<div class="customContent"> <div class="customContent">
{#each [...(value?.previousMessages ?? []), value] as msg} {#each [...(value?.previousMessages ?? []), value] as msg}
{#await getNotificationObject(client, msg.objectId, msg.objectClass) then { object }} {#await getActivityObject(client, msg.objectId, msg.objectClass) then { object }}
{#if object} {#if object}
<Component is={viewlet.component} props={{ message: value, value: object }} /> <Component is={viewlet.component} props={{ message: value, value: object }} />
{/if} {/if}

View File

@ -13,10 +13,10 @@
// limitations under the License. // limitations under the License.
--> -->
<script lang="ts"> <script lang="ts">
import notification, { DocAttributeUpdates, DocUpdateMessageViewlet } from '@hcengineering/notification'
import { Label } from '@hcengineering/ui' import { Label } from '@hcengineering/ui'
import { AttributeModel } from '@hcengineering/view' import { AttributeModel } from '@hcengineering/view'
import ChangeAttributesTemplate from './ChangeAttributesTemplate.svelte' import ChangeAttributesTemplate from './ChangeAttributesTemplate.svelte'
import activity, { DocAttributeUpdates, DocUpdateMessageViewlet } from '@hcengineering/activity'
export let viewlet: DocUpdateMessageViewlet | undefined export let viewlet: DocUpdateMessageViewlet | undefined
export let attributeModel: AttributeModel export let attributeModel: AttributeModel
@ -25,7 +25,7 @@
<ChangeAttributesTemplate {viewlet} {attributeModel} {values}> <ChangeAttributesTemplate {viewlet} {attributeModel} {values}>
<svelte:fragment slot="text"> <svelte:fragment slot="text">
<Label label={notification.string.New} /> <Label label={activity.string.New} />
<span class="lower"><Label label={attributeModel.label} />:</span> <span class="lower"><Label label={attributeModel.label} />:</span>
</svelte:fragment> </svelte:fragment>
</ChangeAttributesTemplate> </ChangeAttributesTemplate>

View File

@ -13,16 +13,16 @@
// limitations under the License. // limitations under the License.
--> -->
<script lang="ts"> <script lang="ts">
import { DocAttributeUpdates, DocUpdateMessageViewlet } from '@hcengineering/notification'
import { Icon, IconEdit, Component } from '@hcengineering/ui' import { Icon, IconEdit, Component } from '@hcengineering/ui'
import { ObjectPresenter } from '@hcengineering/view-resources' import { ObjectPresenter } from '@hcengineering/view-resources'
import { getClient } from '@hcengineering/presentation' import { getClient } from '@hcengineering/presentation'
import { Doc } from '@hcengineering/core' import { Doc } from '@hcengineering/core'
import { AttributeModel } from '@hcengineering/view' import { AttributeModel } from '@hcengineering/view'
import { DocAttributeUpdates, DocUpdateMessageViewlet } from '@hcengineering/activity'
import { getAttributeValues } from '../../../activityMessagesUtils' import { getAttributeValues } from '../../../activityMessagesUtils'
type Values = DocAttributeUpdates['set'] | DocAttributeUpdates['added'] | DocAttributeUpdates['removed'] type Values = DocAttributeUpdates['set' | 'added' | 'removed']
export let viewlet: DocUpdateMessageViewlet | undefined export let viewlet: DocUpdateMessageViewlet | undefined
export let attributeModel: AttributeModel export let attributeModel: AttributeModel
export let values: Values export let values: Values

View File

@ -13,9 +13,9 @@
// limitations under the License. // limitations under the License.
--> -->
<script lang="ts"> <script lang="ts">
import notification, { DocAttributeUpdates, DocUpdateMessageViewlet } from '@hcengineering/notification'
import { Label } from '@hcengineering/ui' import { Label } from '@hcengineering/ui'
import { AttributeModel } from '@hcengineering/view' import { AttributeModel } from '@hcengineering/view'
import activity, { DocAttributeUpdates, DocUpdateMessageViewlet } from '@hcengineering/activity'
import ChangeAttributesTemplate from './ChangeAttributesTemplate.svelte' import ChangeAttributesTemplate from './ChangeAttributesTemplate.svelte'
@ -26,7 +26,7 @@
<ChangeAttributesTemplate {viewlet} {attributeModel} {values}> <ChangeAttributesTemplate {viewlet} {attributeModel} {values}>
<svelte:fragment slot="text"> <svelte:fragment slot="text">
<Label label={notification.string.Removed} /> <Label label={activity.string.Removed} />
<span class="lower"> <Label label={attributeModel.label} />:</span> <span class="lower"> <Label label={attributeModel.label} />:</span>
</svelte:fragment> </svelte:fragment>
</ChangeAttributesTemplate> </ChangeAttributesTemplate>

View File

@ -13,10 +13,10 @@
// limitations under the License. // limitations under the License.
--> -->
<script lang="ts"> <script lang="ts">
import notification, { DocAttributeUpdates, DocUpdateMessageViewlet } from '@hcengineering/notification'
import ui, { Icon, Label, IconEdit } from '@hcengineering/ui' import ui, { Icon, Label, IconEdit } from '@hcengineering/ui'
import { AttributeModel } from '@hcengineering/view' import { AttributeModel } from '@hcengineering/view'
import core from '@hcengineering/core/lib/component' import core from '@hcengineering/core'
import activity, { DocAttributeUpdates, DocUpdateMessageViewlet } from '@hcengineering/activity'
import ChangeAttributesTemplate from './ChangeAttributesTemplate.svelte' import ChangeAttributesTemplate from './ChangeAttributesTemplate.svelte'
@ -45,7 +45,7 @@
{#if isUnset} {#if isUnset}
<div class="unset"> <div class="unset">
<span class="mr-1"><Icon icon={attributeIcon} size="small" /></span> <span class="mr-1"><Icon icon={attributeIcon} size="small" /></span>
<Label label={notification.string.Unset} /> <Label label={activity.string.Unset} />
<span class="lower"><Label label={attributeModel.label} /></span> <span class="lower"><Label label={attributeModel.label} /></span>
</div> </div>
{:else if isTextType} {:else if isTextType}
@ -62,8 +62,8 @@
<ChangeAttributesTemplate {viewlet} {attributeModel} {values}> <ChangeAttributesTemplate {viewlet} {attributeModel} {values}>
<svelte:fragment slot="text"> <svelte:fragment slot="text">
<Label label={attributeModel.label} /> <Label label={attributeModel.label} />
<span class="lower"><Label label={notification.string.Set} /></span> <span class="lower"><Label label={activity.string.Set} /></span>
<span class="lower"><Label label={notification.string.To} /></span> <span class="lower"><Label label={activity.string.To} /></span>
</svelte:fragment> </svelte:fragment>
</ChangeAttributesTemplate> </ChangeAttributesTemplate>
{/if} {/if}

View File

@ -13,14 +13,13 @@
// limitations under the License. // limitations under the License.
--> -->
<script lang="ts"> <script lang="ts">
import { createEventDispatcher } from 'svelte'
import { ActionIcon, EmojiPopup, IconEmoji, showPopup } from '@hcengineering/ui' import { ActionIcon, EmojiPopup, IconEmoji, showPopup } from '@hcengineering/ui'
import { createQuery, getClient } from '@hcengineering/presentation' import { createQuery, getClient } from '@hcengineering/presentation'
import { Reaction } from '@hcengineering/chunter' import activity, { Reaction } from '@hcengineering/activity'
import { Doc } from '@hcengineering/core' import { Doc } from '@hcengineering/core'
import chunter from '../plugin' import { updateDocReactions } from '../../utils'
import { updateDocReactions } from '../utils'
import { createEventDispatcher } from 'svelte'
export let object: Doc | undefined = undefined export let object: Doc | undefined = undefined
@ -32,7 +31,7 @@
let reactions: Reaction[] = [] let reactions: Reaction[] = []
$: if (object) { $: if (object) {
reactionsQuery.query(chunter.class.Reaction, { attachedTo: object._id }, (res?: Reaction[]) => { reactionsQuery.query(activity.class.Reaction, { attachedTo: object._id }, (res?: Reaction[]) => {
reactions = res || [] reactions = res || []
}) })
} }

View File

@ -13,7 +13,8 @@
// limitations under the License. // limitations under the License.
--> -->
<script lang="ts"> <script lang="ts">
import type { Reaction } from '@hcengineering/chunter' import { Reaction } from '@hcengineering/activity'
export let value: Reaction | undefined export let value: Reaction | undefined
</script> </script>

View File

@ -14,13 +14,13 @@
--> -->
<script lang="ts"> <script lang="ts">
import { createEventDispatcher } from 'svelte' import { createEventDispatcher } from 'svelte'
import { Reaction } from '@hcengineering/chunter' import { Reaction } from '@hcengineering/activity'
import { Account, Doc, Ref } from '@hcengineering/core' import { Account, Doc, Ref } from '@hcengineering/core'
import { EmojiPopup, IconAdd, showPopup, tooltip } from '@hcengineering/ui' import { EmojiPopup, IconAdd, showPopup, tooltip } from '@hcengineering/ui'
import { getClient } from '@hcengineering/presentation' import { getClient } from '@hcengineering/presentation'
import ReactionsTooltip from './ReactionsTooltip.svelte' import ReactionsTooltip from './ReactionsTooltip.svelte'
import { updateDocReactions } from '../utils' import { updateDocReactions } from '../../utils'
export let reactions: Reaction[] = [] export let reactions: Reaction[] = []
export let object: Doc | undefined = undefined export let object: Doc | undefined = undefined

View File

@ -14,13 +14,11 @@
--> -->
<script lang="ts"> <script lang="ts">
import { createQuery, getClient } from '@hcengineering/presentation' import { createQuery, getClient } from '@hcengineering/presentation'
import { Reaction } from '@hcengineering/chunter' import activity, { Reaction } from '@hcengineering/activity'
import { Doc } from '@hcengineering/core' import { Doc } from '@hcengineering/core'
import Reactions from './Reactions.svelte' import Reactions from './Reactions.svelte'
import { updateDocReactions } from '../../utils'
import { updateDocReactions } from '../utils'
import chunter from '../plugin'
export let object: Doc | undefined export let object: Doc | undefined
@ -30,7 +28,7 @@
let reactions: Reaction[] = [] let reactions: Reaction[] = []
$: if (object) { $: if (object) {
reactionsQuery.query(chunter.class.Reaction, { attachedTo: object._id }, (res?: Reaction[]) => { reactionsQuery.query(activity.class.Reaction, { attachedTo: object._id }, (res?: Reaction[]) => {
reactions = res || [] reactions = res || []
}) })
} }

View File

@ -16,11 +16,30 @@
import { type Resources } from '@hcengineering/platform' import { type Resources } from '@hcengineering/platform'
import Activity from './components/Activity.svelte' import Activity from './components/Activity.svelte'
import ActivityMessagePresenter from './components/activity-message/ActivityMessagePresenter.svelte'
import DocUpdateMessagePresenter from './components/doc-update-message/DocUpdateMessagePresenter.svelte'
import ReactionAddedMessage from './components/reactions/ReactionAddedMessage.svelte'
import { attributesFilter, pinnedFilter } from './activityMessagesUtils'
export * from './activity' export * from './activity'
export * from './utils' export * from './utils'
export * from './activityMessagesUtils'
export { default as Reactions } from './components/reactions/Reactions.svelte'
export { default as ActivityMessageTemplate } from './components/activity-message/ActivityMessageTemplate.svelte'
export { default as ActivityMessagePresenter } from './components/activity-message/ActivityMessagePresenter.svelte'
export { default as ActivityExtension } from './components/ActivityExtension.svelte'
export default async (): Promise<Resources> => ({ export default async (): Promise<Resources> => ({
component: { component: {
Activity Activity,
ActivityMessagePresenter,
DocUpdateMessagePresenter,
ReactionAddedMessage
},
filter: {
AttributesFilter: attributesFilter,
PinnedFilter: pinnedFilter
} }
}) })

View File

@ -1,5 +1,5 @@
import { get } from 'svelte/store' import { get } from 'svelte/store'
import type { DisplayTx, TxViewlet } from '@hcengineering/activity' import type { DisplayTx, Reaction, TxViewlet } from '@hcengineering/activity'
import core, { import core, {
type AttachedDoc, type AttachedDoc,
type Class, type Class,
@ -16,7 +16,8 @@ import core, {
type TxOperations, type TxOperations,
TxProcessor, TxProcessor,
type TxUpdateDoc, type TxUpdateDoc,
matchQuery matchQuery,
getCurrentAccount
} from '@hcengineering/core' } from '@hcengineering/core'
import { type Asset, type IntlString, getResource, translate } from '@hcengineering/platform' import { type Asset, type IntlString, getResource, translate } from '@hcengineering/platform'
import { getAttributePresenterClass } from '@hcengineering/presentation' import { getAttributePresenterClass } from '@hcengineering/presentation'
@ -391,3 +392,27 @@ export async function getValue (client: TxOperations, m: AttributeModel, tx: Dis
} }
return value return value
} }
export async function updateDocReactions (
client: TxOperations,
reactions: Reaction[],
object?: Doc,
emoji?: string
): Promise<void> {
if (emoji === undefined || object === undefined) {
return
}
const currentAccount = getCurrentAccount()
const reaction = reactions.find((r) => r.emoji === emoji && r.createBy === currentAccount._id)
if (reaction == null) {
await client.addCollection(activity.class.Reaction, object.space, object._id, object._class, 'reactions', {
emoji,
createBy: currentAccount._id
})
} else {
await client.remove(reaction)
}
}

View File

@ -30,7 +30,6 @@
}, },
"dependencies": { "dependencies": {
"@hcengineering/core": "^0.6.28", "@hcengineering/core": "^0.6.28",
"@hcengineering/notification": "^0.6.16",
"@hcengineering/platform": "^0.6.9", "@hcengineering/platform": "^0.6.9",
"@hcengineering/ui": "^0.6.11" "@hcengineering/ui": "^0.6.11"
} }

View File

@ -13,21 +13,24 @@
// limitations under the License. // limitations under the License.
// //
import type { import {
Account,
AttachedDoc, AttachedDoc,
Attribute, Attribute,
Class, Class,
Collection, Collection,
Doc, Doc,
DocumentQuery, DocumentQuery,
Mixin,
Ref, Ref,
Timestamp,
Tx, Tx,
TxCreateDoc, TxCreateDoc,
TxCUD, TxCUD,
TxMixin, TxMixin,
TxUpdateDoc TxUpdateDoc
} from '@hcengineering/core' } from '@hcengineering/core'
import type { Asset, IntlString, Plugin } from '@hcengineering/platform' import type { Asset, IntlString, Plugin, Resource } from '@hcengineering/platform'
import { plugin } from '@hcengineering/platform' import { plugin } from '@hcengineering/platform'
import type { AnyComponent } from '@hcengineering/ui' import type { AnyComponent } from '@hcengineering/ui'
@ -98,14 +101,158 @@ export interface DisplayTx {
originTx: TxCUD<Doc> originTx: TxCUD<Doc>
} }
/**
* @public
*/
export interface ActivityMessage extends AttachedDoc {
modifiedBy: Ref<Account>
modifiedOn: Timestamp
isPinned?: boolean
reactions?: number
}
export type DisplayActivityMessage = DisplayDocUpdateMessage | ActivityMessage
export interface DisplayDocUpdateMessage extends DocUpdateMessage {
previousMessages?: DocUpdateMessage[]
combinedMessagesIds?: Ref<DocUpdateMessage>[]
}
export type ActivityMessageExtensionKind = 'action' | 'footer'
/**
* @public
*/
export interface ActivityMessageExtension extends Doc {
ofMessage: Ref<Class<ActivityMessage>>
components: { kind: ActivityMessageExtensionKind, component: AnyComponent }[]
}
/**
* @public
*/
export interface DocUpdateMessage extends ActivityMessage {
objectId: Ref<Doc>
objectClass: Ref<Class<Doc>>
txId: Ref<TxCUD<Doc>>
action: DocUpdateAction
updateCollection?: string
attributeUpdates?: DocAttributeUpdates
}
/**
* @public
*/
export interface DocAttributeUpdates {
attrKey: string
attrClass: Ref<Class<Doc>>
set: (string | number | null)[]
prevValue?: any // Need for description diff
added: (string | number | null)[]
removed: (string | number | null)[]
isMixin: boolean
}
export type DocUpdateAction = 'create' | 'update' | 'remove'
export type DocUpdateMessageViewletAttributesConfig = Record<
string,
{
presenter?: AnyComponent
icon?: Asset
iconPresenter?: AnyComponent
}
>
/**
* @public
*/
export interface ActivityMessageViewlet extends Doc {
objectClass: Ref<Class<Doc>>
onlyWithParent?: boolean
}
/**
* @public
*/
export interface DocUpdateMessageViewlet extends ActivityMessageViewlet {
action: DocUpdateAction
valueAttr?: string
label?: IntlString
labelComponent?: AnyComponent
icon?: Asset
component?: AnyComponent
config?: DocUpdateMessageViewletAttributesConfig
hideIfRemoved?: boolean
}
/** /**
* @public * @public
*/ */
export const activityId = 'activity' as Plugin export const activityId = 'activity' as Plugin
/**
* @public
*/
export interface ActivityMessagesFilter extends Doc {
label: IntlString
filter: Resource<(message: ActivityMessage, _class?: Ref<Doc>) => boolean>
}
/**
* @public
*/
export interface ActivityDoc extends Class<Doc> {
preposition?: IntlString
ignoreCollections?: string[]
}
/**
* @public
*/
export type ActivityExtensionKind = 'input'
/**
* @public
*/
export interface ActivityExtension extends Doc {
ofClass: Ref<Class<Doc>>
components: Record<ActivityExtensionKind, AnyComponent>
}
/**
* @public
*/
export interface Reaction extends AttachedDoc {
emoji: string
createBy: Ref<Account>
}
export default plugin(activityId, { export default plugin(activityId, {
mixin: {
ActivityDoc: '' as Ref<Mixin<ActivityDoc>>
},
class: {
TxViewlet: '' as Ref<Class<TxViewlet>>,
DocUpdateMessage: '' as Ref<Class<DocUpdateMessage>>,
ActivityMessage: '' as Ref<Class<ActivityMessage>>,
DocUpdateMessageViewlet: '' as Ref<Class<DocUpdateMessageViewlet>>,
ActivityMessageExtension: '' as Ref<Class<ActivityMessageExtension>>,
ActivityMessagesFilter: '' as Ref<Class<ActivityMessagesFilter>>,
ActivityExtension: '' as Ref<Class<ActivityExtension>>,
Reaction: '' as Ref<Class<Reaction>>
},
icon: { icon: {
Activity: '' as Asset Activity: '' as Asset,
Emoji: '' as Asset
}, },
string: { string: {
Activity: '' as IntlString, Activity: '' as IntlString,
@ -115,12 +262,24 @@ export default plugin(activityId, {
From: '' as IntlString, From: '' as IntlString,
Removed: '' as IntlString, Removed: '' as IntlString,
To: '' as IntlString, To: '' as IntlString,
Unset: '' as IntlString Unset: '' as IntlString,
}, In: '' as IntlString,
class: { NewestFirst: '' as IntlString,
TxViewlet: '' as Ref<Class<TxViewlet>> Edit: '' as IntlString,
Updated: '' as IntlString,
Created: '' as IntlString,
UpdatedCollection: '' as IntlString,
New: '' as IntlString,
Set: '' as IntlString,
Update: '' as IntlString,
For: '' as IntlString,
AllActivity: '' as IntlString,
Reactions: '' as IntlString
}, },
component: { component: {
Activity: '' as AnyComponent Activity: '' as AnyComponent,
ActivityMessagePresenter: '' as AnyComponent,
DocUpdateMessagePresenter: '' as AnyComponent,
ReactionAddedMessage: '' as AnyComponent
} }
}) })

Some files were not shown because too many files have changed in this diff Show More