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.

@rusackas
Copy link
Member

rusackas commented Oct 1, 2024

Hi @nyohasstium - just curious your thoughts on the review comments. Let us know if we can help you carry this effort forward.

Copy link

codecov bot commented Oct 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.88%. Comparing base (76d897e) to head (41989a6).
Report is 812 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #30318       +/-   ##
===========================================
+ Coverage   60.48%   83.88%   +23.40%     
===========================================
  Files        1931      533     -1398     
  Lines       76236    38495    -37741     
  Branches     8568        0     -8568     
===========================================
- Hits        46114    32293    -13821     
+ Misses      28017     6202    -21815     
+ Partials     2105        0     -2105     
Flag Coverage Δ
hive 49.01% <100.00%> (-0.15%) ⬇️
javascript ?
mysql 76.84% <100.00%> (?)
postgres 76.93% <100.00%> (?)
presto 53.52% <100.00%> (-0.29%) ⬇️
python 83.88% <100.00%> (+20.40%) ⬆️
sqlite 76.38% <100.00%> (?)
unit 60.60% <25.00%> (+2.97%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

4 participants