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/04 15:08:34 UTC
[GitHub] [superset] agatapst opened a new pull request #12946: feature(native-filters: Add time filters
agatapst opened a new pull request #12946:
URL: https://github.com/apache/superset/pull/12946
### SUMMARY
The aim of this PR was to create foundations for new native filters' feature: time filters.
User can choose between one more filter type, which is Time.
That's the basics for this feature. What should be added in next PRs:
- UI improvements (if we want to show modal in modal, how to display very long time "pills" in Filter Bar etc.)
- Improve Filter Config Modal validation - right now datasource is required, but in case of time filters it should not
- Implement additional filtering: i.e. inverse
- Might also take a look on performance - it take more time to show time filters result than select filters result
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
![time_filters_small](https://user-images.githubusercontent.com/47450693/106911676-b1789f80-6702-11eb-89a1-1070e9f4a351.gif)
### TEST PLAN
Go to `config.py` and set ` "DASHBOARD_NATIVE_FILTERS": True,`
Go to dashboard and create native filters with filter type "TIME"
### ADDITIONAL INFORMATION
<!--- Check any relevant boxes with "x" -->
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
- [ ] Has associated issue:
- [x] Changes UI
- [ ] Requires DB Migration.
- [ ] Confirm DB Migration upgrade and downgrade tested.
- [x] Introduces new feature or API
- [ ] Removes existing feature or API
cc @villebro @simcha90 @junlincc
----------------------------------------------------------------
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
[GitHub] [superset] villebro commented on a change in pull request #12946: feature(native-filters): Add time filters
Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #12946:
URL: https://github.com/apache/superset/pull/12946#discussion_r570352665
##########
File path: superset-frontend/src/filters/components/Time/TimeFilter.tsx
##########
@@ -0,0 +1,72 @@
+/**
+ * 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 { styled, TimeRange } from '@superset-ui/core';
+import React, { useState, useEffect } from 'react';
+import DateFilterControl from 'src/explore/components/controls/DateFilterControl/DateFilterControl';
+import { getRangeExtraFormData } from 'src/filters/utils';
+import { AntdPluginFilterStylesProps } from '../types';
+import { DEFAULT_FORM_DATA, PluginFilterTimeProps } from './types';
+
+const Styles = styled.div<AntdPluginFilterStylesProps>`
+ height: ${({ height }) => height}px;
+ width: ${({ width }) => width}px;
+ overflow-x: scroll;
+`;
+
+export default function PluginFilterTime(props: PluginFilterTimeProps) {
+ const { formData, setExtraFormData, width, height } = props;
+ const { defaultValue } = {
+ ...DEFAULT_FORM_DATA,
+ ...formData,
+ };
+
+ const firstDefault = (defaultValue?.[0] || '').toString();
+ const [value, setValue] = useState<string>(firstDefault || 'Last week');
+
+ let { groupby = [] } = formData;
+ groupby = Array.isArray(groupby) ? groupby : [groupby];
+
+ const handleTimeRangeChange = (timeRange: TimeRange) => {
+ const [col] = groupby;
+ const extraFormData = getRangeExtraFormData(
+ col,
+ timeRange.since,
+ timeRange.until,
+ );
+ // @ts-ignore
+ setExtraFormData({ extraFormData, currentState: { value: [value] } });
+ };
Review comment:
The handler should set `extraFormData` with the following params (assuming that `timeRange.time_range` is the value that usually gets added to the chart metadata):
```javascript
extraFormData = {
override: {
time_range: timeRange.time_range,
},
};
```
Also, `currentState` should be set with `the native state of the time
----------------------------------------------------------------
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
[GitHub] [superset] ktmud commented on pull request #12946: feat(native-filters): Add time filters
Posted by GitBox <gi...@apache.org>.
ktmud commented on pull request #12946:
URL: https://github.com/apache/superset/pull/12946#issuecomment-773914247
Currently the time range filter in FilterBox is not tied to any datasource. It will apply to any chart that is in scope and has a time column specified, regardless if it's using the same datasource or not.
The new [time filter in native filters](https://github.com/apache/superset/pull/12946) seems to be tied to a specific datasource and field, I'm wondering how this time filter will actually work in the dashboard?
Will it work like the old Time Range filter in `FilterBox`, or will it work on the selected `ds` column on the selected datasource?
----------------------------------------------------------------
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
[GitHub] [superset] villebro closed pull request #12946: feat(native-filters): Add time filters
Posted by GitBox <gi...@apache.org>.
villebro closed pull request #12946:
URL: https://github.com/apache/superset/pull/12946
----------------------------------------------------------------
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
[GitHub] [superset] codecov-io edited a comment on pull request #12946: feat(native-filters): Add time filters
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12946:
URL: https://github.com/apache/superset/pull/12946#issuecomment-773448205
# [Codecov](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=h1) Report
> Merging [#12946](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=desc) (a727bfe) into [master](https://codecov.io/gh/apache/superset/commit/76c225db7ee464d5b642cf7e0aa6c990df88f99d?el=desc) (76c225d) will **decrease** coverage by `9.68%`.
> The diff coverage is `48.78%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12946/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #12946 +/- ##
==========================================
- Coverage 69.14% 59.45% -9.69%
==========================================
Files 1025 816 -209
Lines 48765 41313 -7452
Branches 5188 3283 -1905
==========================================
- Hits 33718 24564 -9154
- Misses 14913 16749 +1836
+ Partials 134 0 -134
```
| Flag | Coverage Δ | |
|---|---|---|
| cypress | `41.86% <48.78%> (-8.97%)` | :arrow_down: |
| javascript | `?` | |
| python | `67.21% <ø> (-0.41%)` | :arrow_down: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...frontend/src/filters/components/Time/buildQuery.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL2J1aWxkUXVlcnkudHM=) | `0.00% <0.00%> (ø)` | |
| [...tend/src/filters/components/Time/transformProps.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL3RyYW5zZm9ybVByb3BzLnRz) | `0.00% <0.00%> (ø)` | |
| [...-frontend/src/visualizations/presets/MainPreset.js](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Zpc3VhbGl6YXRpb25zL3ByZXNldHMvTWFpblByZXNldC5qcw==) | `100.00% <ø> (ø)` | |
| [...s/controls/DateFilterControl/DateFilterControl.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EYXRlRmlsdGVyQ29udHJvbC9EYXRlRmlsdGVyQ29udHJvbC50c3g=) | `61.11% <59.25%> (-22.51%)` | :arrow_down: |
| [...rset-frontend/src/filters/components/Time/index.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL2luZGV4LnRz) | `75.00% <75.00%> (ø)` | |
| [...ontend/src/filters/components/Time/controlPanel.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL2NvbnRyb2xQYW5lbC50cw==) | `100.00% <100.00%> (ø)` | |
| [...tend/src/visualizations/FilterBox/controlPanel.jsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Zpc3VhbGl6YXRpb25zL0ZpbHRlckJveC9jb250cm9sUGFuZWwuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [...set-frontend/src/views/CRUD/alert/ExecutionLog.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYWxlcnQvRXhlY3V0aW9uTG9nLnRzeA==) | `11.76% <0.00%> (-88.24%)` | :arrow_down: |
| [superset-frontend/src/components/IconTooltip.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvSWNvblRvb2x0aXAudHN4) | `13.33% <0.00%> (-86.67%)` | :arrow_down: |
| [...perset-frontend/src/views/CRUD/welcome/Welcome.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvd2VsY29tZS9XZWxjb21lLnRzeA==) | `2.94% <0.00%> (-85.95%)` | :arrow_down: |
| ... and [481 more](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=footer). Last update [76c225d...a727bfe](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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
[GitHub] [superset] codecov-io edited a comment on pull request #12946: feat(native-filters): Add time filters
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12946:
URL: https://github.com/apache/superset/pull/12946#issuecomment-773448205
# [Codecov](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=h1) Report
> Merging [#12946](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=desc) (a727bfe) into [master](https://codecov.io/gh/apache/superset/commit/76c225db7ee464d5b642cf7e0aa6c990df88f99d?el=desc) (76c225d) will **decrease** coverage by `1.99%`.
> The diff coverage is `27.27%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12946/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #12946 +/- ##
==========================================
- Coverage 69.14% 67.14% -2.00%
==========================================
Files 1025 1031 +6
Lines 48765 48819 +54
Branches 5188 5211 +23
==========================================
- Hits 33718 32780 -938
- Misses 14913 15852 +939
- Partials 134 187 +53
```
| Flag | Coverage Δ | |
|---|---|---|
| cypress | `41.86% <48.78%> (-8.97%)` | :arrow_down: |
| javascript | `61.66% <1.29%> (-0.17%)` | :arrow_down: |
| python | `67.21% <ø> (-0.41%)` | :arrow_down: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...c/dashboard/components/nativeFilters/FilterBar.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQmFyLnRzeA==) | `51.36% <ø> (-1.02%)` | :arrow_down: |
| [...oard/components/nativeFilters/FilterConfigForm.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQ29uZmlnRm9ybS50c3g=) | `70.00% <ø> (-5.00%)` | :arrow_down: |
| [...ard/components/nativeFilters/FilterConfigModal.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQ29uZmlnTW9kYWwudHN4) | `69.74% <ø> (-0.16%)` | :arrow_down: |
| [...nd/src/dashboard/components/nativeFilters/utils.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvdXRpbHMudHM=) | `83.60% <ø> (ø)` | |
| [...rontend/src/filters/components/Time/TimeFilter.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL1RpbWVGaWx0ZXIudHN4) | `0.00% <0.00%> (ø)` | |
| [...frontend/src/filters/components/Time/buildQuery.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL2J1aWxkUXVlcnkudHM=) | `0.00% <0.00%> (ø)` | |
| [...tend/src/filters/components/Time/transformProps.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL3RyYW5zZm9ybVByb3BzLnRz) | `0.00% <0.00%> (ø)` | |
| [...rset-frontend/src/filters/components/Time/types.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL3R5cGVzLnRz) | `0.00% <0.00%> (ø)` | |
| [superset-frontend/src/filters/components/index.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9pbmRleC50cw==) | `0.00% <0.00%> (ø)` | |
| [superset-frontend/src/filters/utils.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvdXRpbHMudHM=) | `88.88% <ø> (ø)` | |
| ... and [124 more](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=footer). Last update [76c225d...a727bfe](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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
[GitHub] [superset] villebro commented on a change in pull request #12946: feature(native-filters): Add time filters
Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #12946:
URL: https://github.com/apache/superset/pull/12946#discussion_r570347975
##########
File path: superset-frontend/src/filters/components/Time/buildQuery.ts
##########
@@ -0,0 +1,72 @@
+/**
+ * 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 {
+ buildQueryContext,
+ ColumnType,
+ QueryFormData,
+} from '@superset-ui/core';
+
+/**
+ * The buildQuery function is used to create an instance of QueryContext that's
+ * sent to the chart data endpoint. In addition to containing information of which
+ * datasource to use, it specifies the type (e.g. full payload, samples, query) and
+ * format (e.g. CSV or JSON) of the result and whether or not to force refresh the data from
+ * the datasource as opposed to using a cached copy of the data, if available.
+ *
+ * More importantly though, QueryContext contains a property `queries`, which is an array of
+ * QueryObjects specifying individual data requests to be made. A QueryObject specifies which
+ * columns, metrics and filters, among others, to use during the query. Usually it will be enough
+ * to specify just one query based on the baseQueryObject, but for some more advanced use cases
+ * it is possible to define post processing operations in the QueryObject, or multiple queries
+ * if a viz needs multiple different result sets.
+ */
+export default function buildQuery(formData: QueryFormData) {
+ const { groupby } = formData;
+ const [column] = groupby || [];
+ return buildQueryContext(formData, baseQueryObject => [
Review comment:
This file can probably be removed, as the chart won't be doing any data fetching. Otherwise we need to do some tweaking to make sure viz plugins don't need do do any data fetching.
##########
File path: superset-frontend/src/filters/components/Time/TimeFilter.tsx
##########
@@ -0,0 +1,72 @@
+/**
+ * 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 { styled, TimeRange } from '@superset-ui/core';
+import React, { useState, useEffect } from 'react';
+import DateFilterControl from 'src/explore/components/controls/DateFilterControl/DateFilterControl';
+import { getRangeExtraFormData } from 'src/filters/utils';
+import { AntdPluginFilterStylesProps } from '../types';
+import { DEFAULT_FORM_DATA, PluginFilterTimeProps } from './types';
+
+const Styles = styled.div<AntdPluginFilterStylesProps>`
+ height: ${({ height }) => height}px;
+ width: ${({ width }) => width}px;
+ overflow-x: scroll;
+`;
+
+export default function PluginFilterTime(props: PluginFilterTimeProps) {
+ const { formData, setExtraFormData, width, height } = props;
+ const { defaultValue } = {
+ ...DEFAULT_FORM_DATA,
+ ...formData,
+ };
+
+ const firstDefault = (defaultValue?.[0] || '').toString();
+ const [value, setValue] = useState<string>(firstDefault || 'Last week');
+
+ let { groupby = [] } = formData;
+ groupby = Array.isArray(groupby) ? groupby : [groupby];
+
+ const handleTimeRangeChange = (timeRange: TimeRange) => {
+ const [col] = groupby;
+ const extraFormData = getRangeExtraFormData(
+ col,
+ timeRange.since,
+ timeRange.until,
+ );
+ // @ts-ignore
+ setExtraFormData({ extraFormData, currentState: { value: [value] } });
+ };
Review comment:
The handler should set `extraFormData` with the following params:
```javascript
extraFormData = {
override: {
time_range: timeRange,
},
};
```
##########
File path: superset-frontend/src/filters/components/Time/types.ts
##########
@@ -0,0 +1,56 @@
+/**
+ * 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 {
+ QueryFormData,
+ DataRecord,
+ SetExtraFormDataHook,
+} from '@superset-ui/core';
+import { RefObject } from 'react';
+import { AntdPluginFilterStylesProps } from '../types';
+
+interface PluginFilterTimeCustomizeProps {
+ defaultValue?: (string | number)[] | null;
+ currentValue?: (string | number)[] | null;
+ enableEmptyFilter: boolean;
+ fetchPredicate?: string;
+ inverseSelection: boolean;
+ multiSelect: boolean;
+ showSearch: boolean;
+ inputRef?: RefObject<HTMLInputElement>;
+}
+
+export type AntdPluginFilterSelectQueryFormData = QueryFormData &
+ AntdPluginFilterStylesProps &
+ PluginFilterTimeCustomizeProps;
+
+export type PluginFilterTimeProps = AntdPluginFilterStylesProps & {
+ data: DataRecord[];
+ setExtraFormData: SetExtraFormDataHook;
+ formData: AntdPluginFilterSelectQueryFormData;
+};
+
+export const DEFAULT_FORM_DATA: PluginFilterTimeCustomizeProps = {
+ defaultValue: null,
+ currentValue: null,
+ enableEmptyFilter: false,
+ fetchPredicate: '',
+ inverseSelection: false,
+ multiSelect: true,
+ showSearch: true,
Review comment:
We can probably remove all the other default form data except `defaultValue` and `currentValue`.
##########
File path: superset-frontend/src/filters/components/Time/controlPanel.ts
##########
@@ -0,0 +1,44 @@
+/**
+ * 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, validateNonEmpty } from '@superset-ui/core';
+import { ControlPanelConfig, sections } from '@superset-ui/chart-controls';
+
+const config: ControlPanelConfig = {
+ // For control input types, see: superset-frontend/src/explore/components/controls/index.js
+ controlPanelSections: [
+ // @ts-ignore
+ sections.legacyRegularTime,
+ {
+ label: t('Query'),
+ expanded: true,
+ controlSetRows: [['groupby'], ['adhoc_filters']],
+ },
+ ],
+ controlOverrides: {
+ groupby: {
+ validators: [validateNonEmpty],
+ clearable: false,
+ },
+ row_limit: {
+ default: 100,
+ },
+ },
+};
Review comment:
Same here - a minimal control panel should be enough.
##########
File path: superset-frontend/src/filters/utils.ts
##########
@@ -46,8 +46,8 @@ export const getSelectExtraFormData = (
export const getRangeExtraFormData = (
col: string,
- lower?: number | null,
- upper?: number | null,
+ lower?: number | string | null,
+ upper?: number | string | null,
Review comment:
As the time filter won't be needing this util, we don't need to make changes here.
##########
File path: superset-frontend/src/filters/components/Time/TimeFilter.tsx
##########
@@ -0,0 +1,72 @@
+/**
+ * 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 { styled, TimeRange } from '@superset-ui/core';
+import React, { useState, useEffect } from 'react';
+import DateFilterControl from 'src/explore/components/controls/DateFilterControl/DateFilterControl';
+import { getRangeExtraFormData } from 'src/filters/utils';
+import { AntdPluginFilterStylesProps } from '../types';
+import { DEFAULT_FORM_DATA, PluginFilterTimeProps } from './types';
+
+const Styles = styled.div<AntdPluginFilterStylesProps>`
+ height: ${({ height }) => height}px;
+ width: ${({ width }) => width}px;
+ overflow-x: scroll;
+`;
+
+export default function PluginFilterTime(props: PluginFilterTimeProps) {
+ const { formData, setExtraFormData, width, height } = props;
+ const { defaultValue } = {
+ ...DEFAULT_FORM_DATA,
+ ...formData,
+ };
+
+ const firstDefault = (defaultValue?.[0] || '').toString();
+ const [value, setValue] = useState<string>(firstDefault || 'Last week');
+
+ let { groupby = [] } = formData;
+ groupby = Array.isArray(groupby) ? groupby : [groupby];
+
+ const handleTimeRangeChange = (timeRange: TimeRange) => {
+ const [col] = groupby;
+ const extraFormData = getRangeExtraFormData(
+ col,
+ timeRange.since,
+ timeRange.until,
+ );
+ // @ts-ignore
+ setExtraFormData({ extraFormData, currentState: { value: [value] } });
+ };
Review comment:
The handler should set `extraFormData` with the following params (assuming that `timeRange.time_range` is the value that usually gets added to the chart metadata):
```javascript
extraFormData = {
override: {
time_range: timeRange.time_range,
},
};
```
Also, `currentState` should be set with `the native state of the time
##########
File path: superset-frontend/src/filters/components/Time/TimeFilter.tsx
##########
@@ -0,0 +1,72 @@
+/**
+ * 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 { styled, TimeRange } from '@superset-ui/core';
+import React, { useState, useEffect } from 'react';
+import DateFilterControl from 'src/explore/components/controls/DateFilterControl/DateFilterControl';
+import { getRangeExtraFormData } from 'src/filters/utils';
+import { AntdPluginFilterStylesProps } from '../types';
+import { DEFAULT_FORM_DATA, PluginFilterTimeProps } from './types';
+
+const Styles = styled.div<AntdPluginFilterStylesProps>`
+ height: ${({ height }) => height}px;
+ width: ${({ width }) => width}px;
+ overflow-x: scroll;
+`;
+
+export default function PluginFilterTime(props: PluginFilterTimeProps) {
+ const { formData, setExtraFormData, width, height } = props;
+ const { defaultValue } = {
+ ...DEFAULT_FORM_DATA,
+ ...formData,
+ };
+
+ const firstDefault = (defaultValue?.[0] || '').toString();
+ const [value, setValue] = useState<string>(firstDefault || 'Last week');
+
+ let { groupby = [] } = formData;
+ groupby = Array.isArray(groupby) ? groupby : [groupby];
+
+ const handleTimeRangeChange = (timeRange: TimeRange) => {
+ const [col] = groupby;
+ const extraFormData = getRangeExtraFormData(
+ col,
+ timeRange.since,
+ timeRange.until,
+ );
+ // @ts-ignore
+ setExtraFormData({ extraFormData, currentState: { value: [value] } });
+ };
Review comment:
The handler should set `extraFormData` with the following params (assuming that `timeRange.time_range` is the value that usually gets added to the chart metadata):
```javascript
extraFormData = {
override: {
time_range: timeRange.time_range,
},
};
```
Also, `currentState` should be set with the native state of the time picker, so I'm assuming `timeRange`.
----------------------------------------------------------------
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
[GitHub] [superset] villebro commented on a change in pull request #12946: feat(native-filters): Add time filters
Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #12946:
URL: https://github.com/apache/superset/pull/12946#discussion_r570948771
##########
File path: superset-frontend/src/explore/components/controls/DateFilterControl/DateFilterControl.tsx
##########
@@ -76,12 +77,13 @@ const fetchTimeRange = async (
const endpoint = `/api/v1/time_range/?q=${query}`;
try {
const response = await SupersetClient.get({ endpoint });
- const timeRangeString = buildTimeRangeString(
- response?.json?.result?.since || '',
- response?.json?.result?.until || '',
- );
+ const { since = '', until = '' } = response?.json?.result || {};
+ const timeRangeString = buildTimeRangeString(since, until);
+
return {
value: formatTimeRange(timeRangeString, endpoints),
+ since,
+ until,
Review comment:
instead of returning `since` and `until`, let's rather return `timeRangeString` as that's what we'll be passing to `ExtraFormData`.
##########
File path: superset-frontend/src/filters/components/Time/TimeFilter.tsx
##########
@@ -0,0 +1,72 @@
+/**
+ * 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 { styled, TimeRange } from '@superset-ui/core';
+import React, { useState, useEffect } from 'react';
+import DateFilterControl from 'src/explore/components/controls/DateFilterControl/DateFilterControl';
+import { getRangeExtraFormData } from 'src/filters/utils';
+import { AntdPluginFilterStylesProps } from '../types';
+import { DEFAULT_FORM_DATA, PluginFilterTimeProps } from './types';
+
+const Styles = styled.div<AntdPluginFilterStylesProps>`
+ height: ${({ height }) => height}px;
+ width: ${({ width }) => width}px;
+ overflow-x: scroll;
+`;
+
+export default function PluginFilterTime(props: PluginFilterTimeProps) {
+ const { formData, setExtraFormData, width, height } = props;
+ const { defaultValue } = {
+ ...DEFAULT_FORM_DATA,
+ ...formData,
+ };
+
+ const firstDefault = (defaultValue?.[0] || '').toString();
+ const [value, setValue] = useState<string>(firstDefault || 'Last week');
+
+ let { groupby = [] } = formData;
+ groupby = Array.isArray(groupby) ? groupby : [groupby];
+
+ const handleTimeRangeChange = (timeRange: TimeRange) => {
+ const [col] = groupby;
+ const extraFormData = getRangeExtraFormData(
+ col,
+ timeRange.since,
+ timeRange.until,
+ );
+ // @ts-ignore
+ setExtraFormData({ extraFormData, currentState: { value: [value] } });
+ };
Review comment:
I checked, this would be roughly the correct hook call (assuming `time_range` is what's generated by `buildTimeRangeString`):
```
setExtraFormData({
extraFormData: {
override_form_data: {
time_range,
}
},
currentState: { value: [timeRange] },
});
```
Btw, you'll need to `@ts-ignore` until we update the `ExtraFormData` type in `superset-ui/core`
----------------------------------------------------------------
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
[GitHub] [superset] ktmud edited a comment on pull request #12946: feat(native-filters): Add time filters
Posted by GitBox <gi...@apache.org>.
ktmud edited a comment on pull request #12946:
URL: https://github.com/apache/superset/pull/12946#issuecomment-773914247
Currently the time range filter in FilterBox is not tied to any datasource. It will apply to any chart that is in scope and has a time column specified, regardless if it's using the same datasource or not.
The new time filter in native filters here seems to be tied to a specific datasource and field as users have to specify that when creating one, I'm wondering how this actually works in the dashboard? Will it work like the old Time Range filter in `FilterBox`, or will it applied only to the charts that use the same datasource and has the selected `ds` as its time column?
If it's the latter case, we might want to redesign the whole thing to make users select filter type first before selecting datasource.
----------------------------------------------------------------
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
[GitHub] [superset] junlincc commented on pull request #12946: feat(native-filters): Add time filters
Posted by GitBox <gi...@apache.org>.
junlincc commented on pull request #12946:
URL: https://github.com/apache/superset/pull/12946#issuecomment-773713200
Thank you bringing it so close to the finish line @agatapst !
@villebro should @simcha90 continue to push commits to this branch or should we merge it and open follow up PRs?
----------------------------------------------------------------
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
[GitHub] [superset] villebro commented on pull request #12946: feat(native-filters): Add time filters
Posted by GitBox <gi...@apache.org>.
villebro commented on pull request #12946:
URL: https://github.com/apache/superset/pull/12946#issuecomment-775042334
Closing in favor of #12992 (includes these commits + follow-up commits)
----------------------------------------------------------------
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
[GitHub] [superset] agatapst commented on a change in pull request #12946: feat(native-filters): Add time filters
Posted by GitBox <gi...@apache.org>.
agatapst commented on a change in pull request #12946:
URL: https://github.com/apache/superset/pull/12946#discussion_r570427480
##########
File path: superset-frontend/src/filters/components/Time/TimeFilter.tsx
##########
@@ -0,0 +1,72 @@
+/**
+ * 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 { styled, TimeRange } from '@superset-ui/core';
+import React, { useState, useEffect } from 'react';
+import DateFilterControl from 'src/explore/components/controls/DateFilterControl/DateFilterControl';
+import { getRangeExtraFormData } from 'src/filters/utils';
+import { AntdPluginFilterStylesProps } from '../types';
+import { DEFAULT_FORM_DATA, PluginFilterTimeProps } from './types';
+
+const Styles = styled.div<AntdPluginFilterStylesProps>`
+ height: ${({ height }) => height}px;
+ width: ${({ width }) => width}px;
+ overflow-x: scroll;
+`;
+
+export default function PluginFilterTime(props: PluginFilterTimeProps) {
+ const { formData, setExtraFormData, width, height } = props;
+ const { defaultValue } = {
+ ...DEFAULT_FORM_DATA,
+ ...formData,
+ };
+
+ const firstDefault = (defaultValue?.[0] || '').toString();
+ const [value, setValue] = useState<string>(firstDefault || 'Last week');
+
+ let { groupby = [] } = formData;
+ groupby = Array.isArray(groupby) ? groupby : [groupby];
+
+ const handleTimeRangeChange = (timeRange: TimeRange) => {
+ const [col] = groupby;
+ const extraFormData = getRangeExtraFormData(
+ col,
+ timeRange.since,
+ timeRange.until,
+ );
+ // @ts-ignore
+ setExtraFormData({ extraFormData, currentState: { value: [value] } });
+ };
Review comment:
I have changed it to:
```
const { time_range } = timeRange;
setExtraFormData({
// @ts-ignore
extraFormData: { override: { time_range } },
currentState: { value: [time_range] },
});
```
but it does not seem to work anymore. Maybe is something wrong here?
----------------------------------------------------------------
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
[GitHub] [superset] villebro commented on a change in pull request #12946: feat(native-filters): Add time filters
Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #12946:
URL: https://github.com/apache/superset/pull/12946#discussion_r570917558
##########
File path: superset-frontend/src/filters/components/Time/TimeFilter.tsx
##########
@@ -0,0 +1,72 @@
+/**
+ * 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 { styled, TimeRange } from '@superset-ui/core';
+import React, { useState, useEffect } from 'react';
+import DateFilterControl from 'src/explore/components/controls/DateFilterControl/DateFilterControl';
+import { getRangeExtraFormData } from 'src/filters/utils';
+import { AntdPluginFilterStylesProps } from '../types';
+import { DEFAULT_FORM_DATA, PluginFilterTimeProps } from './types';
+
+const Styles = styled.div<AntdPluginFilterStylesProps>`
+ height: ${({ height }) => height}px;
+ width: ${({ width }) => width}px;
+ overflow-x: scroll;
+`;
+
+export default function PluginFilterTime(props: PluginFilterTimeProps) {
+ const { formData, setExtraFormData, width, height } = props;
+ const { defaultValue } = {
+ ...DEFAULT_FORM_DATA,
+ ...formData,
+ };
+
+ const firstDefault = (defaultValue?.[0] || '').toString();
+ const [value, setValue] = useState<string>(firstDefault || 'Last week');
+
+ let { groupby = [] } = formData;
+ groupby = Array.isArray(groupby) ? groupby : [groupby];
+
+ const handleTimeRangeChange = (timeRange: TimeRange) => {
+ const [col] = groupby;
+ const extraFormData = getRangeExtraFormData(
+ col,
+ timeRange.since,
+ timeRange.until,
+ );
+ // @ts-ignore
+ setExtraFormData({ extraFormData, currentState: { value: [value] } });
+ };
Review comment:
Hmm, let me test this really quickly, it's probably something very simple that's wrong.
----------------------------------------------------------------
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
[GitHub] [superset] codecov-io edited a comment on pull request #12946: feat(native-filters): Add time filters
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12946:
URL: https://github.com/apache/superset/pull/12946#issuecomment-773448205
# [Codecov](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=h1) Report
> Merging [#12946](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=desc) (c2ba1c7) into [master](https://codecov.io/gh/apache/superset/commit/76c225db7ee464d5b642cf7e0aa6c990df88f99d?el=desc) (76c225d) will **decrease** coverage by `16.15%`.
> The diff coverage is `74.35%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12946/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #12946 +/- ##
===========================================
- Coverage 69.14% 52.98% -16.16%
===========================================
Files 1025 483 -542
Lines 48765 17334 -31431
Branches 5188 4485 -703
===========================================
- Hits 33718 9185 -24533
+ Misses 14913 8149 -6764
+ Partials 134 0 -134
```
| Flag | Coverage Δ | |
|---|---|---|
| cypress | `52.98% <74.35%> (+2.15%)` | :arrow_up: |
| javascript | `?` | |
| python | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...c/dashboard/components/nativeFilters/FilterBar.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQmFyLnRzeA==) | `92.00% <ø> (+39.61%)` | :arrow_up: |
| [...ard/components/nativeFilters/FilterConfigModal.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQ29uZmlnTW9kYWwudHN4) | `79.00% <ø> (+9.10%)` | :arrow_up: |
| [...nd/src/dashboard/components/nativeFilters/utils.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvdXRpbHMudHM=) | `53.15% <ø> (-30.46%)` | :arrow_down: |
| [...tend/src/filters/components/Time/transformProps.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL3RyYW5zZm9ybVByb3BzLnRz) | `0.00% <0.00%> (ø)` | |
| [superset-frontend/src/filters/utils.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvdXRpbHMudHM=) | `50.00% <ø> (-38.89%)` | :arrow_down: |
| [...-frontend/src/visualizations/presets/MainPreset.js](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Zpc3VhbGl6YXRpb25zL3ByZXNldHMvTWFpblByZXNldC5qcw==) | `100.00% <ø> (ø)` | |
| [...rset-frontend/src/filters/components/Time/index.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL2luZGV4LnRz) | `75.00% <75.00%> (ø)` | |
| [...s/controls/DateFilterControl/DateFilterControl.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EYXRlRmlsdGVyQ29udHJvbC9EYXRlRmlsdGVyQ29udHJvbC50c3g=) | `81.48% <85.18%> (-2.14%)` | :arrow_down: |
| [...oard/components/nativeFilters/FilterConfigForm.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQ29uZmlnRm9ybS50c3g=) | `77.35% <100.00%> (+2.35%)` | :arrow_up: |
| [...nd/src/dashboard/components/nativeFilters/types.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvdHlwZXMudHM=) | `100.00% <100.00%> (ø)` | |
| ... and [900 more](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=footer). Last update [76c225d...c2ba1c7](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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
[GitHub] [superset] codecov-io edited a comment on pull request #12946: feat(native-filters): Add time filters
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12946:
URL: https://github.com/apache/superset/pull/12946#issuecomment-773448205
# [Codecov](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=h1) Report
> Merging [#12946](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=desc) (c2ba1c7) into [master](https://codecov.io/gh/apache/superset/commit/76c225db7ee464d5b642cf7e0aa6c990df88f99d?el=desc) (76c225d) will **decrease** coverage by `7.08%`.
> The diff coverage is `74.35%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12946/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #12946 +/- ##
==========================================
- Coverage 69.14% 62.06% -7.09%
==========================================
Files 1025 972 -53
Lines 48765 46022 -2743
Branches 5188 4485 -703
==========================================
- Hits 33718 28562 -5156
- Misses 14913 17460 +2547
+ Partials 134 0 -134
```
| Flag | Coverage Δ | |
|---|---|---|
| cypress | `52.98% <74.35%> (+2.15%)` | :arrow_up: |
| javascript | `?` | |
| python | `67.54% <ø> (-0.09%)` | :arrow_down: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...c/dashboard/components/nativeFilters/FilterBar.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQmFyLnRzeA==) | `92.00% <ø> (+39.61%)` | :arrow_up: |
| [...ard/components/nativeFilters/FilterConfigModal.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQ29uZmlnTW9kYWwudHN4) | `79.00% <ø> (+9.10%)` | :arrow_up: |
| [...nd/src/dashboard/components/nativeFilters/utils.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvdXRpbHMudHM=) | `53.15% <ø> (-30.46%)` | :arrow_down: |
| [...tend/src/filters/components/Time/transformProps.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL3RyYW5zZm9ybVByb3BzLnRz) | `0.00% <0.00%> (ø)` | |
| [superset-frontend/src/filters/utils.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvdXRpbHMudHM=) | `50.00% <ø> (-38.89%)` | :arrow_down: |
| [...-frontend/src/visualizations/presets/MainPreset.js](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Zpc3VhbGl6YXRpb25zL3ByZXNldHMvTWFpblByZXNldC5qcw==) | `100.00% <ø> (ø)` | |
| [...rset-frontend/src/filters/components/Time/index.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL2luZGV4LnRz) | `75.00% <75.00%> (ø)` | |
| [...s/controls/DateFilterControl/DateFilterControl.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EYXRlRmlsdGVyQ29udHJvbC9EYXRlRmlsdGVyQ29udHJvbC50c3g=) | `81.48% <85.18%> (-2.14%)` | :arrow_down: |
| [...oard/components/nativeFilters/FilterConfigForm.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQ29uZmlnRm9ybS50c3g=) | `77.35% <100.00%> (+2.35%)` | :arrow_up: |
| [...nd/src/dashboard/components/nativeFilters/types.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvdHlwZXMudHM=) | `100.00% <100.00%> (ø)` | |
| ... and [432 more](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=footer). Last update [76c225d...c2ba1c7](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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
[GitHub] [superset] agatapst commented on a change in pull request #12946: feat(native-filters): Add time filters
Posted by GitBox <gi...@apache.org>.
agatapst commented on a change in pull request #12946:
URL: https://github.com/apache/superset/pull/12946#discussion_r570427480
##########
File path: superset-frontend/src/filters/components/Time/TimeFilter.tsx
##########
@@ -0,0 +1,72 @@
+/**
+ * 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 { styled, TimeRange } from '@superset-ui/core';
+import React, { useState, useEffect } from 'react';
+import DateFilterControl from 'src/explore/components/controls/DateFilterControl/DateFilterControl';
+import { getRangeExtraFormData } from 'src/filters/utils';
+import { AntdPluginFilterStylesProps } from '../types';
+import { DEFAULT_FORM_DATA, PluginFilterTimeProps } from './types';
+
+const Styles = styled.div<AntdPluginFilterStylesProps>`
+ height: ${({ height }) => height}px;
+ width: ${({ width }) => width}px;
+ overflow-x: scroll;
+`;
+
+export default function PluginFilterTime(props: PluginFilterTimeProps) {
+ const { formData, setExtraFormData, width, height } = props;
+ const { defaultValue } = {
+ ...DEFAULT_FORM_DATA,
+ ...formData,
+ };
+
+ const firstDefault = (defaultValue?.[0] || '').toString();
+ const [value, setValue] = useState<string>(firstDefault || 'Last week');
+
+ let { groupby = [] } = formData;
+ groupby = Array.isArray(groupby) ? groupby : [groupby];
+
+ const handleTimeRangeChange = (timeRange: TimeRange) => {
+ const [col] = groupby;
+ const extraFormData = getRangeExtraFormData(
+ col,
+ timeRange.since,
+ timeRange.until,
+ );
+ // @ts-ignore
+ setExtraFormData({ extraFormData, currentState: { value: [value] } });
+ };
Review comment:
I have changed it to:
```
const { time_range } = timeRange;
setExtraFormData({
// @ts-ignore
extraFormData: { override: { time_range } },
currentState: { value: [time_range] },
});
```
but it does not seem to work anymore
----------------------------------------------------------------
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
[GitHub] [superset] ktmud edited a comment on pull request #12946: feat(native-filters): Add time filters
Posted by GitBox <gi...@apache.org>.
ktmud edited a comment on pull request #12946:
URL: https://github.com/apache/superset/pull/12946#issuecomment-773914247
----------------------------------------------------------------
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
[GitHub] [superset] codecov-io edited a comment on pull request #12946: feat(native-filters): Add time filters
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12946:
URL: https://github.com/apache/superset/pull/12946#issuecomment-773448205
# [Codecov](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=h1) Report
> Merging [#12946](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=desc) (c2ba1c7) into [master](https://codecov.io/gh/apache/superset/commit/76c225db7ee464d5b642cf7e0aa6c990df88f99d?el=desc) (76c225d) will **decrease** coverage by `7.06%`.
> The diff coverage is `74.35%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12946/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #12946 +/- ##
==========================================
- Coverage 69.14% 62.07% -7.07%
==========================================
Files 1025 972 -53
Lines 48765 46022 -2743
Branches 5188 4485 -703
==========================================
- Hits 33718 28569 -5149
- Misses 14913 17453 +2540
+ Partials 134 0 -134
```
| Flag | Coverage Δ | |
|---|---|---|
| cypress | `52.98% <74.35%> (+2.15%)` | :arrow_up: |
| javascript | `?` | |
| python | `67.56% <ø> (-0.06%)` | :arrow_down: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...c/dashboard/components/nativeFilters/FilterBar.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQmFyLnRzeA==) | `92.00% <ø> (+39.61%)` | :arrow_up: |
| [...ard/components/nativeFilters/FilterConfigModal.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQ29uZmlnTW9kYWwudHN4) | `79.00% <ø> (+9.10%)` | :arrow_up: |
| [...nd/src/dashboard/components/nativeFilters/utils.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvdXRpbHMudHM=) | `53.15% <ø> (-30.46%)` | :arrow_down: |
| [...tend/src/filters/components/Time/transformProps.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL3RyYW5zZm9ybVByb3BzLnRz) | `0.00% <0.00%> (ø)` | |
| [superset-frontend/src/filters/utils.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvdXRpbHMudHM=) | `50.00% <ø> (-38.89%)` | :arrow_down: |
| [...-frontend/src/visualizations/presets/MainPreset.js](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Zpc3VhbGl6YXRpb25zL3ByZXNldHMvTWFpblByZXNldC5qcw==) | `100.00% <ø> (ø)` | |
| [...rset-frontend/src/filters/components/Time/index.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL2luZGV4LnRz) | `75.00% <75.00%> (ø)` | |
| [...s/controls/DateFilterControl/DateFilterControl.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EYXRlRmlsdGVyQ29udHJvbC9EYXRlRmlsdGVyQ29udHJvbC50c3g=) | `81.48% <85.18%> (-2.14%)` | :arrow_down: |
| [...oard/components/nativeFilters/FilterConfigForm.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQ29uZmlnRm9ybS50c3g=) | `77.35% <100.00%> (+2.35%)` | :arrow_up: |
| [...nd/src/dashboard/components/nativeFilters/types.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvdHlwZXMudHM=) | `100.00% <100.00%> (ø)` | |
| ... and [429 more](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=footer). Last update [76c225d...c2ba1c7](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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
[GitHub] [superset] villebro commented on pull request #12946: feat(native-filters): Add time filters
Posted by GitBox <gi...@apache.org>.
villebro commented on pull request #12946:
URL: https://github.com/apache/superset/pull/12946#issuecomment-773916360
> Currently the time range filter in FilterBox is not tied to any datasource. It will apply to any chart that is in scope and has a time column specified, regardless if it's using the same datasource or not.
>
> The new [time filter in native filters](https://github.com/apache/superset/pull/12946) seems to be tied to a specific datasource and field, I'm wondering how this time filter will actually work in the dashboard?
>
> Will it work like the old Time Range filter in `FilterBox`, or will it work on the selected `ds` column on the selected datasource?
This will be changed shortly - the time filter won't be tied to a datasource, and will only have the time picker (no need for datasource, column etc). Also, the date column filter will be ported to native filters, and that one will obviously have a datasource.
----------------------------------------------------------------
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
[GitHub] [superset] villebro commented on pull request #12946: feat(native-filters): Add time filters
Posted by GitBox <gi...@apache.org>.
villebro commented on pull request #12946:
URL: https://github.com/apache/superset/pull/12946#issuecomment-773916360
> Currently the time range filter in FilterBox is not tied to any datasource. It will apply to any chart that is in scope and has a time column specified, regardless if it's using the same datasource or not.
>
> The new [time filter in native filters](https://github.com/apache/superset/pull/12946) seems to be tied to a specific datasource and field, I'm wondering how this time filter will actually work in the dashboard?
>
> Will it work like the old Time Range filter in `FilterBox`, or will it work on the selected `ds` column on the selected datasource?
This will be changed shortly - the time filter won't be tied to a datasource, and will only have the time picker (no need for datasource, column etc). Also, the date column filter will be ported to native filters, and that one will obviously have a datasource.
----------------------------------------------------------------
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
[GitHub] [superset] ktmud edited a comment on pull request #12946: feat(native-filters): Add time filters
Posted by GitBox <gi...@apache.org>.
ktmud edited a comment on pull request #12946:
URL: https://github.com/apache/superset/pull/12946#issuecomment-773914247
Currently the time range filter in FilterBox is not tied to any datasource. It will apply to any chart that is in scope and has a time column specified, regardless if it's using the same datasource or not.
The new time filter in native filters here seems to be tied to a specific datasource and field as users have to specify that when creating one, I'm wondering how this actually works in the dashboard? Will it work like the old Time Range filter in `FilterBox`, or will it applied only to the charts that use the same datasource and has the selected `ds` as its time column?
If it's the latter case, we might want to redesign the whole thing to make users select filter type first before selecting datasource ("Datasource" and "Field" should be hidden when they select "Filter type: Time").
----------------------------------------------------------------
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
[GitHub] [superset] codecov-io edited a comment on pull request #12946: feature(native-filters): Add time filters
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12946:
URL: https://github.com/apache/superset/pull/12946#issuecomment-773448205
----------------------------------------------------------------
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
[GitHub] [superset] villebro edited a comment on pull request #12946: feat(native-filters): Add time filters
Posted by GitBox <gi...@apache.org>.
villebro edited a comment on pull request #12946:
URL: https://github.com/apache/superset/pull/12946#issuecomment-773916360
> Currently the time range filter in FilterBox is not tied to any datasource. It will apply to any chart that is in scope and has a time column specified, regardless if it's using the same datasource or not.
>
> The new [time filter in native filters](https://github.com/apache/superset/pull/12946) seems to be tied to a specific datasource and field, I'm wondering how this time filter will actually work in the dashboard?
>
> Will it work like the old Time Range filter in `FilterBox`, or will it work on the selected `ds` column on the selected datasource?
This will be changed shortly - the time filter won't be tied to a datasource, and will only have the time picker (no need for datasource, column etc). Also, the date column filter will be ported to native filters, and that one will obviously have a datasource.
> If it's the latter case, we might want to redesign the whole thing to make users select filter type first before selecting datasource.
The redesign is currently under discussion, and a change similar to the one you're proposing is in the works
----------------------------------------------------------------
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
[GitHub] [superset] villebro edited a comment on pull request #12946: feat(native-filters): Add time filters
Posted by GitBox <gi...@apache.org>.
villebro edited a comment on pull request #12946:
URL: https://github.com/apache/superset/pull/12946#issuecomment-773916360
> Currently the time range filter in FilterBox is not tied to any datasource. It will apply to any chart that is in scope and has a time column specified, regardless if it's using the same datasource or not.
>
> The new [time filter in native filters](https://github.com/apache/superset/pull/12946) seems to be tied to a specific datasource and field, I'm wondering how this time filter will actually work in the dashboard?
>
> Will it work like the old Time Range filter in `FilterBox`, or will it work on the selected `ds` column on the selected datasource?
This will be changed shortly - the time filter won't be tied to a datasource, and will only have the time picker (no need for datasource, column etc). Also, the date column filter will be ported to native filters, and that one will obviously have a datasource.
> If it's the latter case, we might want to redesign the whole thing to make users select filter type first before selecting datasource.
The redesign is currently under discussion, and a change similar to the one you're proposing is in the works
----------------------------------------------------------------
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
[GitHub] [superset] ktmud commented on pull request #12946: feat(native-filters): Add time filters
Posted by GitBox <gi...@apache.org>.
ktmud commented on pull request #12946:
URL: https://github.com/apache/superset/pull/12946#issuecomment-773914247
Currently the time range filter in FilterBox is not tied to any datasource. It will apply to any chart that is in scope and has a time column specified, regardless if it's using the same datasource or not.
The new [time filter in native filters](https://github.com/apache/superset/pull/12946) seems to be tied to a specific datasource and field, I'm wondering how this time filter will actually work in the dashboard?
Will it work like the old Time Range filter in `FilterBox`, or will it work on the selected `ds` column on the selected datasource?
----------------------------------------------------------------
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
[GitHub] [superset] codecov-io edited a comment on pull request #12946: feature(native-filters): Add time filters
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12946:
URL: https://github.com/apache/superset/pull/12946#issuecomment-773448205
# [Codecov](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=h1) Report
> Merging [#12946](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=desc) (88aac31) into [master](https://codecov.io/gh/apache/superset/commit/76c225db7ee464d5b642cf7e0aa6c990df88f99d?el=desc) (76c225d) will **decrease** coverage by `8.24%`.
> The diff coverage is `66.66%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12946/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #12946 +/- ##
==========================================
- Coverage 69.14% 60.89% -8.25%
==========================================
Files 1025 970 -55
Lines 48765 45902 -2863
Branches 5188 4445 -743
==========================================
- Hits 33718 27954 -5764
- Misses 14913 17948 +3035
+ Partials 134 0 -134
```
| Flag | Coverage Δ | |
|---|---|---|
| cypress | `50.46% <66.66%> (-0.37%)` | :arrow_down: |
| javascript | `?` | |
| python | `67.17% <ø> (-0.45%)` | :arrow_down: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...c/dashboard/components/nativeFilters/FilterBar.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQmFyLnRzeA==) | `49.60% <ø> (-2.79%)` | :arrow_down: |
| [...oard/components/nativeFilters/FilterConfigForm.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQ29uZmlnRm9ybS50c3g=) | `60.37% <ø> (-14.63%)` | :arrow_down: |
| [...ard/components/nativeFilters/FilterConfigModal.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQ29uZmlnTW9kYWwudHN4) | `51.93% <ø> (-17.97%)` | :arrow_down: |
| [...nd/src/dashboard/components/nativeFilters/utils.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvdXRpbHMudHM=) | `27.02% <ø> (-56.58%)` | :arrow_down: |
| [...controls/DateFilterControl/frame/AdvancedFrame.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EYXRlRmlsdGVyQ29udHJvbC9mcmFtZS9BZHZhbmNlZEZyYW1lLnRzeA==) | `40.00% <ø> (-12.00%)` | :arrow_down: |
| [...s/controls/DateFilterControl/frame/CustomFrame.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EYXRlRmlsdGVyQ29udHJvbC9mcmFtZS9DdXN0b21GcmFtZS50c3g=) | `32.55% <ø> (-9.45%)` | :arrow_down: |
| [...frontend/src/filters/components/Time/buildQuery.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL2J1aWxkUXVlcnkudHM=) | `0.00% <0.00%> (ø)` | |
| [...tend/src/filters/components/Time/transformProps.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL3RyYW5zZm9ybVByb3BzLnRz) | `0.00% <0.00%> (ø)` | |
| [...-frontend/src/visualizations/presets/MainPreset.js](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Zpc3VhbGl6YXRpb25zL3ByZXNldHMvTWFpblByZXNldC5qcw==) | `100.00% <ø> (ø)` | |
| [...rset-frontend/src/filters/components/Time/index.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL2luZGV4LnRz) | `75.00% <75.00%> (ø)` | |
| ... and [426 more](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=footer). Last update [76c225d...a727bfe](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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
[GitHub] [superset] villebro commented on a change in pull request #12946: feature(native-filters): Add time filters
Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #12946:
URL: https://github.com/apache/superset/pull/12946#discussion_r570347975
##########
File path: superset-frontend/src/filters/components/Time/buildQuery.ts
##########
@@ -0,0 +1,72 @@
+/**
+ * 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 {
+ buildQueryContext,
+ ColumnType,
+ QueryFormData,
+} from '@superset-ui/core';
+
+/**
+ * The buildQuery function is used to create an instance of QueryContext that's
+ * sent to the chart data endpoint. In addition to containing information of which
+ * datasource to use, it specifies the type (e.g. full payload, samples, query) and
+ * format (e.g. CSV or JSON) of the result and whether or not to force refresh the data from
+ * the datasource as opposed to using a cached copy of the data, if available.
+ *
+ * More importantly though, QueryContext contains a property `queries`, which is an array of
+ * QueryObjects specifying individual data requests to be made. A QueryObject specifies which
+ * columns, metrics and filters, among others, to use during the query. Usually it will be enough
+ * to specify just one query based on the baseQueryObject, but for some more advanced use cases
+ * it is possible to define post processing operations in the QueryObject, or multiple queries
+ * if a viz needs multiple different result sets.
+ */
+export default function buildQuery(formData: QueryFormData) {
+ const { groupby } = formData;
+ const [column] = groupby || [];
+ return buildQueryContext(formData, baseQueryObject => [
Review comment:
This file can probably be removed, as the chart won't be doing any data fetching. Otherwise we need to do some tweaking to make sure viz plugins don't need do do any data fetching.
##########
File path: superset-frontend/src/filters/components/Time/TimeFilter.tsx
##########
@@ -0,0 +1,72 @@
+/**
+ * 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 { styled, TimeRange } from '@superset-ui/core';
+import React, { useState, useEffect } from 'react';
+import DateFilterControl from 'src/explore/components/controls/DateFilterControl/DateFilterControl';
+import { getRangeExtraFormData } from 'src/filters/utils';
+import { AntdPluginFilterStylesProps } from '../types';
+import { DEFAULT_FORM_DATA, PluginFilterTimeProps } from './types';
+
+const Styles = styled.div<AntdPluginFilterStylesProps>`
+ height: ${({ height }) => height}px;
+ width: ${({ width }) => width}px;
+ overflow-x: scroll;
+`;
+
+export default function PluginFilterTime(props: PluginFilterTimeProps) {
+ const { formData, setExtraFormData, width, height } = props;
+ const { defaultValue } = {
+ ...DEFAULT_FORM_DATA,
+ ...formData,
+ };
+
+ const firstDefault = (defaultValue?.[0] || '').toString();
+ const [value, setValue] = useState<string>(firstDefault || 'Last week');
+
+ let { groupby = [] } = formData;
+ groupby = Array.isArray(groupby) ? groupby : [groupby];
+
+ const handleTimeRangeChange = (timeRange: TimeRange) => {
+ const [col] = groupby;
+ const extraFormData = getRangeExtraFormData(
+ col,
+ timeRange.since,
+ timeRange.until,
+ );
+ // @ts-ignore
+ setExtraFormData({ extraFormData, currentState: { value: [value] } });
+ };
Review comment:
The handler should set `extraFormData` with the following params:
```javascript
extraFormData = {
override: {
time_range: timeRange,
},
};
```
##########
File path: superset-frontend/src/filters/components/Time/types.ts
##########
@@ -0,0 +1,56 @@
+/**
+ * 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 {
+ QueryFormData,
+ DataRecord,
+ SetExtraFormDataHook,
+} from '@superset-ui/core';
+import { RefObject } from 'react';
+import { AntdPluginFilterStylesProps } from '../types';
+
+interface PluginFilterTimeCustomizeProps {
+ defaultValue?: (string | number)[] | null;
+ currentValue?: (string | number)[] | null;
+ enableEmptyFilter: boolean;
+ fetchPredicate?: string;
+ inverseSelection: boolean;
+ multiSelect: boolean;
+ showSearch: boolean;
+ inputRef?: RefObject<HTMLInputElement>;
+}
+
+export type AntdPluginFilterSelectQueryFormData = QueryFormData &
+ AntdPluginFilterStylesProps &
+ PluginFilterTimeCustomizeProps;
+
+export type PluginFilterTimeProps = AntdPluginFilterStylesProps & {
+ data: DataRecord[];
+ setExtraFormData: SetExtraFormDataHook;
+ formData: AntdPluginFilterSelectQueryFormData;
+};
+
+export const DEFAULT_FORM_DATA: PluginFilterTimeCustomizeProps = {
+ defaultValue: null,
+ currentValue: null,
+ enableEmptyFilter: false,
+ fetchPredicate: '',
+ inverseSelection: false,
+ multiSelect: true,
+ showSearch: true,
Review comment:
We can probably remove all the other default form data except `defaultValue` and `currentValue`.
##########
File path: superset-frontend/src/filters/components/Time/controlPanel.ts
##########
@@ -0,0 +1,44 @@
+/**
+ * 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, validateNonEmpty } from '@superset-ui/core';
+import { ControlPanelConfig, sections } from '@superset-ui/chart-controls';
+
+const config: ControlPanelConfig = {
+ // For control input types, see: superset-frontend/src/explore/components/controls/index.js
+ controlPanelSections: [
+ // @ts-ignore
+ sections.legacyRegularTime,
+ {
+ label: t('Query'),
+ expanded: true,
+ controlSetRows: [['groupby'], ['adhoc_filters']],
+ },
+ ],
+ controlOverrides: {
+ groupby: {
+ validators: [validateNonEmpty],
+ clearable: false,
+ },
+ row_limit: {
+ default: 100,
+ },
+ },
+};
Review comment:
Same here - a minimal control panel should be enough.
##########
File path: superset-frontend/src/filters/utils.ts
##########
@@ -46,8 +46,8 @@ export const getSelectExtraFormData = (
export const getRangeExtraFormData = (
col: string,
- lower?: number | null,
- upper?: number | null,
+ lower?: number | string | null,
+ upper?: number | string | null,
Review comment:
As the time filter won't be needing this util, we don't need to make changes here.
----------------------------------------------------------------
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
[GitHub] [superset] agatapst commented on a change in pull request #12946: feat(native-filters): Add time filters
Posted by GitBox <gi...@apache.org>.
agatapst commented on a change in pull request #12946:
URL: https://github.com/apache/superset/pull/12946#discussion_r570427480
##########
File path: superset-frontend/src/filters/components/Time/TimeFilter.tsx
##########
@@ -0,0 +1,72 @@
+/**
+ * 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 { styled, TimeRange } from '@superset-ui/core';
+import React, { useState, useEffect } from 'react';
+import DateFilterControl from 'src/explore/components/controls/DateFilterControl/DateFilterControl';
+import { getRangeExtraFormData } from 'src/filters/utils';
+import { AntdPluginFilterStylesProps } from '../types';
+import { DEFAULT_FORM_DATA, PluginFilterTimeProps } from './types';
+
+const Styles = styled.div<AntdPluginFilterStylesProps>`
+ height: ${({ height }) => height}px;
+ width: ${({ width }) => width}px;
+ overflow-x: scroll;
+`;
+
+export default function PluginFilterTime(props: PluginFilterTimeProps) {
+ const { formData, setExtraFormData, width, height } = props;
+ const { defaultValue } = {
+ ...DEFAULT_FORM_DATA,
+ ...formData,
+ };
+
+ const firstDefault = (defaultValue?.[0] || '').toString();
+ const [value, setValue] = useState<string>(firstDefault || 'Last week');
+
+ let { groupby = [] } = formData;
+ groupby = Array.isArray(groupby) ? groupby : [groupby];
+
+ const handleTimeRangeChange = (timeRange: TimeRange) => {
+ const [col] = groupby;
+ const extraFormData = getRangeExtraFormData(
+ col,
+ timeRange.since,
+ timeRange.until,
+ );
+ // @ts-ignore
+ setExtraFormData({ extraFormData, currentState: { value: [value] } });
+ };
Review comment:
I have changed it to:
```
const { time_range } = timeRange;
setExtraFormData({
// @ts-ignore
extraFormData: { override: { time_range } },
currentState: { value: [time_range] },
});
```
but it does not seem to work anymore
##########
File path: superset-frontend/src/filters/components/Time/controlPanel.ts
##########
@@ -0,0 +1,44 @@
+/**
+ * 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, validateNonEmpty } from '@superset-ui/core';
+import { ControlPanelConfig, sections } from '@superset-ui/chart-controls';
+
+const config: ControlPanelConfig = {
+ // For control input types, see: superset-frontend/src/explore/components/controls/index.js
+ controlPanelSections: [
+ // @ts-ignore
+ sections.legacyRegularTime,
+ {
+ label: t('Query'),
+ expanded: true,
+ controlSetRows: [['groupby'], ['adhoc_filters']],
+ },
+ ],
+ controlOverrides: {
+ groupby: {
+ validators: [validateNonEmpty],
+ clearable: false,
+ },
+ row_limit: {
+ default: 100,
+ },
+ },
+};
Review comment:
Do you think that it would be enough?
```
const config: ControlPanelConfig = {
controlPanelSections: [],
};
```
##########
File path: superset-frontend/src/filters/components/Time/TimeFilter.tsx
##########
@@ -0,0 +1,72 @@
+/**
+ * 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 { styled, TimeRange } from '@superset-ui/core';
+import React, { useState, useEffect } from 'react';
+import DateFilterControl from 'src/explore/components/controls/DateFilterControl/DateFilterControl';
+import { getRangeExtraFormData } from 'src/filters/utils';
+import { AntdPluginFilterStylesProps } from '../types';
+import { DEFAULT_FORM_DATA, PluginFilterTimeProps } from './types';
+
+const Styles = styled.div<AntdPluginFilterStylesProps>`
+ height: ${({ height }) => height}px;
+ width: ${({ width }) => width}px;
+ overflow-x: scroll;
+`;
+
+export default function PluginFilterTime(props: PluginFilterTimeProps) {
+ const { formData, setExtraFormData, width, height } = props;
+ const { defaultValue } = {
+ ...DEFAULT_FORM_DATA,
+ ...formData,
+ };
+
+ const firstDefault = (defaultValue?.[0] || '').toString();
+ const [value, setValue] = useState<string>(firstDefault || 'Last week');
+
+ let { groupby = [] } = formData;
+ groupby = Array.isArray(groupby) ? groupby : [groupby];
+
+ const handleTimeRangeChange = (timeRange: TimeRange) => {
+ const [col] = groupby;
+ const extraFormData = getRangeExtraFormData(
+ col,
+ timeRange.since,
+ timeRange.until,
+ );
+ // @ts-ignore
+ setExtraFormData({ extraFormData, currentState: { value: [value] } });
+ };
Review comment:
I have changed it to:
```
const { time_range } = timeRange;
setExtraFormData({
// @ts-ignore
extraFormData: { override: { time_range } },
currentState: { value: [time_range] },
});
```
but it does not seem to work anymore. Maybe is something wrong here?
----------------------------------------------------------------
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
[GitHub] [superset] junlincc commented on pull request #12946: feat(native-filters): Add time filters
Posted by GitBox <gi...@apache.org>.
junlincc commented on pull request #12946:
URL: https://github.com/apache/superset/pull/12946#issuecomment-773713200
Thank you bringing it so close to the finish line @agatapst !
@villebro should @simcha90 continue to push commits to this branch or should we merge it and open follow up PRs?
----------------------------------------------------------------
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
[GitHub] [superset] codecov-io edited a comment on pull request #12946: feat(native-filters): Add time filters
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12946:
URL: https://github.com/apache/superset/pull/12946#issuecomment-773448205
# [Codecov](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=h1) Report
> Merging [#12946](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=desc) (c2ba1c7) into [master](https://codecov.io/gh/apache/superset/commit/76c225db7ee464d5b642cf7e0aa6c990df88f99d?el=desc) (76c225d) will **decrease** coverage by `20.37%`.
> The diff coverage is `71.79%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12946/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #12946 +/- ##
===========================================
- Coverage 69.14% 48.76% -20.38%
===========================================
Files 1025 442 -583
Lines 48765 14795 -33970
Branches 5188 3936 -1252
===========================================
- Hits 33718 7215 -26503
+ Misses 14913 7580 -7333
+ Partials 134 0 -134
```
| Flag | Coverage Δ | |
|---|---|---|
| cypress | `48.76% <71.79%> (-2.07%)` | :arrow_down: |
| javascript | `?` | |
| python | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...c/dashboard/components/nativeFilters/FilterBar.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQmFyLnRzeA==) | `48.80% <ø> (-3.59%)` | :arrow_down: |
| [...oard/components/nativeFilters/FilterConfigForm.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQ29uZmlnRm9ybS50c3g=) | `15.09% <0.00%> (-59.91%)` | :arrow_down: |
| [...ard/components/nativeFilters/FilterConfigModal.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQ29uZmlnTW9kYWwudHN4) | `25.41% <ø> (-44.49%)` | :arrow_down: |
| [...nd/src/dashboard/components/nativeFilters/utils.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvdXRpbHMudHM=) | `18.01% <ø> (-65.59%)` | :arrow_down: |
| [...tend/src/filters/components/Time/transformProps.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL3RyYW5zZm9ybVByb3BzLnRz) | `0.00% <0.00%> (ø)` | |
| [...-frontend/src/visualizations/presets/MainPreset.js](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Zpc3VhbGl6YXRpb25zL3ByZXNldHMvTWFpblByZXNldC5qcw==) | `100.00% <ø> (ø)` | |
| [...rset-frontend/src/filters/components/Time/index.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL2luZGV4LnRz) | `75.00% <75.00%> (ø)` | |
| [...s/controls/DateFilterControl/DateFilterControl.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EYXRlRmlsdGVyQ29udHJvbC9EYXRlRmlsdGVyQ29udHJvbC50c3g=) | `81.48% <85.18%> (-2.14%)` | :arrow_down: |
| [...nd/src/dashboard/components/nativeFilters/types.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvdHlwZXMudHM=) | `100.00% <100.00%> (ø)` | |
| [...ontend/src/filters/components/Time/controlPanel.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL2NvbnRyb2xQYW5lbC50cw==) | `100.00% <100.00%> (ø)` | |
| ... and [924 more](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=footer). Last update [76c225d...c2ba1c7](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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
[GitHub] [superset] villebro commented on a change in pull request #12946: feat(native-filters): Add time filters
Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #12946:
URL: https://github.com/apache/superset/pull/12946#discussion_r570917006
##########
File path: superset-frontend/src/filters/components/Time/controlPanel.ts
##########
@@ -0,0 +1,44 @@
+/**
+ * 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, validateNonEmpty } from '@superset-ui/core';
+import { ControlPanelConfig, sections } from '@superset-ui/chart-controls';
+
+const config: ControlPanelConfig = {
+ // For control input types, see: superset-frontend/src/explore/components/controls/index.js
+ controlPanelSections: [
+ // @ts-ignore
+ sections.legacyRegularTime,
+ {
+ label: t('Query'),
+ expanded: true,
+ controlSetRows: [['groupby'], ['adhoc_filters']],
+ },
+ ],
+ controlOverrides: {
+ groupby: {
+ validators: [validateNonEmpty],
+ clearable: false,
+ },
+ row_limit: {
+ default: 100,
+ },
+ },
+};
Review comment:
I think so 👍 All options really refer to database operations, and since none of those are applicable, I think having an empty config seems correct.
----------------------------------------------------------------
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
[GitHub] [superset] codecov-io edited a comment on pull request #12946: feat(native-filters): Add time filters
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12946:
URL: https://github.com/apache/superset/pull/12946#issuecomment-773448205
# [Codecov](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=h1) Report
> Merging [#12946](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=desc) (c2ba1c7) into [master](https://codecov.io/gh/apache/superset/commit/76c225db7ee464d5b642cf7e0aa6c990df88f99d?el=desc) (76c225d) will **decrease** coverage by `16.52%`.
> The diff coverage is `74.35%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12946/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #12946 +/- ##
===========================================
- Coverage 69.14% 52.61% -16.53%
===========================================
Files 1025 483 -542
Lines 48765 17334 -31431
Branches 5188 4485 -703
===========================================
- Hits 33718 9121 -24597
+ Misses 14913 8213 -6700
+ Partials 134 0 -134
```
| Flag | Coverage Δ | |
|---|---|---|
| cypress | `52.61% <74.35%> (+1.78%)` | :arrow_up: |
| javascript | `?` | |
| python | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...c/dashboard/components/nativeFilters/FilterBar.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQmFyLnRzeA==) | `92.00% <ø> (+39.61%)` | :arrow_up: |
| [...ard/components/nativeFilters/FilterConfigModal.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQ29uZmlnTW9kYWwudHN4) | `79.00% <ø> (+9.10%)` | :arrow_up: |
| [...nd/src/dashboard/components/nativeFilters/utils.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvdXRpbHMudHM=) | `53.15% <ø> (-30.46%)` | :arrow_down: |
| [...tend/src/filters/components/Time/transformProps.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL3RyYW5zZm9ybVByb3BzLnRz) | `0.00% <0.00%> (ø)` | |
| [superset-frontend/src/filters/utils.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvdXRpbHMudHM=) | `50.00% <ø> (-38.89%)` | :arrow_down: |
| [...-frontend/src/visualizations/presets/MainPreset.js](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Zpc3VhbGl6YXRpb25zL3ByZXNldHMvTWFpblByZXNldC5qcw==) | `100.00% <ø> (ø)` | |
| [...rset-frontend/src/filters/components/Time/index.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL2luZGV4LnRz) | `75.00% <75.00%> (ø)` | |
| [...s/controls/DateFilterControl/DateFilterControl.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EYXRlRmlsdGVyQ29udHJvbC9EYXRlRmlsdGVyQ29udHJvbC50c3g=) | `81.48% <85.18%> (-2.14%)` | :arrow_down: |
| [...oard/components/nativeFilters/FilterConfigForm.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQ29uZmlnRm9ybS50c3g=) | `77.35% <100.00%> (+2.35%)` | :arrow_up: |
| [...nd/src/dashboard/components/nativeFilters/types.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvdHlwZXMudHM=) | `100.00% <100.00%> (ø)` | |
| ... and [900 more](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=footer). Last update [76c225d...c2ba1c7](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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
[GitHub] [superset] codecov-io edited a comment on pull request #12946: feature(native-filters): Add time filters
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12946:
URL: https://github.com/apache/superset/pull/12946#issuecomment-773448205
# [Codecov](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=h1) Report
> Merging [#12946](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=desc) (a727bfe) into [master](https://codecov.io/gh/apache/superset/commit/76c225db7ee464d5b642cf7e0aa6c990df88f99d?el=desc) (76c225d) will **decrease** coverage by `9.70%`.
> The diff coverage is `48.78%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12946/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #12946 +/- ##
==========================================
- Coverage 69.14% 59.43% -9.71%
==========================================
Files 1025 816 -209
Lines 48765 41311 -7454
Branches 5188 3283 -1905
==========================================
- Hits 33718 24553 -9165
- Misses 14913 16758 +1845
+ Partials 134 0 -134
```
| Flag | Coverage Δ | |
|---|---|---|
| cypress | `41.86% <48.78%> (-8.97%)` | :arrow_down: |
| javascript | `?` | |
| python | `67.18% <ø> (-0.45%)` | :arrow_down: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...frontend/src/filters/components/Time/buildQuery.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL2J1aWxkUXVlcnkudHM=) | `0.00% <0.00%> (ø)` | |
| [...tend/src/filters/components/Time/transformProps.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL3RyYW5zZm9ybVByb3BzLnRz) | `0.00% <0.00%> (ø)` | |
| [...-frontend/src/visualizations/presets/MainPreset.js](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Zpc3VhbGl6YXRpb25zL3ByZXNldHMvTWFpblByZXNldC5qcw==) | `100.00% <ø> (ø)` | |
| [...s/controls/DateFilterControl/DateFilterControl.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EYXRlRmlsdGVyQ29udHJvbC9EYXRlRmlsdGVyQ29udHJvbC50c3g=) | `61.11% <59.25%> (-22.51%)` | :arrow_down: |
| [...rset-frontend/src/filters/components/Time/index.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL2luZGV4LnRz) | `75.00% <75.00%> (ø)` | |
| [...ontend/src/filters/components/Time/controlPanel.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL2NvbnRyb2xQYW5lbC50cw==) | `100.00% <100.00%> (ø)` | |
| [...tend/src/visualizations/FilterBox/controlPanel.jsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Zpc3VhbGl6YXRpb25zL0ZpbHRlckJveC9jb250cm9sUGFuZWwuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [...set-frontend/src/views/CRUD/alert/ExecutionLog.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYWxlcnQvRXhlY3V0aW9uTG9nLnRzeA==) | `11.76% <0.00%> (-88.24%)` | :arrow_down: |
| [superset-frontend/src/components/IconTooltip.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvSWNvblRvb2x0aXAudHN4) | `13.33% <0.00%> (-86.67%)` | :arrow_down: |
| [...perset-frontend/src/views/CRUD/welcome/Welcome.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvd2VsY29tZS9XZWxjb21lLnRzeA==) | `2.94% <0.00%> (-85.95%)` | :arrow_down: |
| ... and [485 more](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=footer). Last update [76c225d...a727bfe](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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
[GitHub] [superset] ktmud edited a comment on pull request #12946: feat(native-filters): Add time filters
Posted by GitBox <gi...@apache.org>.
ktmud edited a comment on pull request #12946:
URL: https://github.com/apache/superset/pull/12946#issuecomment-773914247
Currently the time range filter in FilterBox is not tied to any datasource. It will apply to any chart that is in scope and has a time column specified, regardless if it's using the same datasource or not.
The new time filter in native filters here seems to be tied to a specific datasource and field as users have to specify that when creating one, I'm wondering how this actually works in the dashboard? Will it work like the old Time Range filter in `FilterBox`, or will it applied only to the charts that use the same datasource and has the selected `ds` as its time column?
----------------------------------------------------------------
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
[GitHub] [superset] villebro commented on a change in pull request #12946: feature(native-filters): Add time filters
Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #12946:
URL: https://github.com/apache/superset/pull/12946#discussion_r570352665
##########
File path: superset-frontend/src/filters/components/Time/TimeFilter.tsx
##########
@@ -0,0 +1,72 @@
+/**
+ * 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 { styled, TimeRange } from '@superset-ui/core';
+import React, { useState, useEffect } from 'react';
+import DateFilterControl from 'src/explore/components/controls/DateFilterControl/DateFilterControl';
+import { getRangeExtraFormData } from 'src/filters/utils';
+import { AntdPluginFilterStylesProps } from '../types';
+import { DEFAULT_FORM_DATA, PluginFilterTimeProps } from './types';
+
+const Styles = styled.div<AntdPluginFilterStylesProps>`
+ height: ${({ height }) => height}px;
+ width: ${({ width }) => width}px;
+ overflow-x: scroll;
+`;
+
+export default function PluginFilterTime(props: PluginFilterTimeProps) {
+ const { formData, setExtraFormData, width, height } = props;
+ const { defaultValue } = {
+ ...DEFAULT_FORM_DATA,
+ ...formData,
+ };
+
+ const firstDefault = (defaultValue?.[0] || '').toString();
+ const [value, setValue] = useState<string>(firstDefault || 'Last week');
+
+ let { groupby = [] } = formData;
+ groupby = Array.isArray(groupby) ? groupby : [groupby];
+
+ const handleTimeRangeChange = (timeRange: TimeRange) => {
+ const [col] = groupby;
+ const extraFormData = getRangeExtraFormData(
+ col,
+ timeRange.since,
+ timeRange.until,
+ );
+ // @ts-ignore
+ setExtraFormData({ extraFormData, currentState: { value: [value] } });
+ };
Review comment:
The handler should set `extraFormData` with the following params (assuming that `timeRange.time_range` is the value that usually gets added to the chart metadata):
```javascript
extraFormData = {
override: {
time_range: timeRange.time_range,
},
};
```
Also, `currentState` should be set with the native state of the time picker, so I'm assuming `timeRange`.
----------------------------------------------------------------
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
[GitHub] [superset] codecov-io edited a comment on pull request #12946: feat(native-filters): Add time filters
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12946:
URL: https://github.com/apache/superset/pull/12946#issuecomment-773448205
# [Codecov](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=h1) Report
> Merging [#12946](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=desc) (a727bfe) into [master](https://codecov.io/gh/apache/superset/commit/76c225db7ee464d5b642cf7e0aa6c990df88f99d?el=desc) (76c225d) will **decrease** coverage by `1.83%`.
> The diff coverage is `27.27%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12946/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #12946 +/- ##
==========================================
- Coverage 69.14% 67.30% -1.84%
==========================================
Files 1025 1031 +6
Lines 48765 48819 +54
Branches 5188 5211 +23
==========================================
- Hits 33718 32858 -860
- Misses 14913 15774 +861
- Partials 134 187 +53
```
| Flag | Coverage Δ | |
|---|---|---|
| cypress | `41.86% <48.78%> (-8.97%)` | :arrow_down: |
| javascript | `61.66% <1.29%> (-0.17%)` | :arrow_down: |
| python | `67.49% <ø> (-0.14%)` | :arrow_down: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...c/dashboard/components/nativeFilters/FilterBar.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQmFyLnRzeA==) | `51.36% <ø> (-1.02%)` | :arrow_down: |
| [...oard/components/nativeFilters/FilterConfigForm.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQ29uZmlnRm9ybS50c3g=) | `70.00% <ø> (-5.00%)` | :arrow_down: |
| [...ard/components/nativeFilters/FilterConfigModal.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQ29uZmlnTW9kYWwudHN4) | `69.74% <ø> (-0.16%)` | :arrow_down: |
| [...nd/src/dashboard/components/nativeFilters/utils.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvdXRpbHMudHM=) | `83.60% <ø> (ø)` | |
| [...rontend/src/filters/components/Time/TimeFilter.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL1RpbWVGaWx0ZXIudHN4) | `0.00% <0.00%> (ø)` | |
| [...frontend/src/filters/components/Time/buildQuery.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL2J1aWxkUXVlcnkudHM=) | `0.00% <0.00%> (ø)` | |
| [...tend/src/filters/components/Time/transformProps.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL3RyYW5zZm9ybVByb3BzLnRz) | `0.00% <0.00%> (ø)` | |
| [...rset-frontend/src/filters/components/Time/types.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL3R5cGVzLnRz) | `0.00% <0.00%> (ø)` | |
| [superset-frontend/src/filters/components/index.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9pbmRleC50cw==) | `0.00% <0.00%> (ø)` | |
| [superset-frontend/src/filters/utils.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvdXRpbHMudHM=) | `88.88% <ø> (ø)` | |
| ... and [119 more](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=footer). Last update [76c225d...a727bfe](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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
[GitHub] [superset] codecov-io edited a comment on pull request #12946: feat(native-filters): Add time filters
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12946:
URL: https://github.com/apache/superset/pull/12946#issuecomment-773448205
# [Codecov](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=h1) Report
> Merging [#12946](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=desc) (c2ba1c7) into [master](https://codecov.io/gh/apache/superset/commit/76c225db7ee464d5b642cf7e0aa6c990df88f99d?el=desc) (76c225d) will **decrease** coverage by `7.11%`.
> The diff coverage is `74.35%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12946/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #12946 +/- ##
==========================================
- Coverage 69.14% 62.02% -7.12%
==========================================
Files 1025 972 -53
Lines 48765 46022 -2743
Branches 5188 4485 -703
==========================================
- Hits 33718 28547 -5171
- Misses 14913 17475 +2562
+ Partials 134 0 -134
```
| Flag | Coverage Δ | |
|---|---|---|
| cypress | `52.98% <74.35%> (+2.15%)` | :arrow_up: |
| javascript | `?` | |
| python | `67.49% <ø> (-0.14%)` | :arrow_down: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...c/dashboard/components/nativeFilters/FilterBar.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQmFyLnRzeA==) | `92.00% <ø> (+39.61%)` | :arrow_up: |
| [...ard/components/nativeFilters/FilterConfigModal.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQ29uZmlnTW9kYWwudHN4) | `79.00% <ø> (+9.10%)` | :arrow_up: |
| [...nd/src/dashboard/components/nativeFilters/utils.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvdXRpbHMudHM=) | `53.15% <ø> (-30.46%)` | :arrow_down: |
| [...tend/src/filters/components/Time/transformProps.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL3RyYW5zZm9ybVByb3BzLnRz) | `0.00% <0.00%> (ø)` | |
| [superset-frontend/src/filters/utils.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvdXRpbHMudHM=) | `50.00% <ø> (-38.89%)` | :arrow_down: |
| [...-frontend/src/visualizations/presets/MainPreset.js](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Zpc3VhbGl6YXRpb25zL3ByZXNldHMvTWFpblByZXNldC5qcw==) | `100.00% <ø> (ø)` | |
| [...rset-frontend/src/filters/components/Time/index.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL2luZGV4LnRz) | `75.00% <75.00%> (ø)` | |
| [...s/controls/DateFilterControl/DateFilterControl.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EYXRlRmlsdGVyQ29udHJvbC9EYXRlRmlsdGVyQ29udHJvbC50c3g=) | `81.48% <85.18%> (-2.14%)` | :arrow_down: |
| [...oard/components/nativeFilters/FilterConfigForm.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQ29uZmlnRm9ybS50c3g=) | `77.35% <100.00%> (+2.35%)` | :arrow_up: |
| [...nd/src/dashboard/components/nativeFilters/types.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvdHlwZXMudHM=) | `100.00% <100.00%> (ø)` | |
| ... and [434 more](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=footer). Last update [76c225d...c2ba1c7](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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
[GitHub] [superset] agatapst commented on a change in pull request #12946: feat(native-filters): Add time filters
Posted by GitBox <gi...@apache.org>.
agatapst commented on a change in pull request #12946:
URL: https://github.com/apache/superset/pull/12946#discussion_r570428273
##########
File path: superset-frontend/src/filters/components/Time/controlPanel.ts
##########
@@ -0,0 +1,44 @@
+/**
+ * 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, validateNonEmpty } from '@superset-ui/core';
+import { ControlPanelConfig, sections } from '@superset-ui/chart-controls';
+
+const config: ControlPanelConfig = {
+ // For control input types, see: superset-frontend/src/explore/components/controls/index.js
+ controlPanelSections: [
+ // @ts-ignore
+ sections.legacyRegularTime,
+ {
+ label: t('Query'),
+ expanded: true,
+ controlSetRows: [['groupby'], ['adhoc_filters']],
+ },
+ ],
+ controlOverrides: {
+ groupby: {
+ validators: [validateNonEmpty],
+ clearable: false,
+ },
+ row_limit: {
+ default: 100,
+ },
+ },
+};
Review comment:
Do you think that it would be enough?
```
const config: ControlPanelConfig = {
controlPanelSections: [],
};
```
----------------------------------------------------------------
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
[GitHub] [superset] codecov-io commented on pull request #12946: feature(native-filters): Add time filters
Posted by GitBox <gi...@apache.org>.
codecov-io commented on pull request #12946:
URL: https://github.com/apache/superset/pull/12946#issuecomment-773448205
# [Codecov](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=h1) Report
> Merging [#12946](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=desc) (a727bfe) into [master](https://codecov.io/gh/apache/superset/commit/76c225db7ee464d5b642cf7e0aa6c990df88f99d?el=desc) (76c225d) will **decrease** coverage by `27.28%`.
> The diff coverage is `48.78%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12946/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #12946 +/- ##
===========================================
- Coverage 69.14% 41.86% -27.29%
===========================================
Files 1025 327 -698
Lines 48765 12644 -36121
Branches 5188 3283 -1905
===========================================
- Hits 33718 5293 -28425
+ Misses 14913 7351 -7562
+ Partials 134 0 -134
```
| Flag | Coverage Δ | |
|---|---|---|
| cypress | `41.86% <48.78%> (-8.97%)` | :arrow_down: |
| javascript | `?` | |
| python | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...frontend/src/filters/components/Time/buildQuery.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL2J1aWxkUXVlcnkudHM=) | `0.00% <0.00%> (ø)` | |
| [...tend/src/filters/components/Time/transformProps.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL3RyYW5zZm9ybVByb3BzLnRz) | `0.00% <0.00%> (ø)` | |
| [...-frontend/src/visualizations/presets/MainPreset.js](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Zpc3VhbGl6YXRpb25zL3ByZXNldHMvTWFpblByZXNldC5qcw==) | `100.00% <ø> (ø)` | |
| [...s/controls/DateFilterControl/DateFilterControl.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EYXRlRmlsdGVyQ29udHJvbC9EYXRlRmlsdGVyQ29udHJvbC50c3g=) | `61.11% <59.25%> (-22.51%)` | :arrow_down: |
| [...rset-frontend/src/filters/components/Time/index.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL2luZGV4LnRz) | `75.00% <75.00%> (ø)` | |
| [...ontend/src/filters/components/Time/controlPanel.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL2NvbnRyb2xQYW5lbC50cw==) | `100.00% <100.00%> (ø)` | |
| [...tend/src/visualizations/FilterBox/controlPanel.jsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Zpc3VhbGl6YXRpb25zL0ZpbHRlckJveC9jb250cm9sUGFuZWwuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [...set-frontend/src/views/CRUD/alert/ExecutionLog.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYWxlcnQvRXhlY3V0aW9uTG9nLnRzeA==) | `11.76% <0.00%> (-88.24%)` | :arrow_down: |
| [superset-frontend/src/components/IconTooltip.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvSWNvblRvb2x0aXAudHN4) | `13.33% <0.00%> (-86.67%)` | :arrow_down: |
| [...perset-frontend/src/views/CRUD/welcome/Welcome.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvd2VsY29tZS9XZWxjb21lLnRzeA==) | `2.94% <0.00%> (-85.95%)` | :arrow_down: |
| ... and [961 more](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=footer). Last update [76c225d...a727bfe](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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
[GitHub] [superset] codecov-io edited a comment on pull request #12946: feat(native-filters): Add time filters
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12946:
URL: https://github.com/apache/superset/pull/12946#issuecomment-773448205
# [Codecov](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=h1) Report
> Merging [#12946](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=desc) (c2ba1c7) into [master](https://codecov.io/gh/apache/superset/commit/76c225db7ee464d5b642cf7e0aa6c990df88f99d?el=desc) (76c225d) will **decrease** coverage by `7.29%`.
> The diff coverage is `74.35%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12946/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #12946 +/- ##
==========================================
- Coverage 69.14% 61.85% -7.30%
==========================================
Files 1025 972 -53
Lines 48765 46022 -2743
Branches 5188 4485 -703
==========================================
- Hits 33718 28466 -5252
- Misses 14913 17556 +2643
+ Partials 134 0 -134
```
| Flag | Coverage Δ | |
|---|---|---|
| cypress | `52.98% <74.35%> (+2.15%)` | :arrow_up: |
| javascript | `?` | |
| python | `67.20% <ø> (-0.42%)` | :arrow_down: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...c/dashboard/components/nativeFilters/FilterBar.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQmFyLnRzeA==) | `92.00% <ø> (+39.61%)` | :arrow_up: |
| [...ard/components/nativeFilters/FilterConfigModal.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQ29uZmlnTW9kYWwudHN4) | `79.00% <ø> (+9.10%)` | :arrow_up: |
| [...nd/src/dashboard/components/nativeFilters/utils.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvdXRpbHMudHM=) | `53.15% <ø> (-30.46%)` | :arrow_down: |
| [...tend/src/filters/components/Time/transformProps.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL3RyYW5zZm9ybVByb3BzLnRz) | `0.00% <0.00%> (ø)` | |
| [superset-frontend/src/filters/utils.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvdXRpbHMudHM=) | `50.00% <ø> (-38.89%)` | :arrow_down: |
| [...-frontend/src/visualizations/presets/MainPreset.js](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Zpc3VhbGl6YXRpb25zL3ByZXNldHMvTWFpblByZXNldC5qcw==) | `100.00% <ø> (ø)` | |
| [...rset-frontend/src/filters/components/Time/index.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL2luZGV4LnRz) | `75.00% <75.00%> (ø)` | |
| [...s/controls/DateFilterControl/DateFilterControl.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EYXRlRmlsdGVyQ29udHJvbC9EYXRlRmlsdGVyQ29udHJvbC50c3g=) | `81.48% <85.18%> (-2.14%)` | :arrow_down: |
| [...oard/components/nativeFilters/FilterConfigForm.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQ29uZmlnRm9ybS50c3g=) | `77.35% <100.00%> (+2.35%)` | :arrow_up: |
| [...nd/src/dashboard/components/nativeFilters/types.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvdHlwZXMudHM=) | `100.00% <100.00%> (ø)` | |
| ... and [439 more](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=footer). Last update [76c225d...c2ba1c7](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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
[GitHub] [superset] codecov-io edited a comment on pull request #12946: feat(native-filters): Add time filters
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12946:
URL: https://github.com/apache/superset/pull/12946#issuecomment-773448205
# [Codecov](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=h1) Report
> Merging [#12946](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=desc) (c2ba1c7) into [master](https://codecov.io/gh/apache/superset/commit/76c225db7ee464d5b642cf7e0aa6c990df88f99d?el=desc) (76c225d) will **decrease** coverage by `7.04%`.
> The diff coverage is `74.35%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12946/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #12946 +/- ##
==========================================
- Coverage 69.14% 62.09% -7.05%
==========================================
Files 1025 972 -53
Lines 48765 46050 -2715
Branches 5188 4485 -703
==========================================
- Hits 33718 28596 -5122
- Misses 14913 17454 +2541
+ Partials 134 0 -134
```
| Flag | Coverage Δ | |
|---|---|---|
| cypress | `52.98% <74.35%> (+2.15%)` | :arrow_up: |
| javascript | `?` | |
| python | `67.59% <ø> (-0.04%)` | :arrow_down: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...c/dashboard/components/nativeFilters/FilterBar.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQmFyLnRzeA==) | `92.00% <ø> (+39.61%)` | :arrow_up: |
| [...ard/components/nativeFilters/FilterConfigModal.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQ29uZmlnTW9kYWwudHN4) | `79.00% <ø> (+9.10%)` | :arrow_up: |
| [...nd/src/dashboard/components/nativeFilters/utils.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvdXRpbHMudHM=) | `53.15% <ø> (-30.46%)` | :arrow_down: |
| [...tend/src/filters/components/Time/transformProps.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL3RyYW5zZm9ybVByb3BzLnRz) | `0.00% <0.00%> (ø)` | |
| [superset-frontend/src/filters/utils.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvdXRpbHMudHM=) | `50.00% <ø> (-38.89%)` | :arrow_down: |
| [...-frontend/src/visualizations/presets/MainPreset.js](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Zpc3VhbGl6YXRpb25zL3ByZXNldHMvTWFpblByZXNldC5qcw==) | `100.00% <ø> (ø)` | |
| [...rset-frontend/src/filters/components/Time/index.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL2luZGV4LnRz) | `75.00% <75.00%> (ø)` | |
| [...s/controls/DateFilterControl/DateFilterControl.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EYXRlRmlsdGVyQ29udHJvbC9EYXRlRmlsdGVyQ29udHJvbC50c3g=) | `81.48% <85.18%> (-2.14%)` | :arrow_down: |
| [...oard/components/nativeFilters/FilterConfigForm.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQ29uZmlnRm9ybS50c3g=) | `77.35% <100.00%> (+2.35%)` | :arrow_up: |
| [...nd/src/dashboard/components/nativeFilters/types.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvdHlwZXMudHM=) | `100.00% <100.00%> (ø)` | |
| ... and [422 more](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=footer). Last update [76c225d...c2ba1c7](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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
[GitHub] [superset] codecov-io commented on pull request #12946: feature(native-filters): Add time filters
Posted by GitBox <gi...@apache.org>.
codecov-io commented on pull request #12946:
URL: https://github.com/apache/superset/pull/12946#issuecomment-773448205
# [Codecov](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=h1) Report
> Merging [#12946](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=desc) (a727bfe) into [master](https://codecov.io/gh/apache/superset/commit/76c225db7ee464d5b642cf7e0aa6c990df88f99d?el=desc) (76c225d) will **decrease** coverage by `27.28%`.
> The diff coverage is `48.78%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/12946/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #12946 +/- ##
===========================================
- Coverage 69.14% 41.86% -27.29%
===========================================
Files 1025 327 -698
Lines 48765 12644 -36121
Branches 5188 3283 -1905
===========================================
- Hits 33718 5293 -28425
+ Misses 14913 7351 -7562
+ Partials 134 0 -134
```
| Flag | Coverage Δ | |
|---|---|---|
| cypress | `41.86% <48.78%> (-8.97%)` | :arrow_down: |
| javascript | `?` | |
| python | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...frontend/src/filters/components/Time/buildQuery.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL2J1aWxkUXVlcnkudHM=) | `0.00% <0.00%> (ø)` | |
| [...tend/src/filters/components/Time/transformProps.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL3RyYW5zZm9ybVByb3BzLnRz) | `0.00% <0.00%> (ø)` | |
| [...-frontend/src/visualizations/presets/MainPreset.js](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Zpc3VhbGl6YXRpb25zL3ByZXNldHMvTWFpblByZXNldC5qcw==) | `100.00% <ø> (ø)` | |
| [...s/controls/DateFilterControl/DateFilterControl.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EYXRlRmlsdGVyQ29udHJvbC9EYXRlRmlsdGVyQ29udHJvbC50c3g=) | `61.11% <59.25%> (-22.51%)` | :arrow_down: |
| [...rset-frontend/src/filters/components/Time/index.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL2luZGV4LnRz) | `75.00% <75.00%> (ø)` | |
| [...ontend/src/filters/components/Time/controlPanel.ts](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL2NvbnRyb2xQYW5lbC50cw==) | `100.00% <100.00%> (ø)` | |
| [...tend/src/visualizations/FilterBox/controlPanel.jsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Zpc3VhbGl6YXRpb25zL0ZpbHRlckJveC9jb250cm9sUGFuZWwuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [...set-frontend/src/views/CRUD/alert/ExecutionLog.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYWxlcnQvRXhlY3V0aW9uTG9nLnRzeA==) | `11.76% <0.00%> (-88.24%)` | :arrow_down: |
| [superset-frontend/src/components/IconTooltip.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvSWNvblRvb2x0aXAudHN4) | `13.33% <0.00%> (-86.67%)` | :arrow_down: |
| [...perset-frontend/src/views/CRUD/welcome/Welcome.tsx](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvd2VsY29tZS9XZWxjb21lLnRzeA==) | `2.94% <0.00%> (-85.95%)` | :arrow_down: |
| ... and [961 more](https://codecov.io/gh/apache/superset/pull/12946/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=footer). Last update [76c225d...a727bfe](https://codecov.io/gh/apache/superset/pull/12946?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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