('notifications');
diff --git a/src/app/notifications/broker/events/notifications-broker-events.component.html b/src/app/notifications/qa/events/quality-assurance-events.component.html
similarity index 98%
rename from src/app/notifications/broker/events/notifications-broker-events.component.html
rename to src/app/notifications/qa/events/quality-assurance-events.component.html
index a9f51cefd0..40fa75943f 100644
--- a/src/app/notifications/broker/events/notifications-broker-events.component.html
+++ b/src/app/notifications/qa/events/quality-assurance-events.component.html
@@ -4,7 +4,7 @@
{{'notifications.events.title'| translate}}
{{'notifications.broker.events.description'| translate}}
-
+
{{'notifications.broker.events.back' | translate}}
@@ -23,7 +23,7 @@
[paginationOptions]="paginationConfig"
[collectionSize]="(totalElements$ | async)"
[sortOptions]="paginationSortConfig"
- (paginationChange)="getNotificationsBrokerEvents()">
+ (paginationChange)="getQualityAssuranceEvents()">
@@ -140,7 +140,7 @@
-
+
{{'notifications.broker.events.back' | translate}}
diff --git a/src/app/notifications/broker/events/notifications-broker-events.component.spec.ts b/src/app/notifications/qa/events/quality-assurance-events.component.spec.ts
similarity index 66%
rename from src/app/notifications/broker/events/notifications-broker-events.component.spec.ts
rename to src/app/notifications/qa/events/quality-assurance-events.component.spec.ts
index 40be083567..976d8540e3 100644
--- a/src/app/notifications/broker/events/notifications-broker-events.component.spec.ts
+++ b/src/app/notifications/qa/events/quality-assurance-events.component.spec.ts
@@ -5,15 +5,15 @@ import { ComponentFixture, inject, TestBed, waitForAsync } from '@angular/core/t
import { TranslateModule, TranslateService } from '@ngx-translate/core';
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { of as observableOf } from 'rxjs';
-import { NotificationsBrokerEventRestService } from '../../../core/notifications/broker/events/notifications-broker-event-rest.service';
-import { NotificationsBrokerEventsComponent } from './notifications-broker-events.component';
+import { QualityAssuranceEventRestService } from '../../../core/notifications/qa/events/quality-assurance-event-rest.service';
+import { QualityAssuranceEventsComponent } from './quality-assurance-events.component';
import {
- getMockNotificationsBrokerEventRestService,
+ getMockQualityAssuranceEventRestService,
ItemMockPid10,
ItemMockPid8,
ItemMockPid9,
- notificationsBrokerEventObjectMissingProjectFound,
- notificationsBrokerEventObjectMissingProjectNotFound,
+ qualityAssuranceEventObjectMissingProjectFound,
+ qualityAssuranceEventObjectMissingProjectNotFound,
NotificationsMockDspaceObject
} from '../../../shared/mocks/notifications.mock';
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub';
@@ -22,8 +22,8 @@ import { getMockTranslateService } from '../../../shared/mocks/translate.service
import { createTestComponent } from '../../../shared/testing/utils.test';
import { ActivatedRouteStub } from '../../../shared/testing/active-router.stub';
import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model';
-import { NotificationsBrokerEventObject } from '../../../core/notifications/broker/models/notifications-broker-event.model';
-import { NotificationsBrokerEventData } from '../project-entry-import-modal/project-entry-import-modal.component';
+import { QualityAssuranceEventObject } from '../../../core/notifications/qa/models/quality-assurance-event.model';
+import { QualityAssuranceEventData } from '../project-entry-import-modal/project-entry-import-modal.component';
import { TestScheduler } from 'rxjs/testing';
import { getTestScheduler } from 'jasmine-marbles';
import { followLink } from '../../../shared/utils/follow-link-config.model';
@@ -34,14 +34,14 @@ import {
createSuccessfulRemoteDataObject,
createSuccessfulRemoteDataObject$
} from '../../../shared/remote-data.utils';
-import { FindListOptions } from '../../../core/data/request.models';
import { SortDirection, SortOptions } from '../../../core/cache/models/sort-options.model';
import { PaginationService } from '../../../core/pagination/pagination.service';
import { PaginationServiceStub } from '../../../shared/testing/pagination-service.stub';
+import {FindListOptions} from '../../../core/data/find-list-options.model';
-describe('NotificationsBrokerEventsComponent test suite', () => {
- let fixture: ComponentFixture
;
- let comp: NotificationsBrokerEventsComponent;
+describe('QualityAssuranceEventsComponent test suite', () => {
+ let fixture: ComponentFixture;
+ let comp: QualityAssuranceEventsComponent;
let compAsAny: any;
let scheduler: TestScheduler;
@@ -50,9 +50,9 @@ describe('NotificationsBrokerEventsComponent test suite', () => {
close: () => null,
dismiss: () => null
};
- const notificationsBrokerEventRestServiceStub: any = getMockNotificationsBrokerEventRestService();
+ const qualityAssuranceEventRestServiceStub: any = getMockQualityAssuranceEventRestService();
const activatedRouteParams = {
- notificationsBrokerEventsParams: {
+ qualityAssuranceEventsParams: {
currentPage: 0,
pageSize: 10
}
@@ -61,19 +61,19 @@ describe('NotificationsBrokerEventsComponent test suite', () => {
id: 'ENRICH!MISSING!PROJECT'
};
- const events: NotificationsBrokerEventObject[] = [
- notificationsBrokerEventObjectMissingProjectFound,
- notificationsBrokerEventObjectMissingProjectNotFound
+ const events: QualityAssuranceEventObject[] = [
+ qualityAssuranceEventObjectMissingProjectFound,
+ qualityAssuranceEventObjectMissingProjectNotFound
];
const paginationService = new PaginationServiceStub();
- function getNotificationsBrokerEventData1(): NotificationsBrokerEventData {
+ function getQualityAssuranceEventData1(): QualityAssuranceEventData {
return {
- event: notificationsBrokerEventObjectMissingProjectFound,
- id: notificationsBrokerEventObjectMissingProjectFound.id,
- title: notificationsBrokerEventObjectMissingProjectFound.title,
+ event: qualityAssuranceEventObjectMissingProjectFound,
+ id: qualityAssuranceEventObjectMissingProjectFound.id,
+ title: qualityAssuranceEventObjectMissingProjectFound.title,
hasProject: true,
- projectTitle: notificationsBrokerEventObjectMissingProjectFound.message.title,
+ projectTitle: qualityAssuranceEventObjectMissingProjectFound.message.title,
projectId: ItemMockPid10.id,
handle: ItemMockPid10.handle,
reason: null,
@@ -82,11 +82,11 @@ describe('NotificationsBrokerEventsComponent test suite', () => {
};
}
- function getNotificationsBrokerEventData2(): NotificationsBrokerEventData {
+ function getQualityAssuranceEventData2(): QualityAssuranceEventData {
return {
- event: notificationsBrokerEventObjectMissingProjectNotFound,
- id: notificationsBrokerEventObjectMissingProjectNotFound.id,
- title: notificationsBrokerEventObjectMissingProjectNotFound.title,
+ event: qualityAssuranceEventObjectMissingProjectNotFound,
+ id: qualityAssuranceEventObjectMissingProjectNotFound.id,
+ title: qualityAssuranceEventObjectMissingProjectNotFound.title,
hasProject: false,
projectTitle: null,
projectId: null,
@@ -104,17 +104,17 @@ describe('NotificationsBrokerEventsComponent test suite', () => {
TranslateModule.forRoot(),
],
declarations: [
- NotificationsBrokerEventsComponent,
+ QualityAssuranceEventsComponent,
TestComponent,
],
providers: [
{ provide: ActivatedRoute, useValue: new ActivatedRouteStub(activatedRouteParamsMap, activatedRouteParams) },
- { provide: NotificationsBrokerEventRestService, useValue: notificationsBrokerEventRestServiceStub },
+ { provide: QualityAssuranceEventRestService, useValue: qualityAssuranceEventRestServiceStub },
{ provide: NgbModal, useValue: modalStub },
{ provide: NotificationsService, useValue: new NotificationsServiceStub() },
{ provide: TranslateService, useValue: getMockTranslateService() },
{ provide: PaginationService, useValue: paginationService },
- NotificationsBrokerEventsComponent
+ QualityAssuranceEventsComponent
],
schemas: [NO_ERRORS_SCHEMA]
}).compileComponents().then();
@@ -129,7 +129,7 @@ describe('NotificationsBrokerEventsComponent test suite', () => {
// synchronous beforeEach
beforeEach(() => {
const html = `
- `;
+ `;
testFixture = createTestComponent(html, TestComponent) as ComponentFixture;
testComp = testFixture.componentInstance;
});
@@ -138,14 +138,14 @@ describe('NotificationsBrokerEventsComponent test suite', () => {
testFixture.destroy();
});
- it('should create NotificationsBrokerEventsComponent', inject([NotificationsBrokerEventsComponent], (app: NotificationsBrokerEventsComponent) => {
+ it('should create QualityAssuranceEventsComponent', inject([QualityAssuranceEventsComponent], (app: QualityAssuranceEventsComponent) => {
expect(app).toBeDefined();
}));
});
describe('Main tests', () => {
beforeEach(() => {
- fixture = TestBed.createComponent(NotificationsBrokerEventsComponent);
+ fixture = TestBed.createComponent(QualityAssuranceEventsComponent);
comp = fixture.componentInstance;
compAsAny = comp;
});
@@ -159,8 +159,8 @@ describe('NotificationsBrokerEventsComponent test suite', () => {
describe('setEventUpdated', () => {
it('should update events', () => {
const expected = [
- getNotificationsBrokerEventData1(),
- getNotificationsBrokerEventData2()
+ getQualityAssuranceEventData1(),
+ getQualityAssuranceEventData2()
];
scheduler.schedule(() => {
compAsAny.setEventUpdated(events);
@@ -179,14 +179,14 @@ describe('NotificationsBrokerEventsComponent test suite', () => {
it('should call executeAction if a project is present', () => {
const action = 'ACCEPTED';
- comp.modalChoice(action, getNotificationsBrokerEventData1(), modalStub);
- expect(comp.executeAction).toHaveBeenCalledWith(action, getNotificationsBrokerEventData1());
+ comp.modalChoice(action, getQualityAssuranceEventData1(), modalStub);
+ expect(comp.executeAction).toHaveBeenCalledWith(action, getQualityAssuranceEventData1());
});
it('should call openModal if a project is not present', () => {
const action = 'ACCEPTED';
- comp.modalChoice(action, getNotificationsBrokerEventData2(), modalStub);
- expect(comp.openModal).toHaveBeenCalledWith(action, getNotificationsBrokerEventData2(), modalStub);
+ comp.modalChoice(action, getQualityAssuranceEventData2(), modalStub);
+ expect(comp.openModal).toHaveBeenCalledWith(action, getQualityAssuranceEventData2(), modalStub);
});
});
@@ -197,7 +197,7 @@ describe('NotificationsBrokerEventsComponent test suite', () => {
spyOn(compAsAny.modalService, 'open').and.returnValue({ result: new Promise((res, rej) => 'do' ) });
spyOn(comp, 'executeAction');
- comp.openModal(action, getNotificationsBrokerEventData1(), modalStub);
+ comp.openModal(action, getQualityAssuranceEventData1(), modalStub);
expect(compAsAny.modalService.open).toHaveBeenCalled();
});
});
@@ -217,7 +217,7 @@ describe('NotificationsBrokerEventsComponent test suite', () => {
}
);
scheduler.schedule(() => {
- comp.openModalLookup(getNotificationsBrokerEventData1());
+ comp.openModalLookup(getQualityAssuranceEventData1());
});
scheduler.flush();
@@ -227,27 +227,27 @@ describe('NotificationsBrokerEventsComponent test suite', () => {
});
describe('executeAction', () => {
- it('should call getNotificationsBrokerEvents on 200 response from REST', () => {
+ it('should call getQualityAssuranceEvents on 200 response from REST', () => {
const action = 'ACCEPTED';
- spyOn(compAsAny, 'getNotificationsBrokerEvents');
- notificationsBrokerEventRestServiceStub.patchEvent.and.returnValue(createSuccessfulRemoteDataObject$({}));
+ spyOn(compAsAny, 'getQualityAssuranceEvents');
+ qualityAssuranceEventRestServiceStub.patchEvent.and.returnValue(createSuccessfulRemoteDataObject$({}));
scheduler.schedule(() => {
- comp.executeAction(action, getNotificationsBrokerEventData1());
+ comp.executeAction(action, getQualityAssuranceEventData1());
});
scheduler.flush();
- expect(compAsAny.getNotificationsBrokerEvents).toHaveBeenCalled();
+ expect(compAsAny.getQualityAssuranceEvents).toHaveBeenCalled();
});
});
describe('boundProject', () => {
it('should populate the project data inside "eventData"', () => {
- const eventData = getNotificationsBrokerEventData2();
+ const eventData = getQualityAssuranceEventData2();
const projectId = 'UUID-23943-34u43-38344';
const projectName = 'Test Project';
const projectHandle = '1000/1000';
- notificationsBrokerEventRestServiceStub.boundProject.and.returnValue(createSuccessfulRemoteDataObject$({}));
+ qualityAssuranceEventRestServiceStub.boundProject.and.returnValue(createSuccessfulRemoteDataObject$({}));
scheduler.schedule(() => {
comp.boundProject(eventData, projectId, projectName, projectHandle);
@@ -263,8 +263,8 @@ describe('NotificationsBrokerEventsComponent test suite', () => {
describe('removeProject', () => {
it('should remove the project data inside "eventData"', () => {
- const eventData = getNotificationsBrokerEventData1();
- notificationsBrokerEventRestServiceStub.removeProject.and.returnValue(createNoContentRemoteDataObject$());
+ const eventData = getQualityAssuranceEventData1();
+ qualityAssuranceEventRestServiceStub.removeProject.and.returnValue(createNoContentRemoteDataObject$());
scheduler.schedule(() => {
comp.removeProject(eventData);
@@ -278,8 +278,8 @@ describe('NotificationsBrokerEventsComponent test suite', () => {
});
});
- describe('getNotificationsBrokerEvents', () => {
- it('should call the "notificationsBrokerEventRestService.getEventsByTopic" to take data and "setEventUpdated" to populate eventData', () => {
+ describe('getQualityAssuranceEvents', () => {
+ it('should call the "qualityAssuranceEventRestService.getEventsByTopic" to take data and "setEventUpdated" to populate eventData', () => {
comp.paginationConfig = new PaginationComponentOptions();
comp.paginationConfig.currentPage = 1;
comp.paginationConfig.pageSize = 20;
@@ -297,20 +297,20 @@ describe('NotificationsBrokerEventsComponent test suite', () => {
currentPage: comp.paginationConfig.currentPage
});
const array = [
- notificationsBrokerEventObjectMissingProjectFound,
- notificationsBrokerEventObjectMissingProjectNotFound,
+ qualityAssuranceEventObjectMissingProjectFound,
+ qualityAssuranceEventObjectMissingProjectNotFound,
];
const paginatedList = buildPaginatedList(pageInfo, array);
const paginatedListRD = createSuccessfulRemoteDataObject(paginatedList);
- notificationsBrokerEventRestServiceStub.getEventsByTopic.and.returnValue(observableOf(paginatedListRD));
+ qualityAssuranceEventRestServiceStub.getEventsByTopic.and.returnValue(observableOf(paginatedListRD));
spyOn(compAsAny, 'setEventUpdated');
scheduler.schedule(() => {
- compAsAny.getNotificationsBrokerEvents();
+ compAsAny.getQualityAssuranceEvents();
});
scheduler.flush();
- expect(compAsAny.notificationsBrokerEventRestService.getEventsByTopic).toHaveBeenCalledWith(
+ expect(compAsAny.qualityAssuranceEventRestService.getEventsByTopic).toHaveBeenCalledWith(
activatedRouteParamsMap.id,
options,
followLink('target'),followLink('related')
diff --git a/src/app/notifications/broker/events/notifications-broker-events.component.ts b/src/app/notifications/qa/events/quality-assurance-events.component.ts
similarity index 74%
rename from src/app/notifications/broker/events/notifications-broker-events.component.ts
rename to src/app/notifications/qa/events/quality-assurance-events.component.ts
index 7639554c55..aa47bfc590 100644
--- a/src/app/notifications/broker/events/notifications-broker-events.component.ts
+++ b/src/app/notifications/qa/events/quality-assurance-events.component.ts
@@ -9,12 +9,11 @@ import { distinctUntilChanged, map, mergeMap, scan, switchMap, take } from 'rxjs
import { SortDirection, SortOptions } from '../../../core/cache/models/sort-options.model';
import { PaginatedList } from '../../../core/data/paginated-list.model';
import { RemoteData } from '../../../core/data/remote-data';
-import { FindListOptions } from '../../../core/data/request.models';
import {
- NotificationsBrokerEventObject,
+ QualityAssuranceEventObject,
OpenaireBrokerEventMessageObject
-} from '../../../core/notifications/broker/models/notifications-broker-event.model';
-import { NotificationsBrokerEventRestService } from '../../../core/notifications/broker/events/notifications-broker-event-rest.service';
+} from '../../../core/notifications/qa/models/quality-assurance-event.model';
+import { QualityAssuranceEventRestService } from '../../../core/notifications/qa/events/quality-assurance-event-rest.service';
import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model';
import { Metadata } from '../../../core/shared/metadata.utils';
import { followLink } from '../../../shared/utils/follow-link-config.model';
@@ -22,23 +21,24 @@ import { hasValue } from '../../../shared/empty.util';
import { ItemSearchResult } from '../../../shared/object-collection/shared/item-search-result.model';
import { NotificationsService } from '../../../shared/notifications/notifications.service';
import {
- NotificationsBrokerEventData,
+ QualityAssuranceEventData,
ProjectEntryImportModalComponent
} from '../project-entry-import-modal/project-entry-import-modal.component';
import { getFirstCompletedRemoteData } from '../../../core/shared/operators';
import { PaginationService } from '../../../core/pagination/pagination.service';
import { combineLatest } from 'rxjs/internal/observable/combineLatest';
import { Item } from '../../../core/shared/item.model';
+import {FindListOptions} from '../../../core/data/find-list-options.model';
/**
- * Component to display the Notifications Broker event list.
+ * Component to display the Quality Assurance event list.
*/
@Component({
- selector: 'ds-notifications-broker-events',
- templateUrl: './notifications-broker-events.component.html',
- styleUrls: ['./notifications-broker-events.scomponent.scss'],
+ selector: 'ds-quality-assurance-events',
+ templateUrl: './quality-assurance-events.component.html',
+ styleUrls: ['./quality-assurance-events.scomponent.scss'],
})
-export class NotificationsBrokerEventsComponent implements OnInit {
+export class QualityAssuranceEventsComponent implements OnInit {
/**
* The pagination system configuration for HTML listing.
* @type {PaginationComponentOptions}
@@ -50,27 +50,27 @@ export class NotificationsBrokerEventsComponent implements OnInit {
pageSizeOptions: [5, 10, 20, 40, 60]
});
/**
- * The Notifications Broker event list sort options.
+ * The Quality Assurance event list sort options.
* @type {SortOptions}
*/
public paginationSortConfig: SortOptions = new SortOptions('trust', SortDirection.DESC);
/**
- * Array to save the presence of a project inside an Notifications Broker event.
- * @type {NotificationsBrokerEventData[]>}
+ * Array to save the presence of a project inside an Quality Assurance event.
+ * @type {QualityAssuranceEventData[]>}
*/
- public eventsUpdated$: BehaviorSubject = new BehaviorSubject([]);
+ public eventsUpdated$: BehaviorSubject = new BehaviorSubject([]);
/**
- * The total number of Notifications Broker events.
+ * The total number of Quality Assurance events.
* @type {Observable}
*/
public totalElements$: Observable;
/**
- * The topic of the Notifications Broker events; suitable for displaying.
+ * The topic of the Quality Assurance events; suitable for displaying.
* @type {string}
*/
public showTopic: string;
/**
- * The topic of the Notifications Broker events; suitable for HTTP calls.
+ * The topic of the Quality Assurance events; suitable for HTTP calls.
* @type {string}
*/
public topic: string;
@@ -114,7 +114,7 @@ export class NotificationsBrokerEventsComponent implements OnInit {
* @param {ActivatedRoute} activatedRoute
* @param {NgbModal} modalService
* @param {NotificationsService} notificationsService
- * @param {NotificationsBrokerEventRestService} notificationsBrokerEventRestService
+ * @param {QualityAssuranceEventRestService} qualityAssuranceEventRestService
* @param {PaginationService} paginationService
* @param {TranslateService} translateService
*/
@@ -122,7 +122,7 @@ export class NotificationsBrokerEventsComponent implements OnInit {
private activatedRoute: ActivatedRoute,
private modalService: NgbModal,
private notificationsService: NotificationsService,
- private notificationsBrokerEventRestService: NotificationsBrokerEventRestService,
+ private qualityAssuranceEventRestService: QualityAssuranceEventRestService,
private paginationService: PaginationService,
private translateService: TranslateService
) {
@@ -142,7 +142,7 @@ export class NotificationsBrokerEventsComponent implements OnInit {
this.showTopic = id.replace(regEx, '/');
this.topic = id;
this.isEventPageLoading.next(false);
- this.getNotificationsBrokerEvents();
+ this.getQualityAssuranceEvents();
});
}
@@ -162,12 +162,12 @@ export class NotificationsBrokerEventsComponent implements OnInit {
*
* @param {string} action
* the action (can be: ACCEPTED, REJECTED, DISCARDED, PENDING)
- * @param {NotificationsBrokerEventData} eventData
- * the Notifications Broker event data
+ * @param {QualityAssuranceEventData} eventData
+ * the Quality Assurance event data
* @param {any} content
* Reference to the modal
*/
- public modalChoice(action: string, eventData: NotificationsBrokerEventData, content: any): void {
+ public modalChoice(action: string, eventData: QualityAssuranceEventData, content: any): void {
if (eventData.hasProject) {
this.executeAction(action, eventData);
} else {
@@ -180,12 +180,12 @@ export class NotificationsBrokerEventsComponent implements OnInit {
*
* @param {string} action
* the action (can be: ACCEPTED, REJECTED, DISCARDED, PENDING)
- * @param {NotificationsBrokerEventData} eventData
- * the Notifications Broker event data
+ * @param {QualityAssuranceEventData} eventData
+ * the Quality Assurance event data
* @param {any} content
* Reference to the modal
*/
- public openModal(action: string, eventData: NotificationsBrokerEventData, content: any): void {
+ public openModal(action: string, eventData: QualityAssuranceEventData, content: any): void {
this.modalService.open(content, { ariaLabelledBy: 'modal-basic-title' }).result.then(
(result) => {
if (result === 'do') {
@@ -203,10 +203,10 @@ export class NotificationsBrokerEventsComponent implements OnInit {
/**
* Open a modal where the user can select the project.
*
- * @param {NotificationsBrokerEventData} eventData
- * the Notifications Broker event item data
+ * @param {QualityAssuranceEventData} eventData
+ * the Quality Assurance event item data
*/
- public openModalLookup(eventData: NotificationsBrokerEventData): void {
+ public openModalLookup(eventData: QualityAssuranceEventData): void {
this.modalRef = this.modalService.open(ProjectEntryImportModalComponent, {
size: 'lg'
});
@@ -232,19 +232,19 @@ export class NotificationsBrokerEventsComponent implements OnInit {
*
* @param {string} action
* the action (can be: ACCEPTED, REJECTED, DISCARDED, PENDING)
- * @param {NotificationsBrokerEventData} eventData
- * the Notifications Broker event data
+ * @param {QualityAssuranceEventData} eventData
+ * the Quality Assurance event data
*/
- public executeAction(action: string, eventData: NotificationsBrokerEventData): void {
+ public executeAction(action: string, eventData: QualityAssuranceEventData): void {
eventData.isRunning = true;
this.subs.push(
- this.notificationsBrokerEventRestService.patchEvent(action, eventData.event, eventData.reason).pipe(getFirstCompletedRemoteData())
- .subscribe((rd: RemoteData) => {
+ this.qualityAssuranceEventRestService.patchEvent(action, eventData.event, eventData.reason).pipe(getFirstCompletedRemoteData())
+ .subscribe((rd: RemoteData) => {
if (rd.isSuccess && rd.statusCode === 200) {
this.notificationsService.success(
this.translateService.instant('notifications.broker.event.action.saved')
);
- this.getNotificationsBrokerEvents();
+ this.getQualityAssuranceEvents();
} else {
this.notificationsService.error(
this.translateService.instant('notifications.broker.event.action.error')
@@ -256,10 +256,10 @@ export class NotificationsBrokerEventsComponent implements OnInit {
}
/**
- * Bound a project to the publication described in the Notifications Broker event calling the REST service.
+ * Bound a project to the publication described in the Quality Assurance event calling the REST service.
*
- * @param {NotificationsBrokerEventData} eventData
- * the Notifications Broker event item data
+ * @param {QualityAssuranceEventData} eventData
+ * the Quality Assurance event item data
* @param {string} projectId
* the project Id to bound
* @param {string} projectTitle
@@ -267,11 +267,11 @@ export class NotificationsBrokerEventsComponent implements OnInit {
* @param {string} projectHandle
* the project handle
*/
- public boundProject(eventData: NotificationsBrokerEventData, projectId: string, projectTitle: string, projectHandle: string): void {
+ public boundProject(eventData: QualityAssuranceEventData, projectId: string, projectTitle: string, projectHandle: string): void {
eventData.isRunning = true;
this.subs.push(
- this.notificationsBrokerEventRestService.boundProject(eventData.id, projectId).pipe(getFirstCompletedRemoteData())
- .subscribe((rd: RemoteData) => {
+ this.qualityAssuranceEventRestService.boundProject(eventData.id, projectId).pipe(getFirstCompletedRemoteData())
+ .subscribe((rd: RemoteData) => {
if (rd.isSuccess) {
this.notificationsService.success(
this.translateService.instant('notifications.broker.event.project.bounded')
@@ -291,16 +291,16 @@ export class NotificationsBrokerEventsComponent implements OnInit {
}
/**
- * Remove the bounded project from the publication described in the Notifications Broker event calling the REST service.
+ * Remove the bounded project from the publication described in the Quality Assurance event calling the REST service.
*
- * @param {NotificationsBrokerEventData} eventData
- * the Notifications Broker event data
+ * @param {QualityAssuranceEventData} eventData
+ * the Quality Assurance event data
*/
- public removeProject(eventData: NotificationsBrokerEventData): void {
+ public removeProject(eventData: QualityAssuranceEventData): void {
eventData.isRunning = true;
this.subs.push(
- this.notificationsBrokerEventRestService.removeProject(eventData.id).pipe(getFirstCompletedRemoteData())
- .subscribe((rd: RemoteData) => {
+ this.qualityAssuranceEventRestService.removeProject(eventData.id).pipe(getFirstCompletedRemoteData())
+ .subscribe((rd: RemoteData) => {
if (rd.isSuccess) {
this.notificationsService.success(
this.translateService.instant('notifications.broker.event.project.removed')
@@ -337,26 +337,26 @@ export class NotificationsBrokerEventsComponent implements OnInit {
/**
- * Dispatch the Notifications Broker events retrival.
+ * Dispatch the Quality Assurance events retrival.
*/
- public getNotificationsBrokerEvents(): void {
+ public getQualityAssuranceEvents(): void {
this.paginationService.getFindListOptions(this.paginationConfig.id, this.defaultConfig).pipe(
distinctUntilChanged(),
- switchMap((options: FindListOptions) => this.notificationsBrokerEventRestService.getEventsByTopic(
+ switchMap((options: FindListOptions) => this.qualityAssuranceEventRestService.getEventsByTopic(
this.topic,
options,
followLink('target'), followLink('related')
)),
getFirstCompletedRemoteData(),
- ).subscribe((rd: RemoteData>) => {
+ ).subscribe((rd: RemoteData>) => {
if (rd.hasSucceeded) {
this.isEventLoading.next(false);
this.totalElements$ = observableOf(rd.payload.totalElements);
this.setEventUpdated(rd.payload.page);
} else {
- throw new Error('Can\'t retrieve Notifications Broker events from the Broker events REST service');
+ throw new Error('Can\'t retrieve Quality Assurance events from the Broker events REST service');
}
- this.notificationsBrokerEventRestService.clearFindByTopicRequests();
+ this.qualityAssuranceEventRestService.clearFindByTopicRequests();
});
}
@@ -370,15 +370,15 @@ export class NotificationsBrokerEventsComponent implements OnInit {
}
/**
- * Set the project status for the Notifications Broker events.
+ * Set the project status for the Quality Assurance events.
*
- * @param {NotificationsBrokerEventObject[]} events
- * the Notifications Broker event item
+ * @param {QualityAssuranceEventObject[]} events
+ * the Quality Assurance event item
*/
- protected setEventUpdated(events: NotificationsBrokerEventObject[]): void {
+ protected setEventUpdated(events: QualityAssuranceEventObject[]): void {
this.subs.push(
from(events).pipe(
- mergeMap((event: NotificationsBrokerEventObject) => {
+ mergeMap((event: QualityAssuranceEventObject) => {
const related$ = event.related.pipe(
getFirstCompletedRemoteData(),
);
@@ -387,7 +387,7 @@ export class NotificationsBrokerEventsComponent implements OnInit {
);
return combineLatest([related$, target$]).pipe(
map(([relatedItemRD, targetItemRD]: [RemoteData- , RemoteData
- ]) => {
- const data: NotificationsBrokerEventData = {
+ const data: QualityAssuranceEventData = {
event: event,
id: event.id,
title: event.title,
diff --git a/src/app/notifications/broker/events/notifications-broker-events.scomponent.scss b/src/app/notifications/qa/events/quality-assurance-events.scomponent.scss
similarity index 100%
rename from src/app/notifications/broker/events/notifications-broker-events.scomponent.scss
rename to src/app/notifications/qa/events/quality-assurance-events.scomponent.scss
diff --git a/src/app/notifications/broker/project-entry-import-modal/project-entry-import-modal.component.html b/src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.html
similarity index 100%
rename from src/app/notifications/broker/project-entry-import-modal/project-entry-import-modal.component.html
rename to src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.html
diff --git a/src/app/notifications/broker/project-entry-import-modal/project-entry-import-modal.component.scss b/src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.scss
similarity index 100%
rename from src/app/notifications/broker/project-entry-import-modal/project-entry-import-modal.component.scss
rename to src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.scss
diff --git a/src/app/notifications/broker/project-entry-import-modal/project-entry-import-modal.component.spec.ts b/src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.spec.ts
similarity index 95%
rename from src/app/notifications/broker/project-entry-import-modal/project-entry-import-modal.component.spec.ts
rename to src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.spec.ts
index 7cac576844..42a57c2ac5 100644
--- a/src/app/notifications/broker/project-entry-import-modal/project-entry-import-modal.component.spec.ts
+++ b/src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.spec.ts
@@ -17,16 +17,16 @@ import { buildPaginatedList } from '../../../core/data/paginated-list.model';
import { PageInfo } from '../../../core/shared/page-info.model';
import {
ItemMockPid10,
- notificationsBrokerEventObjectMissingProjectFound,
+ qualityAssuranceEventObjectMissingProjectFound,
NotificationsMockDspaceObject
} from '../../../shared/mocks/notifications.mock';
const eventData = {
- event: notificationsBrokerEventObjectMissingProjectFound,
- id: notificationsBrokerEventObjectMissingProjectFound.id,
- title: notificationsBrokerEventObjectMissingProjectFound.title,
+ event: qualityAssuranceEventObjectMissingProjectFound,
+ id: qualityAssuranceEventObjectMissingProjectFound.id,
+ title: qualityAssuranceEventObjectMissingProjectFound.title,
hasProject: true,
- projectTitle: notificationsBrokerEventObjectMissingProjectFound.message.title,
+ projectTitle: qualityAssuranceEventObjectMissingProjectFound.message.title,
projectId: ItemMockPid10.id,
handle: ItemMockPid10.handle,
reason: null,
diff --git a/src/app/notifications/broker/project-entry-import-modal/project-entry-import-modal.component.ts b/src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.ts
similarity index 94%
rename from src/app/notifications/broker/project-entry-import-modal/project-entry-import-modal.component.ts
rename to src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.ts
index 64672fa1fa..64a5f6908f 100644
--- a/src/app/notifications/broker/project-entry-import-modal/project-entry-import-modal.component.ts
+++ b/src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.ts
@@ -13,10 +13,10 @@ import { PaginationComponentOptions } from '../../../shared/pagination/paginatio
import { SearchService } from '../../../core/shared/search/search.service';
import { DSpaceObject } from '../../../core/shared/dspace-object.model';
import {
- NotificationsBrokerEventObject,
- NotificationsBrokerEventMessageObject,
+ QualityAssuranceEventObject,
+ QualityAssuranceEventMessageObject,
OpenaireBrokerEventMessageObject,
-} from '../../../core/notifications/broker/models/notifications-broker-event.model';
+} from '../../../core/notifications/qa/models/quality-assurance-event.model';
import { hasValue, isNotEmpty } from '../../../shared/empty.util';
import { Item } from '../../../core/shared/item.model';
@@ -34,13 +34,13 @@ export enum ImportType {
/**
* The data type passed from the parent page
*/
-export interface NotificationsBrokerEventData {
+export interface QualityAssuranceEventData {
/**
- * The Notifications Broker event
+ * The Quality Assurance event
*/
- event: NotificationsBrokerEventObject;
+ event: QualityAssuranceEventObject;
/**
- * The Notifications Broker event Id (uuid)
+ * The Quality Assurance event Id (uuid)
*/
id: string;
/**
@@ -83,14 +83,14 @@ export interface NotificationsBrokerEventData {
templateUrl: './project-entry-import-modal.component.html'
})
/**
- * Component to display a modal window for linking a project to an Notifications Broker event
+ * Component to display a modal window for linking a project to an Quality Assurance event
* Shows information about the selected project and a selectable list.
*/
export class ProjectEntryImportModalComponent implements OnInit {
/**
* The external source entry
*/
- @Input() externalSourceEntry: NotificationsBrokerEventData;
+ @Input() externalSourceEntry: QualityAssuranceEventData;
/**
* The number of results per page
*/
diff --git a/src/app/notifications/broker/source/notifications-broker-source.actions.ts b/src/app/notifications/qa/source/quality-assurance-source.actions.ts
similarity index 62%
rename from src/app/notifications/broker/source/notifications-broker-source.actions.ts
rename to src/app/notifications/qa/source/quality-assurance-source.actions.ts
index a3fd9240c8..7a22e7a9ae 100644
--- a/src/app/notifications/broker/source/notifications-broker-source.actions.ts
+++ b/src/app/notifications/qa/source/quality-assurance-source.actions.ts
@@ -1,6 +1,6 @@
import { Action } from '@ngrx/store';
import { type } from '../../../shared/ngrx/type';
-import { NotificationsBrokerSourceObject } from '../../../core/notifications/broker/models/notifications-broker-source.model';
+import { QualityAssuranceSourceObject } from '../../../core/notifications/qa/models/quality-assurance-source.model';
/**
* For each action type in an action group, make a simple
@@ -10,19 +10,19 @@ import { NotificationsBrokerSourceObject } from '../../../core/notifications/bro
* literal types and runs a simple check to guarantee all
* action types in the application are unique.
*/
-export const NotificationsBrokerSourceActionTypes = {
- ADD_SOURCE: type('dspace/integration/notifications/broker/ADD_SOURCE'),
- RETRIEVE_ALL_SOURCE: type('dspace/integration/notifications/broker/RETRIEVE_ALL_SOURCE'),
- RETRIEVE_ALL_SOURCE_ERROR: type('dspace/integration/notifications/broker/RETRIEVE_ALL_SOURCE_ERROR'),
+export const QualityAssuranceSourceActionTypes = {
+ ADD_SOURCE: type('dspace/integration/notifications/qa/ADD_SOURCE'),
+ RETRIEVE_ALL_SOURCE: type('dspace/integration/notifications/qa/RETRIEVE_ALL_SOURCE'),
+ RETRIEVE_ALL_SOURCE_ERROR: type('dspace/integration/notifications/qa/RETRIEVE_ALL_SOURCE_ERROR'),
};
/* tslint:disable:max-classes-per-file */
/**
- * An ngrx action to retrieve all the Notifications Broker source.
+ * An ngrx action to retrieve all the Quality Assurance source.
*/
export class RetrieveAllSourceAction implements Action {
- type = NotificationsBrokerSourceActionTypes.RETRIEVE_ALL_SOURCE;
+ type = QualityAssuranceSourceActionTypes.RETRIEVE_ALL_SOURCE;
payload: {
elementsPerPage: number;
currentPage: number;
@@ -45,20 +45,20 @@ export class RetrieveAllSourceAction implements Action {
}
/**
- * An ngrx action for retrieving 'all Notifications Broker source' error.
+ * An ngrx action for retrieving 'all Quality Assurance source' error.
*/
export class RetrieveAllSourceErrorAction implements Action {
- type = NotificationsBrokerSourceActionTypes.RETRIEVE_ALL_SOURCE_ERROR;
+ type = QualityAssuranceSourceActionTypes.RETRIEVE_ALL_SOURCE_ERROR;
}
/**
- * An ngrx action to load the Notifications Broker source objects.
+ * An ngrx action to load the Quality Assurance source objects.
* Called by the ??? effect.
*/
export class AddSourceAction implements Action {
- type = NotificationsBrokerSourceActionTypes.ADD_SOURCE;
+ type = QualityAssuranceSourceActionTypes.ADD_SOURCE;
payload: {
- source: NotificationsBrokerSourceObject[];
+ source: QualityAssuranceSourceObject[];
totalPages: number;
currentPage: number;
totalElements: number;
@@ -74,9 +74,9 @@ export class AddSourceAction implements Action {
* @param currentPage
* the current page
* @param totalElements
- * the total available Notifications Broker source
+ * the total available Quality Assurance source
*/
- constructor(source: NotificationsBrokerSourceObject[], totalPages: number, currentPage: number, totalElements: number) {
+ constructor(source: QualityAssuranceSourceObject[], totalPages: number, currentPage: number, totalElements: number) {
this.payload = {
source,
totalPages,
@@ -93,7 +93,7 @@ export class AddSourceAction implements Action {
* Export a type alias of all actions in this action group
* so that reducers can easily compose action types.
*/
-export type NotificationsBrokerSourceActions
+export type QualityAssuranceSourceActions
= RetrieveAllSourceAction
|RetrieveAllSourceErrorAction
|AddSourceAction;
diff --git a/src/app/notifications/broker/source/notifications-broker-source.component.html b/src/app/notifications/qa/source/quality-assurance-source.component.html
similarity index 97%
rename from src/app/notifications/broker/source/notifications-broker-source.component.html
rename to src/app/notifications/qa/source/quality-assurance-source.component.html
index a7e1e52748..5309098c55 100644
--- a/src/app/notifications/broker/source/notifications-broker-source.component.html
+++ b/src/app/notifications/qa/source/quality-assurance-source.component.html
@@ -8,15 +8,15 @@
{{'notifications.broker.source'| translate}}
-
+
-
+ (paginationChange)="getQualityAssuranceSource()">
+
@@ -55,4 +55,4 @@
-
+
diff --git a/src/app/notifications/broker/source/notifications-broker-source.component.scss b/src/app/notifications/qa/source/quality-assurance-source.component.scss
similarity index 100%
rename from src/app/notifications/broker/source/notifications-broker-source.component.scss
rename to src/app/notifications/qa/source/quality-assurance-source.component.scss
diff --git a/src/app/notifications/broker/source/notifications-broker-source.component.spec.ts b/src/app/notifications/qa/source/quality-assurance-source.component.spec.ts
similarity index 60%
rename from src/app/notifications/broker/source/notifications-broker-source.component.spec.ts
rename to src/app/notifications/qa/source/quality-assurance-source.component.spec.ts
index 6c0ad42ce8..ba3a903cc5 100644
--- a/src/app/notifications/broker/source/notifications-broker-source.component.spec.ts
+++ b/src/app/notifications/qa/source/quality-assurance-source.component.spec.ts
@@ -7,22 +7,22 @@ import { ComponentFixture, inject, TestBed, waitForAsync } from '@angular/core/t
import { createTestComponent } from '../../../shared/testing/utils.test';
import {
getMockNotificationsStateService,
- notificationsBrokerSourceObjectMoreAbstract,
- notificationsBrokerSourceObjectMorePid
+ qualityAssuranceSourceObjectMoreAbstract,
+ qualityAssuranceSourceObjectMorePid
} from '../../../shared/mocks/notifications.mock';
-import { NotificationsBrokerSourceComponent } from './notifications-broker-source.component';
+import { QualityAssuranceSourceComponent } from './quality-assurance-source.component';
import { NotificationsStateService } from '../../notifications-state.service';
import { cold } from 'jasmine-marbles';
import { PaginationServiceStub } from '../../../shared/testing/pagination-service.stub';
import { PaginationService } from '../../../core/pagination/pagination.service';
-describe('NotificationsBrokerSourceComponent test suite', () => {
- let fixture: ComponentFixture;
- let comp: NotificationsBrokerSourceComponent;
+describe('QualityAssuranceSourceComponent test suite', () => {
+ let fixture: ComponentFixture;
+ let comp: QualityAssuranceSourceComponent;
let compAsAny: any;
const mockNotificationsStateService = getMockNotificationsStateService();
const activatedRouteParams = {
- notificationsBrokerSourceParams: {
+ qualityAssuranceSourceParams: {
currentPage: 0,
pageSize: 5
}
@@ -36,27 +36,27 @@ describe('NotificationsBrokerSourceComponent test suite', () => {
TranslateModule.forRoot(),
],
declarations: [
- NotificationsBrokerSourceComponent,
+ QualityAssuranceSourceComponent,
TestComponent,
],
providers: [
{ provide: NotificationsStateService, useValue: mockNotificationsStateService },
{ provide: ActivatedRoute, useValue: { data: observableOf(activatedRouteParams), params: observableOf({}) } },
{ provide: PaginationService, useValue: paginationService },
- NotificationsBrokerSourceComponent
+ QualityAssuranceSourceComponent
],
schemas: [NO_ERRORS_SCHEMA]
}).compileComponents().then(() => {
- mockNotificationsStateService.getNotificationsBrokerSource.and.returnValue(observableOf([
- notificationsBrokerSourceObjectMorePid,
- notificationsBrokerSourceObjectMoreAbstract
+ mockNotificationsStateService.getQualityAssuranceSource.and.returnValue(observableOf([
+ qualityAssuranceSourceObjectMorePid,
+ qualityAssuranceSourceObjectMoreAbstract
]));
- mockNotificationsStateService.getNotificationsBrokerSourceTotalPages.and.returnValue(observableOf(1));
- mockNotificationsStateService.getNotificationsBrokerSourceCurrentPage.and.returnValue(observableOf(0));
- mockNotificationsStateService.getNotificationsBrokerSourceTotals.and.returnValue(observableOf(2));
- mockNotificationsStateService.isNotificationsBrokerSourceLoaded.and.returnValue(observableOf(true));
- mockNotificationsStateService.isNotificationsBrokerSourceLoading.and.returnValue(observableOf(false));
- mockNotificationsStateService.isNotificationsBrokerSourceProcessing.and.returnValue(observableOf(false));
+ mockNotificationsStateService.getQualityAssuranceSourceTotalPages.and.returnValue(observableOf(1));
+ mockNotificationsStateService.getQualityAssuranceSourceCurrentPage.and.returnValue(observableOf(0));
+ mockNotificationsStateService.getQualityAssuranceSourceTotals.and.returnValue(observableOf(2));
+ mockNotificationsStateService.isQualityAssuranceSourceLoaded.and.returnValue(observableOf(true));
+ mockNotificationsStateService.isQualityAssuranceSourceLoading.and.returnValue(observableOf(false));
+ mockNotificationsStateService.isQualityAssuranceSourceProcessing.and.returnValue(observableOf(false));
});
}));
@@ -68,7 +68,7 @@ describe('NotificationsBrokerSourceComponent test suite', () => {
// synchronous beforeEach
beforeEach(() => {
const html = `
- `;
+ `;
testFixture = createTestComponent(html, TestComponent) as ComponentFixture;
testComp = testFixture.componentInstance;
});
@@ -77,14 +77,14 @@ describe('NotificationsBrokerSourceComponent test suite', () => {
testFixture.destroy();
});
- it('should create NotificationsBrokerSourceComponent', inject([NotificationsBrokerSourceComponent], (app: NotificationsBrokerSourceComponent) => {
+ it('should create QualityAssuranceSourceComponent', inject([QualityAssuranceSourceComponent], (app: QualityAssuranceSourceComponent) => {
expect(app).toBeDefined();
}));
});
describe('Main tests running with two Source', () => {
beforeEach(() => {
- fixture = TestBed.createComponent(NotificationsBrokerSourceComponent);
+ fixture = TestBed.createComponent(QualityAssuranceSourceComponent);
comp = fixture.componentInstance;
compAsAny = comp;
@@ -102,8 +102,8 @@ describe('NotificationsBrokerSourceComponent test suite', () => {
expect(comp.sources$).toBeObservable(cold('(a|)', {
a: [
- notificationsBrokerSourceObjectMorePid,
- notificationsBrokerSourceObjectMoreAbstract
+ qualityAssuranceSourceObjectMorePid,
+ qualityAssuranceSourceObjectMoreAbstract
]
}));
expect(comp.totalElements$).toBeObservable(cold('(a|)', {
@@ -112,12 +112,12 @@ describe('NotificationsBrokerSourceComponent test suite', () => {
});
it(('Should set data properly after the view init'), () => {
- spyOn(compAsAny, 'getNotificationsBrokerSource');
+ spyOn(compAsAny, 'getQualityAssuranceSource');
comp.ngAfterViewInit();
fixture.detectChanges();
- expect(compAsAny.getNotificationsBrokerSource).toHaveBeenCalled();
+ expect(compAsAny.getQualityAssuranceSource).toHaveBeenCalled();
});
it(('isSourceLoading should return FALSE'), () => {
@@ -132,12 +132,12 @@ describe('NotificationsBrokerSourceComponent test suite', () => {
}));
});
- it(('getNotificationsBrokerSource should call the service to dispatch a STATE change'), () => {
+ it(('getQualityAssuranceSource should call the service to dispatch a STATE change'), () => {
comp.ngOnInit();
fixture.detectChanges();
- compAsAny.notificationsStateService.dispatchRetrieveNotificationsBrokerSource(comp.paginationConfig.pageSize, comp.paginationConfig.currentPage).and.callThrough();
- expect(compAsAny.notificationsStateService.dispatchRetrieveNotificationsBrokerSource).toHaveBeenCalledWith(comp.paginationConfig.pageSize, comp.paginationConfig.currentPage);
+ compAsAny.notificationsStateService.dispatchRetrieveQualityAssuranceSource(comp.paginationConfig.pageSize, comp.paginationConfig.currentPage).and.callThrough();
+ expect(compAsAny.notificationsStateService.dispatchRetrieveQualityAssuranceSource).toHaveBeenCalledWith(comp.paginationConfig.pageSize, comp.paginationConfig.currentPage);
});
});
});
diff --git a/src/app/notifications/broker/source/notifications-broker-source.component.ts b/src/app/notifications/qa/source/quality-assurance-source.component.ts
similarity index 64%
rename from src/app/notifications/broker/source/notifications-broker-source.component.ts
rename to src/app/notifications/qa/source/quality-assurance-source.component.ts
index 070e03f396..fde1afec43 100644
--- a/src/app/notifications/broker/source/notifications-broker-source.component.ts
+++ b/src/app/notifications/qa/source/quality-assurance-source.component.ts
@@ -3,18 +3,18 @@ import { PaginationService } from '../../../core/pagination/pagination.service';
import { Observable, Subscription } from 'rxjs';
import { distinctUntilChanged, take } from 'rxjs/operators';
import { SortOptions } from '../../../core/cache/models/sort-options.model';
-import { NotificationsBrokerSourceObject } from '../../../core/notifications/broker/models/notifications-broker-source.model';
+import { QualityAssuranceSourceObject } from '../../../core/notifications/qa/models/quality-assurance-source.model';
import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model';
import { NotificationsStateService } from '../../notifications-state.service';
-import { AdminNotificationsBrokerSourcePageParams } from '../../../admin/admin-notifications/admin-notifications-broker-source-page-component/admin-notifications-broker-source-page-resolver.service';
+import { AdminQualityAssuranceSourcePageParams } from '../../../admin/admin-notifications/admin-quality-assurance-source-page-component/admin-quality-assurance-source-page-resolver.service';
import { hasValue } from '../../../shared/empty.util';
@Component({
- selector: 'ds-notifications-broker-source',
- templateUrl: './notifications-broker-source.component.html',
- styleUrls: ['./notifications-broker-source.component.scss']
+ selector: 'ds-quality-assurance-source',
+ templateUrl: './quality-assurance-source.component.html',
+ styleUrls: ['./quality-assurance-source.component.scss']
})
-export class NotificationsBrokerSourceComponent implements OnInit {
+export class QualityAssuranceSourceComponent implements OnInit {
/**
* The pagination system configuration for HTML listing.
@@ -26,16 +26,16 @@ export class NotificationsBrokerSourceComponent implements OnInit {
pageSizeOptions: [5, 10, 20, 40, 60]
});
/**
- * The Notifications Broker source list sort options.
+ * The Quality Assurance source list sort options.
* @type {SortOptions}
*/
public paginationSortConfig: SortOptions;
/**
- * The Notifications Broker source list.
+ * The Quality Assurance source list.
*/
- public sources$: Observable;
+ public sources$: Observable;
/**
- * The total number of Notifications Broker sources.
+ * The total number of Quality Assurance sources.
*/
public totalElements$: Observable;
/**
@@ -58,51 +58,51 @@ export class NotificationsBrokerSourceComponent implements OnInit {
* Component initialization.
*/
ngOnInit(): void {
- this.sources$ = this.notificationsStateService.getNotificationsBrokerSource();
- this.totalElements$ = this.notificationsStateService.getNotificationsBrokerSourceTotals();
+ this.sources$ = this.notificationsStateService.getQualityAssuranceSource();
+ this.totalElements$ = this.notificationsStateService.getQualityAssuranceSourceTotals();
}
/**
- * First Notifications Broker source loading after view initialization.
+ * First Quality Assurance source loading after view initialization.
*/
ngAfterViewInit(): void {
this.subs.push(
- this.notificationsStateService.isNotificationsBrokerSourceLoaded().pipe(
+ this.notificationsStateService.isQualityAssuranceSourceLoaded().pipe(
take(1)
).subscribe(() => {
- this.getNotificationsBrokerSource();
+ this.getQualityAssuranceSource();
})
);
}
/**
- * Returns the information about the loading status of the Notifications Broker source (if it's running or not).
+ * Returns the information about the loading status of the Quality Assurance source (if it's running or not).
*
* @return Observable
* 'true' if the source are loading, 'false' otherwise.
*/
public isSourceLoading(): Observable {
- return this.notificationsStateService.isNotificationsBrokerSourceLoading();
+ return this.notificationsStateService.isQualityAssuranceSourceLoading();
}
/**
- * Returns the information about the processing status of the Notifications Broker source (if it's running or not).
+ * Returns the information about the processing status of the Quality Assurance source (if it's running or not).
*
* @return Observable
* 'true' if there are operations running on the source (ex.: a REST call), 'false' otherwise.
*/
public isSourceProcessing(): Observable {
- return this.notificationsStateService.isNotificationsBrokerSourceProcessing();
+ return this.notificationsStateService.isQualityAssuranceSourceProcessing();
}
/**
- * Dispatch the Notifications Broker source retrival.
+ * Dispatch the Quality Assurance source retrival.
*/
- public getNotificationsBrokerSource(): void {
+ public getQualityAssuranceSource(): void {
this.paginationService.getCurrentPagination(this.paginationConfig.id, this.paginationConfig).pipe(
distinctUntilChanged(),
).subscribe((options: PaginationComponentOptions) => {
- this.notificationsStateService.dispatchRetrieveNotificationsBrokerSource(
+ this.notificationsStateService.dispatchRetrieveQualityAssuranceSource(
options.pageSize,
options.currentPage
);
@@ -114,7 +114,7 @@ export class NotificationsBrokerSourceComponent implements OnInit {
*
* @param eventsRouteParams
*/
- protected updatePaginationFromRouteParams(eventsRouteParams: AdminNotificationsBrokerSourcePageParams) {
+ protected updatePaginationFromRouteParams(eventsRouteParams: AdminQualityAssuranceSourcePageParams) {
if (eventsRouteParams.currentPage) {
this.paginationConfig.currentPage = eventsRouteParams.currentPage;
}
diff --git a/src/app/notifications/broker/source/notifications-broker-source.effects.ts b/src/app/notifications/qa/source/quality-assurance-source.effects.ts
similarity index 59%
rename from src/app/notifications/broker/source/notifications-broker-source.effects.ts
rename to src/app/notifications/qa/source/quality-assurance-source.effects.ts
index bd8b3f00cd..6d8aa275d5 100644
--- a/src/app/notifications/broker/source/notifications-broker-source.effects.ts
+++ b/src/app/notifications/qa/source/quality-assurance-source.effects.ts
@@ -6,35 +6,35 @@ import { catchError, map, switchMap, tap, withLatestFrom } from 'rxjs/operators'
import { of as observableOf } from 'rxjs';
import {
AddSourceAction,
- NotificationsBrokerSourceActionTypes,
+ QualityAssuranceSourceActionTypes,
RetrieveAllSourceAction,
RetrieveAllSourceErrorAction,
-} from './notifications-broker-source.actions';
+} from './quality-assurance-source.actions';
-import { NotificationsBrokerSourceObject } from '../../../core/notifications/broker/models/notifications-broker-source.model';
+import { QualityAssuranceSourceObject } from '../../../core/notifications/qa/models/quality-assurance-source.model';
import { PaginatedList } from '../../../core/data/paginated-list.model';
-import { NotificationsBrokerSourceService } from './notifications-broker-source.service';
+import { QualityAssuranceSourceService } from './quality-assurance-source.service';
import { NotificationsService } from '../../../shared/notifications/notifications.service';
-import { NotificationsBrokerSourceRestService } from '../../../core/notifications/broker/source/notifications-broker-source-rest.service';
+import { QualityAssuranceSourceRestService } from '../../../core/notifications/qa/source/quality-assurance-source-rest.service';
/**
- * Provides effect methods for the Notifications Broker source actions.
+ * Provides effect methods for the Quality Assurance source actions.
*/
@Injectable()
-export class NotificationsBrokerSourceEffects {
+export class QualityAssuranceSourceEffects {
/**
- * Retrieve all Notifications Broker source managing pagination and errors.
+ * Retrieve all Quality Assurance source managing pagination and errors.
*/
@Effect() retrieveAllSource$ = this.actions$.pipe(
- ofType(NotificationsBrokerSourceActionTypes.RETRIEVE_ALL_SOURCE),
+ ofType(QualityAssuranceSourceActionTypes.RETRIEVE_ALL_SOURCE),
withLatestFrom(this.store$),
switchMap(([action, currentState]: [RetrieveAllSourceAction, any]) => {
- return this.notificationsBrokerSourceService.getSources(
+ return this.qualityAssuranceSourceService.getSources(
action.payload.elementsPerPage,
action.payload.currentPage
).pipe(
- map((sources: PaginatedList) =>
+ map((sources: PaginatedList) =>
new AddSourceAction(sources.page, sources.totalPages, sources.currentPage, sources.totalElements)
),
catchError((error: Error) => {
@@ -51,7 +51,7 @@ export class NotificationsBrokerSourceEffects {
* Show a notification on error.
*/
@Effect({ dispatch: false }) retrieveAllSourceErrorAction$ = this.actions$.pipe(
- ofType(NotificationsBrokerSourceActionTypes.RETRIEVE_ALL_SOURCE_ERROR),
+ ofType(QualityAssuranceSourceActionTypes.RETRIEVE_ALL_SOURCE_ERROR),
tap(() => {
this.notificationsService.error(null, this.translate.get('notifications.broker.source.error.service.retrieve'));
})
@@ -61,9 +61,9 @@ export class NotificationsBrokerSourceEffects {
* Clear find all source requests from cache.
*/
@Effect({ dispatch: false }) addSourceAction$ = this.actions$.pipe(
- ofType(NotificationsBrokerSourceActionTypes.ADD_SOURCE),
+ ofType(QualityAssuranceSourceActionTypes.ADD_SOURCE),
tap(() => {
- this.notificationsBrokerSourceDataService.clearFindAllSourceRequests();
+ this.qualityAssuranceSourceDataService.clearFindAllSourceRequests();
})
);
@@ -73,15 +73,15 @@ export class NotificationsBrokerSourceEffects {
* @param {Store} store$
* @param {TranslateService} translate
* @param {NotificationsService} notificationsService
- * @param {NotificationsBrokerSourceService} notificationsBrokerSourceService
- * @param {NotificationsBrokerSourceRestService} notificationsBrokerSourceDataService
+ * @param {QualityAssuranceSourceService} qualityAssuranceSourceService
+ * @param {QualityAssuranceSourceRestService} qualityAssuranceSourceDataService
*/
constructor(
private actions$: Actions,
private store$: Store,
private translate: TranslateService,
private notificationsService: NotificationsService,
- private notificationsBrokerSourceService: NotificationsBrokerSourceService,
- private notificationsBrokerSourceDataService: NotificationsBrokerSourceRestService
+ private qualityAssuranceSourceService: QualityAssuranceSourceService,
+ private qualityAssuranceSourceDataService: QualityAssuranceSourceRestService
) { }
}
diff --git a/src/app/notifications/broker/source/notifications-broker-source.reducer.spec.ts b/src/app/notifications/qa/source/quality-assurance-source.reducer.spec.ts
similarity index 52%
rename from src/app/notifications/broker/source/notifications-broker-source.reducer.spec.ts
rename to src/app/notifications/qa/source/quality-assurance-source.reducer.spec.ts
index 74bc77d3ec..fcb717067d 100644
--- a/src/app/notifications/broker/source/notifications-broker-source.reducer.spec.ts
+++ b/src/app/notifications/qa/source/quality-assurance-source.reducer.spec.ts
@@ -2,20 +2,20 @@ import {
AddSourceAction,
RetrieveAllSourceAction,
RetrieveAllSourceErrorAction
- } from './notifications-broker-source.actions';
- import { notificationsBrokerSourceReducer, NotificationsBrokerSourceState } from './notifications-broker-source.reducer';
+ } from './quality-assurance-source.actions';
+ import { qualityAssuranceSourceReducer, QualityAssuranceSourceState } from './quality-assurance-source.reducer';
import {
- notificationsBrokerSourceObjectMoreAbstract,
- notificationsBrokerSourceObjectMorePid
+ qualityAssuranceSourceObjectMoreAbstract,
+ qualityAssuranceSourceObjectMorePid
} from '../../../shared/mocks/notifications.mock';
- describe('notificationsBrokerSourceReducer test suite', () => {
- let notificationsBrokerSourceInitialState: NotificationsBrokerSourceState;
+ describe('qualityAssuranceSourceReducer test suite', () => {
+ let qualityAssuranceSourceInitialState: QualityAssuranceSourceState;
const elementPerPage = 3;
const currentPage = 0;
beforeEach(() => {
- notificationsBrokerSourceInitialState = {
+ qualityAssuranceSourceInitialState = {
source: [],
processing: false,
loaded: false,
@@ -26,30 +26,30 @@ import {
});
it('Action RETRIEVE_ALL_SOURCE should set the State property "processing" to TRUE', () => {
- const expectedState = notificationsBrokerSourceInitialState;
+ const expectedState = qualityAssuranceSourceInitialState;
expectedState.processing = true;
const action = new RetrieveAllSourceAction(elementPerPage, currentPage);
- const newState = notificationsBrokerSourceReducer(notificationsBrokerSourceInitialState, action);
+ const newState = qualityAssuranceSourceReducer(qualityAssuranceSourceInitialState, action);
expect(newState).toEqual(expectedState);
});
it('Action RETRIEVE_ALL_SOURCE_ERROR should change the State to initial State but processing, loaded, and currentPage', () => {
- const expectedState = notificationsBrokerSourceInitialState;
+ const expectedState = qualityAssuranceSourceInitialState;
expectedState.processing = false;
expectedState.loaded = true;
expectedState.currentPage = 0;
const action = new RetrieveAllSourceErrorAction();
- const newState = notificationsBrokerSourceReducer(notificationsBrokerSourceInitialState, action);
+ const newState = qualityAssuranceSourceReducer(qualityAssuranceSourceInitialState, action);
expect(newState).toEqual(expectedState);
});
- it('Action ADD_SOURCE should populate the State with Notifications Broker source', () => {
+ it('Action ADD_SOURCE should populate the State with Quality Assurance source', () => {
const expectedState = {
- source: [ notificationsBrokerSourceObjectMorePid, notificationsBrokerSourceObjectMoreAbstract ],
+ source: [ qualityAssuranceSourceObjectMorePid, qualityAssuranceSourceObjectMoreAbstract ],
processing: false,
loaded: true,
totalPages: 1,
@@ -58,10 +58,10 @@ import {
};
const action = new AddSourceAction(
- [ notificationsBrokerSourceObjectMorePid, notificationsBrokerSourceObjectMoreAbstract ],
+ [ qualityAssuranceSourceObjectMorePid, qualityAssuranceSourceObjectMoreAbstract ],
1, 0, 2
);
- const newState = notificationsBrokerSourceReducer(notificationsBrokerSourceInitialState, action);
+ const newState = qualityAssuranceSourceReducer(qualityAssuranceSourceInitialState, action);
expect(newState).toEqual(expectedState);
});
diff --git a/src/app/notifications/qa/source/quality-assurance-source.reducer.ts b/src/app/notifications/qa/source/quality-assurance-source.reducer.ts
new file mode 100644
index 0000000000..08e26a177a
--- /dev/null
+++ b/src/app/notifications/qa/source/quality-assurance-source.reducer.ts
@@ -0,0 +1,72 @@
+import { QualityAssuranceSourceObject } from '../../../core/notifications/qa/models/quality-assurance-source.model';
+import { QualityAssuranceSourceActionTypes, QualityAssuranceSourceActions } from './quality-assurance-source.actions';
+
+/**
+ * The interface representing the Quality Assurance source state.
+ */
+export interface QualityAssuranceSourceState {
+ source: QualityAssuranceSourceObject[];
+ processing: boolean;
+ loaded: boolean;
+ totalPages: number;
+ currentPage: number;
+ totalElements: number;
+}
+
+/**
+ * Used for the Quality Assurance source state initialization.
+ */
+const qualityAssuranceSourceInitialState: QualityAssuranceSourceState = {
+ source: [],
+ processing: false,
+ loaded: false,
+ totalPages: 0,
+ currentPage: 0,
+ totalElements: 0
+};
+
+/**
+ * The Quality Assurance Source Reducer
+ *
+ * @param state
+ * the current state initialized with qualityAssuranceSourceInitialState
+ * @param action
+ * the action to perform on the state
+ * @return QualityAssuranceSourceState
+ * the new state
+ */
+export function qualityAssuranceSourceReducer(state = qualityAssuranceSourceInitialState, action: QualityAssuranceSourceActions): QualityAssuranceSourceState {
+ switch (action.type) {
+ case QualityAssuranceSourceActionTypes.RETRIEVE_ALL_SOURCE: {
+ return Object.assign({}, state, {
+ source: [],
+ processing: true
+ });
+ }
+
+ case QualityAssuranceSourceActionTypes.ADD_SOURCE: {
+ return Object.assign({}, state, {
+ source: action.payload.source,
+ processing: false,
+ loaded: true,
+ totalPages: action.payload.totalPages,
+ currentPage: state.currentPage,
+ totalElements: action.payload.totalElements
+ });
+ }
+
+ case QualityAssuranceSourceActionTypes.RETRIEVE_ALL_SOURCE_ERROR: {
+ return Object.assign({}, state, {
+ processing: false,
+ loaded: true,
+ totalPages: 0,
+ currentPage: 0,
+ totalElements: 0
+ });
+ }
+
+ default: {
+ return state;
+ }
+ }
+}
diff --git a/src/app/notifications/broker/source/notifications-broker-source.service.spec.ts b/src/app/notifications/qa/source/quality-assurance-source.service.spec.ts
similarity index 56%
rename from src/app/notifications/broker/source/notifications-broker-source.service.spec.ts
rename to src/app/notifications/qa/source/quality-assurance-source.service.spec.ts
index e94804cbf6..06f020be1d 100644
--- a/src/app/notifications/broker/source/notifications-broker-source.service.spec.ts
+++ b/src/app/notifications/qa/source/quality-assurance-source.service.spec.ts
@@ -1,28 +1,28 @@
import { TestBed } from '@angular/core/testing';
import { of as observableOf } from 'rxjs';
-import { NotificationsBrokerSourceService } from './notifications-broker-source.service';
+import { QualityAssuranceSourceService } from './quality-assurance-source.service';
import { SortDirection, SortOptions } from '../../../core/cache/models/sort-options.model';
import { PageInfo } from '../../../core/shared/page-info.model';
-import { FindListOptions } from '../../../core/data/request.models';
import {
- getMockNotificationsBrokerSourceRestService,
- notificationsBrokerSourceObjectMoreAbstract,
- notificationsBrokerSourceObjectMorePid
+ getMockQualityAssuranceSourceRestService,
+ qualityAssuranceSourceObjectMoreAbstract,
+ qualityAssuranceSourceObjectMorePid
} from '../../../shared/mocks/notifications.mock';
import { createSuccessfulRemoteDataObject } from '../../../shared/remote-data.utils';
import { cold } from 'jasmine-marbles';
import { buildPaginatedList } from '../../../core/data/paginated-list.model';
-import { NotificationsBrokerSourceRestService } from '../../../core/notifications/broker/source/notifications-broker-source-rest.service';
+import { QualityAssuranceSourceRestService } from '../../../core/notifications/qa/source/quality-assurance-source-rest.service';
import { RequestParam } from '../../../core/cache/models/request-param.model';
+import {FindListOptions} from '../../../core/data/find-list-options.model';
-describe('NotificationsBrokerSourceService', () => {
- let service: NotificationsBrokerSourceService;
- let restService: NotificationsBrokerSourceRestService;
+describe('QualityAssuranceSourceService', () => {
+ let service: QualityAssuranceSourceService;
+ let restService: QualityAssuranceSourceRestService;
let serviceAsAny: any;
let restServiceAsAny: any;
const pageInfo = new PageInfo();
- const array = [ notificationsBrokerSourceObjectMorePid, notificationsBrokerSourceObjectMoreAbstract ];
+ const array = [ qualityAssuranceSourceObjectMorePid, qualityAssuranceSourceObjectMoreAbstract ];
const paginatedList = buildPaginatedList(pageInfo, array);
const paginatedListRD = createSuccessfulRemoteDataObject(paginatedList);
const elementsPerPage = 3;
@@ -31,22 +31,22 @@ describe('NotificationsBrokerSourceService', () => {
beforeEach(async () => {
TestBed.configureTestingModule({
providers: [
- { provide: NotificationsBrokerSourceRestService, useClass: getMockNotificationsBrokerSourceRestService },
- { provide: NotificationsBrokerSourceService, useValue: service }
+ { provide: QualityAssuranceSourceRestService, useClass: getMockQualityAssuranceSourceRestService },
+ { provide: QualityAssuranceSourceService, useValue: service }
]
}).compileComponents();
});
beforeEach(() => {
- restService = TestBed.get(NotificationsBrokerSourceRestService);
+ restService = TestBed.get(QualityAssuranceSourceRestService);
restServiceAsAny = restService;
restServiceAsAny.getSources.and.returnValue(observableOf(paginatedListRD));
- service = new NotificationsBrokerSourceService(restService);
+ service = new QualityAssuranceSourceService(restService);
serviceAsAny = service;
});
describe('getSources', () => {
- it('Should proxy the call to notificationsBrokerSourceRestService.getSources', () => {
+ it('Should proxy the call to qualityAssuranceSourceRestService.getSources', () => {
const sortOptions = new SortOptions('name', SortDirection.ASC);
const findListOptions: FindListOptions = {
elementsPerPage: elementsPerPage,
@@ -54,10 +54,10 @@ describe('NotificationsBrokerSourceService', () => {
sort: sortOptions
};
const result = service.getSources(elementsPerPage, currentPage);
- expect((service as any).notificationsBrokerSourceRestService.getSources).toHaveBeenCalledWith(findListOptions);
+ expect((service as any).qualityAssuranceSourceRestService.getSources).toHaveBeenCalledWith(findListOptions);
});
- it('Should return a paginated list of Notifications Broker Source', () => {
+ it('Should return a paginated list of Quality Assurance Source', () => {
const expected = cold('(a|)', {
a: paginatedList
});
diff --git a/src/app/notifications/qa/source/quality-assurance-source.service.ts b/src/app/notifications/qa/source/quality-assurance-source.service.ts
new file mode 100644
index 0000000000..30a889d3e2
--- /dev/null
+++ b/src/app/notifications/qa/source/quality-assurance-source.service.ts
@@ -0,0 +1,55 @@
+import { Injectable } from '@angular/core';
+import { Observable } from 'rxjs';
+import { find, map } from 'rxjs/operators';
+import { QualityAssuranceSourceRestService } from '../../../core/notifications/qa/source/quality-assurance-source-rest.service';
+import { SortDirection, SortOptions } from '../../../core/cache/models/sort-options.model';
+import { RemoteData } from '../../../core/data/remote-data';
+import { PaginatedList } from '../../../core/data/paginated-list.model';
+import { QualityAssuranceSourceObject } from '../../../core/notifications/qa/models/quality-assurance-source.model';
+import {FindListOptions} from '../../../core/data/find-list-options.model';
+
+/**
+ * The service handling all Quality Assurance source requests to the REST service.
+ */
+@Injectable()
+export class QualityAssuranceSourceService {
+
+ /**
+ * Initialize the service variables.
+ * @param {QualityAssuranceSourceRestService} qualityAssuranceSourceRestService
+ */
+ constructor(
+ private qualityAssuranceSourceRestService: QualityAssuranceSourceRestService
+ ) { }
+
+ /**
+ * Return the list of Quality Assurance source managing pagination and errors.
+ *
+ * @param elementsPerPage
+ * The number of the source per page
+ * @param currentPage
+ * The page number to retrieve
+ * @return Observable>
+ * The list of Quality Assurance source.
+ */
+ public getSources(elementsPerPage, currentPage): Observable> {
+ const sortOptions = new SortOptions('name', SortDirection.ASC);
+
+ const findListOptions: FindListOptions = {
+ elementsPerPage: elementsPerPage,
+ currentPage: currentPage,
+ sort: sortOptions
+ };
+
+ return this.qualityAssuranceSourceRestService.getSources(findListOptions).pipe(
+ find((rd: RemoteData>) => !rd.isResponsePending),
+ map((rd: RemoteData>) => {
+ if (rd.hasSucceeded) {
+ return rd.payload;
+ } else {
+ throw new Error('Can\'t retrieve Quality Assurance source from the Broker source REST service');
+ }
+ })
+ );
+ }
+}
diff --git a/src/app/notifications/broker/topics/notifications-broker-topics.actions.ts b/src/app/notifications/qa/topics/quality-assurance-topics.actions.ts
similarity index 62%
rename from src/app/notifications/broker/topics/notifications-broker-topics.actions.ts
rename to src/app/notifications/qa/topics/quality-assurance-topics.actions.ts
index 622ecc8141..0506806587 100644
--- a/src/app/notifications/broker/topics/notifications-broker-topics.actions.ts
+++ b/src/app/notifications/qa/topics/quality-assurance-topics.actions.ts
@@ -1,6 +1,6 @@
import { Action } from '@ngrx/store';
import { type } from '../../../shared/ngrx/type';
-import { NotificationsBrokerTopicObject } from '../../../core/notifications/broker/models/notifications-broker-topic.model';
+import { QualityAssuranceTopicObject } from '../../../core/notifications/qa/models/quality-assurance-topic.model';
/**
* For each action type in an action group, make a simple
@@ -10,19 +10,19 @@ import { NotificationsBrokerTopicObject } from '../../../core/notifications/brok
* literal types and runs a simple check to guarantee all
* action types in the application are unique.
*/
-export const NotificationsBrokerTopicActionTypes = {
- ADD_TOPICS: type('dspace/integration/notifications/broker/topic/ADD_TOPICS'),
- RETRIEVE_ALL_TOPICS: type('dspace/integration/notifications/broker/topic/RETRIEVE_ALL_TOPICS'),
- RETRIEVE_ALL_TOPICS_ERROR: type('dspace/integration/notifications/broker/topic/RETRIEVE_ALL_TOPICS_ERROR'),
+export const QualityAssuranceTopicActionTypes = {
+ ADD_TOPICS: type('dspace/integration/notifications/qa/topic/ADD_TOPICS'),
+ RETRIEVE_ALL_TOPICS: type('dspace/integration/notifications/qa/topic/RETRIEVE_ALL_TOPICS'),
+ RETRIEVE_ALL_TOPICS_ERROR: type('dspace/integration/notifications/qa/topic/RETRIEVE_ALL_TOPICS_ERROR'),
};
/* tslint:disable:max-classes-per-file */
/**
- * An ngrx action to retrieve all the Notifications Broker topics.
+ * An ngrx action to retrieve all the Quality Assurance topics.
*/
export class RetrieveAllTopicsAction implements Action {
- type = NotificationsBrokerTopicActionTypes.RETRIEVE_ALL_TOPICS;
+ type = QualityAssuranceTopicActionTypes.RETRIEVE_ALL_TOPICS;
payload: {
elementsPerPage: number;
currentPage: number;
@@ -45,20 +45,20 @@ export class RetrieveAllTopicsAction implements Action {
}
/**
- * An ngrx action for retrieving 'all Notifications Broker topics' error.
+ * An ngrx action for retrieving 'all Quality Assurance topics' error.
*/
export class RetrieveAllTopicsErrorAction implements Action {
- type = NotificationsBrokerTopicActionTypes.RETRIEVE_ALL_TOPICS_ERROR;
+ type = QualityAssuranceTopicActionTypes.RETRIEVE_ALL_TOPICS_ERROR;
}
/**
- * An ngrx action to load the Notifications Broker topic objects.
+ * An ngrx action to load the Quality Assurance topic objects.
* Called by the ??? effect.
*/
export class AddTopicsAction implements Action {
- type = NotificationsBrokerTopicActionTypes.ADD_TOPICS;
+ type = QualityAssuranceTopicActionTypes.ADD_TOPICS;
payload: {
- topics: NotificationsBrokerTopicObject[];
+ topics: QualityAssuranceTopicObject[];
totalPages: number;
currentPage: number;
totalElements: number;
@@ -74,9 +74,9 @@ export class AddTopicsAction implements Action {
* @param currentPage
* the current page
* @param totalElements
- * the total available Notifications Broker topics
+ * the total available Quality Assurance topics
*/
- constructor(topics: NotificationsBrokerTopicObject[], totalPages: number, currentPage: number, totalElements: number) {
+ constructor(topics: QualityAssuranceTopicObject[], totalPages: number, currentPage: number, totalElements: number) {
this.payload = {
topics,
totalPages,
@@ -93,7 +93,7 @@ export class AddTopicsAction implements Action {
* Export a type alias of all actions in this action group
* so that reducers can easily compose action types.
*/
-export type NotificationsBrokerTopicsActions
+export type QualityAssuranceTopicsActions
= AddTopicsAction
|RetrieveAllTopicsAction
|RetrieveAllTopicsErrorAction;
diff --git a/src/app/notifications/broker/topics/notifications-broker-topics.component.html b/src/app/notifications/qa/topics/quality-assurance-topics.component.html
similarity index 97%
rename from src/app/notifications/broker/topics/notifications-broker-topics.component.html
rename to src/app/notifications/qa/topics/quality-assurance-topics.component.html
index 8b27778ee9..b563a355f5 100644
--- a/src/app/notifications/broker/topics/notifications-broker-topics.component.html
+++ b/src/app/notifications/qa/topics/quality-assurance-topics.component.html
@@ -15,7 +15,7 @@
[collectionSize]="(totalElements$ | async)"
[hideGear]="false"
[hideSortOptions]="true"
- (paginationChange)="getNotificationsBrokerTopics()">
+ (paginationChange)="getQualityAssuranceTopics()">
diff --git a/src/app/notifications/broker/topics/notifications-broker-topics.component.scss b/src/app/notifications/qa/topics/quality-assurance-topics.component.scss
similarity index 100%
rename from src/app/notifications/broker/topics/notifications-broker-topics.component.scss
rename to src/app/notifications/qa/topics/quality-assurance-topics.component.scss
diff --git a/src/app/notifications/broker/topics/notifications-broker-topics.component.spec.ts b/src/app/notifications/qa/topics/quality-assurance-topics.component.spec.ts
similarity index 59%
rename from src/app/notifications/broker/topics/notifications-broker-topics.component.spec.ts
rename to src/app/notifications/qa/topics/quality-assurance-topics.component.spec.ts
index dbb8137321..8e154eca99 100644
--- a/src/app/notifications/broker/topics/notifications-broker-topics.component.spec.ts
+++ b/src/app/notifications/qa/topics/quality-assurance-topics.component.spec.ts
@@ -7,23 +7,23 @@ import { ComponentFixture, inject, TestBed, waitForAsync } from '@angular/core/t
import { createTestComponent } from '../../../shared/testing/utils.test';
import {
getMockNotificationsStateService,
- notificationsBrokerTopicObjectMoreAbstract,
- notificationsBrokerTopicObjectMorePid
+ qualityAssuranceTopicObjectMoreAbstract,
+ qualityAssuranceTopicObjectMorePid
} from '../../../shared/mocks/notifications.mock';
-import { NotificationsBrokerTopicsComponent } from './notifications-broker-topics.component';
+import { QualityAssuranceTopicsComponent } from './quality-assurance-topics.component';
import { NotificationsStateService } from '../../notifications-state.service';
import { cold } from 'jasmine-marbles';
import { PaginationServiceStub } from '../../../shared/testing/pagination-service.stub';
import { PaginationService } from '../../../core/pagination/pagination.service';
-import { NotificationsBrokerTopicsService } from './notifications-broker-topics.service';
+import { QualityAssuranceTopicsService } from './quality-assurance-topics.service';
-describe('NotificationsBrokerTopicsComponent test suite', () => {
- let fixture: ComponentFixture;
- let comp: NotificationsBrokerTopicsComponent;
+describe('QualityAssuranceTopicsComponent test suite', () => {
+ let fixture: ComponentFixture;
+ let comp: QualityAssuranceTopicsComponent;
let compAsAny: any;
const mockNotificationsStateService = getMockNotificationsStateService();
const activatedRouteParams = {
- notificationsBrokerTopicsParams: {
+ qualityAssuranceTopicsParams: {
currentPage: 0,
pageSize: 5
}
@@ -37,7 +37,7 @@ describe('NotificationsBrokerTopicsComponent test suite', () => {
TranslateModule.forRoot(),
],
declarations: [
- NotificationsBrokerTopicsComponent,
+ QualityAssuranceTopicsComponent,
TestComponent,
],
providers: [
@@ -48,22 +48,22 @@ describe('NotificationsBrokerTopicsComponent test suite', () => {
},
}}},
{ provide: PaginationService, useValue: paginationService },
- NotificationsBrokerTopicsComponent,
+ QualityAssuranceTopicsComponent,
// tslint:disable-next-line: no-empty
- { provide: NotificationsBrokerTopicsService, useValue: { setSourceId: (sourceId: string) => { } }}
+ { provide: QualityAssuranceTopicsService, useValue: { setSourceId: (sourceId: string) => { } }}
],
schemas: [NO_ERRORS_SCHEMA]
}).compileComponents().then(() => {
- mockNotificationsStateService.getNotificationsBrokerTopics.and.returnValue(observableOf([
- notificationsBrokerTopicObjectMorePid,
- notificationsBrokerTopicObjectMoreAbstract
+ mockNotificationsStateService.getQualityAssuranceTopics.and.returnValue(observableOf([
+ qualityAssuranceTopicObjectMorePid,
+ qualityAssuranceTopicObjectMoreAbstract
]));
- mockNotificationsStateService.getNotificationsBrokerTopicsTotalPages.and.returnValue(observableOf(1));
- mockNotificationsStateService.getNotificationsBrokerTopicsCurrentPage.and.returnValue(observableOf(0));
- mockNotificationsStateService.getNotificationsBrokerTopicsTotals.and.returnValue(observableOf(2));
- mockNotificationsStateService.isNotificationsBrokerTopicsLoaded.and.returnValue(observableOf(true));
- mockNotificationsStateService.isNotificationsBrokerTopicsLoading.and.returnValue(observableOf(false));
- mockNotificationsStateService.isNotificationsBrokerTopicsProcessing.and.returnValue(observableOf(false));
+ mockNotificationsStateService.getQualityAssuranceTopicsTotalPages.and.returnValue(observableOf(1));
+ mockNotificationsStateService.getQualityAssuranceTopicsCurrentPage.and.returnValue(observableOf(0));
+ mockNotificationsStateService.getQualityAssuranceTopicsTotals.and.returnValue(observableOf(2));
+ mockNotificationsStateService.isQualityAssuranceTopicsLoaded.and.returnValue(observableOf(true));
+ mockNotificationsStateService.isQualityAssuranceTopicsLoading.and.returnValue(observableOf(false));
+ mockNotificationsStateService.isQualityAssuranceTopicsProcessing.and.returnValue(observableOf(false));
});
}));
@@ -75,7 +75,7 @@ describe('NotificationsBrokerTopicsComponent test suite', () => {
// synchronous beforeEach
beforeEach(() => {
const html = `
- `;
+ `;
testFixture = createTestComponent(html, TestComponent) as ComponentFixture;
testComp = testFixture.componentInstance;
});
@@ -84,14 +84,14 @@ describe('NotificationsBrokerTopicsComponent test suite', () => {
testFixture.destroy();
});
- it('should create NotificationsBrokerTopicsComponent', inject([NotificationsBrokerTopicsComponent], (app: NotificationsBrokerTopicsComponent) => {
+ it('should create QualityAssuranceTopicsComponent', inject([QualityAssuranceTopicsComponent], (app: QualityAssuranceTopicsComponent) => {
expect(app).toBeDefined();
}));
});
describe('Main tests running with two topics', () => {
beforeEach(() => {
- fixture = TestBed.createComponent(NotificationsBrokerTopicsComponent);
+ fixture = TestBed.createComponent(QualityAssuranceTopicsComponent);
comp = fixture.componentInstance;
compAsAny = comp;
@@ -109,8 +109,8 @@ describe('NotificationsBrokerTopicsComponent test suite', () => {
expect(comp.topics$).toBeObservable(cold('(a|)', {
a: [
- notificationsBrokerTopicObjectMorePid,
- notificationsBrokerTopicObjectMoreAbstract
+ qualityAssuranceTopicObjectMorePid,
+ qualityAssuranceTopicObjectMoreAbstract
]
}));
expect(comp.totalElements$).toBeObservable(cold('(a|)', {
@@ -119,12 +119,12 @@ describe('NotificationsBrokerTopicsComponent test suite', () => {
});
it(('Should set data properly after the view init'), () => {
- spyOn(compAsAny, 'getNotificationsBrokerTopics');
+ spyOn(compAsAny, 'getQualityAssuranceTopics');
comp.ngAfterViewInit();
fixture.detectChanges();
- expect(compAsAny.getNotificationsBrokerTopics).toHaveBeenCalled();
+ expect(compAsAny.getQualityAssuranceTopics).toHaveBeenCalled();
});
it(('isTopicsLoading should return FALSE'), () => {
@@ -139,12 +139,12 @@ describe('NotificationsBrokerTopicsComponent test suite', () => {
}));
});
- it(('getNotificationsBrokerTopics should call the service to dispatch a STATE change'), () => {
+ it(('getQualityAssuranceTopics should call the service to dispatch a STATE change'), () => {
comp.ngOnInit();
fixture.detectChanges();
- compAsAny.notificationsStateService.dispatchRetrieveNotificationsBrokerTopics(comp.paginationConfig.pageSize, comp.paginationConfig.currentPage).and.callThrough();
- expect(compAsAny.notificationsStateService.dispatchRetrieveNotificationsBrokerTopics).toHaveBeenCalledWith(comp.paginationConfig.pageSize, comp.paginationConfig.currentPage);
+ compAsAny.notificationsStateService.dispatchRetrieveQualityAssuranceTopics(comp.paginationConfig.pageSize, comp.paginationConfig.currentPage).and.callThrough();
+ expect(compAsAny.notificationsStateService.dispatchRetrieveQualityAssuranceTopics).toHaveBeenCalledWith(comp.paginationConfig.pageSize, comp.paginationConfig.currentPage);
});
});
});
diff --git a/src/app/notifications/broker/topics/notifications-broker-topics.component.ts b/src/app/notifications/qa/topics/quality-assurance-topics.component.ts
similarity index 63%
rename from src/app/notifications/broker/topics/notifications-broker-topics.component.ts
rename to src/app/notifications/qa/topics/quality-assurance-topics.component.ts
index a740ca5c1e..f825358f3b 100644
--- a/src/app/notifications/broker/topics/notifications-broker-topics.component.ts
+++ b/src/app/notifications/qa/topics/quality-assurance-topics.component.ts
@@ -4,24 +4,24 @@ import { Observable, Subscription } from 'rxjs';
import { distinctUntilChanged, map, take } from 'rxjs/operators';
import { SortOptions } from '../../../core/cache/models/sort-options.model';
-import { NotificationsBrokerTopicObject } from '../../../core/notifications/broker/models/notifications-broker-topic.model';
+import { QualityAssuranceTopicObject } from '../../../core/notifications/qa/models/quality-assurance-topic.model';
import { hasValue } from '../../../shared/empty.util';
import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model';
import { NotificationsStateService } from '../../notifications-state.service';
-import { AdminNotificationsBrokerTopicsPageParams } from '../../../admin/admin-notifications/admin-notifications-broker-topics-page/admin-notifications-broker-topics-page-resolver.service';
+import { AdminQualityAssuranceTopicsPageParams } from '../../../admin/admin-notifications/admin-quality-assurance-topics-page/admin-quality-assurance-topics-page-resolver.service';
import { PaginationService } from '../../../core/pagination/pagination.service';
import { ActivatedRoute } from '@angular/router';
-import { NotificationsBrokerTopicsService } from './notifications-broker-topics.service';
+import { QualityAssuranceTopicsService } from './quality-assurance-topics.service';
/**
- * Component to display the Notifications Broker topic list.
+ * Component to display the Quality Assurance topic list.
*/
@Component({
- selector: 'ds-notifications-broker-topic',
- templateUrl: './notifications-broker-topics.component.html',
- styleUrls: ['./notifications-broker-topics.component.scss'],
+ selector: 'ds-quality-assurance-topic',
+ templateUrl: './quality-assurance-topics.component.html',
+ styleUrls: ['./quality-assurance-topics.component.scss'],
})
-export class NotificationsBrokerTopicsComponent implements OnInit {
+export class QualityAssuranceTopicsComponent implements OnInit {
/**
* The pagination system configuration for HTML listing.
* @type {PaginationComponentOptions}
@@ -32,16 +32,16 @@ export class NotificationsBrokerTopicsComponent implements OnInit {
pageSizeOptions: [5, 10, 20, 40, 60]
});
/**
- * The Notifications Broker topic list sort options.
+ * The Quality Assurance topic list sort options.
* @type {SortOptions}
*/
public paginationSortConfig: SortOptions;
/**
- * The Notifications Broker topic list.
+ * The Quality Assurance topic list.
*/
- public topics$: Observable;
+ public topics$: Observable;
/**
- * The total number of Notifications Broker topics.
+ * The total number of Quality Assurance topics.
*/
public totalElements$: Observable;
/**
@@ -65,7 +65,7 @@ export class NotificationsBrokerTopicsComponent implements OnInit {
private paginationService: PaginationService,
private activatedRoute: ActivatedRoute,
private notificationsStateService: NotificationsStateService,
- private notificationsBrokerTopicsService: NotificationsBrokerTopicsService
+ private qualityAssuranceTopicsService: QualityAssuranceTopicsService
) {
}
@@ -74,52 +74,52 @@ export class NotificationsBrokerTopicsComponent implements OnInit {
*/
ngOnInit(): void {
this.sourceId = this.activatedRoute.snapshot.paramMap.get('sourceId');
- this.notificationsBrokerTopicsService.setSourceId(this.sourceId);
- this.topics$ = this.notificationsStateService.getNotificationsBrokerTopics();
- this.totalElements$ = this.notificationsStateService.getNotificationsBrokerTopicsTotals();
+ this.qualityAssuranceTopicsService.setSourceId(this.sourceId);
+ this.topics$ = this.notificationsStateService.getQualityAssuranceTopics();
+ this.totalElements$ = this.notificationsStateService.getQualityAssuranceTopicsTotals();
}
/**
- * First Notifications Broker topics loading after view initialization.
+ * First Quality Assurance topics loading after view initialization.
*/
ngAfterViewInit(): void {
this.subs.push(
- this.notificationsStateService.isNotificationsBrokerTopicsLoaded().pipe(
+ this.notificationsStateService.isQualityAssuranceTopicsLoaded().pipe(
take(1)
).subscribe(() => {
- this.getNotificationsBrokerTopics();
+ this.getQualityAssuranceTopics();
})
);
}
/**
- * Returns the information about the loading status of the Notifications Broker topics (if it's running or not).
+ * Returns the information about the loading status of the Quality Assurance topics (if it's running or not).
*
* @return Observable
* 'true' if the topics are loading, 'false' otherwise.
*/
public isTopicsLoading(): Observable {
- return this.notificationsStateService.isNotificationsBrokerTopicsLoading();
+ return this.notificationsStateService.isQualityAssuranceTopicsLoading();
}
/**
- * Returns the information about the processing status of the Notifications Broker topics (if it's running or not).
+ * Returns the information about the processing status of the Quality Assurance topics (if it's running or not).
*
* @return Observable
* 'true' if there are operations running on the topics (ex.: a REST call), 'false' otherwise.
*/
public isTopicsProcessing(): Observable {
- return this.notificationsStateService.isNotificationsBrokerTopicsProcessing();
+ return this.notificationsStateService.isQualityAssuranceTopicsProcessing();
}
/**
- * Dispatch the Notifications Broker topics retrival.
+ * Dispatch the Quality Assurance topics retrival.
*/
- public getNotificationsBrokerTopics(): void {
+ public getQualityAssuranceTopics(): void {
this.paginationService.getCurrentPagination(this.paginationConfig.id, this.paginationConfig).pipe(
distinctUntilChanged(),
).subscribe((options: PaginationComponentOptions) => {
- this.notificationsStateService.dispatchRetrieveNotificationsBrokerTopics(
+ this.notificationsStateService.dispatchRetrieveQualityAssuranceTopics(
options.pageSize,
options.currentPage
);
@@ -131,7 +131,7 @@ export class NotificationsBrokerTopicsComponent implements OnInit {
*
* @param eventsRouteParams
*/
- protected updatePaginationFromRouteParams(eventsRouteParams: AdminNotificationsBrokerTopicsPageParams) {
+ protected updatePaginationFromRouteParams(eventsRouteParams: AdminQualityAssuranceTopicsPageParams) {
if (eventsRouteParams.currentPage) {
this.paginationConfig.currentPage = eventsRouteParams.currentPage;
}
diff --git a/src/app/notifications/broker/topics/notifications-broker-topics.effects.ts b/src/app/notifications/qa/topics/quality-assurance-topics.effects.ts
similarity index 59%
rename from src/app/notifications/broker/topics/notifications-broker-topics.effects.ts
rename to src/app/notifications/qa/topics/quality-assurance-topics.effects.ts
index e3e1e16098..14c0dacc23 100644
--- a/src/app/notifications/broker/topics/notifications-broker-topics.effects.ts
+++ b/src/app/notifications/qa/topics/quality-assurance-topics.effects.ts
@@ -6,35 +6,35 @@ import { catchError, map, switchMap, tap, withLatestFrom } from 'rxjs/operators'
import { of as observableOf } from 'rxjs';
import {
AddTopicsAction,
- NotificationsBrokerTopicActionTypes,
+ QualityAssuranceTopicActionTypes,
RetrieveAllTopicsAction,
RetrieveAllTopicsErrorAction,
-} from './notifications-broker-topics.actions';
+} from './quality-assurance-topics.actions';
-import { NotificationsBrokerTopicObject } from '../../../core/notifications/broker/models/notifications-broker-topic.model';
+import { QualityAssuranceTopicObject } from '../../../core/notifications/qa/models/quality-assurance-topic.model';
import { PaginatedList } from '../../../core/data/paginated-list.model';
-import { NotificationsBrokerTopicsService } from './notifications-broker-topics.service';
+import { QualityAssuranceTopicsService } from './quality-assurance-topics.service';
import { NotificationsService } from '../../../shared/notifications/notifications.service';
-import { NotificationsBrokerTopicRestService } from '../../../core/notifications/broker/topics/notifications-broker-topic-rest.service';
+import { QualityAssuranceTopicRestService } from '../../../core/notifications/qa/topics/quality-assurance-topic-rest.service';
/**
- * Provides effect methods for the Notifications Broker topics actions.
+ * Provides effect methods for the Quality Assurance topics actions.
*/
@Injectable()
-export class NotificationsBrokerTopicsEffects {
+export class QualityAssuranceTopicsEffects {
/**
- * Retrieve all Notifications Broker topics managing pagination and errors.
+ * Retrieve all Quality Assurance topics managing pagination and errors.
*/
@Effect() retrieveAllTopics$ = this.actions$.pipe(
- ofType(NotificationsBrokerTopicActionTypes.RETRIEVE_ALL_TOPICS),
+ ofType(QualityAssuranceTopicActionTypes.RETRIEVE_ALL_TOPICS),
withLatestFrom(this.store$),
switchMap(([action, currentState]: [RetrieveAllTopicsAction, any]) => {
- return this.notificationsBrokerTopicService.getTopics(
+ return this.qualityAssuranceTopicService.getTopics(
action.payload.elementsPerPage,
action.payload.currentPage
).pipe(
- map((topics: PaginatedList) =>
+ map((topics: PaginatedList) =>
new AddTopicsAction(topics.page, topics.totalPages, topics.currentPage, topics.totalElements)
),
catchError((error: Error) => {
@@ -51,7 +51,7 @@ export class NotificationsBrokerTopicsEffects {
* Show a notification on error.
*/
@Effect({ dispatch: false }) retrieveAllTopicsErrorAction$ = this.actions$.pipe(
- ofType(NotificationsBrokerTopicActionTypes.RETRIEVE_ALL_TOPICS_ERROR),
+ ofType(QualityAssuranceTopicActionTypes.RETRIEVE_ALL_TOPICS_ERROR),
tap(() => {
this.notificationsService.error(null, this.translate.get('notifications.broker.topic.error.service.retrieve'));
})
@@ -61,9 +61,9 @@ export class NotificationsBrokerTopicsEffects {
* Clear find all topics requests from cache.
*/
@Effect({ dispatch: false }) addTopicsAction$ = this.actions$.pipe(
- ofType(NotificationsBrokerTopicActionTypes.ADD_TOPICS),
+ ofType(QualityAssuranceTopicActionTypes.ADD_TOPICS),
tap(() => {
- this.notificationsBrokerTopicDataService.clearFindAllTopicsRequests();
+ this.qualityAssuranceTopicDataService.clearFindAllTopicsRequests();
})
);
@@ -73,15 +73,15 @@ export class NotificationsBrokerTopicsEffects {
* @param {Store} store$
* @param {TranslateService} translate
* @param {NotificationsService} notificationsService
- * @param {NotificationsBrokerTopicsService} notificationsBrokerTopicService
- * @param {NotificationsBrokerTopicRestService} notificationsBrokerTopicDataService
+ * @param {QualityAssuranceTopicsService} qualityAssuranceTopicService
+ * @param {QualityAssuranceTopicRestService} qualityAssuranceTopicDataService
*/
constructor(
private actions$: Actions,
private store$: Store,
private translate: TranslateService,
private notificationsService: NotificationsService,
- private notificationsBrokerTopicService: NotificationsBrokerTopicsService,
- private notificationsBrokerTopicDataService: NotificationsBrokerTopicRestService
+ private qualityAssuranceTopicService: QualityAssuranceTopicsService,
+ private qualityAssuranceTopicDataService: QualityAssuranceTopicRestService
) { }
}
diff --git a/src/app/notifications/broker/topics/notifications-broker-topics.reducer.spec.ts b/src/app/notifications/qa/topics/quality-assurance-topics.reducer.spec.ts
similarity index 51%
rename from src/app/notifications/broker/topics/notifications-broker-topics.reducer.spec.ts
rename to src/app/notifications/qa/topics/quality-assurance-topics.reducer.spec.ts
index 523fac9550..a1c002d3f2 100644
--- a/src/app/notifications/broker/topics/notifications-broker-topics.reducer.spec.ts
+++ b/src/app/notifications/qa/topics/quality-assurance-topics.reducer.spec.ts
@@ -2,20 +2,20 @@ import {
AddTopicsAction,
RetrieveAllTopicsAction,
RetrieveAllTopicsErrorAction
-} from './notifications-broker-topics.actions';
-import { notificationsBrokerTopicsReducer, NotificationsBrokerTopicState } from './notifications-broker-topics.reducer';
+} from './quality-assurance-topics.actions';
+import { qualityAssuranceTopicsReducer, QualityAssuranceTopicState } from './quality-assurance-topics.reducer';
import {
- notificationsBrokerTopicObjectMoreAbstract,
- notificationsBrokerTopicObjectMorePid
+ qualityAssuranceTopicObjectMoreAbstract,
+ qualityAssuranceTopicObjectMorePid
} from '../../../shared/mocks/notifications.mock';
-describe('notificationsBrokerTopicsReducer test suite', () => {
- let notificationsBrokerTopicInitialState: NotificationsBrokerTopicState;
+describe('qualityAssuranceTopicsReducer test suite', () => {
+ let qualityAssuranceTopicInitialState: QualityAssuranceTopicState;
const elementPerPage = 3;
const currentPage = 0;
beforeEach(() => {
- notificationsBrokerTopicInitialState = {
+ qualityAssuranceTopicInitialState = {
topics: [],
processing: false,
loaded: false,
@@ -26,30 +26,30 @@ describe('notificationsBrokerTopicsReducer test suite', () => {
});
it('Action RETRIEVE_ALL_TOPICS should set the State property "processing" to TRUE', () => {
- const expectedState = notificationsBrokerTopicInitialState;
+ const expectedState = qualityAssuranceTopicInitialState;
expectedState.processing = true;
const action = new RetrieveAllTopicsAction(elementPerPage, currentPage);
- const newState = notificationsBrokerTopicsReducer(notificationsBrokerTopicInitialState, action);
+ const newState = qualityAssuranceTopicsReducer(qualityAssuranceTopicInitialState, action);
expect(newState).toEqual(expectedState);
});
it('Action RETRIEVE_ALL_TOPICS_ERROR should change the State to initial State but processing, loaded, and currentPage', () => {
- const expectedState = notificationsBrokerTopicInitialState;
+ const expectedState = qualityAssuranceTopicInitialState;
expectedState.processing = false;
expectedState.loaded = true;
expectedState.currentPage = 0;
const action = new RetrieveAllTopicsErrorAction();
- const newState = notificationsBrokerTopicsReducer(notificationsBrokerTopicInitialState, action);
+ const newState = qualityAssuranceTopicsReducer(qualityAssuranceTopicInitialState, action);
expect(newState).toEqual(expectedState);
});
- it('Action ADD_TOPICS should populate the State with Notifications Broker topics', () => {
+ it('Action ADD_TOPICS should populate the State with Quality Assurance topics', () => {
const expectedState = {
- topics: [ notificationsBrokerTopicObjectMorePid, notificationsBrokerTopicObjectMoreAbstract ],
+ topics: [ qualityAssuranceTopicObjectMorePid, qualityAssuranceTopicObjectMoreAbstract ],
processing: false,
loaded: true,
totalPages: 1,
@@ -58,10 +58,10 @@ describe('notificationsBrokerTopicsReducer test suite', () => {
};
const action = new AddTopicsAction(
- [ notificationsBrokerTopicObjectMorePid, notificationsBrokerTopicObjectMoreAbstract ],
+ [ qualityAssuranceTopicObjectMorePid, qualityAssuranceTopicObjectMoreAbstract ],
1, 0, 2
);
- const newState = notificationsBrokerTopicsReducer(notificationsBrokerTopicInitialState, action);
+ const newState = qualityAssuranceTopicsReducer(qualityAssuranceTopicInitialState, action);
expect(newState).toEqual(expectedState);
});
diff --git a/src/app/notifications/qa/topics/quality-assurance-topics.reducer.ts b/src/app/notifications/qa/topics/quality-assurance-topics.reducer.ts
new file mode 100644
index 0000000000..ff94f1b8bb
--- /dev/null
+++ b/src/app/notifications/qa/topics/quality-assurance-topics.reducer.ts
@@ -0,0 +1,72 @@
+import { QualityAssuranceTopicObject } from '../../../core/notifications/qa/models/quality-assurance-topic.model';
+import { QualityAssuranceTopicActionTypes, QualityAssuranceTopicsActions } from './quality-assurance-topics.actions';
+
+/**
+ * The interface representing the Quality Assurance topic state.
+ */
+export interface QualityAssuranceTopicState {
+ topics: QualityAssuranceTopicObject[];
+ processing: boolean;
+ loaded: boolean;
+ totalPages: number;
+ currentPage: number;
+ totalElements: number;
+}
+
+/**
+ * Used for the Quality Assurance topic state initialization.
+ */
+const qualityAssuranceTopicInitialState: QualityAssuranceTopicState = {
+ topics: [],
+ processing: false,
+ loaded: false,
+ totalPages: 0,
+ currentPage: 0,
+ totalElements: 0
+};
+
+/**
+ * The Quality Assurance Topic Reducer
+ *
+ * @param state
+ * the current state initialized with qualityAssuranceTopicInitialState
+ * @param action
+ * the action to perform on the state
+ * @return QualityAssuranceTopicState
+ * the new state
+ */
+export function qualityAssuranceTopicsReducer(state = qualityAssuranceTopicInitialState, action: QualityAssuranceTopicsActions): QualityAssuranceTopicState {
+ switch (action.type) {
+ case QualityAssuranceTopicActionTypes.RETRIEVE_ALL_TOPICS: {
+ return Object.assign({}, state, {
+ topics: [],
+ processing: true
+ });
+ }
+
+ case QualityAssuranceTopicActionTypes.ADD_TOPICS: {
+ return Object.assign({}, state, {
+ topics: action.payload.topics,
+ processing: false,
+ loaded: true,
+ totalPages: action.payload.totalPages,
+ currentPage: state.currentPage,
+ totalElements: action.payload.totalElements
+ });
+ }
+
+ case QualityAssuranceTopicActionTypes.RETRIEVE_ALL_TOPICS_ERROR: {
+ return Object.assign({}, state, {
+ processing: false,
+ loaded: true,
+ totalPages: 0,
+ currentPage: 0,
+ totalElements: 0
+ });
+ }
+
+ default: {
+ return state;
+ }
+ }
+}
diff --git a/src/app/notifications/broker/topics/notifications-broker-topics.service.spec.ts b/src/app/notifications/qa/topics/quality-assurance-topics.service.spec.ts
similarity index 58%
rename from src/app/notifications/broker/topics/notifications-broker-topics.service.spec.ts
rename to src/app/notifications/qa/topics/quality-assurance-topics.service.spec.ts
index e5616df320..6d945446b2 100644
--- a/src/app/notifications/broker/topics/notifications-broker-topics.service.spec.ts
+++ b/src/app/notifications/qa/topics/quality-assurance-topics.service.spec.ts
@@ -1,28 +1,28 @@
import { TestBed } from '@angular/core/testing';
import { of as observableOf } from 'rxjs';
-import { NotificationsBrokerTopicsService } from './notifications-broker-topics.service';
+import { QualityAssuranceTopicsService } from './quality-assurance-topics.service';
import { SortDirection, SortOptions } from '../../../core/cache/models/sort-options.model';
-import { NotificationsBrokerTopicRestService } from '../../../core/notifications/broker/topics/notifications-broker-topic-rest.service';
+import { QualityAssuranceTopicRestService } from '../../../core/notifications/qa/topics/quality-assurance-topic-rest.service';
import { PageInfo } from '../../../core/shared/page-info.model';
-import { FindListOptions } from '../../../core/data/request.models';
import {
- getMockNotificationsBrokerTopicRestService,
- notificationsBrokerTopicObjectMoreAbstract,
- notificationsBrokerTopicObjectMorePid
+ getMockQualityAssuranceTopicRestService,
+ qualityAssuranceTopicObjectMoreAbstract,
+ qualityAssuranceTopicObjectMorePid
} from '../../../shared/mocks/notifications.mock';
import { createSuccessfulRemoteDataObject } from '../../../shared/remote-data.utils';
import { cold } from 'jasmine-marbles';
import { buildPaginatedList } from '../../../core/data/paginated-list.model';
import { RequestParam } from '../../../core/cache/models/request-param.model';
+import {FindListOptions} from '../../../core/data/find-list-options.model';
-describe('NotificationsBrokerTopicsService', () => {
- let service: NotificationsBrokerTopicsService;
- let restService: NotificationsBrokerTopicRestService;
+describe('QualityAssuranceTopicsService', () => {
+ let service: QualityAssuranceTopicsService;
+ let restService: QualityAssuranceTopicRestService;
let serviceAsAny: any;
let restServiceAsAny: any;
const pageInfo = new PageInfo();
- const array = [ notificationsBrokerTopicObjectMorePid, notificationsBrokerTopicObjectMoreAbstract ];
+ const array = [ qualityAssuranceTopicObjectMorePid, qualityAssuranceTopicObjectMoreAbstract ];
const paginatedList = buildPaginatedList(pageInfo, array);
const paginatedListRD = createSuccessfulRemoteDataObject(paginatedList);
const elementsPerPage = 3;
@@ -31,22 +31,22 @@ describe('NotificationsBrokerTopicsService', () => {
beforeEach(async () => {
TestBed.configureTestingModule({
providers: [
- { provide: NotificationsBrokerTopicRestService, useClass: getMockNotificationsBrokerTopicRestService },
- { provide: NotificationsBrokerTopicsService, useValue: service }
+ { provide: QualityAssuranceTopicRestService, useClass: getMockQualityAssuranceTopicRestService },
+ { provide: QualityAssuranceTopicsService, useValue: service }
]
}).compileComponents();
});
beforeEach(() => {
- restService = TestBed.get(NotificationsBrokerTopicRestService);
+ restService = TestBed.get(QualityAssuranceTopicRestService);
restServiceAsAny = restService;
restServiceAsAny.getTopics.and.returnValue(observableOf(paginatedListRD));
- service = new NotificationsBrokerTopicsService(restService);
+ service = new QualityAssuranceTopicsService(restService);
serviceAsAny = service;
});
describe('getTopics', () => {
- it('Should proxy the call to notificationsBrokerTopicRestService.getTopics', () => {
+ it('Should proxy the call to qualityAssuranceTopicRestService.getTopics', () => {
const sortOptions = new SortOptions('name', SortDirection.ASC);
const findListOptions: FindListOptions = {
elementsPerPage: elementsPerPage,
@@ -56,10 +56,10 @@ describe('NotificationsBrokerTopicsService', () => {
};
service.setSourceId('ENRICH!MORE!ABSTRACT');
const result = service.getTopics(elementsPerPage, currentPage);
- expect((service as any).notificationsBrokerTopicRestService.getTopics).toHaveBeenCalledWith(findListOptions);
+ expect((service as any).qualityAssuranceTopicRestService.getTopics).toHaveBeenCalledWith(findListOptions);
});
- it('Should return a paginated list of Notifications Broker topics', () => {
+ it('Should return a paginated list of Quality Assurance topics', () => {
const expected = cold('(a|)', {
a: paginatedList
});
diff --git a/src/app/notifications/broker/topics/notifications-broker-topics.service.ts b/src/app/notifications/qa/topics/quality-assurance-topics.service.ts
similarity index 51%
rename from src/app/notifications/broker/topics/notifications-broker-topics.service.ts
rename to src/app/notifications/qa/topics/quality-assurance-topics.service.ts
index 80c52a70a9..c09a0750e0 100644
--- a/src/app/notifications/broker/topics/notifications-broker-topics.service.ts
+++ b/src/app/notifications/qa/topics/quality-assurance-topics.service.ts
@@ -1,26 +1,26 @@
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { find, map } from 'rxjs/operators';
-import { NotificationsBrokerTopicRestService } from '../../../core/notifications/broker/topics/notifications-broker-topic-rest.service';
+import { QualityAssuranceTopicRestService } from '../../../core/notifications/qa/topics/quality-assurance-topic-rest.service';
import { SortDirection, SortOptions } from '../../../core/cache/models/sort-options.model';
-import { FindListOptions } from '../../../core/data/request.models';
import { RemoteData } from '../../../core/data/remote-data';
import { PaginatedList } from '../../../core/data/paginated-list.model';
-import { NotificationsBrokerTopicObject } from '../../../core/notifications/broker/models/notifications-broker-topic.model';
+import { QualityAssuranceTopicObject } from '../../../core/notifications/qa/models/quality-assurance-topic.model';
import { RequestParam } from '../../../core/cache/models/request-param.model';
+import {FindListOptions} from '../../../core/data/find-list-options.model';
/**
- * The service handling all Notifications Broker topic requests to the REST service.
+ * The service handling all Quality Assurance topic requests to the REST service.
*/
@Injectable()
-export class NotificationsBrokerTopicsService {
+export class QualityAssuranceTopicsService {
/**
* Initialize the service variables.
- * @param {NotificationsBrokerTopicRestService} notificationsBrokerTopicRestService
+ * @param {QualityAssuranceTopicRestService} qualityAssuranceTopicRestService
*/
constructor(
- private notificationsBrokerTopicRestService: NotificationsBrokerTopicRestService
+ private qualityAssuranceTopicRestService: QualityAssuranceTopicRestService
) { }
/**
@@ -29,16 +29,16 @@ export class NotificationsBrokerTopicsService {
sourceId: string;
/**
- * Return the list of Notifications Broker topics managing pagination and errors.
+ * Return the list of Quality Assurance topics managing pagination and errors.
*
* @param elementsPerPage
* The number of the topics per page
* @param currentPage
* The page number to retrieve
- * @return Observable>
- * The list of Notifications Broker topics.
+ * @return Observable>
+ * The list of Quality Assurance topics.
*/
- public getTopics(elementsPerPage, currentPage): Observable> {
+ public getTopics(elementsPerPage, currentPage): Observable> {
const sortOptions = new SortOptions('name', SortDirection.ASC);
const findListOptions: FindListOptions = {
@@ -48,13 +48,13 @@ export class NotificationsBrokerTopicsService {
searchParams: [new RequestParam('source', this.sourceId)]
};
- return this.notificationsBrokerTopicRestService.getTopics(findListOptions).pipe(
- find((rd: RemoteData>) => !rd.isResponsePending),
- map((rd: RemoteData>) => {
+ return this.qualityAssuranceTopicRestService.getTopics(findListOptions).pipe(
+ find((rd: RemoteData>) => !rd.isResponsePending),
+ map((rd: RemoteData>) => {
if (rd.hasSucceeded) {
return rd.payload;
} else {
- throw new Error('Can\'t retrieve Notifications Broker topics from the Broker topics REST service');
+ throw new Error('Can\'t retrieve Quality Assurance topics from the Broker topics REST service');
}
})
);
diff --git a/src/app/notifications/selectors.ts b/src/app/notifications/selectors.ts
index 0436a35eb3..3ab769aa95 100644
--- a/src/app/notifications/selectors.ts
+++ b/src/app/notifications/selectors.ts
@@ -1,10 +1,10 @@
import { createSelector, MemoizedSelector } from '@ngrx/store';
import { subStateSelector } from '../shared/selector.util';
import { notificationsSelector, NotificationsState } from './notifications.reducer';
-import { NotificationsBrokerTopicObject } from '../core/notifications/broker/models/notifications-broker-topic.model';
-import { NotificationsBrokerTopicState } from './broker/topics/notifications-broker-topics.reducer';
-import { NotificationsBrokerSourceState } from './broker/source/notifications-broker-source.reducer';
-import { NotificationsBrokerSourceObject } from '../core/notifications/broker/models/notifications-broker-source.model';
+import { QualityAssuranceTopicObject } from '../core/notifications/qa/models/quality-assurance-topic.model';
+import { QualityAssuranceTopicState } from './qa/topics/quality-assurance-topics.reducer';
+import { QualityAssuranceSourceState } from './qa/source/quality-assurance-source.reducer';
+import { QualityAssuranceSourceObject } from '../core/notifications/qa/models/quality-assurance-source.model';
/**
* Returns the Notifications state.
@@ -14,33 +14,33 @@ import { NotificationsBrokerSourceObject } from '../core/notifications/broker/mo
*/
const _getNotificationsState = (state: any) => state.notifications;
-// Notifications Broker topics
+// Quality Assurance topics
// ----------------------------------------------------------------------------
/**
- * Returns the Notifications Broker topics State.
- * @function notificationsBrokerTopicsStateSelector
- * @return {NotificationsBrokerTopicState}
+ * Returns the Quality Assurance topics State.
+ * @function qualityAssuranceTopicsStateSelector
+ * @return {QualityAssuranceTopicState}
*/
-export function notificationsBrokerTopicsStateSelector(): MemoizedSelector {
- return subStateSelector(notificationsSelector, 'brokerTopic');
+export function qualityAssuranceTopicsStateSelector(): MemoizedSelector {
+ return subStateSelector(notificationsSelector, 'brokerTopic');
}
/**
- * Returns the Notifications Broker topics list.
- * @function notificationsBrokerTopicsObjectSelector
- * @return {NotificationsBrokerTopicObject[]}
+ * Returns the Quality Assurance topics list.
+ * @function qualityAssuranceTopicsObjectSelector
+ * @return {QualityAssuranceTopicObject[]}
*/
-export function notificationsBrokerTopicsObjectSelector(): MemoizedSelector {
- return subStateSelector(notificationsBrokerTopicsStateSelector(), 'topics');
+export function qualityAssuranceTopicsObjectSelector(): MemoizedSelector {
+ return subStateSelector(qualityAssuranceTopicsStateSelector(), 'topics');
}
/**
- * Returns true if the Notifications Broker topics are loaded.
- * @function isNotificationsBrokerTopicsLoadedSelector
+ * Returns true if the Quality Assurance topics are loaded.
+ * @function isQualityAssuranceTopicsLoadedSelector
* @return {boolean}
*/
-export const isNotificationsBrokerTopicsLoadedSelector = createSelector(_getNotificationsState,
+export const isQualityAssuranceTopicsLoadedSelector = createSelector(_getNotificationsState,
(state: NotificationsState) => state.brokerTopic.loaded
);
@@ -49,64 +49,64 @@ export const isNotificationsBrokerTopicsLoadedSelector = createSelector(_getNoti
* @function isDeduplicationSetsProcessingSelector
* @return {boolean}
*/
-export const isNotificationsBrokerTopicsProcessingSelector = createSelector(_getNotificationsState,
+export const isQualityAssuranceTopicsProcessingSelector = createSelector(_getNotificationsState,
(state: NotificationsState) => state.brokerTopic.processing
);
/**
- * Returns the total available pages of Notifications Broker topics.
- * @function getNotificationsBrokerTopicsTotalPagesSelector
+ * Returns the total available pages of Quality Assurance topics.
+ * @function getQualityAssuranceTopicsTotalPagesSelector
* @return {number}
*/
-export const getNotificationsBrokerTopicsTotalPagesSelector = createSelector(_getNotificationsState,
+export const getQualityAssuranceTopicsTotalPagesSelector = createSelector(_getNotificationsState,
(state: NotificationsState) => state.brokerTopic.totalPages
);
/**
- * Returns the current page of Notifications Broker topics.
- * @function getNotificationsBrokerTopicsCurrentPageSelector
+ * Returns the current page of Quality Assurance topics.
+ * @function getQualityAssuranceTopicsCurrentPageSelector
* @return {number}
*/
-export const getNotificationsBrokerTopicsCurrentPageSelector = createSelector(_getNotificationsState,
+export const getQualityAssuranceTopicsCurrentPageSelector = createSelector(_getNotificationsState,
(state: NotificationsState) => state.brokerTopic.currentPage
);
/**
- * Returns the total number of Notifications Broker topics.
- * @function getNotificationsBrokerTopicsTotalsSelector
+ * Returns the total number of Quality Assurance topics.
+ * @function getQualityAssuranceTopicsTotalsSelector
* @return {number}
*/
-export const getNotificationsBrokerTopicsTotalsSelector = createSelector(_getNotificationsState,
+export const getQualityAssuranceTopicsTotalsSelector = createSelector(_getNotificationsState,
(state: NotificationsState) => state.brokerTopic.totalElements
);
-// Notifications Broker source
+// Quality Assurance source
// ----------------------------------------------------------------------------
/**
- * Returns the Notifications Broker source State.
- * @function notificationsBrokerSourceStateSelector
- * @return {NotificationsBrokerSourceState}
+ * Returns the Quality Assurance source State.
+ * @function qualityAssuranceSourceStateSelector
+ * @return {QualityAssuranceSourceState}
*/
- export function notificationsBrokerSourceStateSelector(): MemoizedSelector {
- return subStateSelector(notificationsSelector, 'brokerSource');
+ export function qualityAssuranceSourceStateSelector(): MemoizedSelector {
+ return subStateSelector(notificationsSelector, 'brokerSource');
}
/**
- * Returns the Notifications Broker source list.
- * @function notificationsBrokerSourceObjectSelector
- * @return {NotificationsBrokerSourceObject[]}
+ * Returns the Quality Assurance source list.
+ * @function qualityAssuranceSourceObjectSelector
+ * @return {QualityAssuranceSourceObject[]}
*/
-export function notificationsBrokerSourceObjectSelector(): MemoizedSelector {
- return subStateSelector(notificationsBrokerSourceStateSelector(), 'source');
+export function qualityAssuranceSourceObjectSelector(): MemoizedSelector {
+ return subStateSelector(qualityAssuranceSourceStateSelector(), 'source');
}
/**
- * Returns true if the Notifications Broker source are loaded.
- * @function isNotificationsBrokerSourceLoadedSelector
+ * Returns true if the Quality Assurance source are loaded.
+ * @function isQualityAssuranceSourceLoadedSelector
* @return {boolean}
*/
-export const isNotificationsBrokerSourceLoadedSelector = createSelector(_getNotificationsState,
+export const isQualityAssuranceSourceLoadedSelector = createSelector(_getNotificationsState,
(state: NotificationsState) => state.brokerSource.loaded
);
@@ -115,33 +115,33 @@ export const isNotificationsBrokerSourceLoadedSelector = createSelector(_getNoti
* @function isDeduplicationSetsProcessingSelector
* @return {boolean}
*/
-export const isNotificationsBrokerSourceProcessingSelector = createSelector(_getNotificationsState,
+export const isQualityAssuranceSourceProcessingSelector = createSelector(_getNotificationsState,
(state: NotificationsState) => state.brokerSource.processing
);
/**
- * Returns the total available pages of Notifications Broker source.
- * @function getNotificationsBrokerSourceTotalPagesSelector
+ * Returns the total available pages of Quality Assurance source.
+ * @function getQualityAssuranceSourceTotalPagesSelector
* @return {number}
*/
-export const getNotificationsBrokerSourceTotalPagesSelector = createSelector(_getNotificationsState,
+export const getQualityAssuranceSourceTotalPagesSelector = createSelector(_getNotificationsState,
(state: NotificationsState) => state.brokerSource.totalPages
);
/**
- * Returns the current page of Notifications Broker source.
- * @function getNotificationsBrokerSourceCurrentPageSelector
+ * Returns the current page of Quality Assurance source.
+ * @function getQualityAssuranceSourceCurrentPageSelector
* @return {number}
*/
-export const getNotificationsBrokerSourceCurrentPageSelector = createSelector(_getNotificationsState,
+export const getQualityAssuranceSourceCurrentPageSelector = createSelector(_getNotificationsState,
(state: NotificationsState) => state.brokerSource.currentPage
);
/**
- * Returns the total number of Notifications Broker source.
- * @function getNotificationsBrokerSourceTotalsSelector
+ * Returns the total number of Quality Assurance source.
+ * @function getQualityAssuranceSourceTotalsSelector
* @return {number}
*/
-export const getNotificationsBrokerSourceTotalsSelector = createSelector(_getNotificationsState,
+export const getQualityAssuranceSourceTotalsSelector = createSelector(_getNotificationsState,
(state: NotificationsState) => state.brokerSource.totalElements
);
diff --git a/src/app/shared/mocks/notifications.mock.ts b/src/app/shared/mocks/notifications.mock.ts
index 8af034ea32..845c13a4ce 100644
--- a/src/app/shared/mocks/notifications.mock.ts
+++ b/src/app/shared/mocks/notifications.mock.ts
@@ -1,9 +1,9 @@
import { of as observableOf } from 'rxjs';
import { ResourceType } from '../../core/shared/resource-type';
-import { NotificationsBrokerTopicObject } from '../../core/notifications/broker/models/notifications-broker-topic.model';
-import { NotificationsBrokerEventObject } from '../../core/notifications/broker/models/notifications-broker-event.model';
-import { NotificationsBrokerTopicRestService } from '../../core/notifications/broker/topics/notifications-broker-topic-rest.service';
-import { NotificationsBrokerEventRestService } from '../../core/notifications/broker/events/notifications-broker-event-rest.service';
+import { QualityAssuranceTopicObject } from '../../core/notifications/qa/models/quality-assurance-topic.model';
+import { QualityAssuranceEventObject } from '../../core/notifications/qa/models/quality-assurance-event.model';
+import { QualityAssuranceTopicRestService } from '../../core/notifications/qa/topics/quality-assurance-topic-rest.service';
+import { QualityAssuranceEventRestService } from '../../core/notifications/qa/events/quality-assurance-event-rest.service';
import { DSpaceObject } from '../../core/shared/dspace-object.model';
import { NotificationsStateService } from '../../notifications/notifications-state.service';
import { Item } from '../../core/shared/item.model';
@@ -13,7 +13,7 @@ import {
createSuccessfulRemoteDataObject$
} from '../remote-data.utils';
import { SearchResult } from '../search/models/search-result.model';
-import { NotificationsBrokerSourceObject } from '../../core/notifications/broker/models/notifications-broker-source.model';
+import { QualityAssuranceSourceObject } from '../../core/notifications/qa/models/quality-assurance-source.model';
// REST Mock ---------------------------------------------------------------------
// -------------------------------------------------------------------------------
@@ -1333,7 +1333,7 @@ export const NotificationsMockDspaceObject: SearchResult = Object.
// Sources
// -------------------------------------------------------------------------------
-export const notificationsBrokerSourceObjectMorePid: NotificationsBrokerSourceObject = {
+export const qualityAssuranceSourceObjectMorePid: QualityAssuranceSourceObject = {
type: new ResourceType('nbsource'),
id: 'ENRICH!MORE!PID',
lastEvent: '2020/10/09 10:11 UTC',
@@ -1345,7 +1345,7 @@ export const notificationsBrokerSourceObjectMorePid: NotificationsBrokerSourceOb
}
};
-export const notificationsBrokerSourceObjectMoreAbstract: NotificationsBrokerSourceObject = {
+export const qualityAssuranceSourceObjectMoreAbstract: QualityAssuranceSourceObject = {
type: new ResourceType('nbsource'),
id: 'ENRICH!MORE!ABSTRACT',
lastEvent: '2020/09/08 21:14 UTC',
@@ -1357,7 +1357,7 @@ export const notificationsBrokerSourceObjectMoreAbstract: NotificationsBrokerSou
}
};
-export const notificationsBrokerSourceObjectMissingPid: NotificationsBrokerSourceObject = {
+export const qualityAssuranceSourceObjectMissingPid: QualityAssuranceSourceObject = {
type: new ResourceType('nbsource'),
id: 'ENRICH!MISSING!PID',
lastEvent: '2020/10/01 07:36 UTC',
@@ -1372,7 +1372,7 @@ export const notificationsBrokerSourceObjectMissingPid: NotificationsBrokerSourc
// Topics
// -------------------------------------------------------------------------------
-export const notificationsBrokerTopicObjectMorePid: NotificationsBrokerTopicObject = {
+export const qualityAssuranceTopicObjectMorePid: QualityAssuranceTopicObject = {
type: new ResourceType('nbtopic'),
id: 'ENRICH!MORE!PID',
name: 'ENRICH/MORE/PID',
@@ -1385,7 +1385,7 @@ export const notificationsBrokerTopicObjectMorePid: NotificationsBrokerTopicObje
}
};
-export const notificationsBrokerTopicObjectMoreAbstract: NotificationsBrokerTopicObject = {
+export const qualityAssuranceTopicObjectMoreAbstract: QualityAssuranceTopicObject = {
type: new ResourceType('nbtopic'),
id: 'ENRICH!MORE!ABSTRACT',
name: 'ENRICH/MORE/ABSTRACT',
@@ -1398,7 +1398,7 @@ export const notificationsBrokerTopicObjectMoreAbstract: NotificationsBrokerTopi
}
};
-export const notificationsBrokerTopicObjectMissingPid: NotificationsBrokerTopicObject = {
+export const qualityAssuranceTopicObjectMissingPid: QualityAssuranceTopicObject = {
type: new ResourceType('nbtopic'),
id: 'ENRICH!MISSING!PID',
name: 'ENRICH/MISSING/PID',
@@ -1411,7 +1411,7 @@ export const notificationsBrokerTopicObjectMissingPid: NotificationsBrokerTopicO
}
};
-export const notificationsBrokerTopicObjectMissingAbstract: NotificationsBrokerTopicObject = {
+export const qualityAssuranceTopicObjectMissingAbstract: QualityAssuranceTopicObject = {
type: new ResourceType('nbtopic'),
id: 'ENRICH!MISSING!ABSTRACT',
name: 'ENRICH/MISSING/ABSTRACT',
@@ -1424,7 +1424,7 @@ export const notificationsBrokerTopicObjectMissingAbstract: NotificationsBrokerT
}
};
-export const notificationsBrokerTopicObjectMissingAcm: NotificationsBrokerTopicObject = {
+export const qualityAssuranceTopicObjectMissingAcm: QualityAssuranceTopicObject = {
type: new ResourceType('nbtopic'),
id: 'ENRICH!MISSING!SUBJECT!ACM',
name: 'ENRICH/MISSING/SUBJECT/ACM',
@@ -1437,7 +1437,7 @@ export const notificationsBrokerTopicObjectMissingAcm: NotificationsBrokerTopicO
}
};
-export const notificationsBrokerTopicObjectMissingProject: NotificationsBrokerTopicObject = {
+export const qualityAssuranceTopicObjectMissingProject: QualityAssuranceTopicObject = {
type: new ResourceType('nbtopic'),
id: 'ENRICH!MISSING!PROJECT',
name: 'ENRICH/MISSING/PROJECT',
@@ -1453,7 +1453,7 @@ export const notificationsBrokerTopicObjectMissingProject: NotificationsBrokerTo
// Events
// -------------------------------------------------------------------------------
-export const notificationsBrokerEventObjectMissingPid: NotificationsBrokerEventObject = {
+export const qualityAssuranceEventObjectMissingPid: QualityAssuranceEventObject = {
id: '123e4567-e89b-12d3-a456-426614174001',
uuid: '123e4567-e89b-12d3-a456-426614174001',
type: new ResourceType('nbevent'),
@@ -1489,10 +1489,10 @@ export const notificationsBrokerEventObjectMissingPid: NotificationsBrokerEventO
related: observableOf(createSuccessfulRemoteDataObject(ItemMockPid10))
};
-export const notificationsBrokerEventObjectMissingPid2: NotificationsBrokerEventObject = {
+export const qualityAssuranceEventObjectMissingPid2: QualityAssuranceEventObject = {
id: '123e4567-e89b-12d3-a456-426614174004',
uuid: '123e4567-e89b-12d3-a456-426614174004',
- type: new ResourceType('notificationsBrokerEvent'),
+ type: new ResourceType('qualityAssuranceEvent'),
originalId: 'oai:www.openstarts.units.it:10077/21486',
title: 'UNA NUOVA RILETTURA DELL\u0027 ARISTOTELE DI FRANZ BRENTANO ALLA LUCE DI ALCUNI INEDITI',
trust: 1.0,
@@ -1525,10 +1525,10 @@ export const notificationsBrokerEventObjectMissingPid2: NotificationsBrokerEvent
related: observableOf(createSuccessfulRemoteDataObject(ItemMockPid10))
};
-export const notificationsBrokerEventObjectMissingPid3: NotificationsBrokerEventObject = {
+export const qualityAssuranceEventObjectMissingPid3: QualityAssuranceEventObject = {
id: '123e4567-e89b-12d3-a456-426614174005',
uuid: '123e4567-e89b-12d3-a456-426614174005',
- type: new ResourceType('notificationsBrokerEvent'),
+ type: new ResourceType('qualityAssuranceEvent'),
originalId: 'oai:www.openstarts.units.it:10077/554',
title: 'Sustainable development',
trust: 0.375,
@@ -1561,10 +1561,10 @@ export const notificationsBrokerEventObjectMissingPid3: NotificationsBrokerEvent
related: observableOf(createSuccessfulRemoteDataObject(ItemMockPid10))
};
-export const notificationsBrokerEventObjectMissingPid4: NotificationsBrokerEventObject = {
+export const qualityAssuranceEventObjectMissingPid4: QualityAssuranceEventObject = {
id: '123e4567-e89b-12d3-a456-426614174006',
uuid: '123e4567-e89b-12d3-a456-426614174006',
- type: new ResourceType('notificationsBrokerEvent'),
+ type: new ResourceType('qualityAssuranceEvent'),
originalId: 'oai:www.openstarts.units.it:10077/10787',
title: 'Reply to Critics',
trust: 1.0,
@@ -1597,10 +1597,10 @@ export const notificationsBrokerEventObjectMissingPid4: NotificationsBrokerEvent
related: observableOf(createSuccessfulRemoteDataObject(ItemMockPid10))
};
-export const notificationsBrokerEventObjectMissingPid5: NotificationsBrokerEventObject = {
+export const qualityAssuranceEventObjectMissingPid5: QualityAssuranceEventObject = {
id: '123e4567-e89b-12d3-a456-426614174007',
uuid: '123e4567-e89b-12d3-a456-426614174007',
- type: new ResourceType('notificationsBrokerEvent'),
+ type: new ResourceType('qualityAssuranceEvent'),
originalId: 'oai:www.openstarts.units.it:10077/11339',
title: 'PROGETTAZIONE, SINTESI E VALUTAZIONE DELL\u0027ATTIVITA\u0027 ANTIMICOBATTERICA ED ANTIFUNGINA DI NUOVI DERIVATI ETEROCICLICI',
trust: 0.375,
@@ -1633,10 +1633,10 @@ export const notificationsBrokerEventObjectMissingPid5: NotificationsBrokerEvent
related: observableOf(createSuccessfulRemoteDataObject(ItemMockPid10))
};
-export const notificationsBrokerEventObjectMissingPid6: NotificationsBrokerEventObject = {
+export const qualityAssuranceEventObjectMissingPid6: QualityAssuranceEventObject = {
id: '123e4567-e89b-12d3-a456-426614174008',
uuid: '123e4567-e89b-12d3-a456-426614174008',
- type: new ResourceType('notificationsBrokerEvent'),
+ type: new ResourceType('qualityAssuranceEvent'),
originalId: 'oai:www.openstarts.units.it:10077/29860',
title: 'Donald Davidson',
trust: 0.375,
@@ -1669,10 +1669,10 @@ export const notificationsBrokerEventObjectMissingPid6: NotificationsBrokerEvent
related: observableOf(createSuccessfulRemoteDataObject(ItemMockPid10))
};
-export const notificationsBrokerEventObjectMissingAbstract: NotificationsBrokerEventObject = {
+export const qualityAssuranceEventObjectMissingAbstract: QualityAssuranceEventObject = {
id: '123e4567-e89b-12d3-a456-426614174009',
uuid: '123e4567-e89b-12d3-a456-426614174009',
- type: new ResourceType('notificationsBrokerEvent'),
+ type: new ResourceType('qualityAssuranceEvent'),
originalId: 'oai:www.openstarts.units.it:10077/21110',
title: 'Missing abstract article',
trust: 0.751,
@@ -1705,10 +1705,10 @@ export const notificationsBrokerEventObjectMissingAbstract: NotificationsBrokerE
related: observableOf(createSuccessfulRemoteDataObject(ItemMockPid10))
};
-export const notificationsBrokerEventObjectMissingProjectFound: NotificationsBrokerEventObject = {
+export const qualityAssuranceEventObjectMissingProjectFound: QualityAssuranceEventObject = {
id: '123e4567-e89b-12d3-a456-426614174002',
uuid: '123e4567-e89b-12d3-a456-426614174002',
- type: new ResourceType('notificationsBrokerEvent'),
+ type: new ResourceType('qualityAssuranceEvent'),
originalId: 'oai:www.openstarts.units.it:10077/21838',
title: 'Egypt, crossroad of translations and literary interweavings (3rd-6th centuries). A reconsideration of earlier Coptic literature',
trust: 1.0,
@@ -1741,10 +1741,10 @@ export const notificationsBrokerEventObjectMissingProjectFound: NotificationsBro
related: createSuccessfulRemoteDataObject$(ItemMockPid10)
};
-export const notificationsBrokerEventObjectMissingProjectNotFound: NotificationsBrokerEventObject = {
+export const qualityAssuranceEventObjectMissingProjectNotFound: QualityAssuranceEventObject = {
id: '123e4567-e89b-12d3-a456-426614174003',
uuid: '123e4567-e89b-12d3-a456-426614174003',
- type: new ResourceType('notificationsBrokerEvent'),
+ type: new ResourceType('qualityAssuranceEvent'),
originalId: 'oai:www.openstarts.units.it:10077/21838',
title: 'Morocco, crossroad of translations and literary interweavings (3rd-6th centuries). A reconsideration of earlier Coptic literature',
trust: 1.0,
@@ -1785,51 +1785,51 @@ export const notificationsBrokerEventObjectMissingProjectNotFound: Notifications
*/
export function getMockNotificationsStateService(): any {
return jasmine.createSpyObj('NotificationsStateService', {
- getNotificationsBrokerTopics: jasmine.createSpy('getNotificationsBrokerTopics'),
- isNotificationsBrokerTopicsLoading: jasmine.createSpy('isNotificationsBrokerTopicsLoading'),
- isNotificationsBrokerTopicsLoaded: jasmine.createSpy('isNotificationsBrokerTopicsLoaded'),
- isNotificationsBrokerTopicsProcessing: jasmine.createSpy('isNotificationsBrokerTopicsProcessing'),
- getNotificationsBrokerTopicsTotalPages: jasmine.createSpy('getNotificationsBrokerTopicsTotalPages'),
- getNotificationsBrokerTopicsCurrentPage: jasmine.createSpy('getNotificationsBrokerTopicsCurrentPage'),
- getNotificationsBrokerTopicsTotals: jasmine.createSpy('getNotificationsBrokerTopicsTotals'),
- dispatchRetrieveNotificationsBrokerTopics: jasmine.createSpy('dispatchRetrieveNotificationsBrokerTopics'),
- getNotificationsBrokerSource: jasmine.createSpy('getNotificationsBrokerSource'),
- isNotificationsBrokerSourceLoading: jasmine.createSpy('isNotificationsBrokerSourceLoading'),
- isNotificationsBrokerSourceLoaded: jasmine.createSpy('isNotificationsBrokerSourceLoaded'),
- isNotificationsBrokerSourceProcessing: jasmine.createSpy('isNotificationsBrokerSourceProcessing'),
- getNotificationsBrokerSourceTotalPages: jasmine.createSpy('getNotificationsBrokerSourceTotalPages'),
- getNotificationsBrokerSourceCurrentPage: jasmine.createSpy('getNotificationsBrokerSourceCurrentPage'),
- getNotificationsBrokerSourceTotals: jasmine.createSpy('getNotificationsBrokerSourceTotals'),
- dispatchRetrieveNotificationsBrokerSource: jasmine.createSpy('dispatchRetrieveNotificationsBrokerSource'),
+ getQualityAssuranceTopics: jasmine.createSpy('getQualityAssuranceTopics'),
+ isQualityAssuranceTopicsLoading: jasmine.createSpy('isQualityAssuranceTopicsLoading'),
+ isQualityAssuranceTopicsLoaded: jasmine.createSpy('isQualityAssuranceTopicsLoaded'),
+ isQualityAssuranceTopicsProcessing: jasmine.createSpy('isQualityAssuranceTopicsProcessing'),
+ getQualityAssuranceTopicsTotalPages: jasmine.createSpy('getQualityAssuranceTopicsTotalPages'),
+ getQualityAssuranceTopicsCurrentPage: jasmine.createSpy('getQualityAssuranceTopicsCurrentPage'),
+ getQualityAssuranceTopicsTotals: jasmine.createSpy('getQualityAssuranceTopicsTotals'),
+ dispatchRetrieveQualityAssuranceTopics: jasmine.createSpy('dispatchRetrieveQualityAssuranceTopics'),
+ getQualityAssuranceSource: jasmine.createSpy('getQualityAssuranceSource'),
+ isQualityAssuranceSourceLoading: jasmine.createSpy('isQualityAssuranceSourceLoading'),
+ isQualityAssuranceSourceLoaded: jasmine.createSpy('isQualityAssuranceSourceLoaded'),
+ isQualityAssuranceSourceProcessing: jasmine.createSpy('isQualityAssuranceSourceProcessing'),
+ getQualityAssuranceSourceTotalPages: jasmine.createSpy('getQualityAssuranceSourceTotalPages'),
+ getQualityAssuranceSourceCurrentPage: jasmine.createSpy('getQualityAssuranceSourceCurrentPage'),
+ getQualityAssuranceSourceTotals: jasmine.createSpy('getQualityAssuranceSourceTotals'),
+ dispatchRetrieveQualityAssuranceSource: jasmine.createSpy('dispatchRetrieveQualityAssuranceSource'),
dispatchMarkUserSuggestionsAsVisitedAction: jasmine.createSpy('dispatchMarkUserSuggestionsAsVisitedAction')
});
}
/**
- * Mock for [[NotificationsBrokerSourceRestService]]
+ * Mock for [[QualityAssuranceSourceRestService]]
*/
- export function getMockNotificationsBrokerSourceRestService(): NotificationsBrokerTopicRestService {
- return jasmine.createSpyObj('NotificationsBrokerSourceRestService', {
+ export function getMockQualityAssuranceSourceRestService(): QualityAssuranceTopicRestService {
+ return jasmine.createSpyObj('QualityAssuranceSourceRestService', {
getSources: jasmine.createSpy('getSources'),
getSource: jasmine.createSpy('getSource'),
});
}
/**
- * Mock for [[NotificationsBrokerTopicRestService]]
+ * Mock for [[QualityAssuranceTopicRestService]]
*/
-export function getMockNotificationsBrokerTopicRestService(): NotificationsBrokerTopicRestService {
- return jasmine.createSpyObj('NotificationsBrokerTopicRestService', {
+export function getMockQualityAssuranceTopicRestService(): QualityAssuranceTopicRestService {
+ return jasmine.createSpyObj('QualityAssuranceTopicRestService', {
getTopics: jasmine.createSpy('getTopics'),
getTopic: jasmine.createSpy('getTopic'),
});
}
/**
- * Mock for [[NotificationsBrokerEventRestService]]
+ * Mock for [[QualityAssuranceEventRestService]]
*/
-export function getMockNotificationsBrokerEventRestService(): NotificationsBrokerEventRestService {
- return jasmine.createSpyObj('NotificationsBrokerEventRestService', {
+export function getMockQualityAssuranceEventRestService(): QualityAssuranceEventRestService {
+ return jasmine.createSpyObj('QualityAssuranceEventRestService', {
getEventsByTopic: jasmine.createSpy('getEventsByTopic'),
getEvent: jasmine.createSpy('getEvent'),
patchEvent: jasmine.createSpy('patchEvent'),
@@ -1840,7 +1840,7 @@ export function getMockNotificationsBrokerEventRestService(): NotificationsBroke
}
/**
- * Mock for [[NotificationsBrokerEventRestService]]
+ * Mock for [[QualityAssuranceEventRestService]]
*/
export function getMockSuggestionsService(): any {
return jasmine.createSpyObj('SuggestionsService', {
diff --git a/src/assets/i18n/en.json5 b/src/assets/i18n/en.json5
index d092e4f2c8..0f5db4eb5b 100644
--- a/src/assets/i18n/en.json5
+++ b/src/assets/i18n/en.json5
@@ -499,13 +499,13 @@
"admin.access-control.groups.form.return": "Back",
- "admin.notifications.broker.breadcrumbs": "Notifications Broker",
+ "admin.notifications.broker.breadcrumbs": "Quality Assurance",
"admin.notifications.event.breadcrumbs": "Broker Suggestions",
"admin.notifications.event.page.title": "Broker Suggestions",
- "admin.notifications.broker.page.title": "Notifications Broker",
+ "admin.notifications.broker.page.title": "Quality Assurance",
"admin.notifications.source.breadcrumbs": "Notifications Source",
@@ -2687,7 +2687,7 @@
"menu.section.notifications": "Notifications",
- "menu.section.notifications_broker": "Notifications Broker",
+ "menu.section.notifications_broker": "Quality Assurance",
"menu.section.notifications_reciter": "Publication Claim",
@@ -2889,9 +2889,9 @@
"notifications.events.title": "Broker Suggestions",
- "notifications.broker.topic.error.service.retrieve": "An error occurred while loading the Notifications Broker topics",
+ "notifications.broker.topic.error.service.retrieve": "An error occurred while loading the Quality Assurance topics",
- "notifications.broker.source.error.service.retrieve": "An error occurred while loading the Notifications Broker source",
+ "notifications.broker.source.error.service.retrieve": "An error occurred while loading the Quality Assurance source",
"notifications.broker.events.description": "Below the list of all the suggestions for the selected topic.",