Commit d33aa0d9 authored by Jeff Lothéal's avatar Jeff Lothéal
Browse files

Fix the pagination bug and history back

parent af2b03a5
{
"name": "webapp",
"version": "2.6.6",
"version": "2.6.11",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
......
......@@ -226,11 +226,11 @@ export class DatasetDetailComponent implements OnInit, OnDestroy {
this._router.navigate([
`/${AppRoutes.datasets.uri}/${this._datasetDetailService.dataset.slug}/${AppRoutes.data.uri}`,
// tslint:disable-next-line: align
], { queryParamsHandling: 'preserve' });
], { queryParamsHandling: 'preserve', replaceUrl: true });
} else {
this._router.navigate([
`/${AppRoutes.datasets.uri}/${this._datasetDetailService.dataset.slug}/${AppRoutes.info.uri}`,
]);
], {replaceUrl: true});
}
} else {
// Making that the url contains the slug and not the uuid of the dataset
......@@ -239,7 +239,7 @@ export class DatasetDetailComponent implements OnInit, OnDestroy {
`/${AppRoutes.datasets.uri}/${this._datasetDetailService.dataset.slug}/${this._route.snapshot.firstChild.url[0]}`,
],
// tslint:disable-next-line: align
{ queryParamsHandling: 'preserve' });
{ queryParamsHandling: 'preserve', replaceUrl: true });
}
// Emit event to indicate to child component that the dataset has changed
......
......@@ -260,6 +260,6 @@ export class ResultsComponent implements OnInit, OnDestroy {
}
get toResultNumber() {
return Math.min(((this.paginator.pageIndex - 1) * this.paginator.pageSize) + 10, this.paginator.length);
return Math.min((this.paginator.pageIndex * this.paginator.pageSize), this.paginator.length);
}
}
......@@ -37,7 +37,7 @@ export class DatasetResearchService {
this._searchChangeSubject = new Subject<any>();
this._datasetsReloadedSubject = new Subject<any>();
this._scopeChangedSubject = new Subject<any>();
this._elasticsearchOptions = new ElasticsearchOptions({ pageSize: 10 });
this._elasticsearchOptions = new ElasticsearchOptions({ pageSize: 5 });
this._resultsCount = [];
}
......
import { Component, OnInit } from '@angular/core';
import { Location } from '@angular/common';
import { Router } from '@angular/router';
import { map, mergeMap, tap } from 'rxjs/operators';
import { notificationMessages, pageTitles } from '../../../../i18n/traductions';
......@@ -30,6 +31,7 @@ export class OrganizationsComponent implements OnInit {
private _datasetResearchService: DatasetResearchService,
private _notificationService: NotificationService,
private _router: Router,
private _location: Location
) { }
ngOnInit() {
......@@ -79,7 +81,7 @@ export class OrganizationsComponent implements OnInit {
this._datasetResearchService.getResults().subscribe(() => {
this._datasetResearchService.updateAggregation('metadata-fr.responsibleParty.organisationName', name, true);
this._datasetResearchService.scopeReasearch = scopesResearch.datasets;
this._router.navigate(['/', AppRoutes.research.uri]);
this._router.navigateByUrl(this._location.path());
});
}
......@@ -89,7 +91,7 @@ export class OrganizationsComponent implements OnInit {
this._datasetResearchService.getResults().subscribe(() => {
this._datasetResearchService.updateAggregation('metadata-fr.responsibleParty.organisationName', name, true);
this._datasetResearchService.scopeReasearch = scopesResearch.services;
this._router.navigate(['/', AppRoutes.research.uri]);
this._router.navigateByUrl(this._location.path());
});
}
......
......@@ -796,8 +796,8 @@ Here is the list of the last evolutions of the portal. If you wish to contribute
<target>Your credentials are not correct.</target>
</trans-unit>
<trans-unit id="login.internalError" datatype="html">
<source>Something went wrong, please try again later.</source>
<target>Something went wrong, please try again later.</target>
<source>Please enter a valid email and password.</source>
<target>Please enter a valid email and password.</target>
</trans-unit>
<trans-unit id="login.emailRequired" datatype="html">
<source>Email is required.</source>
......
......@@ -805,8 +805,8 @@ Voici la liste des dernières évolutions du portail. Si vous souhaitez contribu
<target>Vos identifiants ne sont pas corrects.</target>
</trans-unit>
<trans-unit id="login.internalError" datatype="html">
<source>Something went wrong, please try again later.</source>
<target>Une erreur est survenue, veuillez réessayer ultérieurement.</target>
<source>Please enter a valid email and password.</source>
<target>Merci de saisir un email et un mot de passe valides.</target>
</trans-unit>
<trans-unit id="login.emailRequired" datatype="html">
<source>Email is required.</source>
......
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