Repository navigation
Conversation
…APP_ROOT ImageLoader fetched thumbnails with a bare fetch, so root-relative thumbnail_url paths didn't prepend SUPERSET_APP_ROOT. Moved the ListViewCard story images to imgFallbackURL since Storybook has no configured client.
| useEffect(() => { | ||
| if (src) { | ||
| fetch(src) | ||
| SupersetClient.get({ endpoint: src, parseMethod: 'raw' }) |
There was a problem hiding this comment.
Switching to SupersetClient.get changes the fetch call that the callers' tests assert on: SupersetClient awaits ensureAuth() and then calls fetch with an absolute URL and an options object. DashboardCard.test.tsx (thumbnail URL construction, around lines 226-257) still expects a synchronous fetch('/api/v1/dashboard/<id>/thumbnail/<ts>/') with no second argument, and the sharded-jest-tests (2) check fails on exactly those two assertions. Could you update them to wait for the request and match the new fetch signature (or assert on SupersetClient.get)?
ImageLoader fetches thumbnails via SupersetClient.get, which awaits ensureAuth() before fetch. Test now waits for the request and matches the URL by its path and method option
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
| Language | Invalidated translations |
|---|---|
tr |
196 |
How to fix
1. Install dependencies (if not already set up):
pip install -r superset/translations/requirements.txt
sudo apt-get install gettext # or: brew install gettext2. Re-extract strings and sync .po files:
./scripts/translations/babel_update.shThis rewrites superset/translations/messages.pot from the current source files and merges the changes into every .po file. Strings whose msgid changed will be marked #, fuzzy.
3. Resolve the fuzzy entries in the affected language files (tr):
grep -n '#, fuzzy' superset/translations/<lang>/LC_MESSAGES/messages.poFor each fuzzy entry, either rewrite the msgstr to match the new string and remove the #, fuzzy line, or clear the msgstr to "" if you cannot provide a translation.
4. Commit your changes to the .po files.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #45640 +/- ##
=======================================
Coverage 84.62% 84.62%
=======================================
Files 3069 3069
Lines 205483 205483
Branches 48295 48295
=======================================
+ Hits 173882 173883 +1
+ Misses 28307 28306 -1
Partials 3294 3294
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| useEffect(() => { | ||
| if (src) { | ||
| fetch(src) | ||
| SupersetClient.get({ endpoint: src, parseMethod: 'raw' }) |
There was a problem hiding this comment.
SupersetClient.get calls getInstance(), which throws synchronously when configure() was never called, so the error skips the .catch below and the effect throws on mount instead of showing the fallback image. Storybook and the docs portal never configure the client, and docs/developer_docs/components/ui/listviewcard.mdx at this head still passes imgURL="https://picsum.photos/seed/superset/300/200" (lines 39 and 100), so that live example would crash rather than render. Could the request be started inside the promise chain (for example Promise.resolve().then(() => SupersetClient.get(...))) so an unconfigured client falls back to imgFallbackURL?
ImageLoader fetched thumbnails with a bare fetch, so root-relative thumbnail_url paths didn't prepend SUPERSET_APP_ROOT. Moved the ListViewCard story images to imgFallbackURL since Storybook has no configured client.
SUMMARY
When Superset is served under a subdirectory i.e. (
SUPERSET_APP_ROOT=/analytics), thumbnails on the chart list, the dashboard list and the dashboard editor's "add chart" panel are requested without the prefix: the page asks for/api/v1/chart/123/thumbnail/<digest>/instead of/analytics/api/v1/chart/123/thumbnail/<digest>/.Root cause.
ImageLoader(packages/superset-ui-core/src/components/ListViewCard/ImageLoader.tsx) loads images with a barefetch(src). The backend'sthumbnail_urlis a root-relative API path without the app root, which matches the frontend convention since #39925, so the prefix has to be added client side. A barefetchnever goes throughSupersetClient.getUrl, so it never gets it.Fix.
ImageLoaderrequestssrcthroughSupersetClient.get({ endpoint: src, parseMethod: 'raw' }), the same pattern used inuseDownloadScreenshot.tsandutils/export.ts. The client adds the app root, the CSRF header and the auth handling. Callers (ChartCard,DashboardCard,AddSliceCard) are unchanged.Behaviour changes
ImageLoader'ssrcmust be a Superset endpoint. Absolute external URLs are no longer supported; no caller in the app passes one.SupersetClient's redirect to login, like any other API call.ensureAuth(), so it starts asynchronously rather than during the first effect run.Stories and docs. The
ListViewCardstories passed picsum URLs asimgURL. Storybook and the docs portal never configureSupersetClient, so those stories would throw. The picsum images move toimgFallbackURL(a CSS background, not fetched) andimgURLis empty.docs/developer_docs/components/ui/listviewcard.mdxis regenerated from the stories. Typing an endpoint into theimgURLcontrol in Storybook or the docs page will still fail, since there is no configured client there.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A. With
SUPERSET_APP_ROOTset, list cards go from the placeholder image to the real thumbnail. Without an app root, nothing changes.TESTING INSTRUCTIONS
Automated:
Manual:
THUMBNAILSfeature flag and a working thumbnail cache/worker setup.SUPERSET_APP_ROOT=/analytics, behind a proxy that only routes/analyticsto Superset./analytics/api/v1/.../thumbnail/...and the images render. Onmasterthey go to/api/v1/...and fall back to the placeholder.SUPERSET_APP_ROOT, thumbnails load as before.ADDITIONAL INFORMATION
THUMBNAILS(to see thumbnails at all)