mirror of
https://github.com/hcengineering/platform.git
synced 2025-01-23 20:13:20 +00:00
Filter old email activity (#2983)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
parent
99b6634cdd
commit
7c1a31c095
@ -14,10 +14,10 @@
|
||||
-->
|
||||
<script lang="ts">
|
||||
import { DisplayTx } from '@hcengineering/activity'
|
||||
import core, { AttachedDoc, Doc, TxCUD, TxCollectionCUD, TxProcessor } from '@hcengineering/core'
|
||||
import core, { AttachedDoc, Doc, TxCUD, TxCollectionCUD, TxCreateDoc, TxProcessor } from '@hcengineering/core'
|
||||
import { createQuery, getClient } from '@hcengineering/presentation'
|
||||
import contact from '../../plugin'
|
||||
import { Channel, Contact } from '@hcengineering/contact'
|
||||
import { Channel, ChannelItem, Contact } from '@hcengineering/contact'
|
||||
import { newDisplayTx } from '@hcengineering/activity-resources'
|
||||
import { createEventDispatcher } from 'svelte'
|
||||
|
||||
@ -46,7 +46,7 @@
|
||||
let newTxes: DisplayTx[] = []
|
||||
|
||||
const txQuery = createQuery()
|
||||
$: txQuery.query(
|
||||
$: txQuery.query<TxCollectionCUD<Channel, ChannelItem>>(
|
||||
core.class.TxCollectionCUD,
|
||||
{
|
||||
objectId: { $in: channels.map((p) => p._id) },
|
||||
@ -54,7 +54,8 @@
|
||||
'tx.attributes.incoming': false
|
||||
},
|
||||
(res) => {
|
||||
newTxes = createDisplayTxes(res)
|
||||
const filtered = res.filter((p) => (p.tx as TxCreateDoc<ChannelItem>).attributes.sendOn >= object.createOn)
|
||||
newTxes = createDisplayTxes(filtered)
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -58,6 +58,17 @@ export interface Channel extends AttachedDoc {
|
||||
lastMessage?: Timestamp
|
||||
}
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export interface ChannelItem extends AttachedDoc {
|
||||
attachedTo: Ref<Channel>
|
||||
attachedToClass: Ref<Class<Channel>>
|
||||
incoming: boolean
|
||||
sendOn: Timestamp
|
||||
attachments?: number
|
||||
}
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
|
@ -13,7 +13,7 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import { Channel } from '@hcengineering/contact'
|
||||
import { ChannelItem } from '@hcengineering/contact'
|
||||
import type { Account, AttachedDoc, Class, Doc, Ref, Space, Timestamp } from '@hcengineering/core'
|
||||
import type { Plugin } from '@hcengineering/platform'
|
||||
import { Metadata, plugin } from '@hcengineering/platform'
|
||||
@ -23,14 +23,10 @@ import type { AnyComponent } from '@hcengineering/ui'
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export interface Message extends BaseMessage, AttachedDoc {
|
||||
attachedTo: Ref<Channel>
|
||||
attachedToClass: Ref<Class<Channel>>
|
||||
export interface Message extends BaseMessage, ChannelItem {
|
||||
messageId: string
|
||||
from: string
|
||||
textContent: string
|
||||
incoming: boolean
|
||||
sendOn: Timestamp
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -13,13 +13,13 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import { Metadata, plugin } from '@hcengineering/platform'
|
||||
import { ChannelItem } from '@hcengineering/contact'
|
||||
import type { AttachedDoc, Class, Doc, Ref, Space, Timestamp } from '@hcengineering/core'
|
||||
import type { Plugin } from '@hcengineering/platform'
|
||||
import type { Doc, Ref, Class, Space, AttachedDoc, Timestamp } from '@hcengineering/core'
|
||||
import type { AnyComponent } from '@hcengineering/ui'
|
||||
import type { IntegrationType, Handler } from '@hcengineering/setting'
|
||||
import { Channel } from '@hcengineering/contact'
|
||||
import { Metadata, plugin } from '@hcengineering/platform'
|
||||
import type { Handler, IntegrationType } from '@hcengineering/setting'
|
||||
import { TemplateField } from '@hcengineering/templates'
|
||||
import type { AnyComponent } from '@hcengineering/ui'
|
||||
|
||||
/**
|
||||
* @public
|
||||
@ -32,14 +32,7 @@ export interface BaseTelegramMessage extends Doc {
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export interface TelegramMessage extends BaseTelegramMessage, AttachedDoc {
|
||||
attachedTo: Ref<Channel>
|
||||
attachedToClass: Ref<Class<Channel>>
|
||||
|
||||
incoming: boolean
|
||||
|
||||
sendOn: Timestamp
|
||||
}
|
||||
export interface TelegramMessage extends BaseTelegramMessage, ChannelItem {}
|
||||
|
||||
/**
|
||||
* @public
|
||||
|
Loading…
Reference in New Issue
Block a user