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'
|
|
|
|
import { Team, Issue } from '@hcengineering/tracker'
|
|
|
|
import { Spinner, IconClose, tooltip } 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'
|
2022-05-23 07:24:15 +00:00
|
|
|
|
|
|
|
export let issue: Issue
|
|
|
|
|
|
|
|
const dispatch = createEventDispatcher()
|
|
|
|
const spaceQuery = createQuery()
|
|
|
|
|
|
|
|
let team: Team | undefined
|
|
|
|
|
|
|
|
$: spaceQuery.query(tracker.class.Team, { _id: issue.space }, (res) => ([team] = res))
|
2022-06-09 14:49:57 +00:00
|
|
|
$: issueId = team && getIssueId(team, issue)
|
2022-05-23 07:24:15 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<div class="flex-center root">
|
|
|
|
{#if issueId}
|
|
|
|
<span class="overflow-label flex-no-shrink">{issueId}</span>
|
|
|
|
{:else}
|
|
|
|
<Spinner size="small" />
|
|
|
|
{/if}
|
|
|
|
<span class="overflow-label issue-title">{issue.title}</span>
|
2023-01-18 05:14:59 +00:00
|
|
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
2022-06-30 03:41:46 +00:00
|
|
|
<div
|
|
|
|
class="button-close"
|
|
|
|
use:tooltip={{ label: tracker.string.RemoveParent, direction: 'bottom' }}
|
|
|
|
on:click={() => dispatch('close')}
|
|
|
|
>
|
|
|
|
<IconClose size="x-small" />
|
|
|
|
</div>
|
2022-05-23 07:24:15 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
.root {
|
|
|
|
padding: 0.375rem 0.75rem;
|
|
|
|
line-height: 150%;
|
|
|
|
max-width: fit-content;
|
|
|
|
border: 1px solid var(--button-border-color);
|
2022-05-25 06:09:58 +00:00
|
|
|
border-radius: 0.25rem;
|
|
|
|
box-shadow: var(--primary-shadow);
|
2022-05-23 07:24:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.issue-title {
|
|
|
|
margin: 0 0.75rem 0 0.5rem;
|
|
|
|
padding-right: 0.75rem;
|
2022-05-25 06:09:58 +00:00
|
|
|
color: var(--theme-content-accent-color);
|
2022-05-23 07:24:15 +00:00
|
|
|
border-right: 1px solid var(--button-border-color);
|
|
|
|
}
|
|
|
|
|
|
|
|
.button-close {
|
|
|
|
cursor: pointer;
|
|
|
|
position: relative;
|
2022-05-25 06:09:58 +00:00
|
|
|
color: var(--content-color);
|
|
|
|
transition: color 0.15s;
|
2022-05-23 07:24:15 +00:00
|
|
|
|
|
|
|
&:hover {
|
|
|
|
color: var(--theme-caption-color);
|
|
|
|
}
|
|
|
|
&:active {
|
|
|
|
color: var(--theme-content-accent-color);
|
|
|
|
}
|
|
|
|
&::before {
|
|
|
|
position: absolute;
|
|
|
|
content: '';
|
|
|
|
inset: -0.5rem;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|