Skip to content

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

Closed
wants to merge 5 commits into from

Conversation

pritishpai
Copy link
Contributor

Dashboards can order widgets defined in dashboard.yml

Introduces #131

@pritishpai pritishpai marked this pull request as draft June 13, 2024 03:00
Copy link

✅ 27/27 passed, 2 skipped, 34m56s total

Running from acceptance #134

Copy link
Contributor

@JCZuurmond JCZuurmond left a 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"
Copy link
Contributor

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

Copy link
Contributor

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:
Copy link
Contributor

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See other comments

Suggested change
widgets: list[WidgetSpec] = dataclasses.field(default_factory=list)
widgets: dict[str, WidgetMetadata] = ...

@JCZuurmond JCZuurmond closed this Jul 15, 2024
@nfx nfx deleted the feat/order_widgets_dashboard_yml branch July 30, 2024 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants