[ADF- 3846] Started Extensions library docs (#4095)

* [ADF-3846] Added some doc comments and skeleton doc files

* [ADF-3846] Added basic docs for Extensions library

* [ADF-3846] Fixes to index pages

* [ADF-3846] Did tslint check and fixed error with doc comment
This commit is contained in:
Andy Stark
2018-12-21 17:46:03 +00:00
committed by Eugenio Romano
parent b604b2a4b7
commit 478b299960
13 changed files with 541 additions and 52 deletions

View File

@@ -16,14 +16,13 @@ for more information about installing and using the source code.
| Name | Description | Source link |
| ---- | ----------- | ----------- |
| _Dynamic component_ | _Not currently documented_ | [Source](../../lib/extensions/src/lib/components/dynamic-component/dynamic.component.ts) |
| _Dynamic tab component_ | _Not currently documented_ | [Source](../../lib/extensions/src/lib/components/dynamic-tab/dynamic-tab.component.ts) |
| [Dynamic component](dynamic.component.md) ![Experimental](../docassets/images/ExperimentalIcon.png) | Displays dynamically-loaded extension components. | [Source](../../lib/extensions/src/lib/components/dynamic-component/dynamic.component.ts) |
| [Dynamic tab component](dynamic-tab.component.md) ![Experimental](../docassets/images/ExperimentalIcon.png) | Displays dynamically-loaded extensions with tabs. | [Source](../../lib/extensions/src/lib/components/dynamic-tab/dynamic-tab.component.ts) |
## Services
| Name | Description | Source link |
| ---- | ----------- | ----------- |
| _Extension loader service_ | _Not currently documented_ | [Source](../../lib/extensions/src/lib/services/extension-loader.service.ts) |
| _Extension service_ | _Not currently documented_ | [Source](../../lib/extensions/src/lib/services/extension.service.ts) |
| [Extension service](extension.service.md) ![Experimental](../docassets/images/ExperimentalIcon.png) | Manages and runs basic extension functionality. | [Source](../../lib/extensions/src/lib/services/extension.service.ts) |
<!--extensions end-->

View File

@@ -0,0 +1,18 @@
---
Title: Dynamic Tab Component
Added: v3.0.0
Status: Experimental
Last reviewed: 2018-12-17
---
# [Dynamic Tab Component](../../lib/core/about/about.component.ts "Defined in about.component.ts")
Displays dynamically-loaded extensions with tabs.
## Class members
## Details
## See also
- Dynamic component

View File

@@ -0,0 +1,58 @@
---
Title: Dynamic Component
Added: v3.0.0
Status: Experimental
Last reviewed: 2018-12-17
---
# [Dynamic Component](../../lib/extensions/src/lib/components/dynamic-component/dynamic.component.ts "Defined in dynamic.component.ts")
Displays dynamically-loaded extension components.
## Class members
### Properties
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| data | `any` | | Data for the dynamically-loaded component instance. |
| id | `string` | | Unique ID string for the component to show. |
## Details
Use the Dynamic component to create extensible apps
(ie, apps that provide a generalized UI structure where the specific content
can be "plugged in" by other developers). The `id` property refers to a
component that has previously been registered using the `setComponents` method
of the [Extension service](../../lib/extensions/src/lib/services/extension.service.ts):
```ts
// Registering the extension components.
extensionService.setComponents({
'plugInName.components.docList': DocumentListComponent.
'plugInName.components.login': LoginComponent,
...
});
```
```html
<!-- Using the component pre-registered with the key 'plugInName.components.login' -->
<adf-dynamic-component
id="'plugInName.components.login'"
data="{ ... }"
>
</adf-dynamic-component>
```
Use this to provide the extension developer with a standard layout that
contains placeholders defined by instances of the Dynamic component. The
developer can then register any desired components to correspond to the
defined component IDs. For example, the extensible app might be shipped
with the standard [Document List component](../content-services/document-list.component.md) registered against `plugInName.components.docList`.
The extension developer can replace this with a custom class
simply by registering that class with `setComponents` before use.
## See also
- [Extension service](../../lib/extensions/src/lib/services/extension.service.ts)
- [Dynamic tab component](../../lib/extensions/src/lib/components/dynamic-tab/dynamic-tab.component.ts)

View File

@@ -0,0 +1,69 @@
---
Title: Extension Service
Added: v3.0.0
Status: Experimental
Last reviewed: 2018-12-17
---
# [Extension Service](../../lib/extensions/src/lib/services/extension.service.ts "Defined in extension.service.ts")
Manages and runs basic extension functionality.
## Class members
### Methods
- **evaluateRule**(ruleId: `string`, context: [`RuleContext`](../../lib/extensions/src/lib/config/rule.extensions.ts)): `boolean`<br/>
Evaluates a rule.
- _ruleId:_ `string` - ID of the rule to evaluate
- _context:_ [`RuleContext`](../../lib/extensions/src/lib/config/rule.extensions.ts) - Parameter object for the evaluator with details of app state
- **Returns** `boolean` - True if the rule passed, false otherwise
- **getActionById**(id: `string`): [`ActionRef`](../../lib/extensions/src/lib/config/action.extensions.ts)<br/>
Retrieves an action using its ID value.
- _id:_ `string` - The ID value to look for
- **Returns** [`ActionRef`](../../lib/extensions/src/lib/config/action.extensions.ts) - Action or null if not found
- **getAuthGuards**(ids: `string[]`): `Array<Type<__type>>`<br/>
Retrieves one or more auth guards using an array of ID values.
- _ids:_ `string[]` - Array of ID value to look for
- **Returns** `Array<Type<__type>>` - Array of auth guards or empty array if none were found
- **getComponentById**(id: `string`): `Type<>`<br/>
Retrieves a registered [extension component](../../lib/extensions/src/lib/services/component-register.service.ts) using its ID value.
- _id:_ `string` - The ID value to look for
- **Returns** `Type<>` - The component or null if not found
- **getEvaluator**(key: `string`): `RuleEvaluator`<br/>
Retrieves a RuleEvaluator function using its key name.
- _key:_ `string` - Key name to look for
- **Returns** `RuleEvaluator` - RuleEvaluator or null if not found
- **getRouteById**(id: `string`): [`RouteRef`](../../lib/extensions/src/lib/config/routing.extensions.ts)<br/>
Retrieves a route using its ID value.
- _id:_ `string` - The ID value to look for
- **Returns** [`RouteRef`](../../lib/extensions/src/lib/config/routing.extensions.ts) - The route or null if not found
- **getRuleById**(id: `string`): [`RuleRef`](../../lib/extensions/src/lib/config/rule.extensions.ts)<br/>
Retrieves a rule using its ID value.
- _id:_ `string` - The ID value to look for
- **Returns** [`RuleRef`](../../lib/extensions/src/lib/config/rule.extensions.ts) - The rule or null if not found
- **load**(): [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises)`<`[`ExtensionConfig`](../../lib/extensions/src/lib/config/extension.config.ts)`>`<br/>
Loads and registers an extension config file and plugins (specified by path properties).
- **Returns** [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises)`<`[`ExtensionConfig`](../../lib/extensions/src/lib/config/extension.config.ts)`>` - The loaded config data
- **runExpression**(value: `string`, context?: `any`): `any`<br/>
Runs a lightweight expression stored in a string.
- _value:_ `string` - String containing the expression or literal value
- _context:_ `any` - (Optional) Parameter object for the expression with details of app state
- **Returns** `any` - Result of evaluated expression, if found, or the literal value otherwise
- **setAuthGuards**(values: `Function`)<br/>
Adds one or more new auth guards to the existing set.
- _values:_ `Function` - The new auth guards to add
- **setComponents**(values: `Function`)<br/>
Adds one or more new components to the existing set.
- _values:_ `Function` - The new components to add
- **setEvaluators**(values: `Function`)<br/>
Adds one or more new rule evaluators to the existing set.
- _values:_ `Function` - The new evaluators to add
- **setup**(config: [`ExtensionConfig`](../../lib/extensions/src/lib/config/extension.config.ts))<br/>
Registers extensions from a config object.
- _config:_ [`ExtensionConfig`](../../lib/extensions/src/lib/config/extension.config.ts) - Object with config data
## Details
Use the methods of this service to add extensibility features to your app. You can find further
details in the [App extensions](../user-guide/app-extensions.md) page.