Skip to content

Commit

Permalink
Several bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dyang415 committed Sep 15, 2023
1 parent f4fc978 commit 6065c2a
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,6 @@ export default function TopDimensionSlicesTable({
const sensitivity = useSelector(
(state: RootState) => state.comparisonInsight.sensitivity
);
const setTopDriverMode = (mode: "impact" | "outlier") => {
dispatch(setMode(mode));
};
const setSensitvity = (sensitivity: "low" | "medium" | "high") => {
dispatch(setSensitivity(sensitivity));
};

const overallChange =
metric.baselineValue === 0
Expand Down Expand Up @@ -120,7 +114,7 @@ export default function TopDimensionSlicesTable({
<Select
value={mode}
onValueChange={(e) => {
setTopDriverMode(e as any);
dispatch(setMode(e as "impact" | "outlier"));
}}
>
<SelectItem value="impact">All Top Segments</SelectItem>
Expand All @@ -138,7 +132,7 @@ export default function TopDimensionSlicesTable({
<Select
value={sensitivity}
onValueChange={(e) => {
setSensitvity(e as any);
dispatch(setSensitivity(e as "low" | "medium" | "high"));
}}
>
<SelectItem value="low">Low</SelectItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
import { ReactNode } from "react";
import { useDispatch, useSelector } from "react-redux";
import { Md5 } from "ts-md5";
import getSettings from "../../common/server-data/settings";
import { DimensionSliceInfo, DimensionSliceKey } from "../../common/types";
import {
formatDimensionSliceKeyForRendering,
Expand Down Expand Up @@ -227,11 +228,13 @@ export default function TopDimensionSlicesTableRow({
)}
</Text>
</TableCell>
<TableCell>
{renderDebugInfo("P-Score", dimensionSlice.confidence)}
{renderDebugInfo("Z-Score", dimensionSlice.changeDev)}
{renderDebugInfo("Serialized Key", dimensionSlice.serializedKey)}
</TableCell>
{getSettings().showDebugInfo && (
<TableCell>
{renderDebugInfo("P-Score", dimensionSlice.confidence)}
{renderDebugInfo("Z-Score", dimensionSlice.changeDev)}
{renderDebugInfo("Serialized Key", dimensionSlice.serializedKey)}
</TableCell>
)}
</TableRow>
{rowStatus.isExpanded && renderSubSlices()}
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export function DimensionSliceDetailModalMetricCard({
}

function renderSegments() {
if (filteredRelatedSegments.length > 20 && !showAll) {
if (filteredRelatedSegments.length > 10 && !showAll) {
return (
<>
{filteredRelatedSegments
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ export function DimensionSliceDetailModal({
setSegmentInsightLoading(false);
}

setFilteringSegmentKeyComponents([]);

if (selectedSliceKey && supportTImeSeries) {
loadInsight();
loadRelatedSegments();
Expand Down
16 changes: 9 additions & 7 deletions frontend/src/store/comparisonInsight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@ export const comparisonMetricsSlice = createSlice({

setMode: (state, action: PayloadAction<"impact" | "outlier">) => {
state.mode = action.payload;
state.groupRows = true;
[state.tableRowStatus, state.tableRowCSV] = buildRowStatusMap(
state.analyzingMetrics,
true,
Expand Down Expand Up @@ -491,15 +492,14 @@ export const comparisonMetricsSlice = createSlice({
state.tableRowStatusByDimension[dimension].rowStatus[key];

if (!rowStatus.hasCalculatedChildren) {
const dimensionSliceInfoSorted = Object.values(
const dimensionSliceInfo = Object.values(
state.analyzingMetrics.dimensionSliceInfo
)
.filter((sliceInfo) =>
sliceInfo.key.find((k) => k.dimension === dimension)
)
.sort((i1, i2) => Math.abs(i2.impact) - Math.abs(i1.impact));
).filter((sliceInfo) =>
sliceInfo.key.find((k) => k.dimension === dimension)
);
// .sort((i1, i2) => Math.abs(i2.impact) - Math.abs(i1.impact));

dimensionSliceInfoSorted.forEach((sliceInfo) => {
dimensionSliceInfo.forEach((sliceInfo) => {
if (sliceInfo.key.length === 1) {
return;
}
Expand All @@ -515,6 +515,8 @@ export const comparisonMetricsSlice = createSlice({
{},
10
);

rowStatus!.hasCalculatedChildren = true;
});
}
} else {
Expand Down

0 comments on commit 6065c2a

Please sign in to comment.