mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-15 19:52:15 +01:00
fix bug where chart does not update project colors on data change
This commit is contained in:
committed by
Constantin Graf
parent
b2ad4b3785
commit
36cdae523f
@@ -15,6 +15,7 @@ import { getRandomColorWithSeed } from '@/packages/ui/src/utils/color';
|
|||||||
import type { GroupedDataEntries } from '@/packages/api/src';
|
import type { GroupedDataEntries } from '@/packages/api/src';
|
||||||
import { useReportingStore } from '@/utils/useReporting';
|
import { useReportingStore } from '@/utils/useReporting';
|
||||||
import { useProjectsStore } from '@/utils/useProjects';
|
import { useProjectsStore } from '@/utils/useProjects';
|
||||||
|
import { storeToRefs } from 'pinia';
|
||||||
|
|
||||||
use([
|
use([
|
||||||
CanvasRenderer,
|
CanvasRenderer,
|
||||||
@@ -32,7 +33,7 @@ const props = defineProps<{
|
|||||||
type: string | null;
|
type: string | null;
|
||||||
}>();
|
}>();
|
||||||
const { getNameForReportingRowEntry, emptyPlaceholder } = useReportingStore();
|
const { getNameForReportingRowEntry, emptyPlaceholder } = useReportingStore();
|
||||||
const { projects } = useProjectsStore();
|
const { projects } = storeToRefs(useProjectsStore());
|
||||||
|
|
||||||
const groupChartData = computed(() => {
|
const groupChartData = computed(() => {
|
||||||
return (
|
return (
|
||||||
@@ -43,7 +44,7 @@ const groupChartData = computed(() => {
|
|||||||
color = '#CCCCCC';
|
color = '#CCCCCC';
|
||||||
} else if (props.type === 'project') {
|
} else if (props.type === 'project') {
|
||||||
color =
|
color =
|
||||||
projects.find((project) => project.id === entry.key)
|
projects.value?.find((project) => project.id === entry.key)
|
||||||
?.color ?? '#CCCCCC';
|
?.color ?? '#CCCCCC';
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user