feat(planner): remove large view mode (#5043)

Signed-off-by: Eduard Aksamitov <e@euaaaio.ru>
This commit is contained in:
Eduard Aksamitov 2024-03-25 05:57:35 +03:00 committed by GitHub
parent 2bb4295f4d
commit 9f198a5428
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 17 additions and 55 deletions

View File

@ -26,7 +26,6 @@
import ToDoPriorityPresenter from './ToDoPriorityPresenter.svelte' import ToDoPriorityPresenter from './ToDoPriorityPresenter.svelte'
export let todo: WithLookup<ToDo> export let todo: WithLookup<ToDo>
export let size: 'small' | 'large' = 'small'
export let planned: boolean = true export let planned: boolean = true
export let isNew: boolean = false export let isNew: boolean = false
@ -69,7 +68,7 @@
</script> </script>
<button <button
class="hulyToDoLine-container {size}" class="hulyToDoLine-container"
class:hovered class:hovered
class:isDone class:isDone
on:click|stopPropagation={open} on:click|stopPropagation={open}
@ -90,44 +89,21 @@
<ToDoCheckbox checked={isDone} priority={todo.priority} on:value={markDone} /> <ToDoCheckbox checked={isDone} priority={todo.priority} on:value={markDone} />
{/if} {/if}
</div> </div>
{#if size === 'small'}
<ToDoPriorityPresenter value={todo.priority} muted={isDone} /> <ToDoPriorityPresenter value={todo.priority} muted={isDone} />
{/if}
</div> </div>
</div> </div>
<WorkItemPresenter {todo} kind={'todo-line'} withoutSpace /> <WorkItemPresenter {todo} kind={'todo-line'} withoutSpace />
{#if size === 'small'}
<div class="hulyToDoLine-title hulyToDoLine-top-align top-12 text-left font-regular-14 overflow-label"> <div class="hulyToDoLine-title hulyToDoLine-top-align top-12 text-left font-regular-14 overflow-label">
{todo.title} {todo.title}
</div> </div>
{:else}
<div class="flex-col flex-gap-2 flex-grow text-left">
<div class="hulyToDoLine-title hulyToDoLine-top-align top-12 text-left font-regular-14">
{todo.title}
</div>
{#if todo.labels && todo.labels > 0 && todo.priority !== ToDoPriority.NoPriority}
<div class="flex-row-center flex-grow flex-gap-2">
{#if todo.labels && todo.labels > 0}
<Component
is={tags.component.LabelsPresenter}
props={{ object: todo, value: todo.labels, kind: 'todo' }}
/>
{/if}
<ToDoPriorityPresenter value={todo.priority} muted={isDone} showLabel />
</div>
{/if}
</div>
{/if}
</div> </div>
<div class="flex-row-top flex-no-shrink flex-gap-2"> <div class="flex-row-top flex-no-shrink flex-gap-2">
{#if size === 'small'}
<div class="flex-row-center min-h-6 max-h-6 flex-gap-2"> <div class="flex-row-center min-h-6 max-h-6 flex-gap-2">
<Component <Component
is={tags.component.LabelsPresenter} is={tags.component.LabelsPresenter}
props={{ object: todo, value: todo.labels, kind: 'todo-compact' }} props={{ object: todo, value: todo.labels, kind: 'todo-compact' }}
/> />
</div> </div>
{/if}
</div> </div>
<div class="flex flex-no-shrink flex-gap-3 pl-2"> <div class="flex flex-no-shrink flex-gap-3 pl-2">
{#if events.length > 0} {#if events.length > 0}

View File

@ -20,20 +20,20 @@
import type { Project } from '@hcengineering/tracker' import type { Project } from '@hcengineering/tracker'
import type { ToDosMode } from '..' import type { ToDosMode } from '..'
import { AccordionItem } from '@hcengineering/ui' import { AccordionItem } from '@hcengineering/ui'
import { getClient } from '@hcengineering/presentation'
import { makeRank } from '@hcengineering/task'
import ToDoProjectGroup from './ToDoProjectGroup.svelte'
import ToDoDraggable from './ToDoDraggable.svelte' import ToDoDraggable from './ToDoDraggable.svelte'
import ToDoDuration from './ToDoDuration.svelte' import ToDoDuration from './ToDoDuration.svelte'
import ToDoElement from './ToDoElement.svelte' import ToDoElement from './ToDoElement.svelte'
import { dragging } from '../dragging' import { dragging } from '../dragging'
import ToDoProjectGroup from './ToDoProjectGroup.svelte' import time from '../plugin'
import { getClient } from '@hcengineering/presentation'
import { makeRank } from '@hcengineering/task'
export let mode: ToDosMode export let mode: ToDosMode
export let title: IntlString export let title: IntlString
export let todos: WithLookup<ToDo>[] export let todos: WithLookup<ToDo>[]
export let showTitle: boolean export let showTitle: boolean
export let showDuration: boolean export let showDuration: boolean
export let largeSize: boolean = false
export let projects: IdMap<Project> export let projects: IdMap<Project>
function getAllWorkslots (todos: WithLookup<ToDo>[]): WorkSlot[] { function getAllWorkslots (todos: WithLookup<ToDo>[]): WorkSlot[] {
@ -111,7 +111,6 @@
todos={todos.filter((td) => td.attachedSpace === group._id)} todos={todos.filter((td) => td.attachedSpace === group._id)}
project={group} project={group}
groupName={title} groupName={title}
{largeSize}
{mode} {mode}
/> />
{/each} {/each}
@ -121,7 +120,6 @@
todos={todos.filter((td) => !hasProject(td.attachedSpace))} todos={todos.filter((td) => !hasProject(td.attachedSpace))}
project={false} project={false}
groupName={title} groupName={title}
{largeSize}
{mode} {mode}
/> />
{/if} {/if}
@ -130,7 +128,7 @@
<div class="flex-col p-4 w-full"> <div class="flex-col p-4 w-full">
{#each todos as todo, index} {#each todos as todo, index}
<ToDoDraggable {todo} {index} groupName={title} projectId={false} on:drop={handleDrop}> <ToDoDraggable {todo} {index} groupName={title} projectId={false} on:drop={handleDrop}>
<ToDoElement {todo} size={largeSize ? 'large' : 'small'} planned={mode !== 'unplanned'} /> <ToDoElement {todo} planned={mode !== 'unplanned'} />
</ToDoDraggable> </ToDoDraggable>
{/each} {/each}
</div> </div>

View File

@ -38,7 +38,6 @@
export let project: Project | false | undefined = undefined export let project: Project | false | undefined = undefined
export let mode: ToDosMode export let mode: ToDosMode
export let groupName: IntlString export let groupName: IntlString
export let largeSize: boolean = false
const client = getClient() const client = getClient()
@ -85,7 +84,7 @@
<AccordionItem {id} {icon} {iconProps} {title} {label} size={'medium'} nested> <AccordionItem {id} {icon} {iconProps} {title} {label} size={'medium'} nested>
{#each todos as todo, index} {#each todos as todo, index}
<ToDoDraggable {todo} {index} {groupName} {projectId} on:drop={handleDrop}> <ToDoDraggable {todo} {index} {groupName} {projectId} on:drop={handleDrop}>
<ToDoElement {todo} size={largeSize ? 'large' : 'small'} planned={mode !== 'unplanned'} /> <ToDoElement {todo} planned={mode !== 'unplanned'} />
</ToDoDraggable> </ToDoDraggable>
{/each} {/each}
</AccordionItem> </AccordionItem>

View File

@ -42,7 +42,6 @@
const acc = getCurrentAccount() as PersonAccount const acc = getCurrentAccount() as PersonAccount
const user = acc.person const user = acc.person
let largeSize: boolean = false
const doneQuery = createQuery() const doneQuery = createQuery()
const inboxQuery = createQuery() const inboxQuery = createQuery()
@ -302,15 +301,6 @@
/> />
{/if} {/if}
</div> </div>
<svelte:fragment slot="actions">
<ButtonIcon
icon={IconDiff}
size={'small'}
kind={'tertiary'}
pressed={largeSize}
on:click={() => (largeSize = !largeSize)}
/>
</svelte:fragment>
</Header> </Header>
<CreateToDo fullSize /> <CreateToDo fullSize />
@ -323,7 +313,6 @@
showDuration={group[0] !== time.string.Unplanned} showDuration={group[0] !== time.string.Unplanned}
{mode} {mode}
{projects} {projects}
{largeSize}
/> />
{/each} {/each}
</Scroller> </Scroller>