diff --git a/.stylelintrc b/.stylelintrc index faa158a997d2eadcda58208efc0ee3db555c38f3..715d95012ac97662f3f00869c37b75ea2849b93c 100644 --- a/.stylelintrc +++ b/.stylelintrc @@ -1,10 +1,8 @@ { - "extends": - "stylelint-config-standard" - , + "extends": "stylelint-config-standard", "rules": { "selector-pseudo-class-no-unknown": [ true, { - ignorePseudoClasses: ["host"], + ignorePseudoClasses: ["ng-deep"], } ] } } \ No newline at end of file diff --git a/src/app/geosource/components/dataset-detail/dataset-resources/resource-downloadable/resource-downloadable.component.scss b/src/app/geosource/components/dataset-detail/dataset-resources/resource-downloadable/resource-downloadable.component.scss index 13f431bb66fbb497c76f43b6b4f0e170ccc923c0..3084d96c42afe6436e33dc39c26193f06b49f77a 100644 --- a/src/app/geosource/components/dataset-detail/dataset-resources/resource-downloadable/resource-downloadable.component.scss +++ b/src/app/geosource/components/dataset-detail/dataset-resources/resource-downloadable/resource-downloadable.component.scss @@ -32,7 +32,7 @@ } .resource-icon { - ::ng-deep svg { + /deep/ svg { height: 2.125rem; .grey { @@ -46,31 +46,31 @@ } .resource-icon.PDF { - ::ng-deep svg { + /deep/ svg { fill: #ef7575; } } .resource-icon.ZIP { - ::ng-deep svg { + /deep/ svg { fill: #e5bb4e; } } .resource-icon.ECW { - ::ng-deep svg { + /deep/ svg { fill: #da92bb; } } .resource-icon.CSV { - ::ng-deep svg { + /deep/ svg { fill: #86b89b; } } .resource-icon.TIF { - ::ng-deep svg { + /deep/ svg { fill: #7e99ce; } } diff --git a/src/app/geosource/components/results/results.component.scss b/src/app/geosource/components/results/results.component.scss index 34b67c10f2635437bcbbdc6e3f240d5e81534189..681add0ae1b1e76af84059b3f30792f840100c41 100644 --- a/src/app/geosource/components/results/results.component.scss +++ b/src/app/geosource/components/results/results.component.scss @@ -1,8 +1,7 @@ @import "../../../../../node_modules/bulma/sass/utilities/_all"; @import "../../../../scss/variables.scss"; - -@media(max-width: $tablet) { +@media (max-width: $tablet) { .header-dataset { flex-direction: column-reverse; display: flex; @@ -34,8 +33,7 @@ } .filter-column { - - background-color: #F2F2F2; + background-color: #f2f2f2; padding: 0; top: 10px; @@ -61,7 +59,6 @@ padding-right: 1.5rem; margin-left: -1.5rem; margin-right: -1.5rem; - } .no-result { @@ -94,11 +91,11 @@ li { padding-left: 1em; - text-indent: -.7em; + text-indent: -0.7em; } li::before { - font-family: "Open sans"; + font-family: "Open sans", sans-serif; content: "• "; color: $tomato-color; font-size: 1rem; @@ -109,15 +106,15 @@ display: flex; justify-content: center; - .column:first-child { - padding-left: 0; - } - .column { display: flex; justify-content: center; } + .column:first-child { + padding-left: 0; + } + @media screen and (min-width: $desktop) { justify-content: space-between; @@ -132,7 +129,6 @@ display: flex; justify-content: flex-end; } - } } } @@ -154,6 +150,7 @@ span.item-found { .result-dataset { margin-bottom: 0.75rem; + margin-top: 0.5rem; } .pagination-bottom { diff --git a/src/app/geosource/services/elasticsearch.service.ts b/src/app/geosource/services/elasticsearch.service.ts index d470c60c0529aec36c87bc2fefe53278943a0a64..431820ea6eecf9d3e724ffbf4bbd958ec5322419 100644 --- a/src/app/geosource/services/elasticsearch.service.ts +++ b/src/app/geosource/services/elasticsearch.service.ts @@ -487,7 +487,6 @@ export class ElasticsearchService { let shouldExpression: Object[] = []; options.filters.forEach((filter) => { - let hasParentAgg = null; const activeAggregations = filter.findActiveAggregations(); if (activeAggregations.length > 0) { activeAggregations.forEach((activeAgg: Aggregation) => { @@ -506,20 +505,49 @@ export class ElasticsearchService { } else { field += '.keyword'; if (filter.subField) { - shouldExpression.push({ - nested: { - path: filter.nestedPath, - ignore_unmapped: true, - query: { - term: { - [field]: activeAgg.key, + // if we have a nested field, we need to create a AND query. + // ex: organizationName = "Métropole de Lyon" AND individualName = "DINSI". + // For this, we add a must condition inside the should of the nested field + let mustNested = null; + if (activeAgg.parentAggregation) { + const fieldParent = `${activeAgg.parentAggregation.field}.keyword`; + + mustNested = { + nested: { + path: filter.nestedPath, + ignore_unmapped: true, + query: { + bool: { + must: [ + { + match: { + [field]: activeAgg.key, + }, + }, + { + match: { + [fieldParent]: activeAgg.parentAggregation.key, + }, + }, + ], + }, }, }, - }, - }); - if (activeAgg.parentAggregation) { - hasParentAgg = activeAgg.parentAggregation; + }; + } else { + mustNested = { + nested: { + path: filter.nestedPath, + ignore_unmapped: true, + query: { + term: { + [field]: activeAgg.key, + }, + }, + }, + }; } + shouldExpression.push(mustNested); } else { // Special treatment for the licences if (filter.label === geosource.filterCategories.licences && @@ -554,28 +582,6 @@ export class ElasticsearchService { ); shouldExpression = []; } - - if (hasParentAgg) { - const fieldParent = `${hasParentAgg.field}.keyword`; - const shouldForParent = { - nested: { - path: filter.nestedPath, - ignore_unmapped: true, - query: { - term: { - [fieldParent]: hasParentAgg.key, - }, - }, - }, - }; - mustExpression.push( - { - bool: { - should: shouldForParent, - }, - }, - ); - } }); // Must is act like an logic "AND"