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

   ## Summary
   
   `DASHBOARD_AUTO_REFRESH_INTERVALS` reaches the browser but is never read by 
the frontend: the refresh-interval selector builds its radio list from a 
module-level constant, `REFRESH_FREQUENCY_OPTIONS` in 
`superset-frontend/src/dashboard/components/RefreshFrequency/RefreshFrequencySelect.tsx`.
 On `master` only `DASHBOARD_AUTO_REFRESH_MODE` survived the auto-refresh 
rework (#37459); in 6.0.0 `Header/index.jsx` still looked the configured pairs 
up to label an interval, so this is a consumption gap, not a payload gap.
   
   This makes the selector derive its options from the bootstrapped config, 
which restores the 6.0.x behaviour:
   
   - `getRefreshFrequencyOptions` turns the configured `[seconds, label]` pairs 
into options and appends the `Custom` entry, which is a UI affordance rather 
than an interval. Configured labels are rendered verbatim — the deployment 
authored them, so running them through `t()` would rewrite operator wording (a 
German `10 Minuten` stays `10 Minuten`).
   - The value list is now data rather than a hard-coded slice, so a configured 
interval that is absent from the built-in list (e.g. `600`) is offered and 
persisted like any preset.
   - `isPresetValue`/`getCustomValue` take the resolved list, so a dashboard 
whose stored `refresh_frequency` is missing from the configuration still 
renders — the frequency falls through to the `Custom` input with its current 
value instead of silently resetting to "Don't refresh".
   
   ## Why the fallback branch
   
   The option list degrades to the previous built-in constant whenever the 
config is absent or not a well-formed list of `[number, string]` pairs — an 
empty array, a bare string, entries with a missing/blank label, or a negative 
or non-numeric value. That keeps embedded and partially bootstrapped payloads 
rendering exactly as they do today instead of an empty selector. A `Custom` 
entry already present in the configuration is not duplicated.
   
   ## Testing
   
   ```
   cd superset-frontend
   npx jest src/dashboard/components/RefreshFrequency 
src/dashboard/components/RefreshIntervalModal.test.tsx 
src/dashboard/components/PropertiesModal
   ```
   
   84 passed / 10 suites. The same new tests against pristine `origin/master` 
(7a2913e2db) fail 7/17, so the interval list and the malformed-entry handling 
are pinned by the suite rather than asserted against current behaviour. 
`RefreshFrequencySelect` is shared with `PropertiesModal`'s `RefreshSection`, 
whose suites are included in that run. `npx oxlint --config oxlint.json` is 
clean on the touched paths (the `set-state-in-effect` warning on that file is 
present on `master` too), and `tsc -p .` reports nothing for these files (the 
run fails on unbuilt plugin project references, unrelated to this change).
   
   Fixes #44981


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to