Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/coar-notify-7' into coar-notify-…
Browse files Browse the repository at this point in the history
…7-part-two
  • Loading branch information
steph-ieffam committed Jan 26, 2024
2 parents 4ff0c79 + 5bf9cea commit 8d49fe6
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ <h2 class="flex-grow-1">{{ isNewService ? ('ldn-create-service.title' | translat
<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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {QualityAssuranceBreadcrumbService} from './quality-assurance-breadcrumb.

describe('QualityAssuranceBreadcrumbService', () => {
let service: QualityAssuranceBreadcrumbService;
let dataService: any;
let translateService: any = {
instant: (str) => str,
};
Expand All @@ -26,7 +25,7 @@ describe('QualityAssuranceBreadcrumbService', () => {
}));

beforeEach(() => {
service = new QualityAssuranceBreadcrumbService(dataService,translateService);
service = new QualityAssuranceBreadcrumbService(translateService);
});

describe('getBreadcrumbs', () => {
Expand Down
18 changes: 5 additions & 13 deletions src/app/core/breadcrumbs/quality-assurance-breadcrumb.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';



Expand All @@ -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,
) {

Expand All @@ -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}`)]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@
[fields]="['datacite.relation.isSupplementedBy']"
[label]="'item.page.dataset'">
</ds-item-page-uri-field>
<ds-item-page-uri-field [item]="object"
[fields]="['datacite.relation.isReferencedBy']"
[label]="'item.page.dataset'">
</ds-item-page-uri-field>
<div>
<a class="btn btn-outline-primary" role="button" [routerLink]="[itemPageRoute + '/full']">
<i class="fas fa-info-circle"></i> {{"item.page.link.full" | translate}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@
[fields]="['datacite.relation.isSupplementedBy']"
[label]="'item.page.dataset'">
</ds-item-page-uri-field>
<ds-item-page-uri-field [item]="object"
[fields]="['datacite.relation.isReferencedBy']"
[label]="'item.page.dataset'">
</ds-item-page-uri-field>
<div>
<a class="btn btn-outline-primary" [routerLink]="[itemPageRoute + '/full']" role="button">
<i class="fas fa-info-circle"></i> {{"item.page.link.full" | translate}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'">
Expand Down Expand Up @@ -184,14 +180,6 @@ <h4 class="border-bottom pb-2">
</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>
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -150,7 +149,6 @@ export class QualityAssuranceEventsComponent implements OnInit, OnDestroy {
private paginationService: PaginationService,
private translateService: TranslateService,
private itemService: ItemDataService,
private _location: Location
) {
}

Expand Down Expand Up @@ -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();
}
}

0 comments on commit 8d49fe6

Please sign in to comment.