superset-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-superset] graceguo-supercat commented on a change in pull request #7908: [WiP][Feature] Dashboard filter indicators
Date Thu, 01 Aug 2019 00:03:36 GMT
graceguo-supercat commented on a change in pull request #7908: [WiP][Feature] Dashboard filter
indicators
URL: https://github.com/apache/incubator-superset/pull/7908#discussion_r309478679
 
 

 ##########
 File path: superset/assets/src/dashboard/reducers/dashboardFilters.js
 ##########
 @@ -0,0 +1,125 @@
+/**
+ * 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.
+ */
+/* eslint-disable no-param-reassign */
+/* eslint-disable camelcase */
+import { DASHBOARD_ROOT_ID } from '../util/constants';
+import {
+  ADD_FILTER,
+  REMOVE_FILTER,
+  CHANGE_FILTER,
+  UPDATE_DIRECT_PATH_TO_FILTER,
+} from '../actions/dashboardFilters';
+import { TIME_RANGE } from '../../visualizations/FilterBox/FilterBox';
+import getFilterConfigsFromFormdata from '../util/getFilterConfigsFromFormdata';
+import { buildFilterColorMap } from '../util/dashboardFiltersColorMap';
+import { buildActiveFilters } from '../util/activeDashboardFilters';
+
+export const dashboardFilter = {
+  chartId: 0,
+  componentId: '',
+  directPathToFilter: [],
+  scope: DASHBOARD_ROOT_ID,
+  isDateFilter: false,
+  isInstantFilter: true,
+  columns: {},
+};
+
+export default function dashboardFiltersReducer(dashboardFilters = {}, action) {
+  const actionHandlers = {
+    [ADD_FILTER]() {
+      const { chartId, component, form_data } = action;
+      const columns = getFilterConfigsFromFormdata(form_data);
+      let directPathToFilter = [];
 
 Review comment:
   👍 

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


With regards,
Apache Git Services

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


Mime
View raw message