Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AAE-3694] Add new Service Method for service task integration #6199

Merged
merged 3 commits into from
Oct 1, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
<div fxLayout="row"
fxFill
fxLayoutGap="2px">
<div fxLayout
fxFill>
<adf-cloud-service-task-filters [appName]="appName"
[filterParam]="{index: 0}"
(filterClick)="onTaskFilterSelected($event)">

</adf-cloud-service-task-filters>
<div fxLayout="column"
fxFill
fxLayoutGap="2px">

fxFlex>
<adf-cloud-edit-service-task-filter [id]="filterId"
[appName]="appName"
[filterProperties]="taskFilterProperties.filterProperties"
Expand All @@ -19,6 +16,7 @@
</adf-cloud-edit-service-task-filter>
<div fxLayout="column"
fxFlex
fxFill
fxLayoutAlign="space-between"
*ngIf="editedFilter">
<adf-cloud-service-task-list #taskCloud
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import { BaseEditTaskFilterCloudComponent } from './base-edit-task-filter-cloud.
export class EditServiceTaskFilterCloudComponent extends BaseEditTaskFilterCloudComponent {

public static DEFAULT_TASK_FILTER_PROPERTIES = ['appName', 'activityName', 'status', 'sort', 'order'];
public static DEFAULT_TASK_SORT_PROPERTIES = ['id', 'name', 'startedDate', 'completedDate'];
public static DEFAULT_TASK_SORT_PROPERTIES = ['id', 'activityName', 'startedDate', 'completedDate'];
public static DEFAULT_TASK_STATUS_PROPERTIES = [
{ label: 'ALL', value: '' },
{ label: 'STARTED', value: 'STARTED' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,10 @@ export interface ServiceTaskQueryCloudRequestModel {
serviceVersion?: string;
startedDate?: Date;
}

export interface ServiceTaskIntegrationContextCloudModel extends ServiceTaskQueryCloudRequestModel {
errorDate?: Date;
errorClassName?: string;
errorCode?: string;
errorMessage?: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import { Injectable } from '@angular/core';
import { AlfrescoApiService, AppConfigService, LogService } from '@alfresco/adf-core';
import { TaskQueryCloudRequestModel, ServiceTaskQueryCloudRequestModel } from '../models/filter-cloud-model';
import { TaskQueryCloudRequestModel, ServiceTaskQueryCloudRequestModel, ServiceTaskIntegrationContextCloudModel } from '../models/filter-cloud-model';
import { Observable, throwError } from 'rxjs';
import { TaskListCloudSortingModel } from '../models/task-list-sorting.model';
import { BaseCloudService } from '../../../services/base-cloud.service';
Expand Down Expand Up @@ -71,6 +71,22 @@ export class TaskListCloudService extends BaseCloudService {
}
}

/**
* Finds a service task integration context using an object with optional query properties.
* @param appName string
* @param serviceTaskId string
* @returns Service Task Integration Context information
*/
getServiceTaskStatus(appName: string, serviceTaskId: string): Observable<ServiceTaskIntegrationContextCloudModel> {
if (appName) {
const queryUrl = `${this.getBasePath(appName)}/query/admin/v1/service-tasks/${serviceTaskId}/integration-context`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you sure that is right to call an admin API ?

return this.get(queryUrl);
} else {
this.logService.error('Appname is mandatory for querying task');
return throwError('Appname not configured');
}
}

private buildQueryParams(requestNode: TaskQueryCloudRequestModel): Object {
const queryParam: Object = {};
for (const property in requestNode) {
Expand Down