Commit 10f26691 authored by Vitali Stupin's avatar Vitali Stupin
Browse files

Adding link to display hidden subsystems

parent d2a712c7
......@@ -25,6 +25,7 @@ export class SearchComponent implements OnInit {
}
setLimit(limit: string) {
this.limit = limit;
this.subsystemsService.setLimit(limit);
}
......
......@@ -37,7 +37,11 @@
<app-subsystem-item *ngFor="let subsystem of filteredSubsystems | async" [subsystem]="subsystem"></app-subsystem-item>
<br>
<p *ngIf="isPartialList()">{{'subsystemList.moreSubsystems' | translate}}</p>
<p *ngIf="isPartialList()">
{{'subsystemList.moreSubsystems' | translate}}<br>
<a class="font-weight-bold"
onClick="return false" href="#" (click)="setMaxLimit()">{{'subsystemList.showAll' | translate}}</a>.
</p>
<p *ngIf="filteredSubsystems.value?.length">
<button type="button" [ngClass]="'btn btn-secondary'" (click)="scrollToTop()">{{'scrollToTop' | translate}}</button>
......
......@@ -167,6 +167,16 @@ describe('SubsystemListComponent', () => {
component.setInstanceVersion();
expect(TestBed.get(Router).navigateByUrl).toHaveBeenCalledWith('/INST');
});
it('setMaxLimit should work', () => {
fixture = TestBed.createComponent(SubsystemListComponent);
component = fixture.componentInstance;
component.search = TestBed.createComponent(SearchStubComponent).componentInstance;
fixture.detectChanges();
component.search.setLimit = jasmine.createSpy();
component.setMaxLimit();
expect(component.search.setLimit).toHaveBeenCalledWith('all');
});
});
describe('SubsystemListComponent (with instance version)', () => {
......
import { Component, OnInit, AfterViewInit, OnDestroy } from '@angular/core';
import { Component, OnInit, AfterViewInit, OnDestroy, ViewChild } from '@angular/core';
import { Subsystem } from '../subsystem';
import { SubsystemsService } from '../subsystems.service';
import { ActivatedRoute, Router, Scroll } from '@angular/router';
......@@ -6,6 +6,7 @@ import { Subscription, BehaviorSubject } from 'rxjs';
import { ViewportScroller } from '@angular/common';
import { filter } from 'rxjs/operators';
import { InstanceVersion } from '../instance-version';
import { SearchComponent } from './search/search.component';
@Component({
selector: 'app-subsystem-list',
......@@ -22,6 +23,8 @@ export class SubsystemListComponent implements OnInit, AfterViewInit, OnDestroy
instanceVersions: BehaviorSubject<InstanceVersion[]>;
instanceVersion: string;
@ViewChild(SearchComponent) search;
constructor(
private subsystemsService: SubsystemsService,
private route: ActivatedRoute,
......@@ -84,6 +87,10 @@ export class SubsystemListComponent implements OnInit, AfterViewInit, OnDestroy
this.subsystemsService.setInstance(this.subsystemsService.getInstance(), this.instanceVersion);
}
setMaxLimit() {
this.search.setLimit('all');
}
ngOnInit() {
// Reset message on page load
this.message = '';
......
......@@ -14,7 +14,8 @@
"p4": "Latest catalogue version in JSON form: <a href=\"{{jsonUrl}}\" target=\"_blank\">JSON</a>",
"p5": "Support: <a href=\"mailto:help@ria.ee\">help@ria.ee</a>"
},
"moreSubsystems": "To see more subsystems change amount of subsystems to display or filter by subsystem or service name.",
"moreSubsystems": "Because of selected subsystem display limit some subsystems are hidden. To see more subsystems change amount of subsystems to display or filter by subsystem or service name.",
"showAll": "Show all hidden sybsystems",
"selectInstance": "Select X-tee instance",
"selectVersion": "Select methods catalogue version",
"latestVersion": "Latest version"
......
......@@ -14,7 +14,8 @@
"p4": "Kõige värskem kataloogi versioon JSON kujul: <a href=\"{{jsonUrl}}\" target=\"_blank\">JSON</a>",
"p5": "Kasutajatugi: <a href=\"mailto:help@ria.ee\">help@ria.ee</a>"
},
"moreSubsystems": "Selleks, et näha rohkem alamsüsteeme, muutke alamsüsteemide näitamise piirangu või otsige alamsüsteemi või teenuse nime järgi.",
"moreSubsystems": "Seoses valitud alamsüsteemide näitamise piiranguga mõned alamsüsteemid on peidetud. Selleks, et näha rohkem alamsüsteeme, muutke alamsüsteemide näitamise piirangu või otsige alamsüsteemi või teenuse nime järgi.",
"showAll": "Näita kõik peidetud alamsüsteemid",
"selectInstance": "Vali X-tee instants",
"selectVersion": "Vali teenuste kataloogi versiooni",
"latestVersion": "Viimane versioon"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment