Skip to content

Commit

Permalink
Docu links leftovers (SAP#974)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxmarkus authored Nov 21, 2019
1 parent 5c680c2 commit ebbd70c
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 27 deletions.
4 changes: 2 additions & 2 deletions client/src/linkManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ export class linkManager extends LuigiClientBase {
* @example
* LuigiClient.linkManager().openAsModal('projects/pr1/users', {title:'Users', size:'m'});
*/
openAsModal(path, modalSettings) {
this.navigate(path, 0, true, modalSettings || {});
openAsModal(path, modalSettings = {}) {
this.navigate(path, 0, true, modalSettings);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Read the Luigi Client API documentation to learn more about the functions and pa

## Examples

Check the Luigi [application examples](../core/examples/README.md) for an in-depth look at Luigi capabilities.
Check the Luigi [application examples](../core/examples) for an in-depth look at Luigi capabilities.

## Development

Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ Follow these steps to create a global user interface and host a full web applica
Follow these steps to develop micro frontends and connect them to an already existing Luigi Core app:

1. [Install Luigi Client](luigi-client-setup.md).
2. Use the functions and parameters provided by the Luigi Client API. You can find them in the [Luigi Client API documentation](luigi-client-api.md).
2. Use the functions and parameters provided by the Luigi Client API. You can find them in the [Luigi Client API documentation](luigi-client-api.md).
2 changes: 1 addition & 1 deletion docs/luigi-client-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ Opens a view in a modal. You can specify the modal's title and size. If you don'
#### Parameters

- `path` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** navigation path
- `modalSettings` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** opens a view in a modal. Use these settings to configure the modal's title and size
- `modalSettings` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** opens a view in a modal. Use these settings to configure the modal's title and size (optional, default `{}`)
- `modalSettings.title` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** modal title. By default, it is the node label. If there is no label, it is left empty
- `modalSettings.size` **(`"l"` \| `"m"` \| `"s"`)** size of the modal (optional, default `"l"`)

Expand Down
1 change: 0 additions & 1 deletion website/docs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

# Generated and copied
extendedConfiguration.bundle.js
fundamental-ui
luigi-core
luigi-client
public/*
Expand Down
6 changes: 0 additions & 6 deletions website/docs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion website/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"copy-webpack-plugin": "^5.0.4",
"css-loader": "^3.2.0",
"esm": "^3.2.25",
"fiori-fundamentals": "^1.7.1",
"lodash.orderby": "^4.6.0",
"mini-css-extract-plugin": "^0.8.0",
"node-sass": "^4.12.0",
Expand Down
7 changes: 6 additions & 1 deletion website/docs/src/client-js/internal-links.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ export class InternalLinksHandler {
window.navigateInternal = (evt, elem) => {
evt.preventDefault();
evt.stopPropagation();
const url = new URL(elem.getAttribute('href'));
let url;
try {
url = new URL(elem.getAttribute('href'));
} catch (error) {
console.debug('navigateInternal URL parse error', elem, elem.getAttribute('href'), error);
}
const urlWithPath = url.pathname.replace(ctx.coreBaseUrl, '').replace('.md', '').replace('/docu-microfrontend', '');
if (url.hash) {
LuigiClient.linkManager().withParams({hash: url.hash.toLowerCase()}).navigate(urlWithPath);
Expand Down
1 change: 1 addition & 0 deletions website/docs/src/client-js/smooth-scroll-anchors.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export class ScrollAnchorsHandler {
if (LuigiClient.getNodeParams().hash) {
this.scrollAnchor(null, LuigiClient.getNodeParams().hash);
}
window.scrollAnchor = this.scrollAnchor;
});
}

Expand Down
5 changes: 2 additions & 3 deletions website/docs/src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,5 @@ sapper.start({
new CopyCodeHandler().init();
new InternalLinksHandler().init();

const scrollHandler = new ScrollAnchorsHandler();
scrollHandler.init();
window.scrollAnchor = scrollHandler.scrollAnchor;
new ScrollAnchorsHandler().init();

12 changes: 6 additions & 6 deletions website/docs/src/routes/docs/index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@
</script>

<style>
.invisible {
height: 0;
overflow: hidden;
}
</style>

<svelte:head>
<title>Documentation</title>
</svelte:head>

{#each docs as doc}
<!-- we're using the non-standard `rel=prefetch` attribute to
tell Sapper to load the data for the page as soon as
the user hovers over the link or taps it, instead of
waiting for the 'click' event -->
{#if doc.shortName == "README"}
{@html doc.contents}
{:else}
<li><a rel='prefetch' href='docs/{doc.shortName}'>{doc.name}</a></li>
<!-- Used as sapper sitemap -->
<li class="invisible"><a rel='prefetch' href='docs/{doc.shortName}'>{doc.name}</a></li>
{/if}
{/each}
4 changes: 0 additions & 4 deletions website/docs/webpack-generateConfig.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ module.exports = {
"from": "node_modules/@kyma-project/luigi-client",
"to": "../luigi-client"
},
{
"from": "node_modules/fiori-fundamentals/dist",
"to": "../fundamental-ui"
},
{
"from": "../../docs/assets",
"to": "../assets"
Expand Down

0 comments on commit ebbd70c

Please sign in to comment.