2022-06-27 06:04:26 +00:00
|
|
|
|
<!--
|
|
|
|
|
// Copyright © 2022 Hardcore Engineering Inc.
|
2023-11-20 10:01:43 +00:00
|
|
|
|
//
|
2022-06-27 06:04:26 +00:00
|
|
|
|
// 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
|
2023-11-20 10:01:43 +00:00
|
|
|
|
//
|
2022-06-27 06:04:26 +00:00
|
|
|
|
// 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.
|
2023-11-20 10:01:43 +00:00
|
|
|
|
//
|
2022-06-27 06:04:26 +00:00
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
|
// limitations under the License.
|
|
|
|
|
-->
|
|
|
|
|
<script lang="ts">
|
2022-09-26 09:40:13 +00:00
|
|
|
|
import type { Issue, IssueParentInfo } from '@hcengineering/tracker'
|
|
|
|
|
import { showPanel } from '@hcengineering/ui'
|
|
|
|
|
import tracker from '../../plugin'
|
2022-06-27 06:04:26 +00:00
|
|
|
|
|
|
|
|
|
export let value: Issue | undefined
|
2022-08-30 10:11:46 +00:00
|
|
|
|
|
|
|
|
|
export let maxWidth = ''
|
2022-09-26 09:40:13 +00:00
|
|
|
|
|
|
|
|
|
function handleIssueEditorOpened (parent: IssueParentInfo) {
|
|
|
|
|
if (value === undefined) return
|
|
|
|
|
showPanel(tracker.component.EditIssue, parent.parentId, value._class, 'content')
|
|
|
|
|
}
|
2022-06-27 06:04:26 +00:00
|
|
|
|
</script>
|
|
|
|
|
|
2023-11-18 08:20:19 +00:00
|
|
|
|
{#if value && Array.isArray(value.parents)}
|
2022-08-30 10:11:46 +00:00
|
|
|
|
<div class="root" style:max-width={maxWidth}>
|
2022-06-27 06:04:26 +00:00
|
|
|
|
<span class="names">
|
|
|
|
|
{#each value.parents as parentInfo}
|
2023-01-18 05:14:59 +00:00
|
|
|
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
2023-03-21 01:49:29 +00:00
|
|
|
|
<span
|
2023-09-11 13:41:09 +00:00
|
|
|
|
class="parent-label overflow-label cursor-pointer"
|
2023-03-21 01:49:29 +00:00
|
|
|
|
title={parentInfo.parentTitle}
|
2023-11-20 10:01:43 +00:00
|
|
|
|
on:click={() => {
|
|
|
|
|
handleIssueEditorOpened(parentInfo)
|
|
|
|
|
}}
|
2023-03-21 01:49:29 +00:00
|
|
|
|
>
|
2023-03-17 03:52:32 +00:00
|
|
|
|
{parentInfo.parentTitle}
|
|
|
|
|
</span>
|
2022-06-27 06:04:26 +00:00
|
|
|
|
{/each}
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
{/if}
|
|
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
|
.root {
|
2023-09-11 13:41:09 +00:00
|
|
|
|
display: inline-flex;
|
2023-03-21 01:49:29 +00:00
|
|
|
|
margin-left: 0;
|
2022-06-27 06:04:26 +00:00
|
|
|
|
min-width: 0;
|
|
|
|
|
|
|
|
|
|
.names {
|
2023-03-17 03:52:32 +00:00
|
|
|
|
display: inline-flex;
|
2023-03-21 01:49:29 +00:00
|
|
|
|
min-width: 0;
|
2023-06-29 04:29:12 +00:00
|
|
|
|
color: var(--theme-dark-color);
|
2022-06-27 06:04:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
2023-09-11 13:41:09 +00:00
|
|
|
|
.parent-label {
|
|
|
|
|
flex-shrink: 5;
|
|
|
|
|
|
2022-09-26 09:40:13 +00:00
|
|
|
|
&:hover {
|
2023-06-29 04:29:12 +00:00
|
|
|
|
color: var(--theme-caption-color);
|
2022-09-26 09:40:13 +00:00
|
|
|
|
text-decoration: underline;
|
|
|
|
|
}
|
|
|
|
|
&:active {
|
2023-06-29 04:29:12 +00:00
|
|
|
|
color: var(--theme-content-color);
|
2022-09-26 09:40:13 +00:00
|
|
|
|
}
|
2023-03-17 03:52:32 +00:00
|
|
|
|
&::before {
|
|
|
|
|
content: '›';
|
|
|
|
|
padding: 0 0.25rem;
|
|
|
|
|
}
|
2022-06-27 06:04:26 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|