From 04da45b6662d5b6149aaf8cc744d7d5876c9e1a1 Mon Sep 17 00:00:00 2001 From: Andrey Sobolev Date: Tue, 30 May 2023 01:16:33 +0700 Subject: [PATCH] UBER-279: Total qfix Signed-off-by: Andrey Sobolev --- packages/query/src/index.ts | 13 +++- .../src/components/Schedule.svelte | 29 ++++---- .../src/components/ScheduleView.svelte | 68 ++++++++++--------- plugins/hr-resources/src/utils.ts | 13 ++-- plugins/view-assets/lang/en.json | 4 +- plugins/view-assets/lang/ru.json | 4 +- .../src/components/Table.svelte | 46 ++++++++++--- .../src/components/TableBrowser.svelte | 2 + .../src/components/SpecialView.svelte | 3 +- server/mongo/src/storage.ts | 5 +- server/rpc/src/rpc.ts | 11 ++- 11 files changed, 126 insertions(+), 72 deletions(-) diff --git a/packages/query/src/index.ts b/packages/query/src/index.ts index 72dac92b16..acfa066687 100644 --- a/packages/query/src/index.ts +++ b/packages/query/src/index.ts @@ -416,6 +416,7 @@ export class LiveQuery extends TxProcessor implements Client { protected override async txMixin (tx: TxMixin): Promise { const hierarchy = this.client.getHierarchy() + for (const queries of this.queries) { const isTx = hierarchy.isDerived(queries[0], core.class.Tx) const isMixin = hierarchy.isDerived(tx.mixin, queries[0]) @@ -433,16 +434,22 @@ export class LiveQuery extends TxProcessor implements Client { // If query contains search we must check use fulltext if (q.query.$search != null && q.query.$search.length > 0) { const searchRefresh = await this.checkSearch(q, tx.objectId) - if (searchRefresh) return {} + if (searchRefresh) { + continue + } } else { const updatedDoc = q.result[pos] if (updatedDoc.modifiedOn < tx.modifiedOn) { await this.__updateMixinDoc(q, updatedDoc, tx) const updateRefresh = await this.checkUpdatedDocMatch(q, updatedDoc) - if (updateRefresh) return {} + if (updateRefresh) { + continue + } } else { const currentRefresh = await this.getCurrentDoc(q, updatedDoc._id) - if (currentRefresh) return {} + if (currentRefresh) { + continue + } } } await this.sort(q, tx) diff --git a/plugins/hr-resources/src/components/Schedule.svelte b/plugins/hr-resources/src/components/Schedule.svelte index 27b7792e8b..5c5fbcd0ac 100644 --- a/plugins/hr-resources/src/components/Schedule.svelte +++ b/plugins/hr-resources/src/components/Schedule.svelte @@ -15,30 +15,30 @@ -{#if departmentStaff.length} - {#await getDepartmentsForEmployee(departmentStaff) then staffDepartmentMap} - {#if mode === CalendarMode.Year} - - {:else if mode === CalendarMode.Month} - {#if display === 'chart'} - - {:else if display === 'stats'} - - {/if} +{#if staffDepartmentMap.size > 0} + {#if mode === CalendarMode.Year} + + {:else if mode === CalendarMode.Month} + {#if display === 'chart'} + + {:else if display === 'stats'} + {/if} - {/await} + {/if} {:else}