mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-17 14:21:29 +00:00
Merge remote-tracking branch 'origin/dev-valbano-ng15-start' into AAE-23572-recreate-js-api-lib-into-a-proper-nx-workspace-lib
This commit is contained in:
@@ -87,7 +87,6 @@ for more information about installing and using the source code.
|
||||
| [About GitHub Link Component](core/components/about-github-link.component.md)  | Shows which version of the application is running based on the latest GitHub commit, as well as the server settings for the application. | [Source](../lib/core/src/lib/about/about-github-link/about-github-link.component.ts) |
|
||||
| [About Product Version Component](core/components/about-product-version.component.md)  | Shows which version of Process Services (BPM) and Content Services (ECM) an application is running. It also shows the relevant license information, application status and Alfresco modules running in an application. | [Source](../lib/core/src/lib/about/about-product-version/about-product-version.component.ts) |
|
||||
| [About Component](core/components/about.component.md) | Presentational component to display About information as a set of collapsible panels. | [Source](../lib/core/src/lib/about/about.component.ts) |
|
||||
| [Buttons Menu Component](core/components/buttons-menu.component.md) | Displays buttons on a responsive menu. | [Source](../lib/core/src/lib/buttons-menu/buttons-menu.component.ts) |
|
||||
| [Card View component](core/components/card-view.component.md) | Displays a configurable property list renderer. | [Source](../lib/core/src/lib/card-view/components/card-view/card-view.component.ts) |
|
||||
| [Comment list component](core/components/comment-list.component.md) | Shows a list of comments. | [Source](../lib/core/src/lib/comments/comment-list/comment-list.component.ts) |
|
||||
| [Comments Component](core/components/comments.component.md) | Displays comments from users involved in a specified environment and allows an involved user to add a comment to a environment. | [Source](../lib/core/src/lib/comments/comments.component.ts) |
|
||||
@@ -277,7 +276,7 @@ for more information about installing and using the source code.
|
||||
| [Breadcrumb Component](content-services/components/breadcrumb.component.md) | Indicates the current position within a navigation hierarchy. | [Source](../lib/content-services/src/lib/breadcrumb/breadcrumb.component.ts) |
|
||||
| [Content Action component](content-services/components/content-action.component.md) | Adds options to a Document List actions menu for a particular content type. | [Source](../lib/content-services/src/lib/document-list/components/content-action/content-action.component.ts) |
|
||||
| [Content Metadata Card component](content-services/components/content-metadata-card.component.md) | Displays and edits metadata related to a node. | [Source](../lib/content-services/src/lib/content-metadata/components/content-metadata-card/content-metadata-card.component.ts) |
|
||||
| [Content Node Selector Panel component](content-services/components/content-node-selector-panel.component.md) | Opens a Content Node Selector in its own dialog window. | [Source](../lib/content-services/src/lib/content-node-selector/content-node-selector-panel.component.ts) |
|
||||
| [Content Node Selector Panel component](content-services/components/content-node-selector-panel.component.md) | Opens a Content Node Selector in its own dialog window. | [Source](../lib/content-services/src/lib/content-node-selector/content-node-selector-panel/content-node-selector-panel.component.ts) |
|
||||
| [Content Node Selector component](content-services/components/content-node-selector.component.md) | Allows a user to select items from a Content Services repository. | [Source](../lib/content-services/src/lib/content-node-selector/content-node-selector.component.ts) |
|
||||
| [Content Type Dialog component](content-services/components/content-type-dialog.component.md) | Confirm dialog when user changes content type of a node. | [Source](../lib/content-services/src/lib/content-type/content-type-dialog.component.ts) |
|
||||
| [Content User Info component](content-services/components/content-user-info.component.md) | Shows user information for CONTENT and CONTENT_SSO mode. | [Source](../lib/content-services/src/lib/content-user-info/content-user-info.component.ts) |
|
||||
@@ -307,7 +306,7 @@ for more information about installing and using the source code.
|
||||
| [Search Sorting Picker Component](content-services/components/search-sorting-picker.component.md) | Provides an ability to select one of the predefined sorting definitions for search results: | [Source](../lib/content-services/src/lib/search/components/search-sorting-picker/search-sorting-picker.component.ts) |
|
||||
| [Search text component](content-services/components/search-text.component.md) | Implements a text input widget for the Search Filter component. | [Source](../lib/content-services/src/lib/search/components/search-text/search-text.component.ts) |
|
||||
| [Search component](content-services/components/search.component.md) | Searches items for supplied search terms. | [Source](../lib/content-services/src/lib/search/components/search.component.ts) |
|
||||
| [Sites Dropdown component](content-services/components/sites-dropdown.component.md) | Displays a dropdown menu to show and interact with the sites of the current user. | [Source](../lib/content-services/src/lib/site-dropdown/sites-dropdown.component.ts) |
|
||||
| [Sites Dropdown component](content-services/components/sites-dropdown.component.md) | Displays a dropdown menu to show and interact with the sites of the current user. | [Source](../lib/content-services/src/lib/content-node-selector/site-dropdown/sites-dropdown.component.ts) |
|
||||
| [Tag Node Actions List component](content-services/components/tag-actions.component.md) | Shows available actions for tags. | [Source](../lib/content-services/src/lib/tag/tag-actions.component.ts) |
|
||||
| [Tag List component](content-services/components/tag-list.component.md) | Shows tags for an item. | [Source](../lib/content-services/src/lib/tag/tag-list.component.ts) |
|
||||
| [Tag Node List component](content-services/components/tag-node-list.component.md) | Shows tags for a node. | [Source](../lib/content-services/src/lib/tag/tag-node-list.component.ts) |
|
||||
|
@@ -2,10 +2,10 @@
|
||||
Title: Content Node Selector Panel component
|
||||
Added: v2.1.0
|
||||
Status: Active
|
||||
Last reviewed: 2019-03-20
|
||||
Last reviewed: 2024-06-21
|
||||
---
|
||||
|
||||
# [Content Node Selector Panel component](../../../lib/content-services/src/lib/content-node-selector/content-node-selector-panel.component.ts "Defined in content-node-selector-panel.component.ts")
|
||||
# Content Node Selector Panel Component
|
||||
|
||||
Opens a [Content Node Selector](content-node-selector.component.md) in its own dialog window.
|
||||
|
||||
@@ -28,50 +28,53 @@ Opens a [Content Node Selector](content-node-selector.component.md) in its own
|
||||
|
||||
### Properties
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| ---- | ---- | ------------- | ----------- |
|
||||
| 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 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. This is the same as the `siteList`. property of the Sites Dropdown component (see its doc page for more information). |
|
||||
| imageResolver | [`ImageResolver`](../../../lib/content-services/src/lib/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. |
|
||||
| isSelectionValid | [`ValidationFunction`](../../../lib/content-services/src/lib/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. |
|
||||
| pageSize | `number` | | Number of items shown per page in the list. |
|
||||
| restrictRootToCurrentFolderId | `boolean` | false | If true will restrict the search and breadcrumbs to the currentFolderId |
|
||||
| selectionMode | `"single" \| "multiple"` | "single" | Define the selection mode for document list. The allowed values are single or multiple |
|
||||
| where | `string` | | Custom _where_ filter function. See the [Document List component](../../content-services/components/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`](../../../lib/content-services/src/lib/document-list/data/row-filter.model.ts) | | Custom row filter function. See the [Row Filter Model](row-filter.model.md) page for more information. |
|
||||
| showDropdownSiteList | `boolean` | | Toggle sites list dropdown rendering |
|
||||
| showFilesInResult | `void` | | Shows the files and folders in the search result |
|
||||
| showNodeCounter | `boolean` | | Shows the node counter in the breadcrumb |
|
||||
| showSearch | `boolean` | | Toggle search input rendering |
|
||||
| Name | Type | Default value | Description |
|
||||
|-------------------------------|--------------------------|-------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| 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 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` | 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](../models/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. |
|
||||
| restrictRootToCurrentFolderId | `boolean` | false | If true will restrict the search and breadcrumbs to the currentFolderId |
|
||||
| selectionMode | `"single" \| "multiple"` | "single" | Define the selection mode for document list. The allowed values are single or multiple |
|
||||
| where | `string` | | Custom _where_ filter function. See the [Document List component](../../content-services/components/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 [Row Filter Model](row-filter.model.md) page for more information. |
|
||||
| showDropdownSiteList | `boolean` | | Toggle sites list dropdown rendering |
|
||||
| showFilesInResult | `void` | | Shows the files and folders in the search result |
|
||||
| showNodeCounter | `boolean` | | Shows the node counter in the breadcrumb |
|
||||
| showSearch | `boolean` | | Toggle search input rendering |
|
||||
|
||||
### Events
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| currentFolder | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<Node>` | Emitted when current folder loaded. |
|
||||
| folderLoaded | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<any>` | Emitted when folder loaded. |
|
||||
| navigationChange | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`NodeEntryEvent`](../../../lib/content-services/src/lib/document-list/components/node.event.ts)`>` | Emitted when the navigation changes. |
|
||||
| select | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<Node[]>` | Emitted when the user has chosen an item. |
|
||||
| showingSearch | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<boolean>` | Emitted when search is running. |
|
||||
| siteChange | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<string>` | Emitted when the select site changes. |
|
||||
| Name | Type | Description |
|
||||
|------------------|--------------------------------|-------------------------------------------|
|
||||
| currentFolder | `EventEmitter<Node>` | Emitted when current folder loaded. |
|
||||
| folderLoaded | `EventEmitter<any>` | Emitted when folder loaded. |
|
||||
| navigationChange | `EventEmitter<NodeEntryEvent>` | Emitted when the navigation changes. |
|
||||
| select | `EventEmitter<Node[]>` | Emitted when the user has chosen an item. |
|
||||
| showingSearch | `EventEmitter<boolean>` | Emitted when search is running. |
|
||||
| siteChange | `EventEmitter<string>` | Emitted when the select site changes. |
|
||||
|
||||
## Details
|
||||
|
||||
This component opens a _content node selector_ in its own dialog window. This behaves a lot like the
|
||||
standard file open/save dialogs used by applications to choose files. Full details are given in the
|
||||
[Content Node Selector component](content-node-selector.component.md) page (this is similar but does
|
||||
not manage the dialog window for you). Also, the
|
||||
[Content Node Dialog service](../services/content-node-dialog.service.md) has several methods that give you
|
||||
not manage the dialog window for you).
|
||||
|
||||
Also, the [Content Node Dialog service](../services/content-node-dialog.service.md) has several methods that give you
|
||||
finer control over the behavior of the dialog.
|
||||
|
||||
### Using the breadcrumbTransform function
|
||||
|
||||
The `breadcrumbTransform` property lets you modify the [`Node`](https://github.com/Alfresco/alfresco-js-api/blob/develop/src/api/content-rest-api/docs/Node.md) object that is used to generate the
|
||||
The `breadcrumbTransform` property lets you modify the `Node` object that is used to generate the
|
||||
list of breadcrumbs. You can use this, for example, to remove path elements that are not
|
||||
relevant to the use case. See the [Breadcrumb component](breadcrumb.component.md) page for an
|
||||
relevant to the use case.
|
||||
|
||||
See the [Breadcrumb component](breadcrumb.component.md) page for an
|
||||
example of how to use this function.
|
||||
|
||||
## See also
|
||||
|
@@ -5,7 +5,7 @@ Status: Active
|
||||
Last reviewed: 2019-01-16
|
||||
---
|
||||
|
||||
# [Content Node Selector component](../../../lib/content-services/src/lib/content-node-selector/content-node-selector.component.ts "Defined in content-node-selector.component.ts")
|
||||
# Content Node Selector component
|
||||
|
||||
Allows a user to select items from a Content Services repository.
|
||||
|
||||
@@ -15,19 +15,18 @@ Allows a user to select items from a Content Services repository.
|
||||
|
||||
The [Content Node Selector component](content-node-selector.component.md) works a lot like the standard File Open/Save
|
||||
dialog used by desktop applications except that it chooses items from a Content Services
|
||||
repository rather than the filesystem. For example, the
|
||||
[Document List component](document-list.component.md) uses a selector to choose the targets
|
||||
of Copy/Move actions (see the [Content Action component](content-action.component.md) for
|
||||
more information).
|
||||
repository rather than the filesystem.
|
||||
|
||||
For example, the [Document List component](document-list.component.md) uses a selector to choose the targets
|
||||
of Copy/Move actions (see the [Content Action component](content-action.component.md) for more information).
|
||||
|
||||
### Showing the dialog
|
||||
|
||||
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/src/lib/content-node-selector/content-node-selector.component-data.interface.ts) interface
|
||||
to work with the Dialog's
|
||||
[data option](https://material.angular.io/components/dialog/overview#sharing-data-with-the-dialog-component-):
|
||||
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` interface to work with the Dialog [data option](https://material.angular.io/components/dialog/overview#sharing-data-with-the-dialog-component-):
|
||||
|
||||
```ts
|
||||
export interface ContentNodeSelectorComponentData {
|
||||
@@ -55,22 +54,22 @@ export interface ContentNodeSelectorComponentData {
|
||||
|
||||
The properties are described in the table below:
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| ---- | ---- | ------------- | ----------- |
|
||||
| title | `string` | "" | Dialog title |
|
||||
| actionName | `string` | "" | Text to appear on the dialog's main action button ("Move", "Copy", etc) |
|
||||
| currentFolderId | `string` | `null` | [`Node`](https://github.com/Alfresco/alfresco-js-api/blob/develop/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/src/lib/document-list/data/row-filter.model.ts) | `null` | Custom row filter function. See the [Row Filter Model](../models/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/src/lib/document-list/data/image-resolver.model.ts) | `null` | Custom image resolver function. See the [Image Resolver Model](../models/image-resolver.model.md) page for more information. |
|
||||
| pageSize | `number` | | Number of items shown per page in the list. |
|
||||
| isSelectionValid | [`ValidationFunction`](../../../lib/content-services/src/lib/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. |
|
||||
| select | [`Subject<Node>`](https://github.com/Alfresco/alfresco-js-api/blob/develop/src/api/content-rest-api/docs/Node.md) | | Event emitted with the current node selection when the dialog closes |
|
||||
| showSearch | `boolean` | `true` | Render search input |
|
||||
| showDropdownSiteList | `boolean` | `true` | Render sites list dropdown menu |
|
||||
| Name | Type | Default value | Description |
|
||||
|----------------------|----------------------|---------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| title | `string` | "" | Dialog title |
|
||||
| actionName | `string` | "" | Text to appear on the dialog's main action button ("Move", "Copy", etc) |
|
||||
| currentFolderId | `string` | `null` | The ID of the folder node 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` | `null` | Custom site for site dropdown same as siteList. See the [Sites Dropdown component](sites-dropdown.component.md) for more information. |
|
||||
| rowFilter | `RowFilter` | `null` | Custom row filter function. See the [Row Filter Model](../models/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` | `null` | Custom image resolver function. See the [Image Resolver Model](../models/image-resolver.model.md) page for more information. |
|
||||
| pageSize | `number` | | Number of items shown per page in the list. |
|
||||
| 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. |
|
||||
| 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. |
|
||||
| select | `Subject<Node>` | | Event emitted with the current node selection when the dialog closes |
|
||||
| showSearch | `boolean` | `true` | Render search input |
|
||||
| showDropdownSiteList | `boolean` | `true` | Render sites list dropdown menu |
|
||||
|
||||
If you don't want to manage the dialog yourself then it is easier to use the
|
||||
[Content Node Selector Panel component](content-node-selector-panel.component.md), or the
|
||||
@@ -81,65 +80,65 @@ the dialog for you.
|
||||
|
||||
```ts
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { ContentNodeSelectorComponentData, ContentNodeSelectorComponent} from '@adf/content-services'
|
||||
import { ContentNodeSelectorComponentData, ContentNodeSelectorComponent} from '@adf/content-services';
|
||||
import { Subject } from 'rxjs/Subject';
|
||||
...
|
||||
|
||||
constructor(dialog: MatDialog ... ) {}
|
||||
export class MyComponent {
|
||||
constructor(dialog: MatDialog) {
|
||||
}
|
||||
|
||||
openSelectorDialog() {
|
||||
data: ContentNodeSelectorComponentData = {
|
||||
title: "Choose an item",
|
||||
actionName: "Choose",
|
||||
currentFolderId: someFolderId,
|
||||
select: new Subject<Node[]>()
|
||||
};
|
||||
openSelectorDialog() {
|
||||
data: ContentNodeSelectorComponentData = {
|
||||
title: "Choose an item",
|
||||
actionName: "Choose",
|
||||
currentFolderId: someFolderId,
|
||||
select: new Subject<Node[]>()
|
||||
};
|
||||
|
||||
this.dialog.open(
|
||||
ContentNodeSelectorComponent,
|
||||
{
|
||||
data, panelClass: 'adf-content-node-selector-dialog',
|
||||
width: '630px'
|
||||
}
|
||||
);
|
||||
this.dialog.open(
|
||||
ContentNodeSelectorComponent,
|
||||
{
|
||||
data, panelClass: 'adf-content-node-selector-dialog',
|
||||
width: '630px'
|
||||
}
|
||||
);
|
||||
|
||||
data.select.subscribe((selections: Node[]) => {
|
||||
// Use or store selection...
|
||||
},
|
||||
(error)=>{
|
||||
//your error handling
|
||||
},
|
||||
()=>{
|
||||
//action called when an action or cancel is clicked on the dialog
|
||||
this.dialog.closeAll();
|
||||
});
|
||||
data.select.subscribe((selections: Node[]) => {
|
||||
// Use or store selection...
|
||||
},
|
||||
(error) => {
|
||||
//your error handling
|
||||
},
|
||||
() => {
|
||||
//action called when an action or cancel is clicked on the dialog
|
||||
this.dialog.closeAll();
|
||||
});
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
All the results will be streamed to the select [subject](http://reactivex.io/rxjs/manual/overview.html#subject) present in the [`ContentNodeSelectorComponentData`](../../../lib/content-services/src/lib/content-node-selector/content-node-selector.component-data.interface.ts) object passed to the dialog.
|
||||
All the results will be streamed to the select `subject` present in the `ContentNodeSelectorComponentData` object passed to the dialog.
|
||||
When the dialog action is selected by clicking, the `data.select` stream will be completed.
|
||||
|
||||
### RowFilter and ImageResolver
|
||||
|
||||
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
|
||||
[Row Filter Model](../models/row-filter.model.md) and [Image Resolver Model](../models/image-resolver.model.md)
|
||||
pages for more information.
|
||||
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 [Row Filter Model](../models/row-filter.model.md) and [Image Resolver Model](../models/image-resolver.model.md) pages for more information.
|
||||
|
||||
### Using the breadcrumbTransform function
|
||||
|
||||
The `breadcrumbTransform` property of [`ContentNodeSelectorComponentData`](../../../lib/content-services/src/lib/content-node-selector/content-node-selector.component-data.interface.ts) lets you modify
|
||||
the [`Node`](https://github.com/Alfresco/alfresco-js-api/blob/develop/src/api/content-rest-api/docs/Node.md) object that is used to generate the
|
||||
list of breadcrumbs. You can use this, for example, to remove path elements that are not
|
||||
relevant to the use case. See the [Breadcrumb component](breadcrumb.component.md) page for an
|
||||
example of how to use this function.
|
||||
The `breadcrumbTransform` property of `ContentNodeSelectorComponentData` lets you modify
|
||||
the `Node` object that is used to generate the list of breadcrumbs.
|
||||
|
||||
You can use this, for example, to remove path elements that are not relevant to the use case.
|
||||
See the [Breadcrumb component](breadcrumb.component.md) page for an example of how to use this function.
|
||||
|
||||
## See also
|
||||
|
||||
- [Document list component](document-list.component.md)
|
||||
- [Document List Component](document-list.component.md)
|
||||
- [Content Node Selector Panel component](content-node-selector-panel.component.md)
|
||||
- [Content Node Dialog service](../services/content-node-dialog.service.md)
|
||||
|
@@ -66,6 +66,7 @@ Displays the documents from a repository.
|
||||
| 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 |
|
||||
| displayCheckboxesOnHover | `boolean` | false | Enables checkboxes in datatable rows being displayed on hover only. |
|
||||
| emptyFolderImageUrl | `string` | | Custom image for empty folder. Default value: './assets/images/empty_doc_lib.svg' |
|
||||
| filterValue | `any` | | Initial value for filter. |
|
||||
| headerFilters | `boolean` | false | Toggles the header filters mode. |
|
||||
|
@@ -1,11 +1,4 @@
|
||||
---
|
||||
Title: Sites Dropdown component
|
||||
Added: v2.0.0
|
||||
Status: Active
|
||||
Last reviewed: 2018-11-19
|
||||
---
|
||||
|
||||
# [Sites Dropdown component](../../../lib/content-services/src/lib/site-dropdown/sites-dropdown.component.ts "Defined in sites-dropdown.component.ts")
|
||||
# Sites Dropdown component
|
||||
|
||||
Displays a dropdown menu to show and interact with the sites of the current user.
|
||||
|
||||
@@ -19,20 +12,24 @@ Displays a dropdown menu to show and interact with the sites of the current user
|
||||
</adf-sites-dropdown>
|
||||
```
|
||||
|
||||
## Class members
|
||||
## API
|
||||
|
||||
```ts
|
||||
import { SitesDropdownComponent } from '@alfresco/adf-content-services';
|
||||
```
|
||||
|
||||
### Properties
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| ---- | ---- | ------------- | ----------- |
|
||||
| hideMyFiles | `boolean` | false | Hide the "My Files" option. |
|
||||
| placeholder | `string` | | Text or a translation key to act as a placeholder. Default value is the key "DROPDOWN.PLACEHOLDER_LABEL". |
|
||||
| relations | `string` | | Filter for the results of the sites query. Possible values are "members" and "containers". When "members" is used, the site list will be restricted to the sites that the user is a member of. |
|
||||
| siteList | [`SitePaging`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/SitePaging.md) | null | A custom list of sites to be displayed by the dropdown. If no value is given, the sites of the current user are displayed by default. A list of objects only with properties 'title' and 'guid' is enough to be able to display the dropdown. |
|
||||
| value | `string` | null | Id of the selected site |
|
||||
| Name | Type | Default value | Description |
|
||||
|-------------|--------------|---------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| hideMyFiles | `boolean` | false | Hide the "My Files" option. |
|
||||
| placeholder | `string` | | Text or a translation key to act as a placeholder. Default value is the key "DROPDOWN.PLACEHOLDER_LABEL". |
|
||||
| relations | `string` | | Filter for the results of the sites query. Possible values are "members" and "containers". When "members" is used, the site list will be restricted to the sites that the user is a member of. |
|
||||
| siteList | `SitePaging` | null | A custom list of sites to be displayed by the dropdown. If no value is given, the sites of the current user are displayed by default. A list of objects only with properties 'title' and 'guid' is enough to be able to display the dropdown. |
|
||||
| value | `string` | null | Id of the selected site |
|
||||
|
||||
### Events
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| change | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`SiteEntry`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/SiteEntry.md)`>` | Emitted when the user selects a site. When the default option is selected, an empty model is emitted. |
|
||||
| Name | Type | Description |
|
||||
|--------|---------------------------|-------------------------------------------------------------------------------------------------------|
|
||||
| change | `EventEmitter<SiteEntry>` | Emitted when the user selects a site. When the default option is selected, an empty model is emitted. |
|
||||
|
@@ -1,36 +1,30 @@
|
||||
---
|
||||
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")
|
||||
# Image Resolver Model
|
||||
|
||||
Defines the Image Resolver function used by the [Document List Component](../components/document-list.component.md).
|
||||
|
||||
## Definitions
|
||||
|
||||
- `type` **[`ImageResolver`](../../../lib/content-services/src/lib/document-list/data/image-resolver.model.ts)** = (row: [`DataRow`](../../../lib/core/src/lib/datatable/data/data-row.model.ts), column: [`DataColumn`](../../../lib/core/src/lib/datatable/data/data-column.model.ts)) => `string`
|
||||
- _row:_ [`DataRow`](../../../lib/core/src/lib/datatable/data/data-row.model.ts) - Data that defines the row
|
||||
- _column:_ [`DataColumn`](../../../lib/core/src/lib/datatable/data/data-column.model.ts) - Data that defines the column
|
||||
- `type` **ImageResolver** = (row: `DataRow`, column: `DataColumn`) => `string`
|
||||
- _row:_ `DataRow` - Data that defines the row
|
||||
- _column:_ `DataColumn` - 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](../components/document-list.component.md)
|
||||
or another component that uses the Document List (such as the
|
||||
[Content Node Selector Panel Component](../components/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).
|
||||
An image resolver function selects an image file path for an item in a [Document List Component](../components/document-list.component.md)
|
||||
or another component that uses the Document List (such as the [Content Node Selector Panel Component](../components/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/src/lib/datatable/data/data-row.model.ts) and [`DataColumn`](../../../lib/core/src/lib/datatable/data/data-column.model.ts) objects as parameters:
|
||||
A typical image resolver implementation receives `DataRow` and `DataColumn` objects as parameters:
|
||||
|
||||
```ts
|
||||
myImageResolver(row: DataRow, col: DataColumn): string {
|
||||
return '/path/to/image';
|
||||
export class MyComponent {
|
||||
myImageResolver(row: DataRow, col: DataColumn): string {
|
||||
return '/path/to/image';
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -74,15 +68,13 @@ export class View1 {
|
||||
let name = row.getValue(col.key);
|
||||
|
||||
// Format image url
|
||||
return `http://<my custom path to folder icon>/${name}`;
|
||||
return `https://<my custom path to folder icon>/${name}`;
|
||||
}
|
||||
|
||||
// For the rest of the cases just fallback to default behaviour.
|
||||
return null;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
|
@@ -429,6 +429,8 @@ Learn more about styling your datatable: [Customizing the component's styles](#c
|
||||
| columns | `any[]` | \[] | The columns that the datatable will show. |
|
||||
| contextMenu | `boolean` | false | Toggles custom context menu for the component. |
|
||||
| data | [`DataTableAdapter`](../../../lib/core/src/lib/datatable/data/datatable-adapter.ts) | | Data source for the table |
|
||||
| displayCheckboxesOnHover | `boolean` | false | Enables checkboxes in datatable rows being displayed on hover only. |
|
||||
|
||||
| fallbackThumbnail | `string` | | Fallback image for rows where the thumbnail is missing. |
|
||||
| isResizingEnabled | `boolean` | false | Flag that indicates if the datatable allows column resizing. |
|
||||
| loading | `boolean` | false | Flag that indicates if the datatable is in loading state and needs to show the loading template (see the docs to learn how to configure a loading template). |
|
||||
|
@@ -75,6 +75,7 @@ See the [Custom layout](#custom-layout) section for full details of all availabl
|
||||
| originalMimeType | `string` | | Overload originalMimeType |
|
||||
| overlayMode | `boolean` | false | If `true` then show the Viewer as a full page over the current content. Otherwise fit inside the parent div. |
|
||||
| readOnly | `boolean` | true | Enable when where is possible the editing functionalities |
|
||||
| allowedEditActions | `{ [key: string]: boolean }` | `{ rotate: true, crop: true }` | Controls which editing actions are enabled when not in read-only mode. Allows granular control over actions like rotation and cropping. |
|
||||
| showLeftSidebar | `boolean` | false | Toggles left sidebar visibility. Requires `allowLeftSidebar` to be set to `true`. |
|
||||
| showRightSidebar | `boolean` | false | Toggles right sidebar visibility. Requires `allowRightSidebar` to be set to `true`. |
|
||||
| showToolbar | `boolean` | true | Hide or show the toolbar |
|
||||
|
@@ -101,7 +101,7 @@
|
||||
</mat-expansion-panel-header>
|
||||
<div *ngIf="currentPanel.panelTitle === DefaultPanels.TAGS && !editing" class="adf-metadata-properties-tags">
|
||||
<mat-chip-set>
|
||||
<mat-chip *ngFor="let tag of tags" [disableRipple]="true" data-automation-id="metadata-properties-tag-chip">{{ tag }}</mat-chip>
|
||||
<mat-chip *ngFor="let tag of tags" [disableRipple]="true" class="metadata-properties-tag-chip" data-automation-id="metadata-properties-tag-chip">{{ tag }}</mat-chip>
|
||||
</mat-chip-set>
|
||||
</div>
|
||||
<div *ngIf="showEmptyTagMessage" class="adf-metadata-no-item-added">
|
||||
|
@@ -21,15 +21,15 @@ import { By } from '@angular/platform-browser';
|
||||
import { Node, NodeEntry, NodePaging, RequestScope, ResultSetPaging, SiteEntry, SitePaging, SitePagingList } from '@alfresco/js-api';
|
||||
import { of } from 'rxjs';
|
||||
import { ContentNodeSelectorPanelComponent } from './content-node-selector-panel.component';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
import { DocumentListService } from '../document-list/services/document-list.service';
|
||||
import { DocumentListComponent } from '../document-list/components/document-list.component';
|
||||
import { CustomResourcesService } from '../document-list/services/custom-resources.service';
|
||||
import { NodeEntryEvent, ShareDataRow } from '../document-list';
|
||||
import { SearchQueryBuilderService } from '../search';
|
||||
import { mockSearchRequest } from '../mock/search-query.mock';
|
||||
import { SitesService } from '../common/services/sites.service';
|
||||
import { NodesApiService } from '../common/services/nodes-api.service';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { DocumentListService } from '../../document-list/services/document-list.service';
|
||||
import { DocumentListComponent } from '../../document-list/components/document-list.component';
|
||||
import { CustomResourcesService } from '../../document-list/services/custom-resources.service';
|
||||
import { NodeEntryEvent, ShareDataRow } from '../../document-list';
|
||||
import { SearchQueryBuilderService } from '../../search';
|
||||
import { mockSearchRequest } from '../../mock/search-query.mock';
|
||||
import { SitesService } from '../../common/services/sites.service';
|
||||
import { NodesApiService } from '../../common/services/nodes-api.service';
|
||||
|
||||
const fakeResultSetPaging: ResultSetPaging = {
|
||||
list: {
|
@@ -214,27 +214,24 @@ h2.adf-search-results-label {
|
||||
.adf-datatable-list .adf-datatable-body .adf-datatable-row {
|
||||
min-height: 65px;
|
||||
|
||||
.adf-datatable-cell-container {
|
||||
.adf-name-location-cell-location {
|
||||
padding: 0 10px;
|
||||
display: block;
|
||||
}
|
||||
@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {
|
||||
padding-top: 15px;
|
||||
}
|
||||
|
||||
.adf-name-location-cell-name {
|
||||
padding: 5px 10px 2px;
|
||||
}
|
||||
.adf-name-location-cell-name {
|
||||
padding: 5px 10px 2px;
|
||||
}
|
||||
|
||||
&.adf-content-selector-modified-cell {
|
||||
display: none;
|
||||
}
|
||||
&.adf-content-selector-modified-cell {
|
||||
display: none;
|
||||
}
|
||||
|
||||
&.adf-content-selector-modifier-cell {
|
||||
display: none;
|
||||
}
|
||||
&.adf-content-selector-modifier-cell {
|
||||
display: none;
|
||||
}
|
||||
|
||||
&.adf-content-selector-visibility-cell {
|
||||
display: none;
|
||||
}
|
||||
&.adf-content-selector-visibility-cell {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
@@ -20,17 +20,17 @@ import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testin
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { Node, NodeEntry, NodePaging, ResultSetPaging, Site, SiteEntry, SitePaging, SitePagingList, UserInfo } from '@alfresco/js-api';
|
||||
import { DataRow, ThumbnailService, DataColumn } from '@alfresco/adf-core';
|
||||
import { ContentService, UploadService, NodesApiService, SitesService, FileModel, FileUploadStatus, FileUploadCompleteEvent } from '../common';
|
||||
import { ContentService, UploadService, NodesApiService, SitesService, FileModel, FileUploadStatus, FileUploadCompleteEvent } from '../../common';
|
||||
import { of, throwError } from 'rxjs';
|
||||
import { DropdownBreadcrumbComponent } from '../breadcrumb';
|
||||
import { DropdownBreadcrumbComponent } from '../../breadcrumb';
|
||||
import { ContentNodeSelectorPanelComponent } from './content-node-selector-panel.component';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
import { DocumentListService } from '../document-list/services/document-list.service';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { DocumentListService } from '../../document-list/services/document-list.service';
|
||||
import { DropdownSitesComponent } from '../site-dropdown/sites-dropdown.component';
|
||||
import { NodeEntryEvent, ShareDataRow, ShareDataTableAdapter } from '../document-list';
|
||||
import { SearchQueryBuilderService } from '../search';
|
||||
import { NodeEntryEvent, ShareDataRow, ShareDataTableAdapter } from '../../document-list';
|
||||
import { SearchQueryBuilderService } from '../../search';
|
||||
import { ContentNodeSelectorPanelService } from './content-node-selector-panel.service';
|
||||
import { mockContentModelTextProperty } from '../mock/content-model.mock';
|
||||
import { mockContentModelTextProperty } from '../../mock/content-model.mock';
|
||||
|
||||
const fakeResultSetPaging: ResultSetPaging = {
|
||||
list: {
|
@@ -25,18 +25,18 @@ import {
|
||||
DataSorting,
|
||||
ShowHeaderMode
|
||||
} from '@alfresco/adf-core';
|
||||
import { NodesApiService, UploadService, FileUploadCompleteEvent, FileUploadDeleteEvent, SitesService } from '../common';
|
||||
import { NodesApiService, UploadService, FileUploadCompleteEvent, FileUploadDeleteEvent, SitesService } from '../../common';
|
||||
import { UntypedFormControl } from '@angular/forms';
|
||||
import { Node, NodePaging, Pagination, SiteEntry, SitePaging, NodeEntry, SearchRequest, RequestScope } from '@alfresco/js-api';
|
||||
import { DocumentListComponent } from '../document-list/components/document-list.component';
|
||||
import { RowFilter } from '../document-list/data/row-filter.model';
|
||||
import { ImageResolver } from '../document-list/data/image-resolver.model';
|
||||
import { CustomResourcesService } from '../document-list/services/custom-resources.service';
|
||||
import { ShareDataRow } from '../document-list/data/share-data-row.model';
|
||||
import { NodeEntryEvent } from '../document-list/components/node.event';
|
||||
import { DocumentListComponent } from '../../document-list/components/document-list.component';
|
||||
import { RowFilter } from '../../document-list/data/row-filter.model';
|
||||
import { ImageResolver } from '../../document-list/data/image-resolver.model';
|
||||
import { CustomResourcesService } from '../../document-list/services/custom-resources.service';
|
||||
import { ShareDataRow } from '../../document-list/data/share-data-row.model';
|
||||
import { NodeEntryEvent } from '../../document-list/components/node.event';
|
||||
import { debounceTime, takeUntil } from 'rxjs/operators';
|
||||
import { Subject } from 'rxjs';
|
||||
import { SearchQueryBuilderService } from '../search';
|
||||
import { SearchQueryBuilderService } from '../../search';
|
||||
import { ContentNodeSelectorPanelService } from './content-node-selector-panel.service';
|
||||
|
||||
export type ValidationFunction = (entry: Node) => boolean;
|
@@ -16,10 +16,9 @@
|
||||
*/
|
||||
|
||||
import { ContentNodeSelectorPanelService } from './content-node-selector-panel.service';
|
||||
import { mockContentModelDateProperty, mockContentModelTextProperty, mockConvertedSearchCategoriesFromModels } from '../mock/content-model.mock';
|
||||
import { mockContentModelDateProperty, mockContentModelTextProperty, mockConvertedSearchCategoriesFromModels } from '../../mock/content-model.mock';
|
||||
|
||||
describe('ContentNodeSelectorPanelService', () => {
|
||||
|
||||
const contentNodeSelectorPanelService = new ContentNodeSelectorPanelService();
|
||||
|
||||
it('should support text type', () => {
|
||||
@@ -42,7 +41,7 @@ describe('ContentNodeSelectorPanelService', () => {
|
||||
});
|
||||
|
||||
it('should modelPropertyTypeToSearchFilterTypeMap contain only the supported types', () => {
|
||||
const expectedSupportedTypesMap = new Map<string, string> ();
|
||||
const expectedSupportedTypesMap = new Map<string, string>();
|
||||
expectedSupportedTypesMap.set('d:text', 'text');
|
||||
expectedSupportedTypesMap.set('d:date', 'date-range');
|
||||
expectedSupportedTypesMap.set('d:datetime', 'datetime-range');
|
@@ -16,15 +16,14 @@
|
||||
*/
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { SearchCategory } from '../search/models/search-category.interface';
|
||||
import { SearchCategory } from '../../search/models/search-category.interface';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ContentNodeSelectorPanelService {
|
||||
|
||||
propertyTypes = ['d:text', 'd:date', 'd:datetime'];
|
||||
modelPropertyTypeToSearchFilterTypeMap = new Map<string, string> ();
|
||||
modelPropertyTypeToSearchFilterTypeMap = new Map<string, string>();
|
||||
customModels: any[];
|
||||
|
||||
constructor() {
|
||||
@@ -35,7 +34,7 @@ export class ContentNodeSelectorPanelService {
|
||||
|
||||
convertCustomModelPropertiesToSearchCategories(): SearchCategory[] {
|
||||
const searchConfig: SearchCategory[] = [];
|
||||
this.customModels?.forEach( (propertyModel) => {
|
||||
this.customModels?.forEach((propertyModel) => {
|
||||
searchConfig.push(this.convertModelPropertyIntoSearchFilter(propertyModel));
|
||||
});
|
||||
|
||||
@@ -46,7 +45,7 @@ export class ContentNodeSelectorPanelService {
|
||||
let filterSearch: SearchCategory;
|
||||
if (this.isTypeSupported(modelProperty.dataType)) {
|
||||
filterSearch = {
|
||||
id : modelProperty.prefixedName,
|
||||
id: modelProperty.prefixedName,
|
||||
name: modelProperty.prefixedName,
|
||||
expanded: false,
|
||||
enabled: true,
|
||||
@@ -66,5 +65,4 @@ export class ContentNodeSelectorPanelService {
|
||||
isTypeSupported(dataType: string): boolean {
|
||||
return this.propertyTypes.includes(dataType);
|
||||
}
|
||||
|
||||
}
|
@@ -29,7 +29,7 @@ import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
import { DocumentListService } from '../document-list/services/document-list.service';
|
||||
import { DocumentListComponent } from '../document-list/components/document-list.component';
|
||||
import { UploadModule } from '../upload';
|
||||
import { ContentNodeSelectorPanelComponent } from './content-node-selector-panel.component';
|
||||
import { ContentNodeSelectorPanelComponent } from './content-node-selector-panel/content-node-selector-panel.component';
|
||||
import { NodeAction } from '../document-list/models/node-action.enum';
|
||||
import { SitesService } from '../common/services/sites.service';
|
||||
import { NodesApiService } from '../common/services/nodes-api.service';
|
||||
|
@@ -19,10 +19,8 @@ import { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { MaterialModule } from '../material.module';
|
||||
|
||||
import { ContentNodeSelectorPanelComponent } from './content-node-selector-panel.component';
|
||||
import { ContentNodeSelectorPanelComponent } from './content-node-selector-panel/content-node-selector-panel.component';
|
||||
import { ContentNodeSelectorComponent } from './content-node-selector.component';
|
||||
import { SitesDropdownModule } from '../site-dropdown/sites-dropdown.module';
|
||||
import { BreadcrumbModule } from '../breadcrumb/breadcrumb.module';
|
||||
import { SearchModule } from '../search/search.module';
|
||||
import { CoreModule } from '@alfresco/adf-core';
|
||||
@@ -31,6 +29,7 @@ import { NameLocationCellComponent } from './name-location-cell/name-location-ce
|
||||
import { UploadModule } from '../upload/upload.module';
|
||||
import { SearchQueryBuilderService } from '../search/services/search-query-builder.service';
|
||||
import { ContentDirectiveModule } from '../directives/content-directive.module';
|
||||
import { DropdownSitesComponent } from './site-dropdown/sites-dropdown.component';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@@ -39,23 +38,16 @@ import { ContentDirectiveModule } from '../directives/content-directive.module';
|
||||
CoreModule,
|
||||
CommonModule,
|
||||
MaterialModule,
|
||||
SitesDropdownModule,
|
||||
DropdownSitesComponent,
|
||||
BreadcrumbModule,
|
||||
SearchModule,
|
||||
DocumentListModule,
|
||||
UploadModule,
|
||||
ContentDirectiveModule
|
||||
],
|
||||
exports: [
|
||||
ContentNodeSelectorPanelComponent,
|
||||
NameLocationCellComponent,
|
||||
ContentNodeSelectorComponent
|
||||
],
|
||||
declarations: [
|
||||
ContentNodeSelectorPanelComponent,
|
||||
NameLocationCellComponent,
|
||||
ContentNodeSelectorComponent
|
||||
ContentDirectiveModule,
|
||||
NameLocationCellComponent
|
||||
],
|
||||
exports: [ContentNodeSelectorPanelComponent, NameLocationCellComponent, ContentNodeSelectorComponent],
|
||||
declarations: [ContentNodeSelectorPanelComponent, ContentNodeSelectorComponent],
|
||||
providers: [SearchQueryBuilderService]
|
||||
})
|
||||
export class ContentNodeSelectorModule {}
|
||||
|
@@ -27,9 +27,7 @@ describe('NameLocationCellComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [
|
||||
NameLocationCellComponent
|
||||
]
|
||||
imports: [NameLocationCellComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(NameLocationCellComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
@@ -20,6 +20,7 @@ import { DataRow } from '@alfresco/adf-core';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-name-location-cell',
|
||||
standalone: true,
|
||||
template: `
|
||||
<div class="adf-name-location-cell-name adf-datatable-cell-value" [title]="name">{{ name }}</div>
|
||||
<div class="adf-name-location-cell-location adf-datatable-cell-value" [title]="path">{{ path }}</div>
|
||||
@@ -30,7 +31,6 @@ import { DataRow } from '@alfresco/adf-core';
|
||||
host: { class: 'adf-name-location-cell adf-datatable-content-cell' }
|
||||
})
|
||||
export class NameLocationCellComponent implements OnInit {
|
||||
|
||||
name: string = '';
|
||||
path: string = '';
|
||||
|
||||
|
@@ -16,10 +16,11 @@
|
||||
*/
|
||||
|
||||
export * from './name-location-cell/name-location-cell.component';
|
||||
export * from './site-dropdown/sites-dropdown.component';
|
||||
export * from './content-node-selector.component-data.interface';
|
||||
export * from './content-node-selector-panel.component';
|
||||
export * from './content-node-selector-panel/content-node-selector-panel.component';
|
||||
export * from './content-node-selector.component';
|
||||
export * from './content-node-dialog.service';
|
||||
export * from './content-node-selector-panel.service';
|
||||
export * from './content-node-selector-panel/content-node-selector-panel.service';
|
||||
|
||||
export * from './content-node-selector.module';
|
||||
|
@@ -25,9 +25,9 @@ import {
|
||||
getFakeSitePagingFirstPage,
|
||||
getFakeSitePagingLastPage,
|
||||
getFakeSitePagingWithMembers
|
||||
} from '../mock';
|
||||
import { ContentTestingModule } from '../testing/content.testing.module';
|
||||
import { SitesService } from '../common/services/sites.service';
|
||||
} from '../../mock';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { SitesService } from '../../common/services/sites.service';
|
||||
import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
import { MatSelectHarness } from '@angular/material/select/testing';
|
@@ -18,10 +18,12 @@
|
||||
import { Component, EventEmitter, Input, OnInit, Output, ViewEncapsulation } from '@angular/core';
|
||||
import { InfiniteSelectScrollDirective, AuthenticationService } from '@alfresco/adf-core';
|
||||
import { SitePaging, SiteEntry, Site } from '@alfresco/js-api';
|
||||
import { MatSelectChange } from '@angular/material/select';
|
||||
import { MatSelectChange, MatSelectModule } from '@angular/material/select';
|
||||
import { LiveAnnouncer } from '@angular/cdk/a11y';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { SitesService } from '../common/services/sites.service';
|
||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
||||
import { SitesService } from '../../common/services/sites.service';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
|
||||
/* eslint-disable no-shadow */
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
@@ -33,6 +35,8 @@ export enum Relations {
|
||||
|
||||
@Component({
|
||||
selector: 'adf-sites-dropdown',
|
||||
standalone: true,
|
||||
imports: [CommonModule, TranslateModule, MatFormFieldModule, MatSelectModule, InfiniteSelectScrollDirective],
|
||||
templateUrl: './sites-dropdown.component.html',
|
||||
encapsulation: ViewEncapsulation.None,
|
||||
host: { class: 'adf-sites-dropdown' }
|
||||
@@ -75,7 +79,7 @@ export class DropdownSitesComponent implements OnInit {
|
||||
* an empty model is emitted.
|
||||
*/
|
||||
@Output()
|
||||
change: EventEmitter<SiteEntry> = new EventEmitter();
|
||||
change = new EventEmitter<SiteEntry>();
|
||||
|
||||
@Output()
|
||||
error = new EventEmitter<any>();
|
@@ -26,7 +26,6 @@ import { TagModule } from './tag/tag.module';
|
||||
import { DocumentListModule } from './document-list/document-list.module';
|
||||
import { UploadModule } from './upload/upload.module';
|
||||
import { SearchModule } from './search/search.module';
|
||||
import { SitesDropdownModule } from './site-dropdown/sites-dropdown.module';
|
||||
import { BreadcrumbModule } from './breadcrumb/breadcrumb.module';
|
||||
import { VersionManagerModule } from './version-manager/version-manager.module';
|
||||
import { ContentNodeSelectorModule } from './content-node-selector/content-node-selector.module';
|
||||
@@ -49,6 +48,7 @@ import { ContentUserInfoModule } from './content-user-info/content-user-info.mod
|
||||
import { CategoriesModule } from './category/category.module';
|
||||
import { contentAuthLoaderFactory } from './auth-loader/content-auth-loader-factory';
|
||||
import { ContentAuthLoaderService } from './auth-loader/content-auth-loader.service';
|
||||
import { DropdownSitesComponent } from './content-node-selector/site-dropdown/sites-dropdown.component';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@@ -64,7 +64,7 @@ import { ContentAuthLoaderService } from './auth-loader/content-auth-loader.serv
|
||||
ContentUserInfoModule,
|
||||
UploadModule,
|
||||
MaterialModule,
|
||||
SitesDropdownModule,
|
||||
DropdownSitesComponent,
|
||||
BreadcrumbModule,
|
||||
ContentNodeSelectorModule,
|
||||
ContentNodeShareModule,
|
||||
@@ -90,7 +90,7 @@ import { ContentAuthLoaderService } from './auth-loader/content-auth-loader.serv
|
||||
ContentUserInfoModule,
|
||||
UploadModule,
|
||||
SearchModule,
|
||||
SitesDropdownModule,
|
||||
DropdownSitesComponent,
|
||||
BreadcrumbModule,
|
||||
ContentNodeSelectorModule,
|
||||
ContentNodeShareModule,
|
||||
|
@@ -17,6 +17,7 @@
|
||||
[allowFiltering]="allowFiltering"
|
||||
[isResizingEnabled]="isResizingEnabled"
|
||||
[blurOnResize]="blurOnResize"
|
||||
[displayCheckboxesOnHover]="displayCheckboxesOnHover"
|
||||
(showRowContextMenu)="onShowRowContextMenu($event)"
|
||||
(showRowActionsMenu)="onShowRowActionsMenu($event)"
|
||||
(executeRowAction)="onExecuteRowAction($event)"
|
||||
|
@@ -340,6 +340,10 @@ export class DocumentListComponent extends DataTableSchema implements OnInit, On
|
||||
@Input()
|
||||
blurOnResize = true;
|
||||
|
||||
/** Display checkboxes in datatable rows on hover only */
|
||||
@Input()
|
||||
displayCheckboxesOnHover = false;
|
||||
|
||||
/** Emitted when the user clicks a list node */
|
||||
@Output()
|
||||
nodeClick = new EventEmitter<NodeEntityEvent>();
|
||||
|
@@ -30,18 +30,19 @@ import { ContentNodeDialogService } from '../../content-node-selector/content-no
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class DocumentActionsService {
|
||||
|
||||
permissionEvent = new Subject<PermissionModel>();
|
||||
error = new Subject<Error>();
|
||||
success = new Subject<string>();
|
||||
|
||||
private handlers: { [id: string]: ContentActionHandler } = {};
|
||||
|
||||
constructor(private nodeActionsService: NodeActionsService,
|
||||
private contentNodeDialogService: ContentNodeDialogService,
|
||||
private translation: TranslationService,
|
||||
private documentListService?: DocumentListService,
|
||||
private contentService?: ContentService) {
|
||||
constructor(
|
||||
private nodeActionsService: NodeActionsService,
|
||||
private contentNodeDialogService: ContentNodeDialogService,
|
||||
private translation: TranslationService,
|
||||
private documentListService?: DocumentListService,
|
||||
private contentService?: ContentService
|
||||
) {
|
||||
this.setupActionHandlers();
|
||||
}
|
||||
|
||||
@@ -114,32 +115,34 @@ export class DocumentActionsService {
|
||||
}
|
||||
|
||||
private prepareHandlers(actionObservable: Subject<string>): void {
|
||||
actionObservable.subscribe(
|
||||
(fileOperationMessage) => {
|
||||
this.success.next(fileOperationMessage);
|
||||
},
|
||||
this.error.next.bind(this.error)
|
||||
);
|
||||
actionObservable.subscribe((fileOperationMessage) => {
|
||||
this.success.next(fileOperationMessage);
|
||||
}, this.error.next.bind(this.error));
|
||||
}
|
||||
|
||||
private deleteNode(node: NodeEntry, _target?: any, permission?: string): Observable<any> {
|
||||
if (this.canExecuteAction(node)) {
|
||||
if (this.contentService.hasAllowableOperations(node.entry, permission)) {
|
||||
const handlerObservable = this.documentListService.deleteNode(node.entry.id);
|
||||
handlerObservable.subscribe(() => {
|
||||
const message = this.translation.instant('CORE.DELETE_NODE.SINGULAR', { name: node.entry.name });
|
||||
this.success.next(message);
|
||||
}, () => {
|
||||
const message = this.translation.instant('CORE.DELETE_NODE.ERROR_SINGULAR', { name: node.entry.name });
|
||||
this.error.next(message);
|
||||
});
|
||||
handlerObservable.subscribe(
|
||||
() => {
|
||||
const message = this.translation.instant('CORE.DELETE_NODE.SINGULAR', { name: node.entry.name });
|
||||
this.success.next(message);
|
||||
},
|
||||
() => {
|
||||
const message = this.translation.instant('CORE.DELETE_NODE.ERROR_SINGULAR', { name: node.entry.name });
|
||||
this.error.next(message);
|
||||
}
|
||||
);
|
||||
return handlerObservable;
|
||||
} else {
|
||||
this.permissionEvent.next(new PermissionModel({
|
||||
type: 'content',
|
||||
action: 'delete',
|
||||
permission
|
||||
}));
|
||||
this.permissionEvent.next(
|
||||
new PermissionModel({
|
||||
type: 'content',
|
||||
action: 'delete',
|
||||
permission
|
||||
})
|
||||
);
|
||||
return throwError(new Error('No permission to delete'));
|
||||
}
|
||||
}
|
||||
|
@@ -32,21 +32,21 @@ import { NodeAction } from '../models/node-action.enum';
|
||||
})
|
||||
// eslint-disable-next-line @angular-eslint/directive-class-suffix
|
||||
export class NodeActionsService {
|
||||
|
||||
@Output()
|
||||
error = new EventEmitter<any>();
|
||||
|
||||
constructor(private contentDialogService: ContentNodeDialogService,
|
||||
public dialogRef: MatDialog,
|
||||
public content: ContentService,
|
||||
private documentListService?: DocumentListService,
|
||||
private apiService?: AlfrescoApiService,
|
||||
private dialog?: MatDialog,
|
||||
private downloadService?: DownloadService) {}
|
||||
constructor(
|
||||
private contentDialogService: ContentNodeDialogService,
|
||||
public dialogRef: MatDialog,
|
||||
public content: ContentService,
|
||||
private documentListService?: DocumentListService,
|
||||
private apiService?: AlfrescoApiService,
|
||||
private dialog?: MatDialog,
|
||||
private downloadService?: DownloadService
|
||||
) {}
|
||||
|
||||
downloadNode(node: NodeEntry) {
|
||||
new NodeDownloadDirective(this.apiService, this.downloadService, this.dialog)
|
||||
.downloadNode(node);
|
||||
new NodeDownloadDirective(this.apiService, this.downloadService, this.dialog).downloadNode(node);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -102,23 +102,29 @@ export class NodeActionsService {
|
||||
* @param permission permission which is needed to apply the action
|
||||
* @returns operation result
|
||||
*/
|
||||
private doFileOperation(action: NodeAction.COPY | NodeAction.MOVE, type: 'content' | 'folder', contentEntry: Node, permission?: string): Subject<string> {
|
||||
private doFileOperation(
|
||||
action: NodeAction.COPY | NodeAction.MOVE,
|
||||
type: 'content' | 'folder',
|
||||
contentEntry: Node,
|
||||
permission?: string
|
||||
): Subject<string> {
|
||||
const observable = new Subject<string>();
|
||||
|
||||
this.contentDialogService
|
||||
.openCopyMoveDialog(action, contentEntry, permission)
|
||||
.subscribe((selections: Node[]) => {
|
||||
this.contentDialogService.openCopyMoveDialog(action, contentEntry, permission).subscribe(
|
||||
(selections: Node[]) => {
|
||||
const selection = selections[0];
|
||||
this.documentListService[`${action.toLowerCase()}Node`].call(this.documentListService, contentEntry.id, selection.id)
|
||||
this.documentListService[`${action.toLowerCase()}Node`]
|
||||
.call(this.documentListService, contentEntry.id, selection.id)
|
||||
.subscribe(
|
||||
observable.next.bind(observable, `OPERATION.SUCCESS.${type.toUpperCase()}.${action}`),
|
||||
observable.error.bind(observable)
|
||||
observable.next.bind(observable, `OPERATION.SUCCESS.${type.toUpperCase()}.${action}`),
|
||||
observable.error.bind(observable)
|
||||
);
|
||||
},
|
||||
(error) => {
|
||||
observable.error(error);
|
||||
return observable;
|
||||
});
|
||||
}
|
||||
);
|
||||
return observable;
|
||||
}
|
||||
}
|
||||
|
@@ -51,6 +51,8 @@ $search-result-height: calc(100% - 60px);
|
||||
&-permission-search {
|
||||
&-input {
|
||||
width: 100%;
|
||||
padding-bottom: 0;
|
||||
padding-top: 12px;
|
||||
|
||||
#{$mat-form-field-wrapper} {
|
||||
#{$mat-form-field-flex} {
|
||||
@@ -73,7 +75,7 @@ $search-result-height: calc(100% - 60px);
|
||||
}
|
||||
}
|
||||
|
||||
.adf-permission-search-icon {
|
||||
.adf-permission-search-icon:is(mat-icon) {
|
||||
padding: 0 0 12px;
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
|
@@ -415,13 +415,13 @@ describe('SearchControlComponent', () => {
|
||||
it('should have positive transform translation', () => {
|
||||
userPreferencesService.setWithoutStore('textOrientation', 'ltr');
|
||||
fixture.detectChanges();
|
||||
expect(component.searchTextInput.subscriptAnimationState.params.transform).toBe('translateX(82%)');
|
||||
expect(component.searchTextInput.subscriptAnimationState.params.transform).toBe('translateX(95%)');
|
||||
});
|
||||
|
||||
it('should have negative transform translation ', () => {
|
||||
userPreferencesService.setWithoutStore('textOrientation', 'rtl');
|
||||
fixture.detectChanges();
|
||||
expect(component.searchTextInput.subscriptAnimationState.params.transform).toBe('translateX(-82%)');
|
||||
expect(component.searchTextInput.subscriptAnimationState.params.transform).toBe('translateX(-95%)');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import { ContentNodeSelectorPanelService } from '../../../content-node-selector/content-node-selector-panel.service';
|
||||
import { ContentNodeSelectorPanelService } from '../../../content-node-selector/content-node-selector-panel/content-node-selector-panel.service';
|
||||
import { SearchQueryBuilderService } from '../../services/search-query-builder.service';
|
||||
|
||||
@Component({
|
||||
|
@@ -1,18 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export * from './public-api';
|
@@ -1,20 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export * from './sites-dropdown.component';
|
||||
|
||||
export * from './sites-dropdown.module';
|
@@ -1,41 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { MaterialModule } from '../material.module';
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
|
||||
import { DropdownSitesComponent } from './sites-dropdown.component';
|
||||
import { CoreModule } from '@alfresco/adf-core';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
MaterialModule,
|
||||
FormsModule,
|
||||
ReactiveFormsModule,
|
||||
CoreModule
|
||||
],
|
||||
exports: [
|
||||
DropdownSitesComponent
|
||||
],
|
||||
declarations: [
|
||||
DropdownSitesComponent
|
||||
]
|
||||
})
|
||||
export class SitesDropdownModule {}
|
@@ -24,6 +24,7 @@
|
||||
[urlFile]="urlFileContent"
|
||||
[tracks]="tracks"
|
||||
[readOnly]="readOnly"
|
||||
[allowedEditActions]="allowedEditActions"
|
||||
[viewerExtensions]="viewerExtensions"
|
||||
(downloadFile)="onDownloadFile()"
|
||||
(navigateBefore)="onNavigateBeforeClick($event)"
|
||||
|
@@ -215,6 +215,10 @@ export class AlfrescoViewerComponent implements OnChanges, OnInit, OnDestroy {
|
||||
nodeEntry: NodeEntry;
|
||||
tracks: Track[] = [];
|
||||
readOnly: boolean = true;
|
||||
allowedEditActions: { [key: string]: boolean } = {
|
||||
rotate: true,
|
||||
crop: true
|
||||
};
|
||||
|
||||
sidebarRightTemplateContext: { node: Node } = { node: null };
|
||||
sidebarLeftTemplateContext: { node: Node } = { node: null };
|
||||
|
@@ -21,7 +21,6 @@ export * from './lib/document-list/index';
|
||||
export * from './lib/content-user-info/index';
|
||||
export * from './lib/upload/index';
|
||||
export * from './lib/search/index';
|
||||
export * from './lib/site-dropdown/index';
|
||||
export * from './lib/breadcrumb/index';
|
||||
export * from './lib/version-manager/index';
|
||||
export * from './lib/content-node-selector/index';
|
||||
|
@@ -65,8 +65,7 @@
|
||||
"demo-shell/src/styles.scss",
|
||||
"demo-shell/src/custom-style-dev.scss",
|
||||
"node_modules/cropperjs/dist/cropper.min.css",
|
||||
"node_modules/pdfjs-dist/web/pdf_viewer.css",
|
||||
|
||||
"node_modules/pdfjs-dist/web/pdf_viewer.css"
|
||||
],
|
||||
"stylePreprocessorOptions": {
|
||||
"includePaths": ["lib", "lib/core/src/lib"]
|
||||
|
@@ -1,124 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { applicationConfig, Meta, moduleMetadata, StoryFn } from '@storybook/angular';
|
||||
import { ButtonsMenuComponent } from './buttons-menu.component';
|
||||
import { ButtonsMenuModule } from './buttons-menu.module';
|
||||
import { importProvidersFrom } from '@angular/core';
|
||||
import { CoreStoryModule } from '../../..';
|
||||
|
||||
export default {
|
||||
component: ButtonsMenuComponent,
|
||||
title: 'Core/Buttons Menu/Buttons Menu',
|
||||
decorators: [
|
||||
moduleMetadata({
|
||||
imports: [ButtonsMenuModule]
|
||||
}),
|
||||
applicationConfig({
|
||||
providers: [importProvidersFrom(CoreStoryModule)]
|
||||
})
|
||||
],
|
||||
argTypes: {
|
||||
mobile: {
|
||||
type: { name: 'boolean' },
|
||||
name: 'isMobile',
|
||||
description: 'Determines whether it is displayed on a mobile device',
|
||||
control: {
|
||||
disable: false
|
||||
},
|
||||
table: {
|
||||
category: 'Component methods',
|
||||
type: {
|
||||
summary: '() => boolean'
|
||||
}
|
||||
}
|
||||
},
|
||||
isMenuEmpty: {
|
||||
description: 'Determines whether it has anything to display',
|
||||
table: {
|
||||
category: 'Component properties',
|
||||
type: {
|
||||
summary: 'boolean'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
args: {
|
||||
mobile: true
|
||||
}
|
||||
} as Meta<ButtonsMenuComponent>;
|
||||
|
||||
export const SixButtons: StoryFn = (args) => ({
|
||||
props: {
|
||||
...args,
|
||||
isMenuEmpty: false,
|
||||
isMobile() {
|
||||
return args.mobile;
|
||||
}
|
||||
},
|
||||
template: `
|
||||
<adf-buttons-action-menu>
|
||||
<button mat-menu-item>
|
||||
<mat-icon>settings</mat-icon><span> Settings </span>
|
||||
</button>
|
||||
<button mat-menu-item>
|
||||
<mat-icon>home</mat-icon><span> Home </span>
|
||||
</button>
|
||||
<button mat-menu-item>
|
||||
<mat-icon>search</mat-icon><span> Search </span>
|
||||
</button>
|
||||
<button mat-menu-item>
|
||||
<mat-icon>done</mat-icon><span> Done </span>
|
||||
</button>
|
||||
<button mat-menu-item>
|
||||
<mat-icon>delete</mat-icon><span> Delete </span>
|
||||
</button>
|
||||
<button mat-menu-item>
|
||||
<mat-icon>block</mat-icon><span> Block </span>
|
||||
</button>
|
||||
</adf-buttons-action-menu>
|
||||
`
|
||||
});
|
||||
|
||||
export const OneButton: StoryFn = (args) => ({
|
||||
props: {
|
||||
...args,
|
||||
isMenuEmpty: false,
|
||||
isMobile() {
|
||||
return args.mobile;
|
||||
}
|
||||
},
|
||||
template: `
|
||||
<adf-buttons-action-menu>
|
||||
<button mat-menu-item>
|
||||
<mat-icon>settings</mat-icon><span> Settings </span>
|
||||
</button>
|
||||
</adf-buttons-action-menu>
|
||||
`
|
||||
});
|
||||
|
||||
export const NoButtons: StoryFn = (args) => ({
|
||||
props: {
|
||||
...args,
|
||||
isMenuEmpty: true,
|
||||
isMobile() {
|
||||
return args.mobile;
|
||||
}
|
||||
},
|
||||
template: `
|
||||
<adf-buttons-action-menu></adf-buttons-action-menu>`
|
||||
});
|
@@ -1,36 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatMenuModule } from '@angular/material/menu';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { ButtonsMenuComponent } from './buttons-menu.component';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
MatIconModule,
|
||||
MatMenuModule,
|
||||
TranslateModule
|
||||
],
|
||||
declarations: [ButtonsMenuComponent],
|
||||
exports: [ButtonsMenuComponent, MatIconModule, MatMenuModule, MatButtonModule]
|
||||
})
|
||||
export class ButtonsMenuModule {}
|
@@ -1,18 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export * from './public-api';
|
@@ -1,19 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export * from './buttons-menu.component';
|
||||
export * from './buttons-menu.module';
|
@@ -30,6 +30,7 @@
|
||||
padding: 6px 0 8px 12px;
|
||||
margin-top: 0;
|
||||
border-radius: 6px;
|
||||
width: 90%;
|
||||
|
||||
#{$mat-select-value} {
|
||||
color: var(--adf-metadata-action-button-clear-color);
|
||||
|
@@ -35,7 +35,6 @@ import { FormBaseModule } from './form/form-base.module';
|
||||
import { SidenavLayoutModule } from './layout/layout.module';
|
||||
import { CommentsModule } from './comments/comments.module';
|
||||
import { CommentListModule } from './comments/comment-list/comment-list.module';
|
||||
import { ButtonsMenuModule } from './buttons-menu/buttons-menu.module';
|
||||
import { TemplateModule } from './templates/template.module';
|
||||
import { ClipboardModule } from './clipboard/clipboard.module';
|
||||
import { NotificationHistoryModule } from './notifications/notification-history.module';
|
||||
@@ -95,7 +94,6 @@ import { DynamicChipListModule } from './dynamic-chip-list';
|
||||
LanguageMenuModule,
|
||||
InfoDrawerModule,
|
||||
DataTableModule,
|
||||
ButtonsMenuModule,
|
||||
TemplateModule,
|
||||
IconModule,
|
||||
SortingPickerModule,
|
||||
@@ -135,7 +133,6 @@ import { DynamicChipListModule } from './dynamic-chip-list';
|
||||
InfoDrawerModule,
|
||||
DataTableModule,
|
||||
TranslateModule,
|
||||
ButtonsMenuModule,
|
||||
TemplateModule,
|
||||
SortingPickerModule,
|
||||
IconModule,
|
||||
|
@@ -185,7 +185,8 @@
|
||||
<label *ngIf="multiselect" [for]="'select-file-' + idx" class="adf-datatable-cell adf-datatable-checkbox-cell adf-datatable-checkbox-single">
|
||||
<mat-checkbox
|
||||
[id]="'select-file-' + idx"
|
||||
[class.adf-datatable-checkbox-selected]="row.isSelected"
|
||||
[class.adf-datatable-checkbox-selected]="row.isSelected"
|
||||
[class.adf-datatable-hover-only]="displayCheckboxesOnHover"
|
||||
[checked]="row.isSelected"
|
||||
[attr.aria-checked]="row.isSelected"
|
||||
role="checkbox"
|
||||
|
@@ -160,17 +160,15 @@ $data-table-cell-min-width-file-size: $data-table-cell-min-width-1 !default;
|
||||
align-items: center;
|
||||
|
||||
&:hover {
|
||||
.adf-datatable-checkbox-cell {
|
||||
&.adf-datatable-checkbox-single {
|
||||
visibility: visible;
|
||||
}
|
||||
.adf-datatable-hover-only {
|
||||
visibility: visible;
|
||||
}
|
||||
}
|
||||
|
||||
.adf-datatable-checkbox-single {
|
||||
.adf-datatable-hover-only {
|
||||
visibility: hidden;
|
||||
|
||||
&:has(.adf-datatable-checkbox-selected) {
|
||||
&.adf-datatable-checkbox-selected {
|
||||
visibility: visible;
|
||||
}
|
||||
}
|
||||
@@ -453,6 +451,8 @@ $data-table-cell-min-width-file-size: $data-table-cell-min-width-1 !default;
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* stylelint-disable media-feature-range-notation */
|
||||
|
||||
/* mobile phone */
|
||||
@media all and (max-width: 768px) {
|
||||
.adf-desktop-only.adf-ellipsis-cell {
|
||||
@@ -578,6 +578,7 @@ $data-table-cell-min-width-file-size: $data-table-cell-min-width-1 !default;
|
||||
}
|
||||
}
|
||||
|
||||
/* stylelint-disable selector-class-pattern */
|
||||
.cdk-drag-preview {
|
||||
&.adf-datatable-cell-header {
|
||||
border-radius: 6px;
|
||||
@@ -641,7 +642,7 @@ $data-table-cell-min-width-file-size: $data-table-cell-min-width-1 !default;
|
||||
align-items: center;
|
||||
height: inherit;
|
||||
|
||||
.adf-datatable-body[role="rowgroup"] {
|
||||
.adf-datatable-body[role='rowgroup'] {
|
||||
.adf-datatable-row {
|
||||
height: 100%;
|
||||
background-color: var(--adf-theme-background-card-color);
|
||||
|
@@ -1329,6 +1329,36 @@ describe('DataTable', () => {
|
||||
expect(rows[1].getValue('icon')).toBe('directions_car');
|
||||
expect(rows[2].getValue('icon')).toBe('local_shipping');
|
||||
});
|
||||
|
||||
describe('displayCheckboxesOnHover', () => {
|
||||
const getCheckboxes = () =>
|
||||
fixture.debugElement.queryAll(By.css('.adf-datatable-checkbox-single .adf-checkbox-sr-only')).map((row) => row.nativeElement);
|
||||
|
||||
beforeEach(() => {
|
||||
dataTable.data = new ObjectDataTableAdapter([{ name: '1' }, { name: '2' }], [new ObjectDataColumn({ key: 'name' })]);
|
||||
dataTable.multiselect = true;
|
||||
});
|
||||
|
||||
it('should always display checkboxes when displayCheckboxesOnHover is set to false', () => {
|
||||
dataTable.displayCheckboxesOnHover = false;
|
||||
fixture.detectChanges();
|
||||
|
||||
const checkboxes = getCheckboxes();
|
||||
checkboxes.forEach((checkbox) => {
|
||||
expect(checkbox.classList).not.toContain('adf-datatable-hover-only');
|
||||
});
|
||||
});
|
||||
|
||||
it('should display checkboxes on hover when displayCheckboxesOnHover is set to true', () => {
|
||||
dataTable.displayCheckboxesOnHover = true;
|
||||
fixture.detectChanges();
|
||||
|
||||
const checkboxes = getCheckboxes();
|
||||
checkboxes.forEach((checkbox) => {
|
||||
expect(checkbox.classList).toContain('adf-datatable-hover-only');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('Accesibility', () => {
|
||||
|
@@ -238,6 +238,12 @@ export class DataTableComponent implements OnInit, AfterContentInit, OnChanges,
|
||||
@Input()
|
||||
blurOnResize = true;
|
||||
|
||||
/**
|
||||
* Flag that indicates if selection checkboxes inside row should be displayed on hover only.
|
||||
*/
|
||||
@Input()
|
||||
displayCheckboxesOnHover = false;
|
||||
|
||||
headerFilterTemplate: TemplateRef<any>;
|
||||
noContentTemplate: TemplateRef<any>;
|
||||
noPermissionTemplate: TemplateRef<any>;
|
||||
|
@@ -206,7 +206,7 @@ describe('SearchTextInputComponent', () => {
|
||||
fixture.detectChanges();
|
||||
tick(100);
|
||||
|
||||
expect(component.subscriptAnimationState.params).toEqual({ transform: 'translateX(82%)' });
|
||||
expect(component.subscriptAnimationState.params).toEqual({ transform: 'translateX(95%)' });
|
||||
discardPeriodicTasks();
|
||||
}));
|
||||
|
||||
@@ -237,7 +237,7 @@ describe('SearchTextInputComponent', () => {
|
||||
fixture.detectChanges();
|
||||
tick(100);
|
||||
|
||||
expect(component.subscriptAnimationState.params).toEqual({ transform: 'translateX(-82%)' });
|
||||
expect(component.subscriptAnimationState.params).toEqual({ transform: 'translateX(-95%)' });
|
||||
discardPeriodicTasks();
|
||||
}));
|
||||
|
||||
|
@@ -33,14 +33,14 @@
|
||||
<mat-icon>zoom_in</mat-icon>
|
||||
</button>
|
||||
|
||||
<button *ngIf="!readOnly" id="viewer-rotate-button"
|
||||
<button *ngIf="!readOnly && allowedEditActions.rotate" id="viewer-rotate-button"
|
||||
title="{{ 'ADF_VIEWER.ARIA.ROTATE' | translate }}"
|
||||
attr.aria-label="{{ 'ADF_VIEWER.ARIA.ROTATE' | translate }}"
|
||||
mat-icon-button
|
||||
(click)="rotateImage()">
|
||||
<mat-icon>rotate_left</mat-icon>
|
||||
</button>
|
||||
<button *ngIf="!readOnly" id="viewer-crop-button"
|
||||
<button *ngIf="!readOnly && allowedEditActions.crop" id="viewer-crop-button"
|
||||
title="{{ 'ADF_VIEWER.ARIA.CROP' | translate }}"
|
||||
attr.aria-label="{{ 'ADF_VIEWER.ARIA.CROP' | translate }}"
|
||||
mat-icon-button
|
||||
@@ -58,7 +58,7 @@
|
||||
|
||||
</adf-toolbar>
|
||||
|
||||
<adf-toolbar class="adf-secondary-toolbar" *ngIf="!readOnly && isEditing">
|
||||
<adf-toolbar class="adf-secondary-toolbar" *ngIf="isEditing && !readOnly">
|
||||
<button id="viewer-cancel-button"
|
||||
title="{{ 'ADF_VIEWER.ARIA.CANCEL' | translate }}"
|
||||
attr.aria-label="{{ 'ADF_VIEWER.ARIA.CANCEL' | translate }}"
|
||||
|
@@ -370,4 +370,36 @@ describe('Test Img viewer component ', () => {
|
||||
expect(component.reset).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
describe('allowedEditActions', () => {
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(ImgViewerComponent);
|
||||
element = fixture.nativeElement;
|
||||
component = fixture.componentInstance;
|
||||
});
|
||||
|
||||
it('should conditionally display rotate and crop buttons based on allowedEditActions', () => {
|
||||
component.readOnly = false;
|
||||
component.allowedEditActions = { rotate: true, crop: true };
|
||||
fixture.detectChanges();
|
||||
|
||||
let rotateButton = element.querySelector('#viewer-rotate-button');
|
||||
let cropButton = element.querySelector('#viewer-crop-button');
|
||||
|
||||
// Check both buttons are visible when allowed
|
||||
expect(rotateButton).not.toBeNull('Rotate button should be visible when allowed');
|
||||
expect(cropButton).not.toBeNull('Crop button should be visible when allowed');
|
||||
|
||||
// Change allowedEditActions to disallow both actions
|
||||
component.allowedEditActions = { rotate: false, crop: false };
|
||||
fixture.detectChanges();
|
||||
|
||||
rotateButton = element.querySelector('#viewer-rotate-button');
|
||||
cropButton = element.querySelector('#viewer-crop-button');
|
||||
|
||||
// Check both buttons are not visible when not allowed
|
||||
expect(rotateButton).toBeNull('Rotate button should not be visible when disallowed');
|
||||
expect(cropButton).toBeNull('Crop button should not be visible when disallowed');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -54,6 +54,12 @@ export class ImgViewerComponent implements AfterViewInit, OnChanges, OnDestroy {
|
||||
@Input()
|
||||
readOnly = true;
|
||||
|
||||
@Input()
|
||||
allowedEditActions: { [key: string]: boolean } = {
|
||||
rotate: true,
|
||||
crop: true
|
||||
};
|
||||
|
||||
@Input()
|
||||
urlFile: string;
|
||||
|
||||
|
@@ -44,6 +44,7 @@
|
||||
<adf-img-viewer [urlFile]="urlFile"
|
||||
[readOnly]="readOnly"
|
||||
[fileName]="internalFileName"
|
||||
[allowedEditActions]="allowedEditActions"
|
||||
[blobFile]="blobFile"
|
||||
(error)="onUnsupportedFile()"
|
||||
(submit)="onSubmitFile($event)"
|
||||
|
@@ -95,6 +95,17 @@ export class ViewerRenderComponent implements OnChanges, OnInit, OnDestroy {
|
||||
@Input()
|
||||
readOnly = true;
|
||||
|
||||
/**
|
||||
* Controls which actions are enabled in the viewer.
|
||||
* Example:
|
||||
* { rotate: true, crop: false } will enable rotation but disable cropping.
|
||||
*/
|
||||
@Input()
|
||||
allowedEditActions: { [key: string]: boolean } = {
|
||||
rotate: true,
|
||||
crop: true
|
||||
};
|
||||
|
||||
/** media subtitles for the media player*/
|
||||
@Input()
|
||||
tracks: Track[] = [];
|
||||
|
@@ -167,6 +167,7 @@
|
||||
[blobFile]="blobFile"
|
||||
[readOnly]="readOnly"
|
||||
(submitFile)="onSubmitFile($event)"
|
||||
[allowedEditActions]="allowedEditActions"
|
||||
[urlFile]="urlFile"
|
||||
(isSaving)="allowNavigate = !$event"
|
||||
[tracks]="tracks"
|
||||
|
@@ -189,6 +189,17 @@ export class ViewerComponent<T> implements OnDestroy, OnInit, OnChanges {
|
||||
@Input()
|
||||
readOnly = true;
|
||||
|
||||
/**
|
||||
* Controls which actions are enabled in the viewer.
|
||||
* Example:
|
||||
* { rotate: true, crop: false } will enable rotation but disable cropping.
|
||||
*/
|
||||
@Input()
|
||||
allowedEditActions: { [key: string]: boolean } = {
|
||||
rotate: true,
|
||||
crop: true
|
||||
};
|
||||
|
||||
/** media subtitles for the media player*/
|
||||
@Input()
|
||||
tracks: Track[] = [];
|
||||
|
@@ -32,7 +32,6 @@ export * from './lib/app-config/index';
|
||||
export * from './lib/form/index';
|
||||
export * from './lib/layout/index';
|
||||
export * from './lib/comments/index';
|
||||
export * from './lib/buttons-menu/index';
|
||||
export * from './lib/sorting-picker/index';
|
||||
export * from './lib/templates/index';
|
||||
export * from './lib/pipes/index';
|
||||
|
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "extensions",
|
||||
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||
"sourceRoot": "lib/extensions",
|
||||
"sourceRoot": "lib/extensions/src",
|
||||
"projectType": "library",
|
||||
"prefix": "adf",
|
||||
"targets": {
|
||||
|
@@ -7,6 +7,10 @@
|
||||
"extends": [
|
||||
"plugin:@nrwl/nx/angular"
|
||||
],
|
||||
"parserOptions": {
|
||||
"project": ["lib/insights/tsconfig.lib.json", "lib/insights/tsconfig.spec.json"],
|
||||
"createDefaultProgram": true
|
||||
},
|
||||
"rules": {
|
||||
"no-underscore-dangle": ["error", { "allowAfterThis": true }],
|
||||
"@angular-eslint/no-output-native": "off",
|
||||
@@ -74,6 +78,10 @@
|
||||
{
|
||||
"files": ["*.html"],
|
||||
"extends": ["plugin:@nrwl/nx/angular-template"],
|
||||
"parserOptions": {
|
||||
"project": ["lib/insights/tsconfig.lib.json", "lib/insights/tsconfig.spec.json"],
|
||||
"createDefaultProgram": true
|
||||
},
|
||||
"rules": {
|
||||
"@angular-eslint/template/no-autofocus": "error",
|
||||
"@angular-eslint/template/no-positive-tabindex": "error"
|
||||
|
@@ -2,19 +2,17 @@
|
||||
Title: Buttons Menu Component
|
||||
Added: v2.4.0
|
||||
Status: Active
|
||||
Last reviewed: 2018-06-08
|
||||
Last reviewed: 2024-06-21
|
||||
---
|
||||
|
||||
# [Buttons Menu Component](../../../lib/core/src/lib/buttons-menu/buttons-menu.component.ts "Defined in buttons-menu.component.ts")
|
||||
# Buttons Menu Component
|
||||
|
||||
Displays buttons on a responsive menu.
|
||||
|
||||

|
||||

|
||||
|
||||
## Basic Usage
|
||||
|
||||
### [Transclusions](../../user-guide/transclusion.md)
|
||||
|
||||
Place the buttons for the menu inside this component's HTML tags.
|
||||
They must use the following structure:
|
||||
|
||||
@@ -42,16 +40,16 @@ They also make use of the Angular material directive `mat-menu-item`.
|
||||
|
||||
## Details
|
||||
|
||||
This component is fully responsive and it will display one of two different layouts
|
||||
This component is fully responsive, and it will display one of two different layouts
|
||||
depending on the screen size:
|
||||
|
||||
**Desktop View**
|
||||
|
||||

|
||||

|
||||
|
||||
**Mobile View**
|
||||
|
||||

|
||||

|
||||
|
||||
The component has a property called `isMenuEmpty` that you can access from code. If this is
|
||||
set to true then the component will not show an empty menu with no buttons defined.
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 8.8 KiB After Width: | Height: | Size: 8.8 KiB |
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AdfDateFnsAdapter, ButtonsMenuModule, DownloadService, ToolbarComponent, ToolbarTitleComponent } from '@alfresco/adf-core';
|
||||
import { AdfDateFnsAdapter, DownloadService, ToolbarComponent, ToolbarTitleComponent } from '@alfresco/adf-core';
|
||||
import {
|
||||
AfterContentChecked,
|
||||
Component,
|
||||
@@ -45,6 +45,7 @@ import { MatInputModule } from '@angular/material/input';
|
||||
import { MatMenuModule } from '@angular/material/menu';
|
||||
import { WIDGET_DIRECTIVES } from './widgets';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { ButtonsMenuComponent } from './buttons-menu/buttons-menu.component';
|
||||
|
||||
const FORMAT_DATE_ACTIVITI = 'YYYY-MM-DD';
|
||||
|
||||
@@ -113,15 +114,15 @@ export interface ReportFormValues {
|
||||
MatIconModule,
|
||||
ReactiveFormsModule,
|
||||
ToolbarComponent,
|
||||
ToolbarTitleComponent,
|
||||
MatFormFieldModule,
|
||||
MatInputModule,
|
||||
MatMenuModule,
|
||||
ToolbarTitleComponent,
|
||||
...WIDGET_DIRECTIVES,
|
||||
MatDialogModule,
|
||||
FormsModule,
|
||||
MatButtonModule,
|
||||
ButtonsMenuModule
|
||||
ButtonsMenuComponent
|
||||
],
|
||||
templateUrl: './analytics-report-parameters.component.html',
|
||||
styleUrls: ['./analytics-report-parameters.component.scss'],
|
||||
|
@@ -16,15 +16,19 @@
|
||||
*/
|
||||
|
||||
import { TestBed, ComponentFixture } from '@angular/core/testing';
|
||||
import { MaterialModule } from '../material.module';
|
||||
import { CUSTOM_ELEMENTS_SCHEMA, Component } from '@angular/core';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { Component } from '@angular/core';
|
||||
import { ButtonsMenuComponent } from '@alfresco/adf-insights';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { MatMenuModule } from '@angular/material/menu';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-custom-container',
|
||||
standalone: true,
|
||||
imports: [CommonModule, ButtonsMenuComponent, MatMenuModule, MatIconModule],
|
||||
template: `
|
||||
<adf-buttons-action-menu>
|
||||
<button mat-menu-item (click)="assignValue()"><mat-icon>settings</mat-icon><span> Button </span></button>
|
||||
<button mat-menu-item (click)="assignValue()"><mat-icon>settings</mat-icon><span>Button</span></button>
|
||||
</adf-buttons-action-menu>
|
||||
`
|
||||
})
|
||||
@@ -50,9 +54,7 @@ describe('ButtonsMenuComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [TranslateModule.forRoot()],
|
||||
declarations: [CustomContainerComponent],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
imports: [ButtonsMenuComponent, CustomContainerComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(CustomContainerComponent);
|
||||
element = fixture.debugElement.nativeElement;
|
||||
@@ -93,9 +95,8 @@ describe('ButtonsMenuComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [TranslateModule.forRoot(), MaterialModule],
|
||||
declarations: [CustomEmptyContainerComponent],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
imports: [ButtonsMenuComponent],
|
||||
declarations: [CustomEmptyContainerComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(CustomEmptyContainerComponent);
|
||||
element = fixture.nativeElement;
|
@@ -16,17 +16,20 @@
|
||||
*/
|
||||
|
||||
import { Component, ContentChildren, QueryList, AfterContentInit, ViewEncapsulation } from '@angular/core';
|
||||
import { MatMenuItem } from '@angular/material/menu';
|
||||
import { MatMenuItem, MatMenuModule } from '@angular/material/menu';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { CommonModule } from '@angular/common';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-buttons-action-menu',
|
||||
standalone: true,
|
||||
imports: [CommonModule, MatButtonModule, MatMenuModule, MatIconModule],
|
||||
templateUrl: './buttons-menu.component.html',
|
||||
styleUrls: ['./buttons-menu.component.scss'],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
|
||||
export class ButtonsMenuComponent implements AfterContentInit {
|
||||
|
||||
export class ButtonsMenuComponent implements AfterContentInit {
|
||||
@ContentChildren(MatMenuItem) buttons: QueryList<MatMenuItem>;
|
||||
|
||||
isMenuEmpty: boolean;
|
@@ -21,6 +21,7 @@ import { AnalyticsReportListComponent } from './components/analytics-report-list
|
||||
import { AnalyticsReportParametersComponent } from './components/analytics-report-parameters.component';
|
||||
import { AnalyticsGeneratorComponent } from './components/analytics-generator.component';
|
||||
import { AnalyticsReportHeatMapComponent } from './components/analytics-report-heat-map.component';
|
||||
import { ButtonsMenuComponent } from './components/buttons-menu/buttons-menu.component';
|
||||
|
||||
export * from './components/analytics.component';
|
||||
export * from './components/analytics-report-heat-map.component';
|
||||
@@ -28,12 +29,14 @@ export * from './components/analytics-generator.component';
|
||||
export * from './components/analytics-report-list.component';
|
||||
export * from './components/analytics-report-parameters.component';
|
||||
export * from './components/analytics.component';
|
||||
export * from './components/buttons-menu/buttons-menu.component';
|
||||
|
||||
export * from './services/analytics.service';
|
||||
export * from './components/widgets';
|
||||
|
||||
export const ANALYTICS_PROCESS_DIRECTIVES = [
|
||||
...WIDGET_DIRECTIVES,
|
||||
ButtonsMenuComponent,
|
||||
AnalyticsComponent,
|
||||
AnalyticsReportListComponent,
|
||||
AnalyticsReportParametersComponent,
|
||||
|
191
package-lock.json
generated
191
package-lock.json
generated
@@ -190,6 +190,16 @@
|
||||
"resolved": "lib/eslint-angular",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@alfresco/js-api": {
|
||||
"version": "7.9.0-9321526184",
|
||||
"resolved": "https://registry.npmjs.org/@alfresco/js-api/-/js-api-7.9.0-9321526184.tgz",
|
||||
"integrity": "sha512-VFN/DyWrUCUuZ1RMSKJp2MbPdoRDtffZo6rXnuTooNxvwyF/mr9VtkMM+JSp1Eo3r9oMRipr0BcNN8Hy1hKing==",
|
||||
"dependencies": {
|
||||
"event-emitter": "^0.3.5",
|
||||
"superagent": "^9.0.1",
|
||||
"tslib": "^2.6.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@ampproject/remapping": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz",
|
||||
@@ -2171,6 +2181,109 @@
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helper-optimise-call-expression": {
|
||||
"version": "7.22.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.22.5.tgz",
|
||||
"integrity": "sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.22.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helper-plugin-utils": {
|
||||
"version": "7.24.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.0.tgz",
|
||||
"integrity": "sha512-9cUznXMG0+FxRuJfvL82QlTqIzhVW9sL0KjMPHhAOOvpQGL8QtdxnBKILjBqxlHyliz0yCa1G903ZXI/FuHy2w==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helper-remap-async-to-generator": {
|
||||
"version": "7.22.20",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.22.20.tgz",
|
||||
"integrity": "sha512-pBGyV4uBqOns+0UvhsTO8qgl8hO89PmiDYv+/COyp1aeMcmfrfruz+/nCMFiYyFF/Knn0yfrC85ZzNFjembFTw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/helper-annotate-as-pure": "^7.22.5",
|
||||
"@babel/helper-environment-visitor": "^7.22.20",
|
||||
"@babel/helper-wrap-function": "^7.22.20"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helper-remap-async-to-generator/node_modules/@babel/helper-annotate-as-pure": {
|
||||
"version": "7.22.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz",
|
||||
"integrity": "sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.22.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helper-replace-supers": {
|
||||
"version": "7.24.1",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.24.1.tgz",
|
||||
"integrity": "sha512-QCR1UqC9BzG5vZl8BMicmZ28RuUBnHhAMddD8yHFHDRH9lLTZ9uUPehX8ctVPT8l0TKblJidqcgUUKGVrePleQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/helper-environment-visitor": "^7.22.20",
|
||||
"@babel/helper-member-expression-to-functions": "^7.23.0",
|
||||
"@babel/helper-optimise-call-expression": "^7.22.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helper-simple-access": {
|
||||
"version": "7.22.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz",
|
||||
"integrity": "sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.22.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helper-skip-transparent-expression-wrappers": {
|
||||
"version": "7.22.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.22.5.tgz",
|
||||
"integrity": "sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.22.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helper-split-export-declaration": {
|
||||
"version": "7.18.6",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz",
|
||||
"integrity": "sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.18.6"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helper-string-parser": {
|
||||
"version": "7.24.7",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.7.tgz",
|
||||
@@ -8497,10 +8610,7 @@
|
||||
"color-convert": "^2.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/@nrwl/node/node_modules/chalk": {
|
||||
@@ -8508,27 +8618,28 @@
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
|
||||
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"ansi-styles": "^4.1.0",
|
||||
"supports-color": "^7.1.0"
|
||||
},
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/chalk/chalk?sponsor=1"
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/@nrwl/node/node_modules/color-convert": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
|
||||
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
|
||||
"node_modules/@nrwl/nx-win32-arm64-msvc": {
|
||||
"version": "15.9.7",
|
||||
"resolved": "https://registry.npmjs.org/@nrwl/nx-win32-arm64-msvc/-/nx-win32-arm64-msvc-15.9.7.tgz",
|
||||
"integrity": "sha512-GSQ54hJ5AAnKZb4KP4cmBnJ1oC4ILxnrG1mekxeM65c1RtWg9NpBwZ8E0gU3xNrTv8ZNsBeKi/9UhXBxhsIh8A==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"color-name": "~1.1.4"
|
||||
},
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=7.0.0"
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/@nrwl/node/node_modules/color-name": {
|
||||
@@ -24141,6 +24252,15 @@
|
||||
"integrity": "sha512-iKuQcq+NdHqlAcwUY0o/HL69XQrUaQdMjmStJ8JFmUaiiQErlhrmuigkg/CU4E2J0IyUKUrMAgl36TvN67MqTw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/csso/node_modules/source-map": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
||||
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/cssstyle": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-4.0.1.tgz",
|
||||
@@ -25647,37 +25767,6 @@
|
||||
"node": ">=0.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/escodegen": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz",
|
||||
"integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"esprima": "^4.0.1",
|
||||
"estraverse": "^5.2.0",
|
||||
"esutils": "^2.0.2"
|
||||
},
|
||||
"bin": {
|
||||
"escodegen": "bin/escodegen.js",
|
||||
"esgenerate": "bin/esgenerate.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"source-map": "~0.6.1"
|
||||
}
|
||||
},
|
||||
"node_modules/escodegen/node_modules/source-map": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
||||
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint": {
|
||||
"version": "8.57.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz",
|
||||
|
Reference in New Issue
Block a user