Skip to content

Commit 1e9887b

Browse files
authored
TestRun. Do not change order when details modal is shown (#234)
closes Visual-Regression-Tracker/Visual-Regression-Tracker#305
1 parent d81f41f commit 1e9887b

File tree

13 files changed

+50
-44
lines changed

13 files changed

+50
-44
lines changed

package-lock.json

Lines changed: 13 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"konva": "^7.0.3",
1515
"lint-staged": "^10.5.4",
1616
"material-ui-popup-state": "^1.8.3",
17-
"notistack": "^0.9.17",
17+
"notistack": "^1.0.10",
1818
"prettier": "^2.2.1",
1919
"qs": "^6.9.4",
2020
"react": "^16.13.1",

src/components/BuildList/index.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@ const useStyles = makeStyles((theme: Theme) =>
4444
listItemSecondaryAction: {
4545
visibility: "hidden",
4646
},
47-
listItem: {
48-
"&:hover $listItemSecondaryAction": {
49-
visibility: "inherit",
50-
},
51-
},
5247
})
5348
);
5449

@@ -125,9 +120,6 @@ const BuildList: FunctionComponent = () => {
125120
onClick={() => {
126121
selectBuild(buildDispatch, build.id);
127122
}}
128-
classes={{
129-
container: classes.listItem,
130-
}}
131123
>
132124
<ListItemText
133125
disableTypography
@@ -144,7 +136,7 @@ const BuildList: FunctionComponent = () => {
144136
</Typography>
145137
</Grid>
146138
<Grid item>
147-
<Grid container justify="space-between">
139+
<Grid container justifyContent="space-between">
148140
<Grid item>
149141
<Chip size="small" label={build.branchName} />
150142
</Grid>
@@ -174,7 +166,7 @@ const BuildList: FunctionComponent = () => {
174166
</List>
175167
</Box>
176168
<Box height="9%">
177-
<Grid container justify="center">
169+
<Grid container justifyContent="center">
178170
<Grid item>
179171
<Pagination
180172
size="small"

src/components/DrawArea.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export const DrawArea: FunctionComponent<IDrawArea> = ({
128128
container
129129
direction="column"
130130
alignItems="center"
131-
justify="center"
131+
justifyContent="center"
132132
className={classes.progressContainer}
133133
>
134134
<Grid item>

src/components/Header.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,18 @@ const Header: FunctionComponent = () => {
7272
<React.Fragment>
7373
<AppBar position="static" color="default">
7474
<Toolbar>
75-
<Grid container justify="space-between" alignItems="center">
75+
<Grid container justifyContent="space-between" alignItems="center">
7676
<Grid item>
7777
<Link to="/">
7878
<img src={logo} width="60" height="60" alt="logo" />
7979
</Link>
8080
</Grid>
8181
<Grid item>
82-
<Grid container justify="space-between" alignItems="center">
82+
<Grid
83+
container
84+
justifyContent="space-between"
85+
alignItems="center"
86+
>
8387
<GuidedTour />
8488
{loggedIn && (
8589
<IconButton

src/components/LoginForm.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,12 @@ const LoginForm = () => {
7777
</Grid>
7878
</CardContent>
7979
<CardActions>
80-
<Grid container direction="column" justify="center" spacing={3}>
80+
<Grid
81+
container
82+
direction="column"
83+
justifyContent="center"
84+
spacing={3}
85+
>
8186
<Grid item>
8287
<Button
8388
type="submit"

src/components/RegisterForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ const RegisterForm = () => {
122122
</Grid>
123123
</CardContent>
124124
<CardActions>
125-
<Grid container justify="center">
125+
<Grid container justifyContent="center">
126126
<Grid item>
127127
<Button
128128
type="submit"

src/components/TestDetailsDialog/TestDetailsModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ const TestDetailsModal: React.FunctionComponent<{
249249
<React.Fragment>
250250
<AppBar position="sticky">
251251
<Toolbar>
252-
<Grid container justify="space-between">
252+
<Grid container justifyContent="space-between">
253253
<Grid item>
254254
<Typography variant="h6">{testRun.name}</Typography>
255255
</Grid>

src/components/TestRunList/index.tsx

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ const columnsDef: GridColDef[] = [
9797

9898
const TestRunList: React.FunctionComponent = () => {
9999
const { enqueueSnackbar } = useSnackbar();
100-
const { testRuns, loading } = useTestRunState();
100+
const { testRun, testRuns, loading } = useTestRunState();
101101
const { selectedBuildId } = useBuildState();
102102
const testRunDispatch = useTestRunDispatch();
103103

@@ -148,14 +148,17 @@ const TestRunList: React.FunctionComponent = () => {
148148
);
149149
}}
150150
onStateChange={(props: GridStateChangeParams) => {
151-
testRunDispatch({
152-
type: "filter",
153-
payload: props.state.visibleRows.visibleRows,
154-
});
155-
testRunDispatch({
156-
type: "sort",
157-
payload: props.state.sorting.sortedRows,
158-
});
151+
if (!testRun) {
152+
// only if testRun modal is not shown
153+
testRunDispatch({
154+
type: "filter",
155+
payload: props.state.visibleRows.visibleRows,
156+
});
157+
testRunDispatch({
158+
type: "sort",
159+
payload: props.state.sorting.sortedRows,
160+
});
161+
}
159162
}}
160163
/>
161164
)}

src/contexts/testRun.context.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ function testRunReducer(state: State, action: IAction): State {
156156
}
157157
return t;
158158
}),
159+
testRun:
160+
state.testRun &&
161+
action.payload.find((item) => item.id === state.testRun!.id),
159162
};
160163
case "touched":
161164
return {

0 commit comments

Comments
 (0)