You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ly...@apache.org on 2023/01/19 16:36:00 UTC
[superset] 06/21: Cancel now redirects to the previous page
This is an automated email from the ASF dual-hosted git repository.
lyndsi pushed a commit to branch lyndsi/enable-dataset-creation
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 556d79e2ac8bda14d49c4f646c0f15b4c234f055
Author: lyndsiWilliams <kc...@gmail.com>
AuthorDate: Tue Jan 3 18:53:10 2023 -0600
Cancel now redirects to the previous page
---
.../src/views/CRUD/data/dataset/AddDataset/Footer/index.tsx | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/superset-frontend/src/views/CRUD/data/dataset/AddDataset/Footer/index.tsx b/superset-frontend/src/views/CRUD/data/dataset/AddDataset/Footer/index.tsx
index 5aecec0bb8..28e2f71a6f 100644
--- a/superset-frontend/src/views/CRUD/data/dataset/AddDataset/Footer/index.tsx
+++ b/superset-frontend/src/views/CRUD/data/dataset/AddDataset/Footer/index.tsx
@@ -17,6 +17,7 @@
* under the License.
*/
import React from 'react';
+import { useHistory } from 'react-router-dom';
import Button from 'src/components/Button';
import { t } from '@superset-ui/core';
import { useSingleViewResource } from 'src/views/CRUD/hooks';
@@ -49,12 +50,12 @@ const LOG_ACTIONS = [
];
function Footer({
- url,
datasetObject,
addDangerToast,
hasColumns = false,
datasets,
}: FooterProps) {
+ const history = useHistory();
const { createResource } = useSingleViewResource<Partial<DatasetObject>>(
'dataset',
t('dataset'),
@@ -72,11 +73,7 @@ function Footer({
return LOG_ACTIONS[value];
};
- const goToPreviousUrl = () => {
- // this is a placeholder url until the final feature gets implemented
- // at that point we will be passing in the url of the previous location.
- window.location.href = url;
- };
+ const goToPreviousUrl = () => history.goBack();
const cancelButtonOnClick = () => {
if (!datasetObject) {