const { data: measuresAndLeak } = useMeasuresAndLeakQuery({
componentKey: component.key,
+ branchLike: branch,
metricKeys:
component.qualifier === ComponentQualifier.Project
? projectQualityGateStatus?.conditions !== undefined
({
componentKey,
metricKeys,
+ branchLike,
branchParameters,
}: {
+ branchLike?: BranchLike;
branchParameters?: BranchParameters;
componentKey: string;
metricKeys: string[];
}) => {
const queryClient = useQueryClient();
return queryOptions({
- queryKey: ['measures', 'details', 'component', componentKey, metricKeys, branchParameters],
+ queryKey: [
+ 'measures',
+ 'details',
+ 'component',
+ componentKey,
+ metricKeys,
+ branchLike,
+ branchParameters,
+ ],
queryFn: async () => {
// TODO remove this once all metrics are supported
const filteredMetricKeys = metricKeys.filter(
metricKeys.forEach((metricKey) => {
const measure = measuresMapByMetricKey[metricKey]?.[0] ?? null;
queryClient.setQueryData<Measure>(
- ['measures', 'details', componentKey, metricKey],
+ ['measures', 'details', componentKey, 'branchLike', branchLike, metricKey],
measure,
);
});