TSK-1178 Show empty sprint in right panel (#3065)

Signed-off-by: Denis Bunakalya <denis.bunakalya@xored.com>
This commit is contained in:
Denis Bunakalya 2023-04-25 18:33:14 +03:00 committed by GitHub
parent ef5b8ee9d8
commit 123eb6e3ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 57 additions and 58 deletions

View File

@ -174,12 +174,10 @@
</span>
<ComponentEditor value={issue} />
{#if issue.sprint}
<span class="label">
<Label label={tracker.string.Sprint} />
</span>
<SprintEditor value={issue} />
{/if}
<span class="label">
<Label label={tracker.string.Sprint} />
</span>
<SprintEditor value={issue} />
{#if issue.dueDate !== null}
<div class="divider" />

View File

@ -67,8 +67,8 @@
$: twoRows = $deviceInfo.twoRows
</script>
{#if value.sprint || sprint}
{#if kind === 'list'}
{#if kind === 'list'}
{#if value.sprint}
<div class="clear-mins" class:label-wrapper={compression}>
<SprintSelector
{kind}
@ -87,57 +87,57 @@
onChange={handleSprintIdChanged}
/>
</div>
{:else}
<div
class="flex flex-wrap clear-mins"
class:minus-margin={kind === 'list-header'}
class:label-wrapper={compression}
style:flex-direction={twoRows ? 'column' : 'row'}
>
{#if (value.sprint && value.sprint !== $activeSprint && groupBy !== 'sprint') || shouldShowPlaceholder}
<div class="flex-row-center" class:minus-margin-vSpace={kind === 'list-header'} class:compression style:width>
<SprintSelector
{kind}
{size}
{shape}
{width}
{justify}
{isEditable}
{shouldShowLabel}
{popupPlaceholder}
{onlyIcon}
{enlargedText}
showTooltip={{ label: value.sprint ? tracker.string.MoveToSprint : tracker.string.AddToSprint }}
value={value.sprint}
onChange={handleSprintIdChanged}
/>
</div>
{/if}
{#if sprint && kind === 'list-header'}
<div class="flex-row-center" class:minus-margin-space={kind === 'list-header'} class:text-sm={twoRows}>
{#if sprint}
{@const now = Date.now()}
{@const sprintDaysFrom =
now < sprint.startDate
? 0
: now > sprint.targetDate
? getDayOfSprint(sprint.startDate, sprint.targetDate)
: getDayOfSprint(sprint.startDate, now)}
{@const sprintDaysTo = getDayOfSprint(sprint.startDate, sprint.targetDate)}
<DatePresenter value={sprint.startDate} kind={'transparent'} />
<span class="p-1"> / </span>
<DatePresenter value={sprint.targetDate} kind={'transparent'} />
<div class="w-2 min-w-2" />
<!-- Active sprint in time -->
<TimePresenter value={sprintDaysFrom} />
/
<TimePresenter value={sprintDaysTo} />
{/if}
</div>
{/if}
</div>
{/if}
{:else}
<div
class="flex flex-wrap clear-mins"
class:minus-margin={kind === 'list-header'}
class:label-wrapper={compression}
style:flex-direction={twoRows ? 'column' : 'row'}
>
{#if (value.sprint && value.sprint !== $activeSprint && groupBy !== 'sprint') || shouldShowPlaceholder}
<div class="flex-row-center" class:minus-margin-vSpace={kind === 'list-header'} class:compression style:width>
<SprintSelector
{kind}
{size}
{shape}
{width}
{justify}
{isEditable}
{shouldShowLabel}
{popupPlaceholder}
{onlyIcon}
{enlargedText}
showTooltip={{ label: value.sprint ? tracker.string.MoveToSprint : tracker.string.AddToSprint }}
value={value.sprint}
onChange={handleSprintIdChanged}
/>
</div>
{/if}
{#if sprint && kind === 'list-header'}
<div class="flex-row-center" class:minus-margin-space={kind === 'list-header'} class:text-sm={twoRows}>
{#if sprint}
{@const now = Date.now()}
{@const sprintDaysFrom =
now < sprint.startDate
? 0
: now > sprint.targetDate
? getDayOfSprint(sprint.startDate, sprint.targetDate)
: getDayOfSprint(sprint.startDate, now)}
{@const sprintDaysTo = getDayOfSprint(sprint.startDate, sprint.targetDate)}
<DatePresenter value={sprint.startDate} kind={'transparent'} />
<span class="p-1"> / </span>
<DatePresenter value={sprint.targetDate} kind={'transparent'} />
<div class="w-2 min-w-2" />
<!-- Active sprint in time -->
<TimePresenter value={sprintDaysFrom} />
/
<TimePresenter value={sprintDaysTo} />
{/if}
</div>
{/if}
</div>
{/if}
<style lang="scss">

View File

@ -36,6 +36,7 @@
loc.path[4] = 'sprints'
loc.path[5] = value._id
loc.path.length = 6
loc.fragment = undefined
navigate(loc)
}
</script>