forked from 4Science/dspace-angular
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request DSpace#2751 from 4Science/coar-notify-7-part-two
Coar Notify Integration - Administer/Log
- Loading branch information
Showing
80 changed files
with
3,666 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
src/app/admin/admin-notify-dashboard/admin-notify-dashboard-routing.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { RouterModule } from '@angular/router'; | ||
import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver'; | ||
import { AdminNotifyDashboardComponent } from './admin-notify-dashboard.component'; | ||
import { | ||
SiteAdministratorGuard | ||
} from '../../core/data/feature-authorization/feature-authorization-guard/site-administrator.guard'; | ||
import { | ||
AdminNotifyIncomingComponent | ||
} from './admin-notify-logs/admin-notify-incoming/admin-notify-incoming.component'; | ||
import { | ||
AdminNotifyOutgoingComponent | ||
} from './admin-notify-logs/admin-notify-outgoing/admin-notify-outgoing.component'; | ||
import { NotifyInfoGuard } from '../../core/coar-notify/notify-info/notify-info.guard'; | ||
|
||
@NgModule({ | ||
imports: [ | ||
RouterModule.forChild([ | ||
{ | ||
canActivate: [SiteAdministratorGuard, NotifyInfoGuard], | ||
path: '', | ||
resolve: { | ||
breadcrumb: I18nBreadcrumbResolver, | ||
}, | ||
component: AdminNotifyDashboardComponent, | ||
pathMatch: 'full', | ||
data: { | ||
title: 'admin.notify.dashboard.page.title', | ||
breadcrumbKey: 'admin.notify.dashboard', | ||
}, | ||
}, | ||
{ | ||
path: 'inbound', | ||
resolve: { | ||
breadcrumb: I18nBreadcrumbResolver, | ||
}, | ||
component: AdminNotifyIncomingComponent, | ||
canActivate: [SiteAdministratorGuard, NotifyInfoGuard], | ||
data: { | ||
title: 'admin.notify.dashboard.page.title', | ||
breadcrumbKey: 'admin.notify.dashboard', | ||
}, | ||
}, | ||
{ | ||
path: 'outbound', | ||
resolve: { | ||
breadcrumb: I18nBreadcrumbResolver, | ||
}, | ||
component: AdminNotifyOutgoingComponent, | ||
canActivate: [SiteAdministratorGuard, NotifyInfoGuard], | ||
data: { | ||
title: 'admin.notify.dashboard.page.title', | ||
breadcrumbKey: 'admin.notify.dashboard', | ||
}, | ||
} | ||
]) | ||
], | ||
}) | ||
/** | ||
* Routing module for the Notifications section of the admin sidebar | ||
*/ | ||
export class AdminNotifyDashboardRoutingModule { | ||
|
||
} |
23 changes: 23 additions & 0 deletions
23
src/app/admin/admin-notify-dashboard/admin-notify-dashboard.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<div class="container"> | ||
<div class="row"> | ||
<div class="col-12"> | ||
<h1 class="border-bottom pb-2">{{'admin-notify-dashboard.title'| translate}}</h1> | ||
<div class="my-4">{{'admin-notify-dashboard.description' | translate}}</div> | ||
<div> | ||
<ul class="nav nav-tabs"> | ||
<li class="nav-item"> | ||
<a class="nav-link active">{{'admin-notify-dashboard.metrics' | translate}}</a> | ||
</li> | ||
<li class="nav-item"> | ||
<a class="nav-link" [routerLink]="'inbound'" [queryParams]="{view: 'table'}">{{'admin.notify.dashboard.inbound-logs' | translate}}</a> | ||
</li> | ||
<li class="nav-item"> | ||
<a class="nav-link" [routerLink]="'outbound'" [queryParams]="{view: 'table'}">{{'admin.notify.dashboard.outbound-logs' | translate}}</a> | ||
</ul> | ||
<div class="mt-2"> | ||
<ds-admin-notify-metrics *ngIf="(notifyMetricsRows$ | async)?.length" [boxesConfig]="notifyMetricsRows$ | async"></ds-admin-notify-metrics> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
57 changes: 57 additions & 0 deletions
57
src/app/admin/admin-notify-dashboard/admin-notify-dashboard.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { AdminNotifyDashboardComponent } from './admin-notify-dashboard.component'; | ||
import { TranslateModule } from '@ngx-translate/core'; | ||
import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap'; | ||
import { SearchService } from '../../core/shared/search/search.service'; | ||
import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils'; | ||
import { buildPaginatedList } from '../../core/data/paginated-list.model'; | ||
import { AdminNotifySearchResult } from './models/admin-notify-message-search-result.model'; | ||
import { AdminNotifyMessage } from './models/admin-notify-message.model'; | ||
|
||
describe('AdminNotifyDashboardComponent', () => { | ||
let component: AdminNotifyDashboardComponent; | ||
let fixture: ComponentFixture<AdminNotifyDashboardComponent>; | ||
|
||
let item1; | ||
let item2; | ||
let item3; | ||
let searchResult1; | ||
let searchResult2; | ||
let searchResult3; | ||
let results; | ||
|
||
const mockBoxes = [ | ||
{ title: 'admin-notify-dashboard.received-ldn', boxes: [ undefined, undefined, undefined, undefined, undefined ] }, | ||
{ title: 'admin-notify-dashboard.generated-ldn', boxes: [ undefined, undefined, undefined, undefined, undefined ] } | ||
]; | ||
|
||
beforeEach(async () => { | ||
item1 = Object.assign(new AdminNotifyMessage(), { uuid: 'e1c51c69-896d-42dc-8221-1d5f2ad5516e' }); | ||
item2 = Object.assign(new AdminNotifyMessage(), { uuid: 'c8279647-1acc-41ae-b036-951d5f65649b' }); | ||
item3 = Object.assign(new AdminNotifyMessage(), { uuid: 'c3bcbff5-ec0c-4831-8e4c-94b9c933ccac' }); | ||
searchResult1 = Object.assign(new AdminNotifySearchResult(), { indexableObject: item1 }); | ||
searchResult2 = Object.assign(new AdminNotifySearchResult(), { indexableObject: item2 }); | ||
searchResult3 = Object.assign(new AdminNotifySearchResult(), { indexableObject: item3 }); | ||
results = buildPaginatedList(undefined, [searchResult1, searchResult2, searchResult3]); | ||
|
||
await TestBed.configureTestingModule({ | ||
imports: [TranslateModule.forRoot(), NgbNavModule], | ||
declarations: [ AdminNotifyDashboardComponent ], | ||
providers: [{ provide: SearchService, useValue: { search: () => createSuccessfulRemoteDataObject$(results)}}] | ||
}) | ||
.compileComponents(); | ||
|
||
fixture = TestBed.createComponent(AdminNotifyDashboardComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', (done) => { | ||
component.notifyMetricsRows$.subscribe(boxes => { | ||
expect(boxes).toEqual(mockBoxes); | ||
done(); | ||
}); | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
Oops, something went wrong.