mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
Merged in CST-13289-notify-ui-improvements (pull request #1222)
CST-13289 notify ui improvements Approved-by: Stefano Maffei
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
|
||||
<div class="d-flex justify-content-end">
|
||||
<button class="btn-primary" (click)="toggleCoarMessage()">
|
||||
{{'notify-message-modal.show-more' | translate}}
|
||||
{{'notify-message-modal.show-message' | translate}}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
@@ -1,14 +1,14 @@
|
||||
<div class="container my-4">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-3 text-left h4">{{'admin.notify.dashboard.outbound' | translate}}</div>
|
||||
<div class="col-12 col-md-3 text-left h4">{{((isInbound$ | async) ? 'admin.notify.dashboard.inbound' : 'admin.notify.dashboard.outbound') | translate}}</div>
|
||||
<div class="col-md-9">
|
||||
<ds-search-labels [inPlaceSearch]="true"></ds-search-labels>
|
||||
<div class="h4">
|
||||
<button (click)="resetDefaultConfiguration()" *ngIf="(selectedSearchConfig$ | async) !== defaultConfiguration" class="badge badge-primary mr-1 mb-1">
|
||||
{{'admin.notify.dashboard.configuration' | translate}} {{ selectedSearchConfig$ | async }}
|
||||
{{'admin.notify.dashboard.filter' | translate}} {{ 'admin-notify-dashboard.' + (selectedSearchConfig$ | async) | translate}}
|
||||
<span> ×</span>
|
||||
</button>
|
||||
</div>
|
||||
<ds-search-labels [inPlaceSearch]="true"></ds-search-labels>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -5,6 +5,7 @@ import { SearchConfigurationService } from '../../../../core/shared/search/searc
|
||||
import { Observable } from 'rxjs';
|
||||
import { ActivatedRoute, ActivatedRouteSnapshot, Router } from '@angular/router';
|
||||
import { ViewMode } from '../../../../core/shared/view-mode.model';
|
||||
import { map } from 'rxjs/operators';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-admin-notify-logs-result',
|
||||
@@ -22,6 +23,7 @@ export class AdminNotifyLogsResultComponent implements OnInit{
|
||||
defaultConfiguration: string;
|
||||
|
||||
public selectedSearchConfig$: Observable<string>;
|
||||
public isInbound$: Observable<boolean>;
|
||||
|
||||
protected readonly context = Context.CoarNotify;
|
||||
constructor(@Inject(SEARCH_CONFIG_SERVICE) public searchConfigService: SearchConfigurationService,
|
||||
@@ -36,6 +38,9 @@ export class AdminNotifyLogsResultComponent implements OnInit{
|
||||
};
|
||||
|
||||
this.selectedSearchConfig$ = this.searchConfigService.getCurrentConfiguration(this.defaultConfiguration);
|
||||
this.isInbound$ = this.selectedSearchConfig$.pipe(
|
||||
map(config => config.startsWith('NOTIFY.incoming'))
|
||||
);
|
||||
}
|
||||
|
||||
public resetDefaultConfiguration() {
|
||||
|
@@ -13,13 +13,16 @@
|
||||
<tbody>
|
||||
<tr *ngFor="let message of (messagesSubject$ | async)">
|
||||
<td class="text-nowrap">
|
||||
<div>{{ message.queueLastStartTime | date:"YYYY/MM/d hh:mm:ss" }}</div>
|
||||
<div *ngIf="message.queueLastStartTime">{{ message.queueLastStartTime | date:"YYYY/MM/d hh:mm:ss" }}</div>
|
||||
<div *ngIf="!message.queueLastStartTime">n/a</div>
|
||||
</td>
|
||||
<td class="cell-small text-truncate">
|
||||
<a *ngIf="message.relatedItem" [routerLink]="'/items/' + (isInbound ? message.context : message.object)">{{ message.relatedItem }}</a>
|
||||
<div *ngIf="!message.relatedItem">n/a</div>
|
||||
</td>
|
||||
<td>
|
||||
<a [routerLink]="'/items/' + (isInbound ? message.context : message.object)">{{ message.relatedItem }}</a>
|
||||
</td>
|
||||
<td>
|
||||
<div>{{ message.ldnService }}</div>
|
||||
<div *ngIf="message.ldnService">{{ message.ldnService }}</div>
|
||||
<div *ngIf="!message.ldnService">n/a</div>
|
||||
</td>
|
||||
<td>
|
||||
<div>{{ message.activityStreamType }}</div>
|
||||
|
@@ -0,0 +1,9 @@
|
||||
.cell-small {
|
||||
max-width: 180px;
|
||||
}
|
||||
|
||||
.table-responsive {
|
||||
td, th {
|
||||
padding: 0.5rem;
|
||||
}
|
||||
}
|
@@ -22,6 +22,7 @@ import { DatePipe } from '@angular/common';
|
||||
@Component({
|
||||
selector: 'ds-admin-notify-search-result',
|
||||
templateUrl: './admin-notify-search-result.component.html',
|
||||
styleUrls: ['./admin-notify-search-result.component.scss'],
|
||||
providers: [
|
||||
{
|
||||
provide: SEARCH_CONFIG_SERVICE,
|
||||
|
@@ -171,7 +171,8 @@ export class MenuResolver implements Resolve<boolean> {
|
||||
this.authorizationService.isAuthorized(FeatureID.AdministratorOf),
|
||||
this.authorizationService.isAuthorized(FeatureID.CanSubmit),
|
||||
this.authorizationService.isAuthorized(FeatureID.CanEditItem),
|
||||
]).subscribe(([isCollectionAdmin, isCommunityAdmin, isSiteAdmin, canSubmit, canEditItem]) => {
|
||||
this.authorizationService.isAuthorized(FeatureID.CanSeeQA)
|
||||
]).subscribe(([isCollectionAdmin, isCommunityAdmin, isSiteAdmin, canSubmit, canEditItem, canSeeQA]) => {
|
||||
const newSubMenuList = [
|
||||
{
|
||||
id: 'new_community',
|
||||
@@ -300,12 +301,50 @@ export class MenuResolver implements Resolve<boolean> {
|
||||
icon: 'pencil-alt',
|
||||
index: 1
|
||||
};
|
||||
const notificationSubMenuList = [
|
||||
/* Notifications */
|
||||
{
|
||||
id: 'notifications',
|
||||
active: false,
|
||||
visible: true,
|
||||
model: {
|
||||
type: MenuItemType.TEXT,
|
||||
text: 'menu.section.notifications'
|
||||
} as TextMenuItemModel,
|
||||
icon: 'bell',
|
||||
index: 4
|
||||
},
|
||||
{
|
||||
id: 'notifications_quality-assurance',
|
||||
parentID: 'notifications',
|
||||
active: false,
|
||||
visible: canSeeQA,
|
||||
model: {
|
||||
type: MenuItemType.LINK,
|
||||
text: 'menu.section.quality-assurance',
|
||||
link: '/notifications/quality-assurance'
|
||||
} as LinkMenuItemModel,
|
||||
},
|
||||
{
|
||||
id: 'notifications_reciter',
|
||||
parentID: 'notifications',
|
||||
active: false,
|
||||
visible: true,
|
||||
model: {
|
||||
type: MenuItemType.LINK,
|
||||
text: 'menu.section.notifications_reciter',
|
||||
link: '/notifications/' + NOTIFICATIONS_RECITER_SUGGESTION_PATH
|
||||
} as LinkMenuItemModel,
|
||||
},
|
||||
];
|
||||
|
||||
const menuList = [
|
||||
...newSubMenuList,
|
||||
newSubMenu,
|
||||
...editSubMenuList,
|
||||
editSubMenu,
|
||||
...notificationSubMenuList,
|
||||
|
||||
// TODO: enable this menu item once the feature has been implemented
|
||||
// {
|
||||
// id: 'new_item_version',
|
||||
@@ -543,46 +582,9 @@ export class MenuResolver implements Resolve<boolean> {
|
||||
* Create menu sections dependent on whether or not the current user is a site administrator
|
||||
*/
|
||||
createSiteAdministratorMenuSections() {
|
||||
combineLatest([
|
||||
this.authorizationService.isAuthorized(FeatureID.AdministratorOf),
|
||||
this.authorizationService.isAuthorized(FeatureID.CanSeeQA)
|
||||
])
|
||||
.subscribe(([authorized, canSeeQA]) => {
|
||||
this.authorizationService.isAuthorized(FeatureID.AdministratorOf)
|
||||
.subscribe((authorized) => {
|
||||
const menuList = [
|
||||
/* Notifications */
|
||||
{
|
||||
id: 'notifications',
|
||||
active: false,
|
||||
visible: authorized && canSeeQA,
|
||||
model: {
|
||||
type: MenuItemType.TEXT,
|
||||
text: 'menu.section.notifications'
|
||||
} as TextMenuItemModel,
|
||||
icon: 'bell',
|
||||
index: 4
|
||||
},
|
||||
{
|
||||
id: 'notifications_quality-assurance',
|
||||
parentID: 'notifications',
|
||||
active: false,
|
||||
visible: authorized,
|
||||
model: {
|
||||
type: MenuItemType.LINK,
|
||||
text: 'menu.section.quality-assurance',
|
||||
link: '/notifications/quality-assurance'
|
||||
} as LinkMenuItemModel,
|
||||
},
|
||||
{
|
||||
id: 'notifications_reciter',
|
||||
parentID: 'notifications',
|
||||
active: false,
|
||||
visible: authorized,
|
||||
model: {
|
||||
type: MenuItemType.LINK,
|
||||
text: 'menu.section.notifications_reciter',
|
||||
link: '/notifications/' + NOTIFICATIONS_RECITER_SUGGESTION_PATH
|
||||
} as LinkMenuItemModel,
|
||||
},
|
||||
/* Admin Search */
|
||||
{
|
||||
id: 'admin_search',
|
||||
|
@@ -136,7 +136,6 @@ export class SuggestionTargetsComponent implements OnInit {
|
||||
distinctUntilChanged(),
|
||||
take(1)
|
||||
).subscribe((options: PaginationComponentOptions) => {
|
||||
console.log('HELLO suggestion called!', options);
|
||||
this.suggestionTargetsStateService.dispatchRetrieveReciterSuggestionTargets(
|
||||
this.source,
|
||||
options.pageSize,
|
||||
|
@@ -3471,21 +3471,25 @@
|
||||
|
||||
"admin-notify-dashboard.generated-ldn": "Number of generated LDN",
|
||||
|
||||
"admin-notify-dashboard.accepted": "Accepted",
|
||||
"admin-notify-dashboard.NOTIFY.incoming.accepted": "Accepted",
|
||||
|
||||
"admin-notify-dashboard.processed": "Processed LDN",
|
||||
"admin-notify-dashboard.NOTIFY.incoming.processed": "Processed LDN",
|
||||
|
||||
"admin-notify-dashboard.failure": "Failure",
|
||||
"admin-notify-dashboard.NOTIFY.incoming.failure": "Failure",
|
||||
|
||||
"admin-notify-dashboard.untrusted": "Untrusted",
|
||||
"admin-notify-dashboard.NOTIFY.outgoing.failure": "Failure",
|
||||
|
||||
"admin-notify-dashboard.delivered": "Delivered",
|
||||
"admin-notify-dashboard.NOTIFY.incoming.untrusted": "Untrusted",
|
||||
|
||||
"admin-notify-dashboard.queued": "Queued",
|
||||
"admin-notify-dashboard.NOTIFY.outgoing.delivered": "Delivered",
|
||||
|
||||
"admin-notify-dashboard.queued-for-retry": "Queued for retry",
|
||||
"admin-notify-dashboard.NOTIFY.outgoing.queued": "Queued",
|
||||
|
||||
"admin-notify-dashboard.involved-items": "Involved items",
|
||||
"admin-notify-dashboard.NOTIFY.outgoing.queued_for_retry": "Queued for retry",
|
||||
|
||||
"admin-notify-dashboard.NOTIFY.incoming.involvedItems": "Involved items",
|
||||
|
||||
"admin-notify-dashboard.NOTIFY.outgoing.involvedItems": "Involved items",
|
||||
|
||||
"admin.notify.dashboard.breadcrumbs": "Dashboard",
|
||||
|
||||
@@ -3493,7 +3497,7 @@
|
||||
|
||||
"admin.notify.dashboard.inbound-logs": "Logs/Inbound",
|
||||
|
||||
"admin.notify.dashboard.configuration": "Configuration: ",
|
||||
"admin.notify.dashboard.filter": "Filter: ",
|
||||
|
||||
"search.filters.applied.f.relateditem": "Related items",
|
||||
|
||||
@@ -3673,7 +3677,7 @@
|
||||
|
||||
"notify-message-modal.title": "Message Detail",
|
||||
|
||||
"notify-message-modal.show-more": "Show more",
|
||||
"notify-message-modal.show-message": "Show message",
|
||||
|
||||
"notify-message-result.timestamp": "Timestamp",
|
||||
|
||||
|
@@ -461,27 +461,27 @@ export class DefaultAppConfig implements AppConfig {
|
||||
boxes: [
|
||||
{
|
||||
color: '#B8DAFF',
|
||||
title: 'admin-notify-dashboard.accepted',
|
||||
title: 'admin-notify-dashboard.NOTIFY.incoming.accepted',
|
||||
config: 'NOTIFY.incoming.accepted'
|
||||
},
|
||||
{
|
||||
color: '#D4EDDA',
|
||||
title: 'admin-notify-dashboard.processed',
|
||||
title: 'admin-notify-dashboard.NOTIFY.incoming.processed',
|
||||
config: 'NOTIFY.incoming.processed'
|
||||
},
|
||||
{
|
||||
color: '#FDBBC7',
|
||||
title: 'admin-notify-dashboard.failure',
|
||||
title: 'admin-notify-dashboard.NOTIFY.incoming.failure',
|
||||
config: 'NOTIFY.incoming.failure'
|
||||
},
|
||||
{
|
||||
color: '#FDBBC7',
|
||||
title: 'admin-notify-dashboard.untrusted',
|
||||
title: 'admin-notify-dashboard.NOTIFY.incoming.untrusted',
|
||||
config: 'NOTIFY.incoming.untrusted'
|
||||
},
|
||||
{
|
||||
color: '#43515F',
|
||||
title: 'admin-notify-dashboard.involved-items',
|
||||
title: 'admin-notify-dashboard.NOTIFY.incoming.involvedItems',
|
||||
textColor: '#fff',
|
||||
config: 'NOTIFY.incoming.involvedItems',
|
||||
},
|
||||
@@ -492,27 +492,27 @@ export class DefaultAppConfig implements AppConfig {
|
||||
boxes: [
|
||||
{
|
||||
color: '#D4EDDA',
|
||||
title: 'admin-notify-dashboard.delivered',
|
||||
title: 'admin-notify-dashboard.NOTIFY.outgoing.delivered',
|
||||
config: 'NOTIFY.outgoing.delivered'
|
||||
},
|
||||
{
|
||||
color: '#B8DAFF',
|
||||
title: 'admin-notify-dashboard.queued',
|
||||
title: 'admin-notify-dashboard.NOTIFY.outgoing.queued',
|
||||
config: 'NOTIFY.outgoing.queued'
|
||||
},
|
||||
{
|
||||
color: '#FDEEBB',
|
||||
title: 'admin-notify-dashboard.queued-for-retry',
|
||||
title: 'admin-notify-dashboard.NOTIFY.outgoing.queued_for_retry',
|
||||
config: 'NOTIFY.outgoing.queued_for_retry'
|
||||
},
|
||||
{
|
||||
color: '#FDBBC7',
|
||||
title: 'admin-notify-dashboard.failure',
|
||||
title: 'admin-notify-dashboard.NOTIFY.outgoing.failure',
|
||||
config: 'NOTIFY.outgoing.failure'
|
||||
},
|
||||
{
|
||||
color: '#43515F',
|
||||
title: 'admin-notify-dashboard.involved-items',
|
||||
title: 'admin-notify-dashboard.NOTIFY.outgoing.involvedItems',
|
||||
textColor: '#fff',
|
||||
config: 'NOTIFY.outgoing.involvedItems',
|
||||
},
|
||||
|
Reference in New Issue
Block a user