Skip to content

Commit

Permalink
Fix small docu bugs (#161)
Browse files Browse the repository at this point in the history
* Consolidate routing docu into navigation-configuration file, removing duplication

* fix broken links

* fix indentation and e2e tests commands in angular example readme

* fix small remaining issues

* Small fixes based on review from technical writer

* Remove capitalization from node navigation

* Update filename and add links to files
  • Loading branch information
jesusreal authored Oct 24, 2018
1 parent c756057 commit 3c3c2c5
Show file tree
Hide file tree
Showing 18 changed files with 72 additions and 86 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ The lerna-changelog tool detects changes based on PR labels and maps them to sec
## [core-0.3.3] - 2018-09-14

#### :rocket: Added
* [#67](https://github.com/kyma-project/luigi/pull/67) Navigation Node visibility with custom nodeAccessibilityResolver ([@maxmarkus](https://github.com/maxmarkus))
* [#67](https://github.com/kyma-project/luigi/pull/67) Navigation node visibility with custom nodeAccessibilityResolver ([@maxmarkus](https://github.com/maxmarkus))

#### :bug: Fixed
* [#82](https://github.com/kyma-project/luigi/pull/82) Fixed changedetector bug ([@dariadomagala](https://github.com/dariadomagala))
Expand Down
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,15 @@ Luigi core is the part of Luigi that enables navigation, security and routing. T
- [Application setup](docs/application-setup.md) shows you the first steps to prepare your application for development.
- [Navigation configuration](docs/navigation-configuration.md) shows you how to configure navigation.
- [Authorization configuration](docs/authorization-configuration.md) shows you how to secure Luigi.
- [Routing mechanism configuration](docs/router-configuration.md) demonstrates routing in Luigi.
- [General settings](docs/general-settings.md) provides you with configuration parameters.

### Luigi client

Luigi client enables integration of Luigi in views. You can easily configure the lifecycle and links of the client, as well as customize the appearance of your navigation.

- [Lifecycle](docs/lifecycle.md) gives you details on the life cycle of listeners, navigation Nodes and Event data.
- [Link Manager](docs/link-manager.md) shows how to configure the Link Manager.
- [UX Manager](docs/ux-manager.md) shows how to set up the UX Manager.

* [Lifecycle](docs/luigi-client-api.md#lifecycle) gives you details on the life cycle of listeners, navigation nodes, and Event data.
* [Link Manager](docs/luigi-client-api.md#linkmanager) guides you through the configuration of the Link Manager.
* [UX Manager](docs/luigi-client-api.md#uxmanager) shows you how to set up the UX Manager.
See [this](https://github.com/kyma-project/luigi/blob/master/client/README.md) document to learn more about the Luigi client.

View [example applications](/core/examples).
Expand All @@ -38,7 +36,7 @@ All projects in the repository use [Prettier](https://prettier.io) to format sou

## Tests

To ensure that existing features still work as expected after your changes, you can run UI tests from the 'luigi-sample-angular' example. Before running the tests, start the sample application by using the `npm start` command in the application folder.
To ensure that existing features still work as expected after your changes, run UI tests from the [Angular example application](/core/examples/luigi-sample-angular). Before running the tests, start the sample application by using the `npm start` command in the application folder.

When the application is ready:

Expand Down
12 changes: 6 additions & 6 deletions client/luigi-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@

return {
/**
* There are various parameters and functions available to Luigi pertaining to the lifecycle of listeners, navigation Nodes, and Event data.
* There are various parameters and functions available to Luigi pertaining to the lifecycle of listeners, navigation nodes, and Event data.
* @name lifecycle
*/
/**
Expand Down Expand Up @@ -144,7 +144,7 @@
return currentContext.context;
},
/**
* Returns the configuration object of the active navigation Node.
* Returns the configuration object of the active navigation node.
* @returns {Object} node parameters.
* @memberof lifecycle
*/
Expand Down Expand Up @@ -205,7 +205,7 @@
},

/**
* Sets the current navigation context to that of a specific parent Node that has the {@link navigation-configuration.md navigationContext} field declared in its navigation configuration. This navigation context is then used by navigate function.
* Sets the current navigation context to that of a specific parent node that has the {@link navigation-configuration.md navigationContext} field declared in its navigation configuration. This navigation context is then used by navigate function.
* @param {Object} navigationContext
* @returns {linkManager} link manager instance.
* @example
Expand All @@ -229,7 +229,7 @@
},

/**
* Sets the current navigation context, which is then be used by the navigate function. This has to be a parent navigation context, it is not possible to go to child navigation contexts.
* Sets the current navigation context, which is then used by the navigate function. This has to be a parent navigation context, it is not possible to go to child navigation contexts.
* @returns {linkManager} link manager instance.
* @example
* LuigiClient.linkManager().fromClosestContext().navigate('/users/groups/stakeholders')
Expand All @@ -249,7 +249,7 @@
},

/**
* Sends node parameters to the route, which are then used by the navigate function. Use it optionally in combination with any of the navigation functions and receive it with as part of the context object in Luigi Client.
* Sends node parameters to the route, which are then used by the navigate function. Use it optionally in combination with any of the navigation functions and receive it as part of the context object in Luigi Client.
* @param {Object} nodeParams
* @returns {linkManager} link manager instance.
* @example
Expand Down Expand Up @@ -309,7 +309,7 @@
);
},
/**
* Removes the loading indicator. Use it after calling {@link #showLoadingIndicator showLoadingIndicator()} or to hide the indicator when you use the {@link navigation-configuration.md#nodes loadingIndicator.hideAutomatically: false} Node configuration.
* Removes the loading indicator. Use it after calling {@link #showLoadingIndicator showLoadingIndicator()} or to hide the indicator when you use the {@link navigation-configuration.md#nodes loadingIndicator.hideAutomatically: false} node configuration.
*/
hideLoadingIndicator: function hideLoadingIndicator() {
window.parent.postMessage(
Expand Down
30 changes: 15 additions & 15 deletions core/examples/luigi-sample-angular/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,26 @@ To have this application running, follow these steps:

4. Start the example application from the `luigi/core/examples/luigi-sample-angular` folder.

`/assets/sampleConfiguration.js` is the default configuration with a showcase of all available features. If you want to try out a much simpler example, change the configuration reference in `index.html` to `basicConfiguration.js`.
[`extendedConfiguration.js`](src/assets/extendedConfiguration.js) is the default configuration with a showcase of all available features. If you want to try out a much simpler example, change the configuration reference in [`index.html`](src/index.html) to [`basicConfiguration.js`](src/assets/basicConfiguration.js).

- To run Luigi with hash based routing, change the **routing.useHashrouting** configuration to `true` and run the following command:
```bash
npm run start
```
- To run Luigi with hash-based routing, change the **routing.useHashrouting** configuration to `true` and run the following command:
```bash
npm run start
```

- To run Luigi with path based routing, change the **routing.useHashrouting** configuration to `false` and run the following command:
```bash
npm run startWebpack
```
- To run Luigi with path-based routing, change the **routing.useHashrouting** configuration to `false` and run the following command:
```bash
npm run startWebpack
```

5. Open it in your browser by going to [http://localhost:4200/](http://localhost:4200/)`.
5. Open it in your browser by going to [http://localhost:4200/](http://localhost:4200/).

6. Optional: Reflect changes in the Luigi Core code on the exemplary application.

- You must let the Luigi core to bundle every change you apply to it. The easiest approach is to open the Luigi root folder in another tab of your terminal window and run the following command:
```bash
lerna run bundle-develop
```
```bash
lerna run bundle-develop
```
- The Luigi Client is not bundled, so you are able to update it without bundling.

- The auto-reload of your application only updates the application. Type `CMD + R` to reflect the changes of the linked Luigi Core and Luigi Client modules in the website.
Expand All @@ -60,8 +60,8 @@ To have this application running, follow these steps:

To run UI tests locally, the sample application has to be running. When the application is ready:

- Run `npm run cypress:run` to start tests in the headless browser.
- Run `npm run cypress:open` to start tests in the interactive mode.
- Run `npm run e2e:run` to start tests in the headless browser.
- Run `npm run e2e:open` to start tests in the interactive mode.
<!-- ## Run server
* Using Angular CLI (standard): `npm run start`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,25 @@ export class OverviewComponent {
link: '/projects/pr1/dps',
text: 'defaultChildNode',
description:
'navigation Node configuration to set a specific Node as an initial target'
'navigation node configuration to set a specific node as an initial target'
},
{
link: '/projects/pr1/users/groups',
text: 'dynamic Nodes',
text: 'dynamic nodes',
description:
'navigation Node configuration to set a specific node as dynamic'
'navigation node configuration to set a specific node as dynamic'
},
{
link: '/projects/pr1',
text: 'external URL node',
description:
'navigation Node configuration to direct to an external website'
'navigation node configuration to direct to an external website'
},
{
link: '/projects/pr1/avengers',
text: 'keepSelectedForChildren',
description:
'navigation Node configuration to focus on a navigation menu and omit the children'
'navigation node configuration to focus on a navigation menu and omit the children'
}
];
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<section class="fd-section">
<div class="fd-section__header">
<h1 class="fd-section__title">Child Node 1</h1>
<h1 class="fd-section__title">Child node 1</h1>
</div>
<div class="fd-panel">
This is Child 1 component
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<section class="fd-section">
<div class="fd-section__header">
<h1 class="fd-section__title">Child Node 2</h1>
<h1 class="fd-section__title">Child node 2</h1>
</div>
<div class="fd-panel">
<p>Navigation node config for this <strong>defaultChildNode</strong> demo:</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class DynamicComponent implements OnInit, OnDestroy {
.subscribe((ctx: IContextMessage) => {
if (!ctx.context) {
console.warn(
'To use this component properly, Node configuration requires context.label to be defined. context.links can be defined as array of strings to generate links to children'
'To use this component properly, node configuration requires context.label to be defined. context.links can be defined as array of strings to generate links to children'
);
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ <h1 class="fd-section__title">{{groupLabel}}</h1>
</section>
<section class="fd-section">
<div class="fd-panel">
<p>Navigation Node configuration for <strong>dynamic node</strong> demo:</p>
<p>Navigation node configuration for <strong>dynamic node</strong> demo:</p>
<app-code-snippet data="{
{
pathSegment: ':group',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class GroupDetailsComponent implements OnInit, OnDestroy {
// We can directly access our custom specified context value here
this.groupLabel = toTitleCase(ctx.context.currentGroup);

// Default way, if context is not specified in Node configuration
// Default way, if context is not specified in node configuration
this.pathParams = this.luigiClient.getPathParams();
this.groupLabel =
this.pathParams &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ var projectDetailNavProviderFn = function(context) {
},
{
pathSegment: 'dps',
label: 'Default Child Node Example',
label: 'Default Child node Example',
defaultChildNode: 'dps2',
children: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ <h1 class="fd-action-bar__title">
<section class="fd-section">
<div class="fd-panel">
<p><strong>Luigi Client Features:</strong></p>

<p><a href="javascript:demoLoadingIndicator()">Show loading indicator</a> - and hide it after 3 seconds.<br />
<pre>LuigiClient.uxManager().showLoadingIndicator();
LuigiClient.uxManager().hideLoadingIndicator();</pre>
</p>

</section>

<div class="section-spacer"></div>
Expand All @@ -64,7 +64,7 @@ <h1 class="fd-action-bar__title">
<div class="section-spacer"></div>
<script type="text/javascript" src="/luigi-client/luigi-client.js"></script>
<script type="text/javascript">
// If Node has loadingIndicator.hideAutomatically set to false, we need to manually
// If node has loadingIndicator.hideAutomatically set to false, we need to manually
// trigger LuigiClient.uxManager().hideLoadingIndicator();

console.info('Delaying loading indicator for demo purposes');
Expand All @@ -82,4 +82,4 @@ <h1 class="fd-action-bar__title">
</script>

</body>
</html>
</html>
10 changes: 5 additions & 5 deletions core/src/services/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export const findMatchingNode = (urlPathElement, nodes) => {
if (nodes.length > 1) {
if (dynamicSegmentsLength === 1) {
console.warn(
'Invalid Node setup detected. \nStatic and dynamic nodes cannot be used together on the same level. Static node gets cleaned up. \nRemove the static Node from the configuration to resolve this warning. \nAffected pathSegment:',
'Invalid node setup detected. \nStatic and dynamic nodes cannot be used together on the same level. Static node gets cleaned up. \nRemove the static node from the configuration to resolve this warning. \nAffected pathSegment:',
urlPathElement,
'Children:',
nodes
Expand All @@ -153,20 +153,20 @@ export const findMatchingNode = (urlPathElement, nodes) => {
}
if (dynamicSegmentsLength > 1) {
console.error(
'Invalid Node setup detected. \nMultiple dynamic Nodes are not allowed on the same level. Stopped navigation. \nInvalid Children:',
'Invalid node setup detected. \nMultiple dynamic nodes are not allowed on the same level. Stopped navigation. \nInvalid Children:',
nodes
);
return null;
}
}
nodes.some(node => {
// Static Nodes
// Static nodes
if (node.pathSegment === urlPathElement) {
result = node;
return true;
}

// Dynamic Nodes
// Dynamic nodes
if (node.pathSegment && node.pathSegment.startsWith(':')) {
const key = node.pathSegment.slice(0);
node.pathParam = {
Expand Down Expand Up @@ -243,7 +243,7 @@ export const getGroupedChildren = (children, current) => {
* getTruncatedChildren
*
* Returns an array of children without the childs below
* a Node that has keepSelectedForChildren enabled
* a node that has keepSelectedForChildren enabled
* @param array children
* @returns array children
*/
Expand Down
5 changes: 2 additions & 3 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ This directory contains the following documents that relate to the project:
* [Application setup](application-setup.md) shows you the first steps to prepare your application for development.
* [Navigation configuration](navigation-configuration.md) shows you how to configure navigation in Luigi.
* [Authorization configuration](authorization-configuration.md) guides you through the configuration to secure Luigi.
* [Routing mechanism configuration](router-configuration.md) is demontrated on this page.
* [General settings](general-settings.md) provides you with additional configuration parameters for Luigi.

**Luigi Client**

* [Lifecycle](luigi-client-api.md#lifecycle) gives you details on the life cycle of listeners, navigation nodes and event data.
* [Link Manager](luigi-client-api.md#linkmanager) guides you through configuration of the Link Manager.
* [Lifecycle](luigi-client-api.md#lifecycle) gives you details on the life cycle of listeners, navigation nodes, and Event data.
* [Link Manager](luigi-client-api.md#linkmanager) guides you through the configuration of the Link Manager.
* [UX Manager](luigi-client-api.md#uxmanager) shows you how to set up the UX Manager.
2 changes: 1 addition & 1 deletion docs/application-setup.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Application setup

Prior to the implementation of Luigi, you need to set up your application. This document shows you how to set up a web application using the Luigi micro front-end framework.
Prior to start developing with Luigi, you need to set up your application. This document shows you how to set up a web application using the Luigi micro front-end framework.

Choose the framework to build your application:

Expand Down
8 changes: 4 additions & 4 deletions docs/luigi-client-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## lifecycle

There are various parameters and functions available to Luigi pertaining to the lifecycle of listeners, navigation Nodes, and Event data.
There are various parameters and functions available to Luigi pertaining to the lifecycle of listeners, navigation nodes, and Event data.

### addInitListener

Expand All @@ -30,7 +30,7 @@ Returns **{idToken: [string](https://developer.mozilla.org/docs/Web/JavaScript/R

### getNodeParams

Returns the configuration object of the active navigation Node.
Returns the configuration object of the active navigation node.

Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** node parameters.

Expand Down Expand Up @@ -68,7 +68,7 @@ LuigiClient.linkManager().navigate('/settings', null, true) // preserve view

### fromContext

Sets the current navigation context to that of a specific parent Node that has the [navigationContext](navigation-configuration.md) field declared in its navigation configuration. This navigation context is then used by navigate function.
Sets the current navigation context to that of a specific parent node that has the [navigationContext](navigation-configuration.md) field declared in its navigation configuration. This navigation context is then used by navigate function.

#### Parameters

Expand Down Expand Up @@ -144,7 +144,7 @@ Adds a backdrop with a loading indicator for the micro front-end frame. This ove

### hideLoadingIndicator

Removes the loading indicator. Use it after calling [showLoadingIndicator()](#showLoadingIndicator) or to hide the indicator when you use the [loadingIndicator.hideAutomatically: false](navigation-configuration.md#nodes) Node configuration.
Removes the loading indicator. Use it after calling [showLoadingIndicator()](#showLoadingIndicator) or to hide the indicator when you use the [loadingIndicator.hideAutomatically: false](navigation-configuration.md#nodes) node configuration.

### addBackdrop

Expand Down
Loading

0 comments on commit 3c3c2c5

Please sign in to comment.