mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-23 00:37:47 +00:00
TSK-856. Fixed layout in Issues (#2781)
Signed-off-by: Alexander Platov <sas_lord@mail.ru>
This commit is contained in:
parent
602b23acd1
commit
b5a74cdbc9
@ -570,7 +570,7 @@ export function createModel (builder: Builder): void {
|
|||||||
{
|
{
|
||||||
key: '$lookup.labels',
|
key: '$lookup.labels',
|
||||||
presenter: tags.component.LabelsPresenter,
|
presenter: tags.component.LabelsPresenter,
|
||||||
props: { kind: 'list', full: false, lookupField: 'labels' }
|
props: { kind: 'list', full: false, lookupField: 'labels', listProps: { optional: true, compression: true } }
|
||||||
},
|
},
|
||||||
{ key: '', presenter: tracker.component.DueDatePresenter, props: { kind: 'list' } },
|
{ key: '', presenter: tracker.component.DueDatePresenter, props: { kind: 'list' } },
|
||||||
{
|
{
|
||||||
@ -583,6 +583,7 @@ export function createModel (builder: Builder): void {
|
|||||||
shouldShowPlaceholder: false,
|
shouldShowPlaceholder: false,
|
||||||
listProps: {
|
listProps: {
|
||||||
excludeByKey: 'component',
|
excludeByKey: 'component',
|
||||||
|
compression: true,
|
||||||
optional: true
|
optional: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -597,6 +598,7 @@ export function createModel (builder: Builder): void {
|
|||||||
shouldShowPlaceholder: false,
|
shouldShowPlaceholder: false,
|
||||||
listProps: {
|
listProps: {
|
||||||
excludeByKey: 'sprint',
|
excludeByKey: 'sprint',
|
||||||
|
compression: true,
|
||||||
optional: true
|
optional: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
export let onClick: ((event: MouseEvent) => void) | undefined = undefined
|
export let onClick: ((event: MouseEvent) => void) | undefined = undefined
|
||||||
export let noUnderline = false
|
export let noUnderline = false
|
||||||
export let inline = false
|
export let inline = false
|
||||||
|
export let shrink: number = 0
|
||||||
|
|
||||||
function clickHandler (e: MouseEvent) {
|
function clickHandler (e: MouseEvent) {
|
||||||
if (disableClick) return
|
if (disableClick) return
|
||||||
@ -40,11 +41,17 @@
|
|||||||
|
|
||||||
{#if disableClick || href === undefined}
|
{#if disableClick || href === undefined}
|
||||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||||
<span class:cursor-pointer={!disableClick} class:noUnderline class:inline on:click={clickHandler}>
|
<span
|
||||||
|
class:cursor-pointer={!disableClick}
|
||||||
|
class:noUnderline
|
||||||
|
class:inline
|
||||||
|
style:flex-shrink={shrink}
|
||||||
|
on:click={clickHandler}
|
||||||
|
>
|
||||||
<slot />
|
<slot />
|
||||||
</span>
|
</span>
|
||||||
{:else}
|
{:else}
|
||||||
<a {href} class:noUnderline class:inline on:click={clickHandler}>
|
<a {href} class:noUnderline class:inline style:flex-shrink={shrink} on:click={clickHandler}>
|
||||||
<slot />
|
<slot />
|
||||||
</a>
|
</a>
|
||||||
{/if}
|
{/if}
|
||||||
@ -54,7 +61,7 @@
|
|||||||
a {
|
a {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex-shrink: 0;
|
min-width: 0;
|
||||||
color: var(--accent-color);
|
color: var(--accent-color);
|
||||||
// overflow: hidden;
|
// overflow: hidden;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
export let kind: 'short' | 'full' = 'short'
|
export let kind: 'short' | 'full' = 'short'
|
||||||
export let isEditable: boolean = false
|
export let isEditable: boolean = false
|
||||||
export let action: (evt: MouseEvent) => Promise<void> | void = async () => {}
|
export let action: (evt: MouseEvent) => Promise<void> | void = async () => {}
|
||||||
|
export let compression: boolean = false
|
||||||
|
|
||||||
export let lookupField: string | undefined
|
export let lookupField: string | undefined
|
||||||
|
|
||||||
@ -50,7 +51,8 @@
|
|||||||
class="labels-container"
|
class="labels-container"
|
||||||
style:justify-content={kind === 'short' ? 'space-between' : 'flex-start'}
|
style:justify-content={kind === 'short' ? 'space-between' : 'flex-start'}
|
||||||
class:w-full={kind === 'full'}
|
class:w-full={kind === 'full'}
|
||||||
style:flex-wrap={kind === 'short' ? 'nowrap' : 'wrap'}
|
style:flex-wrap={kind === 'short' || compression ? 'nowrap' : 'wrap'}
|
||||||
|
style:flex-shrink={compression ? 1 : 0}
|
||||||
use:resizeObserver={(element) => {
|
use:resizeObserver={(element) => {
|
||||||
allWidth = element.clientWidth
|
allWidth = element.clientWidth
|
||||||
}}
|
}}
|
||||||
@ -60,7 +62,7 @@
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{#each items as value, i}
|
{#each items as value, i}
|
||||||
<div class="label-box wrap-{kind}">
|
<div class="label-box wrap-{kind}" title={value.title}>
|
||||||
<TagReferencePresenter attr={undefined} {value} kind={'kanban-labels'} bind:realWidth={widths[i]} />
|
<TagReferencePresenter attr={undefined} {value} kind={'kanban-labels'} bind:realWidth={widths[i]} />
|
||||||
</div>
|
</div>
|
||||||
{/each}
|
{/each}
|
||||||
@ -71,7 +73,7 @@
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex-shrink: 0;
|
// flex-shrink: 0;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
border-radius: 0.25rem;
|
border-radius: 0.25rem;
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
export let onlyIcon: boolean = false
|
export let onlyIcon: boolean = false
|
||||||
export let groupBy: string | undefined = undefined
|
export let groupBy: string | undefined = undefined
|
||||||
export let enlargedText = false
|
export let enlargedText = false
|
||||||
|
export let compression: boolean = false
|
||||||
|
|
||||||
const client = getClient()
|
const client = getClient()
|
||||||
|
|
||||||
@ -50,13 +51,14 @@
|
|||||||
{#if (value.component && value.component !== $activeComponent && groupBy !== 'component') || shouldShowPlaceholder}
|
{#if (value.component && value.component !== $activeComponent && groupBy !== 'component') || shouldShowPlaceholder}
|
||||||
<div
|
<div
|
||||||
class:minus-margin={kind === 'list-header'}
|
class:minus-margin={kind === 'list-header'}
|
||||||
|
class:compression
|
||||||
use:tooltip={{ label: value.component ? tracker.string.MoveToComponent : tracker.string.AddToComponent }}
|
use:tooltip={{ label: value.component ? tracker.string.MoveToComponent : tracker.string.AddToComponent }}
|
||||||
>
|
>
|
||||||
<ComponentSelector
|
<ComponentSelector
|
||||||
{kind}
|
{kind}
|
||||||
{size}
|
{size}
|
||||||
{shape}
|
{shape}
|
||||||
{width}
|
width={compression ? 'min-content' : width}
|
||||||
{justify}
|
{justify}
|
||||||
{isEditable}
|
{isEditable}
|
||||||
{shouldShowLabel}
|
{shouldShowLabel}
|
||||||
@ -73,4 +75,8 @@
|
|||||||
.minus-margin {
|
.minus-margin {
|
||||||
margin-left: -0.5rem;
|
margin-left: -0.5rem;
|
||||||
}
|
}
|
||||||
|
.compression {
|
||||||
|
flex-shrink: 5;
|
||||||
|
min-width: 1rem;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -32,7 +32,11 @@
|
|||||||
<span class="names">
|
<span class="names">
|
||||||
{#each value.parents as parentInfo}
|
{#each value.parents as parentInfo}
|
||||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||||
<span class="name cursor-pointer" on:click={() => handleIssueEditorOpened(parentInfo)}>
|
<span
|
||||||
|
class="name overflow-label cursor-pointer"
|
||||||
|
title={parentInfo.parentTitle}
|
||||||
|
on:click={() => handleIssueEditorOpened(parentInfo)}
|
||||||
|
>
|
||||||
{parentInfo.parentTitle}
|
{parentInfo.parentTitle}
|
||||||
</span>
|
</span>
|
||||||
{/each}
|
{/each}
|
||||||
@ -43,13 +47,12 @@
|
|||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.root {
|
.root {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
margin-left: 0;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
|
|
||||||
.names {
|
.names {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
overflow: hidden;
|
min-width: 0;
|
||||||
white-space: nowrap;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
color: var(--content-color);
|
color: var(--content-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,23 +26,25 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if value}
|
{#if value}
|
||||||
<DocNavLink object={value} {onClick} component={tracker.component.EditIssue} inline>
|
<DocNavLink object={value} {onClick} component={tracker.component.EditIssue} inline shrink={1}>
|
||||||
<span
|
<span
|
||||||
class="name overflow-label select-text"
|
class="name overflow-label select-text"
|
||||||
class:with-margin={shouldUseMargin}
|
class:with-margin={shouldUseMargin}
|
||||||
style:max-width={showParent ? `${value.parents.length !== 0 ? 95 : 100}%` : '100%'}
|
style:max-width={showParent ? `${value.parents.length !== 0 ? 95 : 100}%` : '100%'}
|
||||||
|
title={value.title}
|
||||||
>
|
>
|
||||||
{value.title}
|
{value.title}
|
||||||
</span>
|
</span>
|
||||||
|
</DocNavLink>
|
||||||
{#if showParent}
|
{#if showParent}
|
||||||
<ParentNamesPresenter {value} />
|
<ParentNamesPresenter {value} />
|
||||||
{/if}
|
{/if}
|
||||||
</DocNavLink>
|
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.name {
|
.name {
|
||||||
flex-shrink: 0;
|
flex-shrink: 1;
|
||||||
|
min-width: 1rem;
|
||||||
&:hover {
|
&:hover {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
@ -44,6 +44,7 @@
|
|||||||
|
|
||||||
export let groupBy: string | undefined = undefined
|
export let groupBy: string | undefined = undefined
|
||||||
export let enlargedText: boolean = false
|
export let enlargedText: boolean = false
|
||||||
|
export let compression: boolean = false
|
||||||
|
|
||||||
const client = getClient()
|
const client = getClient()
|
||||||
const spaceQuery = createQuery()
|
const spaceQuery = createQuery()
|
||||||
@ -75,15 +76,16 @@
|
|||||||
<div
|
<div
|
||||||
class="flex flex-wrap"
|
class="flex flex-wrap"
|
||||||
class:minus-margin={kind === 'list-header'}
|
class:minus-margin={kind === 'list-header'}
|
||||||
|
class:compression
|
||||||
style:flex-direction={twoRows ? 'column' : 'row'}
|
style:flex-direction={twoRows ? 'column' : 'row'}
|
||||||
>
|
>
|
||||||
{#if (value.sprint && value.sprint !== $activeSprint && groupBy !== 'sprint') || shouldShowPlaceholder}
|
{#if (value.sprint && value.sprint !== $activeSprint && groupBy !== 'sprint') || shouldShowPlaceholder}
|
||||||
<div class="flex-row-center" class:minus-margin-vSpace={kind === 'list-header'} style:width>
|
<div class="flex-row-center" class:minus-margin-vSpace={kind === 'list-header'} class:compression style:width>
|
||||||
<SprintSelector
|
<SprintSelector
|
||||||
{kind}
|
{kind}
|
||||||
{size}
|
{size}
|
||||||
{shape}
|
{shape}
|
||||||
{width}
|
width={compression ? 'min-content' : width}
|
||||||
{justify}
|
{justify}
|
||||||
{isEditable}
|
{isEditable}
|
||||||
{shouldShowLabel}
|
{shouldShowLabel}
|
||||||
@ -131,4 +133,8 @@
|
|||||||
margin: -0.25rem 0 -0.25rem 0.5rem;
|
margin: -0.25rem 0 -0.25rem 0.5rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.compression {
|
||||||
|
flex-shrink: 5;
|
||||||
|
min-width: 1rem;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
export let inline = false
|
export let inline = false
|
||||||
export let component: AnyComponent = view.component.EditDoc
|
export let component: AnyComponent = view.component.EditDoc
|
||||||
export let props: Record<string, any> = {}
|
export let props: Record<string, any> = {}
|
||||||
|
export let shrink: number = 0
|
||||||
|
|
||||||
const client = getClient()
|
const client = getClient()
|
||||||
const hierarchy = client.getHierarchy()
|
const hierarchy = client.getHierarchy()
|
||||||
@ -44,4 +45,4 @@
|
|||||||
$: getHref(object)
|
$: getHref(object)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<NavLink {disableClick} {onClick} {noUnderline} {inline} {href}><slot /></NavLink>
|
<NavLink {disableClick} {onClick} {noUnderline} {inline} {shrink} {href}><slot /></NavLink>
|
||||||
|
@ -77,6 +77,14 @@
|
|||||||
}
|
}
|
||||||
return { object, ...clearAttributeProps, ...props }
|
return { object, ...clearAttributeProps, ...props }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let noCompressed: number
|
||||||
|
$: if (model) {
|
||||||
|
noCompressed = -1
|
||||||
|
model.forEach((m, i) => {
|
||||||
|
if (m.props?.listProps?.compression) noCompressed = i
|
||||||
|
})
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
@ -114,7 +122,7 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{#each model as attributeModel}
|
{#each model as attributeModel, i}
|
||||||
{@const listProps = attributeModel.props?.listProps}
|
{@const listProps = attributeModel.props?.listProps}
|
||||||
{#if attributeModel.props?.type === 'grow'}
|
{#if attributeModel.props?.type === 'grow'}
|
||||||
<svelte:component this={attributeModel.presenter} />
|
<svelte:component this={attributeModel.presenter} />
|
||||||
@ -135,6 +143,7 @@
|
|||||||
value={getObjectValue(attributeModel.key, docObject) ?? ''}
|
value={getObjectValue(attributeModel.key, docObject) ?? ''}
|
||||||
onChange={getOnChange(docObject, attributeModel)}
|
onChange={getOnChange(docObject, attributeModel)}
|
||||||
kind={'list'}
|
kind={'list'}
|
||||||
|
compression={listProps?.compression && i !== noCompressed}
|
||||||
{...joinProps(attributeModel, docObject, props)}
|
{...joinProps(attributeModel, docObject, props)}
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
|
Loading…
Reference in New Issue
Block a user