You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "nyohasstium (via GitHub)" <gi...@apache.org> on 2024/09/18 13:48:35 UTC

[PR] SRV-795 feat - reading language from url + resource type check fix [superset]

nyohasstium opened a new pull request, #30318:
URL: https://github.com/apache/superset/pull/30318

   <!---
   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(embedded dashboard): resource type was not checked appropriately against enum.
   feat(UI): added currency and language to URL_PARAMS
   feat(API):  using language based on query parameter if found and defaulting to session value 
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   - Embed a dashboard using the superset-embedded-sdk package.
   - Set lang and currency in the urlParams options.
   - Depending on the chosen language, the ui will be rendered with it.
   ### 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:
   - [X] 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
   - [X] 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


Re: [PR] feat: reading language from url + resource type check fix [superset]

Posted by "michael-s-molina (via GitHub)" <gi...@apache.org>.
michael-s-molina commented on code in PR #30318:
URL: https://github.com/apache/superset/pull/30318#discussion_r1765455319


##########
superset-frontend/src/constants.ts:
##########
@@ -111,6 +111,14 @@ export const URL_PARAMS = {
     name: 'focused_chart',
     type: 'number',
   },
+  language: {

Review Comment:
   I believe the correct parameter here should be locale which is comprised of both the language and region. Another point is that we should be able to infer the currency from the locale.



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


Re: [PR] feat: reading language from url + resource type check fix [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #30318:
URL: https://github.com/apache/superset/pull/30318#issuecomment-3643677330

   This PR hasn't been updated in a long time and is in need of a rebase. We'll mark it as draft, but please set it as 'ready for review' when it's been brought up to speed.


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


Re: [PR] feat: reading language from url + resource type check fix [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas closed pull request #30318: feat: reading language from url + resource type check fix
URL: https://github.com/apache/superset/pull/30318


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


Re: [PR] feat: reading language from url + resource type check fix [superset]

Posted by "villebro (via GitHub)" <gi...@apache.org>.
villebro commented on code in PR #30318:
URL: https://github.com/apache/superset/pull/30318#discussion_r1765447424


##########
superset/security/manager.py:
##########
@@ -2652,7 +2652,7 @@ def has_guest_access(self, dashboard: "Dashboard") -> bool:
             return False
 
         dashboards = [
-            r for r in user.resources if r["type"] == GuestTokenResourceType.DASHBOARD
+            r for r in user.resources if r["type"] == GuestTokenResourceType.DASHBOARD.value

Review Comment:
   I believe this was already fixed here: #30042



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


Re: [PR] feat: reading language from url + resource type check fix [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #30318:
URL: https://github.com/apache/superset/pull/30318#issuecomment-4702283602

   This bundles a couple of unrelated changes and the review comments never got a reply. Closing as inactive - ping me if you'd like to revive it (ideally split out the embedded-resource fix).


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