mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-622] No implicit returns (#5157)
* enable noImplicitReturns rule * type fixes * fix return types * fix return value * fix tests * fix visibility service * update tests * add missing types * fix test
This commit is contained in:
@@ -163,6 +163,7 @@ export class AuthenticationService {
|
||||
if (this.alfrescoApi.getInstance()) {
|
||||
return this.alfrescoApi.getInstance().logout();
|
||||
}
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { throwError as observableThrowError, Observable } from 'rxjs';
|
||||
import { throwError as observableThrowError, Observable, of } from 'rxjs';
|
||||
import { catchError, map } from 'rxjs/operators';
|
||||
import { Pagination } from '@alfresco/js-api';
|
||||
import { IdentityRoleModel } from '../models/identity-role.model';
|
||||
@@ -90,6 +90,7 @@ export class IdentityRoleService {
|
||||
.post(`${this.identityHost}/roles`, request)
|
||||
.pipe(catchError(error => this.handleError(error)));
|
||||
}
|
||||
return of();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -119,6 +120,7 @@ export class IdentityRoleService {
|
||||
.put(`${this.identityHost}/roles-by-id/${roleId}`, request)
|
||||
.pipe(catchError(error => this.handleError(error)));
|
||||
}
|
||||
return of();
|
||||
}
|
||||
|
||||
private handleError(error: any) {
|
||||
|
@@ -59,14 +59,18 @@ export class LockService {
|
||||
return node.properties['cm:lockType'] === 'WRITE_LOCK' && node.properties['cm:lockLifetime'] === 'PERSISTENT';
|
||||
}
|
||||
|
||||
private getLockExpiryTime(node: Node): Moment {
|
||||
private getLockExpiryTime(node: Node): Moment | undefined {
|
||||
if (node.properties['cm:expiryDate']) {
|
||||
return moment(node.properties['cm:expiryDate'], 'yyyy-MM-ddThh:mm:ssZ');
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
private isLockExpired(node: Node): boolean {
|
||||
const expiryLockTime = this.getLockExpiryTime(node);
|
||||
return moment().isAfter(expiryLockTime);
|
||||
if (expiryLockTime) {
|
||||
return moment().isAfter(expiryLockTime);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@@ -139,9 +139,9 @@ export class UserPreferencesService {
|
||||
* @param property Name of the property
|
||||
* @returns True if the item is present, false otherwise
|
||||
*/
|
||||
hasItem(property: string) {
|
||||
hasItem(property: string): boolean {
|
||||
if (!property) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
return this.storage.hasItem(
|
||||
this.getPropertyKey(property)
|
||||
|
Reference in New Issue
Block a user