From 47d5db2f615c4ae9f8449233c779ac6503b809f6 Mon Sep 17 00:00:00 2001 From: Andrey Sobolev Date: Tue, 14 Feb 2023 11:00:12 +0700 Subject: [PATCH] Fix Contacts layout (#2631) + Fix migration Signed-off-by: Andrey Sobolev --- models/contact/src/migration.ts | 14 +++++++++++++- .../src/components/ContactsTabs.svelte | 6 +++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/models/contact/src/migration.ts b/models/contact/src/migration.ts index 112f592757..0da0a3d6ec 100644 --- a/models/contact/src/migration.ts +++ b/models/contact/src/migration.ts @@ -43,6 +43,7 @@ async function createSpace (tx: TxOperations): Promise { } } +let totalCreateOn = 0 async function setCreate (client: MigrationClient): Promise { while (true) { const docs = await client.find( @@ -58,7 +59,8 @@ async function setCreate (client: MigrationClient): Promise { if (docs.length === 0) { break } - console.log('processing createOn migration', docs.length) + totalCreateOn += docs.length + console.log('processing createOn migration', totalCreateOn) const creates = await client.find>(DOMAIN_TX, { objectId: { $in: docs.map((it) => it._id) }, _class: core.class.TxCreateDoc @@ -84,6 +86,16 @@ async function setCreate (client: MigrationClient): Promise { 'attributes.createOn': tx.modifiedOn } ) + } else { + await client.update( + DOMAIN_CONTACT, + { + _id: doc._id + }, + { + createOn: doc.modifiedOn + } + ) } } } diff --git a/plugins/contact-resources/src/components/ContactsTabs.svelte b/plugins/contact-resources/src/components/ContactsTabs.svelte index a7a42594e2..305b2b4b4c 100644 --- a/plugins/contact-resources/src/components/ContactsTabs.svelte +++ b/plugins/contact-resources/src/components/ContactsTabs.svelte @@ -13,10 +13,10 @@ // limitations under the License. --> {#if tabs && tabs.length > 1} -
+
{:else if tabs?.[0]}