Skip to content

Commit

Permalink
Clean up example links in docs (#857)
Browse files Browse the repository at this point in the history
* Cleaned up example links in docs

* replaced example links with [YOUR.WEBSITE] placeholder
  • Loading branch information
alexandra-simeonova authored Oct 4, 2019
1 parent 2b2a832 commit 2396272
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 40 deletions.
6 changes: 3 additions & 3 deletions docs/authorization-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The following code snippet demonstrates how to configure authorization using Ope
auth: {
use: 'openIdConnect',
openIdConnect: {
authority: 'https://example-authority.com',
authority: 'https://example.com',
client_id: 'client',
scope: 'audience:server:client_id:client openid profile email groups',
redirect_uri: '',
Expand Down Expand Up @@ -51,8 +51,8 @@ The following code snippet demonstrates how to configure authorization using OAu
auth: {
use: 'oAuth2ImplicitGrant',
oAuth2ImplicitGrant: {
authorizeUrl: 'https://example-url.com/authorize',
logoutUrl: 'https://example-url.com/logout',
authorizeUrl: 'https://example.com/authorize',
logoutUrl: 'https://example.com/logout',
oAuthData: {
client_id: 'egDuozijY5SVr0NSIowUP1dT6RVqHnlp'
scope: '',
Expand Down
46 changes: 23 additions & 23 deletions docs/navigation-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,20 @@ navigation: {
{
pathSegment: 'TopNav1',
label: 'Top Navigation Element One',
viewUrl: 'https://microfronted.com',
viewUrl: 'https://example.com',
children: [
{
pathSegment: 'SideNav1',
label: 'Side Navigation Element One',
viewUrl: 'https://microfrontend.com/projects/list.html',
viewUrl: 'https://example.com/projects/list.html',
children: [
{
link: '/TopNav1/internalLink',
label: 'This takes you to yourwebsite.com/TopNav1/internalLink',
label: 'This takes you to [YOUR.WEBSITE]/TopNav1/internalLink',
},
{
externalLink: {
url: 'http://www.google.com',
url: 'http://www.luigi-project.io',
sameWindow: false
},
label: 'This takes you to an external page',
Expand All @@ -68,7 +68,7 @@ navigation: {
{
pathSegment: 'TopNav2',
label: 'Top Navigation Element Two',
viewUrl: 'https://2ndmicrofronted.com',
viewUrl: 'https://example.org',
children: [
...
```
Expand All @@ -80,7 +80,7 @@ navigation: {
The [first steps](#first-steps) example provides some basic navigation parameters:
### pathSegment
This is used to build the path in the browser URL. The main application path is built from values in the navigation path, joined with the **/** character. For example, if the value of a node's **pathSegment** is `home`, the path for that node would be `yourwebsite.com/home`. You can override this setting by using one of the following instead of **pathSegment**:
This is used to build the path in the browser URL. The main application path is built from values in the navigation path, joined with the **/** character. For example, if the value of a node's **pathSegment** is `home`, the path for that node would be `[YOUR.WEBSITE]/home`. You can override this setting by using one of the following instead of **pathSegment**:
* **link** - define a specific internal path. Note that a valid path must always start from the **root node**. For example, if your root node is `home`, and you want to navigate to the `projects` directory:
- `link: '/home/projects'` is correct
- `link: '/projects'`is not correct, since `/projects` is not the root node
Expand Down Expand Up @@ -108,10 +108,10 @@ This is an example of what a node with a category including a label and icon loo
{
category: { label: 'Links', icon: 'myIcon', collapsible: true },
externalLink: {
url: 'http://www.google.com',
url: 'http://www.luigi-project.io',
sameWindow: false
},
label: 'Click here to visit Google.com',
label: 'Click here to visit the Luigi homepage',
},
...
```
Expand All @@ -132,7 +132,7 @@ To define all subsequent nodes, use the category label:
### viewGroup
Imagine your application hosts two micro frontend views: `http://mysite.com/a#e` and `http://mysite.com/b#f`. Due to hash routing and a different path up to `#`, they are, by default, rendered in different iframes. However, as they both have the **same origin**, such as`mysite.com`, and belong to the **same micro frontend** you want to render them in the same iframe. To achieve that, use the view groups feature. Define the **viewGroup** parameter for any navigation node. The children nodes will automatically be considered as part of the same view group.
Imagine your application hosts two micro frontend views: `http://example.com/a#e` and `http://example.com/b#f`. Due to hash routing and a different path up to `#`, they are, by default, rendered in different iframes. However, as they both have the **same origin**, such as`example.com`, and belong to the **same micro frontend** you want to render them in the same iframe. To achieve that, use the view groups feature. Define the **viewGroup** parameter for any navigation node. The children nodes will automatically be considered as part of the same view group.

Nodes belonging to the same view group are always rendered in their own view group iframe. Nodes not belonging to any view group follow the same-origin iframe rendering policy.

Expand All @@ -156,18 +156,18 @@ navigation: {
{
pathSegment: 'home',
label: 'Home',
viewUrl: 'https://microfrontend.com/',
viewUrl: 'https://example.com/',
children: [
{
pathSegment: 'users',
label: 'User List',
viewUrl: 'https://microfrontend.com/users/list.html',
viewUrl: 'https://example.com/users/list.html',
children: [
{
pathSegment: ':userId',
label: 'User Profile',
// E.g. if userId is 'JohnSmith'
// the main application URL will be https://yourwebsite.com/users/JohnSmith
// the main application URL will be https://[YOUR.WEBSITE]/users/JohnSmith
}
]
}
Expand All @@ -182,7 +182,7 @@ navigation: {
### viewUrl parameters

You have the following options to add a parameter to **viewUrl**:
- Place the parameter anywhere in the **viewUrl** value. For example, if the main application URL is `https://yourwebsite.com/home/users/JohnSmith`, then the **viewUrl** of the micro frontend in the content area can be `https://microfrontend.com/users/details.html#id=JohnSmith`.
- Place the parameter anywhere in the **viewUrl** value. For example, if the main application URL is `https://[YOUR.WEBSITE]/home/users/JohnSmith`, then the **viewUrl** of the micro frontend in the content area can be `https://example.com/users/details.html#id=JohnSmith`.
- Use the [Luigi Client API](luigi-client-api.md) to access the node parameter values from the micro frontend. Use the `LuigiClient.getPathParams()` function.
For example, to get the value of the `userId` parameter, use `LuigiClient.getPathParams().userId`.
- Add a parameter to the context part of your configuration:
Expand All @@ -191,7 +191,7 @@ For example, to get the value of the `userId` parameter, use `LuigiClient.getPat
{
pathSegment: ':userId',
label: 'User Profile',
viewUrl: 'https://microfrontend.com/users/details.html#id=:userId;',
viewUrl: 'https://example.com/users/details.html#id=:userId;',
context: {
user: ':userId'
}
Expand All @@ -209,7 +209,7 @@ You can specify them in the main application URL, similarly to URL query paramet
All parameters without the prefix are not passed to the micro frontend and are consumed by the main application.
A sample **viewUrl** `https://yourwebsite.com/home/users/allUsers?~sorting=asc&~page=2` supports sorting and paging by introducing the **sort** and **page** node parameters.
A sample **viewUrl** `https://[YOUR.WEBSITE]/home/users/allUsers?~sorting=asc&~page=2` supports sorting and paging by introducing the **sort** and **page** node parameters.

Using node parameters in the previous example results in:

Expand All @@ -219,17 +219,17 @@ navigation: {
{
pathSegment: 'home',
label: 'Home',
viewUrl: 'https://microfrontend.com/',
viewUrl: 'https://example.com/',
children: [
{
pathSegment: 'users',
label: 'User List',
viewUrl: 'https://microfrontend.com/users/list.html#pagenr={nodeParams.page};sort={nodeParams.sorting}',
viewUrl: 'https://example.com/users/list.html#pagenr={nodeParams.page};sort={nodeParams.sorting}',
children: [
{
pathSegment: ':userId',
label: 'User Profile',
viewUrl: 'https://microfrontend.com/projects/details.html#id=:userId;'
viewUrl: 'https://example.com/projects/details.html#id=:userId;'
}
]
}
Expand All @@ -243,14 +243,14 @@ navigation: {

Use the following options to work with node parameters:

Build the **viewUrl** by placing parameters anywhere in the **viewUrl** value using the following syntax: `nodeParams.{node param name}`. For example, if the main application URL is `https://yourwebsite.com/home/projects/?~sorting=asc&~page=2` then the **viewUrl** of a micro frontend is `https://microfrontend.com/projects/list.html#pagenr=2;sort=asc`.
Build the **viewUrl** by placing parameters anywhere in the **viewUrl** value using the following syntax: `nodeParams.{node param name}`. For example, if the main application URL is `https://[YOUR.WEBSITE]/home/projects/?~sorting=asc&~page=2` then the **viewUrl** of a micro frontend is `https://example.com/projects/list.html#pagenr=2;sort=asc`.


### Dynamic viewUrl

You can use both node parameters and path parameters to build a dynamic **viewUrl**.

For example, if the web application URL is `https://luigi.corp/something/sample_1/products?~sort=asc`, the micro frontend loads using a different URL, such as `https://admin.my.test/project/sample_1/products?sort=asc`.
For example, if the web application URL is `https://[YOUR.WEBSITE]/something/sample_1/products?~sort=asc`, the micro frontend loads using a different URL, such as `https://example.com/project/sample_1/products?sort=asc`.

When loading, the **viewUrl** uses the following dynamic URL parameters:

Expand All @@ -267,11 +267,11 @@ Luigi.setConfig({
{
pathSegment: 'something',
label: 'Something',
viewUrl: 'https://admin.my.test/project',
viewUrl: 'https://example.com/project',
children: [{
navigationContext: 'project',
pathSegment: ':projectId',
viewUrl: 'https://admin.my.test/project/:projectId',
viewUrl: 'https://example.com/project/:projectId',
// Optionally, you can always call LuigiClient.getPathParams() to get the parameters
// context: {
// currentProject: ':projectId'
Expand All @@ -280,7 +280,7 @@ Luigi.setConfig({
{
pathSegment: 'products',
label: 'Products',
viewUrl: 'https://admin.my.test/project/:projectId/products'
viewUrl: 'https://example.com/project/:projectId/products'
}
]
}]
Expand Down
28 changes: 14 additions & 14 deletions docs/navigation-parameters-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@ Luigi.setConfig({
nodeAccessibilityResolver: function (nodeToCheckPermissionFor, parentNode, currentContext) {},
viewGroupSettings: {
main: {
preloadUrl: 'https://my-site.com/index.html#/preload',
preloadUrl: 'https://example.com/index.html#/preload',
},
projects: {
preloadUrl: 'https://my-site.com/projects.html#/preloading',
preloadUrl: 'https://example.com/projects.html#/preloading',
},
envs: {
preloadUrl: 'https://my-site.com/environments-details.html#/preload-view',
preloadUrl: 'https://example.com/environments-details.html#/preload-view',
}
},
nodes: [
// STATIC navigation node
{
pathSegment: 'settings',
label: 'Settings',
viewUrl: 'https://admin.mydomain.com/settings',
viewUrl: 'https://example.com/settings',
viewGroup: 'settingsGroup',
// optional
children: [node, node, node],
Expand Down Expand Up @@ -63,45 +63,45 @@ Luigi.setConfig({
viewGroup: 'main',
pathSegment: 'overview',
label: 'Overview',
viewUrl: 'https://my-site.com/index.html#/overview'
viewUrl: 'https://example.com/index.html#/overview'
},
{
viewGroup: 'main',
pathSegment: 'preload',
viewUrl: 'https://my-site.com/index.html#/preload'
viewUrl: 'https://example.com/index.html#/preload'
},
{
viewGroup: 'projects',
pathSegment: 'projects',
label: 'Projects',
viewUrl: 'https://my-site.com/projects.html#/list',
viewUrl: 'https://example.com/projects.html#/list',
children: [
{
pathSegment: 'preloading',
viewUrl: 'https://my-site.com/projects.html#/preloading'
viewUrl: 'https://example.com/projects.html#/preloading'
}
]
},
{
viewGroup: 'envs',
pathSegment: 'create-environment',
viewUrl: 'https://my-site.com/environments.html#/create',
viewUrl: 'https://example.com/environments.html#/create',
context: {
label: 'Create Environment'
}
},
{
viewGroup: 'envs',
pathSegment: 'environments',
viewUrl: 'https://my-site.com/environments-details.html#/list',
viewUrl: 'https://example.com/environments-details.html#/list',
children: [
{
pathSegment: 'preload',
viewUrl: 'https://my-site.com/environments-details.html#/preload-view'
viewUrl: 'https://example.com/environments-details.html#/preload-view'
},
{
pathSegment: 'env1',
viewUrl: 'https://my-site.com/environments-details.html#/details/env1'
viewUrl: 'https://example.com/environments-details.html#/details/env1'
}
]
}
Expand All @@ -128,7 +128,7 @@ Luigi.setConfig({
testId: 'myTestId',
label: 'Luigi in Github',
externalLink: {
url: 'https://github.com/SAP/luigi',
url: 'https://luigi-project.io/',
sameWindow: false
}
},
Expand All @@ -149,7 +149,7 @@ Luigi.setConfig({
label: 'Luigi in Github',
testId: 'myTestId',
externalLink: {
url: 'https://github.com/SAP/luigi',
url: 'https://luigi-project.io/',
sameWindow: false
}
},
Expand Down

0 comments on commit 2396272

Please sign in to comment.