Commit 489bf1b5 authored by Matthieu Benoist's avatar Matthieu Benoist
Browse files

Change Research menu entry to Datasets

parent a90acb96
......@@ -23,7 +23,7 @@
d="M18.1 10.1a8 8 0 1 1-8-8 8 8 0 0 1 8 8zm-1.9 6.7a9.2 9.2 0 0 1-6.1 2.3 9 9 0 1 1 9-9 9 9 0 0 1-2.2 6l5 4.8a.5.5 0 0 1 0 .7.6.6 0 0 1-.8 0z" />
</svg>
</div>
<span i18n="@@menu.research" class="label-menu">Research</span>
<span i18n="@@menu.datasets" class="label-menu">Datasets</span>
</a>
</li>
<li>
......
......@@ -15,9 +15,4 @@
<span class="tab-label">{{ scopesResearch.services.label }}</span>
<span class="tab-count">{{ countResults[scopesResearch.services.key] || 0 }}</span>
</button>
<button (click)="changeScope(scopesResearch.post)" [ngClass]="{'is-selected': selectedScope.key === scopesResearch.post.key}"
[attr.aria-current]="selectedScope.key === scopesResearch.post.key ? 'page' : undefined">
<span class="tab-label">{{ scopesResearch.post.label }}</span>
<span class="tab-count">{{ countResults[scopesResearch.post.key] || 0 }}</span>
</button>
</div>
......@@ -64,18 +64,16 @@ export class DatasetResearchService {
});
}
});
console.log (`We have ${countDatasets} results.`);
// Datasets scope (datasets + non geographic datasets + series)
this._resultsCount.push({
scopeKey: scopesResearch.datasets.key,
count: countDatasets,
});
console.log(this._resultsCount)
// All scope
const countAll = this._resultsCount.reduce((acc, obj) => {
const count = obj.scopeKey !== scopesResearch.page.key ? acc + obj.count : 0;
const count = obj.scopeKey !== (scopesResearch.page.key&&scopesResearch.post.key) ? acc + obj.count : 0;
return count;
// tslint:disable-next-line:align
}, 0);
......
......@@ -4,7 +4,7 @@ export const scopesResearch = {
all: {
key: 'all',
label: geosource.researchScope.all,
elasticType: ['dataset', 'nonGeographicDataset', 'series', 'nonGeographicSeries','service','post'],
elasticType: ['dataset', 'nonGeographicDataset', 'series', 'nonGeographicSeries','service'],
errorItem: geosource.errorItem.all,
},
datasets:
......
......@@ -23,6 +23,10 @@
<source>Research</source>
<target>Research</target>
</trans-unit>
<trans-unit id="menu.datasets" datatype="html">
<source>Datasets</source>
<target>Datasets</target>
</trans-unit>
<trans-unit id="menu.news" datatype="html">
<source>News</source>
<target>News</target>
......
......@@ -23,6 +23,10 @@
<source>Research</source>
<target>Recherche</target>
</trans-unit>
<trans-unit id="menu.datasets" datatype="html">
<source>Datasets</source>
<target>Jeux de données</target>
</trans-unit>
<trans-unit id="menu.news" datatype="html">
<source>News</source>
<target>Actualités</target>
......
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