Import fixes (#726)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2021-12-23 20:58:49 +07:00 committed by GitHub
parent b37c802aa7
commit 4673bbfa6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 11 deletions

View File

@ -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>>> {
const states: Map<string, Ref<State>> = new Map()
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) {
const rank = stateRanks.next().value
@ -389,7 +384,7 @@ async function createUpdateSpaceKanban (spaceId: Ref<Vacancy>, client: TxOperati
sid,
{
title: st,
color: randColor(),
color: colors[(pos++) % colors.length],
rank
}
)

View File

@ -55,7 +55,8 @@ class ElasticAdapter implements FullTextAdapter {
'attachment.content'
]
}
}
},
size: 200
}
})
const hits = result.body.hits.hits as any[]