From 7375322bfe2bea026a062cda397745c1d7946456 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Pasquier Date: Thu, 26 Mar 2020 11:19:11 +0100 Subject: [PATCH] minor: setup sib app for dashboard component --- src/dependencies.pug | 4 ++++ src/index.pug | 4 ++++ src/menu-left.pug | 7 ++++++- src/page-dashboard.pug | 5 +++++ 4 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 src/page-dashboard.pug diff --git a/src/dependencies.pug b/src/dependencies.pug index ec43d24..2bc5473 100644 --- a/src/dependencies.pug +++ b/src/dependencies.pug @@ -14,6 +14,8 @@ if libLocal script(type="module" src="/lib/sib-conversation/sib-conversation.js") if publicDirectory && (endpoints.users || (endpoints.get && endpoints.get.users)) script(type="module" src="/lib/sib-directory/sib-directory.js") + if endpoints.dashboard || (endpoints.get && endpoints.get.dashboard) + script(type="module" src="/lib/sib-dashboard/sib-dashboard.js") else script(type="module" src="https://unpkg.com/@startinblox/oidc@0.8") script(type="module" src="https://unpkg.com/@startinblox/core@0.9") @@ -28,6 +30,8 @@ else script(type="module" src="https://unpkg.com/@startinblox/component-conversation@0.3") if publicDirectory && (endpoints.users || (endpoints.get && endpoints.get.users)) script(type="module" src="https://unpkg.com/@startinblox/component-directory@0.3") + if endpoints.dashboard || (endpoints.get && endpoints.get.dashboard) + script(type="module" src="https://unpkg.com/@startinblox/component-dashboard@0.1") //- Stylesheets link(rel='stylesheet', href='/styles/index.css') diff --git a/src/index.pug b/src/index.pug index 41e2812..2ffceea 100644 --- a/src/index.pug +++ b/src/index.pug @@ -18,6 +18,10 @@ html(lang="en") include menu-left.pug div#viewport + if endpoints.dashboard || (endpoints.get && endpoints.get.dashboard) + #dashboard(hidden).no-sidebar + include page-dashboard.pug + if publicDirectory && (endpoints.users || (endpoints.get && endpoints.get.users)) #members(hidden).no-sidebar include page-directory.pug diff --git a/src/menu-left.pug b/src/menu-left.pug index 232b737..b3e9a36 100644 --- a/src/menu-left.pug +++ b/src/menu-left.pug @@ -30,7 +30,12 @@ sib-widget(name='menu-fix-url-project') ) nav#main__menu.jsLeftMenu - sib-router#navbar-router(default-route='members') + sib-router#navbar-router(default-route='dashboard') + if endpoints.dashboard || (endpoints.get && endpoints.get.dashboard) + sib-route.menu(name='dashboard') + div.menu-label Dashboard + div.menu-icon.icon-dashboard + div.divider if publicDirectory && (endpoints.users || (endpoints.get && endpoints.get.users)) sib-route.menu(name='members') div.menu-label Members diff --git a/src/page-dashboard.pug b/src/page-dashboard.pug new file mode 100644 index 0000000..2c6e8ea --- /dev/null +++ b/src/page-dashboard.pug @@ -0,0 +1,5 @@ +.views-container + h2 Dashboard + sib-dashboard( + data-src=`${endpoints.dashboard || endpoints.get.dashboard}` + )