mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-10-08 14:51:32 +00:00
add missing typing information (#5227)
* add missing typing information * typing fixes * revert return type * typing fixes
This commit is contained in:
committed by
Eugenio Romano
parent
2138ce600e
commit
0c13f3d879
@@ -18,12 +18,7 @@
|
||||
/**
|
||||
* This object represent the User Event.
|
||||
*/
|
||||
export class UserEventModel {
|
||||
type: string = '';
|
||||
value: any = {};
|
||||
|
||||
constructor(obj?: any) {
|
||||
this.type = obj && obj.type;
|
||||
this.value = obj && obj.value || {};
|
||||
}
|
||||
export interface UserEventModel {
|
||||
type: string;
|
||||
value: any;
|
||||
}
|
||||
|
@@ -19,18 +19,10 @@
|
||||
* This object represent the process service user group.*
|
||||
*/
|
||||
|
||||
export class UserGroupModel {
|
||||
export interface UserGroupModel {
|
||||
id?: number;
|
||||
name?: string;
|
||||
externalId?: string;
|
||||
status?: string;
|
||||
groups?: any = {};
|
||||
|
||||
constructor(obj?: any) {
|
||||
this.id = obj && obj.id;
|
||||
this.name = obj && obj.name;
|
||||
this.externalId = obj && obj.externalId;
|
||||
this.status = obj && obj.status;
|
||||
this.groups = obj && obj.groups;
|
||||
}
|
||||
groups?: any;
|
||||
}
|
||||
|
@@ -77,7 +77,7 @@ export class TaskListService {
|
||||
const requestNodeForFilter = this.generateTaskRequestNodeFromFilter(filterModel);
|
||||
return from(this.callApiTasksFiltered(requestNodeForFilter))
|
||||
.pipe(
|
||||
map((res: any) => {
|
||||
map(res => {
|
||||
return res.data.find((element) => element.id === taskId) ? filterModel : null;
|
||||
}),
|
||||
catchError((err) => this.handleError(err))
|
||||
@@ -155,7 +155,7 @@ export class TaskListService {
|
||||
getTaskDetails(taskId: string): Observable<TaskDetailsModel> {
|
||||
return from(this.callApiTaskDetails(taskId))
|
||||
.pipe(
|
||||
map((details: any) => {
|
||||
map(details => {
|
||||
return new TaskDetailsModel(details);
|
||||
}),
|
||||
catchError((err) => this.handleError(err))
|
||||
@@ -170,7 +170,7 @@ export class TaskListService {
|
||||
getTaskChecklist(id: string): Observable<TaskDetailsModel[]> {
|
||||
return from(this.callApiTaskChecklist(id))
|
||||
.pipe(
|
||||
map((response: any) => {
|
||||
map(response => {
|
||||
const checklists: TaskDetailsModel[] = [];
|
||||
response.data.forEach((checklist) => {
|
||||
checklists.push(new TaskDetailsModel(checklist));
|
||||
@@ -194,7 +194,7 @@ export class TaskListService {
|
||||
|
||||
return from(this.apiService.getInstance().activiti.modelsApi.getModels(opts))
|
||||
.pipe(
|
||||
map((response: any) => {
|
||||
map(response => {
|
||||
const forms: Form[] = [];
|
||||
response.data.forEach((form) => {
|
||||
forms.push(new Form(form.id, form.name));
|
||||
@@ -278,9 +278,6 @@ export class TaskListService {
|
||||
requestNode.size = 0;
|
||||
return from(this.callApiTasksFiltered(requestNode))
|
||||
.pipe(
|
||||
map((res: any) => {
|
||||
return res;
|
||||
}),
|
||||
catchError((err) => this.handleError(err))
|
||||
);
|
||||
}
|
||||
@@ -364,7 +361,7 @@ export class TaskListService {
|
||||
* @param updated Data to update the task (as a `TaskUpdateRepresentation` instance).
|
||||
* @returns Updated task details
|
||||
*/
|
||||
updateTask(taskId: any, updated: TaskUpdateRepresentation): Observable<TaskDetailsModel> {
|
||||
updateTask(taskId: string, updated: TaskUpdateRepresentation): Observable<TaskDetailsModel> {
|
||||
return from(this.apiService.taskApi.updateTask(taskId, updated))
|
||||
.pipe(
|
||||
map((result) => <TaskDetailsModel> result),
|
||||
|
@@ -21,7 +21,7 @@ export class TaskDescriptionValidator implements CardViewItemValidator {
|
||||
|
||||
message: string = 'ADF_CLOUD_TASK_HEADER.FORM_VALIDATION.INVALID_FIELD';
|
||||
|
||||
isValid(value: any): boolean {
|
||||
isValid(value: string): boolean {
|
||||
const isWhitespace = (value || '').trim().length === 0;
|
||||
return value.length === 0 || !isWhitespace;
|
||||
}
|
||||
|
Reference in New Issue
Block a user