fix: correct dashboard title fallback and date filter widget defaults#195
Conversation
Preserve class-level dashboard title when none is passed to __init__, call get_default_label() instead of get_default_value() in DateFilterWidget, and accept tuples as date ranges in get_value_from_date_or_range().
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 38fecd8fa4
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| super().__init__() | ||
| self.widgets = widgets or self.widgets or [] | ||
| self.title = title | ||
| self.title = title or self.title |
There was a problem hiding this comment.
Preserve the project-name fallback for untitled dashboards
When SBAdminDashboardView() is instantiated without an explicit title, super().__init__() has already populated self.title from the inherited label ("Dashboard"), so title or self.title is never falsy. This bypasses the existing get_title() fallback to settings.PROJECT_NAME, meaning dashboards that omitted title now render the generic Dashboard heading instead of the project name; the fallback needs to distinguish a real class-level title from the base label default.
Useful? React with 👍 / 👎.
Preserve class-level dashboard title when none is passed to init, call get_default_label() instead of get_default_value() in DateFilterWidget, and accept tuples as date ranges in get_value_from_date_or_range().