mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
CST-13405 fix QA breadcrumbs, ldn iprange hint
This commit is contained in:
@@ -88,7 +88,7 @@
|
|||||||
<div *ngIf="(formModel.get('lowerIp').invalid && formModel.get('lowerIp').touched) || (formModel.get('upperIp').invalid && formModel.get('upperIp').touched)" class="error-text">
|
<div *ngIf="(formModel.get('lowerIp').invalid && formModel.get('lowerIp').touched) || (formModel.get('upperIp').invalid && formModel.get('upperIp').touched)" class="error-text">
|
||||||
{{ 'ldn-new-service.form.error.ipRange' | translate }}
|
{{ 'ldn-new-service.form.error.ipRange' | translate }}
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="!(formModel.get('lowerIp').invalid && formModel.get('lowerIp').touched) || (formModel.get('upperIp').invalid && formModel.get('upperIp').touched)" class="text-muted">
|
<div class="text-muted">
|
||||||
{{ 'ldn-new-service.form.hint.ipRange' | translate }}
|
{{ 'ldn-new-service.form.hint.ipRange' | translate }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -5,7 +5,6 @@ import {QualityAssuranceBreadcrumbService} from './quality-assurance-breadcrumb.
|
|||||||
|
|
||||||
describe('QualityAssuranceBreadcrumbService', () => {
|
describe('QualityAssuranceBreadcrumbService', () => {
|
||||||
let service: QualityAssuranceBreadcrumbService;
|
let service: QualityAssuranceBreadcrumbService;
|
||||||
let dataService: any;
|
|
||||||
let translateService: any = {
|
let translateService: any = {
|
||||||
instant: (str) => str,
|
instant: (str) => str,
|
||||||
};
|
};
|
||||||
@@ -26,7 +25,7 @@ describe('QualityAssuranceBreadcrumbService', () => {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
service = new QualityAssuranceBreadcrumbService(dataService,translateService);
|
service = new QualityAssuranceBreadcrumbService(translateService);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('getBreadcrumbs', () => {
|
describe('getBreadcrumbs', () => {
|
||||||
|
@@ -2,10 +2,7 @@ import { Breadcrumb } from '../../breadcrumbs/breadcrumb/breadcrumb.model';
|
|||||||
import { BreadcrumbsProviderService } from './breadcrumbsProviderService';
|
import { BreadcrumbsProviderService } from './breadcrumbsProviderService';
|
||||||
import { Observable, of as observableOf } from 'rxjs';
|
import { Observable, of as observableOf } from 'rxjs';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { map } from 'rxjs/operators';
|
|
||||||
import { getFirstCompletedRemoteData } from '../shared/operators';
|
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
import { QualityAssuranceTopicDataService } from '../notifications/qa/topics/quality-assurance-topic-data.service';
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -19,7 +16,6 @@ export class QualityAssuranceBreadcrumbService implements BreadcrumbsProviderSer
|
|||||||
|
|
||||||
private QUALITY_ASSURANCE_BREADCRUMB_KEY = 'admin.quality-assurance.breadcrumbs';
|
private QUALITY_ASSURANCE_BREADCRUMB_KEY = 'admin.quality-assurance.breadcrumbs';
|
||||||
constructor(
|
constructor(
|
||||||
protected qualityAssuranceService: QualityAssuranceTopicDataService,
|
|
||||||
private translationService: TranslateService,
|
private translationService: TranslateService,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
@@ -32,18 +28,14 @@ export class QualityAssuranceBreadcrumbService implements BreadcrumbsProviderSer
|
|||||||
* @param url The url to use as a link for this breadcrumb
|
* @param url The url to use as a link for this breadcrumb
|
||||||
*/
|
*/
|
||||||
getBreadcrumbs(key: string, url: string): Observable<Breadcrumb[]> {
|
getBreadcrumbs(key: string, url: string): Observable<Breadcrumb[]> {
|
||||||
const sourceId = key.split(':')[0];
|
const args = key.split(':');
|
||||||
const topicId = key.split(':')[1];
|
const sourceId = args[0];
|
||||||
|
const topicId = args.length > 2 ? args[args.length - 1] : args[1];
|
||||||
|
|
||||||
if (topicId) {
|
if (topicId) {
|
||||||
return this.qualityAssuranceService.getTopic(topicId).pipe(
|
return observableOf( [new Breadcrumb(this.translationService.instant(this.QUALITY_ASSURANCE_BREADCRUMB_KEY), url),
|
||||||
getFirstCompletedRemoteData(),
|
|
||||||
map((topic) => {
|
|
||||||
return [new Breadcrumb(this.translationService.instant(this.QUALITY_ASSURANCE_BREADCRUMB_KEY), url),
|
|
||||||
new Breadcrumb(sourceId, `${url}${sourceId}`),
|
new Breadcrumb(sourceId, `${url}${sourceId}`),
|
||||||
new Breadcrumb(topicId, undefined)];
|
new Breadcrumb(topicId, undefined)]);
|
||||||
})
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
return observableOf([new Breadcrumb(this.translationService.instant(this.QUALITY_ASSURANCE_BREADCRUMB_KEY), url),
|
return observableOf([new Breadcrumb(this.translationService.instant(this.QUALITY_ASSURANCE_BREADCRUMB_KEY), url),
|
||||||
new Breadcrumb(sourceId, `${url}${sourceId}`)]);
|
new Breadcrumb(sourceId, `${url}${sourceId}`)]);
|
||||||
|
@@ -4,10 +4,6 @@
|
|||||||
<h2 class="border-bottom pb-2">
|
<h2 class="border-bottom pb-2">
|
||||||
<div class="d-flex justify-content-between">
|
<div class="d-flex justify-content-between">
|
||||||
{{'notifications.events.title'| translate}}
|
{{'notifications.events.title'| translate}}
|
||||||
<a class="btn btn-outline-secondary" (click)="goBack()">
|
|
||||||
<i class="fas fa-angle-double-left"></i>
|
|
||||||
{{'quality-assurance.events.back' | translate}}
|
|
||||||
</a>
|
|
||||||
</div>
|
</div>
|
||||||
</h2>
|
</h2>
|
||||||
<ds-alert *ngIf="!targetId" [type]="'alert-info'">
|
<ds-alert *ngIf="!targetId" [type]="'alert-info'">
|
||||||
@@ -184,14 +180,6 @@
|
|||||||
</ds-pagination>
|
</ds-pagination>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row text-right">
|
|
||||||
<div class="col-md-12">
|
|
||||||
<a class="btn btn-outline-secondary" (click)="goBack()">
|
|
||||||
<i class="fas fa-angle-double-left"></i>
|
|
||||||
{{'quality-assurance.events.back' | translate}}
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ng-template #acceptModal let-modal>
|
<ng-template #acceptModal let-modal>
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
import { Location } from '@angular/common';
|
|
||||||
|
|
||||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
@@ -150,7 +149,6 @@ export class QualityAssuranceEventsComponent implements OnInit, OnDestroy {
|
|||||||
private paginationService: PaginationService,
|
private paginationService: PaginationService,
|
||||||
private translateService: TranslateService,
|
private translateService: TranslateService,
|
||||||
private itemService: ItemDataService,
|
private itemService: ItemDataService,
|
||||||
private _location: Location
|
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -487,10 +485,4 @@ export class QualityAssuranceEventsComponent implements OnInit, OnDestroy {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Navigates back to the previous location in the browser's history stack.
|
|
||||||
*/
|
|
||||||
public goBack() {
|
|
||||||
this._location.back();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user