Skip to content

Commit

Permalink
API documentation - capitalize terms and merge latest changes (SAP#2601)
Browse files Browse the repository at this point in the history
Co-authored-by: Johannes Doberer <johannes.doberer@sap.com>
  • Loading branch information
alexandra-simeonova and JohannesDoberer authored Mar 3, 2022
1 parent 165518a commit 63196f9
Showing 10 changed files with 23 additions and 27 deletions.
2 changes: 1 addition & 1 deletion client/luigi-client.d.ts
Original file line number Diff line number Diff line change
@@ -140,7 +140,7 @@ export declare interface UxManager {
* @param {Object} settings.links provides links data
* @param {Object} settings.links.LINK_KEY object containing the data for a particular link. To properly render the link in the alert message refer to the description of the **settings.text** parameter
* @param {string} settings.links.LINK_KEY.text text which replaces the link identifier in the alert content
* @param {string} settings.links.LINK_KEY.url url to navigate when you click the link. Currently, only internal links are supported in the form of relative or absolute paths
* @param {string} settings.links.LINK_KEY.url URL to navigate when you click the link. Currently, only internal links are supported in the form of relative or absolute paths
* @param {string} settings.links.LINK_KEY.dismissKey dismissKey which represents the key of the link.
* @param {number} settings.closeAfter (optional) time in milliseconds that tells Luigi when to close the Alert automatically. If not provided, the Alert will stay on until closed manually. It has to be greater than `100`
* @returns {promise} which is resolved when the alert is dismissed
2 changes: 1 addition & 1 deletion client/src/lifecycleManager.js
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ class LifecycleManager extends LuigiClientBase {
}

/**
* Starts the handshake with Luigi Core and thereafter resulting in initialization of Luigi Client. It is always ran by default when importing luigi-client package in your micro frontend. Note that when using 'defer-luigi-init' to defer default initialization you will need to initialize the handshake using this function manually wherever needed.
* Starts the handshake with Luigi Core and thereafter results in initialization of Luigi Client. It is always ran by default when importing the Luigi Client package in your micro frontend. Note that when using `defer-luigi-init` to defer default initialization, you will need to initialize the handshake using this function manually wherever needed.
* @since 1.12.0
* @memberof Lifecycle
* @example
2 changes: 1 addition & 1 deletion client/src/storageManager.js
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ const pendingOperation = new Map();

/**
* StorageManager allows you to use browser local storage of key/values. Every storage operation is sent to be managed by Luigi Core.
* The idea is that different micro frontends can share or persist items using local storage.
* The idea is that different micro frontends can share or persist items using local storage, as long as they come from the same domain and follow the [same-origin policy](https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy).
* Since all storage operations are asynchronous (sending an event to Luigi Core that will reply once operation is finished), all the methods return Promises.
* @name storageManager
*/
2 changes: 1 addition & 1 deletion client/src/uxManager.js
Original file line number Diff line number Diff line change
@@ -134,7 +134,7 @@ class UxManager extends LuigiClientBase {
* @param {Object} settings.links provides links data
* @param {Object} settings.links.LINK_KEY object containing the data for a particular link. To properly render the link in the alert message refer to the description of the **settings.text** parameter
* @param {string} settings.links.LINK_KEY.text text which replaces the link identifier in the alert content
* @param {string} settings.links.LINK_KEY.url url to navigate when you click the link. Currently, only internal links are supported in the form of relative or absolute paths
* @param {string} settings.links.LINK_KEY.url URL to navigate when you click the link. Currently, only internal links are supported in the form of relative or absolute paths
* @param {string} settings.links.LINK_KEY.dismissKey dismissKey which represents the key of the link.
* @param {number} settings.closeAfter (optional) time in milliseconds that tells Luigi when to close the Alert automatically. If not provided, the Alert will stay on until closed manually. It has to be greater than `100`
* @returns {promise} which is resolved when the alert is dismissed
8 changes: 4 additions & 4 deletions core/README.md
Original file line number Diff line number Diff line change
@@ -39,9 +39,9 @@ You can see the Luigi Core in action by running the [Angular example application

### Build and watch with a simple development environment

Use the following steps, if you want to have a simpler development environment with less output and not the full-blown e2e application. This becomes handy if you want to debug a certain scenario where you already have a luigi configuration snippet.
Use the following steps, if you want to have a simpler development environment with less output and not the full-blown e2e application. This becomes handy if you want to debug a certain scenario where you already have a Luigi configuration snippet.

1. Install dependencies.
1. Install dependencies.
```bash
npm install
```
@@ -50,10 +50,10 @@ Use the following steps, if you want to have a simpler development environment w
npm run simpledev
```

This will create (or use, if already existing) a simple luigi app under /dev-tools/simple-app where you can make changes according to your needs.
This will create (or use, if already existing) a simple Luigi app under `/dev-tools/simple-app` where you can make changes according to your needs.

<!-- 3. Serve public directory
Distribution files generated by `lerna run bundle` and `lerna run bundle` are stored in `core/public` folder.
Distribution files generated by `lerna run bundle` and `lerna run bundle` are stored in `core/public` folder.
Point your local webserver to this directory or use a eg. node based webserver:
```bash
npm install --global local-web-server
2 changes: 1 addition & 1 deletion core/src/core-api/ux.js
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ class LuigiUX {
* @param {Object} settings.links provides links data
* @param {Object} settings.links.LINK_KEY object containing the data for a particular link. To properly render the link in the alert message refer to the description of the **settings.text** parameter
* @param {string} settings.links.LINK_KEY.text text which replaces the link identifier in the alert content
* @param {string} settings.links.LINK_KEY.url url to navigate when you click the link. Currently, only internal links are supported in the form of relative or absolute paths
* @param {string} settings.links.LINK_KEY.url URL to navigate when you click the link. Currently, only internal links are supported in the form of relative or absolute paths
* @param {string} settings.links.LINK_KEY.dismissKey dismissKey which represents the key of the link.
* @param {number} settings.closeAfter (optional) time in milliseconds that tells Luigi when to close the Alert automatically. If not provided, the Alert will stay on until closed manually. It has to be greater than `100`
* @returns {promise} which is resolved when the alert is dismissed
2 changes: 1 addition & 1 deletion docs/advanced-scenarios.md
Original file line number Diff line number Diff line change
@@ -153,7 +153,7 @@ Google's `id_token` contains basic identity data like name and user ID, which al
```
### Use Feature Toggles in Luigi
There are two possibilities to add feature toggles to the active feature toggles list. On the one hand you can use the core api and on the other hand it is possible to add a feature toggle through url parameters.
There are two possibilities to add feature toggles to the active feature toggles list. On the one hand, you can use the Core API and on the other hand, it is possible to add a feature toggle through URL parameters.
#### Overview
Luigi allows you to implement and configure feature toggles. They can be used to organize and compartmentalize your code.
20 changes: 9 additions & 11 deletions docs/luigi-client-api.md
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/

#### luigiClientInit

Starts the handshake with Luigi Core and thereafter resulting in initialization of Luigi Client. It is always ran by default when importing luigi-client package in your micro frontend. Note that when using 'defer-luigi-init' to defer default initialization you will need to initialize the handshake using this function manually wherever needed.
Starts the handshake with Luigi Core and thereafter results in initialization of Luigi Client. It is always ran by default when importing the Luigi Client package in your micro frontend. Note that when using `defer-luigi-init` to defer default initialization, you will need to initialize the handshake using this function manually wherever needed.

##### Examples

@@ -243,7 +243,7 @@ Sets node parameters in Luigi Core. The parameters will be added to the URL.

##### Parameters

- `params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**
- `params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**
- `keepBrowserHistory` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** (optional, default `true`)

##### Examples
@@ -305,7 +305,7 @@ Sends search query parameters to Luigi Core. If they are allowed on node level,

##### Parameters

- `searchParams` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**
- `searchParams` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**
- `keepBrowserHistory` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** (optional, default `true`)

##### Examples
@@ -507,7 +507,6 @@ Navigates to the given path in the application hosted by Luigi. It contains eith
- `drawerSettings.backdrop` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** By default, it is set to `false`. If it is set to `true` the rest of the screen has a backdrop.
- `drawerSettings.size` **(`"l"` \| `"m"` \| `"s"` \| `"xs"`)** size of the drawer (optional, default `"s"`)


##### Examples

```javascript
@@ -606,7 +605,7 @@ Sets the current navigation context to that of a specific parent node which has

##### Parameters

- `navigationContext` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
- `navigationContext` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**

##### Examples

@@ -666,7 +665,7 @@ Sends node parameters to the route. The parameters are used by the `navigate` fu

##### Parameters

- `nodeParams` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**
- `nodeParams` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**

##### Examples

@@ -724,8 +723,8 @@ LuigiClient.linkManager().goBack(true);

### splitView

Split view
Allows to open a micro frontend in a split screen in the lower part of the content area. Open it by calling `const splitViewHandle = LuigiClient.linkManager().openAsSplitView`.
Split view
Allows to open a micro frontend in a split screen in the lower part of the content area. Open it by calling `const splitViewHandle = LuigiClient.linkManager().openAsSplitView`.
At a given time, you can open only one split view. It closes automatically when you navigate to a different route.
When you call `handle.collapse()`, the split view gets destroyed. It recreates when you use `handle.expand()`.
`openAsSplitView` returns an instance of the split view handle. The functions, actions, and event handlers listed below allow you to control and manage the split view.
@@ -927,9 +926,8 @@ Removes the backdrop.

#### setDirtyStatus

This method informs the main application that there are unsaved changes in the current view of the iframe. It can be used to prevent navigation away from the current view, for example with form fields which were edited but not submitted. However, this functionality is not restricted to forms.
This method informs the main application that there are unsaved changes in the current view in the iframe. It can be used to prevent navigation away from the current view, for example with form fields which were edited but not submitted. However, this functionality is not restricted to forms. If you use `withoutSync()` together with `setDirtyStatus()`, this is a special case in which the dirty state logic needs to be handled by the micro frontend. For example, if the user navigates with an Angular router, which would trigger `withoutSync()`, Angular needs to take care about dirty state, prevent the navigation and ask for permission to navigate away, through `uxManager().showConfirmationModal(settings)`.

If you use `withoutSync()` together with `setDirtyStatus()`, this is a special case in which the dirty state logic needs to be handled by the micro frontend. For example, if the user navigates with an Angular router, which would trigger `withoutSync()`, Angular needs to take care about dirty state, prevent the navigation and ask for permission to navigate away, through `uxManager().showConfirmationModal(settings)`.
##### Parameters

- `isDirty` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** indicates if there are any unsaved changes on the current page or in the component
@@ -980,7 +978,7 @@ Shows an alert.
- `settings.links` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** provides links data
- `settings.links.LINK_KEY` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** object containing the data for a particular link. To properly render the link in the alert message refer to the description of the **settings.text** parameter
- `settings.links.LINK_KEY.text` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** text which replaces the link identifier in the alert content
- `settings.links.LINK_KEY.url` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** url to navigate when you click the link. Currently, only internal links are supported in the form of relative or absolute paths
- `settings.links.LINK_KEY.url` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** URL to navigate when you click the link. Currently, only internal links are supported in the form of relative or absolute paths
- `settings.links.LINK_KEY.dismissKey` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** dismissKey which represents the key of the link.
- `settings.closeAfter` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** (optional) time in milliseconds that tells Luigi when to close the Alert automatically. If not provided, the Alert will stay on until closed manually. It has to be greater than `100`

6 changes: 2 additions & 4 deletions docs/luigi-core-api.md
Original file line number Diff line number Diff line change
@@ -540,8 +540,6 @@ Navigates to the given path in the application. It contains either a full absolu
- `drawerSettings.backdrop` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** By default, it is set to `false`. If it is set to `true` the rest of the screen has a backdrop.
- `drawerSettings.size` **(`"l"` \| `"m"` \| `"s"` \| `"xs"`)** size of the drawer (optional, default `"s"`)

Returns **[promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)** a promise which resolves to a Boolean variable specifying whether the navigation was executed or not.

##### Examples

```javascript
@@ -699,7 +697,7 @@ let pathExists;
);
```

Returns **[promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)** a promise which resolves to a Boolean variable specifying whether the path exists or not.
Returns **[promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)** a promise which resolves to a Boolean variable specifying whether the path exists or not

#### hasBack

@@ -884,7 +882,7 @@ Shows an alert.
- `settings.links` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** provides links data
- `settings.links.LINK_KEY` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** object containing the data for a particular link. To properly render the link in the alert message refer to the description of the **settings.text** parameter
- `settings.links.LINK_KEY.text` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** text which replaces the link identifier in the alert content
- `settings.links.LINK_KEY.url` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** url to navigate when you click the link. Currently, only internal links are supported in the form of relative or absolute paths
- `settings.links.LINK_KEY.url` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** URL to navigate when you click the link. Currently, only internal links are supported in the form of relative or absolute paths
- `settings.links.LINK_KEY.dismissKey` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** dismissKey which represents the key of the link.
- `settings.closeAfter` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** (optional) time in milliseconds that tells Luigi when to close the Alert automatically. If not provided, the Alert will stay on until closed manually. It has to be greater than `100`

4 changes: 2 additions & 2 deletions docs/navigation-parameters-reference.md
Original file line number Diff line number Diff line change
@@ -220,8 +220,8 @@ Node parameters are all the parameters that can be added to an individual naviga
### children
- **type**: array | function
- **description**: in this element, you can specify children nodes. All children nodes will have the same parent prefix url.
For example, if you look at our [Fiddle showcase](https://fiddle.luigi-project.io/), you will see that home node has different children: this hierarchy will be reflected in children urls.
- **description**: in this element, you can specify children nodes. All children nodes will have the same parent prefix URL.
For example, if you look at our [Fiddle showcase](https://fiddle.luigi-project.io/), you will see that home node has different children: this hierarchy will be reflected in children URLs.
```javascript
navigation: {
nodes: [{

0 comments on commit 63196f9

Please sign in to comment.