Skip to content

Commit

Permalink
Add pinterest links to top menu (#17)
Browse files Browse the repository at this point in the history
* Add pinterest links to top menu
  • Loading branch information
kgopal492 authored and zhangvi7 committed Aug 1, 2024
1 parent 5c2b5db commit 71c60ad
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions superset/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1664,6 +1664,8 @@ class ExtraRelatedQueryFilters(TypedDict, total=False):

EXTRA_RELATED_QUERY_FILTERS: ExtraRelatedQueryFilters = {}

PINTEREST_MENU_ITEMS: List[Dict[str, str]] = None


# Extra dynamic query filters make it possible to limit which objects are shown
# in the UI before any other filtering is applied. Useful for example when
Expand Down
14 changes: 14 additions & 0 deletions superset/initialization/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,20 @@ def init_views(self) -> None:
category="Manage",
menu_cond=lambda: feature_flag_manager.is_feature_enabled("TAGGING_SYSTEM"),
)

if self.config["PINTEREST_MENU_ITEMS"]:
for menu_item in self.config["PINTEREST_MENU_ITEMS"]:
appbuilder.add_link(
menu_item["name"],
label=__(menu_item["name"]),
href=menu_item["href"],
icon=menu_item["icon"],
category="Pinterest",
category_label=__("Pinterest"),
category_icon=menu_item["icon"],
)
appbuilder.add_separator("Pinterest")

appbuilder.add_api(LogRestApi)
appbuilder.add_view(
LogModelView,
Expand Down

0 comments on commit 71c60ad

Please sign in to comment.