feat: preserve query params when navigating back to flow page from flow editor

This commit is contained in:
kasia.oczkowska
2025-03-13 10:55:10 +00:00
parent a5091a76a8
commit 273713e13f
3 changed files with 13 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
import * as React from 'react';
import PropTypes from 'prop-types';
import { Link } from 'react-router-dom';
import { Link, useLocation } from 'react-router-dom';
import Card from '@mui/material/Card';
import IconButton from '@mui/material/IconButton';
import CardActionArea from '@mui/material/CardActionArea';
@@ -34,6 +34,7 @@ function getFlowStatusColor(status) {
}
function FlowRow(props) {
const location = useLocation();
const formatMessage = useFormatMessage();
const contextButtonRef = React.useRef(null);
const [anchorEl, setAnchorEl] = React.useState(null);
@@ -63,6 +64,9 @@ function FlowRow(props) {
component={Link}
to={URLS.FLOW(flow.id)}
data-test="card-action-area"
state={{
from: `${location.pathname}${location.search}${location.hash}`,
}}
>
<CardContent>
<Apps direction="row" gap={1} sx={{ gridArea: 'apps' }}>