2022-04-08 18:05:49 +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">
|
2023-03-15 14:06:03 +00:00
|
|
|
import { WithLookup } from '@hcengineering/core'
|
2022-09-21 08:08:25 +00:00
|
|
|
import type { Issue } from '@hcengineering/tracker'
|
2023-03-15 14:06:03 +00:00
|
|
|
import { DocNavLink } from '@hcengineering/view-resources'
|
2023-01-18 05:14:59 +00:00
|
|
|
import tracker from '../../plugin'
|
|
|
|
import ParentNamesPresenter from './ParentNamesPresenter.svelte'
|
2022-04-08 18:05:49 +00:00
|
|
|
|
2023-03-15 14:06:03 +00:00
|
|
|
export let value: WithLookup<Issue>
|
2022-04-20 16:31:56 +00:00
|
|
|
export let shouldUseMargin: boolean = false
|
2023-01-18 05:14:59 +00:00
|
|
|
export let showParent = true
|
2023-04-23 17:37:24 +00:00
|
|
|
export let kind: 'list' | undefined = undefined
|
2023-02-03 05:47:25 +00:00
|
|
|
export let onClick: (() => void) | undefined = undefined
|
2022-04-08 18:05:49 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
{#if value}
|
2023-03-27 15:33:23 +00:00
|
|
|
<span
|
|
|
|
class="name overflow-label select-text"
|
|
|
|
class:with-margin={shouldUseMargin}
|
2023-04-23 17:37:24 +00:00
|
|
|
class:list={kind === 'list'}
|
2023-03-27 15:33:23 +00:00
|
|
|
style:max-width={showParent ? `${value.parents.length !== 0 ? 95 : 100}%` : '100%'}
|
|
|
|
title={value.title}
|
|
|
|
>
|
2023-04-23 17:37:24 +00:00
|
|
|
<DocNavLink object={value} {onClick} component={tracker.component.EditIssue} inline shrink={1} colorInherit>
|
2023-03-17 03:52:32 +00:00
|
|
|
{value.title}
|
2023-03-27 15:33:23 +00:00
|
|
|
</DocNavLink>
|
|
|
|
</span>
|
2023-03-21 01:49:29 +00:00
|
|
|
{#if showParent}
|
|
|
|
<ParentNamesPresenter {value} />
|
|
|
|
{/if}
|
2022-04-08 18:05:49 +00:00
|
|
|
{/if}
|
2022-04-20 16:31:56 +00:00
|
|
|
|
|
|
|
<style lang="scss">
|
2023-03-15 14:06:03 +00:00
|
|
|
.name {
|
2023-03-21 01:49:29 +00:00
|
|
|
flex-shrink: 1;
|
|
|
|
min-width: 1rem;
|
2023-04-23 17:37:24 +00:00
|
|
|
|
|
|
|
&.list {
|
|
|
|
color: var(--theme-caption-color);
|
|
|
|
}
|
2023-03-15 14:06:03 +00:00
|
|
|
&:hover {
|
|
|
|
text-decoration: underline;
|
2022-09-26 09:40:13 +00:00
|
|
|
}
|
2023-03-15 14:06:03 +00:00
|
|
|
&:active {
|
2023-04-23 17:37:24 +00:00
|
|
|
color: var(--theme-content-color);
|
2022-04-20 16:31:56 +00:00
|
|
|
}
|
|
|
|
}
|
2023-03-15 14:06:03 +00:00
|
|
|
|
|
|
|
.with-margin {
|
|
|
|
margin-left: 0.5rem;
|
|
|
|
}
|
2022-04-20 16:31:56 +00:00
|
|
|
</style>
|