diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index f786c8b4cc..ecc099532c 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -56,6 +56,7 @@ specifiers: '@rush-temp/model-gmail': file:./projects/model-gmail.tgz '@rush-temp/model-inventory': file:./projects/model-inventory.tgz '@rush-temp/model-lead': file:./projects/model-lead.tgz + '@rush-temp/model-notification': file:./projects/model-notification.tgz '@rush-temp/model-presentation': file:./projects/model-presentation.tgz '@rush-temp/model-recruit': file:./projects/model-recruit.tgz '@rush-temp/model-rig': file:./projects/model-rig.tgz @@ -70,6 +71,8 @@ specifiers: '@rush-temp/model-view': file:./projects/model-view.tgz '@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-resources': file:./projects/notification-resources.tgz '@rush-temp/panel': file:./projects/panel.tgz '@rush-temp/platform': file:./projects/platform.tgz '@rush-temp/platform-rig': file:./projects/platform-rig.tgz @@ -251,6 +254,7 @@ dependencies: '@rush-temp/model-gmail': file:projects/model-gmail.tgz_typescript@4.5.4 '@rush-temp/model-inventory': file:projects/model-inventory.tgz_typescript@4.5.4 '@rush-temp/model-lead': file:projects/model-lead.tgz_typescript@4.5.4 + '@rush-temp/model-notification': file:projects/model-notification.tgz_typescript@4.5.4 '@rush-temp/model-presentation': file:projects/model-presentation.tgz_typescript@4.5.4 '@rush-temp/model-recruit': file:projects/model-recruit.tgz_typescript@4.5.4 '@rush-temp/model-rig': file:projects/model-rig.tgz_37f79b97d0d86442e45d380c86f520c5 @@ -265,6 +269,8 @@ dependencies: '@rush-temp/model-view': file:projects/model-view.tgz_typescript@4.5.4 '@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-resources': file:projects/notification-resources.tgz_ac194b5590200ebf8338e0f86ec190f4 '@rush-temp/panel': file:projects/panel.tgz_096c09b0b673a57c275d9767a12070b1 '@rush-temp/platform': file:projects/platform.tgz '@rush-temp/platform-rig': file:projects/platform-rig.tgz_37f79b97d0d86442e45d380c86f520c5 @@ -12094,7 +12100,7 @@ packages: dev: false file:projects/gmail-resources.tgz_096c09b0b673a57c275d9767a12070b1: - resolution: {integrity: sha512-zZWhkD/HZH3/ljH7WhD2IG9NhQ6b1JPTgG2Rc35pGwScC2uzyI8xT3cq4K/jbsYLZ3BXj31BYOno7Mqo6pFcZg==, tarball: file:projects/gmail-resources.tgz} + resolution: {integrity: sha512-C7jgVQmN2v6HBKZgVAzWPYRaWrRHhfWpIRIRUyBUmspQreX2ArmCFCjq+1CHYBh9lGcnBZGgaNN1zQ1aTzSFLA==, tarball: file:projects/gmail-resources.tgz} id: file:projects/gmail-resources.tgz name: '@rush-temp/gmail-resources' version: 0.0.0 @@ -12425,7 +12431,7 @@ packages: dev: false file:projects/model-all.tgz_typescript@4.5.4: - resolution: {integrity: sha512-KRaYm65Scg01RukljQmwVKLg143zgzLtjWBJQizBtdAU0X8XoHFnW6cOK1Pa3O15Et812fs3HhWWTUj32GJnoQ==, tarball: file:projects/model-all.tgz} + resolution: {integrity: sha512-Q1uN1ojy8Xc1Q2hsrrBqQrwdhkJgfGu90yb/mtHmDDb+WCguVe1JlPL9jbLV0f39wY5qnCzByDApK2FHftgVlA==, tarball: file:projects/model-all.tgz} id: file:projects/model-all.tgz name: '@rush-temp/model-all' version: 0.0.0 @@ -12617,6 +12623,27 @@ packages: - typescript dev: false + file:projects/model-notification.tgz_typescript@4.5.4: + resolution: {integrity: sha512-q/JNneErW66xgCE5Yc/7bPkeUXwiEUJw95gbYt5uDTeuuzK0TrP77epbfSaWqkH7kP9SjqKrBwWPdm+M64q98g==, tarball: file:projects/model-notification.tgz} + id: file:projects/model-notification.tgz + name: '@rush-temp/model-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-presentation.tgz_typescript@4.5.4: resolution: {integrity: sha512-cBkfqfxIgaViuDI4bj0NDuVg1NnzoSjL2mxvRRRn1Dnqkq+2K00cKyx67Pil9dHwH636h2HEYKoM4VNsT3Os1w==, tarball: file:projects/model-presentation.tgz} id: file:projects/model-presentation.tgz @@ -12931,6 +12958,59 @@ packages: - supports-color dev: false + file:projects/notification-resources.tgz_ac194b5590200ebf8338e0f86ec190f4: + resolution: {integrity: sha512-TgP/VzfwZ+LGqaToY+rKYjH683GBuSHetD9bM85Jg6mtCtU09uogF3mwqKCAU1gyKtiVYLA63VmAb8MkxwV56A==, tarball: file:projects/notification-resources.tgz} + id: file:projects/notification-resources.tgz + name: '@rush-temp/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 + svelte: 3.44.3 + svelte-check: 2.3.0_4374c622c67ed7479ff0e44c29d09bce + typescript: 4.5.4 + transitivePeerDependencies: + - '@babel/core' + - coffeescript + - less + - node-sass + - postcss + - postcss-load-config + - pug + - sass + - stylus + - sugarss + - supports-color + dev: false + + file:projects/notification.tgz: + resolution: {integrity: sha512-VOGvKSMA5Utp3zuIYzvaHujYwS2ObDBtjrzKJzWDn8RtQo8zW8nOYjEOIDDIvXKGZlpl/5v62pDsEBiCQ/yNhw==, tarball: file:projects/notification.tgz} + name: '@rush-temp/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 + typescript: 4.5.4 + transitivePeerDependencies: + - supports-color + dev: false + file:projects/panel.tgz_096c09b0b673a57c275d9767a12070b1: resolution: {integrity: sha512-RxiNEW/PUGlF6/JrOvYWaUVfmC4kVnrd1tUQBpUM9tcRQebTwjPIUF1+V19xT63Rer6sRmz4SWo9v6/BtRAJlw==, tarball: file:projects/panel.tgz} id: file:projects/panel.tgz @@ -13047,7 +13127,7 @@ packages: dev: false file:projects/presentation.tgz_096c09b0b673a57c275d9767a12070b1: - resolution: {integrity: sha512-QhfoHLyegkl3JsleXaZkSWsVQgikJM9jdqkla2mRW3kHyQAYWPBITUnVVWu1qBADViJupNZdYmYEcm7oeMF5og==, tarball: file:projects/presentation.tgz} + resolution: {integrity: sha512-jijMKCYTGrkmr9ShyFIPRnr3Uxyy8gyk8SDmwr9Wl4VevuSO9S/vHE0Pln+bEcKDtnzM/Vzh3GJmwUq3aPV3Aw==, tarball: file:projects/presentation.tgz} id: file:projects/presentation.tgz name: '@rush-temp/presentation' version: 0.0.0 @@ -13083,7 +13163,7 @@ packages: dev: false file:projects/prod.tgz_sass@1.45.0+typescript@4.5.4: - resolution: {integrity: sha512-mb0NOzQOQI/mZjzWLO+zp8F57x5koGPRF0qdrONOBHgKJ+wKpbSrVyW911S0nM8b/mVimVqaXCI2XdjAvYO1mg==, tarball: file:projects/prod.tgz} + resolution: {integrity: sha512-8jdkx/UlSEQLfZMUQ/XwQoqOiGAZtR6yJehJqk8TrjkUWKD4y0kroErjmQZ1sv014LnaWuux3mjbte+9b79I7w==, tarball: file:projects/prod.tgz} id: file:projects/prod.tgz name: '@rush-temp/prod' version: 0.0.0 @@ -13157,7 +13237,7 @@ packages: dev: false file:projects/recruit-resources.tgz_096c09b0b673a57c275d9767a12070b1: - resolution: {integrity: sha512-p9e/9INuzm1qqr+zo6pCU0XRtFlQPObX3USd3gRr4hSt/YnFOD5+flKwk4LMCPtLrubdFhTAPX+Ydu1cHJrnnQ==, tarball: file:projects/recruit-resources.tgz} + resolution: {integrity: sha512-NgcfcFmKVD0ojJbtjT3yvD//m1x3koZpBdkLryhSKtQMhzcuZD9GpBmVbRnPtLGBrDMSALasx1NB5JMxxDPLFQ==, tarball: file:projects/recruit-resources.tgz} id: file:projects/recruit-resources.tgz name: '@rush-temp/recruit-resources' version: 0.0.0 @@ -13611,7 +13691,7 @@ packages: dev: false file:projects/telegram-resources.tgz_096c09b0b673a57c275d9767a12070b1: - resolution: {integrity: sha512-ZneaA8uvCmjuSf+zjIrPM1lzhi1At5Giud4UOzKwz2o0lrC4+npRTtCIZ52ZKjjNoOTmgf/hr9RYrqwCMH+z4g==, tarball: file:projects/telegram-resources.tgz} + resolution: {integrity: sha512-hreZkJ3tRwh2rXC7K/WlkA99TDatMLuHwtC2dTXqivRNEKhwH0RHDXgO1jrjulj7uSNj5+0ksOeQtlWBYmhRiw==, tarball: file:projects/telegram-resources.tgz} id: file:projects/telegram-resources.tgz name: '@rush-temp/telegram-resources' version: 0.0.0 diff --git a/dev/prod/package.json b/dev/prod/package.json index 182dab0de6..0177d617b7 100644 --- a/dev/prod/package.json +++ b/dev/prod/package.json @@ -97,6 +97,8 @@ "@anticrm/templates": "~0.6.0", "@anticrm/templates-assets": "~0.6.0", "@anticrm/templates-resources": "~0.6.0", + "@anticrm/notification": "~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.ts b/dev/prod/src/platform.ts index 69290d2fa7..e3fb41130c 100644 --- a/dev/prod/src/platform.ts +++ b/dev/prod/src/platform.ts @@ -33,6 +33,7 @@ import { gmailId } from '@anticrm/gmail' import { imageCropperId } from '@anticrm/image-cropper' import { inventoryId } from '@anticrm/inventory' import { templatesId } from '@anticrm/templates' +import { notificationId } from '@anticrm/notification' import rekoni from '@anticrm/rekoni' import '@anticrm/login-assets' @@ -86,4 +87,6 @@ export async function configurePlatform() { addLocation(imageCropperId, () => import(/* webpackChunkName: "image-cropper" */ '@anticrm/image-cropper-resources')) addLocation(inventoryId, () => import(/* webpackChunkName: "inventory" */ '@anticrm/inventory-resources')) addLocation(templatesId, () => import(/* webpackChunkName: "templates" */ '@anticrm/templates-resources')) + addLocation(templatesId, () => import(/* webpackChunkName: "templates" */ '@anticrm/templates-resources')) + addLocation(notificationId, () => import(/* webpackChunkName: "notification" */ '@anticrm/notification-resources')) } diff --git a/models/all/package.json b/models/all/package.json index 4ab7301574..821644ab1f 100644 --- a/models/all/package.json +++ b/models/all/package.json @@ -50,6 +50,7 @@ "@anticrm/model-inventory": "~0.6.0", "@anticrm/model-presentation": "~0.6.0", "@anticrm/model-templates": "~0.6.0", + "@anticrm/model-notification": "~0.6.0", "@anticrm/model-text-editor": "~0.6.0", "@anticrm/core": "~0.6.13" } diff --git a/models/all/src/index.ts b/models/all/src/index.ts index d0b41cc8b9..9d7d1277b6 100644 --- a/models/all/src/index.ts +++ b/models/all/src/index.ts @@ -36,6 +36,7 @@ import { createModel as templatesModel } from '@anticrm/model-templates' import { createModel as textEditorModel } from '@anticrm/model-text-editor' import { createModel as viewModel } from '@anticrm/model-view' import { createModel as workbenchModel } from '@anticrm/model-workbench' +import { createModel as notificationModel } from '@anticrm/model-notification' const builder = new Builder() @@ -57,7 +58,7 @@ const builders = [ presentationModel, templatesModel, textEditorModel, - + notificationModel, serverCoreModel, serverAttachmentModel, serverContactModel, diff --git a/models/contact/src/index.ts b/models/contact/src/index.ts index 238c1fc719..a3bac20d88 100644 --- a/models/contact/src/index.ts +++ b/models/contact/src/index.ts @@ -70,6 +70,8 @@ export class TChannel extends TAttachedDoc implements Channel { @Prop(TypeString(), 'Value' as IntlString) value!: string + + items?: number } @Model(contact.class.Person, contact.class.Contact) diff --git a/models/notification/.eslintrc.js b/models/notification/.eslintrc.js new file mode 100644 index 0000000000..c3c2c49417 --- /dev/null +++ b/models/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/models/notification/.npmignore b/models/notification/.npmignore new file mode 100644 index 0000000000..e3ec093c38 --- /dev/null +++ b/models/notification/.npmignore @@ -0,0 +1,4 @@ +* +!/lib/** +!CHANGELOG.md +/lib/**/__tests__/ diff --git a/models/notification/config/rig.json b/models/notification/config/rig.json new file mode 100644 index 0000000000..e9a9ee9add --- /dev/null +++ b/models/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/notification/package.json b/models/notification/package.json new file mode 100644 index 0000000000..853d9012c7 --- /dev/null +++ b/models/notification/package.json @@ -0,0 +1,34 @@ +{ + "name": "@anticrm/model-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/model-core": "~0.6.0", + "@anticrm/notification": "~0.6.0" + } +} diff --git a/models/notification/src/index.ts b/models/notification/src/index.ts new file mode 100644 index 0000000000..fa7c4cbf66 --- /dev/null +++ b/models/notification/src/index.ts @@ -0,0 +1,36 @@ +// +// 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 type { Account, Domain, Ref, Timestamp } from '@anticrm/core' +import { Builder, Model, Prop, TypeRef, TypeTimestamp } from '@anticrm/model' +import core, { TAttachedDoc } from '@anticrm/model-core' +import notificaton, { LastView } from '@anticrm/notification' +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) + lastView!: Timestamp + + @Prop(TypeRef(core.class.Account), 'Modified By' as IntlString) + user!: Ref +} + +export function createModel (builder: Builder): void { + builder.createModel(TLastView) +} diff --git a/models/notification/tsconfig.json b/models/notification/tsconfig.json new file mode 100644 index 0000000000..1d60db76b4 --- /dev/null +++ b/models/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/packages/core/src/component.ts b/packages/core/src/component.ts index 1da7a345e3..1cc7fd2e1f 100644 --- a/packages/core/src/component.ts +++ b/packages/core/src/component.ts @@ -55,6 +55,7 @@ export default plugin(coreId, { }, space: { Tx: '' as Ref, + DerivedTx: '' as Ref, Model: '' as Ref }, account: { diff --git a/packages/presentation/src/index.ts b/packages/presentation/src/index.ts index 62527f59ca..fb7628e389 100644 --- a/packages/presentation/src/index.ts +++ b/packages/presentation/src/index.ts @@ -30,7 +30,6 @@ export { default as AttributesBar } from './components/AttributesBar.svelte' export { default as AttributeBarEditor } from './components/AttributeBarEditor.svelte' export { default as AttributeEditor } from './components/AttributeEditor.svelte' export { default as Card } from './components/Card.svelte' -export { default as Channels } from './components/Channels.svelte' export { default as PDFViewer } from './components/PDFViewer.svelte' export { default as MessageBox } from './components/MessageBox.svelte' export { default as SpaceCreateCard } from './components/SpaceCreateCard.svelte' diff --git a/packages/presentation/src/utils.ts b/packages/presentation/src/utils.ts index 83184e5322..0c43df9336 100644 --- a/packages/presentation/src/utils.ts +++ b/packages/presentation/src/utils.ts @@ -22,11 +22,9 @@ import login from '@anticrm/login' import { getMetadata } from '@anticrm/platform' import { LiveQuery as LQ } from '@anticrm/query' import { onDestroy } from 'svelte' -import contact, { ChannelProvider } from '@anticrm/contact' let liveQuery: LQ let client: TxOperations -let channelProviders: Promise | undefined class UIClient extends TxOperations implements Client { constructor (client: Client, private readonly liveQuery: LQ) { @@ -49,7 +47,6 @@ export function setClient (_client: Client): void { _client.notify = (tx: Tx) => { liveQuery.tx(tx).catch((err) => console.log(err)) } - channelProviders = client.findAll(contact.class.ChannelProvider, {}) } export class LiveQuery { @@ -113,12 +110,3 @@ export function getAttributePresenterClass (attribute: AnyAttribute): Ref, ChannelProvider>> { - const cp = (await channelProviders) ?? [] - const map = new Map, ChannelProvider>() - for (const provider of cp) { - map.set(provider._id, provider) - } - return map -} diff --git a/packages/ui/src/components/PanelInstance.svelte b/packages/ui/src/components/PanelInstance.svelte index e5df4fd559..c6b8913806 100644 --- a/packages/ui/src/components/PanelInstance.svelte +++ b/packages/ui/src/components/PanelInstance.svelte @@ -116,6 +116,7 @@ bind:this={componentInstance} _id={props._id} _class={props._class} + rightSection={props.rightSection} on:update={fitPopup} on:close={_close} /> diff --git a/packages/ui/src/panelup.ts b/packages/ui/src/panelup.ts index 3872dd3a8a..1c6aac05d1 100644 --- a/packages/ui/src/panelup.ts +++ b/packages/ui/src/panelup.ts @@ -7,6 +7,7 @@ export interface PanelProps { _id: string _class: string element?: PopupAlignment + rightSection?: AnyComponent } export const panelstore = writable < {panel?: PanelProps|undefined}>({ panel: undefined }) @@ -23,7 +24,8 @@ export function showPanel ( component: AnyComponent, _id: string, _class: string, - element?: PopupAlignment + element?: PopupAlignment, + rightSection?: AnyComponent ): void { const newLoc = encodeURIComponent([component, _id, _class].join('|')) if (currentLocation === newLoc) { @@ -31,7 +33,7 @@ export function showPanel ( } currentLocation = newLoc panelstore.update(() => { - return { panel: { component, _id, _class, element } } + return { panel: { component, _id, _class, element, rightSection } } }) const location = getCurrentLocation() if (location.fragment !== currentLocation) { diff --git a/plugins/chunter-resources/package.json b/plugins/chunter-resources/package.json index ef973cc104..da99cc47db 100644 --- a/plugins/chunter-resources/package.json +++ b/plugins/chunter-resources/package.json @@ -39,6 +39,7 @@ "svelte": "^3.37.0", "@anticrm/text-editor": "~0.6.0", "@anticrm/contact": "~0.6.2", + "@anticrm/contact-resources": "~0.6.0", "@anticrm/view-resources": "~0.6.0", "@anticrm/view": "~0.6.0" } diff --git a/plugins/contact-resources/package.json b/plugins/contact-resources/package.json index 963e6a49ba..83e6da34dc 100644 --- a/plugins/contact-resources/package.json +++ b/plugins/contact-resources/package.json @@ -40,6 +40,7 @@ "@anticrm/core": "~0.6.11", "@anticrm/view": "~0.6.0", "@anticrm/attachment-resources": "~0.6.0", + "@anticrm/notification-resources": "~0.6.0", "@anticrm/panel": "~0.6.0", "@anticrm/view-resources": "~0.6.0", "@anticrm/attachment": "~0.6.1" diff --git a/plugins/contact-resources/src/components/Channels.svelte b/plugins/contact-resources/src/components/Channels.svelte index 14365d4832..9939a5691a 100644 --- a/plugins/contact-resources/src/components/Channels.svelte +++ b/plugins/contact-resources/src/components/Channels.svelte @@ -16,9 +16,10 @@ - { save(e.detail) }} on:click /> + { + save(e.detail) + }} + on:click +/> diff --git a/packages/presentation/src/components/ChannelsPopup.svelte b/plugins/contact-resources/src/components/ChannelsPopup.svelte similarity index 100% rename from packages/presentation/src/components/ChannelsPopup.svelte rename to plugins/contact-resources/src/components/ChannelsPopup.svelte diff --git a/plugins/contact-resources/src/components/ChannelsPresenter.svelte b/plugins/contact-resources/src/components/ChannelsPresenter.svelte index 28ba5d0df0..2ba7b234ed 100644 --- a/plugins/contact-resources/src/components/ChannelsPresenter.svelte +++ b/plugins/contact-resources/src/components/ChannelsPresenter.svelte @@ -15,9 +15,26 @@ --> - + diff --git a/packages/presentation/src/components/Channels.svelte b/plugins/contact-resources/src/components/ChannelsView.svelte similarity index 68% rename from packages/presentation/src/components/Channels.svelte rename to plugins/contact-resources/src/components/ChannelsView.svelte index 57c0dd3428..ee1686a6bc 100644 --- a/packages/presentation/src/components/Channels.svelte +++ b/plugins/contact-resources/src/components/ChannelsView.svelte @@ -15,19 +15,21 @@ --> diff --git a/packages/presentation/src/components/icons/Copy.svelte b/plugins/contact-resources/src/components/icons/Copy.svelte similarity index 100% rename from packages/presentation/src/components/icons/Copy.svelte rename to plugins/contact-resources/src/components/icons/Copy.svelte diff --git a/plugins/contact-resources/src/index.ts b/plugins/contact-resources/src/index.ts index 9be0306ed4..c02125f38b 100644 --- a/plugins/contact-resources/src/index.ts +++ b/plugins/contact-resources/src/index.ts @@ -21,6 +21,7 @@ import { Avatar, ObjectSearchResult, UserInfo } from '@anticrm/presentation' import ChannelsEditor from './components/ChannelsEditor.svelte' import Channels from './components/Channels.svelte' import ChannelsPresenter from './components/ChannelsPresenter.svelte' +import ChannelsView from './components/ChannelsView.svelte' import ContactPresenter from './components/ContactPresenter.svelte' import Contacts from './components/Contacts.svelte' import CreateOrganization from './components/CreateOrganization.svelte' @@ -34,7 +35,7 @@ import PersonPresenter from './components/PersonPresenter.svelte' import SocialEditor from './components/SocialEditor.svelte' import contact from './plugin' -export { Channels, ChannelsEditor, ContactPresenter } +export { Channels, ChannelsEditor, ContactPresenter, ChannelsView } async function queryContact (_class: Ref>, client: Client, search: string): Promise { return (await client.findAll(_class, { name: { $like: `%${search}%` } }, { limit: 200 })).map(e => ({ diff --git a/plugins/contact-resources/src/utils.ts b/plugins/contact-resources/src/utils.ts new file mode 100644 index 0000000000..98e3d4b17d --- /dev/null +++ b/plugins/contact-resources/src/utils.ts @@ -0,0 +1,33 @@ +// +// Copyright © 2020, 2021 Anticrm Platform Contributors. +// Copyright © 2021 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 contact, { ChannelProvider } from '@anticrm/contact' +import { Ref } from '@anticrm/core' +import { getClient } from '@anticrm/presentation' + +let channelProviders: Promise | undefined + +const client = getClient() +channelProviders = client.findAll(contact.class.ChannelProvider, {}) + +export async function getChannelProviders (): Promise, ChannelProvider>> { + const cp = (await channelProviders) ?? [] + const map = new Map, ChannelProvider>() + for (const provider of cp) { + map.set(provider._id, provider) + } + return map +} diff --git a/plugins/contact/src/index.ts b/plugins/contact/src/index.ts index e9fe6068fc..c94d20741c 100644 --- a/plugins/contact/src/index.ts +++ b/plugins/contact/src/index.ts @@ -43,6 +43,7 @@ export interface ChannelProvider extends Doc, UXObject { export interface Channel extends AttachedDoc { provider: Ref value: string + items?: number } /** diff --git a/plugins/gmail-resources/package.json b/plugins/gmail-resources/package.json index 54024f4cca..bc84449cba 100644 --- a/plugins/gmail-resources/package.json +++ b/plugins/gmail-resources/package.json @@ -41,6 +41,7 @@ "@anticrm/setting": "~0.6.0", "@anticrm/chunter": "~0.6.0", "@anticrm/chunter-resources": "~0.6.0", + "@anticrm/notification-resources": "~0.6.0", "@anticrm/login": "~0.6.1", "@anticrm/core": "~0.6.11" } diff --git a/plugins/gmail-resources/src/components/Chats.svelte b/plugins/gmail-resources/src/components/Chats.svelte index f91dbdddf4..14e427eb26 100644 --- a/plugins/gmail-resources/src/components/Chats.svelte +++ b/plugins/gmail-resources/src/components/Chats.svelte @@ -13,7 +13,6 @@ // See the License for the specific language governing permissions and // limitations under the License. --> - -
+