Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESLint: Re-enable rule no-access-state-in-setstate #10870

Merged
merged 2 commits into from
Sep 21, 2020

Conversation

kgabryje
Copy link
Member

SUMMARY

Re-enable ESLint rule no-access-state-in-setstate, which was disabled in PR #10839. Code was refactored to fix the errors raised by the rule.

TEST PLAN

Run npm run lint, verify that there are no new Javascript/Typescript errors.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Requires DB Migration.
  • Confirm DB Migration upgrade and downgrade tested.
  • Introduces new feature or API
  • Removes existing feature or API

@kgabryje kgabryje closed this Sep 16, 2020
@kgabryje kgabryje reopened this Sep 16, 2020
@kgabryje kgabryje closed this Sep 16, 2020
@kgabryje kgabryje reopened this Sep 16, 2020
@codecov-commenter
Copy link

codecov-commenter commented Sep 16, 2020

Codecov Report

Merging #10870 into master will decrease coverage by 4.69%.
The diff coverage is 34.14%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10870      +/-   ##
==========================================
- Coverage   65.80%   61.11%   -4.70%     
==========================================
  Files         815      815              
  Lines       38327    38329       +2     
  Branches     3600     3600              
==========================================
- Hits        25221    23424    -1797     
- Misses      13002    14719    +1717     
- Partials      104      186      +82     
Flag Coverage Δ
#cypress ?
#javascript 61.75% <34.14%> (+<0.01%) ⬆️
#python 60.73% <ø> (-0.73%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
superset-frontend/src/CRUD/CollectionTable.tsx 69.15% <0.00%> (-17.76%) ⬇️
...erset-frontend/src/SqlLab/components/ResultSet.tsx 76.51% <0.00%> (-4.55%) ⬇️
...erset-frontend/src/SqlLab/components/SaveQuery.jsx 77.77% <0.00%> (ø)
...tend/src/SqlLab/components/ScheduleQueryButton.jsx 8.62% <0.00%> (ø)
...rontend/src/SqlLab/components/TabbedSqlEditors.jsx 73.68% <0.00%> (-8.56%) ⬇️
superset-frontend/src/components/OmniContainer.jsx 12.50% <0.00%> (-45.84%) ⬇️
...et-frontend/src/dashboard/components/SaveModal.jsx 40.90% <0.00%> (-40.91%) ⬇️
...d/src/dashboard/components/SliceHeaderControls.jsx 10.63% <0.00%> (-55.32%) ⬇️
...ashboard/components/gridComponents/ChartHolder.jsx 77.77% <0.00%> (-1.39%) ⬇️
...erset-frontend/src/datasource/DatasourceEditor.jsx 69.58% <0.00%> (-3.47%) ⬇️
... and 194 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 557a303...26265a0. Read the comment docs.

@kgabryje kgabryje force-pushed the eslint/no-access-state-in-setstate branch 2 times, most recently from c91de79 to 0f5dc77 Compare September 18, 2020 06:09
@kgabryje kgabryje closed this Sep 18, 2020
@kgabryje kgabryje reopened this Sep 18, 2020
@kgabryje kgabryje closed this Sep 18, 2020
@kgabryje kgabryje reopened this Sep 18, 2020
@mistercrunch
Copy link
Member

I re-triggered the action in CI, if that doesn't work you can rebase as the issue has been addressed on master

@kgabryje kgabryje force-pushed the eslint/no-access-state-in-setstate branch from 0f5dc77 to f798552 Compare September 18, 2020 18:16
@kgabryje kgabryje force-pushed the eslint/no-access-state-in-setstate branch from f798552 to faffcc6 Compare September 20, 2020 20:36
@kgabryje
Copy link
Member Author

@mistercrunch I rebased this PR on the newest master and retriggered the CI a couple of times but it keeps failing the cypress tests (explore/AdhocMetrics.test.ts). @eschutho do you have any idea how we could fix this?

@kgabryje
Copy link
Member Author

@mistercrunch I rebased this PR on the newest master and retriggered the CI a couple of times but it keeps failing the cypress tests (explore/AdhocMetrics.test.ts). @eschutho do you have any idea how we could fix this?

And just as I wrote this comment I figured that the issue is in my code and not in Cypress... I accessed event.target.value in an async function and React's good old event pooling made sure that the target field was undefined. It's fixed now - I moved accessing the value to synchronous part of event handler. Sorry for confusion!

@rusackas rusackas merged commit 4835d3b into apache:master Sep 21, 2020
amitmiran137 pushed a commit to ofekisr/incubator-superset that referenced this pull request Sep 22, 2020
…l_access/dashboard_by_id_endpoints

* upstream/master: (29 commits)
  fix(presto): default unknown types to string type (apache#10753)
  feat(row-level-security): add base filter type and filter grouping (apache#10946)
  docs: add gallery screenshot & link in README (apache#10988)
  docs: add a "Gallery" page (apache#10968)
  build: add PR lint action (apache#10990)
  adding filters back that caused issues (apache#10989)
  chore: selectors refactor in SQLLab test suite (Cypress) (apache#10944)
  ESLint: Remove ts-ignore comments (apache#10933)
  style: fix checkbox color (apache#10970)
  fix: changed disabled rules in datasets module (apache#10979)
  fix: update the time filter for 'Last Year' option in explore (apache#10829)
  fix: use nullpool even for user lookup in the celery (apache#10938)
  Allow empty observations in alerting (apache#10939)
  fix: re-enabling several globally disabled lint rules (apache#10957)
  fix: setting specific exceptions common/query_context.py (apache#10942)
  Pylint disabled rule `pointless-string-statement` is not raising warining anymore - removing (apache#10975)
  fix: pylint disabled rules in dashboard/api.py (apache#10976)
  fix: removed disabled lint rule `too-many-locals` in connectors/base/models.py (apache#10958)
  ESLint: Re-enable rule no-access-state-in-setstate (apache#10870)
  fix: simply is_adhoc_metric (apache#10964)
  ...
auxten pushed a commit to auxten/incubator-superset that referenced this pull request Nov 20, 2020
* Re-enable rule no-access-state-in-setstate

* Move accessing event values out of async functions
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.38.0 labels Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/L 🚢 0.38.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants