Skip to content

Commit

Permalink
Autofix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ybnd committed Dec 19, 2023
1 parent 4a87c9a commit ca1d810
Show file tree
Hide file tree
Showing 58 changed files with 1,590 additions and 1,359 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,16 @@ import { RouterModule } from '@angular/router';
import { AuthenticatedGuard } from '../../core/auth/authenticated.guard';
import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver';
import { I18nBreadcrumbsService } from '../../core/breadcrumbs/i18n-breadcrumbs.service';
import { QualityAssuranceBreadcrumbResolver } from '../../core/breadcrumbs/quality-assurance-breadcrumb.resolver';
import { QualityAssuranceBreadcrumbService } from '../../core/breadcrumbs/quality-assurance-breadcrumb.service';
import { QUALITY_ASSURANCE_EDIT_PATH } from './admin-notifications-routing-paths';
import { AdminQualityAssuranceTopicsPageComponent } from './admin-quality-assurance-topics-page/admin-quality-assurance-topics-page.component';
import { AdminQualityAssuranceEventsPageComponent } from './admin-quality-assurance-events-page/admin-quality-assurance-events-page.component';
import { AdminQualityAssuranceTopicsPageResolver } from './admin-quality-assurance-topics-page/admin-quality-assurance-topics-page-resolver.service';
import { AdminQualityAssuranceEventsPageResolver } from './admin-quality-assurance-events-page/admin-quality-assurance-events-page.resolver';
import { SourceDataResolver } from './admin-quality-assurance-source-page-component/admin-quality-assurance-source-data.resolver';
import { AdminQualityAssuranceSourcePageComponent } from './admin-quality-assurance-source-page-component/admin-quality-assurance-source-page.component';
import { AdminQualityAssuranceSourcePageResolver } from './admin-quality-assurance-source-page-component/admin-quality-assurance-source-page-resolver.service';
import { QualityAssuranceBreadcrumbResolver } from '../../core/breadcrumbs/quality-assurance-breadcrumb.resolver';
import { QualityAssuranceBreadcrumbService } from '../../core/breadcrumbs/quality-assurance-breadcrumb.service';
import {
SourceDataResolver
} from './admin-quality-assurance-source-page-component/admin-quality-assurance-source-data.resolver';
import { AdminQualityAssuranceTopicsPageComponent } from './admin-quality-assurance-topics-page/admin-quality-assurance-topics-page.component';
import { AdminQualityAssuranceTopicsPageResolver } from './admin-quality-assurance-topics-page/admin-quality-assurance-topics-page-resolver.service';

@NgModule({
imports: [
Expand All @@ -27,13 +25,13 @@ import {
pathMatch: 'full',
resolve: {
breadcrumb: QualityAssuranceBreadcrumbResolver,
openaireQualityAssuranceTopicsParams: AdminQualityAssuranceTopicsPageResolver
openaireQualityAssuranceTopicsParams: AdminQualityAssuranceTopicsPageResolver,
},
data: {
title: 'admin.quality-assurance.page.title',
breadcrumbKey: 'admin.quality-assurance',
showBreadcrumbsFluid: false
}
showBreadcrumbsFluid: false,
},
},
{
canActivate: [ AuthenticatedGuard ],
Expand All @@ -43,13 +41,13 @@ import {
resolve: {
breadcrumb: I18nBreadcrumbResolver,
openaireQualityAssuranceSourceParams: AdminQualityAssuranceSourcePageResolver,
sourceData: SourceDataResolver
sourceData: SourceDataResolver,
},
data: {
title: 'admin.notifications.source.breadcrumbs',
breadcrumbKey: 'admin.notifications.source',
showBreadcrumbsFluid: false
}
showBreadcrumbsFluid: false,
},
},
{
canActivate: [ AuthenticatedGuard ],
Expand All @@ -58,15 +56,15 @@ import {
pathMatch: 'full',
resolve: {
breadcrumb: QualityAssuranceBreadcrumbResolver,
openaireQualityAssuranceEventsParams: AdminQualityAssuranceEventsPageResolver
openaireQualityAssuranceEventsParams: AdminQualityAssuranceEventsPageResolver,
},
data: {
title: 'admin.notifications.event.page.title',
breadcrumbKey: 'admin.notifications.event',
showBreadcrumbsFluid: false
}
}
])
showBreadcrumbsFluid: false,
},
},
]),
],
providers: [
I18nBreadcrumbResolver,
Expand All @@ -76,8 +74,8 @@ import {
AdminQualityAssuranceEventsPageResolver,
AdminQualityAssuranceSourcePageResolver,
QualityAssuranceBreadcrumbResolver,
QualityAssuranceBreadcrumbService
]
QualityAssuranceBreadcrumbService,
],
})
/**
* Routing module for the Notifications section of the admin sidebar
Expand Down
11 changes: 6 additions & 5 deletions src/app/admin/admin-notifications/admin-notifications.module.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';

import { CoreModule } from '../../core/core.module';
import { NotificationsModule } from '../../notifications/notifications.module';
import { SharedModule } from '../../shared/shared.module';
import { AdminNotificationsRoutingModule } from './admin-notifications-routing.module';
import { AdminQualityAssuranceTopicsPageComponent } from './admin-quality-assurance-topics-page/admin-quality-assurance-topics-page.component';
import { AdminQualityAssuranceEventsPageComponent } from './admin-quality-assurance-events-page/admin-quality-assurance-events-page.component';
import { AdminQualityAssuranceSourcePageComponent } from './admin-quality-assurance-source-page-component/admin-quality-assurance-source-page.component';
import {NotificationsModule} from '../../notifications/notifications.module';
import { AdminQualityAssuranceTopicsPageComponent } from './admin-quality-assurance-topics-page/admin-quality-assurance-topics-page.component';

@NgModule({
imports: [
CommonModule,
SharedModule,
CoreModule.forRoot(),
AdminNotificationsRoutingModule,
NotificationsModule
NotificationsModule,
],
declarations: [
AdminQualityAssuranceTopicsPageComponent,
AdminQualityAssuranceEventsPageComponent,
AdminQualityAssuranceSourcePageComponent
AdminQualityAssuranceSourcePageComponent,
],
entryComponents: []
entryComponents: [],
})
/**
* This module handles all components related to the notifications pages
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { NO_ERRORS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import {
async,
ComponentFixture,
TestBed,
} from '@angular/core/testing';

import { AdminQualityAssuranceEventsPageComponent } from './admin-quality-assurance-events-page.component';

describe('AdminQualityAssuranceEventsPageComponent', () => {
Expand All @@ -9,9 +14,9 @@ describe('AdminQualityAssuranceEventsPageComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AdminQualityAssuranceEventsPageComponent ],
schemas: [NO_ERRORS_SCHEMA]
schemas: [NO_ERRORS_SCHEMA],
})
.compileComponents();
.compileComponents();
}));

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Component } from '@angular/core';
*/
@Component({
selector: 'ds-quality-assurance-events-page',
templateUrl: './admin-quality-assurance-events-page.component.html'
templateUrl: './admin-quality-assurance-events-page.component.html',
})
export class AdminQualityAssuranceEventsPageComponent {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { Injectable } from '@angular/core';
import { Resolve, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
import {
ActivatedRouteSnapshot,
Resolve,
RouterStateSnapshot,
} from '@angular/router';

/**
* Interface for the route parameters.
Expand All @@ -26,7 +30,7 @@ export class AdminQualityAssuranceEventsPageResolver implements Resolve<AdminQua
return {
pageId: route.queryParams.pageId,
pageSize: parseInt(route.queryParams.pageSize, 10),
currentPage: parseInt(route.queryParams.page, 10)
currentPage: parseInt(route.queryParams.page, 10),
};
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
import { Injectable } from '@angular/core';
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot, Router } from '@angular/router';
import {
ActivatedRouteSnapshot,
Resolve,
Router,
RouterStateSnapshot,
} from '@angular/router';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';

import { environment } from '../../../../environments/environment';
import { PaginatedList } from '../../../core/data/paginated-list.model';
import { QualityAssuranceSourceObject } from '../../../core/notifications/qa/models/quality-assurance-source.model';
import { QualityAssuranceSourceService } from '../../../notifications/qa/source/quality-assurance-source.service';
import {environment} from '../../../../environments/environment';
/**
* This class represents a resolver that retrieve the route data before the route is activated.
*/
Expand All @@ -16,9 +22,9 @@ export class SourceDataResolver implements Resolve<Observable<QualityAssuranceSo
* Initialize the effect class variables.
* @param {QualityAssuranceSourceService} qualityAssuranceSourceService
*/
constructor(
constructor(
private qualityAssuranceSourceService: QualityAssuranceSourceService,
private router: Router
private router: Router,
) { }
/**
* Method for resolving the parameters in the current route.
Expand All @@ -28,12 +34,12 @@ export class SourceDataResolver implements Resolve<Observable<QualityAssuranceSo
*/
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<QualityAssuranceSourceObject[]> {
return this.qualityAssuranceSourceService.getSources(this.pageSize, 0).pipe(
map((sources: PaginatedList<QualityAssuranceSourceObject>) => {
if (sources.page.length === 1) {
this.router.navigate([this.getResolvedUrl(route) + '/' + sources.page[0].id]);
}
return sources.page;
}));
map((sources: PaginatedList<QualityAssuranceSourceObject>) => {
if (sources.page.length === 1) {
this.router.navigate([this.getResolvedUrl(route) + '/' + sources.page[0].id]);
}
return sources.page;
}));
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { Injectable } from '@angular/core';
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
import {
ActivatedRouteSnapshot,
Resolve,
RouterStateSnapshot,
} from '@angular/router';

/**
* Interface for the route parameters.
Expand All @@ -26,7 +30,7 @@ export class AdminQualityAssuranceSourcePageResolver implements Resolve<AdminQua
return {
pageId: route.queryParams.pageId,
pageSize: parseInt(route.queryParams.pageSize, 10),
currentPage: parseInt(route.queryParams.page, 10)
currentPage: parseInt(route.queryParams.page, 10),
};
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { NO_ERRORS_SCHEMA } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import {
ComponentFixture,
TestBed,
} from '@angular/core/testing';

import { AdminQualityAssuranceSourcePageComponent } from './admin-quality-assurance-source-page.component';

Expand All @@ -10,9 +13,9 @@ describe('AdminQualityAssuranceSourcePageComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ AdminQualityAssuranceSourcePageComponent ],
schemas: [NO_ERRORS_SCHEMA]
schemas: [NO_ERRORS_SCHEMA],
})
.compileComponents();
.compileComponents();
});

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { Injectable } from '@angular/core';
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
import {
ActivatedRouteSnapshot,
Resolve,
RouterStateSnapshot,
} from '@angular/router';

/**
* Interface for the route parameters.
Expand All @@ -26,7 +30,7 @@ export class AdminQualityAssuranceTopicsPageResolver implements Resolve<AdminQua
return {
pageId: route.queryParams.pageId,
pageSize: parseInt(route.queryParams.pageSize, 10),
currentPage: parseInt(route.queryParams.page, 10)
currentPage: parseInt(route.queryParams.page, 10),
};
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { NO_ERRORS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import {
async,
ComponentFixture,
TestBed,
} from '@angular/core/testing';

import { AdminQualityAssuranceTopicsPageComponent } from './admin-quality-assurance-topics-page.component';

describe('AdminQualityAssuranceTopicsPageComponent', () => {
Expand All @@ -9,9 +14,9 @@ describe('AdminQualityAssuranceTopicsPageComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AdminQualityAssuranceTopicsPageComponent ],
schemas: [NO_ERRORS_SCHEMA]
schemas: [NO_ERRORS_SCHEMA],
})
.compileComponents();
.compileComponents();
}));

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Component } from '@angular/core';
*/
@Component({
selector: 'ds-notification-qa-page',
templateUrl: './admin-quality-assurance-topics-page.component.html'
templateUrl: './admin-quality-assurance-topics-page.component.html',
})
export class AdminQualityAssuranceTopicsPageComponent {

Expand Down
2 changes: 1 addition & 1 deletion src/app/admin/admin-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { AdminCurationTasksComponent } from './admin-curation-tasks/admin-curati
import { BatchImportPageComponent } from './admin-import-batch-page/batch-import-page.component';
import { MetadataImportPageComponent } from './admin-import-metadata-page/metadata-import-page.component';
import {
NOTIFICATIONS_MODULE_PATH,
REGISTRIES_MODULE_PATH,
NOTIFICATIONS_MODULE_PATH
} from './admin-routing-paths';
import { AdminSearchPageComponent } from './admin-search-page/admin-search-page.component';
import { AdminWorkflowPageComponent } from './admin-workflow-page/admin-workflow-page.component';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {QualityAssuranceBreadcrumbResolver} from './quality-assurance-breadcrumb.resolver';
import { QualityAssuranceBreadcrumbResolver } from './quality-assurance-breadcrumb.resolver';

describe('QualityAssuranceBreadcrumbResolver', () => {
describe('resolve', () => {
Expand All @@ -15,15 +15,15 @@ describe('QualityAssuranceBreadcrumbResolver', () => {
return this[param];
},
sourceId: 'testSourceId',
topicId: 'testTopicId'
}
topicId: 'testTopicId',
},
};
qualityAssuranceBreadcrumbService = {};
resolver = new QualityAssuranceBreadcrumbResolver(qualityAssuranceBreadcrumbService);
});

it('should resolve the breadcrumb config', () => {
const resolvedConfig = resolver.resolve(route as any, {url: fullPath + 'testSourceId'} as any);
const resolvedConfig = resolver.resolve(route as any, { url: fullPath + 'testSourceId' } as any);
const expectedConfig = { provider: qualityAssuranceBreadcrumbService, key: expectedKey, url: fullPath };
expect(resolvedConfig).toEqual(expectedConfig);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import { Injectable } from '@angular/core';
import {QualityAssuranceBreadcrumbService} from './quality-assurance-breadcrumb.service';
import {ActivatedRouteSnapshot, Resolve, RouterStateSnapshot} from '@angular/router';
import {BreadcrumbConfig} from '../../breadcrumbs/breadcrumb/breadcrumb-config.model';
import {
ActivatedRouteSnapshot,
Resolve,
RouterStateSnapshot,
} from '@angular/router';

import { BreadcrumbConfig } from '../../breadcrumbs/breadcrumb/breadcrumb-config.model';
import { QualityAssuranceBreadcrumbService } from './quality-assurance-breadcrumb.service';

@Injectable({
providedIn: 'root'
providedIn: 'root',
})
export class QualityAssuranceBreadcrumbResolver implements Resolve<BreadcrumbConfig<string>> {
constructor(protected breadcrumbService: QualityAssuranceBreadcrumbService) {}
Expand Down
Loading

0 comments on commit ca1d810

Please sign in to comment.