Skip to content

Commit

Permalink
[AAE-10777] Move in common service the real common services (#8203)
Browse files Browse the repository at this point in the history
* Move in common service the real common services
remove Pagination js-api dependencies
move search-input component in content

* fix unit

* fix lint

* fix

* fix
  • Loading branch information
eromano authored Jan 30, 2023
1 parent 89b79c9 commit 4f25426
Show file tree
Hide file tree
Showing 105 changed files with 156 additions and 381 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/

import { QueryBody } from '@alfresco/js-api';
import { SearchConfigurationInterface } from '@alfresco/adf-core';
import { SearchConfigurationInterface } from '@alfresco/adf-content-services';
import { Injectable } from '@angular/core';

@Injectable()
Expand Down
10 changes: 5 additions & 5 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ for more information about installing and using the source code.
| The main purpose of the Notification history component is list all the notification received in the current session. They will disappear from the list after the refresh. | [Source](../lib/core/src/lib/notifications/components/notification-history.component.ts) | |
| [Pagination Component](core/components/pagination.component.md) | Adds pagination to the component it is used with. | [Source](../lib/core/src/lib/pagination/pagination.component.ts) |
| [Rich Text Editor component](core/components/rich-text-editor.md) | Wrap Editor.js element to show a Rich Text editor allows to add formatted text. | [Source](../lib/core/src/lib/rich-text-editor/rich-text-editor.component.ts) |
| [Search Text Input Component](core/components/search-text-input.component.md) | Displays a input text that supports autocompletion | [Source](../lib/core/src/lib/search-text/search-text-input.component.ts) |
| [Search Text Input Component](core/components/search-text-input.component.md) | Displays a input text that supports autocompletion | [Source](lib/content-services/src/lib/search-text/search-text-input.component.ts) |
| [Sidebar action menu component](core/components/sidebar-action-menu.component.md) | Displays a sidebar-action menu information panel. | [Source](../lib/core/src/lib/layout/components/sidebar-action/sidebar-action-menu.component.ts) |
| [Sidenav Layout component](core/components/sidenav-layout.component.md) | Displays the standard three-region ADF application layout. | [Source](../lib/core/src/lib/layout/components/sidenav-layout/sidenav-layout.component.ts) |
| [Snackbar Content Component](core/components/snackbar-content.component.md) | Custom content for Snackbar which allows use icon as action. | [Source](../lib/core/src/lib/snackbar-content/snackbar-content.component.ts) |
Expand Down Expand Up @@ -213,7 +213,7 @@ for more information about installing and using the source code.
| [Favorites Api service](core/services/favorites-api.service.md) | Gets a list of items a user has marked as their favorites. | [Source](lib/content-services/src/lib/common/services/favorites-api.service.ts) |
| [Form Rendering service](core/services/form-rendering.service.md) | Maps a form field type string onto the corresponding form widget component type. | [Source](../lib/core/form/services/form-rendering.service.ts) |
| [Form service](core/services/form.service.md) | Implements Process Services form methods | [Source](../lib/core/src/lib/form/services/form.service.ts) |
| [Highlight Transform service](core/services/highlight-transform.service.md) | Adds HTML to a string to highlight chosen sections. | [Source](../lib/core/src/lib/services/highlight-transform.service.ts) |
| [Highlight Transform service](core/services/highlight-transform.service.md) | Adds HTML to a string to highlight chosen sections. | [Source](lib/core/src/lib/common/services/highlight-transform.service.ts) |
| [Identity Group service](core/services/identity-group.service.md) | Performs CRUD operations on identity groups. | [Source](../lib/process-services-cloud/src/lib/group/services/identity-group.service.ts) |
| [Identity role service](core/services/identity-role.service.md) | Provides APIs for working with the Roles in Identity Services. | [Source](../lib/core/src/lib/auth/services/identity-role.service.ts) |
| [Identity user service](core/services/identity-user.service.md) | Gets OAuth2 personal details and roles for users and performs CRUD operations on identity users. | [Source](../lib/process-services-cloud/src/lib/people/services/identity-user.service.ts) |
Expand All @@ -222,7 +222,7 @@ for more information about installing and using the source code.
| [Login Dialog service](core/services/login-dialog.service.md) | Manages login dialogs. | [Source](../lib/core/src/lib/services/login-dialog.service.ts) |
| [Nodes Api service](core/services/nodes-api.service.md) | Accesses and manipulates ACS document nodes using their node IDs. | [Source](../lib/core/src/lib/services/nodes-api.service.ts) |
| [Notification Service](core/services/notification.service.md) | Shows a notification message with optional feedback. | [Source](../lib/core/src/lib/notifications/services/notification.service.ts) |
| [Page Title service](core/services/page-title.service.md) | Sets the page title. | [Source](../lib/core/src/lib/services/page-title.service.ts) |
| [Page Title service](core/services/page-title.service.md) | Sets the page title. | [Source](lib/core/src/lib/common/services/page-title.service.ts) |
| [People Content service](core/services/people-content.service.md) | Gets information about a Content Services user. | [Source](../lib/core/src/lib/services/people-content.service.ts) |
| [People Process service](core/services/people-process.service.md) | Gets information about Process Services users. | [Source](../lib/core/src/lib/services/people-process.service.ts) |
| [Process Content Service](core/services/process-content.service.md) | Manipulates content related to a Process Instance or Task Instance in APS. | [Source](../lib/process-services/src/lib/form/services/process-content.service.ts) |
Expand All @@ -231,8 +231,8 @@ for more information about installing and using the source code.
| [Search service](core/services/search.service.md) | Accesses the Content Services Search API. | [Source](../lib/core/src/lib/services/search.service.ts) |
| [Shared Links Api service](core/services/shared-links-api.service.md) | Finds shared links to Content Services items. | [Source](lib/content-services/src/lib/content-node-share/services/shared-links-api.service.ts) |
| [Storage service](core/services/storage.service.md) | Stores items in the form of key-value pairs. | [Source](../lib/core/src/lib/services/storage.service.ts) |
| [Thumbnail service](core/services/thumbnail.service.md) | Retrieves an SVG thumbnail image to represent a document type. | [Source](../lib/core/src/lib/services/thumbnail.service.ts) |
| [Translation service](core/services/translation.service.md) | Supports localisation. | [Source](../lib/core/src/lib/services/translation.service.ts) |
| [Thumbnail service](core/services/thumbnail.service.md) | Retrieves an SVG thumbnail image to represent a document type. | [Source](lib/core/src/lib/common/services/thumbnail.service.ts) |
| [Translation service](core/services/translation.service.md) | Supports localisation. | [Source](lib/core/src/lib/translation/translation.service.ts) |
| [Upload Service](core/services/upload.service.md) | Provides access to various APIs related to file upload features. | [Source](../lib/core/src/lib/services/upload.service.ts) |
| [User access service](core/services/user-access.service.md) | Checks the global and application access of a user | [Source](../lib/core/src/lib/services/user-access.service.ts) |
| [User Preferences Service](core/services/user-preferences.service.md) | Stores preferences for the app and for individual components. | [Source](../lib/core/src/lib/common/services/user-preferences.service.ts) |
Expand Down
2 changes: 1 addition & 1 deletion docs/core/components/search-text-input.component.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Status: Active
Last reviewed: 2019-11-06
---

# [Search Text Input Component](../../../lib/core/src/lib/search-text/search-text-input.component.ts "Defined in search-text-input.component.ts")
# [Search Text Input Component](lib/content-services/src/lib/search-text/search-text-input.component.ts "Defined in search-text-input.component.ts")

Displays a input text that supports autocompletion

Expand Down
2 changes: 1 addition & 1 deletion docs/core/interfaces/card-view-item.interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Picard's birthday (47457.1):
1. Define the model for the custom type.

Your model must extend the [`CardViewBaseItemModel`](../../../lib/core/src/lib/card-view/models/card-view-baseitem.model.ts) class and implement the [`CardViewItem`](../../../lib/core/src/lib/card-view/interfaces/card-view-item.interface.ts)
and [`DynamicComponentModel`](../../../lib/core/src/lib/services/dynamic-component-mapper.service.ts) interfaces. See the
and [`DynamicComponentModel`](lib/core/src/lib/common/services/dynamic-component-mapper.service.ts) interfaces. See the
[Card View Text Item model source](https://github.com/Alfresco/alfresco-ng2-components/blob/develop/lib/core/card-view/components/card-view-textitem/card-view-textitem.component.ts)
for an example of how to do this.

Expand Down
2 changes: 1 addition & 1 deletion docs/core/interfaces/search-configuration.interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Added: v2.1.0
Status: Active
---

# [Search Configuration interface](lib/core/src/lib/search-text/interfaces/search-configuration.interface.ts "Defined in search-configuration.interface.ts")
# [Search Configuration interface](lib/content-services/src/lib/common/interface/search-configuration.interface.ts "Defined in search-configuration.interface.ts")

Provides fine control of parameters to a search.

Expand Down
18 changes: 9 additions & 9 deletions docs/core/services/card-item-types.service.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,31 @@ Maps type names to field component types for the [Card View component](../compon

### Methods

- **getComponentTypeResolver**(type: `string`, defaultValue: `Type<any>` = `this.defaultValue`): [`DynamicComponentResolveFunction`](../../../lib/core/src/lib/services/dynamic-component-mapper.service.ts)<br/>
Gets the currently active [DynamicComponentResolveFunction](../../../lib/core/src/lib/services/dynamic-component-mapper.service.ts) for a field type.
- **getComponentTypeResolver**(type: `string`, defaultValue: `Type<any>` = `this.defaultValue`): [`DynamicComponentResolveFunction`](lib/core/src/lib/common/services/dynamic-component-mapper.service.ts)<br/>
Gets the currently active [DynamicComponentResolveFunction](lib/core/src/lib/common/services/dynamic-component-mapper.service.ts) for a field type.
- _type:_ `string` - The type whose resolver you want
- _defaultValue:_ `Type<any>` - Default type returned for types that are not yet mapped
- **Returns** [`DynamicComponentResolveFunction`](../../../lib/core/src/lib/services/dynamic-component-mapper.service.ts) - Resolver function
- **Returns** [`DynamicComponentResolveFunction`](lib/core/src/lib/common/services/dynamic-component-mapper.service.ts) - Resolver function
- **register**(components: `Function`, override: `boolean` = `false`)<br/>
Register multiple components
- _components:_ `Function` -
- _override:_ `boolean` -
- **resolveComponentType**(model: [`DynamicComponentModel`](../../../lib/core/src/lib/services/dynamic-component-mapper.service.ts), defaultValue: `Type<any>` = `this.defaultValue`): `Type<any>`<br/>
- **resolveComponentType**(model: [`DynamicComponentModel`](lib/core/src/lib/common/services/dynamic-component-mapper.service.ts), defaultValue: `Type<any>` = `this.defaultValue`): `Type<any>`<br/>
Finds the component type that is needed to render a form field.
- _model:_ [`DynamicComponentModel`](../../../lib/core/src/lib/services/dynamic-component-mapper.service.ts) - [Form](../../../lib/process-services/src/lib/task-list/models/form.model.ts) field model for the field to render
- _model:_ [`DynamicComponentModel`](lib/core/src/lib/common/services/dynamic-component-mapper.service.ts) - [Form](../../../lib/process-services/src/lib/task-list/models/form.model.ts) field model for the field to render
- _defaultValue:_ `Type<any>` - Default type returned for field types that are not yet mapped.
- **Returns** `Type<any>` - Component type
- **setComponentTypeResolver**(type: `string`, resolver: [`DynamicComponentResolveFunction`](../../../lib/core/src/lib/services/dynamic-component-mapper.service.ts), override: `boolean` = `true`)<br/>
Sets or optionally replaces a [DynamicComponentResolveFunction](../../../lib/core/src/lib/services/dynamic-component-mapper.service.ts) for a field type.
- **setComponentTypeResolver**(type: `string`, resolver: [`DynamicComponentResolveFunction`](lib/core/src/lib/common/services/dynamic-component-mapper.service.ts), override: `boolean` = `true`)<br/>
Sets or optionally replaces a [DynamicComponentResolveFunction](lib/core/src/lib/common/services/dynamic-component-mapper.service.ts) for a field type.
- _type:_ `string` - The type whose resolver you want to set
- _resolver:_ [`DynamicComponentResolveFunction`](../../../lib/core/src/lib/services/dynamic-component-mapper.service.ts) - The new resolver function
- _resolver:_ [`DynamicComponentResolveFunction`](lib/core/src/lib/common/services/dynamic-component-mapper.service.ts) - The new resolver function
- _override:_ `boolean` - The new resolver will only replace an existing one if this parameter is true

## Details

The [Card View component](../components/card-view.component.md) uses this service to find the component
type that is required to display a particular field type (text, date, etc). The service
maps a type name string to a corresponding [`DynamicComponentResolveFunction`](../../../lib/core/src/lib/services/dynamic-component-mapper.service.ts) that takes a
maps a type name string to a corresponding [`DynamicComponentResolveFunction`](lib/core/src/lib/common/services/dynamic-component-mapper.service.ts) that takes a
model object as a parameter and returns the component type needed to display that model.

The default mapping is shown below:
Expand Down
18 changes: 9 additions & 9 deletions docs/core/services/form-rendering.service.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,32 @@ Maps a form field type string onto the corresponding form [widget component](../

### Methods

- **getComponentTypeResolver**(type: `string`, defaultValue: `Type<any>` = `this.defaultValue`): [`DynamicComponentResolveFunction`](../../../lib/core/src/lib/services/dynamic-component-mapper.service.ts)<br/>
Gets the currently active [DynamicComponentResolveFunction](../../../lib/core/src/lib/services/dynamic-component-mapper.service.ts) for a field type.
- **getComponentTypeResolver**(type: `string`, defaultValue: `Type<any>` = `this.defaultValue`): [`DynamicComponentResolveFunction`](lib/core/src/lib/common/services/dynamic-component-mapper.service.ts)<br/>
Gets the currently active [DynamicComponentResolveFunction](lib/core/src/lib/common/services/dynamic-component-mapper.service.ts) for a field type.
- _type:_ `string` - The type whose resolver you want
- _defaultValue:_ `Type<any>` - Default type returned for types that are not yet mapped
- **Returns** [`DynamicComponentResolveFunction`](../../../lib/core/src/lib/services/dynamic-component-mapper.service.ts) - Resolver function
- **Returns** [`DynamicComponentResolveFunction`](lib/core/src/lib/common/services/dynamic-component-mapper.service.ts) - Resolver function
- **register**(components: `Function`, override: `boolean` = `false`)<br/>
Register multiple components
- _components:_ `Function` -
- _override:_ `boolean` -
- **resolveComponentType**(model: [`DynamicComponentModel`](../../../lib/core/src/lib/services/dynamic-component-mapper.service.ts), defaultValue: `Type<any>` = `this.defaultValue`): `Type<any>`<br/>
- **resolveComponentType**(model: [`DynamicComponentModel`](lib/core/src/lib/common/services/dynamic-component-mapper.service.ts), defaultValue: `Type<any>` = `this.defaultValue`): `Type<any>`<br/>
Finds the component type that is needed to render a form field.
- _model:_ [`DynamicComponentModel`](../../../lib/core/src/lib/services/dynamic-component-mapper.service.ts) - [Form](../../../lib/process-services/src/lib/task-list/models/form.model.ts) field model for the field to render
- _model:_ [`DynamicComponentModel`](lib/core/src/lib/common/services/dynamic-component-mapper.service.ts) - [Form](../../../lib/process-services/src/lib/task-list/models/form.model.ts) field model for the field to render
- _defaultValue:_ `Type<any>` - Default type returned for field types that are not yet mapped.
- **Returns** `Type<any>` - Component type
- **setComponentTypeResolver**(type: `string`, resolver: [`DynamicComponentResolveFunction`](../../../lib/core/src/lib/services/dynamic-component-mapper.service.ts), override: `boolean` = `true`)<br/>
Sets or optionally replaces a [DynamicComponentResolveFunction](../../../lib/core/src/lib/services/dynamic-component-mapper.service.ts) for a field type.
- **setComponentTypeResolver**(type: `string`, resolver: [`DynamicComponentResolveFunction`](lib/core/src/lib/common/services/dynamic-component-mapper.service.ts), override: `boolean` = `true`)<br/>
Sets or optionally replaces a [DynamicComponentResolveFunction](lib/core/src/lib/common/services/dynamic-component-mapper.service.ts) for a field type.
- _type:_ `string` - The type whose resolver you want to set
- _resolver:_ [`DynamicComponentResolveFunction`](../../../lib/core/src/lib/services/dynamic-component-mapper.service.ts) - The new resolver function
- _resolver:_ [`DynamicComponentResolveFunction`](lib/core/src/lib/common/services/dynamic-component-mapper.service.ts) - The new resolver function
- _override:_ `boolean` - The new resolver will only replace an existing one if this parameter is true

## Details

The [`Form`](../../../lib/process-services/src/lib/task-list/models/form.model.ts) Field component uses this service to choose which [widget](../../../lib/testing/src/lib/core/pages/form/widgets/widget.ts) to use to render an instance of a
form field. The [`Form`](../../../lib/process-services/src/lib/task-list/models/form.model.ts) Field model stores the field type name as a string (see the table below).
The [`Form`](../../../lib/process-services/src/lib/task-list/models/form.model.ts) Rendering service maintains a mapping between each type name and
a corresponding [`DynamicComponentResolveFunction`](../../../lib/core/src/lib/services/dynamic-component-mapper.service.ts). The function takes a [`FormFieldModel`](../../core/models/form-field.model.md) object as its argument and
a corresponding [`DynamicComponentResolveFunction`](lib/core/src/lib/common/services/dynamic-component-mapper.service.ts). The function takes a [`FormFieldModel`](../../core/models/form-field.model.md) object as its argument and
uses the data from the object to determine which [widget](../../../lib/testing/src/lib/core/pages/form/widgets/widget.ts) should be used to render the field.

In some cases, the field type string alone is enough to determine the [widget](../../../lib/testing/src/lib/core/pages/form/widgets/widget.ts) type and so the function
Expand Down
Loading

0 comments on commit 4f25426

Please sign in to comment.