[WEB-4438] fix: epics label in y axis of epics(analytics-modal) #7644
This commit is contained in:
parent
bbc465a3b2
commit
b6cf3a5a8b
6 changed files with 19 additions and 11 deletions
|
|
@ -16,10 +16,11 @@ type Props = {
|
||||||
params: IAnalyticsParams;
|
params: IAnalyticsParams;
|
||||||
workspaceSlug: string;
|
workspaceSlug: string;
|
||||||
classNames?: string;
|
classNames?: string;
|
||||||
|
isEpic?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const AnalyticsSelectParams: React.FC<Props> = observer((props) => {
|
export const AnalyticsSelectParams: React.FC<Props> = observer((props) => {
|
||||||
const { control, params, classNames } = props;
|
const { control, params, classNames, isEpic } = props;
|
||||||
const xAxisOptions = useMemo(
|
const xAxisOptions = useMemo(
|
||||||
() => ANALYTICS_X_AXIS_VALUES.filter((option) => option.value !== params.group_by),
|
() => ANALYTICS_X_AXIS_VALUES.filter((option) => option.value !== params.group_by),
|
||||||
[params.group_by]
|
[params.group_by]
|
||||||
|
|
@ -42,7 +43,10 @@ export const AnalyticsSelectParams: React.FC<Props> = observer((props) => {
|
||||||
onChange(val);
|
onChange(val);
|
||||||
}}
|
}}
|
||||||
options={ANALYTICS_Y_AXIS_VALUES}
|
options={ANALYTICS_Y_AXIS_VALUES}
|
||||||
hiddenOptions={[ChartYAxisMetric.ESTIMATE_POINT_COUNT]}
|
hiddenOptions={[
|
||||||
|
ChartYAxisMetric.ESTIMATE_POINT_COUNT,
|
||||||
|
isEpic ? ChartYAxisMetric.WORK_ITEM_COUNT : ChartYAxisMetric.EPIC_WORK_ITEM_COUNT,
|
||||||
|
]}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -10,17 +10,13 @@ import AnalyticsSectionWrapper from "../analytics-section-wrapper";
|
||||||
import { AnalyticsSelectParams } from "../select/analytics-params";
|
import { AnalyticsSelectParams } from "../select/analytics-params";
|
||||||
import PriorityChart from "./priority-chart";
|
import PriorityChart from "./priority-chart";
|
||||||
|
|
||||||
const defaultValues: IAnalyticsParams = {
|
const CustomizedInsights = observer(({ peekView, isEpic }: { peekView?: boolean; isEpic?: boolean }) => {
|
||||||
x_axis: ChartXAxisProperty.PRIORITY,
|
|
||||||
y_axis: ChartYAxisMetric.WORK_ITEM_COUNT,
|
|
||||||
};
|
|
||||||
|
|
||||||
const CustomizedInsights = observer(({ peekView }: { peekView?: boolean }) => {
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { workspaceSlug } = useParams();
|
const { workspaceSlug } = useParams();
|
||||||
const { control, watch, setValue } = useForm<IAnalyticsParams>({
|
const { control, watch, setValue } = useForm<IAnalyticsParams>({
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
...defaultValues,
|
x_axis: ChartXAxisProperty.PRIORITY,
|
||||||
|
y_axis: isEpic ? ChartYAxisMetric.EPIC_WORK_ITEM_COUNT : ChartYAxisMetric.WORK_ITEM_COUNT,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -41,6 +37,7 @@ const CustomizedInsights = observer(({ peekView }: { peekView?: boolean }) => {
|
||||||
setValue={setValue}
|
setValue={setValue}
|
||||||
params={params}
|
params={params}
|
||||||
workspaceSlug={workspaceSlug.toString()}
|
workspaceSlug={workspaceSlug.toString()}
|
||||||
|
isEpic={isEpic}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -17,10 +17,11 @@ type Props = {
|
||||||
projectDetails: IProject | undefined;
|
projectDetails: IProject | undefined;
|
||||||
cycleDetails: ICycle | undefined;
|
cycleDetails: ICycle | undefined;
|
||||||
moduleDetails: IModule | undefined;
|
moduleDetails: IModule | undefined;
|
||||||
|
isEpic?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const WorkItemsModalMainContent: React.FC<Props> = observer((props) => {
|
export const WorkItemsModalMainContent: React.FC<Props> = observer((props) => {
|
||||||
const { projectDetails, cycleDetails, moduleDetails, fullScreen } = props;
|
const { projectDetails, cycleDetails, moduleDetails, fullScreen, isEpic } = props;
|
||||||
const { updateSelectedProjects, updateSelectedCycle, updateSelectedModule, updateIsPeekView } = useAnalytics();
|
const { updateSelectedProjects, updateSelectedCycle, updateSelectedModule, updateIsPeekView } = useAnalytics();
|
||||||
const [isModalConfigured, setIsModalConfigured] = useState(false);
|
const [isModalConfigured, setIsModalConfigured] = useState(false);
|
||||||
|
|
||||||
|
|
@ -72,7 +73,7 @@ export const WorkItemsModalMainContent: React.FC<Props> = observer((props) => {
|
||||||
<div className="flex flex-col gap-14 overflow-y-auto p-6">
|
<div className="flex flex-col gap-14 overflow-y-auto p-6">
|
||||||
<TotalInsights analyticsType="work-items" peekView={!fullScreen} />
|
<TotalInsights analyticsType="work-items" peekView={!fullScreen} />
|
||||||
<CreatedVsResolved />
|
<CreatedVsResolved />
|
||||||
<CustomizedInsights peekView={!fullScreen} />
|
<CustomizedInsights peekView={!fullScreen} isEpic={isEpic} />
|
||||||
<WorkItemsInsightTable />
|
<WorkItemsInsightTable />
|
||||||
</div>
|
</div>
|
||||||
</Tab.Group>
|
</Tab.Group>
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,7 @@ export const WorkItemsModal: React.FC<Props> = observer((props) => {
|
||||||
projectDetails={projectDetails}
|
projectDetails={projectDetails}
|
||||||
cycleDetails={cycleDetails}
|
cycleDetails={cycleDetails}
|
||||||
moduleDetails={moduleDetails}
|
moduleDetails={moduleDetails}
|
||||||
|
isEpic={isEpic}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -174,6 +174,10 @@ export const ANALYTICS_Y_AXIS_VALUES: { value: ChartYAxisMetric; label: string }
|
||||||
value: ChartYAxisMetric.ESTIMATE_POINT_COUNT,
|
value: ChartYAxisMetric.ESTIMATE_POINT_COUNT,
|
||||||
label: "Estimate",
|
label: "Estimate",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
value: ChartYAxisMetric.EPIC_WORK_ITEM_COUNT,
|
||||||
|
label: "Epic",
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export const ANALYTICS_V2_DATE_KEYS = ["completed_at", "target_date", "start_date", "created_at"];
|
export const ANALYTICS_V2_DATE_KEYS = ["completed_at", "target_date", "start_date", "created_at"];
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ export enum ChartYAxisMetric {
|
||||||
WORK_ITEM_DUE_THIS_WEEK_COUNT = "WORK_ITEM_DUE_THIS_WEEK_COUNT",
|
WORK_ITEM_DUE_THIS_WEEK_COUNT = "WORK_ITEM_DUE_THIS_WEEK_COUNT",
|
||||||
WORK_ITEM_DUE_TODAY_COUNT = "WORK_ITEM_DUE_TODAY_COUNT",
|
WORK_ITEM_DUE_TODAY_COUNT = "WORK_ITEM_DUE_TODAY_COUNT",
|
||||||
BLOCKED_WORK_ITEM_COUNT = "BLOCKED_WORK_ITEM_COUNT",
|
BLOCKED_WORK_ITEM_COUNT = "BLOCKED_WORK_ITEM_COUNT",
|
||||||
|
EPIC_WORK_ITEM_COUNT = "EPIC_WORK_ITEM_COUNT",
|
||||||
}
|
}
|
||||||
|
|
||||||
export type TAnalyticsTabsBase = "overview" | "work-items";
|
export type TAnalyticsTabsBase = "overview" | "work-items";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue