mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-3745] Updates for doc review (#4291)
* [ADF-3745] Updates for doc review * [ADF-3745] Fixed bad links to Content node selector page * [ADF-3745] Updated index files
This commit is contained in:
committed by
Eugenio Romano
parent
581a0c5177
commit
1079361c2c
@@ -207,7 +207,7 @@ for more information about installing and using the source code.
|
||||
| Name | Description | Source link |
|
||||
| ---- | ----------- | ----------- |
|
||||
| [Data Table Adapter interface](core/datatable-adapter.interface.md) | Defines how table data is supplied to DataTable and Tasklist components. | [Source](../lib/core/datatable/data/datatable-adapter.ts) |
|
||||
| [Form Field Validator interface](core/form-field-validator.interface.md) | Defines how the input fields of Form and Task Details components are validated. | [Source](../lib/core/form/components/widgets/core/form-field-validator.ts) |
|
||||
| [Form Field Validator interface](core/form-field-validator.interface.md) | Defines how the input fields of [`Form`](../../lib/process-services/task-list/models/form.model.ts) and Task Details components are validated. | [Source](../lib/core/form/components/widgets/core/form-field-validator.ts) |
|
||||
| [Search Configuration interface](core/search-configuration.interface.md) | Provides fine control of parameters to a search. | [Source](../lib/core/services/search-configuration.service.ts) |
|
||||
|
||||
[(Back to Contents)](#contents)
|
||||
@@ -285,6 +285,8 @@ for more information about installing and using the source code.
|
||||
|
||||
| Name | Description | Source link |
|
||||
| ---- | ----------- | ----------- |
|
||||
| [Image resolver model](content-services/image-resolver.model.md) | Defines the Image Resolver function used by the Document List Component. | [Source](../lib/content-services/document-list/data/image-resolver.model.ts) |
|
||||
| [Row filter model](content-services/row-filter.model.md) | Defines the Row Filter function used by the Document List Component. | [Source](../lib/content-services/document-list/data/row-filter.model.ts) |
|
||||
| [Permissions style model](content-services/permissions-style.model.md) | Sets custom CSS styles for rows of a Document List according to the item's permissions. | [Source](../lib/content-services/document-list/models/permissions-style.model.ts) |
|
||||
|
||||
## Pipes
|
||||
@@ -315,7 +317,7 @@ for more information about installing and using the source code.
|
||||
|
||||
| Name | Description | Source link |
|
||||
| ---- | ----------- | ----------- |
|
||||
| [Search Widget interface](content-services/search-widget.interface.md) | Specifies required properties for Search filter component widgets. | [Source](../lib/content-services/search/search-widget.interface.ts) |
|
||||
| [Search Widget interface](content-services/search-widget.interface.md) | Specifies required properties for [Search filter component](../content-services/search-filter.component.md) widgets. | [Source](../lib/content-services/search/search-widget.interface.ts) |
|
||||
|
||||
[(Back to Contents)](#contents)
|
||||
|
||||
|
@@ -76,6 +76,8 @@ for more information about installing and using the source code.
|
||||
|
||||
| Name | Description | Source link |
|
||||
| ---- | ----------- | ----------- |
|
||||
| [Image resolver model](image-resolver.model.md) | Defines the Image Resolver function used by the Document List Component. | [Source](../../lib/content-services/document-list/data/image-resolver.model.ts) |
|
||||
| [Row filter model](row-filter.model.md) | Defines the Row Filter function used by the Document List Component. | [Source](../../lib/content-services/document-list/data/row-filter.model.ts) |
|
||||
| [Permissions style model](permissions-style.model.md) | Sets custom CSS styles for rows of a Document List according to the item's permissions. | [Source](../../lib/content-services/document-list/models/permissions-style.model.ts) |
|
||||
|
||||
## Pipes
|
||||
|
@@ -7,7 +7,7 @@ Last reviewed: 2019-01-16
|
||||
|
||||
# [Content Node Selector Panel component](../../lib/content-services/content-node-selector/content-node-selector-panel.component.ts "Defined in content-node-selector-panel.component.ts")
|
||||
|
||||
Opens a Content [`Node`](https://github.com/Alfresco/alfresco-js-api/blob/development/src/api/content-rest-api/docs/Node.md) Selector in its own dialog window.
|
||||
Opens a [Content Node Selector](content-node-selecctor.component.md) in its own dialog window.
|
||||
|
||||

|
||||
|
||||
@@ -33,13 +33,13 @@ Opens a Content [`Node`](https://github.com/Alfresco/alfresco-js-api/blob/develo
|
||||
| breadcrumbTransform | `Function` | | Transformation to be performed on the chosen/folder node before building the breadcrumb UI. Can be useful when custom formatting is needed for the breadcrumb. You can change the path elements from the node that are used to build the breadcrumb using this function. |
|
||||
| currentFolderId | `string` | null | [Node](https://github.com/Alfresco/alfresco-js-api/blob/development/src/api/content-rest-api/docs/Node.md) ID of the folder currently listed. |
|
||||
| dropdownHideMyFiles | `boolean` | false | Hide the "My Files" option added to the site list by default. See the [Sites Dropdown component](sites-dropdown.component.md) for more information. |
|
||||
| dropdownSiteList | [`SitePaging`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/SitePaging.md) | null | Custom site for site dropdown same as siteList. See the [Sites Dropdown component](sites-dropdown.component.md) for more information. |
|
||||
| imageResolver | `ImageResolver` | null | Custom image resolver function. See the [Document List component](document-list.component.md#custom-row-filter) for more information. |
|
||||
| dropdownSiteList | [`SitePaging`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/SitePaging.md) | null | Custom site for site dropdown. This is the same as the `siteList`. property of the Sites Dropdown component (see its doc page for more information). |
|
||||
| imageResolver | `ImageResolver` | null | Custom image resolver function. See the [Image Resolver Model](image-resolver.model.md) page for more information. |
|
||||
| isSelectionValid | `ValidationFunction` | defaultValidation | Function used to decide if the selected node has permission to be selected. Default value is a function that always returns true. |
|
||||
| pageSize | `number` | | Number of items shown per page in the list. |
|
||||
| where | `string` | | Custom _where_ filter function. See the [Document List component](document-list.component.md) for more information. |
|
||||
| where | `string` | | Custom _where_ filter function. See the [Document List component](../content-services/document-list.component.md) for more information. |
|
||||
| excludeSiteContent | `string[]` | | Custom list of site content componentIds. Used to filter out the corresponding items from the displayed nodes |
|
||||
| rowFilter | `RowFilter` | | Custom row filter function. See the [Document List component](document-list.component.md#custom-row-filter) for more information. |
|
||||
| rowFilter | `RowFilter` | | Custom row filter function. See the [Row Filter Model](row-filter.model.md) page for more information. |
|
||||
|
||||
### Events
|
||||
|
||||
|
@@ -22,7 +22,7 @@ more information).
|
||||
|
||||
### Showing the dialog
|
||||
|
||||
Unlike most components, the Content [`Node`](https://github.com/Alfresco/alfresco-js-api/blob/development/src/api/content-rest-api/docs/Node.md) Selector is typically shown in a dialog box
|
||||
Unlike most components, the [Content Node Selector Component](content-node-selector.component.md) is typically shown in a dialog box
|
||||
rather than the main page and you are responsible for opening the dialog yourself. You can use the
|
||||
[Angular Material Dialog](https://material.angular.io/components/dialog/overview) for this,
|
||||
as shown in the usage example. ADF provides the [`ContentNodeSelectorComponentData`](../../lib/content-services/content-node-selector/content-node-selector.component-data.interface.ts) interface
|
||||
@@ -55,9 +55,9 @@ The properties are described in the table below:
|
||||
| currentFolderId | `string` | `null` | [`Node`](https://github.com/Alfresco/alfresco-js-api/blob/development/src/api/content-rest-api/docs/Node.md) ID of the folder currently listed. |
|
||||
| dropdownHideMyFiles | `boolean` | `false` | Hide the "My Files" option added to the site list by default. See the [Sites Dropdown component](sites-dropdown.component.md) for more information. |
|
||||
| dropdownSiteList | [`SitePaging`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/SitePaging.md) | `null` | Custom site for site dropdown same as siteList. See the [Sites Dropdown component](sites-dropdown.component.md) for more information. |
|
||||
| rowFilter | [`RowFilter`](../../lib/content-services/document-list/data/row-filter.model.ts) | `null` | Custom row filter function. See the [Document List component](document-list.component.md#custom-row-filter) for more information. |
|
||||
| rowFilter | [`RowFilter`](../../lib/content-services/document-list/data/row-filter.model.ts) | `null` | Custom row filter function. See the [Row Filter Model](row-filter.model.md) page for more information. |
|
||||
| where | `string` | `null` | Custom *where* filter function. See the [Document List component](document-list.component.md) for more information. |
|
||||
| imageResolver | [`ImageResolver`](../../lib/content-services/document-list/data/image-resolver.model.ts) | `null` | Custom image resolver function. See the [Document List component](document-list.component.md#custom-row-filter) for more information. |
|
||||
| imageResolver | [`ImageResolver`](../../lib/content-services/document-list/data/image-resolver.model.ts) | `null` | Custom image resolver function. See the [Image Resolver Model](image-resolver.model.md) page for more information. |
|
||||
| pageSize | `number` | | Number of items shown per page in the list. |
|
||||
| isSelectionValid | [`ValidationFunction`](../../lib/content-services/content-node-selector/content-node-selector-panel.component.ts) | `defaultValidation` | Function used to decide if the selected node has permission to be selected. Default value is a function that always returns true. |
|
||||
| breadcrumbTransform | `(node: any) => any` | | Transformation to be performed on the chosen/folder node before building the breadcrumb UI. Can be useful when custom formatting is needed for the breadcrumb. You can change the path elements from the node that are used to build the breadcrumb using this function. |
|
||||
@@ -112,13 +112,14 @@ When the dialog action is selected by clicking, the `data.select` stream will be
|
||||
|
||||
### RowFilter and ImageResolver
|
||||
|
||||
The Content [`Node`](https://github.com/Alfresco/alfresco-js-api/blob/development/src/api/content-rest-api/docs/Node.md) Selector uses a [Document List](document-list.component.md) to display the
|
||||
The [Content Node Selector](content-node-selector.component.md) uses a
|
||||
[Document List](document-list.component.md) to display the
|
||||
items that the user can choose. As with the standard Document List, you can supply a custom
|
||||
**row filter** function (to hide items that can't be chosen) and a custom **image resolver**
|
||||
function (to select an image to show in a particular list cell). For example, you could use
|
||||
a row filter to hide document nodes in a folder selector. See the
|
||||
[Advanced Usage and Customization](document-list.component.md#advanced-usage-and-customization)
|
||||
section of the Document List page to learn how these functions are implemented.
|
||||
[Row Filter Model](row-filter.model.md) and [Image Resolver Model](image-resolver.model.md)
|
||||
pages for more information.
|
||||
|
||||
### Using the breadcrumbTransform function
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
Title: Document List component
|
||||
Added: v2.0.0
|
||||
Status: Active
|
||||
Last reviewed: 2019-01-16
|
||||
Last reviewed: 2019-02-08
|
||||
---
|
||||
|
||||
# [Document List component](../../lib/content-services/document-list/components/document-list.component.ts "Defined in document-list.component.ts")
|
||||
@@ -33,8 +33,7 @@ Displays the documents from a repository.
|
||||
- [Actions](#actions)
|
||||
- [Navigation mode](#navigation-mode)
|
||||
- [Advanced usage and customization](#advanced-usage-and-customization)
|
||||
- [Custom row filter](#custom-row-filter)
|
||||
- [Custom image resolver](#custom-image-resolver)
|
||||
- [Image Resolver and Row Filter functions](#image-resolver-and-row-filter-functions)
|
||||
- [Custom 'empty folder' template](#custom-empty-folder-template)
|
||||
- [Custom 'permission denied' template](#custom-permission-denied-template)
|
||||
- [Custom 'loading' template](#custom-loading-template)
|
||||
@@ -57,19 +56,17 @@ Displays the documents from a repository.
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| ---- | ---- | ------------- | ----------- |
|
||||
| \_rowFilter | `RowFilter \| null` | null | Custom row filter |
|
||||
| allowDropFiles | `boolean` | false | Toggle file drop support for rows (see [Upload Directive](../core/upload.directive.md) for further details) |
|
||||
| contentActions | `boolean` | false | Toggles content actions for each row |
|
||||
| contentActionsPosition | `string` | "right" | Position of the content actions dropdown menu. Can be set to "left" or "right". |
|
||||
| contextMenuActions | `boolean` | false | Toggles context menus for each row |
|
||||
| currentFolderId | `string` | null | The ID of the folder node to display or a reserved string alias for special sources |
|
||||
| display | `string` | DisplayMode.List | Change the display mode of the table. Can be "list" or "gallery". |
|
||||
| emptyFolderImageUrl | `string` | | Custom image for empty folder. Default value: './assets/images/empty_doc_lib.svg' |
|
||||
| imageResolver | `any \| null` | null | Custom image resolver |
|
||||
| imageResolver | `any \| null` | null | Custom function to choose image file paths to show. See the [Image Resolver Model](image-resolver.model.md) page for more information. |
|
||||
| includeFields | `string[]` | | Include additional information about the node in the server request. For example: association, isLink, isLocked and others. |
|
||||
| loading | `boolean` | false | Toggles the loading state and animated spinners for the component. Used in combination with `navigate=false` to perform custom navigation and loading state indication. |
|
||||
| locationFormat | `string` | "/" | The default route for all the location-based columns (if declared). |
|
||||
| maxItems | `number` | | Default value is stored into user preference settings use it only if you are not using the pagination |
|
||||
| maxItems | `number` | | Default value is stored in the user preference settings. Use this only if you are not using pagination. |
|
||||
| multiselect | `boolean` | false | Toggles multiselect mode |
|
||||
| navigate | `boolean` | true | Toggles navigation to folder content or file preview |
|
||||
| navigationMode | `string` | | User interaction for folder navigation or file preview. Valid values are "click" and "dblclick". Default value: "dblclick" |
|
||||
@@ -83,7 +80,8 @@ Displays the documents from a repository.
|
||||
| sortingMode | `string` | "client" | Defines sorting mode. Can be either `client` (items in the list are sorted client-side) or `server` (the ordering supplied by the server is used without further client-side sorting). Note that the `server` option _does not_ request the server to sort the data before delivering it. |
|
||||
| thumbnails | `boolean` | false | Show document thumbnails rather than icons |
|
||||
| where | `string` | | Filters the [`Node`](https://github.com/Alfresco/alfresco-js-api/blob/development/src/api/content-rest-api/docs/Node.md) list using the _where_ condition of the REST API (for example, isFolder=true). See the REST API documentation for more information. |
|
||||
| rowFilter | `RowFilter` | | Custom row filter |
|
||||
| currentFolderId | `string` | | The ID of the folder node to display or a reserved string alias for special sources |
|
||||
| rowFilter | `RowFilter` | | Custom function to choose whether to show or hide rows. See the [Row Filter Model](row-filter.model.md) page for more information. |
|
||||
|
||||
### Events
|
||||
|
||||
@@ -581,11 +579,11 @@ You can use the following components as column templates:
|
||||
|
||||
| Name | Description |
|
||||
| ---- | ----------- |
|
||||
| adf-name-column | Renders hyperlink-styled name of the node. Provides formatted tooltip. Emits `name-click` DOM event that can be handled by any parent component. |
|
||||
| adf-library-name-column | Renders library name. Provides formatted tooltips and extra details for libraries with same names on the page. Emits `name-click` DOM event that can be handled by any parent component. |
|
||||
| adf-library-role-column | Renders i18n-enabled information about Library (Site) role (`Manager`, `Collaborator`, `Contributor`, `Consumer`) |
|
||||
| adf-library-status-column | Renders i18n-enabled information about Library (Site) status (`Public`, `Private`, `Moderated`, `Unknown`) |
|
||||
| adf-trashcan-name-column | Renders a name of the deleted node. Distinguishes between a Library (Site) and File/Folder nodes. Provides proper tooltips. |
|
||||
| `adf-name-column` | Renders the hyperlink-styled name of the node. Provides a formatted tooltip. Emits the `name-click` DOM event, which can be handled by any parent component. |
|
||||
| `adf-library-name-column` | Renders the library name. Provides formatted tooltips and extra details for libraries with the same names on the page. Emits the `name-click` DOM event, which can be handled by any parent component. |
|
||||
| `adf-library-role-column` | Renders i18n-enabled information about the Library (Site) role (`Manager`, `Collaborator`, `Contributor`, `Consumer`) |
|
||||
| `adf-library-status-column` | Renders i18n-enabled information about the Library (Site) status (`Public`, `Private`, `Moderated`, `Unknown`) |
|
||||
| `adf-trashcan-name-column` | Renders the name of the deleted node. Distinguishes between a Library (Site) and File/Folder nodes. Provides proper tooltips. |
|
||||
|
||||
All the components above require only the `context` property to be bound, since
|
||||
each component fetches and renders the information it needs from the underlying node.
|
||||
@@ -705,120 +703,17 @@ The following example switches navigation to single clicks:
|
||||
|
||||
## Advanced usage and customization
|
||||
|
||||
### Custom row filter
|
||||
### Image Resolver and Row Filter functions
|
||||
|
||||
You can create a custom row filter function that returns `true` if the row should be
|
||||
displayed or `false` if it should be hidden.
|
||||
A typical row filter implementation receives a [`ShareDataRow`](../../lib/content-services/document-list/data/share-data-row.model.ts) object as a parameter:
|
||||
The Document List has two properties that let you modify behavior with custom
|
||||
functions:
|
||||
|
||||
```ts
|
||||
myFilter(row: ShareDataRow): boolean {
|
||||
return true;
|
||||
}
|
||||
```
|
||||
- `imageResolver` - Specifies a function to choose image file paths for icons and thumbnails.
|
||||
- `rowFilter` - Selects whether a row is shown or hidden according to its data content.
|
||||
|
||||
_Note that for the sake of simplicity the example code below was reduced to the main points of interest only._
|
||||
|
||||
**View1.component.html**
|
||||
|
||||
```html
|
||||
<adf-document-list
|
||||
[rowFilter]="folderFilter">
|
||||
</adf-document-list>
|
||||
```
|
||||
|
||||
**View1.component.ts**
|
||||
|
||||
```ts
|
||||
import { RowFilter, ShareDataRow } from '@alfresco/adf-content-services';
|
||||
|
||||
export class View1 {
|
||||
|
||||
folderFilter: RowFilter;
|
||||
|
||||
constructor() {
|
||||
|
||||
// This filter will make the document list show only folders
|
||||
|
||||
this.folderFilter = (row: ShareDataRow) => {
|
||||
let node = row.node.entry;
|
||||
|
||||
if (node && node.isFolder) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Custom image resolver
|
||||
|
||||
You can create a custom image resolver function to manage the way folder/file icons and thumbnails
|
||||
are resolved (ie, which image is shown for which item).
|
||||
|
||||
**Note:** Image resolvers are executed only for columns of the `image` type.
|
||||
|
||||
A typical image resolver implementation receives [`DataRow`](../../lib/core/datatable/data/data-row.model.ts) and [`DataColumn`](../../lib/core/datatable/data/data-column.model.ts) objects as parameters:
|
||||
|
||||
```ts
|
||||
myImageResolver(row: DataRow, col: DataColumn): string {
|
||||
return '/path/to/image';
|
||||
}
|
||||
```
|
||||
|
||||
Your function can return `null` or `false` values to fall back to the default image
|
||||
resolving behavior.
|
||||
|
||||
_Note that for the sake of simplicity the example code below was reduced to the main points of interest only._
|
||||
|
||||
**View1.component.html**
|
||||
|
||||
```html
|
||||
<adf-document-list
|
||||
[imageResolver]="folderImageResolver">
|
||||
|
||||
<data-columns>
|
||||
<data-column key="name" type="image"></data-column>
|
||||
</data-columns>
|
||||
|
||||
</adf-document-list>
|
||||
```
|
||||
|
||||
**View1.component.ts**
|
||||
|
||||
```ts
|
||||
import { DataColumn, DataRow } from '@alfresco/adf-core';
|
||||
import { ImageResolver } from '@alfresco/adf-content-services';
|
||||
|
||||
export class View1 {
|
||||
|
||||
folderImageResolver: ImageResolver;
|
||||
|
||||
constructor() {
|
||||
|
||||
// Customize folder icons, leave file icons untouched
|
||||
|
||||
this.folderImageResolver = (row: DataRow, col: DataColumn) => {
|
||||
let isFolder = <boolean> row.getValue('isFolder');
|
||||
if (isFolder) {
|
||||
|
||||
// (optional) You may want dynamically getting the column value
|
||||
let name = row.getValue(col.key);
|
||||
|
||||
// Format image url
|
||||
return `http://<my custom path to folder icon>/${name}`;
|
||||
}
|
||||
|
||||
// For the rest of the cases just fallback to default behaviour.
|
||||
return null;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
```
|
||||
See the [Image Resolver Model](image-resolver.model.md)
|
||||
and [Row Filter Model](row-filter.model.md) pages for details of how to
|
||||
implement these functions.
|
||||
|
||||
### Custom 'empty folder' template
|
||||
|
||||
|
92
docs/content-services/image-resolver.model.md
Normal file
92
docs/content-services/image-resolver.model.md
Normal file
@@ -0,0 +1,92 @@
|
||||
---
|
||||
Title: Image Resolver Model
|
||||
Added: v2.0.0
|
||||
Status: Active
|
||||
Last reviewed: 2019-02-08
|
||||
---
|
||||
|
||||
# [Image Resolver Model](../../lib/content-services/document-list/data/image-resolver.model.ts "Defined in image-resolver.model.ts")
|
||||
|
||||
Defines the Image Resolver function used by the [Document List Component](../content-services/document-list.component.md).
|
||||
|
||||
## Definitions
|
||||
|
||||
- `type` **ImageResolver** = (row: [`DataRow`](../../lib/core/datatable/data/data-row.model.ts), column: [`DataColumn`](../../lib/core/datatable/data/data-column.model.ts)) => `string`
|
||||
- _row:_ [`DataRow`](../../lib/core/datatable/data/data-row.model.ts) - Data that defines the row
|
||||
- _column:_ [`DataColumn`](../../lib/core/datatable/data/data-column.model.ts) - Data that defines the column
|
||||
- **Returns** File path for the image
|
||||
|
||||
## Details
|
||||
|
||||
An image resolver function selects an image file path for an item in
|
||||
a [Document List Component](../content-services/document-list.component.md)
|
||||
or another component that uses the Document List (such as the
|
||||
[Content Node Selector Panel Component](content-node-selector-panel.component.md)). You can supply your own image resolver
|
||||
to manage the way folder/file icons and thumbnails are resolved (ie, which image is shown for which item).
|
||||
|
||||
**Note:** Image resolvers are executed only for columns of the `image` type.
|
||||
|
||||
A typical image resolver implementation receives [`DataRow`](../../lib/core/datatable/data/data-row.model.ts) and [`DataColumn`](../../lib/core/datatable/data/data-column.model.ts) objects as parameters:
|
||||
|
||||
```ts
|
||||
myImageResolver(row: DataRow, col: DataColumn): string {
|
||||
return '/path/to/image';
|
||||
}
|
||||
```
|
||||
|
||||
Your function can return `null` or `false` values to fall back to the default image
|
||||
resolving behavior.
|
||||
|
||||
_Note that for the sake of simplicity the example code below was reduced to the main points of interest only._
|
||||
|
||||
**View1.component.html**
|
||||
|
||||
```html
|
||||
<adf-document-list
|
||||
[imageResolver]="folderImageResolver">
|
||||
|
||||
<data-columns>
|
||||
<data-column key="name" type="image"></data-column>
|
||||
</data-columns>
|
||||
|
||||
</adf-document-list>
|
||||
```
|
||||
|
||||
**View1.component.ts**
|
||||
|
||||
```ts
|
||||
import { DataColumn, DataRow } from '@alfresco/adf-core';
|
||||
import { ImageResolver } from '@alfresco/adf-content-services';
|
||||
|
||||
export class View1 {
|
||||
|
||||
folderImageResolver: ImageResolver;
|
||||
|
||||
constructor() {
|
||||
|
||||
// Customize folder icons, leave file icons untouched
|
||||
|
||||
this.folderImageResolver = (row: DataRow, col: DataColumn) => {
|
||||
let isFolder = <boolean> row.getValue('isFolder');
|
||||
if (isFolder) {
|
||||
|
||||
// (optional) You may want dynamically getting the column value
|
||||
let name = row.getValue(col.key);
|
||||
|
||||
// Format image url
|
||||
return `http://<my custom path to folder icon>/${name}`;
|
||||
}
|
||||
|
||||
// For the rest of the cases just fallback to default behaviour.
|
||||
return null;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
- [Document List Component](../content-services/document-list.component.md)
|
||||
- [Content Node Selector Panel Component](content-node-selector-panel.component.md)
|
76
docs/content-services/row-filter.model.md
Normal file
76
docs/content-services/row-filter.model.md
Normal file
@@ -0,0 +1,76 @@
|
||||
---
|
||||
Title: Row Filter Model
|
||||
Added: v2.0.0
|
||||
Status: Active
|
||||
Last reviewed: 2019-02-08
|
||||
---
|
||||
|
||||
# [Row Filter Model](../../lib/content-services/document-list/data/row-filter.model.ts "Defined in row-filter.model.ts")
|
||||
|
||||
Defines the Row Filter function used by the [Document List Component](../content-services/document-list.component.md).
|
||||
|
||||
## Definitions
|
||||
|
||||
- `type` **RowFilter** = (value: [`ShareDataRow`](../../lib/content-services/document-list/data/share-data-row.model.ts), index: `number`, array: [`ShareDataRow`](../../lib/content-services/document-list/data/share-data-row.model.ts)`[]`) => any
|
||||
- _value:_ [`ShareDataRow`](../../lib/content-services/document-list/data/share-data-row.model.ts) - Data that defines the row
|
||||
- _index:_ `number` - Index of the row within the list
|
||||
- _array:_ [`ShareDataRow`](../../lib/content-services/document-list/data/share-data-row.model.ts)`[]` - The full set of rows for the list
|
||||
- **Returns** True if the row should be shown, false otherwise
|
||||
|
||||
## Details
|
||||
|
||||
A row filter function selectively hides or shows rows from a [Document List Component](../content-services/document-list.component.md)
|
||||
or another component that uses the Document List (such as the
|
||||
[Content Node Selector Panel Component](content-node-selector-panel.component.md)).
|
||||
You can supply your own row filter to customize the behavior of the list.
|
||||
|
||||
The function returns `true` if the row should be
|
||||
displayed or `false` if it should be hidden.
|
||||
A typical row filter implementation receives at least a [`ShareDataRow`](../../lib/content-services/document-list/data/share-data-row.model.ts) object as a parameter:
|
||||
|
||||
```ts
|
||||
myFilter(row: ShareDataRow): boolean {
|
||||
return true;
|
||||
}
|
||||
```
|
||||
|
||||
_Note that for the sake of simplicity the example code below was reduced to the main points of interest only._
|
||||
|
||||
**View1.component.html**
|
||||
|
||||
```html
|
||||
<adf-document-list
|
||||
[rowFilter]="folderFilter">
|
||||
</adf-document-list>
|
||||
```
|
||||
|
||||
**View1.component.ts**
|
||||
|
||||
```ts
|
||||
import { RowFilter, ShareDataRow } from '@alfresco/adf-content-services';
|
||||
|
||||
export class View1 {
|
||||
|
||||
folderFilter: RowFilter;
|
||||
|
||||
constructor() {
|
||||
|
||||
// This filter will make the document list show only folders
|
||||
|
||||
this.folderFilter = (row: ShareDataRow) => {
|
||||
let node = row.node.entry;
|
||||
|
||||
if (node && node.isFolder) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
- [Document List Component](../content-services/document-list.component.md)
|
||||
- [Content Node Selector Panel Component](content-node-selector-panel.component.md)
|
@@ -37,10 +37,9 @@ Stores information from all the custom search and faceted search widgets, compil
|
||||
Gets the primary sorting definition.
|
||||
- **Returns** [`SearchSortingDefinition`](../../lib/content-services/search/search-sorting-definition.interface.ts) - The primary sorting definition
|
||||
- **getQueryGroup**(query: `any`): `any`<br/>
|
||||
|
||||
- _query:_ `any` -
|
||||
- **Returns** `any` -
|
||||
|
||||
Gets the query group.
|
||||
- _query:_ `any` - Target query
|
||||
- **Returns** `any` - Query group
|
||||
- **getSortingOptions**(): [`SearchSortingDefinition`](../../lib/content-services/search/search-sorting-definition.interface.ts)`[]`<br/>
|
||||
Gets all pre-configured sorting options that users can choose from.
|
||||
- **Returns** [`SearchSortingDefinition`](../../lib/content-services/search/search-sorting-definition.interface.ts)`[]` - Pre-configured sorting options
|
||||
|
@@ -2,7 +2,7 @@
|
||||
Title: Icon Component
|
||||
Added: v3.0.0
|
||||
Status: Active
|
||||
Last reviewed: 2019-01-10
|
||||
Last reviewed: 2019-02-08
|
||||
---
|
||||
|
||||
# [Icon Component](../../lib/core/icon/icon.component.ts "Defined in icon.component.ts")
|
||||
@@ -72,7 +72,7 @@ In the HTML, you can now use the icon as shown below:
|
||||
### Thumbnail Service
|
||||
|
||||
You can also reference the icons registered with the [Thumbnail Service](thumbnail.service.md)
|
||||
by utilising the `adf:` namespace.
|
||||
using the `adf:` namespace.
|
||||
|
||||
```html
|
||||
<adf-icon value="adf:image/gif"></adf-icon>
|
||||
|
@@ -2,7 +2,7 @@
|
||||
Title: Identity user service
|
||||
Added: v3.0.0
|
||||
Status: Active
|
||||
Last reviewed: 2019-01-23
|
||||
Last reviewed: 2019-02-08
|
||||
---
|
||||
|
||||
# [Identity user service](../../lib/core/userinfo/services/identity-user.service.ts "Defined in identity-user.service.ts")
|
||||
@@ -35,6 +35,11 @@ Gets OAuth2 personal details and roles for users.
|
||||
- _userId:_ `string` - ID of the target user
|
||||
- _clientId:_ `string` - ID of the client app
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<boolean>` - True if the user has access, false otherwise
|
||||
- **checkUserHasRole**(userId: `string`, roleNames: `string[]`): [`Observable`](http://reactivex.io/documentation/observable.html)`<boolean>`<br/>
|
||||
Checks if a user has one of the roles from a list.
|
||||
- _userId:_ `string` - ID of the target user
|
||||
- _roleNames:_ `string[]` - Array of roles to check for
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<boolean>` - True if the user has one of the roles, false otherwise
|
||||
- **findUsersByName**(search: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<any>`<br/>
|
||||
Find users based on search input.
|
||||
- _search:_ `string` - Search query string
|
||||
|
@@ -2,7 +2,7 @@
|
||||
Title: Infinite Pagination component
|
||||
Added: v2.0.0
|
||||
Status: Active
|
||||
Last reviewed: 2019-01-16
|
||||
Last reviewed: 2019-02-08
|
||||
---
|
||||
|
||||
# [Infinite Pagination component](../../lib/core/pagination/infinite-pagination.component.ts "Defined in infinite-pagination.component.ts")
|
||||
@@ -46,7 +46,7 @@ Adds "infinite" pagination to the component it is used with.
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| loadMore | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`PaginationModel`](../../lib/core/models/pagination.model.ts)`>` | Emitted when the "Load More" button is clicked. |
|
||||
| loadMore | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`RequestPaginationModel`](../../lib/core/models/request-pagination.model.ts)`>` | Emitted when the "Load More" button is clicked. |
|
||||
|
||||
## Details
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
Title: Login Dialog service
|
||||
Added: v2.6.0
|
||||
Status: Active
|
||||
Last reviewed: 2018-10-02
|
||||
Last reviewed: 2019-02-08
|
||||
---
|
||||
|
||||
# [Login Dialog service](../../lib/core/services/login-dialog.service.ts "Defined in login-dialog.service.ts")
|
||||
|
@@ -2,7 +2,7 @@
|
||||
Title: Translation service
|
||||
Added: v2.0.0
|
||||
Status: Active
|
||||
Last reviewed: 2018-06-07
|
||||
Last reviewed: 2019-02-08
|
||||
---
|
||||
|
||||
# [Translation service](../../lib/core/services/translation.service.ts "Defined in translation.service.ts")
|
||||
|
@@ -2,7 +2,7 @@
|
||||
Title: Task List component
|
||||
Added: v2.0.0
|
||||
Status: Active
|
||||
Last reviewed: 2018-04-16
|
||||
Last reviewed: 2019-02-08
|
||||
---
|
||||
|
||||
# [Task List component](../../lib/process-services/task-list/components/task-list.component.ts "Defined in task-list.component.ts")
|
||||
@@ -54,22 +54,23 @@ when the task list is empty:
|
||||
| Name | Type | Default value | Description |
|
||||
| ---- | ---- | ------------- | ----------- |
|
||||
| appId | `number` | | The id of the app. |
|
||||
| assignment | `string` | | The assignment of the process. Possible values are: "assignee" (the current user is the assignee), candidate (the current user is a task candidate", "group_x" (the task is assigned to a group where the current user is a member, no value(the current user is involved). |
|
||||
| data | `DataTableAdapter` | | (**Deprecated:** 2.4.0) Data source object that represents the number and the type of the columns that you want to show. |
|
||||
| dueAfter | `string` | | Filter the tasks. Display only tasks with created_date after dueAfter. |
|
||||
| dueBefore | `string` | | Filter the tasks. Display only tasks with created_date before dueBefore. |
|
||||
| assignment | `string` | | The assignment of the process. Possible values are: "assignee" (the current user is the assignee), "candidate" (the current user is a task candidate, "group_x" (the task is assigned to a group where the current user is a member, no value (the current user is involved). |
|
||||
| data | [`DataTableAdapter`](../../lib/core/datatable/data/datatable-adapter.ts) | | Data source object that represents the number and the type of the columns that you want to show. |
|
||||
| dueAfter | `string` | | Filter the tasks. Display only tasks with `created_date` after `dueAfter`. |
|
||||
| dueBefore | `string` | | Filter the tasks. Display only tasks with `created_date` before `dueBefore`. |
|
||||
| includeProcessInstance | `boolean` | | Toggles inclusion of Process Instances |
|
||||
| landingTaskId | `string` | | Define which task id should be selected after reloading. If the task id doesn't exist or nothing is passed then the first task will be selected. |
|
||||
| multiselect | `boolean` | false | Toggles multiple row selection, renders checkboxes at the beginning of each row |
|
||||
| name | `string` | | Name of the tasklist. |
|
||||
| page | `number` | 0 | The page number of the tasks to fetch. |
|
||||
| presetColumn | `string` | | Custom preset column schema in JSON format. |
|
||||
| processDefinitionId | `string` | | The Definition Id of the process. |
|
||||
| processInstanceId | `string` | | The Instance Id of the process. |
|
||||
| selectFirstRow | `boolean` | true | Toggles default selection of the first row |
|
||||
| selectionMode | `string` | "single" | Row selection mode. Can be none, `single` or `multiple`. For `multiple` mode, you can use Cmd (macOS) or Ctrl (Win) modifier key to toggle selection for multiple rows. |
|
||||
| size | `number` | | The number of tasks to fetch. Default value: 25. |
|
||||
| sort | `string` | | Define the sort order of the tasks. Possible values are : `created-desc`, `created-asc`, `due-desc`, `due-asc` |
|
||||
| start | `number` | 0 | Starting point of the |
|
||||
| start | `number` | | Starting point of the list within the full set of tasks. |
|
||||
| state | `string` | | Current state of the process. Possible values are: `completed`, `active`. |
|
||||
| taskId | `string` | | The id of a task |
|
||||
|
||||
@@ -171,7 +172,7 @@ You can use an HTML-based schema and an `app.config.json` custom schema declarat
|
||||
|
||||
### Setting Sorting Order for the list
|
||||
|
||||
you can pass sorting order as shown in the example below:
|
||||
You can pass a sorting order as shown in the example below:
|
||||
|
||||
```ts
|
||||
// Possible values are : `created-desc`, `created-asc`, `due-desc`, `due-asc`
|
||||
@@ -208,7 +209,7 @@ The Tasklist also supports pagination as shown in the example below:
|
||||
|
||||
### DataTableAdapter example
|
||||
|
||||
See the [`DataTableAdapter`](../../lib/core/datatable/data/datatable-adapter.ts) page for full details of the interface and its standard
|
||||
See the [Data Table Adapter interface](../core/datatable-adapter.interface.md) page for full details of the interface and its standard
|
||||
implementation, [`ObjectDataTableAdapter`](../../lib/core/datatable/data/object-datatable-adapter.ts). Below is an example of how you can set up the adapter for a
|
||||
typical tasklist.
|
||||
|
||||
@@ -223,10 +224,10 @@ typical tasklist.
|
||||
|
||||
### DataColumn Features
|
||||
|
||||
You can customize the styling of a column and also add features like tooltips and automatic translation of column titles. See the [`DataColumn`](../../lib/core/datatable/data/data-column.model.ts) page for more information about these features.
|
||||
You can customize the styling of a column and also add features like tooltips and automatic translation of column titles. See the [Data Column component](../../lib/core/datatable/data/data-column.model.ts) page for more information about these features.
|
||||
|
||||
## See also
|
||||
|
||||
- [Data column component](../core/data-column.component.md)
|
||||
- [`DataTableAdapter`](../../lib/core/datatable/data/datatable-adapter.ts)
|
||||
- [Data Table Adapter interface](../core/datatable-adapter.interface.md)
|
||||
- [Pagination component](../core/pagination.component.md)
|
||||
|
@@ -273,6 +273,7 @@ backend services have been tested with each released version of ADF.
|
||||
- [Highlight transform service](core/highlight-transform.service.md)
|
||||
- [Highlight directive](core/highlight.directive.md)
|
||||
- [Host settings component](core/host-settings.component.md)
|
||||
- [Image resolver model](content-services/image-resolver.model.md)
|
||||
- [Infinite pagination component](core/infinite-pagination.component.md)
|
||||
- [Info drawer layout component](core/info-drawer-layout.component.md)
|
||||
- [Info drawer component](core/info-drawer.component.md)
|
||||
@@ -314,6 +315,7 @@ backend services have been tested with each released version of ADF.
|
||||
- [Rating component](content-services/rating.component.md)
|
||||
- [Rating service](content-services/rating.service.md)
|
||||
- [Renditions service](core/renditions.service.md)
|
||||
- [Row filter model](content-services/row-filter.model.md)
|
||||
- [Search control component](content-services/search-control.component.md)
|
||||
- [Search component](content-services/search.component.md)
|
||||
- [Search service](core/search.service.md)
|
||||
|
@@ -64,9 +64,9 @@ export class ContentNodeSelectorPanelComponent implements OnInit {
|
||||
@Input()
|
||||
dropdownHideMyFiles: boolean = false;
|
||||
|
||||
/** Custom site for site dropdown same as siteList. See the
|
||||
* [Sites Dropdown component](sites-dropdown.component.md)
|
||||
* for more information.
|
||||
/** Custom site for site dropdown. This is the same as the `siteList`.
|
||||
* property of the Sites Dropdown component (see its doc page
|
||||
* for more information).
|
||||
*/
|
||||
@Input()
|
||||
dropdownSiteList: SitePaging = null;
|
||||
@@ -74,14 +74,15 @@ export class ContentNodeSelectorPanelComponent implements OnInit {
|
||||
_rowFilter: RowFilter = defaultValidation;
|
||||
|
||||
/** Custom *where* filter function. See the
|
||||
* [Document List component](document-list.component.md)
|
||||
* Document List component
|
||||
* for more information.
|
||||
*/
|
||||
@Input()
|
||||
where: string;
|
||||
|
||||
/** Custom row filter function. See the
|
||||
* [Document List component](document-list.component.md#custom-row-filter)
|
||||
/**
|
||||
* Custom row filter function. See the
|
||||
* [Row Filter Model](row-filter.model.md) page
|
||||
* for more information.
|
||||
*/
|
||||
@Input()
|
||||
@@ -108,8 +109,9 @@ export class ContentNodeSelectorPanelComponent implements OnInit {
|
||||
return this._excludeSiteContent;
|
||||
}
|
||||
|
||||
/** Custom image resolver function. See the
|
||||
* [Document List component](document-list.component.md#custom-row-filter)
|
||||
/**
|
||||
* Custom image resolver function. See the
|
||||
* [Image Resolver Model](image-resolver.model.md) page
|
||||
* for more information.
|
||||
*/
|
||||
@Input()
|
||||
|
@@ -197,10 +197,15 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
|
||||
@Input()
|
||||
loading: boolean = false;
|
||||
|
||||
/** Custom row filter */
|
||||
/** @hidden */
|
||||
@Input()
|
||||
_rowFilter: RowFilter | null = null;
|
||||
|
||||
/**
|
||||
* Custom function to choose whether to show or hide rows.
|
||||
* See the [Row Filter Model](row-filter.model.md) page for
|
||||
* more information.
|
||||
*/
|
||||
@Input()
|
||||
set rowFilter(rowFilter: RowFilter) {
|
||||
this._rowFilter = rowFilter;
|
||||
@@ -216,7 +221,11 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
|
||||
return this._rowFilter;
|
||||
}
|
||||
|
||||
/** Custom image resolver */
|
||||
/**
|
||||
* Custom function to choose image file paths to show. See the
|
||||
* [Image Resolver Model](image-resolver.model.md) page for
|
||||
* more information.
|
||||
*/
|
||||
@Input()
|
||||
imageResolver: any | null = null;
|
||||
|
||||
@@ -246,7 +255,7 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
|
||||
@Input()
|
||||
node: NodePaging = null;
|
||||
|
||||
/** Default value is stored into user preference settings use it only if you are not using the pagination */
|
||||
/** Default value is stored in the user preference settings. Use this only if you are not using pagination. */
|
||||
@Input()
|
||||
maxItems: number = this.DEFAULT_PAGINATION.maxItems;
|
||||
|
||||
|
@@ -255,6 +255,11 @@ export class SearchQueryBuilderService {
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the query group.
|
||||
* @param query Target query
|
||||
* @returns Query group
|
||||
*/
|
||||
getQueryGroup(query) {
|
||||
return query.group || this.config.facetQueries.label || 'Facet Queries';
|
||||
}
|
||||
|
@@ -35,6 +35,7 @@ export class IconComponent {
|
||||
private _value = '';
|
||||
private _isCustom = false;
|
||||
|
||||
/** Theme color palette for the component. */
|
||||
@Input()
|
||||
color: ThemePalette;
|
||||
|
||||
|
@@ -31,7 +31,7 @@ export class LoginDialogService {
|
||||
|
||||
/**
|
||||
* Opens a dialog to choose a file to upload.
|
||||
* @param action Name of the action to show in the title
|
||||
* @param actionName Name of the action to show in the title
|
||||
* @param title Title for the dialog
|
||||
* @returns Information about the chosen file(s)
|
||||
*/
|
||||
|
@@ -302,6 +302,12 @@ export class IdentityUserService {
|
||||
return hasAnyRole;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a user has one of the roles from a list.
|
||||
* @param userId ID of the target user
|
||||
* @param roleNames Array of roles to check for
|
||||
* @returns True if the user has one of the roles, false otherwise
|
||||
*/
|
||||
checkUserHasRole(userId: string, roleNames: string[]): Observable<boolean> {
|
||||
return this.getUserRoles(userId).pipe(map((userRoles: IdentityRoleModel[]) => {
|
||||
let hasRole = false;
|
||||
|
@@ -65,7 +65,7 @@ export class TaskListComponent extends DataTableSchema implements OnChanges, Aft
|
||||
state: string;
|
||||
|
||||
/** The assignment of the process. Possible values are: "assignee" (the current user
|
||||
* is the assignee), candidate (the current user is a task candidate", "group_x" (the task
|
||||
* is the assignee), "candidate" (the current user is a task candidate, "group_x" (the task
|
||||
* is assigned to a group where the current user is a member,
|
||||
* no value (the current user is involved).
|
||||
*/
|
||||
@@ -91,7 +91,6 @@ export class TaskListComponent extends DataTableSchema implements OnChanges, Aft
|
||||
/**
|
||||
* Data source object that represents the number and the type of the columns that
|
||||
* you want to show.
|
||||
* @deprecated 2.4.0
|
||||
*/
|
||||
@Input()
|
||||
data: DataTableAdapter;
|
||||
@@ -119,7 +118,7 @@ export class TaskListComponent extends DataTableSchema implements OnChanges, Aft
|
||||
@Input()
|
||||
includeProcessInstance: boolean;
|
||||
|
||||
/** Starting point of the */
|
||||
/** Starting point of the list within the full set of tasks. */
|
||||
@Input()
|
||||
start: number;
|
||||
|
||||
@@ -151,11 +150,11 @@ export class TaskListComponent extends DataTableSchema implements OnChanges, Aft
|
||||
@Input()
|
||||
size: number = PaginationComponent.DEFAULT_PAGINATION.maxItems;
|
||||
|
||||
/** Filter the tasks. Display only tasks with created_date after dueAfter. */
|
||||
/** Filter the tasks. Display only tasks with `created_date` after `dueAfter`. */
|
||||
@Input()
|
||||
dueAfter: string;
|
||||
|
||||
/** Filter the tasks. Display only tasks with created_date before dueBefore. */
|
||||
/** Filter the tasks. Display only tasks with `created_date` before `dueBefore`. */
|
||||
@Input()
|
||||
dueBefore: string;
|
||||
|
||||
|
@@ -25,7 +25,7 @@ function processDocs(mdCache, aggData, errorMessages) {
|
||||
children: [titleText]
|
||||
};
|
||||
}
|
||||
else if (titleHeading.children[0].type === "link") {
|
||||
else if ((titleHeading.children[0].type === "link") && sourcePath) {
|
||||
var linkElem = titleHeading.children[0];
|
||||
linkElem.url = "../../" + sourcePath;
|
||||
linkElem.title = "Defined in " + path.basename(sourcePath);
|
||||
|
@@ -33,7 +33,7 @@ export function processDocs(mdCache, aggData, errorMessages) {
|
||||
title: `Defined in ${path.basename(sourcePath)}`,
|
||||
children: [titleText]
|
||||
}
|
||||
} else if (titleHeading.children[0].type === "link") {
|
||||
} else if ((titleHeading.children[0].type === "link") && sourcePath) {
|
||||
let linkElem = titleHeading.children[0];
|
||||
linkElem.url = `../../${sourcePath}`;
|
||||
linkElem.title = `Defined in ${path.basename(sourcePath)}`;
|
||||
|
Reference in New Issue
Block a user