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 2022/01/05 21:59:09 UTC

[GitHub] [superset] AAfghahi commented on a change in pull request #17939: refactor(ExploreCtasResultsButton): convert to functional component

AAfghahi commented on a change in pull request #17939:
URL: https://github.com/apache/superset/pull/17939#discussion_r779163169



##########
File path: superset-frontend/src/SqlLab/components/ExploreCtasResultsButton/index.jsx
##########
@@ -35,29 +35,19 @@ const propTypes = {
   templateParams: PropTypes.string,
 };
 
-class ExploreCtasResultsButton extends React.PureComponent {
-  constructor(props) {
-    super(props);
-    this.visualize = this.visualize.bind(this);
-    this.onClick = this.onClick.bind(this);
-  }
-
-  onClick() {
-    this.visualize();
-  }
-
-  buildVizOptions() {
+function ExploreCtasResultsButton(props) {
+  function buildVizOptions() {

Review comment:
       Changeall of these to 
   `const buildVizOptions = () =>`
   to confirm with our style guide 

##########
File path: superset-frontend/src/SqlLab/components/ExploreCtasResultsButton/index.jsx
##########
@@ -35,29 +35,19 @@ const propTypes = {
   templateParams: PropTypes.string,
 };
 
-class ExploreCtasResultsButton extends React.PureComponent {
-  constructor(props) {
-    super(props);
-    this.visualize = this.visualize.bind(this);
-    this.onClick = this.onClick.bind(this);
-  }
-
-  onClick() {
-    this.visualize();
-  }
-
-  buildVizOptions() {
+function ExploreCtasResultsButton(props) {

Review comment:
       Do you mind destructuring props here? An easy way to do this is to console.log props and then list them as individual variables instead of using props. 

##########
File path: superset/translations/messages.pot
##########
@@ -13138,7 +13138,7 @@ msgid ""
 msgstr ""
 
 #: superset/templates/superset/fab_overrides/list_with_checkboxes.html:82
-msgid "Use the edit buttom to change this field"
+msgid "Use the edit button to change this field"

Review comment:
       I think this is a leftover commit, that's interesting. 




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

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