mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-26 13:47:26 +03:00
Fix Contacts layout (#2631)
+ Fix migration Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
961de0ddc0
commit
47d5db2f61
@ -43,6 +43,7 @@ async function createSpace (tx: TxOperations): Promise<void> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let totalCreateOn = 0
|
||||||
async function setCreate (client: MigrationClient): Promise<void> {
|
async function setCreate (client: MigrationClient): Promise<void> {
|
||||||
while (true) {
|
while (true) {
|
||||||
const docs = await client.find<Contact>(
|
const docs = await client.find<Contact>(
|
||||||
@ -58,7 +59,8 @@ async function setCreate (client: MigrationClient): Promise<void> {
|
|||||||
if (docs.length === 0) {
|
if (docs.length === 0) {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
console.log('processing createOn migration', docs.length)
|
totalCreateOn += docs.length
|
||||||
|
console.log('processing createOn migration', totalCreateOn)
|
||||||
const creates = await client.find<TxCreateDoc<Contact>>(DOMAIN_TX, {
|
const creates = await client.find<TxCreateDoc<Contact>>(DOMAIN_TX, {
|
||||||
objectId: { $in: docs.map((it) => it._id) },
|
objectId: { $in: docs.map((it) => it._id) },
|
||||||
_class: core.class.TxCreateDoc
|
_class: core.class.TxCreateDoc
|
||||||
@ -84,6 +86,16 @@ async function setCreate (client: MigrationClient): Promise<void> {
|
|||||||
'attributes.createOn': tx.modifiedOn
|
'attributes.createOn': tx.modifiedOn
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
} else {
|
||||||
|
await client.update(
|
||||||
|
DOMAIN_CONTACT,
|
||||||
|
{
|
||||||
|
_id: doc._id
|
||||||
|
},
|
||||||
|
{
|
||||||
|
createOn: doc.modifiedOn
|
||||||
|
}
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,10 +13,10 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { getClient } from '@hcengineering/presentation'
|
|
||||||
import { Tabs, Component, AnyComponent } from '@hcengineering/ui'
|
|
||||||
import contact from '@hcengineering/contact'
|
import contact from '@hcengineering/contact'
|
||||||
import { IntlString } from '@hcengineering/platform'
|
import { IntlString } from '@hcengineering/platform'
|
||||||
|
import { getClient } from '@hcengineering/presentation'
|
||||||
|
import { AnyComponent, Component, Tabs } from '@hcengineering/ui'
|
||||||
|
|
||||||
const client = getClient()
|
const client = getClient()
|
||||||
|
|
||||||
@ -33,7 +33,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if tabs && tabs.length > 1}
|
{#if tabs && tabs.length > 1}
|
||||||
<div class="pl-2">
|
<div class="flex-col p-4 flex-grow">
|
||||||
<Tabs model={tabs} />
|
<Tabs model={tabs} />
|
||||||
</div>
|
</div>
|
||||||
{:else if tabs?.[0]}
|
{:else if tabs?.[0]}
|
||||||
|
Loading…
Reference in New Issue
Block a user