mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
Minor code and style fixes (#5398)
* type fixes * import fixes * fix typos * fix warning for private props that init in ctor only * typing fixes * typing fixes * style cleanup * fix test template
This commit is contained in:
@@ -21,6 +21,7 @@ import { CommentModel } from '../models/comment.model';
|
||||
import { AlfrescoApiService } from '../services/alfresco-api.service';
|
||||
import { LogService } from '../services/log.service';
|
||||
import { map, catchError } from 'rxjs/operators';
|
||||
import { CommentEntry } from '@alfresco/js-api';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -40,7 +41,7 @@ export class CommentContentService {
|
||||
addNodeComment(nodeId: string, message: string): Observable<CommentModel> {
|
||||
return from(this.apiService.getInstance().core.commentsApi.addComment(nodeId, {content: message}))
|
||||
.pipe(
|
||||
map((response: any) => {
|
||||
map((response: CommentEntry) => {
|
||||
return new CommentModel({
|
||||
id: response.entry.id,
|
||||
message: response.entry.content,
|
||||
@@ -60,7 +61,7 @@ export class CommentContentService {
|
||||
getNodeComments(nodeId: string): Observable<CommentModel[]> {
|
||||
return from(this.apiService.getInstance().core.commentsApi.getComments(nodeId))
|
||||
.pipe(
|
||||
map((response: any) => {
|
||||
map((response) => {
|
||||
const comments: CommentModel[] = [];
|
||||
response.list.entries.forEach((comment: any) => {
|
||||
comments.push(new CommentModel({
|
||||
|
@@ -41,7 +41,7 @@ export class CommentProcessService {
|
||||
addTaskComment(taskId: string, message: string): Observable<CommentModel> {
|
||||
return from(this.apiService.getInstance().activiti.taskApi.addTaskComment({ message: message }, taskId))
|
||||
.pipe(
|
||||
map((response: CommentModel) => {
|
||||
map((response) => {
|
||||
return new CommentModel({
|
||||
id: response.id,
|
||||
message: response.message,
|
||||
@@ -61,9 +61,9 @@ export class CommentProcessService {
|
||||
getTaskComments(taskId: string): Observable<CommentModel[]> {
|
||||
return from(this.apiService.getInstance().activiti.taskApi.getTaskComments(taskId))
|
||||
.pipe(
|
||||
map((response: any) => {
|
||||
map((response) => {
|
||||
const comments: CommentModel[] = [];
|
||||
response.data.forEach((comment: CommentModel) => {
|
||||
response.data.forEach((comment) => {
|
||||
const user = new UserProcessModel(comment.createdBy);
|
||||
comments.push(new CommentModel({
|
||||
id: comment.id,
|
||||
@@ -86,9 +86,9 @@ export class CommentProcessService {
|
||||
getProcessInstanceComments(processInstanceId: string): Observable<CommentModel[]> {
|
||||
return from(this.apiService.getInstance().activiti.commentsApi.getProcessInstanceComments(processInstanceId))
|
||||
.pipe(
|
||||
map((response: any) => {
|
||||
map((response) => {
|
||||
const comments: CommentModel[] = [];
|
||||
response.data.forEach((comment: CommentModel) => {
|
||||
response.data.forEach((comment) => {
|
||||
const user = new UserProcessModel(comment.createdBy);
|
||||
comments.push(new CommentModel({
|
||||
id: comment.id,
|
||||
@@ -113,7 +113,7 @@ export class CommentProcessService {
|
||||
return from(
|
||||
this.apiService.getInstance().activiti.commentsApi.addProcessInstanceComment({ message: message }, processInstanceId)
|
||||
).pipe(
|
||||
map((response: CommentModel) => {
|
||||
map((response) => {
|
||||
return new CommentModel({
|
||||
id: response.id,
|
||||
message: response.message,
|
||||
|
@@ -21,7 +21,7 @@ import { Injectable } from '@angular/core';
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class DownloadService {
|
||||
private saveData: Function;
|
||||
private readonly saveData: Function;
|
||||
|
||||
constructor() {
|
||||
this.saveData = (function() {
|
||||
|
@@ -23,7 +23,7 @@ import { Injectable } from '@angular/core';
|
||||
export class StorageService {
|
||||
|
||||
private memoryStore: { [key: string]: any } = {};
|
||||
private useLocalStorage: boolean = false;
|
||||
private readonly useLocalStorage: boolean = false;
|
||||
private _prefix: string = '';
|
||||
|
||||
get prefix() {
|
||||
|
Reference in New Issue
Block a user