Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix(@blindnet-demos/devkit-simple-tutorial): base url #84

Merged
merged 1 commit into from
Sep 2, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion demos/devkit-simple-tutorial/index.html
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
/>
<meta name="Description" content="Simple tutorial for blindnet devkit" />
<link rel="icon" href="./assets/favicon.svg" />
<base href="/" />
<base href="/privacy-components-web/demos/devkit-simple-tutorial/" />
<link
rel="stylesheet"
href="https://1.www.s81c.com/common/carbon-for-ibm-dotcom/tag/v1/latest/plex.css"
20 changes: 12 additions & 8 deletions demos/devkit-simple-tutorial/src/DevkitSimpleTutorial.js
Original file line number Diff line number Diff line change
@@ -74,6 +74,10 @@ export class DevkitSimpleTutorial extends LitElement {
},
component: 'app-form',
},
{
path: '',
redirect: '/',
},
]);
}

@@ -84,23 +88,23 @@ export class DevkitSimpleTutorial extends LitElement {
button-label-active="Close menu"
button-label-inactive="Open menu"
></bx-header-menu-button>
<bx-header-name href="/" prefix="blindnet devkit"
<bx-header-name href="./" prefix="blindnet devkit"
>tutorial</bx-header-name
>
<bx-header-nav menu-bar-label="blindnet devkit tutorial">
<bx-header-nav-item href="/participate">Prizes</bx-header-nav-item>
<bx-header-nav-item href="/privacy">Privacy</bx-header-nav-item>
<bx-header-nav-item href="/backoffice"
<bx-header-nav-item href="./participate">Prizes</bx-header-nav-item>
<bx-header-nav-item href="./privacy">Privacy</bx-header-nav-item>
<bx-header-nav-item href="./backoffice"
>Back Office</bx-header-nav-item
>
</bx-header-nav>
</bx-header>
<bx-side-nav aria-label="Side navigation">
<bx-side-nav-items>
<bx-side-nav-link href="/">Home</bx-side-nav-link>
<bx-side-nav-link href="/participate">Prizes</bx-side-nav-link>
<bx-side-nav-link href="/privacy">Privacy</bx-side-nav-link>
<bx-side-nav-link href="/backoffice">Back Office</bx-side-nav-link>
<bx-side-nav-link href="./">Home</bx-side-nav-link>
<bx-side-nav-link href="./participate">Prizes</bx-side-nav-link>
<bx-side-nav-link href="./privacy">Privacy</bx-side-nav-link>
<bx-side-nav-link href="./backoffice">Back Office</bx-side-nav-link>
</bx-side-nav-items>
</bx-side-nav>
<main>
10 changes: 9 additions & 1 deletion demos/devkit-simple-tutorial/src/views/BackOffice.js
Original file line number Diff line number Diff line change
@@ -7,7 +7,15 @@ export class AppBackOffice extends LitElement {
}

showDCI() {
Router.go('/admin');
// Vaadin Router doesn't handle baseUrl propertly here
// TODO: report issue to Vaadin
// alternatively, we could use a popstate event
const baseURL = document.querySelector('base')?.href || '/';
const routed = Router.go(`${baseURL}admin`);
if (!routed) {
// eslint-disable-next-line no-console
console.error('admin route not found');
}
}

render() {
6 changes: 1 addition & 5 deletions demos/devkit-simple-tutorial/src/views/DCI.js
Original file line number Diff line number Diff line change
@@ -7,11 +7,7 @@ export class AppDCI extends LitElement {
}

render() {
return html`
<h1>Admin</h1>

<bldn-data-consum></bldn-data-consum>
`;
return html` <bldn-data-consum></bldn-data-consum> `;
}
}

2 changes: 1 addition & 1 deletion demos/devkit-simple-tutorial/src/views/Home.js
Original file line number Diff line number Diff line change
@@ -47,7 +47,7 @@ export class AppHome extends LitElement {
for details and instructions.
</p>

<p>🚀 <a class="app-link" href="/privacy">Make a privacy request.</a></p>
<p>🚀 <a class="app-link" href="./privacy">Make a privacy request.</a></p>
`;
}
}
3 changes: 3 additions & 0 deletions demos/devkit-simple-tutorial/web-dev-server.config.mjs
Original file line number Diff line number Diff line change
@@ -23,4 +23,7 @@ export default /** @type {import('@web/dev-server').DevServerConfig} */ ({
],

// See documentation for all available options
// https://modern-web.dev/docs/dev-server/cli-and-configuration/

basePath: '/privacy-components-web/demos/devkit-simple-tutorial/',
});