Skip to content
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

refactor the dynamic sidebar links (menuLinks) to be extendable to control all dashboard links #130

Merged

Conversation

ca-scribner
Copy link
Contributor

This PR refactors the existing dynamic dashboard implementation to make it more easily reused with other dashboard link types.

changes include:

  • refactoring the library to use new nomenclature
  • removing some unnecessary dashboard link tests
  • refactoring the link handling logic of the charm into separate functions for easier reuse

The general function of the charm shouldn't change, just the implementation.

Notes to reviewers:

  • linting wont pass (will be cleaned up in future PR)
  • unit tests should pass
  • integration tests.... tbd :)

* Changes the library from SidebarItems to DashboardLinks (to make it easier to extend the lib to manage other link types)
* Changes the library to use Dashboard nomenclature
* Refactors charm and tests to use new library
* Renames any existing sidebar_items to menu_links
* Takes the existing menuLink (previously, sidebar) tooling in the charm and extracts it into a generic dashboard_links.py file that is link-type agnostic.
* reimplements the menuLinks using the new link-type agnostic tooling
* updates tests to new structure
Copy link
Contributor

@NohaIhab NohaIhab left a comment

Choose a reason for hiding this comment

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

refactoring looks good, left one small comment

Comment on lines +16 to +18
def aggregate_links(
links_from_relation: List[DashboardLink], additional_link_config: str, link_order_config: str
):
Copy link
Contributor

Choose a reason for hiding this comment

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

docstring missing here, same for the method below

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added!

Copy link
Member

@misohu misohu left a comment

Choose a reason for hiding this comment

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

LGTM good job

@ca-scribner ca-scribner merged commit f211207 into kf-3664-dynamic-sidebar-feature-branch Jul 12, 2023
6 checks passed
@ca-scribner ca-scribner deleted the kf-3796-refactor-menu-links branch July 12, 2023 12:32
ca-scribner added a commit that referenced this pull request Jul 12, 2023
…ntrol all dashboard links (#130)

Takes the existing sidebar implementation (for dashboard `menuLinks`) and refactors it to be easily extended to all kubeflow dashboard link types (menu, external, quick, and documentation).

* Changes the library from SidebarItems to DashboardLinks (to make it easier to extend the lib to manage other link types)
* Changes the library to use Dashboard nomenclature
* Refactors charm and tests to use updated library
* Renames any existing sidebar_items to menu_links
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants