2022-05-23 07:24:15 +00:00
|
|
|
<!--
|
|
|
|
// 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">
|
2022-09-21 08:08:25 +00:00
|
|
|
import { createQuery } from '@hcengineering/presentation'
|
2023-03-17 06:17:53 +00:00
|
|
|
import { Project, Issue } from '@hcengineering/tracker'
|
2023-05-24 10:27:57 +00:00
|
|
|
import { Spinner, IconClose, Button } from '@hcengineering/ui'
|
2022-05-23 07:24:15 +00:00
|
|
|
import { createEventDispatcher } from 'svelte'
|
|
|
|
import tracker from '../../plugin'
|
2022-06-30 03:46:46 +00:00
|
|
|
import { getIssueId } from '../../issues'
|
2023-05-24 10:27:57 +00:00
|
|
|
import PriorityRefPresenter from './PriorityRefPresenter.svelte'
|
2022-05-23 07:24:15 +00:00
|
|
|
|
|
|
|
export let issue: Issue
|
|
|
|
|
|
|
|
const dispatch = createEventDispatcher()
|
|
|
|
const spaceQuery = createQuery()
|
|
|
|
|
2023-03-17 06:17:53 +00:00
|
|
|
let project: Project | undefined
|
2022-05-23 07:24:15 +00:00
|
|
|
|
2023-03-17 06:17:53 +00:00
|
|
|
$: spaceQuery.query(tracker.class.Project, { _id: issue.space }, (res) => ([project] = res))
|
|
|
|
$: issueId = project && getIssueId(project, issue)
|
2022-05-23 07:24:15 +00:00
|
|
|
</script>
|
|
|
|
|
2023-05-24 10:27:57 +00:00
|
|
|
<div class="parentIssue-container">
|
|
|
|
<div class="flex-no-shrink mr-1-5">
|
|
|
|
<PriorityRefPresenter value={issue.priority} shouldShowLabel={false} />
|
|
|
|
</div>
|
2022-05-23 07:24:15 +00:00
|
|
|
{#if issueId}
|
2023-05-24 10:27:57 +00:00
|
|
|
<span class="overflow-label flex-no-shrink content-dark-color">{issueId}</span>
|
2022-05-23 07:24:15 +00:00
|
|
|
{:else}
|
|
|
|
<Spinner size="small" />
|
|
|
|
{/if}
|
|
|
|
<span class="overflow-label issue-title">{issue.title}</span>
|
2023-05-24 10:27:57 +00:00
|
|
|
<Button
|
|
|
|
icon={IconClose}
|
|
|
|
showTooltip={{ label: tracker.string.RemoveParent, direction: 'bottom' }}
|
|
|
|
kind={'transparent'}
|
|
|
|
size={'small'}
|
|
|
|
on:click={() => dispatch('close')}
|
|
|
|
/>
|
2023-01-18 05:14:59 +00:00
|
|
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
2023-05-24 10:27:57 +00:00
|
|
|
<!-- <div
|
2022-06-30 03:41:46 +00:00
|
|
|
class="button-close"
|
|
|
|
use:tooltip={{ label: tracker.string.RemoveParent, direction: 'bottom' }}
|
|
|
|
on:click={() => dispatch('close')}
|
|
|
|
>
|
|
|
|
<IconClose size="x-small" />
|
2023-05-24 10:27:57 +00:00
|
|
|
</div> -->
|
2022-05-23 07:24:15 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<style lang="scss">
|
2023-05-24 10:27:57 +00:00
|
|
|
.parentIssue-container {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
padding: 0.25rem 0.25rem 0.25rem 0.75rem;
|
2022-05-23 07:24:15 +00:00
|
|
|
max-width: fit-content;
|
2023-05-24 10:27:57 +00:00
|
|
|
min-width: 0;
|
|
|
|
// line-height: 150%;
|
|
|
|
height: 2.25rem;
|
|
|
|
border: 1px solid var(--theme-button-border);
|
2022-05-25 06:09:58 +00:00
|
|
|
border-radius: 0.25rem;
|
2022-05-23 07:24:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.issue-title {
|
2023-05-24 10:27:57 +00:00
|
|
|
margin: 0 0.25rem 0 0.375rem;
|
2022-05-23 07:24:15 +00:00
|
|
|
padding-right: 0.75rem;
|
2023-05-24 10:27:57 +00:00
|
|
|
min-width: 0;
|
|
|
|
color: var(--theme-caption-color);
|
|
|
|
border-right: 1px solid var(--theme-button-border);
|
2022-05-23 07:24:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.button-close {
|
|
|
|
cursor: pointer;
|
|
|
|
position: relative;
|
2023-05-24 10:27:57 +00:00
|
|
|
color: var(--theme-dark-color);
|
2022-05-25 06:09:58 +00:00
|
|
|
transition: color 0.15s;
|
2022-05-23 07:24:15 +00:00
|
|
|
|
|
|
|
&:hover {
|
2023-05-24 10:27:57 +00:00
|
|
|
color: var(--theme-content-color);
|
2022-05-23 07:24:15 +00:00
|
|
|
}
|
|
|
|
&:active {
|
2023-05-24 10:27:57 +00:00
|
|
|
color: var(--theme-dark-color);
|
2022-05-23 07:24:15 +00:00
|
|
|
}
|
|
|
|
&::before {
|
|
|
|
position: absolute;
|
|
|
|
content: '';
|
|
|
|
inset: -0.5rem;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|