mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-06 17:57:42 +02:00
UBERF-8425: Global accounts (#7573)
This commit is contained in:
+3
-6
@@ -3,12 +3,11 @@
|
||||
//
|
||||
-->
|
||||
<script lang="ts">
|
||||
import { Ref, WithLookup } from '@hcengineering/core'
|
||||
import { WithLookup } from '@hcengineering/core'
|
||||
import { GithubPullRequestReviewState, GithubReview } from '@hcengineering/github'
|
||||
|
||||
import { ActivityMessageHeader, ActivityMessageTemplate } from '@hcengineering/activity-resources'
|
||||
import { Person, PersonAccount } from '@hcengineering/contact'
|
||||
import { personAccountByIdStore, personByIdStore } from '@hcengineering/contact-resources'
|
||||
import { personByPersonIdStore } from '@hcengineering/contact-resources'
|
||||
import { IntlString } from '@hcengineering/platform'
|
||||
import { MessageViewer } from '@hcengineering/presentation'
|
||||
import { isEmptyMarkup } from '@hcengineering/text'
|
||||
@@ -23,9 +22,7 @@
|
||||
export let embedded: boolean = false
|
||||
export let onClick: (() => void) | undefined = undefined
|
||||
|
||||
$: personAccount = $personAccountByIdStore.get((value?.createdBy ?? value?.modifiedBy) as Ref<PersonAccount>)
|
||||
|
||||
$: person = $personByIdStore.get(personAccount?.person as Ref<Person>)
|
||||
$: person = $personByPersonIdStore.get(value?.createdBy ?? value?.modifiedBy)
|
||||
|
||||
function getCommentFromState (value?: GithubPullRequestReviewState): {
|
||||
label: IntlString
|
||||
|
||||
+7
-9
@@ -3,12 +3,12 @@
|
||||
//
|
||||
-->
|
||||
<script lang="ts">
|
||||
import core, { Account, Ref, WithLookup, getCurrentAccount } from '@hcengineering/core'
|
||||
import core, { PersonId, Ref, WithLookup, getCurrentAccount } from '@hcengineering/core'
|
||||
import { GithubPullRequest, GithubReviewComment, GithubReviewThread } from '@hcengineering/github'
|
||||
|
||||
import { ActivityMessageHeader, ActivityMessageTemplate } from '@hcengineering/activity-resources'
|
||||
import { Person, PersonAccount } from '@hcengineering/contact'
|
||||
import { EmployeePresenter, personAccountByIdStore, personByIdStore } from '@hcengineering/contact-resources'
|
||||
import { Person } from '@hcengineering/contact'
|
||||
import { EmployeePresenter, personByPersonIdStore } from '@hcengineering/contact-resources'
|
||||
import { getEmbeddedLabel } from '@hcengineering/platform'
|
||||
import { createQuery, getClient } from '@hcengineering/presentation'
|
||||
import { ReferenceInput } from '@hcengineering/text-editor-resources'
|
||||
@@ -26,8 +26,7 @@
|
||||
export let embedded: boolean = false
|
||||
export let onClick: (() => void) | undefined = undefined
|
||||
|
||||
$: personAccount = $personAccountByIdStore.get((value?.createdBy ?? value?.modifiedBy) as Ref<PersonAccount>)
|
||||
$: person = $personByIdStore.get(personAccount?.person as Ref<Person>)
|
||||
$: person = $personByPersonIdStore.get(value?.createdBy ?? value?.modifiedBy)
|
||||
|
||||
const commentsQuery = createQuery()
|
||||
|
||||
@@ -71,11 +70,11 @@
|
||||
if (value.isResolved) {
|
||||
await getClient().update(value, { isResolved: false, resolvedBy: null })
|
||||
} else {
|
||||
await getClient().update(value, { isResolved: true, resolvedBy: getCurrentAccount()._id })
|
||||
await getClient().update(value, { isResolved: true, resolvedBy: getCurrentAccount().primarySocialId })
|
||||
}
|
||||
}
|
||||
|
||||
const toRefPersonAccount = (account: Ref<Account>): Ref<PersonAccount> => account as Ref<PersonAccount>
|
||||
const toRefPersonAccount = (account: PersonId): PersonId => account
|
||||
const toRefPerson = (account?: Ref<Person>): Ref<Person> => account as Ref<Person>
|
||||
</script>
|
||||
|
||||
@@ -142,8 +141,7 @@
|
||||
/>
|
||||
{/if}
|
||||
{#if value.isResolved && value.resolvedBy != null}
|
||||
{@const resolveAccount = $personAccountByIdStore.get(toRefPersonAccount(value.resolvedBy))}
|
||||
{@const resolvePerson = $personByIdStore.get(toRefPerson(resolveAccount?.person))}
|
||||
{@const resolvePerson = $personByPersonIdStore.get(value.resolvedBy)}
|
||||
{#if resolvePerson !== undefined}
|
||||
<div class="flex-row-center ml-4">
|
||||
<Label label={getEmbeddedLabel('resolved by')} />
|
||||
|
||||
+3
-10
@@ -1,21 +1,14 @@
|
||||
<script lang="ts">
|
||||
import { Person, PersonAccount } from '@hcengineering/contact'
|
||||
import {
|
||||
EmployeePresenter,
|
||||
SystemAvatar,
|
||||
personAccountByIdStore,
|
||||
personByIdStore
|
||||
} from '@hcengineering/contact-resources'
|
||||
import { EmployeePresenter, SystemAvatar, personByPersonIdStore } from '@hcengineering/contact-resources'
|
||||
import Avatar from '@hcengineering/contact-resources/src/components/Avatar.svelte'
|
||||
import core, { Ref, getDisplayTime } from '@hcengineering/core'
|
||||
import core, { getDisplayTime } from '@hcengineering/core'
|
||||
import { MessageViewer } from '@hcengineering/presentation'
|
||||
import { Label } from '@hcengineering/ui'
|
||||
import { GithubReviewComment } from '@hcengineering/github'
|
||||
|
||||
export let comment: GithubReviewComment
|
||||
|
||||
$: personAccount = $personAccountByIdStore.get((comment?.createdBy ?? comment?.modifiedBy) as Ref<PersonAccount>)
|
||||
$: person = $personByIdStore.get(personAccount?.person as Ref<Person>)
|
||||
$: person = $personByPersonIdStore.get(comment?.createdBy ?? comment?.modifiedBy)
|
||||
</script>
|
||||
|
||||
{#if comment}
|
||||
|
||||
Reference in New Issue
Block a user