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 2021/02/18 19:38:52 UTC

[GitHub] [superset] ktmud commented on a change in pull request #13221: refactor(explore): convert ControlPanelsContainer to typescript

ktmud commented on a change in pull request #13221:
URL: https://github.com/apache/superset/pull/13221#discussion_r578685551



##########
File path: superset-frontend/src/visualizations/FilterBox/FilterBox.jsx
##########
@@ -298,7 +298,6 @@ class FilterBox extends React.PureComponent {
       datasourceFilters.push(
         <ControlRow
           key="sqla-filters"
-          className="control-row"

Review comment:
       This prop is not used in the `ControlRow` component.

##########
File path: superset-frontend/src/explore/actions/exploreActions.ts
##########
@@ -109,11 +109,6 @@ export function setExploreControls(formData: QueryFormData) {
   return { type: SET_EXPLORE_CONTROLS, formData };
 }
 
-export const REMOVE_CONTROL_PANEL_ALERT = 'REMOVE_CONTROL_PANEL_ALERT';
-export function removeControlPanelAlert() {
-  return { type: REMOVE_CONTROL_PANEL_ALERT };
-}

Review comment:
       Cleaning up dead code.
   
   <img width="530" alt="alert-deprecated" src="https://user-images.githubusercontent.com/335541/108408702-391dde00-71da-11eb-811e-ffdaf3be596a.png">
   
   This is the alert this action is trying to clear, which we are not using anymore.

##########
File path: superset-frontend/src/explore/controls.jsx
##########
@@ -355,8 +355,9 @@ export const controls = {
         "using the engine's local timezone. Note one can explicitly set the timezone " +
         'per the ISO 8601 format if specifying either the start and/or end time.',
     ),
-    mapStateToProps: state => ({
-      endpoints: state.form_data ? state.form_data.time_range_endpoints : null,
+    provideFormDataToProps: true,

Review comment:
       Need to add this in `superset-ui/chart-controls`, too. 

##########
File path: superset-frontend/src/explore/components/ControlPanelsContainer.tsx
##########
@@ -161,29 +178,39 @@ class ControlPanelsContainer extends React.Component {
         validationErrors={validationErrors}
         actions={actions}
         formData={provideFormDataToProps ? formData : null}
-        datasource={formData?.datasource}

Review comment:
       Remove this exposed `datasource` prop from #12609  since it's already available in `formData`, plus The typing would not conform with `datasource` for `DatasourceControl`, which uses the whole metadata of a datasource. 
   
   cc @pkdotson @zhaoyongjie 




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