mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
[ACS-9166]: redundant types
This commit is contained in:
@@ -54,7 +54,7 @@ export abstract class SavedSearchesBaseService implements SavedSearchStrategy {
|
||||
saveSearch(newSaveSearch: Pick<SavedSearch, 'name' | 'description' | 'encodedUrl'>): Observable<NodeEntry> {
|
||||
return this.fetchAllSavedSearches().pipe(
|
||||
take(1),
|
||||
switchMap((savedSearches: SavedSearch[]) => {
|
||||
switchMap((savedSearches) => {
|
||||
let updatedSavedSearches: SavedSearch[] = [];
|
||||
|
||||
if (savedSearches.length < 5) {
|
||||
@@ -80,14 +80,14 @@ export abstract class SavedSearchesBaseService implements SavedSearchStrategy {
|
||||
let previousSavedSearches: SavedSearch[];
|
||||
return this.savedSearches$.pipe(
|
||||
take(1),
|
||||
map((savedSearches: SavedSearch[]) => {
|
||||
map((savedSearches) => {
|
||||
previousSavedSearches = [...savedSearches];
|
||||
return savedSearches.map((search) => (search.order === updatedSavedSearch.order ? updatedSavedSearch : search));
|
||||
}),
|
||||
tap((updatedSearches: SavedSearch[]) => {
|
||||
tap((updatedSearches) => {
|
||||
this._savedSearches$.next(updatedSearches);
|
||||
}),
|
||||
switchMap((updatedSearches: SavedSearch[]) => this.updateSavedSearches(updatedSearches)),
|
||||
switchMap((updatedSearches) => this.updateSavedSearches(updatedSearches)),
|
||||
catchError((error) => {
|
||||
this._savedSearches$.next(previousSavedSearches);
|
||||
return throwError(() => error);
|
||||
@@ -99,7 +99,7 @@ export abstract class SavedSearchesBaseService implements SavedSearchStrategy {
|
||||
let previousSavedSearchesOrder: SavedSearch[];
|
||||
return this.savedSearches$.pipe(
|
||||
take(1),
|
||||
map((savedSearches: SavedSearch[]) => {
|
||||
map((savedSearches) => {
|
||||
previousSavedSearchesOrder = [...savedSearches];
|
||||
const updatedSearches = savedSearches.filter((search) => search.order !== deletedSavedSearch.order);
|
||||
return updatedSearches.map((search, index) => ({ ...search, order: index }));
|
||||
@@ -120,7 +120,7 @@ export abstract class SavedSearchesBaseService implements SavedSearchStrategy {
|
||||
this.savedSearches$
|
||||
.pipe(
|
||||
take(1),
|
||||
map((savedSearches: SavedSearch[]) => {
|
||||
map((savedSearches) => {
|
||||
previousSavedSearchesOrder = [...savedSearches];
|
||||
const [movedSearch] = savedSearches.splice(previousIndex, 1);
|
||||
savedSearches.splice(currentIndex, 0, movedSearch);
|
||||
|
||||
@@ -19,7 +19,6 @@ import { TestBed } from '@angular/core/testing';
|
||||
import { AlfrescoApiService } from '../../services';
|
||||
import { NodeEntry } from '@alfresco/js-api';
|
||||
import { AlfrescoApiServiceMock } from '../../mock';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { AuthenticationService } from '@alfresco/adf-core';
|
||||
import { Subject } from 'rxjs';
|
||||
import { SavedSearchesLegacyService } from './saved-searches-legacy.service';
|
||||
@@ -28,7 +27,7 @@ describe('SavedSearchesLegacyService', () => {
|
||||
let service: SavedSearchesLegacyService;
|
||||
let authService: AuthenticationService;
|
||||
let testUserName: string;
|
||||
let getNodeContentSpy: jasmine.Spy;
|
||||
let getNodeContentSpy: jasmine.Spy<jasmine.Func>;
|
||||
|
||||
const testNodeId = 'test-node-id';
|
||||
const SAVED_SEARCHES_NODE_ID = 'saved-searches-node-id__';
|
||||
@@ -49,7 +48,6 @@ describe('SavedSearchesLegacyService', () => {
|
||||
beforeEach(() => {
|
||||
testUserName = 'test-user';
|
||||
TestBed.configureTestingModule({
|
||||
imports: [HttpClientTestingModule],
|
||||
providers: [
|
||||
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
|
||||
{ provide: AuthenticationService, useValue: { getUsername: () => {}, onLogin: new Subject() } },
|
||||
|
||||
@@ -20,7 +20,6 @@ import { AlfrescoApiService } from '../../services/alfresco-api.service';
|
||||
import { AlfrescoApiServiceMock } from '../../mock';
|
||||
import { NodeEntry } from '@alfresco/js-api';
|
||||
import { SavedSearchesService } from './saved-searches.service';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { AuthenticationService } from '@alfresco/adf-core';
|
||||
import { Subject } from 'rxjs';
|
||||
|
||||
@@ -48,7 +47,6 @@ describe('SavedSearchesService', () => {
|
||||
beforeEach(() => {
|
||||
testUserName = 'test-user';
|
||||
TestBed.configureTestingModule({
|
||||
imports: [HttpClientTestingModule],
|
||||
providers: [
|
||||
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
|
||||
{ provide: AuthenticationService, useValue: { getUsername: () => {}, onLogin: new Subject() } },
|
||||
|
||||
Reference in New Issue
Block a user