Commit 0e81a90c authored by Matthieu Benoist's avatar Matthieu Benoist
Browse files

cahnge dataset url, tab orders, robots rules (exemple)

parent 1a4d98fd
......@@ -3,25 +3,8 @@
<app-page-header [pageInfo]="pageHeaderInfo" [customGoToPreviousPage]="goToPreviousPage"></app-page-header>
</div>
<div class="tabulations">
<div class="tabulations" *ngIf="!isRendertron">
<ul class="navigation-tabs">
<li [routerLinkActive]="'is-active'" *ngIf="hasTable || hasMap">
<a (click)="setPosition()" [routerLink]="[AppRoutes.data.uri]" class="tab-link">
<svg class="tab-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 38 32" aria-hidden="true">
<path class="primary"
d="M19 0L4.5 6.4v19.4L19 32l14.5-6.4V6.4L19 0zm13.5 24.9l-13 5.7-.5.3-13.5-5.8v-18l13.5-6 13.1 5.8L19 13l.5.2v.6l13-6.1v17.2z" />
<path class="secondary" d="M19 30.9l.5-.2V13.2L5.9 6.9l-.4.2v.7l13 6.1v16.8z" />
</svg>
<div class="tab-text-wrapper">
<div>
<span class="tab-title" i18n="@@dataset.detail.data">Data</span>
</div>
<div>
<span class="tab-subtitle" i18n="@@dataset.detail.lines">{{ datasetDataNumber }} lines</span>
</div>
</div>
</a>
</li>
<li [routerLinkActive]="'is-active'">
<a (click)="setPosition()" [routerLink]="[AppRoutes.info.uri]" class="tab-link">
<svg class="tab-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 37 37" aria-hidden="true">
......@@ -47,6 +30,23 @@
</div>
</a>
</li>
<li [routerLinkActive]="'is-active'" *ngIf="hasTable || hasMap">
<a (click)="setPosition()" [routerLink]="[AppRoutes.data.uri]" class="tab-link">
<svg class="tab-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 38 32" aria-hidden="true">
<path class="primary"
d="M19 0L4.5 6.4v19.4L19 32l14.5-6.4V6.4L19 0zm13.5 24.9l-13 5.7-.5.3-13.5-5.8v-18l13.5-6 13.1 5.8L19 13l.5.2v.6l13-6.1v17.2z" />
<path class="secondary" d="M19 30.9l.5-.2V13.2L5.9 6.9l-.4.2v.7l13 6.1v16.8z" />
</svg>
<div class="tab-text-wrapper">
<div>
<span class="tab-title" i18n="@@dataset.detail.data">Data</span>
</div>
<div>
<span class="tab-subtitle" i18n="@@dataset.detail.lines">{{ datasetDataNumber }} lines</span>
</div>
</div>
</a>
</li>
<li [routerLinkActive]="'is-active'" *ngIf="datasetFormatsList">
<a (click)="setPosition()" [routerLink]="[AppRoutes.downloads.uri]" class="tab-link">
<svg class="tab-icon" xmlns="http://www.w3.org/2000/svg" data-name="Calque 1" viewBox="0 0 38 32" aria-hidden="true">
......
......@@ -9,6 +9,7 @@ import { datatsetDataRepresentationType, geosource, reusesTypes } from '../../..
import { NavigationHistoryService } from '../../../core/services';
import { AppRoutes } from '../../../routes';
import { IPageHeaderInfo, Metadata, typesMetadata } from '../../../shared/models';
import { isRentertron } from '../../../shared/variables';
import { DatasetDetailService } from '../../services';
......@@ -20,6 +21,8 @@ import { DatasetDetailService } from '../../services';
export class DatasetDetailComponent implements OnInit, OnDestroy {
AppRoutes = AppRoutes;
isRendertron = isRentertron;
pageHeaderInfo: IPageHeaderInfo = {
title: '',
shareButtons: {
......@@ -224,16 +227,16 @@ export class DatasetDetailComponent implements OnInit, OnDestroy {
// If a tab (info, data...) is not specified in the url then redirect to the data tab if the dataset
// as a table or a map or to the info tab in the failing case
if (!this._route.snapshot.firstChild) {
if (this.hasTable || this.hasMap) {
//if (this.hasTable || this.hasMap) {
this._router.navigate([
`/${AppRoutes.datasets.uri}/${this._datasetDetailService.dataset.slug}/${AppRoutes.data.uri}`,
`/${AppRoutes.datasets.uri}/${this._datasetDetailService.dataset.slug}/${AppRoutes.info.uri}`,
// tslint:disable-next-line: align
], { queryParamsHandling: 'preserve', replaceUrl: true });
} else {
/*} 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
this._router.navigate([
......@@ -266,7 +269,7 @@ export class DatasetDetailComponent implements OnInit, OnDestroy {
// If url is null then redirect to research page
if (url == null) {
url = `/${AppRoutes.research.uri}`;
url = `/${AppRoutes.datasets.uri}`;
}
this._router.navigateByUrl(url);
......
......@@ -105,7 +105,7 @@ export class FilterListComponent implements OnInit, OnDestroy {
resetActiveAggregations() {
this._datasetResearchService.resetActiveAggregations();
this._datasetResearchService.triggerSearchChange();
this._location.go(AppRoutes.research.uri, '');
this._location.go(AppRoutes.datasets.uri, '');
this._navigationHistoryService.add(this._location.path());
}
......
......@@ -47,7 +47,7 @@ export class ResultDatasetComponent implements OnInit {
}
get datasetDetailsURI() {
return this.dataset.hasMap || this.dataset.hasTable ? AppRoutes.data.uri : AppRoutes.info.uri;
return AppRoutes.info.uri;
}
}
......@@ -5,10 +5,10 @@ import { ResultsComponent } from './components';
export const routes: Routes = [
{
path: AppRoutes.research.uri,
path: AppRoutes.datasets.uri,
component: ResultsComponent,
data: {
title: AppRoutes.research.title,
title: AppRoutes.datasets.title,
},
},
{
......
......@@ -479,11 +479,11 @@ export class DatasetResearchService {
this._elasticsearchOptions.shouldAggregateResultCount = true;
this._elasticsearchOptions.sortOptions.value = (value && true) ? 'relevance' : 'date';
this._elasticsearchOptions.sortOptions.order = 'desc';
if (this._router.url.split('/').pop() !== AppRoutes.research.uri) {
if (this._router.url.split('/').pop() !== AppRoutes.datasets.uri) {
if (value === '') {
this._router.navigate(['/', `${AppRoutes.research.uri}`]);
this._router.navigate(['/', `${AppRoutes.datasets.uri}`]);
} else {
this._router.navigate(['/', `${AppRoutes.research.uri}`], { queryParams: { q: value } });
this._router.navigate(['/', `${AppRoutes.datasets.uri}`], { queryParams: { q: value } });
}
}
......
......@@ -81,7 +81,7 @@ export class ResearchUrlService {
setParameter(key: string, searchValue: string) {
this._parameters[key] = searchValue;
const params = this.generateUrlParams();
this._location.go(AppRoutes.research.uri, params);
this._location.go(AppRoutes.datasets.uri, params);
this._navigationHistoryService.add(this._location.path());
}
......@@ -136,7 +136,7 @@ export class ResearchUrlService {
}
}
const params = this.generateUrlParams();
this._location.go(AppRoutes.research.uri, params);
this._location.go(AppRoutes.datasets.uri, params);
this._navigationHistoryService.add(this._location.path());
}
......@@ -173,7 +173,7 @@ export class ResearchUrlService {
const value = option.order === 'desc' ? `-${option.value}` : option.value;
this._parameters['sort'] = value;
const params = this.generateUrlParams();
this._location.go(AppRoutes.research.uri, params);
this._location.go(AppRoutes.datasets.uri, params);
this._navigationHistoryService.add(this._location.path());
}
......
......@@ -40,25 +40,14 @@ export class CMSPostsListComponent implements OnInit, OnDestroy {
const countResults = [];
this._datasetResearchService.pageSize = 9;
this._datasetResearchService.getResults().subscribe((posts) => {
this.posts = [];
posts.forEach((result) => {
this.posts.push(result);
});
this._datasetResearchService.resultsCount.forEach((item) => {
console.log ('passage...');
countResults[item.scopeKey] = item.count || 0;
});
const length = countResults[scopesResearch.post.key];
this.paginator = {
pageIndex: this._datasetResearchService.pageIndex + 1,
length: 0,
pageSize: this._datasetResearchService.pageSize,
pageSizeOptions: [5, 10, 20],
};
this.paginator = {
pageIndex: this._datasetResearchService.pageIndex + 1,
length: length,
pageSize: this._datasetResearchService.pageSize,
pageSizeOptions: [5, 10, 20],
};
});
this.search();
}
// When pagination is changed by user, we update results with new pagination options
......@@ -77,8 +66,6 @@ export class CMSPostsListComponent implements OnInit, OnDestroy {
this.posts.push(result);
});
//const position = this._viewportScroller.getScrollPosition();
this.countResults = [];
this._datasetResearchService.resultsCount.forEach((item) => {
this.countResults[item.scopeKey] = item.count || 0;
......
......@@ -17,7 +17,7 @@
</div>
<div class="search column is-7-desktop is-8-tablet ">
<app-search-bar class="app-search-bar"></app-search-bar>
<a class="explore-link" [routerLink]="['/', AppRoutes.research.uri]" (click)="trackExploreButtonEvent()">
<a class="explore-link" [routerLink]="['/', AppRoutes.datasets.uri]" (click)="trackExploreButtonEvent()">
<button class="button explore-button" i18n="@@home.explore">Explore</button>
</a>
</div>
......
......@@ -105,7 +105,7 @@ export class HomeComponent implements OnInit {
goToPostsResearch() {
this._datasetResearchService.resetResearch();
this._datasetResearchService.scopeReasearch = scopesResearch.post;
this._router.navigate(['/', AppRoutes.research.uri]);
this._router.navigate(['/', AppRoutes.datasets.uri]);
}
trackExploreButtonEvent() {
......
......@@ -6,7 +6,7 @@
<p class="pages-group-title" i18n="@@sitemap.mainPages">Main pages</p>
<ul class="pages-list">
<li><a class="link-1" [routerLink]="['/', AppRoutes.home.uri]" i18n="@@sitemap.home">Home</a></li>
<li><a class="link-1" [routerLink]="['/', AppRoutes.research.uri]" i18n="@@sitemap.research">Research</a></li>
<li><a class="link-1" [routerLink]="['/', AppRoutes.datasets.uri]" i18n="@@sitemap.research">Research</a></li>
<li><a class="link-1" [routerLink]="['/', AppRoutes.partners.uri]" i18n="@@sitemap.partners">Partners</a></li>
<li><a class="link-1" [routerLink]="['/', AppRoutes.approach.uri]" i18n="@@sitemap.approach">Approach</a></li>
<li><a class="link-1" [routerLink]="['/', AppRoutes.documentation.uri]" i18n="@@sitemap.documentation">Documentation</a></li>
......
User-agent: *
Allow: /
Disallow: /*/donnees
Disallow: /*/telechargements
Disallow: /*/api
Disallow: /*/reutilisations
Disallow: /*.gif$
Disallow: /*.jpg$
Disallow: /*.jpeg$
Disallow: /*.png$
Disallow: /*.svg$
Disallow: /api/analytics/
Disallow: /api/query/map/
Disallow: /*/?responsibleParty.organisationName=
Disallow: /*/?type=
Disallow: /*/?license=
Disallow: /*/?link.service=
Disallow: /*/?link.formats=
Disallow: /*/?publicationDate=
Disallow: /*/?updateFrequency=
Disallow: /*/?category=
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