mirror of
https://github.com/hcengineering/platform.git
synced 2025-06-04 23:04:47 +00:00
parent
b37c802aa7
commit
4673bbfa6d
@ -364,18 +364,13 @@ export async function findOrUpdate<T extends Doc> (client: TxOperations, space:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function randColor (): string {
|
|
||||||
const letters = '0123456789ABCDEF'
|
|
||||||
let color = '#'
|
|
||||||
for (let i = 0; i < 6; i++) {
|
|
||||||
color += letters[Math.floor(Math.random() * 16)]
|
|
||||||
}
|
|
||||||
return color
|
|
||||||
}
|
|
||||||
|
|
||||||
async function createUpdateSpaceKanban (spaceId: Ref<Vacancy>, client: TxOperations, stateNames: string[]): Promise<Map<string, Ref<State>>> {
|
async function createUpdateSpaceKanban (spaceId: Ref<Vacancy>, client: TxOperations, stateNames: string[]): Promise<Map<string, Ref<State>>> {
|
||||||
const states: Map<string, Ref<State>> = new Map()
|
const states: Map<string, Ref<State>> = new Map()
|
||||||
const stateRanks = genRanks(stateNames.length)
|
const stateRanks = genRanks(stateNames.length)
|
||||||
|
|
||||||
|
const colors: string[] = ['#A5D179', '#77C07B', '#60B96E', '#45AEA3', '#46CBDE', '#47BDF6',
|
||||||
|
'#5AADF6', '#73A6CD', '#B977CB', '#7C6FCD', '#6F7BC5', '#F28469']
|
||||||
|
let pos = 0
|
||||||
for (const st of stateNames) {
|
for (const st of stateNames) {
|
||||||
const rank = stateRanks.next().value
|
const rank = stateRanks.next().value
|
||||||
|
|
||||||
@ -389,7 +384,7 @@ async function createUpdateSpaceKanban (spaceId: Ref<Vacancy>, client: TxOperati
|
|||||||
sid,
|
sid,
|
||||||
{
|
{
|
||||||
title: st,
|
title: st,
|
||||||
color: randColor(),
|
color: colors[(pos++) % colors.length],
|
||||||
rank
|
rank
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
@ -55,7 +55,8 @@ class ElasticAdapter implements FullTextAdapter {
|
|||||||
'attachment.content'
|
'attachment.content'
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
size: 200
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const hits = result.body.hits.hits as any[]
|
const hits = result.body.hits.hits as any[]
|
||||||
|
Loading…
Reference in New Issue
Block a user