mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4793] The filters don't work on community-edition [ Use local storage for community version ] (#4973)
* * Use local storage for community version. * * Created a communityModule. * * Updated unit tests the recent changes * * Updated documents. * * Modified process/task filters doc.
This commit is contained in:
committed by
Eugenio Romano
parent
964e89f6ef
commit
0bca6607a9
@@ -212,3 +212,7 @@ Users can save a filter if they make any changes to it in an application using t
|
||||
## See also
|
||||
|
||||
- [Edit task filter cloud component](edit-task-filter-cloud.component.md)
|
||||
- [Process Filter Cloud Service](../services/process-filter-cloud.service.md)
|
||||
- [Local preference Cloud Service](../services/local-preference-cloud.service.md)
|
||||
- [User preference Cloud Service](../services/user-preference-cloud.service.md)
|
||||
|
||||
|
@@ -212,3 +212,7 @@ Users can save a filter if they make any changes to it in an application using t
|
||||
## See also
|
||||
|
||||
- [Edit process filter cloud component](edit-process-filter-cloud.component.md)
|
||||
- [Task filters Cloud Service](../services/task-filter-cloud.service.md)
|
||||
- [Local preference Cloud Service](../services/local-preference-cloud.service.md)
|
||||
- [User preference Cloud Service](../services/user-preference-cloud.service.md)
|
||||
|
||||
|
@@ -35,3 +35,9 @@ Lists all available process filters and allows to select a filter.
|
||||
| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<any>` | Emitted when any error occurs while loading the filters |
|
||||
| filterClick | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`ProcessFilterCloudModel`](../../../lib/process-services-cloud/src/lib/process/process-filters/models/process-filter-cloud.model.ts)`>` | Emitted when a filter is selected/clicked |
|
||||
| success | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<any>` | Emitted when filters are loaded successfully |
|
||||
|
||||
## See also
|
||||
|
||||
- [Process Filter Cloud Service](./services/process-filter-cloud.service.md)
|
||||
- [Local preference Cloud Service](./services/local-preference-cloud.service.md)
|
||||
- [User preference Cloud Service](./services/user-preference-cloud.service.md)
|
||||
|
@@ -54,3 +54,9 @@ as the value of `filterParam` as shown in the table below:
|
||||
| name | string | The name of the task filter, lowercase is checked |
|
||||
| key | string | The key of the task filter |
|
||||
| index | string | The zero-based position of the filter in the array. |
|
||||
|
||||
## See also
|
||||
|
||||
- [Task filter Cloud Service](../services/task-filter-cloud.service.md)
|
||||
- [Local preference Cloud Service](../services/local-preference-cloud.service.md)
|
||||
- [User preference Cloud Service](../services/user-preference-cloud.service.md)
|
||||
|
@@ -0,0 +1,51 @@
|
||||
---
|
||||
Title: Local Preference Cloud Service
|
||||
Added: v3.4.0
|
||||
Status: Experimental
|
||||
Last reviewed: 2019-08-06
|
||||
---
|
||||
|
||||
# [Local Preference Cloud Service](../../../lib/process-services-cloud/src/lib/services/local-preference-cloud.service.ts "Defined in local-preference-cloud.service.ts")
|
||||
|
||||
Manages Local Storage preferences.
|
||||
|
||||
## Class members
|
||||
|
||||
### Methods
|
||||
|
||||
- **createPreference**(appName: `string`, key: `string`, newPreference: `any`): [`Observable`](http://reactivex.io/documentation/observable.html)`<any>`<br/>
|
||||
Creates local preference.
|
||||
- _appName:_ `string` - Name of the target app
|
||||
- _key:_ `string` - Key of the target preference
|
||||
- _newPreference:_ `any` -
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<any>` - Observable of created local preferences
|
||||
- **deletePreference**(key: `string`, preferences: `any`): [`Observable`](http://reactivex.io/documentation/observable.html)`<any>`<br/>
|
||||
Deletes local preference by given preference key.
|
||||
- _key:_ `string` - Key of the target preference
|
||||
- _preferences:_ `any` - Details of updated preferences
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<any>` - Observable of preferences without deleted preference
|
||||
- **getPreferenceByKey**(appName: `string`, key: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<any>`<br/>
|
||||
Gets local preference.
|
||||
- _appName:_ `string` - Name of the target app
|
||||
- _key:_ `string` - Key of the target preference
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<any>` - Observable of local preference
|
||||
- **getPreferences**(appName: `string`, key: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<any>`<br/>
|
||||
Gets local preferences
|
||||
- _appName:_ `string` - Name of the target app
|
||||
- _key:_ `string` - (Optional) (Optional) (Optional) (Optional)
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<any>` - List of local preferences
|
||||
- **prepareLocalPreferenceResponse**(key: `string`): `any`<br/>
|
||||
|
||||
- _key:_ `string` -
|
||||
- **Returns** `any` -
|
||||
|
||||
- **updatePreference**(appName: `string`, key: `string`, updatedPreference: `any`): [`Observable`](http://reactivex.io/documentation/observable.html)`<any>`<br/>
|
||||
Updates local preference.
|
||||
- _appName:_ `string` - Name of the target app
|
||||
- _key:_ `string` - Key of the target preference
|
||||
- _updatedPreference:_ `any` - Details of updated preference
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<any>` - Observable of updated local preferences
|
||||
|
||||
## See also
|
||||
|
||||
- [User preference Cloud Service](user-preference-cloud.service.md)
|
@@ -35,13 +35,47 @@ Manage Process Filters, which are pre-configured Process Instance queries.
|
||||
- _updatedFilter:_ [`ProcessFilterCloudModel`](../../../lib/process-services-cloud/src/lib/process/process-filters/models/process-filter-cloud.model.ts) -
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`ProcessFilterCloudModel`](../../../lib/process-services-cloud/src/lib/process/process-filters/models/process-filter-cloud.model.ts)`[]>` - Observable of process instance filters with updated filter
|
||||
|
||||
## Details
|
||||
## Inject Preference service
|
||||
|
||||
The methods of this service generally return an instance of
|
||||
[`ProcessFilterCloudModel`](../../../lib/process-services-cloud/src/lib/process/process-filters/models/process-filter-cloud.model.ts) or an array of instances.
|
||||
Token: [`PROCESS_FILTERS_SERVICE_TOKEN`](../../../lib/process-services-cloud/src/lib/services/cloud-token.service.ts)
|
||||
A DI token that maps to the dependency to be injected.
|
||||
|
||||
You can use the returned filters to get matching process instances for the process app,
|
||||
such as 'Running', 'Completed', 'All', etc.
|
||||
[Process Filter Cloud Service](../../../lib/process-services-cloud/src/lib/process/process-filters/services/process-filter-cloud.service.ts "Defined in process-filter-cloud.service.ts")
|
||||
is by default injected with the [Local Preference Cloud Service](../../process-services-cloud/services/local-preference-cloud.service.md)
|
||||
|
||||
```ts
|
||||
import { NgModule } from '@angular/core';
|
||||
import { LocalPreferenceCloudService, PROCESS_FILTERS_SERVICE_TOKEN } from '@alfresco/adf-process-services-cloud';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
...Import Required Modules
|
||||
],
|
||||
providers: [
|
||||
{ provide: PROCESS_FILTERS_SERVICE_TOKEN, useClass: LocalPreferenceCloudService }
|
||||
]
|
||||
})
|
||||
export class ExampleModule {}
|
||||
|
||||
```
|
||||
|
||||
If you would like to inject the [User Preference Cloud Service](../../process-services-cloud/services/user-preference-cloud.service.md), you can inject the service like below shown
|
||||
|
||||
```ts
|
||||
import { NgModule } from '@angular/core';
|
||||
import { UserPreferenceCloudService, PROCESS_FILTERS_SERVICE_TOKEN } from '@alfresco/adf-process-services-cloud';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
...Import Required Modules
|
||||
],
|
||||
providers: [
|
||||
{ provide: PROCESS_FILTERS_SERVICE_TOKEN, useClass: UserPreferenceCloudService }
|
||||
]
|
||||
})
|
||||
export class ExampleModule {}
|
||||
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
|
@@ -7,7 +7,7 @@ Last reviewed: 2019-01-09
|
||||
|
||||
# [Task Filter Cloud Service](../../../lib/process-services-cloud/src/lib/task/task-filters/services/task-filter-cloud.service.ts "Defined in task-filter-cloud.service.ts")
|
||||
|
||||
Manages task filters.
|
||||
Manages task filters.
|
||||
|
||||
## Class members
|
||||
|
||||
@@ -53,6 +53,48 @@ this.taskFilterService.getTaskListFilters(appName).subscribe( (filters: TaskFilt
|
||||
|
||||
These filters can now be used to get matching task instances for the process app.
|
||||
|
||||
## Inject Preference service
|
||||
|
||||
Token: [`TASK_FILTERS_SERVICE_TOKEN`](../../../lib/process-services-cloud/src/lib/services/cloud-token.service.ts)
|
||||
A DI token that maps to the dependency to be injected.
|
||||
|
||||
[Task Filter Cloud Service](../../../lib/process-services-cloud/src/lib/task/task-filters/services/task-filter-cloud.service.ts "Defined in task-filter-cloud.service.ts")
|
||||
is by default injected with the [Local Preference Cloud Service](../../process-services-cloud/services/local-preference-cloud.service.md)
|
||||
|
||||
```ts
|
||||
import { NgModule } from '@angular/core';
|
||||
import { LocalPreferenceCloudService, TASK_FILTERS_SERVICE_TOKEN } from '@alfresco/adf-process-services-cloud';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
...Import Required Modules
|
||||
],
|
||||
providers: [
|
||||
{ provide: TASK_FILTERS_SERVICE_TOKEN, useClass: LocalPreferenceCloudService }
|
||||
]
|
||||
})
|
||||
export class ExampleModule {}
|
||||
|
||||
```
|
||||
|
||||
If you would like to inject the [UserPreferenceCloudService](../../process-services-cloud/services/user-preference-cloud.service.md), you can inject the service like below shown
|
||||
|
||||
```ts
|
||||
import { NgModule } from '@angular/core';
|
||||
import { UserPreferenceCloudService, TASK_FILTERS_SERVICE_TOKEN } from '@alfresco/adf-process-services-cloud';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
...Import Required Modules
|
||||
],
|
||||
providers: [
|
||||
{ provide: TASK_FILTERS_SERVICE_TOKEN, useClass: UserPreferenceCloudService }
|
||||
]
|
||||
})
|
||||
export class ExampleModule {}
|
||||
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
- [Task filter service](../../process-services/services/task-filter.service.md)
|
||||
|
@@ -0,0 +1,50 @@
|
||||
---
|
||||
Title: User Preference Cloud Service
|
||||
Added: v3.4.0
|
||||
Status: Experimental
|
||||
Last reviewed: 2019-08-06
|
||||
---
|
||||
|
||||
# [User Preference Cloud Service](../../../lib/process-services-cloud/src/lib/services/user-preference-cloud.service.ts "Defined in user-preference-cloud.service.ts")
|
||||
|
||||
Manages user preferences.
|
||||
|
||||
## Class members
|
||||
|
||||
### Methods
|
||||
|
||||
- **createPreference**(appName: `string`, key: `string`, newPreference: `any`): [`Observable`](http://reactivex.io/documentation/observable.html)`<any>`<br/>
|
||||
Creates user preference.
|
||||
- _appName:_ `string` - Name of the target app
|
||||
- _key:_ `string` - Key of the target preference
|
||||
- _newPreference:_ `any` -
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<any>` - Observable of created user preferences
|
||||
- **deletePreference**(appName: `string`, key: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<any>`<br/>
|
||||
Deletes user preference by given preference key.
|
||||
- _appName:_ `string` - Name of the target app
|
||||
- _key:_ `string` - Key of the target preference
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<any>` - Observable of delete operation status
|
||||
- **getBasePath**(appName: `string`): `string`<br/>
|
||||
|
||||
- _appName:_ `string` -
|
||||
- **Returns** `string` -
|
||||
|
||||
- **getPreferenceByKey**(appName: `string`, key: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<any>`<br/>
|
||||
Gets user preference.
|
||||
- _appName:_ `string` - Name of the target app
|
||||
- _key:_ `string` - Key of the target preference
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<any>` - Observable of user preference
|
||||
- **getPreferences**(appName: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<any>`<br/>
|
||||
Gets user preferences
|
||||
- _appName:_ `string` - Name of the target app
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<any>` - List of user preferences
|
||||
- **updatePreference**(appName: `string`, key: `string`, updatedPreference: `any`): [`Observable`](http://reactivex.io/documentation/observable.html)`<any>`<br/>
|
||||
Updates user preference.
|
||||
- _appName:_ `string` - Name of the target app
|
||||
- _key:_ `string` - Key of the target preference
|
||||
- _updatedPreference:_ `any` - Details of updated preference
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<any>` - Observable of updated user preferences
|
||||
|
||||
## See also
|
||||
|
||||
- [Local preference Cloud Service](local-preference-cloud.service.md)
|
Reference in New Issue
Block a user