@@ -51,8 +51,8 @@
{{eventElement.title}}
- {{'openaire.broker.event.table.pidtype' | translate}} {{eventElement.event.message.type}}
- {{'openaire.broker.event.table.pidvalue' | translate}}
+ {{'notifications.broker.event.table.pidtype' | translate}} {{eventElement.event.message.type}}
+ {{'notifications.broker.event.table.pidvalue' | translate}}
{{eventElement.event.message.value}}
@@ -60,37 +60,37 @@
|
- {{'openaire.broker.event.table.subjectValue' | translate}} {{eventElement.event.message.value}}
+ {{'notifications.broker.event.table.subjectValue' | translate}} {{eventElement.event.message.value}}
|
- {{'openaire.broker.event.table.abstract' | translate}}
+ {{'notifications.broker.event.table.abstract' | translate}}
{{eventElement.event.message.abstract}}
|
- {{'openaire.broker.event.table.suggestedProject' | translate}}
+ {{'notifications.broker.event.table.suggestedProject' | translate}}
- {{'openaire.broker.event.table.project' | translate}}
+ {{'notifications.broker.event.table.project' | translate}}
{{eventElement.event.message.title}}
- {{'openaire.broker.event.table.acronym' | translate}} {{eventElement.event.message.acronym}}
- {{'openaire.broker.event.table.code' | translate}} {{eventElement.event.message.code}}
- {{'openaire.broker.event.table.funder' | translate}} {{eventElement.event.message.funder}}
- {{'openaire.broker.event.table.fundingProgram' | translate}} {{eventElement.event.message.fundingProgram}}
- {{'openaire.broker.event.table.jurisdiction' | translate}} {{eventElement.event.message.jurisdiction}}
+ {{'notifications.broker.event.table.acronym' | translate}} {{eventElement.event.message.acronym}}
+ {{'notifications.broker.event.table.code' | translate}} {{eventElement.event.message.code}}
+ {{'notifications.broker.event.table.funder' | translate}} {{eventElement.event.message.funder}}
+ {{'notifications.broker.event.table.fundingProgram' | translate}} {{eventElement.event.message.fundingProgram}}
+ {{'notifications.broker.event.table.jurisdiction' | translate}} {{eventElement.event.message.jurisdiction}}
- {{(eventElement.hasProject ? 'openaire.broker.event.project.found' : 'openaire.broker.event.project.notFound') | translate}}
+ {{(eventElement.hasProject ? 'notifications.broker.event.project.found' : 'notifications.broker.event.project.notFound') | translate}}
{{eventElement.handle}}
|
@@ -140,9 +140,9 @@
@@ -150,58 +150,58 @@
-
{{'openaire.broker.event.accept.description' | translate}}
+
{{'notifications.broker.event.accept.description' | translate}}
-
{{'openaire.broker.event.ignore.description' | translate}}
+
{{'notifications.broker.event.ignore.description' | translate}}
-
+
-
{{'openaire.broker.event.reject.description' | translate}}
+
{{'notifications.broker.event.reject.description' | translate}}
-
+
diff --git a/src/app/openaire/broker/events/openaire-broker-events.component.spec.ts b/src/app/notifications/broker/events/notifications-broker-events.component.spec.ts
similarity index 66%
rename from src/app/openaire/broker/events/openaire-broker-events.component.spec.ts
rename to src/app/notifications/broker/events/notifications-broker-events.component.spec.ts
index 267f6a8242..40be083567 100644
--- a/src/app/openaire/broker/events/openaire-broker-events.component.spec.ts
+++ b/src/app/notifications/broker/events/notifications-broker-events.component.spec.ts
@@ -5,25 +5,25 @@ 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 { OpenaireBrokerEventRestService } from '../../../core/openaire/broker/events/openaire-broker-event-rest.service';
-import { OpenaireBrokerEventsComponent } from './openaire-broker-events.component';
+import { NotificationsBrokerEventRestService } from '../../../core/notifications/broker/events/notifications-broker-event-rest.service';
+import { NotificationsBrokerEventsComponent } from './notifications-broker-events.component';
import {
- getMockOpenaireBrokerEventRestService,
+ getMockNotificationsBrokerEventRestService,
ItemMockPid10,
ItemMockPid8,
ItemMockPid9,
- openaireBrokerEventObjectMissingProjectFound,
- openaireBrokerEventObjectMissingProjectNotFound,
- OpenaireMockDspaceObject
-} from '../../../shared/mocks/openaire.mock';
+ notificationsBrokerEventObjectMissingProjectFound,
+ notificationsBrokerEventObjectMissingProjectNotFound,
+ NotificationsMockDspaceObject
+} from '../../../shared/mocks/notifications.mock';
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub';
import { NotificationsService } from '../../../shared/notifications/notifications.service';
import { getMockTranslateService } from '../../../shared/mocks/translate.service.mock';
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 { OpenaireBrokerEventObject } from '../../../core/openaire/broker/models/openaire-broker-event.model';
-import { OpenaireBrokerEventData } from '../project-entry-import-modal/project-entry-import-modal.component';
+import { NotificationsBrokerEventObject } from '../../../core/notifications/broker/models/notifications-broker-event.model';
+import { NotificationsBrokerEventData } 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';
@@ -39,9 +39,9 @@ import { SortDirection, SortOptions } from '../../../core/cache/models/sort-opti
import { PaginationService } from '../../../core/pagination/pagination.service';
import { PaginationServiceStub } from '../../../shared/testing/pagination-service.stub';
-describe('OpenaireBrokerEventsComponent test suite', () => {
- let fixture: ComponentFixture;
- let comp: OpenaireBrokerEventsComponent;
+describe('NotificationsBrokerEventsComponent test suite', () => {
+ let fixture: ComponentFixture;
+ let comp: NotificationsBrokerEventsComponent;
let compAsAny: any;
let scheduler: TestScheduler;
@@ -50,9 +50,9 @@ describe('OpenaireBrokerEventsComponent test suite', () => {
close: () => null,
dismiss: () => null
};
- const openaireBrokerEventRestServiceStub: any = getMockOpenaireBrokerEventRestService();
+ const notificationsBrokerEventRestServiceStub: any = getMockNotificationsBrokerEventRestService();
const activatedRouteParams = {
- openaireBrokerEventsParams: {
+ notificationsBrokerEventsParams: {
currentPage: 0,
pageSize: 10
}
@@ -61,19 +61,19 @@ describe('OpenaireBrokerEventsComponent test suite', () => {
id: 'ENRICH!MISSING!PROJECT'
};
- const events: OpenaireBrokerEventObject[] = [
- openaireBrokerEventObjectMissingProjectFound,
- openaireBrokerEventObjectMissingProjectNotFound
+ const events: NotificationsBrokerEventObject[] = [
+ notificationsBrokerEventObjectMissingProjectFound,
+ notificationsBrokerEventObjectMissingProjectNotFound
];
const paginationService = new PaginationServiceStub();
- function getOpenAireBrokerEventData1(): OpenaireBrokerEventData {
+ function getNotificationsBrokerEventData1(): NotificationsBrokerEventData {
return {
- event: openaireBrokerEventObjectMissingProjectFound,
- id: openaireBrokerEventObjectMissingProjectFound.id,
- title: openaireBrokerEventObjectMissingProjectFound.title,
+ event: notificationsBrokerEventObjectMissingProjectFound,
+ id: notificationsBrokerEventObjectMissingProjectFound.id,
+ title: notificationsBrokerEventObjectMissingProjectFound.title,
hasProject: true,
- projectTitle: openaireBrokerEventObjectMissingProjectFound.message.title,
+ projectTitle: notificationsBrokerEventObjectMissingProjectFound.message.title,
projectId: ItemMockPid10.id,
handle: ItemMockPid10.handle,
reason: null,
@@ -82,11 +82,11 @@ describe('OpenaireBrokerEventsComponent test suite', () => {
};
}
- function getOpenAireBrokerEventData2(): OpenaireBrokerEventData {
+ function getNotificationsBrokerEventData2(): NotificationsBrokerEventData {
return {
- event: openaireBrokerEventObjectMissingProjectNotFound,
- id: openaireBrokerEventObjectMissingProjectNotFound.id,
- title: openaireBrokerEventObjectMissingProjectNotFound.title,
+ event: notificationsBrokerEventObjectMissingProjectNotFound,
+ id: notificationsBrokerEventObjectMissingProjectNotFound.id,
+ title: notificationsBrokerEventObjectMissingProjectNotFound.title,
hasProject: false,
projectTitle: null,
projectId: null,
@@ -104,17 +104,17 @@ describe('OpenaireBrokerEventsComponent test suite', () => {
TranslateModule.forRoot(),
],
declarations: [
- OpenaireBrokerEventsComponent,
+ NotificationsBrokerEventsComponent,
TestComponent,
],
providers: [
{ provide: ActivatedRoute, useValue: new ActivatedRouteStub(activatedRouteParamsMap, activatedRouteParams) },
- { provide: OpenaireBrokerEventRestService, useValue: openaireBrokerEventRestServiceStub },
+ { provide: NotificationsBrokerEventRestService, useValue: notificationsBrokerEventRestServiceStub },
{ provide: NgbModal, useValue: modalStub },
{ provide: NotificationsService, useValue: new NotificationsServiceStub() },
{ provide: TranslateService, useValue: getMockTranslateService() },
{ provide: PaginationService, useValue: paginationService },
- OpenaireBrokerEventsComponent
+ NotificationsBrokerEventsComponent
],
schemas: [NO_ERRORS_SCHEMA]
}).compileComponents().then();
@@ -129,7 +129,7 @@ describe('OpenaireBrokerEventsComponent test suite', () => {
// synchronous beforeEach
beforeEach(() => {
const html = `
- `;
+ `;
testFixture = createTestComponent(html, TestComponent) as ComponentFixture;
testComp = testFixture.componentInstance;
});
@@ -138,14 +138,14 @@ describe('OpenaireBrokerEventsComponent test suite', () => {
testFixture.destroy();
});
- it('should create OpenaireBrokerEventsComponent', inject([OpenaireBrokerEventsComponent], (app: OpenaireBrokerEventsComponent) => {
+ it('should create NotificationsBrokerEventsComponent', inject([NotificationsBrokerEventsComponent], (app: NotificationsBrokerEventsComponent) => {
expect(app).toBeDefined();
}));
});
describe('Main tests', () => {
beforeEach(() => {
- fixture = TestBed.createComponent(OpenaireBrokerEventsComponent);
+ fixture = TestBed.createComponent(NotificationsBrokerEventsComponent);
comp = fixture.componentInstance;
compAsAny = comp;
});
@@ -159,8 +159,8 @@ describe('OpenaireBrokerEventsComponent test suite', () => {
describe('setEventUpdated', () => {
it('should update events', () => {
const expected = [
- getOpenAireBrokerEventData1(),
- getOpenAireBrokerEventData2()
+ getNotificationsBrokerEventData1(),
+ getNotificationsBrokerEventData2()
];
scheduler.schedule(() => {
compAsAny.setEventUpdated(events);
@@ -179,14 +179,14 @@ describe('OpenaireBrokerEventsComponent test suite', () => {
it('should call executeAction if a project is present', () => {
const action = 'ACCEPTED';
- comp.modalChoice(action, getOpenAireBrokerEventData1(), modalStub);
- expect(comp.executeAction).toHaveBeenCalledWith(action, getOpenAireBrokerEventData1());
+ comp.modalChoice(action, getNotificationsBrokerEventData1(), modalStub);
+ expect(comp.executeAction).toHaveBeenCalledWith(action, getNotificationsBrokerEventData1());
});
it('should call openModal if a project is not present', () => {
const action = 'ACCEPTED';
- comp.modalChoice(action, getOpenAireBrokerEventData2(), modalStub);
- expect(comp.openModal).toHaveBeenCalledWith(action, getOpenAireBrokerEventData2(), modalStub);
+ comp.modalChoice(action, getNotificationsBrokerEventData2(), modalStub);
+ expect(comp.openModal).toHaveBeenCalledWith(action, getNotificationsBrokerEventData2(), modalStub);
});
});
@@ -197,7 +197,7 @@ describe('OpenaireBrokerEventsComponent test suite', () => {
spyOn(compAsAny.modalService, 'open').and.returnValue({ result: new Promise((res, rej) => 'do' ) });
spyOn(comp, 'executeAction');
- comp.openModal(action, getOpenAireBrokerEventData1(), modalStub);
+ comp.openModal(action, getNotificationsBrokerEventData1(), modalStub);
expect(compAsAny.modalService.open).toHaveBeenCalled();
});
});
@@ -211,13 +211,13 @@ describe('OpenaireBrokerEventsComponent test suite', () => {
externalSourceEntry: null,
label: null,
importedObject: observableOf({
- indexableObject: OpenaireMockDspaceObject
+ indexableObject: NotificationsMockDspaceObject
})
}
}
);
scheduler.schedule(() => {
- comp.openModalLookup(getOpenAireBrokerEventData1());
+ comp.openModalLookup(getNotificationsBrokerEventData1());
});
scheduler.flush();
@@ -227,27 +227,27 @@ describe('OpenaireBrokerEventsComponent test suite', () => {
});
describe('executeAction', () => {
- it('should call getOpenaireBrokerEvents on 200 response from REST', () => {
+ it('should call getNotificationsBrokerEvents on 200 response from REST', () => {
const action = 'ACCEPTED';
- spyOn(compAsAny, 'getOpenaireBrokerEvents');
- openaireBrokerEventRestServiceStub.patchEvent.and.returnValue(createSuccessfulRemoteDataObject$({}));
+ spyOn(compAsAny, 'getNotificationsBrokerEvents');
+ notificationsBrokerEventRestServiceStub.patchEvent.and.returnValue(createSuccessfulRemoteDataObject$({}));
scheduler.schedule(() => {
- comp.executeAction(action, getOpenAireBrokerEventData1());
+ comp.executeAction(action, getNotificationsBrokerEventData1());
});
scheduler.flush();
- expect(compAsAny.getOpenaireBrokerEvents).toHaveBeenCalled();
+ expect(compAsAny.getNotificationsBrokerEvents).toHaveBeenCalled();
});
});
describe('boundProject', () => {
it('should populate the project data inside "eventData"', () => {
- const eventData = getOpenAireBrokerEventData2();
+ const eventData = getNotificationsBrokerEventData2();
const projectId = 'UUID-23943-34u43-38344';
const projectName = 'Test Project';
const projectHandle = '1000/1000';
- openaireBrokerEventRestServiceStub.boundProject.and.returnValue(createSuccessfulRemoteDataObject$({}));
+ notificationsBrokerEventRestServiceStub.boundProject.and.returnValue(createSuccessfulRemoteDataObject$({}));
scheduler.schedule(() => {
comp.boundProject(eventData, projectId, projectName, projectHandle);
@@ -263,8 +263,8 @@ describe('OpenaireBrokerEventsComponent test suite', () => {
describe('removeProject', () => {
it('should remove the project data inside "eventData"', () => {
- const eventData = getOpenAireBrokerEventData1();
- openaireBrokerEventRestServiceStub.removeProject.and.returnValue(createNoContentRemoteDataObject$());
+ const eventData = getNotificationsBrokerEventData1();
+ notificationsBrokerEventRestServiceStub.removeProject.and.returnValue(createNoContentRemoteDataObject$());
scheduler.schedule(() => {
comp.removeProject(eventData);
@@ -278,8 +278,8 @@ describe('OpenaireBrokerEventsComponent test suite', () => {
});
});
- describe('getOpenaireBrokerEvents', () => {
- it('should call the "openaireBrokerEventRestService.getEventsByTopic" to take data and "setEventUpdated" to populate eventData', () => {
+ describe('getNotificationsBrokerEvents', () => {
+ it('should call the "notificationsBrokerEventRestService.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('OpenaireBrokerEventsComponent test suite', () => {
currentPage: comp.paginationConfig.currentPage
});
const array = [
- openaireBrokerEventObjectMissingProjectFound,
- openaireBrokerEventObjectMissingProjectNotFound,
+ notificationsBrokerEventObjectMissingProjectFound,
+ notificationsBrokerEventObjectMissingProjectNotFound,
];
const paginatedList = buildPaginatedList(pageInfo, array);
const paginatedListRD = createSuccessfulRemoteDataObject(paginatedList);
- openaireBrokerEventRestServiceStub.getEventsByTopic.and.returnValue(observableOf(paginatedListRD));
+ notificationsBrokerEventRestServiceStub.getEventsByTopic.and.returnValue(observableOf(paginatedListRD));
spyOn(compAsAny, 'setEventUpdated');
scheduler.schedule(() => {
- compAsAny.getOpenaireBrokerEvents();
+ compAsAny.getNotificationsBrokerEvents();
});
scheduler.flush();
- expect(compAsAny.openaireBrokerEventRestService.getEventsByTopic).toHaveBeenCalledWith(
+ expect(compAsAny.notificationsBrokerEventRestService.getEventsByTopic).toHaveBeenCalledWith(
activatedRouteParamsMap.id,
options,
followLink('target'),followLink('related')
diff --git a/src/app/openaire/broker/events/openaire-broker-events.component.ts b/src/app/notifications/broker/events/notifications-broker-events.component.ts
similarity index 71%
rename from src/app/openaire/broker/events/openaire-broker-events.component.ts
rename to src/app/notifications/broker/events/notifications-broker-events.component.ts
index 14ad175e80..b416664fca 100644
--- a/src/app/openaire/broker/events/openaire-broker-events.component.ts
+++ b/src/app/notifications/broker/events/notifications-broker-events.component.ts
@@ -11,10 +11,10 @@ import { PaginatedList } from '../../../core/data/paginated-list.model';
import { RemoteData } from '../../../core/data/remote-data';
import { FindListOptions } from '../../../core/data/request.models';
import {
- OpenaireBrokerEventMessageObject,
- OpenaireBrokerEventObject
-} from '../../../core/openaire/broker/models/openaire-broker-event.model';
-import { OpenaireBrokerEventRestService } from '../../../core/openaire/broker/events/openaire-broker-event-rest.service';
+ NotificationsBrokerEventObject,
+ OpenaireBrokerEventMessageObject
+} from '../../../core/notifications/broker/models/notifications-broker-event.model';
+import { NotificationsBrokerEventRestService } from '../../../core/notifications/broker/events/notifications-broker-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,7 +22,7 @@ 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 {
- OpenaireBrokerEventData,
+ NotificationsBrokerEventData,
ProjectEntryImportModalComponent
} from '../project-entry-import-modal/project-entry-import-modal.component';
import { getFirstCompletedRemoteData } from '../../../core/shared/operators';
@@ -31,14 +31,14 @@ import { combineLatest } from 'rxjs/internal/observable/combineLatest';
import { Item } from '../../../core/shared/item.model';
/**
- * Component to display the OpenAIRE Broker event list.
+ * Component to display the Notifications Broker event list.
*/
@Component({
- selector: 'ds-openaire-broker-events',
- templateUrl: './openaire-broker-events.component.html',
- styleUrls: ['./openaire-broker-events.scomponent.scss'],
+ selector: 'ds-notifications-broker-events',
+ templateUrl: './notifications-broker-events.component.html',
+ styleUrls: ['./notifications-broker-events.scomponent.scss'],
})
-export class OpenaireBrokerEventsComponent implements OnInit {
+export class NotificationsBrokerEventsComponent implements OnInit {
/**
* The pagination system configuration for HTML listing.
* @type {PaginationComponentOptions}
@@ -50,27 +50,27 @@ export class OpenaireBrokerEventsComponent implements OnInit {
pageSizeOptions: [5, 10, 20, 40, 60]
});
/**
- * The OpenAIRE Broker event list sort options.
+ * The Notifications Broker event list sort options.
* @type {SortOptions}
*/
public paginationSortConfig: SortOptions = new SortOptions('trust', SortDirection.DESC);
/**
- * Array to save the presence of a project inside an OpenAIRE Broker event.
- * @type {OpenaireBrokerEventData[]>}
+ * Array to save the presence of a project inside an Notifications Broker event.
+ * @type {NotificationsBrokerEventData[]>}
*/
- public eventsUpdated$: BehaviorSubject = new BehaviorSubject([]);
+ public eventsUpdated$: BehaviorSubject = new BehaviorSubject([]);
/**
- * The total number of OpenAIRE Broker events.
+ * The total number of Notifications Broker events.
* @type {Observable}
*/
public totalElements$: Observable;
/**
- * The topic of the OpenAIRE Broker events; suitable for displaying.
+ * The topic of the Notifications Broker events; suitable for displaying.
* @type {string}
*/
public showTopic: string;
/**
- * The topic of the OpenAIRE Broker events; suitable for HTTP calls.
+ * The topic of the Notifications Broker events; suitable for HTTP calls.
* @type {string}
*/
public topic: string;
@@ -114,7 +114,7 @@ export class OpenaireBrokerEventsComponent implements OnInit {
* @param {ActivatedRoute} activatedRoute
* @param {NgbModal} modalService
* @param {NotificationsService} notificationsService
- * @param {OpenaireBrokerEventRestService} openaireBrokerEventRestService
+ * @param {NotificationsBrokerEventRestService} notificationsBrokerEventRestService
* @param {PaginationService} paginationService
* @param {TranslateService} translateService
*/
@@ -122,7 +122,7 @@ export class OpenaireBrokerEventsComponent implements OnInit {
private activatedRoute: ActivatedRoute,
private modalService: NgbModal,
private notificationsService: NotificationsService,
- private openaireBrokerEventRestService: OpenaireBrokerEventRestService,
+ private notificationsBrokerEventRestService: NotificationsBrokerEventRestService,
private paginationService: PaginationService,
private translateService: TranslateService
) {
@@ -142,7 +142,7 @@ export class OpenaireBrokerEventsComponent implements OnInit {
this.showTopic = id.replace(regEx, '/');
this.topic = id;
this.isEventPageLoading.next(false);
- this.getOpenaireBrokerEvents();
+ this.getNotificationsBrokerEvents();
});
}
@@ -162,12 +162,12 @@ export class OpenaireBrokerEventsComponent implements OnInit {
*
* @param {string} action
* the action (can be: ACCEPTED, REJECTED, DISCARDED, PENDING)
- * @param {OpenaireBrokerEventData} eventData
- * the OpenAIRE Broker event data
+ * @param {NotificationsBrokerEventData} eventData
+ * the Notifications Broker event data
* @param {any} content
* Reference to the modal
*/
- public modalChoice(action: string, eventData: OpenaireBrokerEventData, content: any): void {
+ public modalChoice(action: string, eventData: NotificationsBrokerEventData, content: any): void {
if (eventData.hasProject) {
this.executeAction(action, eventData);
} else {
@@ -180,12 +180,12 @@ export class OpenaireBrokerEventsComponent implements OnInit {
*
* @param {string} action
* the action (can be: ACCEPTED, REJECTED, DISCARDED, PENDING)
- * @param {OpenaireBrokerEventData} eventData
- * the OpenAIRE Broker event data
+ * @param {NotificationsBrokerEventData} eventData
+ * the Notifications Broker event data
* @param {any} content
* Reference to the modal
*/
- public openModal(action: string, eventData: OpenaireBrokerEventData, content: any): void {
+ public openModal(action: string, eventData: NotificationsBrokerEventData, content: any): void {
this.modalService.open(content, { ariaLabelledBy: 'modal-basic-title' }).result.then(
(result) => {
if (result === 'do') {
@@ -203,10 +203,10 @@ export class OpenaireBrokerEventsComponent implements OnInit {
/**
* Open a modal where the user can select the project.
*
- * @param {OpenaireBrokerEventData} eventData
- * the OpenAIRE Broker event item data
+ * @param {NotificationsBrokerEventData} eventData
+ * the Notifications Broker event item data
*/
- public openModalLookup(eventData: OpenaireBrokerEventData): void {
+ public openModalLookup(eventData: NotificationsBrokerEventData): void {
this.modalRef = this.modalService.open(ProjectEntryImportModalComponent, {
size: 'lg'
});
@@ -232,22 +232,22 @@ export class OpenaireBrokerEventsComponent implements OnInit {
*
* @param {string} action
* the action (can be: ACCEPTED, REJECTED, DISCARDED, PENDING)
- * @param {OpenaireBrokerEventData} eventData
- * the OpenAIRE Broker event data
+ * @param {NotificationsBrokerEventData} eventData
+ * the Notifications Broker event data
*/
- public executeAction(action: string, eventData: OpenaireBrokerEventData): void {
+ public executeAction(action: string, eventData: NotificationsBrokerEventData): void {
eventData.isRunning = true;
this.subs.push(
- this.openaireBrokerEventRestService.patchEvent(action, eventData.event, eventData.reason).pipe(getFirstCompletedRemoteData())
- .subscribe((rd: RemoteData) => {
+ this.notificationsBrokerEventRestService.patchEvent(action, eventData.event, eventData.reason).pipe(getFirstCompletedRemoteData())
+ .subscribe((rd: RemoteData) => {
if (rd.isSuccess && rd.statusCode === 200) {
this.notificationsService.success(
- this.translateService.instant('openaire.broker.event.action.saved')
+ this.translateService.instant('notifications.broker.event.action.saved')
);
- this.getOpenaireBrokerEvents();
+ this.getNotificationsBrokerEvents();
} else {
this.notificationsService.error(
- this.translateService.instant('openaire.broker.event.action.error')
+ this.translateService.instant('notifications.broker.event.action.error')
);
}
eventData.isRunning = false;
@@ -256,10 +256,10 @@ export class OpenaireBrokerEventsComponent implements OnInit {
}
/**
- * Bound a project to the publication described in the OpenAIRE Broker event calling the REST service.
+ * Bound a project to the publication described in the Notifications Broker event calling the REST service.
*
- * @param {OpenaireBrokerEventData} eventData
- * the OpenAIRE Broker event item data
+ * @param {NotificationsBrokerEventData} eventData
+ * the Notifications Broker event item data
* @param {string} projectId
* the project Id to bound
* @param {string} projectTitle
@@ -267,14 +267,14 @@ export class OpenaireBrokerEventsComponent implements OnInit {
* @param {string} projectHandle
* the project handle
*/
- public boundProject(eventData: OpenaireBrokerEventData, projectId: string, projectTitle: string, projectHandle: string): void {
+ public boundProject(eventData: NotificationsBrokerEventData, projectId: string, projectTitle: string, projectHandle: string): void {
eventData.isRunning = true;
this.subs.push(
- this.openaireBrokerEventRestService.boundProject(eventData.id, projectId).pipe(getFirstCompletedRemoteData())
- .subscribe((rd: RemoteData) => {
+ this.notificationsBrokerEventRestService.boundProject(eventData.id, projectId).pipe(getFirstCompletedRemoteData())
+ .subscribe((rd: RemoteData) => {
if (rd.isSuccess) {
this.notificationsService.success(
- this.translateService.instant('openaire.broker.event.project.bounded')
+ this.translateService.instant('notifications.broker.event.project.bounded')
);
eventData.hasProject = true;
eventData.projectTitle = projectTitle;
@@ -282,7 +282,7 @@ export class OpenaireBrokerEventsComponent implements OnInit {
eventData.projectId = projectId;
} else {
this.notificationsService.error(
- this.translateService.instant('openaire.broker.event.project.error')
+ this.translateService.instant('notifications.broker.event.project.error')
);
}
eventData.isRunning = false;
@@ -291,19 +291,19 @@ export class OpenaireBrokerEventsComponent implements OnInit {
}
/**
- * Remove the bounded project from the publication described in the OpenAIRE Broker event calling the REST service.
+ * Remove the bounded project from the publication described in the Notifications Broker event calling the REST service.
*
- * @param {OpenaireBrokerEventData} eventData
- * the OpenAIRE Broker event data
+ * @param {NotificationsBrokerEventData} eventData
+ * the Notifications Broker event data
*/
- public removeProject(eventData: OpenaireBrokerEventData): void {
+ public removeProject(eventData: NotificationsBrokerEventData): void {
eventData.isRunning = true;
this.subs.push(
- this.openaireBrokerEventRestService.removeProject(eventData.id).pipe(getFirstCompletedRemoteData())
- .subscribe((rd: RemoteData) => {
+ this.notificationsBrokerEventRestService.removeProject(eventData.id).pipe(getFirstCompletedRemoteData())
+ .subscribe((rd: RemoteData) => {
if (rd.isSuccess) {
this.notificationsService.success(
- this.translateService.instant('openaire.broker.event.project.removed')
+ this.translateService.instant('notifications.broker.event.project.removed')
);
eventData.hasProject = false;
eventData.projectTitle = null;
@@ -311,7 +311,7 @@ export class OpenaireBrokerEventsComponent implements OnInit {
eventData.projectId = null;
} else {
this.notificationsService.error(
- this.translateService.instant('openaire.broker.event.project.error')
+ this.translateService.instant('notifications.broker.event.project.error')
);
}
eventData.isRunning = false;
@@ -337,26 +337,26 @@ export class OpenaireBrokerEventsComponent implements OnInit {
/**
- * Dispatch the OpenAIRE Broker events retrival.
+ * Dispatch the Notifications Broker events retrival.
*/
- public getOpenaireBrokerEvents(): void {
+ public getNotificationsBrokerEvents(): void {
this.paginationService.getFindListOptions(this.paginationConfig.id, this.defaultConfig).pipe(
distinctUntilChanged(),
- switchMap((options: FindListOptions) => this.openaireBrokerEventRestService.getEventsByTopic(
+ switchMap((options: FindListOptions) => this.notificationsBrokerEventRestService.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 OpenAIRE Broker events from the Broker events REST service');
+ throw new Error('Can\'t retrieve Notifications Broker events from the Broker events REST service');
}
- this.openaireBrokerEventRestService.clearFindByTopicRequests();
+ this.notificationsBrokerEventRestService.clearFindByTopicRequests();
});
}
@@ -370,15 +370,15 @@ export class OpenaireBrokerEventsComponent implements OnInit {
}
/**
- * Set the project status for the OpenAIRE Broker events.
+ * Set the project status for the Notifications Broker events.
*
- * @param {OpenaireBrokerEventObject[]} events
- * the OpenAIRE Broker event item
+ * @param {NotificationsBrokerEventObject[]} events
+ * the Notifications Broker event item
*/
- protected setEventUpdated(events: OpenaireBrokerEventObject[]): void {
+ protected setEventUpdated(events: NotificationsBrokerEventObject[]): void {
this.subs.push(
from(events).pipe(
- mergeMap((event: OpenaireBrokerEventObject) => {
+ mergeMap((event: NotificationsBrokerEventObject) => {
const related$ = event.related.pipe(
getFirstCompletedRemoteData(),
);
@@ -387,7 +387,7 @@ export class OpenaireBrokerEventsComponent implements OnInit {
);
return combineLatest([related$, target$]).pipe(
map(([relatedItemRD, targetItemRD]: [RemoteData- , RemoteData
- ]) => {
- const data: OpenaireBrokerEventData = {
+ const data: NotificationsBrokerEventData = {
event: event,
id: event.id,
title: event.title,
diff --git a/src/app/openaire/broker/events/openaire-broker-events.scomponent.scss b/src/app/notifications/broker/events/notifications-broker-events.scomponent.scss
similarity index 100%
rename from src/app/openaire/broker/events/openaire-broker-events.scomponent.scss
rename to src/app/notifications/broker/events/notifications-broker-events.scomponent.scss
diff --git a/src/app/openaire/broker/project-entry-import-modal/project-entry-import-modal.component.html b/src/app/notifications/broker/project-entry-import-modal/project-entry-import-modal.component.html
similarity index 100%
rename from src/app/openaire/broker/project-entry-import-modal/project-entry-import-modal.component.html
rename to src/app/notifications/broker/project-entry-import-modal/project-entry-import-modal.component.html
diff --git a/src/app/openaire/broker/project-entry-import-modal/project-entry-import-modal.component.scss b/src/app/notifications/broker/project-entry-import-modal/project-entry-import-modal.component.scss
similarity index 100%
rename from src/app/openaire/broker/project-entry-import-modal/project-entry-import-modal.component.scss
rename to src/app/notifications/broker/project-entry-import-modal/project-entry-import-modal.component.scss
diff --git a/src/app/openaire/broker/project-entry-import-modal/project-entry-import-modal.component.spec.ts b/src/app/notifications/broker/project-entry-import-modal/project-entry-import-modal.component.spec.ts
similarity index 92%
rename from src/app/openaire/broker/project-entry-import-modal/project-entry-import-modal.component.spec.ts
rename to src/app/notifications/broker/project-entry-import-modal/project-entry-import-modal.component.spec.ts
index e19d0a7c86..7cac576844 100644
--- a/src/app/openaire/broker/project-entry-import-modal/project-entry-import-modal.component.spec.ts
+++ b/src/app/notifications/broker/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,
- openaireBrokerEventObjectMissingProjectFound,
- OpenaireMockDspaceObject
-} from '../../../shared/mocks/openaire.mock';
+ notificationsBrokerEventObjectMissingProjectFound,
+ NotificationsMockDspaceObject
+} from '../../../shared/mocks/notifications.mock';
const eventData = {
- event: openaireBrokerEventObjectMissingProjectFound,
- id: openaireBrokerEventObjectMissingProjectFound.id,
- title: openaireBrokerEventObjectMissingProjectFound.title,
+ event: notificationsBrokerEventObjectMissingProjectFound,
+ id: notificationsBrokerEventObjectMissingProjectFound.id,
+ title: notificationsBrokerEventObjectMissingProjectFound.title,
hasProject: true,
- projectTitle: openaireBrokerEventObjectMissingProjectFound.message.title,
+ projectTitle: notificationsBrokerEventObjectMissingProjectFound.message.title,
projectId: ItemMockPid10.id,
handle: ItemMockPid10.handle,
reason: null,
@@ -36,7 +36,7 @@ const eventData = {
const searchString = 'Test project to search';
const pagination = Object.assign(
new PaginationComponentOptions(), {
- id: 'openaire-project-bound',
+ id: 'notifications-project-bound',
pageSize: 3
}
);
@@ -54,7 +54,7 @@ const pageInfo = new PageInfo({
currentPage: 1
});
const array = [
- OpenaireMockDspaceObject,
+ NotificationsMockDspaceObject,
];
const paginatedList = buildPaginatedList(pageInfo, array);
const paginatedListRD = createSuccessfulRemoteDataObject(paginatedList);
@@ -143,7 +143,7 @@ describe('ProjectEntryImportModalComponent test suite', () => {
spyOn(comp, 'deselectAllLists');
spyOn(comp, 'close');
spyOn(comp.importedObject, 'emit');
- comp.selectedEntity = OpenaireMockDspaceObject;
+ comp.selectedEntity = NotificationsMockDspaceObject;
comp.bound();
expect(comp.importedObject.emit).toHaveBeenCalled();
diff --git a/src/app/openaire/broker/project-entry-import-modal/project-entry-import-modal.component.ts b/src/app/notifications/broker/project-entry-import-modal/project-entry-import-modal.component.ts
similarity index 89%
rename from src/app/openaire/broker/project-entry-import-modal/project-entry-import-modal.component.ts
rename to src/app/notifications/broker/project-entry-import-modal/project-entry-import-modal.component.ts
index 5d8cb20c6d..64672fa1fa 100644
--- a/src/app/openaire/broker/project-entry-import-modal/project-entry-import-modal.component.ts
+++ b/src/app/notifications/broker/project-entry-import-modal/project-entry-import-modal.component.ts
@@ -12,7 +12,11 @@ import { ListableObject } from '../../../shared/object-collection/shared/listabl
import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model';
import { SearchService } from '../../../core/shared/search/search.service';
import { DSpaceObject } from '../../../core/shared/dspace-object.model';
-import { OpenaireBrokerEventObject } from '../../../core/openaire/broker/models/openaire-broker-event.model';
+import {
+ NotificationsBrokerEventObject,
+ NotificationsBrokerEventMessageObject,
+ OpenaireBrokerEventMessageObject,
+} from '../../../core/notifications/broker/models/notifications-broker-event.model';
import { hasValue, isNotEmpty } from '../../../shared/empty.util';
import { Item } from '../../../core/shared/item.model';
@@ -30,13 +34,13 @@ export enum ImportType {
/**
* The data type passed from the parent page
*/
-export interface OpenaireBrokerEventData {
+export interface NotificationsBrokerEventData {
/**
- * The OpenAIRE Broker event
+ * The Notifications Broker event
*/
- event: OpenaireBrokerEventObject;
+ event: NotificationsBrokerEventObject;
/**
- * The OpenAIRE Broker event Id (uuid)
+ * The Notifications Broker event Id (uuid)
*/
id: string;
/**
@@ -79,14 +83,14 @@ export interface OpenaireBrokerEventData {
templateUrl: './project-entry-import-modal.component.html'
})
/**
- * Component to display a modal window for linking a project to an OpenAIRE Broker event
+ * Component to display a modal window for linking a project to an Notifications Broker event
* Shows information about the selected project and a selectable list.
*/
export class ProjectEntryImportModalComponent implements OnInit {
/**
* The external source entry
*/
- @Input() externalSourceEntry: OpenaireBrokerEventData;
+ @Input() externalSourceEntry: NotificationsBrokerEventData;
/**
* The number of results per page
*/
@@ -94,7 +98,7 @@ export class ProjectEntryImportModalComponent implements OnInit {
/**
* The prefix for every i18n key within this modal
*/
- labelPrefix = 'openaire.broker.event.modal.';
+ labelPrefix = 'notifications.broker.event.modal.';
/**
* The search configuration to retrieve project
*/
@@ -126,11 +130,11 @@ export class ProjectEntryImportModalComponent implements OnInit {
/**
* List ID for selecting local entities
*/
- entityListId = 'openaire-project-bound';
+ entityListId = 'notifications-project-bound';
/**
* List ID for selecting local authorities
*/
- authorityListId = 'openaire-project-bound-authority';
+ authorityListId = 'notifications-project-bound-authority';
/**
* ImportType enum
*/
@@ -175,8 +179,9 @@ export class ProjectEntryImportModalComponent implements OnInit {
* Component intitialization.
*/
public ngOnInit(): void {
- this.pagination = Object.assign(new PaginationComponentOptions(), { id: 'openaire-project-bound', pageSize: this.pageSize });
- this.projectTitle = (this.externalSourceEntry.projectTitle !== null) ? this.externalSourceEntry.projectTitle : this.externalSourceEntry.event.message.title;
+ this.pagination = Object.assign(new PaginationComponentOptions(), { id: 'notifications-project-bound', pageSize: this.pageSize });
+ this.projectTitle = (this.externalSourceEntry.projectTitle !== null) ? this.externalSourceEntry.projectTitle
+ : (this.externalSourceEntry.event.message as OpenaireBrokerEventMessageObject).title;
this.searchOptions = Object.assign(new PaginatedSearchOptions(
{
configuration: this.configuration,
diff --git a/src/app/openaire/broker/topics/openaire-broker-topics.actions.ts b/src/app/notifications/broker/topics/notifications-broker-topics.actions.ts
similarity index 60%
rename from src/app/openaire/broker/topics/openaire-broker-topics.actions.ts
rename to src/app/notifications/broker/topics/notifications-broker-topics.actions.ts
index fd98c6acb8..622ecc8141 100644
--- a/src/app/openaire/broker/topics/openaire-broker-topics.actions.ts
+++ b/src/app/notifications/broker/topics/notifications-broker-topics.actions.ts
@@ -1,6 +1,6 @@
import { Action } from '@ngrx/store';
import { type } from '../../../shared/ngrx/type';
-import { OpenaireBrokerTopicObject } from '../../../core/openaire/broker/models/openaire-broker-topic.model';
+import { NotificationsBrokerTopicObject } from '../../../core/notifications/broker/models/notifications-broker-topic.model';
/**
* For each action type in an action group, make a simple
@@ -10,19 +10,19 @@ import { OpenaireBrokerTopicObject } from '../../../core/openaire/broker/models/
* literal types and runs a simple check to guarantee all
* action types in the application are unique.
*/
-export const OpenaireBrokerTopicActionTypes = {
- ADD_TOPICS: type('dspace/integration/openaire/broker/topic/ADD_TOPICS'),
- RETRIEVE_ALL_TOPICS: type('dspace/integration/openaire/broker/topic/RETRIEVE_ALL_TOPICS'),
- RETRIEVE_ALL_TOPICS_ERROR: type('dspace/integration/openaire/broker/topic/RETRIEVE_ALL_TOPICS_ERROR'),
+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'),
};
/* tslint:disable:max-classes-per-file */
/**
- * An ngrx action to retrieve all the OpenAIRE Broker topics.
+ * An ngrx action to retrieve all the Notifications Broker topics.
*/
export class RetrieveAllTopicsAction implements Action {
- type = OpenaireBrokerTopicActionTypes.RETRIEVE_ALL_TOPICS;
+ type = NotificationsBrokerTopicActionTypes.RETRIEVE_ALL_TOPICS;
payload: {
elementsPerPage: number;
currentPage: number;
@@ -45,20 +45,20 @@ export class RetrieveAllTopicsAction implements Action {
}
/**
- * An ngrx action for retrieving 'all OpenAIRE Broker topics' error.
+ * An ngrx action for retrieving 'all Notifications Broker topics' error.
*/
export class RetrieveAllTopicsErrorAction implements Action {
- type = OpenaireBrokerTopicActionTypes.RETRIEVE_ALL_TOPICS_ERROR;
+ type = NotificationsBrokerTopicActionTypes.RETRIEVE_ALL_TOPICS_ERROR;
}
/**
- * An ngrx action to load the OpenAIRE Broker topic objects.
+ * An ngrx action to load the Notifications Broker topic objects.
* Called by the ??? effect.
*/
export class AddTopicsAction implements Action {
- type = OpenaireBrokerTopicActionTypes.ADD_TOPICS;
+ type = NotificationsBrokerTopicActionTypes.ADD_TOPICS;
payload: {
- topics: OpenaireBrokerTopicObject[];
+ topics: NotificationsBrokerTopicObject[];
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 OpenAIRE Broker topics
+ * the total available Notifications Broker topics
*/
- constructor(topics: OpenaireBrokerTopicObject[], totalPages: number, currentPage: number, totalElements: number) {
+ constructor(topics: NotificationsBrokerTopicObject[], 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 OpenaireBrokerTopicsActions
+export type NotificationsBrokerTopicsActions
= AddTopicsAction
|RetrieveAllTopicsAction
|RetrieveAllTopicsErrorAction;
diff --git a/src/app/openaire/broker/topics/openaire-broker-topics.component.html b/src/app/notifications/broker/topics/notifications-broker-topics.component.html
similarity index 66%
rename from src/app/openaire/broker/topics/openaire-broker-topics.component.html
rename to src/app/notifications/broker/topics/notifications-broker-topics.component.html
index d8321bc932..02371a8a6b 100644
--- a/src/app/openaire/broker/topics/openaire-broker-topics.component.html
+++ b/src/app/notifications/broker/topics/notifications-broker-topics.component.html
@@ -1,34 +1,34 @@
-
{{'openaire.broker.title'| translate}}
-
{{'openaire.broker.topics.description'| translate}}
+
{{'notifications.broker.title'| translate}}
+
{{'notifications.broker.topics.description'| translate}}
-
{{'openaire.broker.topics'| translate}}
+
{{'notifications.broker.topics'| translate}}
-
+
+ (paginationChange)="getNotificationsBrokerTopics()">
-
+
- {{'openaire.broker.noTopics' | translate}}
+ {{'notifications.broker.noTopics' | translate}}
- {{'openaire.broker.table.topic' | translate}} |
- {{'openaire.broker.table.last-event' | translate}} |
- {{'openaire.broker.table.actions' | translate}} |
+ {{'notifications.broker.table.topic' | translate}} |
+ {{'notifications.broker.table.last-event' | translate}} |
+ {{'notifications.broker.table.actions' | translate}} |
@@ -39,7 +39,7 @@