mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-22 00:10:37 +00:00
State templates minor fixes (#1736)
Signed-off-by: Denis Bykhov <80476319+BykhovDenis@users.noreply.github.com>
This commit is contained in:
parent
3019d1e790
commit
5e7c320fb5
@ -55,6 +55,19 @@
|
||||
title: 'New Template'
|
||||
})
|
||||
|
||||
await client.addCollection(
|
||||
task.class.StateTemplate,
|
||||
space as Ref<Doc> as Ref<Space>,
|
||||
template,
|
||||
task.class.KanbanTemplate,
|
||||
'statesC',
|
||||
{
|
||||
title: 'New State',
|
||||
color: 9,
|
||||
rank: [...genRanks(1)][0]
|
||||
}
|
||||
)
|
||||
|
||||
const ranks = [...genRanks(2)]
|
||||
const doneStates = [
|
||||
{
|
||||
@ -99,14 +112,16 @@
|
||||
{#each templates as t (t._id)}
|
||||
<div class="ac-column__list-item" class:selected={t._id === template?._id} on:click={() => select(t)}>
|
||||
<AttributeEditor maxWidth={'15rem'} _class={task.class.KanbanTemplate} object={t} key="title" />
|
||||
<div
|
||||
class="hover-trans"
|
||||
on:click|stopPropagation={(ev) => {
|
||||
showPopup(ContextMenu, { object: t }, eventToHTMLElement(ev), () => {})
|
||||
}}
|
||||
>
|
||||
<IconMoreH size={'medium'} />
|
||||
</div>
|
||||
{#if templates.length > 1}
|
||||
<div
|
||||
class="hover-trans"
|
||||
on:click|stopPropagation={(ev) => {
|
||||
showPopup(ContextMenu, { object: t }, eventToHTMLElement(ev), () => {})
|
||||
}}
|
||||
>
|
||||
<IconMoreH size={'medium'} />
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
|
@ -118,19 +118,21 @@
|
||||
<div class="flex-grow caption-color">
|
||||
<AttributeEditor maxWidth={'20rem'} _class={state._class} object={state} key="title" />
|
||||
</div>
|
||||
<div
|
||||
class="tool hover-trans"
|
||||
on:click={(ev) => {
|
||||
showPopup(
|
||||
StatusesPopup,
|
||||
{ onDelete: () => dispatch('delete', { state }) },
|
||||
eventToHTMLElement(ev),
|
||||
() => {}
|
||||
)
|
||||
}}
|
||||
>
|
||||
<IconMoreH size={'medium'} />
|
||||
</div>
|
||||
{#if states.length > 1}
|
||||
<div
|
||||
class="tool hover-trans"
|
||||
on:click={(ev) => {
|
||||
showPopup(
|
||||
StatusesPopup,
|
||||
{ onDelete: () => dispatch('delete', { state }) },
|
||||
eventToHTMLElement(ev),
|
||||
() => {}
|
||||
)
|
||||
}}
|
||||
>
|
||||
<IconMoreH size={'medium'} />
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
{/each}
|
||||
|
@ -257,6 +257,12 @@ export async function createKanban (
|
||||
templateId?: Ref<KanbanTemplate>
|
||||
): Promise<Ref<Kanban>> {
|
||||
if (templateId === undefined) {
|
||||
await client.createDoc(task.class.State, attachedTo, {
|
||||
title: 'New State',
|
||||
color: 9,
|
||||
rank: [...genRanks(1)][0]
|
||||
})
|
||||
|
||||
const ranks = [...genRanks(2)]
|
||||
await Promise.all([
|
||||
client.createDoc(task.class.WonState, attachedTo, {
|
||||
|
Loading…
Reference in New Issue
Block a user