-
Notifications
You must be signed in to change notification settings - Fork 5
Order widgets using order key in dashboard.yml #152
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
Conversation
✅ 27/27 passed, 2 skipped, 34m56s total Running from acceptance #134 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some pointers
sdk_dashboard = make_dashboard(display_name="Order Key") | ||
|
||
with (tmp_path / "dashboard.yml").open("w") as f: | ||
f.write("display_name: Order Key\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We were thinking about the following dashboard.yml
format:
display_name: <dashboard name>
widgets:
<widget name/id>:
order: 1
<widget name/id>:
order: 0
<widget name/id>:
order: 2
Maybe you could add that to the docs first so that we can give feedback about
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Widget id is by default the file stem
@@ -33,21 +33,37 @@ | |||
T = TypeVar("T") | |||
logger = logging.getLogger(__name__) | |||
|
|||
#TODO: check if can be integrated with widget metadata | |||
@dataclass | |||
class WidgetSpec: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WidgetMetdata
is added here #147
|
||
@dataclass | ||
class DashboardMetadata: | ||
display_name: str | ||
widgets: list[WidgetSpec] = dataclasses.field(default_factory=list) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See other comments
widgets: list[WidgetSpec] = dataclasses.field(default_factory=list) | |
widgets: dict[str, WidgetMetadata] = ... |
Dashboards can order widgets defined in dashboard.yml
Introduces #131