UBERF-4812 (#4297)

This commit is contained in:
Denis Bykhov 2024-01-04 12:41:37 +06:00 committed by GitHub
parent 639b4317f9
commit a6acb34d92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 35 deletions

View File

@ -108,11 +108,6 @@
}
)
$: statusCounter = tasks.reduce(
(map, task) => map.set(task.status, (map.get(task.status) ?? 0) + 1),
new Map<Ref<Status>, number>()
)
// $: spaceCounter = tasks.reduce(
// (map, task) => map.set(task.space, (map.get(task.space) ?? 0) + 1),
// new Map<Ref<Space>, number>()
@ -295,7 +290,7 @@
</div>
</div>
{:else}
<TaskTypeEditor taskType={selectedTaskType} projectType={type} {taskTypes} {taskTypeCounter} {statusCounter} />
<TaskTypeEditor taskType={selectedTaskType} projectType={type} {taskTypes} {taskTypeCounter} />
{/if}
</div>
</div>

View File

@ -39,7 +39,6 @@
export let taskType: TaskType
export let type: ProjectType
export let states: Status[] = []
export let statusCounter = new Map<Ref<Status>, number>()
const dispatch = createEventDispatcher()
const client = getClient()
@ -205,7 +204,6 @@
<div class="flex-col flex-no-shrink mt-3">
{#each states as state, i}
{@const color = getColor(type, state, categoriesMap)}
{@const counter = statusCounter.get(state._id)}
<!-- svelte-ignore a11y-no-static-element-interactions -->
<div
bind:this={elements[prevIndex + i]}
@ -226,31 +224,26 @@
selected = undefined
}}
>
<div class="bar"><IconCircles size={'small'} /></div>
<!-- svelte-ignore a11y-click-events-have-key-events -->
<div
class="color"
on:click={(ev) => {
if (state.category !== undefined) {
selectIcon(elements[i + prevIndex], state)
} else {
onColor(state, color, elements[i + prevIndex])
}
}}
>
<ObjectPresenter
_class={state._class}
objectId={state._id}
value={state}
props={{ projectType: type._id, taskType: taskType._id }}
/>
</div>
<div class="flex-grow caption-color no-word-wrap">
<!-- <StringPresenter value={state.name} oneLine /> -->
{#if counter !== undefined}
- {counter}
{/if}
<div class="flex-row-center">
<div class="bar"><IconCircles size={'small'} /></div>
<!-- svelte-ignore a11y-click-events-have-key-events -->
<div
class="color"
on:click={(ev) => {
if (state.category !== undefined) {
selectIcon(elements[i + prevIndex], state)
} else {
onColor(state, color, elements[i + prevIndex])
}
}}
>
<ObjectPresenter
_class={state._class}
objectId={state._id}
value={state}
props={{ projectType: type._id, taskType: taskType._id }}
/>
</div>
</div>
<!-- svelte-ignore a11y-click-events-have-key-events -->

View File

@ -32,7 +32,6 @@
export let taskType: TaskType
export let taskTypeCounter: Map<Ref<TaskType>, number>
export let statusCounter: Map<Ref<Status>, number>
export let taskTypes: TaskType[]
@ -113,7 +112,6 @@
{taskType}
type={projectType}
{states}
{statusCounter}
on:delete={async (evt) => {
const index = taskType.statuses.findIndex((p) => p === evt.detail.state._id)
taskType.statuses.splice(index, 1)