mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-25 19:58:30 +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 })
|
const newPerson = await client.findOne(_class, { _id: res })
|
||||||
if (newPerson !== undefined) {
|
if (newPerson !== undefined) {
|
||||||
search = c.update?.(newPerson) ?? ''
|
search = c.update?.(newPerson) ?? ''
|
||||||
|
dispatch('search', search)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<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 { Class, Doc, DocumentQuery, FindOptions, Ref } from '@hcengineering/core'
|
||||||
import type { Asset, IntlString } from '@hcengineering/platform'
|
import type { Asset, IntlString } from '@hcengineering/platform'
|
||||||
import presentation, { getClient, ObjectCreate, ObjectPopup } from '@hcengineering/presentation'
|
import presentation, { getClient, ObjectCreate, ObjectPopup } from '@hcengineering/presentation'
|
||||||
@ -37,14 +37,15 @@
|
|||||||
export let readonly = false
|
export let readonly = false
|
||||||
|
|
||||||
const hierarchy = getClient().getHierarchy()
|
const hierarchy = getClient().getHierarchy()
|
||||||
|
// const dispatch = createEventDispatcher()
|
||||||
|
|
||||||
$: _create =
|
$: _create =
|
||||||
create !== undefined
|
create !== undefined
|
||||||
? {
|
? {
|
||||||
...create,
|
...create,
|
||||||
update: (doc: Doc) => {
|
update: (doc: Doc) => {
|
||||||
const name = getFirstName((doc as Contact).name)
|
const name = getFirstName((doc as Contact).name).split(' ')[0]
|
||||||
return name.length > 0 ? name : (doc as Contact).name
|
return name.length > 0 ? name : getLastName((doc as Contact).name).split(' ')[0]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
: undefined
|
: undefined
|
||||||
|
@ -270,7 +270,7 @@
|
|||||||
|
|
||||||
await applyOps.commit()
|
await applyOps.commit()
|
||||||
draftController.remove()
|
draftController.remove()
|
||||||
dispatch('close', object._id)
|
dispatch('close', _id)
|
||||||
resetObject()
|
resetObject()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user