diff --git a/src/app/dataset-detail/components/dataset-detail/dataset-detail.component.html b/src/app/dataset-detail/components/dataset-detail/dataset-detail.component.html index 1a5c67bce00d31722ea1607e1c0658ef245c9ab3..d1157f573db01188dbc5a0457072919c0f40dcb2 100644 --- a/src/app/dataset-detail/components/dataset-detail/dataset-detail.component.html +++ b/src/app/dataset-detail/components/dataset-detail/dataset-detail.component.html @@ -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"> diff --git a/src/app/dataset-detail/components/dataset-detail/dataset-detail.component.ts b/src/app/dataset-detail/components/dataset-detail/dataset-detail.component.ts index 67e9466c2786613b7eafe36d151df74e371475ee..80972adc0444f40597db2cd20ce689c58e616349 100644 --- a/src/app/dataset-detail/components/dataset-detail/dataset-detail.component.ts +++ b/src/app/dataset-detail/components/dataset-detail/dataset-detail.component.ts @@ -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); diff --git a/src/app/datasets/components/filter-list/filter-list.component.ts b/src/app/datasets/components/filter-list/filter-list.component.ts index 518d95228e011b5c41bebf7e561cd7777031cbbf..99b500dc6fbb0a8b913ab3aa0a10b0a248baa9cb 100644 --- a/src/app/datasets/components/filter-list/filter-list.component.ts +++ b/src/app/datasets/components/filter-list/filter-list.component.ts @@ -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()); } diff --git a/src/app/datasets/components/results/result-dataset/result-dataset.component.ts b/src/app/datasets/components/results/result-dataset/result-dataset.component.ts index 5fa41dd5eb77e7f400ea72d4553320a4dcea2c5e..0c1745273db5a66b53324f6aaeded76226c8f7dd 100644 --- a/src/app/datasets/components/results/result-dataset/result-dataset.component.ts +++ b/src/app/datasets/components/results/result-dataset/result-dataset.component.ts @@ -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; } } diff --git a/src/app/datasets/datasets-routing.module.ts b/src/app/datasets/datasets-routing.module.ts index c296462c479cb1ee22623a3c391e7517b9eea168..849eb19788d5edda4660e39bfe07d42d1440036e 100644 --- a/src/app/datasets/datasets-routing.module.ts +++ b/src/app/datasets/datasets-routing.module.ts @@ -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, }, }, { diff --git a/src/app/datasets/services/dataset-research.service.ts b/src/app/datasets/services/dataset-research.service.ts index 474914ebf59c712b0cf9220d339c55714f62767f..1308666b27a2327b2a499f75f57cc21901118296 100644 --- a/src/app/datasets/services/dataset-research.service.ts +++ b/src/app/datasets/services/dataset-research.service.ts @@ -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 } }); } } diff --git a/src/app/datasets/services/research-url.service.ts b/src/app/datasets/services/research-url.service.ts index e14a2a942f68482ac83e68ad9f9e72c8bbb0ab82..a63386298782545688b36207d86ded445cca96ac 100644 --- a/src/app/datasets/services/research-url.service.ts +++ b/src/app/datasets/services/research-url.service.ts @@ -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()); } diff --git a/src/app/editorialisation/components/cms-posts-list/cms-posts-list.component.ts b/src/app/editorialisation/components/cms-posts-list/cms-posts-list.component.ts index 0193237a6eaa64f7c5e475cf85285a660e913672..5859a2e0feae9c51cb4b72003822c8259399ed03 100644 --- a/src/app/editorialisation/components/cms-posts-list/cms-posts-list.component.ts +++ b/src/app/editorialisation/components/cms-posts-list/cms-posts-list.component.ts @@ -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; diff --git a/src/app/editorialisation/components/home/home.component.html b/src/app/editorialisation/components/home/home.component.html index 14afb02ed30e2be92b232eb7e28b41f0aa28486e..db854474578f13e1aef20f3696db40d7d0866e4f 100644 --- a/src/app/editorialisation/components/home/home.component.html +++ b/src/app/editorialisation/components/home/home.component.html @@ -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> diff --git a/src/app/editorialisation/components/home/home.component.ts b/src/app/editorialisation/components/home/home.component.ts index 9d9fab409626759df4d8203276088f82baf10860..faf0f35a45d98a93a4ac2737b662159d55c63222 100644 --- a/src/app/editorialisation/components/home/home.component.ts +++ b/src/app/editorialisation/components/home/home.component.ts @@ -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() { diff --git a/src/app/editorialisation/components/site-map/site-map.component.html b/src/app/editorialisation/components/site-map/site-map.component.html index a725a92df6344d513c2f9c2b967e951daa6f9e30..f5d3e266ed62215bd28b00f52e9563cdebdbe1c9 100644 --- a/src/app/editorialisation/components/site-map/site-map.component.html +++ b/src/app/editorialisation/components/site-map/site-map.component.html @@ -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> diff --git a/src/robots.txt b/src/robots.txt index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..4835bbd09e629299ee60078fe0773ca61c0296d6 100644 --- a/src/robots.txt +++ b/src/robots.txt @@ -0,0 +1,25 @@ + +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=