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

feat: reading language from url + resource type check fix #30318

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nyohasstium
Copy link

SUMMARY

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

  • 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

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • 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

@dosubot dosubot bot added api Related to the REST API change:frontend Requires changing the frontend embedded labels Sep 18, 2024
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congrats on making your first PR and thank you for contributing to Superset! 🎉 ❤️

We hope to see you in our Slack community too! Not signed up? Use our Slack App to self-register.

@michael-s-molina michael-s-molina changed the title SRV-795 feat - reading language from url + resource type check fix feat: reading language from url + resource type check fix Sep 18, 2024
r for r in user.resources if r["type"] == GuestTokenResourceType.DASHBOARD
r for r in user.resources if r["type"] == GuestTokenResourceType.DASHBOARD.value
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this was already fixed here: #30042

@@ -111,6 +111,14 @@ export const URL_PARAMS = {
name: 'focused_chart',
type: 'number',
},
language: {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Related to the REST API change:frontend Requires changing the frontend embedded size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants