Vacancy templates (#2351)

Signed-off-by: muhtimur <timur.mukhamedishin@xored.com>
This commit is contained in:
Timur Mukhamedishin
2022-11-09 17:24:02 +06:00
committed by GitHub
parent bd1079cb53
commit cdbead6584
43 changed files with 378 additions and 72 deletions
@@ -0,0 +1,59 @@
<!--
// Copyright © 2022 Hardcore Engineering Inc.
//
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. You may
// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
-->
<script lang="ts">
import { Doc, DocumentQuery } from '@hcengineering/core'
import presentation, { createQuery } from '@hcengineering/presentation'
import { IssueTemplate } from '@hcengineering/tracker'
import { Label, Spinner } from '@hcengineering/ui'
import tracker from '../../../plugin'
import IssueTemplatePresenter from '../../templates/IssueTemplatePresenter.svelte'
export let object: Doc
let templates: IssueTemplate[] = []
let query: DocumentQuery<IssueTemplate>
$: query = { 'relations._id': object._id, 'relations._class': object._class }
const templatesQ = createQuery()
$: templatesQ.query(tracker.class.IssueTemplate, query, async (result) => (templates = result))
</script>
<div class="mt-1">
{#if templates !== undefined}
{#if templates.length > 0}
{#each templates as template}
<div class="flex-between row p-3">
<IssueTemplatePresenter value={template} />
</div>
{/each}
{:else}
<div class="p-1">
<Label label={presentation.string.NoMatchesFound} />
</div>
{/if}
{:else}
<div class="flex-center pt-3">
<Spinner />
</div>
{/if}
</div>
<style lang="scss">
.row {
position: relative;
border-bottom: 1px solid var(--divider-color);
}
</style>
@@ -15,7 +15,7 @@
<script lang="ts">
import { AttachmentStyledBox } from '@hcengineering/attachment-resources'
import { Employee } from '@hcengineering/contact'
import { Data, generateId, Ref } from '@hcengineering/core'
import { Data, Doc, generateId, Ref } from '@hcengineering/core'
import { Card, getClient, KeyedAttribute, SpaceSelector } from '@hcengineering/presentation'
import tags, { TagElement } from '@hcengineering/tags'
import { IssuePriority, IssueTemplate, Project, Sprint, Team } from '@hcengineering/tracker'
@@ -35,6 +35,7 @@
export let assignee: Ref<Employee> | null = null
export let project: Ref<Project> | null = $activeProject ?? null
export let sprint: Ref<Sprint> | null = $activeSprint ?? null
export let relatedTo: Doc | undefined
let labels: TagElement[] = []
@@ -50,7 +51,8 @@
children: [],
labels: [],
comments: 0,
attachments: 0
attachments: 0,
relations: []
}
const dispatch = createEventDispatcher()
@@ -92,7 +94,8 @@
children: object.children,
comments: 0,
attachments: 0,
labels: labels.map((it) => it._id)
labels: labels.map((it) => it._id),
relations: relatedTo !== undefined ? [{ _id: relatedTo._id, _class: relatedTo._class }] : []
}
await client.createDoc(tracker.class.IssueTemplate, _space, value, objectId)
+4
View File
@@ -19,6 +19,7 @@ import { ObjectSearchResult } from '@hcengineering/presentation'
import { Issue, Team } from '@hcengineering/tracker'
import { showPopup } from '@hcengineering/ui'
import CreateIssue from './components/CreateIssue.svelte'
import CreateIssueTemplate from './components/templates/CreateIssueTemplate.svelte'
import Inbox from './components/inbox/Inbox.svelte'
import Active from './components/issues/Active.svelte'
import AssigneePresenter from './components/issues/AssigneePresenter.svelte'
@@ -83,6 +84,7 @@ import ReportedTimeEditor from './components/issues/timereport/ReportedTimeEdito
import TimeSpendReport from './components/issues/timereport/TimeSpendReport.svelte'
import RelatedIssues from './components/issues/related/RelatedIssues.svelte'
import RelatedIssueTemplates from './components/issues/related/RelatedIssueTemplates.svelte'
import ProjectSelector from './components/ProjectSelector.svelte'
@@ -196,6 +198,7 @@ export default async (): Promise<Resources> => ({
IssuePreview,
RelationsPopup,
CreateIssue,
CreateIssueTemplate,
Sprints,
SprintPresenter,
SprintStatusPresenter,
@@ -208,6 +211,7 @@ export default async (): Promise<Resources> => ({
SubIssuesSelector,
GrowPresenter,
RelatedIssues,
RelatedIssueTemplates,
ProjectSelector,
IssueTemplates,
IssueTemplatePresenter,