mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-23 03:22:19 +03:00
Fix Devmodel plugin Live Query functionality (#441)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
0f81991480
commit
8765cba7e6
@ -38,7 +38,6 @@ class ServerStorageWrapper implements Storage {
|
||||
|
||||
class NullFullTextAdapter implements FullTextAdapter {
|
||||
async index (doc: IndexedDoc): Promise<TxResult> {
|
||||
console.log('noop full text indexer: ', doc)
|
||||
return {}
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,6 @@ import { serverChunterId } from '@anticrm/server-chunter'
|
||||
|
||||
class NullFullTextAdapter implements FullTextAdapter {
|
||||
async index (doc: IndexedDoc): Promise<TxResult> {
|
||||
console.log('noop full text indexer: ', doc)
|
||||
return {}
|
||||
}
|
||||
|
||||
|
@ -20,12 +20,13 @@
|
||||
import { toIntl } from '..'
|
||||
import ContentPopup from './ContentPopup.svelte'
|
||||
|
||||
let txes: TxCUD<Doc>[] = []
|
||||
let txes: (TxCUD<Doc> & {index:number})[] = []
|
||||
|
||||
const activityQuery = createQuery()
|
||||
|
||||
$: activityQuery.query(core.class.TxCUD, { objectSpace: core.space.Model }, (result) => {
|
||||
txes = result
|
||||
let c = 0
|
||||
txes = result.map(t => ({ ...t, index: c++ }))
|
||||
})
|
||||
</script>
|
||||
|
||||
@ -42,6 +43,7 @@ import { toIntl } from '..'
|
||||
<tbody>
|
||||
{#each txes as tx}
|
||||
<tr class='tr-body'>
|
||||
<td>{tx.index}</td>
|
||||
<td>{tx.objectId}</td>
|
||||
<td>{tx.objectClass}</td>
|
||||
<td>
|
||||
|
@ -41,12 +41,14 @@ export const queries: QueryWithResult[] = []
|
||||
|
||||
class ModelClient implements Client {
|
||||
constructor (readonly client: Client) {
|
||||
}
|
||||
|
||||
notify (tx: Tx): void {
|
||||
this.client.notify?.(tx)
|
||||
client.notify = (tx) => {
|
||||
this.notify?.(tx)
|
||||
console.info('devmodel# notify=>', tx, this.client.getModel())
|
||||
notifications.push(tx)
|
||||
}
|
||||
}
|
||||
|
||||
notify?: (tx: Tx) => void
|
||||
|
||||
getHierarchy (): Hierarchy {
|
||||
return this.client.getHierarchy()
|
||||
|
Loading…
Reference in New Issue
Block a user