You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/12/09 07:34:20 UTC

[GitHub] [incubator-superset] rusackas commented on a change in pull request #11964: refactor : Transform FilterScopeModal to Typescript

rusackas commented on a change in pull request #11964:
URL: https://github.com/apache/incubator-superset/pull/11964#discussion_r539071503



##########
File path: superset-frontend/src/dashboard/components/filterscope/FilterScopeModal.tsx
##########
@@ -16,50 +16,56 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-import React from 'react';
-import PropTypes from 'prop-types';
+import React, { RefObject } from 'react';
 import { styled } from '@superset-ui/core';
 
-import ModalTrigger from '../../../components/ModalTrigger';
-import FilterScope from '../../containers/FilterScope';
+import ModalTrigger from 'src/components/ModalTrigger';
+import FilterScope from 'src/dashboard/containers/FilterScope';
 
-const propTypes = {
-  triggerNode: PropTypes.node.isRequired,
+type FilterScopeModalProps = {
+  triggerNode: JSX.Element;
 };
 
 const FilterScopeModalBody = styled.div(({ theme: { gridUnit } }) => ({
   padding: gridUnit * 2,
   paddingBottom: gridUnit * 3,
 }));
 
-export default class FilterScopeModal extends React.PureComponent {
-  constructor(props) {
+export default class FilterScopeModal extends React.PureComponent<
+  FilterScopeModalProps,
+  {}
+> {
+  modal: RefObject<ModalTrigger>;
+
+  constructor(props: FilterScopeModalProps) {
     super(props);
 
     this.modal = React.createRef();
     this.handleCloseModal = this.handleCloseModal.bind(this);
   }
 
-  handleCloseModal() {
+  handleCloseModal(): any {

Review comment:
       ```suggestion
     handleCloseModal(): void {
   ```
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org