diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index b801a08e75..7b36f2ee74 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -63,6 +63,7 @@ specifiers: '@rush-temp/model-server-attachment': file:./projects/model-server-attachment.tgz '@rush-temp/model-server-contact': file:./projects/model-server-contact.tgz '@rush-temp/model-server-core': file:./projects/model-server-core.tgz + '@rush-temp/model-server-notification': file:./projects/model-server-notification.tgz '@rush-temp/model-setting': file:./projects/model-setting.tgz '@rush-temp/model-task': file:./projects/model-task.tgz '@rush-temp/model-telegram': file:./projects/model-telegram.tgz @@ -72,6 +73,7 @@ specifiers: '@rush-temp/model-workbench': file:./projects/model-workbench.tgz '@rush-temp/mongo': file:./projects/mongo.tgz '@rush-temp/notification': file:./projects/notification.tgz + '@rush-temp/notification-assets': file:./projects/notification-assets.tgz '@rush-temp/notification-resources': file:./projects/notification-resources.tgz '@rush-temp/panel': file:./projects/panel.tgz '@rush-temp/platform': file:./projects/platform.tgz @@ -90,6 +92,8 @@ specifiers: '@rush-temp/server-contact': file:./projects/server-contact.tgz '@rush-temp/server-contact-resources': file:./projects/server-contact-resources.tgz '@rush-temp/server-core': file:./projects/server-core.tgz + '@rush-temp/server-notification': file:./projects/server-notification.tgz + '@rush-temp/server-notification-resources': file:./projects/server-notification-resources.tgz '@rush-temp/server-token': file:./projects/server-token.tgz '@rush-temp/server-tool': file:./projects/server-tool.tgz '@rush-temp/server-ws': file:./projects/server-ws.tgz @@ -264,6 +268,7 @@ dependencies: '@rush-temp/model-server-attachment': file:projects/model-server-attachment.tgz_typescript@4.5.4 '@rush-temp/model-server-contact': file:projects/model-server-contact.tgz_typescript@4.5.4 '@rush-temp/model-server-core': file:projects/model-server-core.tgz_typescript@4.5.4 + '@rush-temp/model-server-notification': file:projects/model-server-notification.tgz_typescript@4.5.4 '@rush-temp/model-setting': file:projects/model-setting.tgz_typescript@4.5.4 '@rush-temp/model-task': file:projects/model-task.tgz_typescript@4.5.4 '@rush-temp/model-telegram': file:projects/model-telegram.tgz_typescript@4.5.4 @@ -273,6 +278,7 @@ dependencies: '@rush-temp/model-workbench': file:projects/model-workbench.tgz_typescript@4.5.4 '@rush-temp/mongo': file:projects/mongo.tgz '@rush-temp/notification': file:projects/notification.tgz + '@rush-temp/notification-assets': file:projects/notification-assets.tgz_typescript@4.5.4 '@rush-temp/notification-resources': file:projects/notification-resources.tgz_096c09b0b673a57c275d9767a12070b1 '@rush-temp/panel': file:projects/panel.tgz_096c09b0b673a57c275d9767a12070b1 '@rush-temp/platform': file:projects/platform.tgz @@ -291,6 +297,8 @@ dependencies: '@rush-temp/server-contact': file:projects/server-contact.tgz '@rush-temp/server-contact-resources': file:projects/server-contact-resources.tgz '@rush-temp/server-core': file:projects/server-core.tgz + '@rush-temp/server-notification': file:projects/server-notification.tgz + '@rush-temp/server-notification-resources': file:projects/server-notification-resources.tgz '@rush-temp/server-token': file:projects/server-token.tgz '@rush-temp/server-tool': file:projects/server-tool.tgz '@rush-temp/server-ws': file:projects/server-ws.tgz @@ -11187,7 +11195,7 @@ packages: dev: false file:projects/activity-resources.tgz_096c09b0b673a57c275d9767a12070b1: - resolution: {integrity: sha512-DTAIFUH5vy1h9mqxFrr25BYnjgndQ7HFIozOVU7lBlRHQJ2v9x1fWdKvLr9Srg+E7OeN2GawVcx19GUZ2eW/zg==, tarball: file:projects/activity-resources.tgz} + resolution: {integrity: sha512-o6RpdrtwnGmVtudJ14BdbkVOXYJ2kWdlC8BrM7HZnHNlWRbCoTUX9wAXdyOvwbkxcXbWANNNb8B9v9A+BE9f4Q==, tarball: file:projects/activity-resources.tgz} id: file:projects/activity-resources.tgz name: '@rush-temp/activity-resources' version: 0.0.0 @@ -11377,7 +11385,7 @@ packages: dev: false file:projects/chunter.tgz: - resolution: {integrity: sha512-D/Ar+jZ9VwOidVBlO8Kh18DjmojP9ILhHojkN4NsoZ9t1ZoJ8/qiiq3TrEm81KHDqb1NyOm+Bcr8TlhkjchB2g==, tarball: file:projects/chunter.tgz} + resolution: {integrity: sha512-Yu9qSoDiPa7br3OD/0UGkdUX+Xb2woPmQWhyNpKvSwMDga++PcU2MWl8/6mASwFGKszAB7ybq/T4l/y7VMaKqg==, tarball: file:projects/chunter.tgz} name: '@rush-temp/chunter' version: 0.0.0 dependencies: @@ -12048,7 +12056,7 @@ packages: dev: false file:projects/lead-resources.tgz_096c09b0b673a57c275d9767a12070b1: - resolution: {integrity: sha512-W842udh6/87OvajsjespWfSRZhSUJZPkGDSHCaMjtSePN5T4nL2EkNGR66mIi1RW88oAoyd3VPx8MSZmUWnCGQ==, tarball: file:projects/lead-resources.tgz} + resolution: {integrity: sha512-od6TTUKq72g4CBbHS06/M64kzZK//B9NF7aftYl91RVwL+gm5JQLFCLwksdo4NE7VSyb7VWop199pYfMaKOcdg==, tarball: file:projects/lead-resources.tgz} id: file:projects/lead-resources.tgz name: '@rush-temp/lead-resources' version: 0.0.0 @@ -12201,7 +12209,7 @@ packages: dev: false file:projects/model-all.tgz_typescript@4.5.4: - resolution: {integrity: sha512-Q1uN1ojy8Xc1Q2hsrrBqQrwdhkJgfGu90yb/mtHmDDb+WCguVe1JlPL9jbLV0f39wY5qnCzByDApK2FHftgVlA==, tarball: file:projects/model-all.tgz} + resolution: {integrity: sha512-KDrsTCCCt8hoQSwtTAQOsgbNjHRb9g270jtlXlT320EbfHNUslOzMLwns850SHjoA+6XxerLV/ItBBPMc4xCUw==, tarball: file:projects/model-all.tgz} id: file:projects/model-all.tgz name: '@rush-temp/model-all' version: 0.0.0 @@ -12394,7 +12402,7 @@ packages: dev: false file:projects/model-notification.tgz_typescript@4.5.4: - resolution: {integrity: sha512-q/JNneErW66xgCE5Yc/7bPkeUXwiEUJw95gbYt5uDTeuuzK0TrP77epbfSaWqkH7kP9SjqKrBwWPdm+M64q98g==, tarball: file:projects/model-notification.tgz} + resolution: {integrity: sha512-oXjmLAI4ablTqm5zdk23LYWTRRdqLGxshn164t87FLm4T/6sFK7xlikIuxGNn+XED0/m1T9ShPXEwXcYFJ/YQw==, tarball: file:projects/model-notification.tgz} id: file:projects/model-notification.tgz name: '@rush-temp/model-notification' version: 0.0.0 @@ -12538,6 +12546,27 @@ packages: - typescript dev: false + file:projects/model-server-notification.tgz_typescript@4.5.4: + resolution: {integrity: sha512-bO0DgNGdJGxJjDU05x1HPNHfprIFhRYhauMT9eH4zKMlsQZNO5Rx5h77SxepW2HiAxVYMqjOR2GwsTN3h7C8wQ==, tarball: file:projects/model-server-notification.tgz} + id: file:projects/model-server-notification.tgz + name: '@rush-temp/model-server-notification' + version: 0.0.0 + dependencies: + '@rushstack/heft': 0.41.8 + '@types/heft-jest': 1.0.2 + '@typescript-eslint/eslint-plugin': 5.7.0_c25e8c1f4f4f7aaed27aa6f9ce042237 + '@typescript-eslint/parser': 5.7.0_eslint@7.32.0+typescript@4.5.4 + eslint: 7.32.0 + eslint-config-standard-with-typescript: 21.0.1_ce2fa0c4dfa1c256100cababd749a13a + eslint-plugin-import: 2.25.3_eslint@7.32.0 + eslint-plugin-node: 11.1.0_eslint@7.32.0 + eslint-plugin-promise: 5.2.0_eslint@7.32.0 + prettier: 2.5.1 + transitivePeerDependencies: + - supports-color + - typescript + dev: false + file:projects/model-setting.tgz_typescript@4.5.4: resolution: {integrity: sha512-zwbVN3PDOfDeqGcL36IHQIufdePTd68yLUm83rfIg4v8+uilseid981y/BrAysmxTXAfhVYWlDmtYXvNPS4DMQ==, tarball: file:projects/model-setting.tgz} id: file:projects/model-setting.tgz @@ -12728,8 +12757,30 @@ packages: - supports-color dev: false + file:projects/notification-assets.tgz_typescript@4.5.4: + resolution: {integrity: sha512-2K6QTmVeQ8n4QRF37QQPTIGFDwzu9L9gWQU1hFrY0JURiX3wKoTX+tLYnqdr/i4QKQFG9DMYxrunrOvRu8kelQ==, tarball: file:projects/notification-assets.tgz} + id: file:projects/notification-assets.tgz + name: '@rush-temp/notification-assets' + version: 0.0.0 + dependencies: + '@rushstack/heft': 0.41.8 + '@types/heft-jest': 1.0.2 + '@types/node': 16.11.14 + '@typescript-eslint/eslint-plugin': 5.7.0_c25e8c1f4f4f7aaed27aa6f9ce042237 + '@typescript-eslint/parser': 5.7.0_eslint@7.32.0+typescript@4.5.4 + eslint: 7.32.0 + eslint-config-standard-with-typescript: 21.0.1_ce2fa0c4dfa1c256100cababd749a13a + eslint-plugin-import: 2.25.3_eslint@7.32.0 + eslint-plugin-node: 11.1.0_eslint@7.32.0 + eslint-plugin-promise: 5.2.0_eslint@7.32.0 + prettier: 2.5.1 + transitivePeerDependencies: + - supports-color + - typescript + dev: false + file:projects/notification-resources.tgz_096c09b0b673a57c275d9767a12070b1: - resolution: {integrity: sha512-jOFuqeLEJ/3BNsAhz8NxibKKTkKtu1a8KqSO434S51HidRwdUBUY8lwZUB1UA97OFi/O7r3E4CGE0ERAdQWn0A==, tarball: file:projects/notification-resources.tgz} + resolution: {integrity: sha512-raqBx9exX10O9GZ0ltv6U0XgNO1DZxV5HzvCjACbdqL9C9wjlxcFci+0iOpwSLxMzPZn1IkkKDo18q5bH2oC7g==, tarball: file:projects/notification-resources.tgz} id: file:projects/notification-resources.tgz name: '@rush-temp/notification-resources' version: 0.0.0 @@ -12766,7 +12817,7 @@ packages: dev: false file:projects/notification.tgz: - resolution: {integrity: sha512-VOGvKSMA5Utp3zuIYzvaHujYwS2ObDBtjrzKJzWDn8RtQo8zW8nOYjEOIDDIvXKGZlpl/5v62pDsEBiCQ/yNhw==, tarball: file:projects/notification.tgz} + resolution: {integrity: sha512-5pLpWTSQqSQ3UavtuHcWcLFP/gUyFTnP74LP+WsAmW5RhoYFxew/x7canzh6Oeq0DpaX7CxXUqmKtv8oCUvQkg==, tarball: file:projects/notification.tgz} name: '@rush-temp/notification' version: 0.0.0 dependencies: @@ -12937,7 +12988,7 @@ packages: dev: false file:projects/prod.tgz_sass@1.45.0+typescript@4.5.4: - resolution: {integrity: sha512-DK9VDDqiYj34A7zgq+FHvonq4RGVr/Ozyjv7QR1HyNaUXnjYTM4lMV3sFjhXLeg2oCFY4J9nU2U1S4zTDoFEYA==, tarball: file:projects/prod.tgz} + resolution: {integrity: sha512-+ke/wA1+S6z6mgIO2IAwtov8K5Zpc4ScgRc+cdU34ie7/5JpPmdoQhDgxG3QbPrf+BlADvJEaVOVZRvml16TVw==, tarball: file:projects/prod.tgz} id: file:projects/prod.tgz name: '@rush-temp/prod' version: 0.0.0 @@ -13029,7 +13080,7 @@ packages: dev: false file:projects/recruit-resources.tgz_096c09b0b673a57c275d9767a12070b1: - resolution: {integrity: sha512-NgcfcFmKVD0ojJbtjT3yvD//m1x3koZpBdkLryhSKtQMhzcuZD9GpBmVbRnPtLGBrDMSALasx1NB5JMxxDPLFQ==, tarball: file:projects/recruit-resources.tgz} + resolution: {integrity: sha512-8pFvHj9M1cjOrdU5vQPrYmV0Yqd76ErwcRrAuiiLXpKIpYqlRdAXTb9Xe34PygnwWRI3icjB+dl22AINYksbHA==, tarball: file:projects/recruit-resources.tgz} id: file:projects/recruit-resources.tgz name: '@rush-temp/recruit-resources' version: 0.0.0 @@ -13218,6 +13269,47 @@ packages: - supports-color dev: false + file:projects/server-notification-resources.tgz: + resolution: {integrity: sha512-9EXWxHdVb5DvmZORxWPquKpxThiRV6zaEtpFbat4drf5i/br5cERKka5+oBJK27WyYYeB8rUGjjQ7AFx/dJzbQ==, tarball: file:projects/server-notification-resources.tgz} + name: '@rush-temp/server-notification-resources' + version: 0.0.0 + dependencies: + '@rushstack/heft': 0.41.8 + '@types/heft-jest': 1.0.2 + '@typescript-eslint/eslint-plugin': 5.7.0_c25e8c1f4f4f7aaed27aa6f9ce042237 + '@typescript-eslint/parser': 5.7.0_eslint@7.32.0+typescript@4.5.4 + eslint: 7.32.0 + eslint-config-standard-with-typescript: 21.0.1_ce2fa0c4dfa1c256100cababd749a13a + eslint-plugin-import: 2.25.3_eslint@7.32.0 + eslint-plugin-node: 11.1.0_eslint@7.32.0 + eslint-plugin-promise: 5.2.0_eslint@7.32.0 + prettier: 2.5.1 + typescript: 4.5.4 + transitivePeerDependencies: + - supports-color + dev: false + + file:projects/server-notification.tgz: + resolution: {integrity: sha512-gM+ROlR5RxqwvyRbfKGpZzsd/41J8Qx+kub8xjs5nKB9KyJRB0QoWtTKwaUBiI1S/JNMfi/3rAFZOWlbcV3sbQ==, tarball: file:projects/server-notification.tgz} + name: '@rush-temp/server-notification' + version: 0.0.0 + dependencies: + '@rushstack/heft': 0.41.8 + '@types/heft-jest': 1.0.2 + '@types/node': 16.11.14 + '@typescript-eslint/eslint-plugin': 5.7.0_c25e8c1f4f4f7aaed27aa6f9ce042237 + '@typescript-eslint/parser': 5.7.0_eslint@7.32.0+typescript@4.5.4 + eslint: 7.32.0 + eslint-config-standard-with-typescript: 21.0.1_ce2fa0c4dfa1c256100cababd749a13a + eslint-plugin-import: 2.25.3_eslint@7.32.0 + eslint-plugin-node: 11.1.0_eslint@7.32.0 + eslint-plugin-promise: 5.2.0_eslint@7.32.0 + prettier: 2.5.1 + typescript: 4.5.4 + transitivePeerDependencies: + - supports-color + dev: false + file:projects/server-token.tgz: resolution: {integrity: sha512-74lvKW1J8vMQI7r+UUFCO8KDItftmBVTc9ecLL9kbWHdFT/kfR1ua57O8XG7MMJDmBVsWylHmM1kr6lxwNpNBA==, tarball: file:projects/server-token.tgz} name: '@rush-temp/server-token' @@ -13297,7 +13389,7 @@ packages: dev: false file:projects/server.tgz: - resolution: {integrity: sha512-b5qcL1erYSk29hFzWoJhG7GbtLdoTbEUHbScHKs7lLsQvftiiZmQRmuVcP8TVjiR3yTuMRJDt4ghH2d2UF9KIw==, tarball: file:projects/server.tgz} + resolution: {integrity: sha512-SuwXbo0xvalgyA3m9i/bbm9ae2I3Tx548KKj8wDffAJxDq0t0tqncuVtUmhrwG06HD9p5myf165I6apGZZocSg==, tarball: file:projects/server.tgz} name: '@rush-temp/server' version: 0.0.0 dependencies: @@ -13349,7 +13441,7 @@ packages: dev: false file:projects/setting-resources.tgz_096c09b0b673a57c275d9767a12070b1: - resolution: {integrity: sha512-64E4dI7SY+8qkmtk5dn8wbbxOSOqM+AD4Xh+i0BTv09Fhafe/TAcYLdByY5jzVkLmBohrYgBioZJcPbmulsvXg==, tarball: file:projects/setting-resources.tgz} + resolution: {integrity: sha512-SwFlNFhQYEi0au+47ljHLl/kE1MKP2Oi290r8xZJL4VMNUHzTsKiHlS7teyE7p1IdGar1AIUm2Xi3JveR5NFIA==, tarball: file:projects/setting-resources.tgz} id: file:projects/setting-resources.tgz name: '@rush-temp/setting-resources' version: 0.0.0 @@ -13579,7 +13671,7 @@ packages: dev: false file:projects/templates-resources.tgz_096c09b0b673a57c275d9767a12070b1: - resolution: {integrity: sha512-dsQP6LQ9+rxBOtUE2GXjmu7lhsQUAtP3ZWdzfo58ncdXao64Dn8w2nYrrUZ9dz7rcxwOPP3oHsrK7N2Egs1CMw==, tarball: file:projects/templates-resources.tgz} + resolution: {integrity: sha512-ms8wJBkOIYY64ptCGC6pQ6M+jQrKrVtJBLbDJNtp6Fxo+D1G8ksbg1S80hvpeZctOhUK14j3AkVt90IYgtgLbA==, tarball: file:projects/templates-resources.tgz} id: file:projects/templates-resources.tgz name: '@rush-temp/templates-resources' version: 0.0.0 @@ -13614,7 +13706,7 @@ packages: dev: false file:projects/templates.tgz: - resolution: {integrity: sha512-GRoSidgyl5TL1m7EI6J/XuUCM7aQ8zp5jH8yl8oDXPHG2rS2v+7pSz9ccBE/ynC0pUkxKL1oSgDRMq9eAXC4Ag==, tarball: file:projects/templates.tgz} + resolution: {integrity: sha512-Ho7HWi1cbb5DLF8usV/ihT2hq6QZrwJapJOipSCnAdFLg9bdK+s3QqeeBuhsieJ0lur1rYMIwOW89g0UVsKwNg==, tarball: file:projects/templates.tgz} name: '@rush-temp/templates' version: 0.0.0 dependencies: @@ -13739,7 +13831,7 @@ packages: dev: false file:projects/tool.tgz: - resolution: {integrity: sha512-tQSiv1J1yUul6SD2WNyzzSCJeS1VCZgWkun9xGIJELvQ+iZN6S4fznI35eMLBppJWD0XIYHmeOzNCfjX4PWw7g==, tarball: file:projects/tool.tgz} + resolution: {integrity: sha512-g3G79v0AQpHzqbZpmFsGU4wNu3BIcTMgR/Rod6Cfi9w0TpNS1XnSSckZeHB0LtTOovvFbj82x5ESBEwq1g0hFA==, tarball: file:projects/tool.tgz} name: '@rush-temp/tool' version: 0.0.0 dependencies: @@ -13914,7 +14006,7 @@ packages: dev: false file:projects/workbench-resources.tgz_096c09b0b673a57c275d9767a12070b1: - resolution: {integrity: sha512-yWHOAPBVj1y9VbkYHOaANIkCbBfQOkKKvxj2dEFK3It4WUN/jxZSPqrmW1/ZNkENZVaWzRL1VY6uGhJJ5dwgFQ==, tarball: file:projects/workbench-resources.tgz} + resolution: {integrity: sha512-zqDa0vWNFseFg/iea/NI651RzhI018W2GA8H5dC3O2CXTkwTCUPGNK00HzqTTxWTYTNZ0tQ+5EI7+n4bs+n56w==, tarball: file:projects/workbench-resources.tgz} id: file:projects/workbench-resources.tgz name: '@rush-temp/workbench-resources' version: 0.0.0 diff --git a/dev/prod/package.json b/dev/prod/package.json index 8194e38ffb..d535e65a2a 100644 --- a/dev/prod/package.json +++ b/dev/prod/package.json @@ -94,10 +94,13 @@ "@anticrm/server-attachment-resources": "~0.6.0", "@anticrm/server-contact": "~0.6.1", "@anticrm/server-contact-resources": "~0.6.0", + "@anticrm/server-notification": "~0.6.0", + "@anticrm/server-notification-resources": "~0.6.0", "@anticrm/templates": "~0.6.0", "@anticrm/templates-assets": "~0.6.0", "@anticrm/templates-resources": "~0.6.0", "@anticrm/notification": "~0.6.0", + "@anticrm/notification-assets": "~0.6.0", "@anticrm/notification-resources": "~0.6.0", "@anticrm/core": "~0.6.16", "@anticrm/rekoni": "~0.6.0" diff --git a/dev/prod/src/platform-dev.ts b/dev/prod/src/platform-dev.ts index 221a23fb35..d5dbc5df06 100644 --- a/dev/prod/src/platform-dev.ts +++ b/dev/prod/src/platform-dev.ts @@ -19,6 +19,7 @@ import login from '@anticrm/login' import { clientId } from '@anticrm/client' import { serverAttachmentId } from '@anticrm/server-attachment' import { serverContactId } from '@anticrm/server-contact' +import { serverNotificationId } from '@anticrm/server-notification' import { setMetadata } from '@anticrm/platform' @@ -33,6 +34,7 @@ export function configurePlatformDev() { addLocation(serverAttachmentId, () => import(/* webpackChunkName: "server-attachment" */ '@anticrm/server-attachment-resources')) addLocation(serverContactId, () => import(/* webpackChunkName: "server-contact" */ '@anticrm/server-contact-resources')) + addLocation(serverNotificationId, () => import(/* webpackChunkName: "server-notification" */ '@anticrm/server-notification-resources')) // Set devmodel to hook client to be able to present all activity enableDevModel() diff --git a/dev/prod/src/platform.ts b/dev/prod/src/platform.ts index 7a40946c79..a56ab5676e 100644 --- a/dev/prod/src/platform.ts +++ b/dev/prod/src/platform.ts @@ -51,6 +51,7 @@ import '@anticrm/gmail-assets' import '@anticrm/workbench-assets' import '@anticrm/inventory-assets' import '@anticrm/templates-assets' +import '@anticrm/notification-assets' import { setMetadata } from '@anticrm/platform' export async function configurePlatform() { diff --git a/dev/tool/package.json b/dev/tool/package.json index 1146e50146..14fa4685e4 100644 --- a/dev/tool/package.json +++ b/dev/tool/package.json @@ -73,6 +73,8 @@ "@anticrm/attachment": "~0.6.1", "@anticrm/server-contact": "~0.6.1", "@anticrm/server-contact-resources": "~0.6.0", + "@anticrm/server-notification": "~0.6.0", + "@anticrm/server-notification-resources": "~0.6.0", "@anticrm/server-tool": "~0.6.0" } } diff --git a/dev/tool/src/elastic.ts b/dev/tool/src/elastic.ts index e1d42f2b58..196f8eef8d 100644 --- a/dev/tool/src/elastic.ts +++ b/dev/tool/src/elastic.ts @@ -49,6 +49,7 @@ import { } from '@anticrm/server-core' import { serverAttachmentId } from '@anticrm/server-attachment' import { serverContactId } from '@anticrm/server-contact' +import { serverNotificationId } from '@anticrm/server-notification' import { Client as ElasticClient } from '@elastic/elasticsearch' import { Client } from 'minio' import { Db, MongoClient } from 'mongodb' @@ -104,6 +105,7 @@ export class ElasticTool { constructor (readonly mongoUrl: string, readonly dbName: string, readonly minio: Client, readonly elasticUrl: string) { addLocation(serverAttachmentId, () => import('@anticrm/server-attachment-resources')) addLocation(serverContactId, () => import('@anticrm/server-contact-resources')) + addLocation(serverNotificationId, () => import('@anticrm/server-notification-resources')) this.mongoClient = new MongoClient(mongoUrl) } diff --git a/models/all/package.json b/models/all/package.json index e27cd04726..44e69c9c20 100644 --- a/models/all/package.json +++ b/models/all/package.json @@ -45,6 +45,7 @@ "@anticrm/model-server-core": "~0.6.0", "@anticrm/model-server-attachment": "~0.6.0", "@anticrm/model-server-contact": "~0.6.0", + "@anticrm/model-server-notification": "~0.6.0", "@anticrm/model-activity": "~0.6.0", "@anticrm/model-attachment": "~0.6.0", "@anticrm/model-gmail": "~0.6.0", diff --git a/models/all/src/index.ts b/models/all/src/index.ts index a7df44babf..d4bbd8ef82 100644 --- a/models/all/src/index.ts +++ b/models/all/src/index.ts @@ -30,6 +30,7 @@ import { createModel as presentationModel } from '@anticrm/model-presentation' import { createModel as recruitModel } from '@anticrm/model-recruit' import { createModel as serverAttachmentModel } from '@anticrm/model-server-attachment' import { createModel as serverContactModel } from '@anticrm/model-server-contact' +import { createModel as serverNotificationModel } from '@anticrm/model-server-notification' import { createModel as serverCoreModel } from '@anticrm/model-server-core' import { createModel as settingModel } from '@anticrm/model-setting' import { createModel as taskModel } from '@anticrm/model-task' @@ -66,7 +67,7 @@ const builders = [ serverCoreModel, serverAttachmentModel, serverContactModel, - + serverNotificationModel, createDemo ] diff --git a/models/notification/package.json b/models/notification/package.json index 853d9012c7..c468986fb8 100644 --- a/models/notification/package.json +++ b/models/notification/package.json @@ -27,6 +27,7 @@ "dependencies": { "@anticrm/core": "~0.6.11", "@anticrm/model": "~0.6.0", + "@anticrm/ui": "~0.6.0", "@anticrm/platform": "~0.6.5", "@anticrm/model-core": "~0.6.0", "@anticrm/notification": "~0.6.0" diff --git a/models/notification/src/index.ts b/models/notification/src/index.ts index fa7c4cbf66..3395d42bb3 100644 --- a/models/notification/src/index.ts +++ b/models/notification/src/index.ts @@ -14,23 +14,33 @@ // limitations under the License. // -import type { Account, Domain, Ref, Timestamp } from '@anticrm/core' -import { Builder, Model, Prop, TypeRef, TypeTimestamp } from '@anticrm/model' +import type { Account, Doc, Domain, Ref, Timestamp, TxCUD } from '@anticrm/core' +import { Builder, Model, Prop, TypeRef, TypeString, TypeTimestamp } from '@anticrm/model' import core, { TAttachedDoc } from '@anticrm/model-core' -import notificaton, { LastView } from '@anticrm/notification' +import type { LastView, Notification, NotificationStatus } from '@anticrm/notification' +import notificaton from './plugin' import type { IntlString } from '@anticrm/platform' export const DOMAIN_NOTIFICATION = 'notification' as Domain @Model(notificaton.class.LastView, core.class.AttachedDoc, DOMAIN_NOTIFICATION) export class TLastView extends TAttachedDoc implements LastView { - @Prop(TypeTimestamp(), 'Last View' as IntlString) + @Prop(TypeTimestamp(), notificaton.string.LastView) lastView!: Timestamp @Prop(TypeRef(core.class.Account), 'Modified By' as IntlString) user!: Ref } -export function createModel (builder: Builder): void { - builder.createModel(TLastView) +@Model(notificaton.class.Notification, core.class.AttachedDoc, DOMAIN_NOTIFICATION) +export class TNotification extends TAttachedDoc implements Notification { + @Prop(TypeRef(core.class.Tx), 'TX' as IntlString) + tx!: Ref> + + @Prop(TypeString(), 'Status' as IntlString) + status!: NotificationStatus +} + +export function createModel (builder: Builder): void { + builder.createModel(TLastView, TNotification) } diff --git a/models/notification/src/plugin.ts b/models/notification/src/plugin.ts new file mode 100644 index 0000000000..4c88f4bbd1 --- /dev/null +++ b/models/notification/src/plugin.ts @@ -0,0 +1,25 @@ +// +// Copyright © 2020, 2021 Anticrm Platform Contributors. +// Copyright © 2021, 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 { IntlString, mergeIds } from '@anticrm/platform' +import notification, { notificationId } from '@anticrm/notification' +import {} from '@anticrm/ui' + +export default mergeIds(notificationId, notification, { + string: { + LastView: '' as IntlString + } +}) diff --git a/models/server-notification/.eslintrc.js b/models/server-notification/.eslintrc.js new file mode 100644 index 0000000000..c3c2c49417 --- /dev/null +++ b/models/server-notification/.eslintrc.js @@ -0,0 +1,7 @@ +module.exports = { + extends: ['./node_modules/@anticrm/model-rig/profiles/default/config/eslint.config.json'], + parserOptions: { + tsconfigRootDir: __dirname, + project: './tsconfig.json' + } +} diff --git a/plugins/notification-resources/.npmignore b/models/server-notification/.npmignore similarity index 100% rename from plugins/notification-resources/.npmignore rename to models/server-notification/.npmignore diff --git a/models/server-notification/config/rig.json b/models/server-notification/config/rig.json new file mode 100644 index 0000000000..e9a9ee9add --- /dev/null +++ b/models/server-notification/config/rig.json @@ -0,0 +1,18 @@ +// The "rig.json" file directs tools to look for their config files in an external package. +// Documentation for this system: https://www.npmjs.com/package/@rushstack/rig-package +{ + "$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json", + + /** + * (Required) The name of the rig package to inherit from. + * It should be an NPM package name with the "-rig" suffix. + */ + "rigPackageName": "@anticrm/model-rig" + + /** + * (Optional) Selects a config profile from the rig package. The name must consist of + * lowercase alphanumeric words separated by hyphens, for example "sample-profile". + * If omitted, then the "default" profile will be used." + */ + // "rigProfile": "your-profile-name" +} diff --git a/models/server-notification/package.json b/models/server-notification/package.json new file mode 100644 index 0000000000..90466c600e --- /dev/null +++ b/models/server-notification/package.json @@ -0,0 +1,34 @@ +{ + "name": "@anticrm/model-server-notification", + "version": "0.6.0", + "main": "lib/index.js", + "author": "Anticrm Platform Contributors", + "license": "EPL-2.0", + "scripts": { + "build": "heft build", + "build:watch": "tsc", + "lint:fix": "eslint --fix src", + "lint": "eslint src", + "format": "prettier --write src && eslint --fix src" + }, + "devDependencies": { + "@anticrm/model-rig": "~0.6.0", + "@typescript-eslint/eslint-plugin": "^5.4.0", + "eslint-plugin-import": "^2.25.3", + "eslint-plugin-promise": "^5.1.1", + "eslint-plugin-node": "^11.1.0", + "eslint": "^7.32.0", + "@types/heft-jest": "^1.0.2", + "@typescript-eslint/parser": "^5.4.0", + "eslint-config-standard-with-typescript": "^21.0.1", + "prettier": "^2.4.1", + "@rushstack/heft": "^0.41.1" + }, + "dependencies": { + "@anticrm/core": "~0.6.11", + "@anticrm/model": "~0.6.0", + "@anticrm/platform": "~0.6.5", + "@anticrm/server-notification": "~0.6.0", + "@anticrm/server-core": "~0.6.0" + } +} diff --git a/models/server-notification/src/index.ts b/models/server-notification/src/index.ts new file mode 100644 index 0000000000..aceab5c4ce --- /dev/null +++ b/models/server-notification/src/index.ts @@ -0,0 +1,27 @@ +// +// Copyright © 2020, 2021 Anticrm Platform Contributors. +// Copyright © 2021, 2022 Hardcore Engineering Inc. +// +// Licensed under the Eclipse Public License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. You may +// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import { Builder } from '@anticrm/model' + +import serverCore from '@anticrm/server-core' +import core from '@anticrm/core' +import serverNotification from '@anticrm/server-notification' + +export function createModel (builder: Builder): void { + builder.createDoc(serverCore.class.Trigger, core.space.Model, { + trigger: serverNotification.trigger.OnBacklinkCreate + }) +} diff --git a/models/server-notification/tsconfig.json b/models/server-notification/tsconfig.json new file mode 100644 index 0000000000..1d60db76b4 --- /dev/null +++ b/models/server-notification/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "./node_modules/@anticrm/model-rig/profiles/default/tsconfig.json", + + "compilerOptions": { + "rootDir": "./src", + "outDir": "./lib", + } +} \ No newline at end of file diff --git a/plugins/activity-resources/package.json b/plugins/activity-resources/package.json index 734815858a..c624af5b6e 100644 --- a/plugins/activity-resources/package.json +++ b/plugins/activity-resources/package.json @@ -40,7 +40,6 @@ "@anticrm/text-editor": "~0.6.0", "@anticrm/contact": "~0.6.2", "@anticrm/view": "~0.6.0", - "@anticrm/view-resources": "~0.6.0", - "@anticrm/chunter-resources": "~0.6.0" + "@anticrm/view-resources": "~0.6.0" } } diff --git a/plugins/activity-resources/src/activity.ts b/plugins/activity-resources/src/activity.ts index 3570c47cc7..2eae276ce8 100644 --- a/plugins/activity-resources/src/activity.ts +++ b/plugins/activity-resources/src/activity.ts @@ -88,9 +88,9 @@ class ActivityImpl implements Activity { private txes1: Array> = [] private txes2: Array> = [] constructor (readonly client: Client, attributes: Map) { - this.hiddenAttributes = new Set([...attributes.entries()] - .filter(([, value]) => value.hidden === true) - .map(([key]) => key)) + this.hiddenAttributes = new Set( + [...attributes.entries()].filter(([, value]) => value.hidden === true).map(([key]) => key) + ) this.txQuery1 = createQuery() this.txQuery2 = createQuery() } @@ -118,7 +118,9 @@ class ActivityImpl implements Activity { ? { 'tx.objectId': object._id as Ref } : { objectId: object._id, - _class: { $in: [core.class.TxCreateDoc, core.class.TxUpdateDoc, core.class.TxRemoveDoc, core.class.TxMixin] } + _class: { + $in: [core.class.TxCreateDoc, core.class.TxUpdateDoc, core.class.TxRemoveDoc, core.class.TxMixin] + } }, (result) => { this.txes1 = result @@ -230,7 +232,7 @@ class ActivityImpl implements Activity { collectionCUD = true } let firstTx = parents.get(tx.objectId) - const result: DisplayTx = this.newDisplayTx(tx) + const result: DisplayTx = newDisplayTx(tx, hierarchy) result.doc = firstTx?.doc ?? result.doc @@ -273,34 +275,19 @@ class ActivityImpl implements Activity { return false } - newDisplayTx (tx: TxCUD): DisplayTx { - const hierarchy = this.client.getHierarchy() - const createTx = hierarchy.isDerived(tx._class, core.class.TxCreateDoc) ? (tx as TxCreateDoc) : undefined - return { - tx, - txes: [], - createTx, - updateTx: hierarchy.isDerived(tx._class, core.class.TxUpdateDoc) ? (tx as TxUpdateDoc) : undefined, - updated: false, - removed: false, - mixin: false, - mixinTx: hierarchy.isDerived(tx._class, core.class.TxMixin) ? (tx as TxMixin) : undefined, - doc: createTx !== undefined ? TxProcessor.createDoc2Doc(createTx) : undefined - } - } - integrateTxWithResults (results: DisplayTx[], result: DisplayTx): DisplayTx[] { - const curUpdate: any = (result.tx._class === core.class.TxUpdateDoc) - ? (result.tx as unknown as TxUpdateDoc).operations - : (result.tx as unknown as TxMixin).attributes + const curUpdate: any = + result.tx._class === core.class.TxUpdateDoc + ? (result.tx as unknown as TxUpdateDoc).operations + : (result.tx as unknown as TxMixin).attributes const newResult = results.filter((prevTx) => { if (this.isSameKindTx(prevTx, result, result.tx._class)) { - const prevUpdate: any = (prevTx.tx._class === core.class.TxUpdateDoc) - ? (prevTx.tx as unknown as TxUpdateDoc).operations - : (prevTx.tx as unknown as TxMixin).attributes - if ( - result.tx.modifiedOn - prevTx.tx.modifiedOn < combineThreshold && isEqualOps(prevUpdate, curUpdate) ) { + const prevUpdate: any = + prevTx.tx._class === core.class.TxUpdateDoc + ? (prevTx.tx as unknown as TxUpdateDoc).operations + : (prevTx.tx as unknown as TxMixin).attributes + if (result.tx.modifiedOn - prevTx.tx.modifiedOn < combineThreshold && isEqualOps(prevUpdate, curUpdate)) { // we have same keys, // Remember previous transactions result.txes.push(...prevTx.txes, prevTx.tx) @@ -324,7 +311,22 @@ class ActivityImpl implements Activity { } } -function getCollectionTx (cltx: TxCollectionCUD): TxCUD { +export function newDisplayTx (tx: TxCUD, hierarchy: Hierarchy): DisplayTx { + const createTx = hierarchy.isDerived(tx._class, core.class.TxCreateDoc) ? (tx as TxCreateDoc) : undefined + return { + tx, + txes: [], + createTx, + updateTx: hierarchy.isDerived(tx._class, core.class.TxUpdateDoc) ? (tx as TxUpdateDoc) : undefined, + updated: false, + removed: false, + mixin: false, + mixinTx: hierarchy.isDerived(tx._class, core.class.TxMixin) ? (tx as TxMixin) : undefined, + doc: createTx !== undefined ? TxProcessor.createDoc2Doc(createTx) : undefined + } +} + +export function getCollectionTx (cltx: TxCollectionCUD): TxCUD { if (cltx.tx._class === core.class.TxCreateDoc) { // We need to update tx to contain attachedDoc, attachedClass & collection const create = cltx.tx as TxCreateDoc diff --git a/plugins/activity-resources/src/components/Activity.svelte b/plugins/activity-resources/src/components/Activity.svelte index f5acf96761..d02c6b0359 100644 --- a/plugins/activity-resources/src/components/Activity.svelte +++ b/plugins/activity-resources/src/components/Activity.svelte @@ -15,10 +15,10 @@ --> {#if fullSize || transparent} - {#if transparent !== undefined && !transparent} + {#if transparent !== undefined && !transparent}
@@ -64,14 +64,17 @@ {#if txes} {#each txes as tx (tx.tx._id)} - + {/each} {/if}
- +
{:else} @@ -98,7 +101,7 @@
- +
{/if} @@ -115,10 +118,18 @@ flex-shrink: 0; padding: 1.5rem 2.5rem; - &.fill { background-color: var(--theme-bg-accent-normal); } + &.fill { + background-color: var(--theme-bg-accent-normal); + } } - .p-activity { padding: 1.5rem 2.5rem 2.5rem; } - .scroller-back { background-color: var(--theme-bg-accent-normal); } - - :global(.grid .msgactivity-container:last-child::after) { content: none; } // Remove the line in the last Activity message + .p-activity { + padding: 1.5rem 2.5rem 2.5rem; + } + .scroller-back { + background-color: var(--theme-bg-accent-normal); + } + + :global(.grid .msgactivity-container:last-child::after) { + content: none; + } // Remove the line in the last Activity message diff --git a/plugins/activity-resources/src/components/TxView.svelte b/plugins/activity-resources/src/components/TxView.svelte index 66620170bc..a36afbaa5f 100644 --- a/plugins/activity-resources/src/components/TxView.svelte +++ b/plugins/activity-resources/src/components/TxView.svelte @@ -13,7 +13,6 @@ // See the License for the specific language governing permissions and // limitations under the License. --> - -{#if (viewlet !== undefined && !((viewlet?.hideOnRemove ?? false) && tx.removed)) || model.length > 0} -
-
- {#if viewlet} - - {:else} - {#if viewlet === undefined && model.length > 0} +{#if (viewlet !== undefined && !((viewlet?.hideOnRemove ?? false) && tx.removed)) || model.length > 0} +
+ {#if showIcon} +
+ {#if viewlet} + + {:else if viewlet === undefined && model.length > 0} {:else} {/if} - {/if} -
+
+ {/if}
-
@@ -141,7 +130,7 @@ {#if viewlet && viewlet?.editable}
{#if viewlet.label} -
{:else if viewlet && viewlet.label} -
+
{/if} - {#if viewlet === undefined && model.length > 0 && tx.updateTx} + {#if viewlet === undefined && model.length > 0 && tx.updateTx} {#each model as m, i} {#await getValue(client, m, tx.updateTx.operations) then value} - {#if value === null} - unset - {:else} - changed - {#if hasMessageType} -
- {/if} - {#if isMessageType(m.attribute)} -
- -
- {:else} -
- -
- {/if} + {#if value === null} + unset + {:else} + changed + {#if hasMessageType} +
{/if} - {/await} + {#if isMessageType(m.attribute)} +
+ +
+ {:else} +
+ +
+ {/if} + {/if} + {/await} {/each} {:else if viewlet === undefined && model.length > 0 && tx.mixinTx} {#each model as m} {#await getValue(client, m, tx.mixinTx.attributes) then value} - {#if value === null} - unset + {#if value === null} + unset + {:else} + changed + {#if isMessageType(m.attribute)} +
+ +
{:else} - changed - {#if isMessageType(m.attribute)} -
- -
- {:else} -
- -
- {/if} +
+ +
{/if} - {/await} + {/if} + {/await} {/each} {:else if viewlet && viewlet.display === 'inline' && viewlet.component} {#if typeof viewlet.component === 'string'} @@ -230,6 +222,9 @@ diff --git a/plugins/notification-resources/src/components/NotificationsPopup.svelte b/plugins/notification-resources/src/components/NotificationsPopup.svelte new file mode 100644 index 0000000000..42902d9270 --- /dev/null +++ b/plugins/notification-resources/src/components/NotificationsPopup.svelte @@ -0,0 +1,76 @@ + + + +