Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion services/github/github-resources/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"build:watch": "compile ui",
"_phase:build": "compile ui",
"_phase:format": "format src",
"_phase:validate": "compile validate"
"_phase:validate": "compile validate",
"svelte-check": "do-svelte-check",
"_phase:svelte-check": "do-svelte-check"
},
"devDependencies": {
"@hcengineering/platform-rig": "workspace:^0.7.19",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { Analytics } from '@hcengineering/analytics'
import core, { ClassifierKind, Ref, WithLookup, generateId } from '@hcengineering/core'
import { getEmbeddedLabel, getMetadata, translate } from '@hcengineering/platform'
import core, { Ref, WithLookup, generateId } from '@hcengineering/core'
import { getMetadata, translate } from '@hcengineering/platform'
import { getClient } from '@hcengineering/presentation'
import task, { TaskType, updateProjectType, type TaskStatusFactory } from '@hcengineering/task'
import tracker, { Project, createStatesData } from '@hcengineering/tracker'
Expand Down Expand Up @@ -63,23 +63,14 @@

if (!client.getHierarchy().hasMixin(projectInst, github.mixin.GithubProject)) {
// We need to add GithubProject mixin
const mixinId = await getClient().createDoc(core.class.Mixin, core.space.Model, {
extends: github.mixin.GithubIssue,
kind: ClassifierKind.MIXIN,
label: getEmbeddedLabel(projectInst.name),
hidden: false,
icon: github.icon.Github
})
await getClient().createMixin(
projectInst._id,
tracker.class.Project,
core.space.Space,
github.mixin.GithubProject,
{
integration: integration._id,
repositories: [],
mixinClass: mixinId,
mappings: []
repositories: []
}
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@
//
-->
<script lang="ts">
import { PersonAccount } from '@hcengineering/contact'
import { getCurrentAccount } from '@hcengineering/core'
import { createQuery, getClient, getFileUrl } from '@hcengineering/presentation'
import { Button, Chevron, Component, ExpandCollapse, Label } from '@hcengineering/ui'
import diffview from '@hcengineering/diffview'
import { GithubPatch, GithubPullRequest, GithubPullRequestReview } from '@hcengineering/github'

import github from '../plugin'
import { getCurrentEmployee } from '@hcengineering/contact'

export let pullRequest: GithubPullRequest

const me = getCurrentAccount() as PersonAccount
const me = getCurrentEmployee()

let isCollapsed = true

Expand All @@ -37,6 +36,7 @@
}

$: hasPatch = patch !== undefined && patchText !== ''
$: changedFilesCount = patchText === '' ? 0 : (patchText.match(/^diff --git /gm)?.length ?? 0)

let review: GithubPullRequestReview | undefined

Expand All @@ -46,7 +46,7 @@
github.class.GithubPullRequestReview,
{
attachedTo: pullRequest._id,
author: me.person
author: me
},
(res) => {
;[review] = res
Expand All @@ -60,7 +60,7 @@
async function handleFileViewed (fileName: string, sha: string, viewed: boolean): Promise<void> {
const current = await client.findOne(github.class.GithubPullRequestReview, {
attachedTo: pullRequest._id,
author: me.person
author: me
})

const files = current?.files ?? []
Expand All @@ -73,7 +73,7 @@
files.push({ fileName, sha })
}

if (current) {
if (current != null) {
await client.update(current, { files })
} else {
await client.addCollection(
Expand All @@ -82,7 +82,7 @@
pullRequest._id,
github.class.GithubPullRequest,
'reviewsVisual',
{ author: me.person, files }
{ author: me, files }
)
}
}
Expand All @@ -106,7 +106,7 @@
fill={'var(--caption-color)'}
marginRight={'.375rem'}
/>
<Label label={github.string.ChangedFiles} params={{ files: pullRequest.files }} />
<Label label={github.string.ChangedFiles} params={{ files: changedFilesCount }} />
</svelte:fragment>
</Button>
</div>
Expand All @@ -119,7 +119,7 @@
props={{ patch: patchText, viewed: viewedFiles }}
on:change={(evt) => {
const { fileName, sha, viewed } = evt.detail
handleFileViewed(fileName, sha, viewed)
void handleFileViewed(fileName, sha, viewed)
}}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</script>

<HyperlinkEditor
value={repository?.repository?.html_url ?? repository?.htmlURL}
value={repository?.htmlURL ?? ''}
placeholder={getEmbeddedLabel(repository?.name ?? '')}
title={repository?.name ?? ''}
readonly
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
export let label: IntlString = github.string.AssignRepository
export let showIcon: boolean = false

$: repository = $integrationRepositories.get(value)
$: repository = value != null ? $integrationRepositories.get(value) : undefined

let selectedRepository: GithubIntegrationRepository | undefined

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//
-->
<script lang="ts">
import core, { PersonId, Ref, WithLookup, getCurrentAccount } from '@hcengineering/core'
import core, { Ref, WithLookup, getCurrentAccount } from '@hcengineering/core'
import { GithubPullRequest, GithubReviewComment, GithubReviewThread } from '@hcengineering/github'

import { ActivityMessageHeader, ActivityMessageTemplate } from '@hcengineering/activity-resources'
Expand Down Expand Up @@ -82,8 +82,9 @@
}
}

const toRefPersonAccount = (account: PersonId): PersonId => account
const toRefPerson = (account?: Ref<Person>): Ref<Person> => account as Ref<Person>
function onDiffExpand (nextExpanded: boolean): void {
expanded = nextExpanded
}
</script>

<div
Expand Down Expand Up @@ -122,9 +123,7 @@
fileName: value.path,
expandable: value.isResolved,
expanded,
onExpand: (value) => {
expanded = value
}
onExpand: onDiffExpand
}}
/>
{/if}
Expand Down
Loading