Skip to content

Commit

Permalink
Fix & Re-Enable Docu Generation (#2230)
Browse files Browse the repository at this point in the history
  • Loading branch information
ndricimrr authored Aug 27, 2021
1 parent 8b0f20c commit d499c60
Show file tree
Hide file tree
Showing 7 changed files with 1,923 additions and 2,824 deletions.
3 changes: 2 additions & 1 deletion client/luigi-client.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,10 @@ export declare interface LinkManager {
* - linkManager().navigateToIntent('Sales-settings', {project: 'pr2', user: 'john'})
* - linkManager().navigate('/#?intent=Sales-settings?project=pr2&user=john')
* @param {string} semanticSlug concatenation of semantic object and action connected with a dash (-), i.e.: `<semanticObject>-<action>`
* @param {Object} params an object representing all the parameters passed, i.e.: `{param1: '1', param2: 2, param3: 'value3'}`. (optional, default `{}`)
* @param {Object} params an object representing all the parameters passed, i.e.: `{param1: '1', param2: 2, param3: 'value3'}`.
* @example
* LuigiClient.linkManager().navigateToIntent('Sales-settings', {project: 'pr2', user: 'john'})
* LuigiClient.linkManager().navigateToIntent('Sales-settings')
*/
navigateToIntent: (semanticSlug: string, params?: Object) => void;

Expand Down
3 changes: 2 additions & 1 deletion client/src/linkManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,10 @@ export class linkManager extends LuigiClientBase {
* - linkManager().navigateToIntent('Sales-settings', {project: 'pr2', user: 'john'})
* - linkManager().navigate('/#?intent=Sales-settings?project=pr2&user=john')
* @param {string} semanticSlug concatenation of semantic object and action connected with a dash (-), i.e.: `<semanticObject>-<action>`
* @param {Object} params an object representing all the parameters passed, i.e.: `{param1: '1', param2: 2, param3: 'value3'}`. (optional, default `{}`)
* @param {Object} params an object representing all the parameters passed, i.e.: `{param1: '1', param2: 2, param3: 'value3'}`.
* @example
* LuigiClient.linkManager().navigateToIntent('Sales-settings', {project: 'pr2', user: 'john'})
* LuigiClient.linkManager().navigateToIntent('Sales-settings')
*/
navigateToIntent(semanticSlug, params = {}) {
let newPath = '#?intent=';
Expand Down
20 changes: 11 additions & 9 deletions docs/luigi-client-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -373,17 +373,19 @@ The Link Manager allows you to navigate to another route. Use it instead of an i

#### navigateToIntent

Offers an alternative way of navigating with intents. This involves specifying a semanticSlug and an object containing parameters, if any.
This method internally generates a URL of the form `#?intent=<semantic object>-<action>?<param_name>=<param_value>` through the given input arguments. This then follows a call to the original `linkManager.navigate(...)` function.
Conequently the following calls shall have the exact same effect:
Offers an alternative way of navigating with intents. This involves specifying a semanticSlug and an object containing
parameters.
This method internally generates a URL of the form `#?intent=<semantic object>-<action>?<param_name>=<param_value>` through the given
input arguments. This then follows a call to the original `linkManager.navigate(...)` function.
Consequently, the following calls shall have the exact same effect:

- `linkManager().navigateToIntent('Sales-settings', {project: 'pr2', user: 'john'})`
- `linkManager().navigate('/#?intent=Sales-settings?project=pr2\&user=john')`
- linkManager().navigateToIntent('Sales-settings', {project: 'pr2', user: 'john'})
- linkManager().navigate('/#?intent=Sales-settings?project=pr2&user=john')

##### Parameters

- `semanticSlug` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** concatenation of semantic object and action connected with a dash (-), i.e.: `<semanticObject>-<action>`
- `params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** an object representing all the parameters passed, i.e.: `{project: 'pr2', user: 'john'}`. (optional, default `{}`)
- `params` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** an object representing all the parameters passed, i.e.: `{param1: '1', param2: 2, param3: 'value3'}`. (optional, default `{}`)

##### Examples

Expand Down Expand Up @@ -472,8 +474,7 @@ LuigiClient.linkManager().openAsModal('projects/pr1/users', {title:'Users', size

#### openAsSplitView

- **See: [splitView](#splitview) for further documentation about the returned instance
**
- **See: [splitView](#splitview) for further documentation about the returned instance**

Opens a view in a split view. You can specify the split view's title and size. If you don't specify the title, it is the node label. If there is no node label, the title remains empty. The default size of the split view is `40`, which means 40% height of the split view.

Expand Down Expand Up @@ -900,7 +901,7 @@ Shows an alert.
- `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.dismissKey` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** dismissKey represents the key of a particular link. There is no need to define url when dismissKey is provided.
- `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`

##### Examples
Expand All @@ -914,6 +915,7 @@ const settings = {
goToHome: { text: 'homepage', url: '/overview' },
goToOtherProject: { text: 'other project', url: '/projects/pr2' },
relativePath: { text: 'relative hide side nav', url: 'hideSideNav' }
neverShowItAgain: { text: 'Never show it again', dismissKey: 'neverShowItAgain' }
},
closeAfter: 3000
}
Expand Down
6 changes: 3 additions & 3 deletions docs/luigi-core-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -536,8 +536,7 @@ Luigi.navigation().openAsModal('projects/pr1/users', {title:'Users', size:'m'});

#### openAsSplitView

- **See: [SplitView Client](https://docs.luigi-project.io/docs/luigi-client-api?section=splitview) for further documentation. These methods from the Client SplitView are also implemented for Luigi Core: `close`, `collapse`, `expand`, `isCollapsed`, `isExpanded`, `exists`
**
- **See: [SplitView Client](https://docs.luigi-project.io/docs/luigi-client-api?section=splitview) for further documentation. These methods from the Client SplitView are also implemented for Luigi Core: `close`, `collapse`, `expand`, `isCollapsed`, `isExpanded`, `exists`**

Opens a view in a split view. You can specify the split view's title and size. If you don't specify the title, it is the node label. If there is no node label, the title remains empty. The default size of the split view is 40, which means 40% height of the split view.

Expand Down Expand Up @@ -853,7 +852,7 @@ Shows an alert.
- `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.dismissKey` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** dismissKey represents the key of a particular link. There is no need to define url when dismissKey is provided.
- `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`

##### Examples
Expand All @@ -866,6 +865,7 @@ const settings = {
goToHome: { text: 'homepage', url: '/overview' },
goToOtherProject: { text: 'other project', url: '/projects/pr2' },
relativePath: { text: 'relative hide side nav', url: 'hideSideNav' }
neverShowItAgain: { text: 'Never show it again', dismissKey: 'neverShowItAgain' }
},
closeAfter: 3000
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
},
"husky": {
"hooks": {
"pre-commit": "npm run code-quality && ./scripts/hooks/remove-test-prefixes.sh && ./scripts/hooks/prevent-illegal-characters.sh"
"pre-commit": "npm run code-quality && ./scripts/hooks/remove-test-prefixes.sh && ./scripts/hooks/generate-docu.sh && ./scripts/hooks/prevent-illegal-characters.sh"
}
},
"codeQuality": {
Expand Down
Loading

0 comments on commit d499c60

Please sign in to comment.