mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
Merged in CST-13405-ui-fine-tuning-part-1 (pull request #1281)
CST-13405 fix QA breadcrumbs, ldn iprange hint Approved-by: Stefano Maffei
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">
|
||||
{{ 'ldn-new-service.form.error.ipRange' | translate }}
|
||||
</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 }}
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -5,7 +5,6 @@ import {QualityAssuranceBreadcrumbService} from './quality-assurance-breadcrumb.
|
||||
|
||||
describe('QualityAssuranceBreadcrumbService', () => {
|
||||
let service: QualityAssuranceBreadcrumbService;
|
||||
let dataService: any;
|
||||
let translateService: any = {
|
||||
instant: (str) => str,
|
||||
};
|
||||
@@ -26,7 +25,7 @@ describe('QualityAssuranceBreadcrumbService', () => {
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
service = new QualityAssuranceBreadcrumbService(dataService,translateService);
|
||||
service = new QualityAssuranceBreadcrumbService(translateService);
|
||||
});
|
||||
|
||||
describe('getBreadcrumbs', () => {
|
||||
|
@@ -2,10 +2,7 @@ import { Breadcrumb } from '../../breadcrumbs/breadcrumb/breadcrumb.model';
|
||||
import { BreadcrumbsProviderService } from './breadcrumbsProviderService';
|
||||
import { Observable, of as observableOf } from 'rxjs';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { getFirstCompletedRemoteData } from '../shared/operators';
|
||||
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';
|
||||
constructor(
|
||||
protected qualityAssuranceService: QualityAssuranceTopicDataService,
|
||||
private translationService: TranslateService,
|
||||
) {
|
||||
|
||||
@@ -32,18 +28,14 @@ export class QualityAssuranceBreadcrumbService implements BreadcrumbsProviderSer
|
||||
* @param url The url to use as a link for this breadcrumb
|
||||
*/
|
||||
getBreadcrumbs(key: string, url: string): Observable<Breadcrumb[]> {
|
||||
const sourceId = key.split(':')[0];
|
||||
const topicId = key.split(':')[1];
|
||||
const args = key.split(':');
|
||||
const sourceId = args[0];
|
||||
const topicId = args.length > 2 ? args[args.length - 1] : args[1];
|
||||
|
||||
if (topicId) {
|
||||
return this.qualityAssuranceService.getTopic(topicId).pipe(
|
||||
getFirstCompletedRemoteData(),
|
||||
map((topic) => {
|
||||
return [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(topicId, undefined)];
|
||||
})
|
||||
);
|
||||
new Breadcrumb(topicId, undefined)]);
|
||||
} else {
|
||||
return observableOf([new Breadcrumb(this.translationService.instant(this.QUALITY_ASSURANCE_BREADCRUMB_KEY), url),
|
||||
new Breadcrumb(sourceId, `${url}${sourceId}`)]);
|
||||
|
@@ -4,10 +4,6 @@
|
||||
<h2 class="border-bottom pb-2">
|
||||
<div class="d-flex justify-content-between">
|
||||
{{'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>
|
||||
</h2>
|
||||
<ds-alert *ngIf="!targetId" [type]="'alert-info'">
|
||||
@@ -184,14 +180,6 @@
|
||||
</ds-pagination>
|
||||
</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>
|
||||
|
||||
<ng-template #acceptModal let-modal>
|
||||
|
@@ -1,6 +1,5 @@
|
||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { Location } from '@angular/common';
|
||||
|
||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
@@ -150,7 +149,6 @@ export class QualityAssuranceEventsComponent implements OnInit, OnDestroy {
|
||||
private paginationService: PaginationService,
|
||||
private translateService: TranslateService,
|
||||
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