diff --git a/models/activity/src/index.ts b/models/activity/src/index.ts index b58ff74121..02e43a406d 100644 --- a/models/activity/src/index.ts +++ b/models/activity/src/index.ts @@ -13,11 +13,11 @@ // limitations under the License. // -import type { ActivityFilter, DisplayTx, TxViewlet } from '@hcengineering/activity' +import type { ActivityFilter, DisplayTx, ExtraActivityComponent, TxViewlet } from '@hcengineering/activity' import activity from './plugin' import core, { Class, Doc, DocumentQuery, DOMAIN_MODEL, Ref, Tx } from '@hcengineering/core' -import { Builder, Model } from '@hcengineering/model' -import { TDoc } from '@hcengineering/model-core' +import { Builder, Mixin, Model } from '@hcengineering/model' +import { TClass, TDoc } from '@hcengineering/model-core' import type { Asset, IntlString, Resource } from '@hcengineering/platform' import { AnyComponent } from '@hcengineering/ui' @@ -42,8 +42,13 @@ export class TActivityFilter extends TDoc implements ActivityFilter { filter!: Resource<(tx: DisplayTx, _class?: Ref) => boolean> } +@Mixin(activity.mixin.ExtraActivityComponent, core.class.Class) +export class TExtraActivityComponent extends TClass implements ExtraActivityComponent { + component!: AnyComponent +} + export function createModel (builder: Builder): void { - builder.createModel(TTxViewlet, TActivityFilter) + builder.createModel(TTxViewlet, TActivityFilter, TExtraActivityComponent) builder.createDoc(activity.class.ActivityFilter, core.space.Model, { label: activity.string.Attributes, diff --git a/models/contact/package.json b/models/contact/package.json index 049b087ea1..339b2a76a3 100644 --- a/models/contact/package.json +++ b/models/contact/package.json @@ -36,6 +36,7 @@ "@hcengineering/core": "^0.6.21", "@hcengineering/ui": "^0.6.3", "@hcengineering/platform": "^0.6.8", + "@hcengineering/activity": "^0.6.0", "@hcengineering/contact": "^0.6.11", "@hcengineering/notification": "^0.6.8", "@hcengineering/contact-resources": "^0.6.0", diff --git a/models/contact/src/index.ts b/models/contact/src/index.ts index 5348e1b5cd..453b8e8d9f 100644 --- a/models/contact/src/index.ts +++ b/models/contact/src/index.ts @@ -31,6 +31,7 @@ import { Status, ContactsTab } from '@hcengineering/contact' +import activity from '@hcengineering/activity' import { Class, DateRangeMode, Domain, DOMAIN_MODEL, IndexKind, Ref, Timestamp } from '@hcengineering/core' import { Builder, @@ -722,6 +723,10 @@ export function createModel (builder: Builder): void { }, contact.templateField.ContactLastName ) + + builder.mixin(contact.class.Contact, core.class.Class, activity.mixin.ExtraActivityComponent, { + component: contact.component.ActivityChannelMessage + }) } export { contactOperation } from './migration' diff --git a/models/contact/src/plugin.ts b/models/contact/src/plugin.ts index 652ab40754..a7bb1c8789 100644 --- a/models/contact/src/plugin.ts +++ b/models/contact/src/plugin.ts @@ -49,7 +49,8 @@ export default mergeIds(contactId, contact, { CreateEmployee: '' as AnyComponent, AccountArrayEditor: '' as AnyComponent, ChannelFilter: '' as AnyComponent, - MergeEmployee: '' as AnyComponent + MergeEmployee: '' as AnyComponent, + ActivityChannelMessage: '' as AnyComponent }, string: { Persons: '' as IntlString, diff --git a/models/gmail/src/index.ts b/models/gmail/src/index.ts index a0288f8714..639bbe6e23 100644 --- a/models/gmail/src/index.ts +++ b/models/gmail/src/index.ts @@ -150,12 +150,26 @@ export function createModel (builder: Builder): void { gmail.integrationType.Gmail ) + builder.createDoc( + activity.class.TxViewlet, + core.space.Model, + { + objectClass: gmail.class.Message, + icon: contact.icon.Email, + txClass: core.class.TxCreateDoc, + label: gmail.string.HaveWrittenEmail, + labelComponent: gmail.activity.TxWriteMessage, + display: 'inline' + }, + gmail.ids.TxSharedCreate + ) + builder.createDoc( activity.class.TxViewlet, core.space.Model, { objectClass: gmail.class.SharedMessages, - icon: contact.icon.Telegram, + icon: contact.icon.Email, txClass: core.class.TxCreateDoc, component: gmail.activity.TxSharedCreate, label: gmail.string.SharedMessages, diff --git a/models/gmail/src/plugin.ts b/models/gmail/src/plugin.ts index f912af75c8..08e1458a76 100644 --- a/models/gmail/src/plugin.ts +++ b/models/gmail/src/plugin.ts @@ -36,7 +36,6 @@ export default mergeIds(gmailId, gmail, { Message: '' as IntlString, Messages: '' as IntlString, Incoming: '' as IntlString, - Email: '' as IntlString, Status: '' as IntlString, EmailPlaceholder: '' as IntlString }, @@ -44,7 +43,8 @@ export default mergeIds(gmailId, gmail, { TxSharedCreate: '' as Ref }, activity: { - TxSharedCreate: '' as AnyComponent + TxSharedCreate: '' as AnyComponent, + TxWriteMessage: '' as AnyComponent }, function: { HasEmail: '' as Resource<(doc?: Doc | Doc[] | undefined) => Promise> diff --git a/packages/panel/src/components/Panel.svelte b/packages/panel/src/components/Panel.svelte index 492e1ad618..69993bae6a 100644 --- a/packages/panel/src/components/Panel.svelte +++ b/packages/panel/src/components/Panel.svelte @@ -139,28 +139,20 @@
- {#if withoutActivity} - {#if $deviceInfo.isMobile} -
- -
- {:else} -
- -
- {/if} - {:else if $deviceInfo.isMobile} + {#if $deviceInfo.isMobile}
- - - + + {#if !withoutActivity} + + {/if}
{:else}
- - - + + {#if !withoutActivity} + + {/if}
{/if} diff --git a/plugins/activity-resources/src/activity.ts b/plugins/activity-resources/src/activity.ts index be38894017..e2e0fe6b48 100644 --- a/plugins/activity-resources/src/activity.ts +++ b/plugins/activity-resources/src/activity.ts @@ -1,3 +1,4 @@ +import { DisplayTx } from '@hcengineering/activity' import core, { AnyAttribute, AttachedDoc, @@ -43,37 +44,6 @@ function isEqualOps (op1: any, op2: any): boolean { return o1 === o2 } -/** - * Transaction being displayed. - * @public - */ -export interface DisplayTx { - // Source tx - tx: TxCUD - - // A set of collapsed transactions. - txes: DisplayTx[] - txDocIds?: Set> - - // type check for createTx - createTx?: TxCreateDoc - - // Type check for updateTx - updateTx?: TxUpdateDoc - - // Type check for updateTx - mixinTx?: TxMixin - - // Document in case it is required. - doc?: Doc - - updated: boolean - mixin: boolean - removed: boolean - - collectionAttribute?: Attribute> -} - /** * @public */ diff --git a/plugins/activity-resources/src/components/Activity.svelte b/plugins/activity-resources/src/components/Activity.svelte index 5a7126f389..59d2d68ce0 100644 --- a/plugins/activity-resources/src/components/Activity.svelte +++ b/plugins/activity-resources/src/components/Activity.svelte @@ -13,35 +13,20 @@ // limitations under the License. --> -{#if !integrate || transparent} - - {#if transparent !== undefined && !transparent} -
-
-
- - -
-
- {/if} -
- -
- {#if filtered} - - {#each filtered as tx, i} - = i && newTxPos !== -1} - isNextNew={newTxPos > i && newTxPos !== -1} - /> - {/each} - - {/if} -
-
- {#if showCommenInput} -
- +
+ +
-{:else} - - - -
- - - {#if selectedFilter === 'All'} -
-
- {:else} - {#each labels as label} -
-
+ + (filtered = e.detail)} /> +
+
+ {#if filtered} + + {#each filtered as tx, i} + = i && newTxPos !== -1} isNextNew={newTxPos > i && newTxPos !== -1} /> {/each} - {/if} -
- -
-
- {#if filtered} - - {#each filtered as tx, i} - = i && newTxPos !== -1} - isNextNew={newTxPos > i && newTxPos !== -1} - /> - {/each} - - {/if} -
- {#if showCommenInput} -
- -
+
{/if} +
+{#if showCommenInput} +
+ +
{/if}