Skip to content

Commit e1f3cc0

Browse files
117616: Auto-fixed new linting rules
1 parent f14cd51 commit e1f3cc0

File tree

1,307 files changed

+6010
-4116
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,307 files changed

+6010
-4116
lines changed

src/app/access-control/bulk-access/browse/bulk-access-browse.component.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,16 @@ import { BrowserOnlyPipe } from '../../../shared/utils/browser-only.pipe';
5151
},
5252
],
5353
imports: [
54-
PaginationComponent,
5554
AsyncPipe,
55+
BrowserOnlyPipe,
56+
ListableObjectComponentLoaderComponent,
5657
NgbAccordionModule,
57-
TranslateModule,
5858
NgbNavModule,
59-
ThemedSearchComponent,
60-
BrowserOnlyPipe,
6159
NgxPaginationModule,
60+
PaginationComponent,
6261
SelectableListItemControlComponent,
63-
ListableObjectComponentLoaderComponent,
62+
ThemedSearchComponent,
63+
TranslateModule,
6464
],
6565
standalone: true,
6666
})

src/app/access-control/bulk-access/bulk-access.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ import { BulkAccessSettingsComponent } from './settings/bulk-access-settings.com
2626
templateUrl: './bulk-access.component.html',
2727
styleUrls: ['./bulk-access.component.scss'],
2828
imports: [
29-
TranslateModule,
30-
BulkAccessSettingsComponent,
31-
BulkAccessBrowseComponent,
3229
BtnDisabledDirective,
30+
BulkAccessBrowseComponent,
31+
BulkAccessSettingsComponent,
32+
TranslateModule,
3333
],
3434
standalone: true,
3535
changeDetection: ChangeDetectionStrategy.OnPush,

src/app/access-control/bulk-access/settings/bulk-access-settings.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ import { AccessControlFormContainerComponent } from '../../../shared/access-cont
1414
styleUrls: ['./bulk-access-settings.component.scss'],
1515
exportAs: 'dsBulkSettings',
1616
imports: [
17+
AccessControlFormContainerComponent,
1718
NgbAccordionModule,
1819
TranslateModule,
19-
AccessControlFormContainerComponent,
2020
],
2121
standalone: true,
2222
})

src/app/access-control/epeople-registry/epeople-registry.component.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import {
2727
import { TranslateModule } from '@ngx-translate/core';
2828
import {
2929
Observable,
30-
of as observableOf,
30+
of,
3131
} from 'rxjs';
3232

3333
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
@@ -85,7 +85,7 @@ describe('EPeopleRegistryComponent', () => {
8585
}), this.allEpeople));
8686
},
8787
getActiveEPerson(): Observable<EPerson> {
88-
return observableOf(this.activeEPerson);
88+
return of(this.activeEPerson);
8989
},
9090
searchByScope(scope: string, query: string, options: FindListOptions = {}): Observable<RemoteData<PaginatedList<EPerson>>> {
9191
if (scope === 'email') {
@@ -129,7 +129,7 @@ describe('EPeopleRegistryComponent', () => {
129129
this.allEpeople = this.allEpeople.filter((ePerson2: EPerson) => {
130130
return (ePerson2.uuid !== ePerson.uuid);
131131
});
132-
return observableOf(true);
132+
return of(true);
133133
},
134134
editEPerson(ePerson: EPerson) {
135135
this.activeEPerson = ePerson;
@@ -145,7 +145,7 @@ describe('EPeopleRegistryComponent', () => {
145145
},
146146
};
147147
authorizationService = jasmine.createSpyObj('authorizationService', {
148-
isAuthorized: observableOf(true),
148+
isAuthorized: of(true),
149149
});
150150
builderService = getMockFormBuilderService();
151151

@@ -180,7 +180,7 @@ describe('EPeopleRegistryComponent', () => {
180180
fixture = TestBed.createComponent(EPeopleRegistryComponent);
181181
component = fixture.componentInstance;
182182
modalService = TestBed.inject(NgbModal);
183-
spyOn(modalService, 'open').and.returnValue(Object.assign({ componentInstance: Object.assign({ response: observableOf(true) }) }));
183+
spyOn(modalService, 'open').and.returnValue(Object.assign({ componentInstance: Object.assign({ response: of(true) }) }));
184184
fixture.detectChanges();
185185
});
186186

@@ -261,7 +261,7 @@ describe('EPeopleRegistryComponent', () => {
261261

262262

263263
it('should hide delete EPerson button when the isAuthorized returns false', () => {
264-
spyOn(authorizationService, 'isAuthorized').and.returnValue(observableOf(false));
264+
spyOn(authorizationService, 'isAuthorized').and.returnValue(of(false));
265265
component.initialisePage();
266266
fixture.detectChanges();
267267

src/app/access-control/epeople-registry/epeople-registry.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,14 @@ import { EPersonFormComponent } from './eperson-form/eperson-form.component';
6767
selector: 'ds-epeople-registry',
6868
templateUrl: './epeople-registry.component.html',
6969
imports: [
70-
TranslateModule,
71-
RouterModule,
7270
AsyncPipe,
7371
EPersonFormComponent,
72+
NgClass,
73+
PaginationComponent,
7474
ReactiveFormsModule,
75+
RouterModule,
7576
ThemedLoadingComponent,
76-
PaginationComponent,
77-
NgClass,
77+
TranslateModule,
7878
],
7979
standalone: true,
8080
})

src/app/access-control/epeople-registry/eperson-form/eperson-form.component.spec.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
2525
import { TranslateModule } from '@ngx-translate/core';
2626
import {
2727
Observable,
28-
of as observableOf,
28+
of,
2929
} from 'rxjs';
3030

3131
import { AuthService } from '../../../core/auth/auth.service';
@@ -91,7 +91,7 @@ describe('EPersonFormComponent', () => {
9191
activeEPerson: null,
9292
allEpeople: mockEPeople,
9393
getActiveEPerson(): Observable<EPerson> {
94-
return observableOf(this.activeEPerson);
94+
return of(this.activeEPerson);
9595
},
9696
searchByScope(scope: string, query: string, options: FindListOptions = {}): Observable<RemoteData<PaginatedList<EPerson>>> {
9797
if (scope === 'email') {
@@ -115,7 +115,7 @@ describe('EPersonFormComponent', () => {
115115
this.allEpeople = this.allEpeople.filter((ePerson2: EPerson) => {
116116
return (ePerson2.uuid !== ePerson.uuid);
117117
});
118-
return observableOf(true);
118+
return of(true);
119119
},
120120
create(ePerson: EPerson): Observable<RemoteData<EPerson>> {
121121
this.allEpeople = [...this.allEpeople, ePerson];
@@ -210,7 +210,7 @@ describe('EPersonFormComponent', () => {
210210
});
211211
authService = new AuthServiceStub();
212212
authorizationService = jasmine.createSpyObj('authorizationService', {
213-
isAuthorized: observableOf(true),
213+
isAuthorized: of(true),
214214

215215
});
216216
groupsDataService = jasmine.createSpyObj('groupsDataService', {
@@ -389,7 +389,7 @@ describe('EPersonFormComponent', () => {
389389
});
390390
describe('without active EPerson', () => {
391391
beforeEach(() => {
392-
spyOn(ePersonDataServiceStub, 'getActiveEPerson').and.returnValue(observableOf(undefined));
392+
spyOn(ePersonDataServiceStub, 'getActiveEPerson').and.returnValue(of(undefined));
393393
component.onSubmit();
394394
fixture.detectChanges();
395395
});
@@ -429,7 +429,7 @@ describe('EPersonFormComponent', () => {
429429
},
430430
},
431431
});
432-
spyOn(ePersonDataServiceStub, 'getActiveEPerson').and.returnValue(observableOf(expectedWithId));
432+
spyOn(ePersonDataServiceStub, 'getActiveEPerson').and.returnValue(of(expectedWithId));
433433
component.ngOnInit();
434434
component.onSubmit();
435435
fixture.detectChanges();
@@ -485,10 +485,10 @@ describe('EPersonFormComponent', () => {
485485
spyOn(authService, 'impersonate').and.callThrough();
486486
eperson = EPersonMock;
487487
component.epersonInitial = eperson;
488-
component.canDelete$ = observableOf(true);
489-
spyOn(component.epersonService, 'getActiveEPerson').and.returnValue(observableOf(eperson));
488+
component.canDelete$ = of(true);
489+
spyOn(component.epersonService, 'getActiveEPerson').and.returnValue(of(eperson));
490490
modalService = (component as any).modalService;
491-
spyOn(modalService, 'open').and.returnValue(Object.assign({ componentInstance: Object.assign({ response: observableOf(true) }) }));
491+
spyOn(modalService, 'open').and.returnValue(Object.assign({ componentInstance: Object.assign({ response: of(true) }) }));
492492
component.ngOnInit();
493493
fixture.detectChanges();
494494
});
@@ -499,7 +499,7 @@ describe('EPersonFormComponent', () => {
499499
});
500500

501501
it('the delete button should be hidden if the ePerson cannot be deleted', () => {
502-
component.canDelete$ = observableOf(false);
502+
component.canDelete$ = of(false);
503503
fixture.detectChanges();
504504
const deleteButton = fixture.debugElement.query(By.css('.delete-button'));
505505
expect(deleteButton).toBeNull();

src/app/access-control/epeople-registry/eperson-form/eperson-form.component.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import {
2727
import {
2828
combineLatest as observableCombineLatest,
2929
Observable,
30-
of as observableOf,
30+
of,
3131
Subscription,
3232
} from 'rxjs';
3333
import {
@@ -78,14 +78,14 @@ import { ValidateEmailNotTaken } from './validators/email-taken.validator';
7878
selector: 'ds-eperson-form',
7979
templateUrl: './eperson-form.component.html',
8080
imports: [
81-
FormComponent,
8281
AsyncPipe,
83-
TranslateModule,
84-
ThemedLoadingComponent,
82+
BtnDisabledDirective,
83+
FormComponent,
84+
HasNoValuePipe,
8585
PaginationComponent,
8686
RouterLink,
87-
HasNoValuePipe,
88-
BtnDisabledDirective,
87+
ThemedLoadingComponent,
88+
TranslateModule,
8989
],
9090
standalone: true,
9191
})
@@ -357,7 +357,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
357357

358358
this.groups$ = this.activeEPerson$.pipe(
359359
switchMap((eperson) => {
360-
return observableCombineLatest([observableOf(eperson), this.paginationService.getFindListOptions(this.config.id, {
360+
return observableCombineLatest([of(eperson), this.paginationService.getFindListOptions(this.config.id, {
361361
currentPage: 1,
362362
elementsPerPage: this.config.pageSize,
363363
})]);
@@ -366,7 +366,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
366366
if (eperson != null) {
367367
return this.groupsDataService.findListByHref(eperson._links.groups.href, findListOptions, true, true, followLink('object'));
368368
}
369-
return observableOf(undefined);
369+
return of(undefined);
370370
}),
371371
);
372372

@@ -379,14 +379,14 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
379379
if (hasValue(eperson)) {
380380
return this.authorizationService.isAuthorized(FeatureID.LoginOnBehalfOf, eperson.self);
381381
} else {
382-
return observableOf(false);
382+
return of(false);
383383
}
384384
}),
385385
);
386386
this.canDelete$ = this.activeEPerson$.pipe(
387387
switchMap((eperson) => this.authorizationService.isAuthorized(FeatureID.CanDelete, hasValue(eperson) ? eperson.self : undefined)),
388388
);
389-
this.canReset$ = observableOf(true);
389+
this.canReset$ = of(true);
390390
}
391391

392392
/**
@@ -540,16 +540,16 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
540540
take(1),
541541
switchMap((confirm: boolean) => {
542542
if (confirm && hasValue(eperson.id)) {
543-
this.canDelete$ = observableOf(false);
543+
this.canDelete$ = of(false);
544544
return this.epersonService.deleteEPerson(eperson).pipe(
545545
getFirstCompletedRemoteData(),
546546
map((restResponse: RemoteData<NoContent>) => ({ restResponse, eperson })),
547547
);
548548
} else {
549-
return observableOf(null);
549+
return of(null);
550550
}
551551
}),
552-
finalize(() => this.canDelete$ = observableOf(true)),
552+
finalize(() => this.canDelete$ = of(true)),
553553
);
554554
}),
555555
).subscribe(({ restResponse, eperson }: { restResponse: RemoteData<NoContent> | null, eperson: EPerson }) => {

src/app/access-control/group-registry/group-form/group-form.component.spec.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import { TranslateModule } from '@ngx-translate/core';
2727
import { Operation } from 'fast-json-patch';
2828
import {
2929
Observable,
30-
of as observableOf,
30+
of,
3131
} from 'rxjs';
3232

3333
import { DSONameService } from '../../../core/breadcrumbs/dso-name.service';
@@ -116,7 +116,7 @@ describe('GroupFormComponent', () => {
116116
activeGroup: null,
117117
createdGroup: null,
118118
getActiveGroup(): Observable<Group> {
119-
return observableOf(this.activeGroup);
119+
return of(this.activeGroup);
120120
},
121121
getGroupRegistryRouterLink(): string {
122122
return '/access-control/groups';
@@ -137,7 +137,7 @@ describe('GroupFormComponent', () => {
137137
this.activeGroup = null;
138138
},
139139
findById(id: string) {
140-
return observableOf({ payload: null, hasSucceeded: true });
140+
return of({ payload: null, hasSucceeded: true });
141141
},
142142
findByHref(href: string) {
143143
return createSuccessfulRemoteDataObject$(this.createdGroup);
@@ -164,7 +164,7 @@ describe('GroupFormComponent', () => {
164164
},
165165
};
166166
authorizationService = jasmine.createSpyObj('authorizationService', {
167-
isAuthorized: observableOf(true),
167+
isAuthorized: of(true),
168168
});
169169
dsoDataServiceStub = {
170170
findByHref(href: string): Observable<RemoteData<DSpaceObject>> {
@@ -330,7 +330,7 @@ describe('GroupFormComponent', () => {
330330
},
331331
},
332332
});
333-
spyOn(groupsDataServiceStub, 'getActiveGroup').and.returnValue(observableOf(expected));
333+
spyOn(groupsDataServiceStub, 'getActiveGroup').and.returnValue(of(expected));
334334
spyOn(groupsDataServiceStub, 'patch').and.returnValue(createSuccessfulRemoteDataObject$(expected2));
335335
component.ngOnInit();
336336
});
@@ -417,7 +417,7 @@ describe('GroupFormComponent', () => {
417417
},
418418
});
419419
spyOn(component.submitForm, 'emit');
420-
spyOn(dsoDataServiceStub, 'findByHref').and.returnValue(observableOf(expected));
420+
spyOn(dsoDataServiceStub, 'findByHref').and.returnValue(of(expected));
421421

422422
fixture.detectChanges();
423423
component.initialisePage();
@@ -471,11 +471,11 @@ describe('GroupFormComponent', () => {
471471

472472
beforeEach(async () => {
473473
spyOn(groupsDataServiceStub, 'delete').and.callThrough();
474-
component.activeGroup$ = observableOf({
474+
component.activeGroup$ = of({
475475
id: 'active-group',
476476
permanent: false,
477477
} as Group);
478-
component.canEdit$ = observableOf(true);
478+
component.canEdit$ = of(true);
479479

480480
component.initialisePage();
481481

src/app/access-control/group-registry/group-form/group-form.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,13 @@ import { ValidateGroupExists } from './validators/group-exists.validator';
8787
selector: 'ds-group-form',
8888
templateUrl: './group-form.component.html',
8989
imports: [
90-
FormComponent,
9190
AlertComponent,
9291
AsyncPipe,
93-
TranslateModule,
9492
ContextHelpDirective,
93+
FormComponent,
9594
MembersListComponent,
9695
SubgroupsListComponent,
96+
TranslateModule,
9797
],
9898
standalone: true,
9999
})

0 commit comments

Comments
 (0)