You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by vi...@apache.org on 2021/01/12 12:35:02 UTC

[superset] 07/08: fix: Refresh Interval Modal dropdown (#12406)

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

villebro pushed a commit to branch 1.0
in repository https://gitbox.apache.org/repos/asf/superset.git

commit d940cae8d5d5794733fc5f282d1538cc9aaaca73
Author: Agata Stawarz <47...@users.noreply.github.com>
AuthorDate: Mon Jan 11 20:58:28 2021 +0100

    fix: Refresh Interval Modal dropdown (#12406)
---
 .../dashboard/components/RefreshIntervalModal_spec.jsx       | 12 ++++++++----
 .../src/dashboard/components/RefreshIntervalModal.tsx        |  8 +++++++-
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/superset-frontend/spec/javascripts/dashboard/components/RefreshIntervalModal_spec.jsx b/superset-frontend/spec/javascripts/dashboard/components/RefreshIntervalModal_spec.jsx
index e621026..7a2c6c7 100644
--- a/superset-frontend/spec/javascripts/dashboard/components/RefreshIntervalModal_spec.jsx
+++ b/superset-frontend/spec/javascripts/dashboard/components/RefreshIntervalModal_spec.jsx
@@ -17,7 +17,7 @@
  * under the License.
  */
 import React from 'react';
-import { mount, shallow } from 'enzyme';
+import { mount } from 'enzyme';
 
 import ModalTrigger from 'src/components/ModalTrigger';
 import RefreshIntervalModal from 'src/dashboard/components/RefreshIntervalModal';
@@ -66,11 +66,15 @@ describe('RefreshIntervalModal', () => {
       refreshWarning: 'Show warning',
     };
 
-    const wrapper = shallow(<RefreshIntervalModal {...props} />);
+    const wrapper = getMountWrapper(props);
+    wrapper.find('span[role="button"]').simulate('click');
+
     wrapper.instance().handleFrequencyChange({ value: 30 });
-    expect(wrapper.find(ModalTrigger).dive().find(Alert)).toExist();
+    wrapper.update();
+    expect(wrapper.find(ModalTrigger).find(Alert)).toExist();
 
     wrapper.instance().handleFrequencyChange({ value: 3601 });
-    expect(wrapper.find(ModalTrigger).dive().find(Alert)).not.toExist();
+    wrapper.update();
+    expect(wrapper.find(ModalTrigger).find(Alert)).not.toExist();
   });
 });
diff --git a/superset-frontend/src/dashboard/components/RefreshIntervalModal.tsx b/superset-frontend/src/dashboard/components/RefreshIntervalModal.tsx
index a4799d6..0f77f00 100644
--- a/superset-frontend/src/dashboard/components/RefreshIntervalModal.tsx
+++ b/superset-frontend/src/dashboard/components/RefreshIntervalModal.tsx
@@ -38,6 +38,12 @@ export const options = [
   [86400, t('24 hours')],
 ].map(o => ({ value: o[0], label: o[1] }));
 
+const StyledModalTrigger = styled(ModalTrigger)`
+  .ant-modal-body {
+    overflow: visible;
+  }
+`;
+
 const RefreshWarningContainer = styled.div`
   margin-top: ${({ theme }) => theme.gridUnit * 6}px;
 `;
@@ -103,7 +109,7 @@ class RefreshIntervalModal extends React.PureComponent<
       !!refreshFrequency && !!refreshWarning && refreshFrequency < refreshLimit;
 
     return (
-      <ModalTrigger
+      <StyledModalTrigger
         ref={this.modalRef}
         triggerNode={this.props.triggerNode}
         modalTitle={t('Refresh Interval')}