UBERF-9732: Use huly id as primary social id (#8499)

* uberf-9732: use huly id as primary social id
Signed-off-by: Alexey Zinoviev <alexey.zinoviev@xored.com>

* uberf-9732: fix person id filter
Signed-off-by: Alexey Zinoviev <alexey.zinoviev@xored.com>
This commit is contained in:
Alexey Zinoviev
2025-04-09 09:52:06 +07:00
committed by GitHub
parent 420b31d66f
commit 4cb1f3e411
29 changed files with 478 additions and 238 deletions
@@ -0,0 +1,26 @@
<!--
// Copyright © 2023 Hardcore Engineering Inc.
//
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. You may
// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
-->
<script lang="ts">
import { Ref, Space } from '@hcengineering/core'
import { Component } from '@hcengineering/ui'
import contact from '@hcengineering/contact'
import { Filter } from '@hcengineering/view'
export let filter: Filter
export let space: Ref<Space> | undefined = undefined
export let onChange: (e: Filter) => void
</script>
<Component is={contact.component.PersonIdFilter} props={{ filter, space, onChange }} />
@@ -18,17 +18,20 @@
import { getClient } from '@hcengineering/presentation'
import contact, { getPersonRefsBySocialIds, Person } from '@hcengineering/contact'
export let value: [any, PersonId][]
export let value: PersonId[]
const client = getClient()
let persons: Ref<Person>[] = []
$: void getPersons(value.map((p) => p[1]).flat())
$: void getPersons(value)
async function getPersons (ids: PersonId[]): Promise<void> {
if (ids !== undefined) {
const personsMap = await getPersonRefsBySocialIds(client, ids)
persons = Object.values(personsMap)
console.log(persons)
if (ids.length === 0) {
persons = []
} else {
const personsMap = await getPersonRefsBySocialIds(client, ids)
persons = Object.values(personsMap)
}
}
}
</script>