mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-22 19:11:33 +03:00
UBERF-4957: Fix status colors (#4369)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
fd24ac2158
commit
12924cb79c
@ -31,7 +31,7 @@
|
||||
showPopup,
|
||||
themeStore
|
||||
} from '@hcengineering/ui'
|
||||
import { ColorsPopup, IconPicker, ObjectPresenter } from '@hcengineering/view-resources'
|
||||
import { ColorsPopup, IconPicker, ObjectPresenter, statusStore } from '@hcengineering/view-resources'
|
||||
import { createEventDispatcher } from 'svelte'
|
||||
import task from '../../plugin'
|
||||
import StatusesPopup from './StatusesPopup.svelte'
|
||||
@ -77,12 +77,12 @@
|
||||
if (res == null) {
|
||||
return
|
||||
}
|
||||
const targetColor = type.statuses.find((p) => p._id === state._id)
|
||||
if (targetColor !== undefined) {
|
||||
const targetColors = type.statuses.filter((p) => p._id === state._id)
|
||||
for (const targetColor of targetColors) {
|
||||
targetColor.color = res
|
||||
}
|
||||
await client.update(type, { statuses: type.statuses })
|
||||
type = type
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@ -174,11 +174,12 @@
|
||||
const projectStatus = getProjectStatus(type, state, categoriesMap)
|
||||
showPopup(IconPicker, { icon: projectStatus?.icon, color: projectStatus?.color, icons }, el, async (result) => {
|
||||
if (result !== undefined && result !== null) {
|
||||
const targetColor = type.statuses.find((p) => p._id === state._id)
|
||||
if (targetColor !== undefined) {
|
||||
const targetColors = type.statuses.filter((p) => p._id === state._id)
|
||||
for (const targetColor of targetColors) {
|
||||
targetColor.color = result.color
|
||||
targetColor.icon = result.icon
|
||||
console.log(result.color)
|
||||
}
|
||||
if (targetColors.length > 0) {
|
||||
await client.update(type, { statuses: type.statuses })
|
||||
type = type
|
||||
}
|
||||
|
@ -145,7 +145,12 @@ export function calculateStatuses (
|
||||
taskTypes: Map<Ref<TaskType>, Data<TaskType>>,
|
||||
override: Array<{ taskTypeId: Ref<TaskType>, statuses: Array<Ref<Status>> }>
|
||||
): ProjectStatus[] {
|
||||
const stIds = new Map(projectType.statuses.map((p) => [p._id, p]))
|
||||
const stIds = new Map<Ref<Status>, ProjectStatus>()
|
||||
for (const s of projectType.statuses) {
|
||||
if (!stIds.has(s._id)) {
|
||||
stIds.set(s._id, s)
|
||||
}
|
||||
}
|
||||
const processed = new Set<string>()
|
||||
const result: ProjectStatus[] = []
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user