mirror of
https://github.com/hcengineering/platform.git
synced 2025-05-24 17:05:42 +00:00
UBERF-10664: Fix person preview (#8995)
Signed-off-by: Artem Savchenko <armisav@gmail.com>
This commit is contained in:
parent
a4cc6e102e
commit
7f32b2b2f4
Binary file not shown.
Before Width: | Height: | Size: 169 KiB After Width: | Height: | Size: 133 KiB |
@ -13,7 +13,7 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Employee } from '@hcengineering/contact'
|
import { Employee, Person } from '@hcengineering/contact'
|
||||||
import { AccountUuid, Class, Doc, Ref } from '@hcengineering/core'
|
import { AccountUuid, Class, Doc, Ref } from '@hcengineering/core'
|
||||||
import { ButtonIcon, navigate } from '@hcengineering/ui'
|
import { ButtonIcon, navigate } from '@hcengineering/ui'
|
||||||
import view from '@hcengineering/view'
|
import view from '@hcengineering/view'
|
||||||
@ -23,7 +23,7 @@
|
|||||||
import ModernProfilePopup from './ModernProfilePopup.svelte'
|
import ModernProfilePopup from './ModernProfilePopup.svelte'
|
||||||
import contact from '../../plugin'
|
import contact from '../../plugin'
|
||||||
import Avatar from '../Avatar.svelte'
|
import Avatar from '../Avatar.svelte'
|
||||||
import { employeeByIdStore } from '../../utils'
|
import { employeeByIdStore, personByIdStore } from '../../utils'
|
||||||
import { getPersonTimezone } from './utils'
|
import { getPersonTimezone } from './utils'
|
||||||
import { EmployeePresenter } from '../../index'
|
import { EmployeePresenter } from '../../index'
|
||||||
import TimePresenter from './TimePresenter.svelte'
|
import TimePresenter from './TimePresenter.svelte'
|
||||||
@ -35,11 +35,13 @@
|
|||||||
const client = getClient()
|
const client = getClient()
|
||||||
const hierarchy = client.getHierarchy()
|
const hierarchy = client.getHierarchy()
|
||||||
|
|
||||||
let employee: Employee | undefined = undefined
|
let employee: Employee | Person | undefined = undefined
|
||||||
let timezone: string | undefined = undefined
|
let timezone: string | undefined = undefined
|
||||||
|
let isEmployee: boolean = false
|
||||||
|
|
||||||
$: employee = $employeeByIdStore.get(_id)
|
$: employee = $employeeByIdStore.get(_id) ?? $personByIdStore.get(_id)
|
||||||
$: void loadPersonTimezone(employee?.personUuid)
|
$: isEmployee = $employeeByIdStore.has(_id)
|
||||||
|
$: void loadPersonTimezone(employee)
|
||||||
|
|
||||||
async function viewProfile (): Promise<void> {
|
async function viewProfile (): Promise<void> {
|
||||||
if (employee === undefined) return
|
if (employee === undefined) return
|
||||||
@ -49,8 +51,10 @@
|
|||||||
navigate(loc)
|
navigate(loc)
|
||||||
}
|
}
|
||||||
|
|
||||||
async function loadPersonTimezone (personId: AccountUuid | undefined): Promise<void> {
|
async function loadPersonTimezone (person: Employee | Person | undefined): Promise<void> {
|
||||||
timezone = await getPersonTimezone(personId)
|
if (person?.personUuid !== undefined && isEmployee) {
|
||||||
|
timezone = await getPersonTimezone(person?.personUuid as AccountUuid)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -80,7 +84,7 @@
|
|||||||
person={employee}
|
person={employee}
|
||||||
name={employee?.name}
|
name={employee?.name}
|
||||||
{disabled}
|
{disabled}
|
||||||
showStatus
|
showStatus={isEmployee}
|
||||||
statusSize="medium"
|
statusSize="medium"
|
||||||
style="modern"
|
style="modern"
|
||||||
clickable
|
clickable
|
||||||
@ -94,14 +98,16 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="py-1">
|
{#if isEmployee}
|
||||||
<ComponentExtensions
|
<div class="py-1">
|
||||||
extension={contact.extension.PersonAchievementsPresenter}
|
<ComponentExtensions
|
||||||
props={{
|
extension={contact.extension.PersonAchievementsPresenter}
|
||||||
personId: _id
|
props={{
|
||||||
}}
|
personId: _id
|
||||||
/>
|
}}
|
||||||
</div>
|
/>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
{:else}
|
{:else}
|
||||||
<div class="flex-presenter flex-gap-2 p-2">
|
<div class="flex-presenter flex-gap-2 p-2">
|
||||||
<div class="flex-presenter">
|
<div class="flex-presenter">
|
||||||
|
@ -80,7 +80,7 @@
|
|||||||
.image-container {
|
.image-container {
|
||||||
/* image-container */
|
/* image-container */
|
||||||
width: 100%;
|
width: 100%;
|
||||||
min-height: 8rem;
|
min-height: 6.5rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
/* Inside auto layout */
|
/* Inside auto layout */
|
||||||
@ -110,7 +110,7 @@
|
|||||||
right: 0;
|
right: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
height: 7.25rem;
|
height: 5.5rem;
|
||||||
|
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
background-size: contain;
|
background-size: contain;
|
||||||
|
Loading…
Reference in New Issue
Block a user