mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-] update library to use new js-api 3.0.0 (#4097)
This commit is contained in:
committed by
Eugenio Romano
parent
2acd1b4e26
commit
3ef7d3b7ea
@@ -17,7 +17,7 @@
|
||||
|
||||
import { AppsProcessService } from '@alfresco/adf-core';
|
||||
import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';
|
||||
import { ProcessInstanceFilterRepresentation, UserProcessInstanceFilterRepresentation } from 'alfresco-js-api';
|
||||
import { ProcessInstanceFilterRepresentation, UserProcessInstanceFilterRepresentation } from '@alfresco/js-api';
|
||||
import { Observable } from 'rxjs';
|
||||
import { FilterProcessRepresentationModel } from '../models/filter-process.model';
|
||||
import { ProcessFilterService } from './../services/process-filter.service';
|
||||
|
@@ -15,12 +15,16 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ProcessFilterRequestRepresentation, ProcessInstanceFilterRepresentation, UserProcessInstanceFilterRepresentation } from 'alfresco-js-api';
|
||||
import {
|
||||
ProcessFilterRequestRepresentation,
|
||||
ProcessInstanceFilterRepresentation,
|
||||
UserProcessInstanceFilterRepresentation
|
||||
} from '@alfresco/js-api';
|
||||
|
||||
export class FilterProcessRepresentationModel implements UserProcessInstanceFilterRepresentation {
|
||||
appId: number;
|
||||
filter: ProcessInstanceFilterRepresentation;
|
||||
icon: number;
|
||||
icon: string;
|
||||
id: number;
|
||||
index: number;
|
||||
name: string;
|
||||
@@ -48,11 +52,11 @@ export class FilterProcessRepresentationModel implements UserProcessInstanceFilt
|
||||
*/
|
||||
export class ProcessFilterParamRepresentationModel implements ProcessFilterRequestRepresentation {
|
||||
|
||||
processDefinitionId?: number;
|
||||
processInstanceId?: number|string;
|
||||
processDefinitionId?: string;
|
||||
processInstanceId?: string;
|
||||
appDefinitionId?: number;
|
||||
state?: string;
|
||||
sort?: string;
|
||||
state?: any;
|
||||
sort?: any;
|
||||
page?: number;
|
||||
size?: number;
|
||||
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { RestVariable } from 'alfresco-js-api';
|
||||
import { RestVariable } from '@alfresco/js-api';
|
||||
|
||||
export class ProcessInstanceVariable implements RestVariable {
|
||||
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { LightUserRepresentation, ProcessInstanceRepresentation, RestVariable } from 'alfresco-js-api';
|
||||
import { LightUserRepresentation, ProcessInstanceRepresentation, RestVariable } from '@alfresco/js-api';
|
||||
|
||||
export class ProcessInstance implements ProcessInstanceRepresentation {
|
||||
|
||||
|
@@ -121,7 +121,7 @@ describe('Process filter', () => {
|
||||
'status': 200,
|
||||
contentType: 'application/json',
|
||||
responseText: JSON.stringify({
|
||||
appId: 1001, id: '111', name: 'Running', icon: 'fake-icon', recent: false
|
||||
appId: 1001, id: 111, name: 'Running', icon: 'fake-icon', recent: false
|
||||
})
|
||||
});
|
||||
|
||||
@@ -129,7 +129,7 @@ describe('Process filter', () => {
|
||||
'status': 200,
|
||||
contentType: 'application/json',
|
||||
responseText: JSON.stringify({
|
||||
appId: 1001, id: '222', name: 'Completed', icon: 'fake-icon', recent: false
|
||||
appId: 1001, id: 222, name: 'Completed', icon: 'fake-icon', recent: false
|
||||
})
|
||||
});
|
||||
|
||||
@@ -137,7 +137,7 @@ describe('Process filter', () => {
|
||||
'status': 200,
|
||||
contentType: 'application/json',
|
||||
responseText: JSON.stringify({
|
||||
appId: 1001, id: '333', name: 'All', icon: 'fake-icon', recent: false
|
||||
appId: 1001, id: 333, name: 'All', icon: 'fake-icon', recent: false
|
||||
})
|
||||
});
|
||||
});
|
||||
|
@@ -17,6 +17,7 @@
|
||||
|
||||
import { AlfrescoApiService, FormValues } from '@alfresco/adf-core';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { RestVariable } from '@alfresco/js-api';
|
||||
import { Observable, from, throwError, of } from 'rxjs';
|
||||
import { TaskDetailsModel } from '../../task-list';
|
||||
import { ProcessFilterParamRepresentationModel } from '../models/filter-process.model';
|
||||
@@ -203,7 +204,7 @@ export class ProcessService {
|
||||
this.alfrescoApiService.getInstance().activiti.processInstanceVariablesApi.getProcessInstanceVariables(processInstanceId)
|
||||
)
|
||||
.pipe(
|
||||
map((processVars: any[]) => processVars.map((pd) => new ProcessInstanceVariable(pd))),
|
||||
map((processVars: any[]) => processVars.map((currentProcessVar) => new ProcessInstanceVariable(currentProcessVar))),
|
||||
catchError((err) => this.handleProcessError(err))
|
||||
);
|
||||
}
|
||||
@@ -214,11 +215,10 @@ export class ProcessService {
|
||||
* @param variables Variables to update
|
||||
* @returns Array of instance variable info
|
||||
*/
|
||||
createOrUpdateProcessInstanceVariables(processInstanceId: string, variables: ProcessInstanceVariable[]): Observable<ProcessInstanceVariable[]> {
|
||||
return from<ProcessInstanceVariable[]>(
|
||||
createOrUpdateProcessInstanceVariables(processInstanceId: string, variables: RestVariable[]): Observable<ProcessInstanceVariable[]> {
|
||||
return from(
|
||||
this.alfrescoApiService.getInstance().activiti.processInstanceVariablesApi.createOrUpdateProcessInstanceVariables(processInstanceId, variables)
|
||||
)
|
||||
.pipe(
|
||||
).pipe(
|
||||
catchError((err) => this.handleProcessError(err))
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user