feat(ImportFlowDialog): preserve flow filters
This commit is contained in:
@@ -4,7 +4,7 @@ import Button from '@mui/material/Button';
|
||||
import { useTheme } from '@mui/material/styles';
|
||||
import useMediaQuery from '@mui/material/useMediaQuery';
|
||||
import * as React from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { Link, useLocation } from 'react-router-dom';
|
||||
|
||||
import SplitButton from 'components/SplitButton';
|
||||
|
||||
@@ -14,6 +14,7 @@ import useFormatMessage from 'hooks/useFormatMessage';
|
||||
import useAutomatischConfig from 'hooks/useAutomatischConfig';
|
||||
|
||||
export default function FlowsButtons() {
|
||||
const location = useLocation();
|
||||
const formatMessage = useFormatMessage();
|
||||
const currentUserAbility = useCurrentUserAbility();
|
||||
const theme = useTheme();
|
||||
@@ -69,7 +70,7 @@ export default function FlowsButtons() {
|
||||
component={Link}
|
||||
disabled={!canCreateFlow}
|
||||
startIcon={<UploadIcon />}
|
||||
to={URLS.IMPORT_FLOW}
|
||||
to={{ pathname: URLS.IMPORT_FLOW, search: location.search }}
|
||||
data-test="import-flow-button"
|
||||
>
|
||||
{formatMessage('flows.importFlow')}
|
||||
|
||||
@@ -1,30 +1,31 @@
|
||||
import * as React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { useNavigate, Link } from 'react-router-dom';
|
||||
import UploadIcon from '@mui/icons-material/Upload';
|
||||
import Alert from '@mui/material/Alert';
|
||||
import Box from '@mui/material/Box';
|
||||
import Button from '@mui/material/Button';
|
||||
import Stack from '@mui/material/Stack';
|
||||
import Dialog from '@mui/material/Dialog';
|
||||
import DialogActions from '@mui/material/DialogActions';
|
||||
import DialogContent from '@mui/material/DialogContent';
|
||||
import DialogContentText from '@mui/material/DialogContentText';
|
||||
import DialogTitle from '@mui/material/DialogTitle';
|
||||
import Typography from '@mui/material/Typography';
|
||||
import UploadIcon from '@mui/icons-material/Upload';
|
||||
import Stack from '@mui/material/Stack';
|
||||
import Tooltip from '@mui/material/Tooltip';
|
||||
import Box from '@mui/material/Box';
|
||||
import Typography from '@mui/material/Typography';
|
||||
import PropTypes from 'prop-types';
|
||||
import * as React from 'react';
|
||||
import { Link, useLocation, useNavigate } from 'react-router-dom';
|
||||
|
||||
import * as URLS from 'config/urls';
|
||||
import useFormatMessage from 'hooks/useFormatMessage';
|
||||
import FileUploadInput from 'components/FileUploadInput';
|
||||
import useImportFlow from 'hooks/useImportFlow';
|
||||
import * as URLS from 'config/urls';
|
||||
import { getUnifiedErrorMessage } from 'helpers/errors';
|
||||
import useFormatMessage from 'hooks/useFormatMessage';
|
||||
import useImportFlow from 'hooks/useImportFlow';
|
||||
|
||||
function ImportFlowDialog(props) {
|
||||
const { open = true, 'data-test': dataTest = 'import-flow-dialog' } = props;
|
||||
|
||||
const [hasParsingError, setParsingError] = React.useState(false);
|
||||
const [selectedFile, setSelectedFile] = React.useState(null);
|
||||
const location = useLocation();
|
||||
const navigate = useNavigate();
|
||||
const formatMessage = useFormatMessage();
|
||||
|
||||
@@ -72,7 +73,7 @@ function ImportFlowDialog(props) {
|
||||
};
|
||||
|
||||
const onClose = () => {
|
||||
navigate('..');
|
||||
navigate({ pathname: URLS.FLOWS, search: location.search });
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@@ -13,10 +13,10 @@ import {
|
||||
useSearchParams,
|
||||
} from 'react-router-dom';
|
||||
|
||||
import FlowFilters from 'components/FlowFilters';
|
||||
import FlowsButtons from 'components/FlowsButtons';
|
||||
import Container from 'components/Container';
|
||||
import FlowFilters from 'components/FlowFilters';
|
||||
import FlowRow from 'components/FlowRow';
|
||||
import FlowsButtons from 'components/FlowsButtons';
|
||||
import Folders from 'components/Folders';
|
||||
import ImportFlowDialog from 'components/ImportFlowDialog';
|
||||
import NoResultFound from 'components/NoResultFound';
|
||||
@@ -24,10 +24,10 @@ import PageTitle from 'components/PageTitle';
|
||||
import SearchInput from 'components/SearchInput';
|
||||
import TemplatesDialog from 'components/TemplatesDialog/index.ee';
|
||||
import * as URLS from 'config/urls';
|
||||
import objectifyUrlSearchParams from 'helpers/objectifyUrlSearchParams';
|
||||
import useCurrentUserAbility from 'hooks/useCurrentUserAbility';
|
||||
import useFlows from 'hooks/useFlows';
|
||||
import useFormatMessage from 'hooks/useFormatMessage';
|
||||
import objectifyUrlSearchParams from 'helpers/objectifyUrlSearchParams';
|
||||
|
||||
export default function Flows() {
|
||||
const formatMessage = useFormatMessage();
|
||||
|
||||
Reference in New Issue
Block a user