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/06/07 17:58:18 UTC
[GitHub] [superset] hughhhh opened a new pull request, #20296: fix: Alpha are unable to perform a second modification to a Dataset when in Explore
hughhhh opened a new pull request, #20296:
URL: https://github.com/apache/superset/pull/20296
<!---
Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/
Example:
fix(dashboard): load charts correctly
-->
### SUMMARY
<!--- Describe the change below, including rationale and design decisions -->
Fix issue when Alpha users want to make a secondary change in `Edit Dataset`. The issue lies with the API from `datasource/save` returning a different payload for datasource.owners. To handle we'll add an additional check for the key value to make sure the user will still be able to edit moving forward.
### 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] hughhhh commented on pull request #20296: fix: Alpha are unable to perform a second modification to a Dataset when in Explore
Posted by GitBox <gi...@apache.org>.
hughhhh commented on PR #20296:
URL: https://github.com/apache/superset/pull/20296#issuecomment-1149036280
/testenv up
--
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] github-actions[bot] commented on pull request #20296: fix: Alpha are unable to perform a second modification to a Dataset when in Explore
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #20296:
URL: https://github.com/apache/superset/pull/20296#issuecomment-1149990600
Ephemeral environment shutdown and build artifacts deleted.
--
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] AAfghahi commented on a diff in pull request #20296: fix: Alpha are unable to perform a second modification to a Dataset when in Explore
Posted by GitBox <gi...@apache.org>.
AAfghahi commented on code in PR #20296:
URL: https://github.com/apache/superset/pull/20296#discussion_r891576913
##########
superset-frontend/src/explore/components/controls/DatasourceControl/index.jsx:
##########
@@ -200,7 +200,8 @@ class DatasourceControl extends React.PureComponent {
const { user } = this.props;
const allowEdit =
datasource.owners.map(o => o.id).includes(user.userId) ||
- isUserAdmin(user);
+ datasource.owners.map(o => o.value).includes(user.userId);
Review Comment:
also should this be an || or should you be amending allowEdit with the new values from o.value?
--
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] AAfghahi commented on a diff in pull request #20296: fix: Alpha are unable to perform a second modification to a Dataset when in Explore
Posted by GitBox <gi...@apache.org>.
AAfghahi commented on code in PR #20296:
URL: https://github.com/apache/superset/pull/20296#discussion_r891576024
##########
superset-frontend/src/explore/components/controls/DatasourceControl/index.jsx:
##########
@@ -200,7 +200,8 @@ class DatasourceControl extends React.PureComponent {
const { user } = this.props;
const allowEdit =
datasource.owners.map(o => o.id).includes(user.userId) ||
- isUserAdmin(user);
+ datasource.owners.map(o => o.value).includes(user.userId);
Review Comment:
don't think this is the right way of doing it though.
##########
superset-frontend/src/explore/components/controls/DatasourceControl/index.jsx:
##########
@@ -200,7 +200,8 @@ class DatasourceControl extends React.PureComponent {
const { user } = this.props;
const allowEdit =
datasource.owners.map(o => o.id).includes(user.userId) ||
- isUserAdmin(user);
+ datasource.owners.map(o => o.value).includes(user.userId);
Review Comment:
couldn't you write this in without the ||
`o => o.id || o.value == user.userId `
--
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] hughhhh commented on a diff in pull request #20296: fix: Alpha are unable to perform a second modification to a Dataset when in Explore
Posted by GitBox <gi...@apache.org>.
hughhhh commented on code in PR #20296:
URL: https://github.com/apache/superset/pull/20296#discussion_r892296614
##########
superset-frontend/src/explore/components/controls/DatasourceControl/index.jsx:
##########
@@ -200,7 +200,8 @@ class DatasourceControl extends React.PureComponent {
const { user } = this.props;
const allowEdit =
datasource.owners.map(o => o.id).includes(user.userId) ||
- isUserAdmin(user);
+ datasource.owners.map(o => o.value).includes(user.userId);
Review Comment:
datasource.owners objects will either have value || id set in the object. So first i'm using map to create deconstruct the objects into a list of users ids then checking if the current user id is in the array.
--
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] hughhhh commented on a diff in pull request #20296: fix: Alpha are unable to perform a second modification to a Dataset when in Explore
Posted by GitBox <gi...@apache.org>.
hughhhh commented on code in PR #20296:
URL: https://github.com/apache/superset/pull/20296#discussion_r892296614
##########
superset-frontend/src/explore/components/controls/DatasourceControl/index.jsx:
##########
@@ -200,7 +200,8 @@ class DatasourceControl extends React.PureComponent {
const { user } = this.props;
const allowEdit =
datasource.owners.map(o => o.id).includes(user.userId) ||
- isUserAdmin(user);
+ datasource.owners.map(o => o.value).includes(user.userId);
Review Comment:
datasource.owners objects will either have value || id set in the object. So first i'm using map to create deconstruct the objects into a list of users ids then checking if the current user id is in the array.
--
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 #20296: fix: Alpha are unable to perform a second modification to a Dataset when in Explore
Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on PR #20296:
URL: https://github.com/apache/superset/pull/20296#issuecomment-1149038819
# [Codecov](https://codecov.io/gh/apache/superset/pull/20296?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 [#20296](https://codecov.io/gh/apache/superset/pull/20296?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (38ad047) into [master](https://codecov.io/gh/apache/superset/commit/d1c24f81f2989976728a49753961deb77ebec427?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (d1c24f8) will **increase** coverage by `0.00%`.
> The diff coverage is `100.00%`.
```diff
@@ Coverage Diff @@
## master #20296 +/- ##
=======================================
Coverage 66.65% 66.66%
=======================================
Files 1729 1729
Lines 64906 64908 +2
Branches 6842 6842
=======================================
+ Hits 43266 43269 +3
Misses 19891 19891
+ Partials 1749 1748 -1
```
| Flag | Coverage Δ | |
|---|---|---|
| javascript | `51.58% <100.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/20296?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...re/components/controls/DatasourceControl/index.jsx](https://codecov.io/gh/apache/superset/pull/20296/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EYXRhc291cmNlQ29udHJvbC9pbmRleC5qc3g=) | `74.69% <100.00%> (+1.85%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/20296?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/20296?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [d1c24f8...38ad047](https://codecov.io/gh/apache/superset/pull/20296?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?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] github-actions[bot] commented on pull request #20296: fix: Alpha are unable to perform a second modification to a Dataset when in Explore
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #20296:
URL: https://github.com/apache/superset/pull/20296#issuecomment-1149037922
@hughhhh Ephemeral environment spinning up at http://54.149.174.139:8080. Credentials are `admin`/`admin`. Please allow several minutes for bootstrapping and startup.
--
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] hughhhh merged pull request #20296: fix: Alpha are unable to perform a second modification to a Dataset when in Explore
Posted by GitBox <gi...@apache.org>.
hughhhh merged PR #20296:
URL: https://github.com/apache/superset/pull/20296
--
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