villebro commented on a change in pull request #13625:
URL: https://github.com/apache/superset/pull/13625#discussion_r595173632



##########
File path: superset-frontend/src/dashboard/actions/dashboardInfo.ts
##########
@@ -0,0 +1,81 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { Dispatch } from 'redux';
+import { makeApi } from '@superset-ui/core';
+import { ChartConfiguration, DashboardInfo } from '../reducers/types';
+
+export const DASHBOARD_INFO_UPDATED = 'DASHBOARD_INFO_UPDATED';
+
+// updates partially changed dashboard info
+export function dashboardInfoChanged(newInfo: { metadata: any }) {
+  return { type: DASHBOARD_INFO_UPDATED, newInfo };
+}
+export const SET_CHART_CONFIG_BEGIN = 'SET_CHART_CONFIG_BEGIN';
+export interface SetChartConfigBegin {
+  type: typeof SET_CHART_CONFIG_BEGIN;
+  filterConfig: ChartConfiguration;

Review comment:
       nit: it would be nice if we are consistent with naming: `filterConfig` 
vs `filterConfiguration`. Either is fine, but it seems we already have fields 
with `_configuration` in the dashboard metadata, so perhaps that one is 
preferable. Also, shouldn't this be `chartConfig`/`chartConfiguration`?

##########
File path: 
superset-frontend/src/dashboard/components/CrossFilterScopingModal/utils.ts
##########
@@ -0,0 +1,26 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { FormInstance } from 'antd/lib/form';
+
+// eslint-disable-next-line import/prefer-default-export
+export const setFilterFieldValues = (form: FormInstance, values: object) => {
+  form.setFieldsValue({
+    ...values,
+  });
+};

Review comment:
       Could be a good idea to rename this to `setCrossFilterFieldValues` to 
avoid confusion (also rename the other one `setNativeFilterFieldValues`)

##########
File path: 
superset-frontend/src/dashboard/components/CrossFilterScopingModal/CrossFilterScopingModal.tsx
##########
@@ -0,0 +1,97 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { t } from '@superset-ui/core';
+import React, { FC } from 'react';
+import { useDispatch, useSelector } from 'react-redux';
+import { StyledModal } from '../../../common/components/Modal';
+import Button from '../../../components/Button';
+import { Form } from '../../../common/components';
+import CrossFilterScopingForm from './CrossFilterScopingForm';
+import { CrossFilterScopingFormType } from './types';
+import { StyledForm } from 
'../nativeFilters/FiltersConfigModal/FiltersConfigModal';
+import { setChartConfiguration } from '../../actions/dashboardInfo';
+import { ChartConfiguration } from '../../reducers/types';

Review comment:
       nit: import from `src/...`

##########
File path: superset-frontend/src/dashboard/actions/dashboardInfo.ts
##########
@@ -0,0 +1,81 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { Dispatch } from 'redux';
+import { makeApi } from '@superset-ui/core';
+import { ChartConfiguration, DashboardInfo } from '../reducers/types';
+
+export const DASHBOARD_INFO_UPDATED = 'DASHBOARD_INFO_UPDATED';
+
+// updates partially changed dashboard info
+export function dashboardInfoChanged(newInfo: { metadata: any }) {
+  return { type: DASHBOARD_INFO_UPDATED, newInfo };
+}
+export const SET_CHART_CONFIG_BEGIN = 'SET_CHART_CONFIG_BEGIN';
+export interface SetChartConfigBegin {
+  type: typeof SET_CHART_CONFIG_BEGIN;
+  filterConfig: ChartConfiguration;
+}
+export const SET_CHART_CONFIG_COMPLETE = 'SET_CHART_CONFIG_COMPLETE';
+export interface SetChartConfigComplete {
+  type: typeof SET_CHART_CONFIG_COMPLETE;
+  filterConfig: ChartConfiguration;
+}
+export const SET_CHART_CONFIG_FAIL = 'SET_CHART_CONFIG_FAIL';
+export interface SetChartConfigFail {
+  type: typeof SET_CHART_CONFIG_FAIL;
+  filterConfig: ChartConfiguration;
+}

Review comment:
       Same here `filterConfig` -> `chartConfig`




----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to