You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/11/02 10:00:45 UTC
[GitHub] [superset] zhaoyongjie opened a new pull request, #22002: refactor: clean up codes
zhaoyongjie opened a new pull request, #22002:
URL: https://github.com/apache/superset/pull/22002
### SUMMARY
This PR clears codes up. It's no logical change. I will add comments on the codes for the reviewer.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
<!--- Skip this if not applicable -->
### TESTING INSTRUCTIONS
<!--- Required! What steps can be taken to manually verify the changes? -->
### ADDITIONAL INFORMATION
<!--- Check any relevant boxes with "x" -->
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] zhaoyongjie commented on a diff in pull request #22002: refactor: clean up codes
Posted by GitBox <gi...@apache.org>.
zhaoyongjie commented on code in PR #22002:
URL: https://github.com/apache/superset/pull/22002#discussion_r1011508618
##########
superset-frontend/src/explore/components/controls/DateFilterControl/DateFilterLabel.tsx:
##########
@@ -302,7 +295,7 @@ export default function DateFilterLabel(props: DateFilterControlProps) {
disabled={!validTimeRange}
key="apply"
onClick={onSave}
- {...getDateFilterControlTestId('apply-button')}
+ data-test={DATE_FILTER_TEST_KEY.applyButton}
Review Comment:
Keep simple too.
##########
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterBar.test.tsx:
##########
@@ -121,7 +117,7 @@ const changeFilterValue = async () => {
userEvent.click(screen.getAllByText('No filter')[0]);
userEvent.click(screen.getByDisplayValue('Last day'));
expect(await screen.findByText(/2021-04-13/)).toBeInTheDocument();
- userEvent.click(screen.getByTestId(getDateControlTestId('apply-button')));
+ userEvent.click(screen.getByTestId(DATE_FILTER_TEST_KEY.applyButton));
Review Comment:
Keep simple logic for a simple use case.
##########
superset-frontend/src/addSlice/AddSliceContainer.tsx:
##########
@@ -19,10 +19,15 @@
import React, { ReactNode } from 'react';
import rison from 'rison';
import querystring from 'query-string';
-import { styled, t, SupersetClient, JsonResponse } from '@superset-ui/core';
+import {
+ styled,
+ t,
+ SupersetClient,
+ JsonResponse,
+ isDefined,
+} from '@superset-ui/core';
import { getUrlParam } from 'src/utils/urlUtils';
import { URL_PARAMS } from 'src/constants';
-import { isNullish } from 'src/utils/common';
Review Comment:
replace `isNullish` with `isDefined`
##########
superset-frontend/src/explore/components/controls/DateFilterControl/DateFilterLabel.tsx:
##########
@@ -174,11 +172,6 @@ export default function DateFilterLabel(props: DateFilterControlProps) {
guessedFrame === 'No filter'
) {
setActualTimeRange(value);
- setTooltipTitle(
- type === ('error' as Type)
- ? t('Default value is required')
- : actualRange || '',
- );
Review Comment:
Since the default value always gets from `Store` or `constants`, the value of the `DateFilterControl` will not be undefined.
So the type in the `DateFilterControl` is useless.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] codecov[bot] commented on pull request #22002: refactor: clean up codes
Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on PR #22002:
URL: https://github.com/apache/superset/pull/22002#issuecomment-1300096952
# [Codecov](https://codecov.io/gh/apache/superset/pull/22002?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#22002](https://codecov.io/gh/apache/superset/pull/22002?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (442de25) into [master](https://codecov.io/gh/apache/superset/commit/4a330a363056eeb8b54bee59fa82b41766fefcde?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4a330a3) will **increase** coverage by `0.00%`.
> The diff coverage is `0.00%`.
```diff
@@ Coverage Diff @@
## master #22002 +/- ##
=======================================
Coverage 67.03% 67.03%
=======================================
Files 1813 1813
Lines 69437 69425 -12
Branches 7449 7447 -2
=======================================
- Hits 46545 46542 -3
+ Misses 20972 20963 -9
Partials 1920 1920
```
| Flag | Coverage Δ | |
|---|---|---|
| javascript | `53.50% <0.00%> (+<0.01%)` | :arrow_up: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/superset/pull/22002?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...perset-frontend/src/addSlice/AddSliceContainer.tsx](https://codecov.io/gh/apache/superset/pull/22002/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2FkZFNsaWNlL0FkZFNsaWNlQ29udGFpbmVyLnRzeA==) | `59.61% <0.00%> (ø)` | |
| [...ts/nativeFilters/FilterBar/ActionButtons/index.tsx](https://codecov.io/gh/apache/superset/pull/22002/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQmFyL0FjdGlvbkJ1dHRvbnMvaW5kZXgudHN4) | `87.50% <0.00%> (ø)` | |
| [...nts/controls/DateFilterControl/DateFilterLabel.tsx](https://codecov.io/gh/apache/superset/pull/22002/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EYXRlRmlsdGVyQ29udHJvbC9EYXRlRmlsdGVyTGFiZWwudHN4) | `58.13% <ø> (+1.95%)` | :arrow_up: |
| [...ore/components/controls/DateFilterControl/types.ts](https://codecov.io/gh/apache/superset/pull/22002/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EYXRlRmlsdGVyQ29udHJvbC90eXBlcy50cw==) | `100.00% <ø> (ø)` | |
| [...ents/controls/DateFilterControl/utils/constants.ts](https://codecov.io/gh/apache/superset/pull/22002/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EYXRlRmlsdGVyQ29udHJvbC91dGlscy9jb25zdGFudHMudHM=) | `100.00% <ø> (ø)` | |
| [...d/src/filters/components/Time/TimeFilterPlugin.tsx](https://codecov.io/gh/apache/superset/pull/22002/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL1RpbWVGaWx0ZXJQbHVnaW4udHN4) | `0.00% <ø> (ø)` | |
| [superset-frontend/src/utils/common.js](https://codecov.io/gh/apache/superset/pull/22002/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3V0aWxzL2NvbW1vbi5qcw==) | `100.00% <ø> (+10.00%)` | :arrow_up: |
| [...-frontend/src/visualizations/presets/MainPreset.js](https://codecov.io/gh/apache/superset/pull/22002/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Zpc3VhbGl6YXRpb25zL3ByZXNldHMvTWFpblByZXNldC5qcw==) | `100.00% <ø> (ø)` | |
:mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] zhaoyongjie merged pull request #22002: refactor: clean up codes
Posted by GitBox <gi...@apache.org>.
zhaoyongjie merged PR #22002:
URL: https://github.com/apache/superset/pull/22002
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org