mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-26 04:54:40 +03:00
UBER-267: Fix Users popup (#3268)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
b95066d71a
commit
79486e1b8c
@ -130,6 +130,7 @@
|
||||
const newPerson = await client.findOne(_class, { _id: res })
|
||||
if (newPerson !== undefined) {
|
||||
search = c.update?.(newPerson) ?? ''
|
||||
dispatch('search', search)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -13,7 +13,7 @@
|
||||
// limitations under the License.
|
||||
-->
|
||||
<script lang="ts">
|
||||
import { Contact, getFirstName, Person } from '@hcengineering/contact'
|
||||
import { Contact, getFirstName, getLastName, Person } from '@hcengineering/contact'
|
||||
import type { Class, Doc, DocumentQuery, FindOptions, Ref } from '@hcengineering/core'
|
||||
import type { Asset, IntlString } from '@hcengineering/platform'
|
||||
import presentation, { getClient, ObjectCreate, ObjectPopup } from '@hcengineering/presentation'
|
||||
@ -37,14 +37,15 @@
|
||||
export let readonly = false
|
||||
|
||||
const hierarchy = getClient().getHierarchy()
|
||||
// const dispatch = createEventDispatcher()
|
||||
|
||||
$: _create =
|
||||
create !== undefined
|
||||
? {
|
||||
...create,
|
||||
update: (doc: Doc) => {
|
||||
const name = getFirstName((doc as Contact).name)
|
||||
return name.length > 0 ? name : (doc as Contact).name
|
||||
const name = getFirstName((doc as Contact).name).split(' ')[0]
|
||||
return name.length > 0 ? name : getLastName((doc as Contact).name).split(' ')[0]
|
||||
}
|
||||
}
|
||||
: undefined
|
||||
|
@ -270,7 +270,7 @@
|
||||
|
||||
await applyOps.commit()
|
||||
draftController.remove()
|
||||
dispatch('close', object._id)
|
||||
dispatch('close', _id)
|
||||
resetObject()
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user