Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(planner): remove large view mode #5043

Merged
merged 1 commit into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 11 additions & 35 deletions plugins/time-resources/src/components/ToDoElement.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import ToDoPriorityPresenter from './ToDoPriorityPresenter.svelte'

export let todo: WithLookup<ToDo>
export let size: 'small' | 'large' = 'small'
export let planned: boolean = true
export let isNew: boolean = false

Expand Down Expand Up @@ -69,7 +68,7 @@
</script>

<button
class="hulyToDoLine-container {size}"
class="hulyToDoLine-container"
class:hovered
class:isDone
on:click|stopPropagation={open}
Expand All @@ -90,44 +89,21 @@
<ToDoCheckbox checked={isDone} priority={todo.priority} on:value={markDone} />
{/if}
</div>
{#if size === 'small'}
<ToDoPriorityPresenter value={todo.priority} muted={isDone} />
{/if}
<ToDoPriorityPresenter value={todo.priority} muted={isDone} />
</div>
</div>
<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">
{todo.title}
</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 class="hulyToDoLine-title hulyToDoLine-top-align top-12 text-left font-regular-14 overflow-label">
{todo.title}
</div>
</div>
<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">
<Component
is={tags.component.LabelsPresenter}
props={{ object: todo, value: todo.labels, kind: 'todo-compact' }}
/>
</div>
{/if}
<div class="flex-row-center min-h-6 max-h-6 flex-gap-2">
<Component
is={tags.component.LabelsPresenter}
props={{ object: todo, value: todo.labels, kind: 'todo-compact' }}
/>
</div>
</div>
<div class="flex flex-no-shrink flex-gap-3 pl-2">
{#if events.length > 0}
Expand Down
13 changes: 5 additions & 8 deletions plugins/time-resources/src/components/ToDoGroup.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,20 @@
import type { Project } from '@hcengineering/tracker'
import type { ToDosMode } from '..'
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 ToDoDuration from './ToDoDuration.svelte'
import ToDoElement from './ToDoElement.svelte'
import time from '../plugin'
import { dragging } from '../dragging'
import ToDoProjectGroup from './ToDoProjectGroup.svelte'
import { getClient } from '@hcengineering/presentation'
import { makeRank } from '@hcengineering/task'
import time from '../plugin'

export let mode: ToDosMode
export let title: IntlString
export let todos: WithLookup<ToDo>[]
export let showTitle: boolean
export let showDuration: boolean
export let largeSize: boolean = false
export let projects: IdMap<Project>

function getAllWorkslots (todos: WithLookup<ToDo>[]): WorkSlot[] {
Expand Down Expand Up @@ -110,7 +109,6 @@
todos={todos.filter((td) => td.attachedSpace === group._id)}
project={group}
groupName={title}
{largeSize}
{mode}
/>
{/each}
Expand All @@ -120,7 +118,6 @@
todos={todos.filter((td) => !hasProject(td.attachedSpace))}
project={false}
groupName={title}
{largeSize}
{mode}
/>
{/if}
Expand All @@ -129,7 +126,7 @@
<div class="flex-col p-4 w-full">
{#each todos as todo, index}
<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>
{/each}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
export let project: Project | false | undefined = undefined
export let mode: ToDosMode
export let groupName: IntlString
export let largeSize: boolean = false

const client = getClient()

Expand Down Expand Up @@ -84,7 +83,7 @@
<AccordionItem {icon} {iconProps} {title} {label} size={'medium'} isOpen nested>
{#each todos as todo, index}
<ToDoDraggable {todo} {index} {groupName} {projectId} on:drop={handleDrop}>
<ToDoElement {todo} size={largeSize ? 'large' : 'small'} planned={mode !== 'unplanned'} />
<ToDoElement {todo} planned={mode !== 'unplanned'} />
</ToDoDraggable>
{/each}
</AccordionItem>
11 changes: 0 additions & 11 deletions plugins/time-resources/src/components/ToDos.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@

const acc = getCurrentAccount() as PersonAccount
const user = acc.person
let largeSize: boolean = false

const doneQuery = createQuery()
const inboxQuery = createQuery()
Expand Down Expand Up @@ -302,15 +301,6 @@
/>
{/if}
</div>
<svelte:fragment slot="actions">
<ButtonIcon
icon={IconDiff}
size={'small'}
kind={'tertiary'}
pressed={largeSize}
on:click={() => (largeSize = !largeSize)}
/>
</svelte:fragment>
</Header>
<CreateToDo fullSize />

Expand All @@ -323,7 +313,6 @@
showDuration={group[0] !== time.string.Unplanned}
{mode}
{projects}
{largeSize}
/>
{/each}
</Scroller>
Expand Down