You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by hu...@apache.org on 2021/01/04 19:52:16 UTC

[incubator-superset] branch master updated: fix: Change Datasource styling fixes (#12165)

This is an automated email from the ASF dual-hosted git repository.

hugh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 7d88e6b  fix: Change Datasource styling fixes (#12165)
7d88e6b is described below

commit 7d88e6b8912c5384a9b9a54d014e67ca71f568d8
Author: Hugh A. Miles II <hu...@gmail.com>
AuthorDate: Mon Jan 4 14:51:15 2021 -0500

    fix: Change Datasource styling fixes (#12165)
---
 .../src/datasource/ChangeDatasourceModal.tsx       | 53 +++++++++++-----------
 1 file changed, 27 insertions(+), 26 deletions(-)

diff --git a/superset-frontend/src/datasource/ChangeDatasourceModal.tsx b/superset-frontend/src/datasource/ChangeDatasourceModal.tsx
index 0a49d67..8e0bad3 100644
--- a/superset-frontend/src/datasource/ChangeDatasourceModal.tsx
+++ b/superset-frontend/src/datasource/ChangeDatasourceModal.tsx
@@ -36,7 +36,12 @@ import Loading from '../components/Loading';
 import withToasts from '../messageToasts/enhancers/withToasts';
 
 const CONFIRM_WARNING_MESSAGE = t(
-  'Warning! Changing the dataset may break the chart if the metadata (columns/metrics) does not exist in the target dataset',
+  'Warning! Changing the dataset may break the chart if the metadata does not exist.',
+);
+
+const CHANGE_WARNING_MSG = t(
+  'Changing the dataset may break the chart if the chart relies ' +
+    'on columns or metadata that does not exist in the target dataset',
 );
 
 interface Datasource {
@@ -83,11 +88,6 @@ const TABLE_COLUMNS = [
   'creator',
 ].map(col => ({ accessor: col, Header: col }));
 
-const CHANGE_WARNING_MSG = t(
-  'Changing the dataset may break the chart if the chart relies ' +
-    'on columns or metadata that does not exist in the target dataset',
-);
-
 const emptyRequest = {
   pageIndex: 0,
   pageSize: 20,
@@ -186,7 +186,7 @@ const ChangeDatasourceModal: FunctionComponent<ChangeDatasourceModalProps> = ({
         );
       });
     onHide();
-    addSuccessToast('Successfully changed datasource!');
+    addSuccessToast('Successfully changed dataset!');
   };
 
   const handlerCancelConfirm = () => {
@@ -219,8 +219,25 @@ const ChangeDatasourceModal: FunctionComponent<ChangeDatasourceModalProps> = ({
       show={show}
       onHide={onHide}
       responsive
-      title={t('Select a dataset')}
-      hideFooter
+      title={t('Change Dataset')}
+      footer={
+        <>
+          {confirmChange && (
+            <ConfirmModalStyled>
+              <div className="btn-container">
+                <Button onClick={handlerCancelConfirm}>Cancel</Button>
+                <Button
+                  className="proceed-btn"
+                  buttonStyle="primary"
+                  onClick={handleChangeConfirm}
+                >
+                  Proceed
+                </Button>
+              </div>
+            </ConfirmModalStyled>
+          )}
+        </>
+      }
     >
       <>
         {!confirmChange && (
@@ -251,23 +268,7 @@ const ChangeDatasourceModal: FunctionComponent<ChangeDatasourceModalProps> = ({
             )}
           </>
         )}
-        {confirmChange && (
-          <ConfirmModalStyled>
-            <div className="confirm-modal-container">
-              {CONFIRM_WARNING_MESSAGE}
-              <div className="btn-container">
-                <Button onClick={handlerCancelConfirm}>Cancel</Button>
-                <Button
-                  className="proceed-btn"
-                  buttonStyle="primary"
-                  onClick={handleChangeConfirm}
-                >
-                  Proceed
-                </Button>
-              </div>
-            </div>
-          </ConfirmModalStyled>
-        )}
+        {confirmChange && <>{CONFIRM_WARNING_MESSAGE}</>}
       </>
     </StyledModal>
   );