mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-19 14:55:31 +00: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,
|
showPopup,
|
||||||
themeStore
|
themeStore
|
||||||
} from '@hcengineering/ui'
|
} 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 { createEventDispatcher } from 'svelte'
|
||||||
import task from '../../plugin'
|
import task from '../../plugin'
|
||||||
import StatusesPopup from './StatusesPopup.svelte'
|
import StatusesPopup from './StatusesPopup.svelte'
|
||||||
@ -77,12 +77,12 @@
|
|||||||
if (res == null) {
|
if (res == null) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const targetColor = type.statuses.find((p) => p._id === state._id)
|
const targetColors = type.statuses.filter((p) => p._id === state._id)
|
||||||
if (targetColor !== undefined) {
|
for (const targetColor of targetColors) {
|
||||||
targetColor.color = res
|
targetColor.color = res
|
||||||
await client.update(type, { statuses: type.statuses })
|
|
||||||
type = type
|
|
||||||
}
|
}
|
||||||
|
await client.update(type, { statuses: type.statuses })
|
||||||
|
type = type
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -174,11 +174,12 @@
|
|||||||
const projectStatus = getProjectStatus(type, state, categoriesMap)
|
const projectStatus = getProjectStatus(type, state, categoriesMap)
|
||||||
showPopup(IconPicker, { icon: projectStatus?.icon, color: projectStatus?.color, icons }, el, async (result) => {
|
showPopup(IconPicker, { icon: projectStatus?.icon, color: projectStatus?.color, icons }, el, async (result) => {
|
||||||
if (result !== undefined && result !== null) {
|
if (result !== undefined && result !== null) {
|
||||||
const targetColor = type.statuses.find((p) => p._id === state._id)
|
const targetColors = type.statuses.filter((p) => p._id === state._id)
|
||||||
if (targetColor !== undefined) {
|
for (const targetColor of targetColors) {
|
||||||
targetColor.color = result.color
|
targetColor.color = result.color
|
||||||
targetColor.icon = result.icon
|
targetColor.icon = result.icon
|
||||||
console.log(result.color)
|
}
|
||||||
|
if (targetColors.length > 0) {
|
||||||
await client.update(type, { statuses: type.statuses })
|
await client.update(type, { statuses: type.statuses })
|
||||||
type = type
|
type = type
|
||||||
}
|
}
|
||||||
|
@ -145,7 +145,12 @@ export function calculateStatuses (
|
|||||||
taskTypes: Map<Ref<TaskType>, Data<TaskType>>,
|
taskTypes: Map<Ref<TaskType>, Data<TaskType>>,
|
||||||
override: Array<{ taskTypeId: Ref<TaskType>, statuses: Array<Ref<Status>> }>
|
override: Array<{ taskTypeId: Ref<TaskType>, statuses: Array<Ref<Status>> }>
|
||||||
): ProjectStatus[] {
|
): 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 processed = new Set<string>()
|
||||||
const result: ProjectStatus[] = []
|
const result: ProjectStatus[] = []
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user