Skip to content
Snippets Groups Projects
Commit 6a21587e authored by ncastejon's avatar ncastejon
Browse files

Fix some stylelint warnings. Add ES filter for parent aggregation when subAgg is active

parent a328306d
No related branches found
No related tags found
1 merge request!31Version 2.12
Showing
with 297 additions and 276 deletions
......@@ -9,18 +9,6 @@
grid-template-rows: [header] $header-bar-height [content] 1fr [footer] auto;
}
.grid-layout.is-home {
// To make the navbar top to the menu dark color when home page
background-color: $brand-color;
grid-template-rows: [content] 1fr [footer] auto;
.site-header {
background-color: transparent;
position: absolute;
width: 100%;
}
}
.site-header {
grid-row: header;
grid-column: 1;
......@@ -34,6 +22,18 @@
}
}
.grid-layout.is-home {
// To make the navbar top to the menu dark color when home page
background-color: $brand-color;
grid-template-rows: [content] 1fr [footer] auto;
.site-header {
background-color: transparent;
position: absolute;
width: 100%;
}
}
.side-menu {
position: fixed;
height: calc(100% - #{$header-bar-height});
......@@ -56,7 +56,6 @@
transform: translateX(0);
}
.site-content {
grid-row: content;
grid-column: 1;
......@@ -72,7 +71,6 @@
margin-left: 0;
width: 100%;
}
}
.site-footer {
......
......@@ -17,7 +17,6 @@ $app-notification-width: 29rem;
.app-notification {
position: relative;
min-width: $app-notification-width;
max-width: $app-notification-width;
padding: 1rem;
......@@ -30,7 +29,18 @@ $app-notification-width: 29rem;
max-width: 100%;
}
span, p, button {
// Adding slideFromRight animation on notification classe
// The div come from the right and go back after a while
// The animation lasts 5s and is runned only one time
animation: slideFromRight 8s 1;
@media screen and (max-width: $tablet) {
animation: slideFromRightMobile 8s 1;
}
span,
p,
button {
color: white;
}
......@@ -49,7 +59,7 @@ $app-notification-width: 29rem;
font-weight: bold;
}
}
p.app-notification-content {
font-size: 0.875rem;
}
......@@ -76,29 +86,33 @@ $app-notification-width: 29rem;
cursor: pointer;
}
// Animation
@keyframes slideFromRight {
0% { transform: translateX($app-notification-width);}
15%, 85% { transform: translateX(0);}
100% { transform: translateX($app-notification-width);}
0% {
transform: translateX($app-notification-width);
}
15%,
85% {
transform: translateX(0);
}
100% {
transform: translateX($app-notification-width);
}
}
@keyframes slideFromRightMobile {
0% { transform: translateX(100%);}
15%, 85% { transform: translateX(0);}
100% { transform: translateX(100%);}
}
0% {
transform: translateX(100%);
}
// Adding slideFromRight animation on notification classe
// The div come from the right and go back after a while
// The animation lasts 5s and is runned only one time
.app-notification {
animation: slideFromRight 8s 1;
}
15%,
85% {
transform: translateX(0);
}
@media screen and (max-width: $tablet) {
.app-notification {
animation: slideFromRightMobile 8s 1;
100% {
transform: translateX(100%);
}
}
\ No newline at end of file
}
......@@ -12,7 +12,6 @@ img {
}
.item {
/* Masonry bricks or child elements */
.organization {
background-color: white;
......@@ -20,7 +19,7 @@ img {
padding: 0.75rem 2rem;
&:hover {
box-shadow: inset 0px 0px 3px 0px grey;
box-shadow: inset 0 0 3px 0 grey;
}
.button {
......@@ -29,6 +28,7 @@ img {
padding-bottom: 0.75rem;
text-decoration: none;
border-radius: 0;
span {
font-size: $size-8;
}
......@@ -38,7 +38,6 @@ img {
display: inline-block;
margin: 0 0 1em;
width: 100%;
}
.datasetsCount {
......@@ -52,6 +51,7 @@ img {
word-break: break-word;
}
}
@supports not (hyphens: auto) {
p {
text-align: left;
......@@ -59,7 +59,6 @@ img {
}
}
.logo-content {
min-height: 100px;
line-height: 100px;
......@@ -79,5 +78,4 @@ img {
border: none;
border-radius: 0;
}
}
a {
text-decoration: none;
}
\ No newline at end of file
}
......@@ -19,4 +19,4 @@
margin-right: -1.25rem;
margin-left: -1.25rem;
}
}
\ No newline at end of file
}
......@@ -19,4 +19,4 @@
margin-right: -1.25rem;
margin-left: -1.25rem;
}
}
\ No newline at end of file
}
@import './../../../../scss/variables.scss';
@import './../../../../scss/variables.scss';
.section {
text-align: center;
......@@ -28,7 +28,6 @@
a:hover {
text-decoration: none;
color: $brand-color;
}
&:hover {
......@@ -43,4 +42,4 @@
}
}
}
}
\ No newline at end of file
}
......@@ -4,14 +4,17 @@ img {
max-height: 100px;
}
.container {
text-align: center;
;
}
.button {
width: 60%;
}
.masonry {
margin-top: 2rem;
/* Masonry container */
column-count: auto;
column-gap: 1em;
......@@ -34,21 +37,20 @@ img {
line-height: 2rem;
font-weight: 100;
&:before,
&:after {
&::before,
&::after {
content: '\201C';
font-family: 'Sanchez';
font-family: 'Sanchez', sans-serif;
color: $tomato-color;
}
&:after {
&::after {
content: '\201D';
}
}
}
.item {
/* Masonry bricks or child elements */
.credit {
background-color: white;
......@@ -56,7 +58,7 @@ img {
padding: 0.75rem 2rem;
&:hover {
box-shadow: inset 0px 0px 3px 0px grey;
box-shadow: inset 0 0 3px 0 grey;
}
.button {
......@@ -75,21 +77,17 @@ img {
display: inline-block;
margin: 0 0 1em;
width: 100%;
}
.datasetsCount {
text-align: center;
}
p {
text-align: left;
word-break: break-word;
}
.logo-content {
min-height: 100px;
line-height: 100px;
......@@ -109,9 +107,4 @@ p {
border: none;
border-radius: 0;
}
}
.button {
width: 60%;
}
@import '../../../../scss/variables.scss';
@import '../../../../../node_modules/bulma/sass/utilities/all';
.home-component {
height: 100%;
display: flex;
flex-direction: column;
}
.icon-decoration {
position: absolute;
top: 30vh;
img {
position: relative;
max-height: 18.75rem;
display: none;
@media screen and (min-width: $tablet) {
display: block;
left: -6rem;
}
@media screen and (min-width: $fullhd) {
display: block;
left: -4rem;
}
}
}
.research {
text-align: center;
// Color used as background when image is loading
// background-image: linear-gradient(to right, rgba(0, 0, 0, 0.9), rgba(51, 55, 68, 0) 21%, rgba(51, 55, 68, 0) 78%, #000000),
// url('../../../../assets/img/home_image.jpg');
background-color: $brand-color;
background-size: contain;
background-position: center;
position: relative;
height: 35vh;
min-height: 300px;
padding-top: 4rem;
......@@ -63,36 +76,13 @@
}
}
.icon-decoration {
position: absolute;
top: 30vh;
img {
position: relative;
max-height: 18.75rem;
display: none;
@media screen and (min-width: $tablet) {
display: block;
left: -6rem;
}
@media screen and (min-width: $fullhd) {
display: block;
left: -4rem;
}
}
}
.posts {
flex-grow: 1;
background: linear-gradient(to bottom, $grey-background-color, #dedede);
display: flex;
justify-content: center;
.post-container {
width: 100%;
margin-bottom: 1rem;
// Make the icon go behind in some screen width when menu is pushed.
......@@ -141,7 +131,6 @@
}
.posts-all-news {
@media screen and (min-width: $desktop) {
text-align: right;
}
......@@ -159,7 +148,6 @@
}
.post-item {
margin: auto;
margin-bottom: 2rem;
......@@ -182,10 +170,6 @@
}
}
a:hover .post-description-title {
text-decoration: underline;
}
.post-image {
min-height: 7.5rem;
width: 100%;
......@@ -193,6 +177,8 @@
background-size: cover;
background-repeat: no-repeat;
border-radius: 0.25rem 0.25rem 0 0;
filter: none;
transition: filter 0.5s ease-in-out;
}
.post-description {
......@@ -215,10 +201,8 @@
}
}
.post-image {
filter: none;
transition: filter 0.5s ease-in-out;
a:hover .post-description-title {
text-decoration: underline;
}
&:hover {
......
......@@ -9,14 +9,14 @@
<div class="root-url">
<div class="root-url-label title-label">
<span i18n="@@dataset.resources.url.root">
Root URL
Root URL
</span>
</div>
<div class="root-url-input">
<div class="link-with-copy">
<a class="parameters-url" [href]="resource.metadataLink.url" target="_blank">
<span>{{ resource.metadataLink.url }}</span>
</a>
<span class="parameters-url">
<a [href]="resource.metadataLink.url" target="_blank">{{ resource.metadataLink.url }}</a>
</span>
<button type="button" (click)="copyToClipboard(resource.metadataLink.url, true)" class="button is-medium">
<svg xmlns="http://www.w3.org/2000/svg" id="copy" viewBox="0 0 18 18">
<path
......@@ -32,10 +32,11 @@
</div>
</div>
<div class="create-request" (click)="requestOpen = !requestOpen" [ngClass]="{'is-open': requestOpen}" *ngIf="allSettingsOK">
<div class="create-request" (click)="requestOpen = !requestOpen" [ngClass]="{'is-open': requestOpen}"
*ngIf="allSettingsOK">
<span i18n="@@dataset.resources.createRequest">
Create one request
</span>
Create one request
</span>
<span class="create-request-icon">
<svg xmlns="http://www.w3.org/2000/svg" id="chevron" viewBox="0 0 15 9">
<path
......@@ -49,9 +50,9 @@
</div>
<div class="no-custom-url" *ngIf="!allSettingsOK">
<span i18n="@@dataset.resources.impossibleCreate">
Impossible de créer une requête personalisée pour ce jeu de données
</span>
<span i18n="@@dataset.resources.impossibleCreate">
Impossible de créer une requête personalisée pour ce jeu de données
</span>
</div>
<ng-container *ngIf="requestOpen">
......@@ -164,13 +165,13 @@
</div>
<div class="fromFeature-item">
<div class="title-label">
<label for="fromFeature"> Numéro du 1er enregistrement</label>
<label for="fromFeature"> Numéro du 1er enregistrement</label>
</div>
<div>
<input class="input" id="fromFeature" type="number" [value]="fromFeature" min="1" max="10000" [(ngModel)]="fromFeature"
(change)="setActiveFromFeature()">
<input class="input" id="fromFeature" type="number" [value]="fromFeature" min="1" max="10000"
[(ngModel)]="fromFeature" (change)="setActiveFromFeature()">
</div>
</div>
</ng-container>
......@@ -183,43 +184,45 @@
</span>
</div>
<div class="link-with-copy">
<a class="parameters-url column is-narrow-tablet" [href]="queryableUrl" target="_blank">
<span>
{{ queryableParameters.baseUrl }}
</span>
<span>
{{ queryableParameters.baseParameters }}
</span>
<span>
{{ queryableParameters.layer }}
</span>
<span *ngIf="selectedProjection" [ngClass]="{'is-active-parameter': queryableParameters.projectionActive}">
{{ queryableParameters.projection }}
{{ queryableParameters.bbox }}
</span>
<span *ngIf="selectedFormat" [ngClass]="{'is-active-parameter': queryableParameters.outputFormatActive}">
{{ queryableParameters.outputFormat }}
</span>
<span *ngIf="selectedInsee" [ngClass]="{'is-active-parameter': queryableParameters.inseeActive}">
{{ queryableParameters.insee }}
</span>
<span *ngIf="resource.type === linkFormats.wfs"
[ngClass]="{'is-active-parameter': queryableParameters.countFeatures}">
&count={{ countFeatures }}
</span>
<span *ngIf="resource.type === linkFormats.wfs"
[ngClass]="{'is-active-parameter': queryableParameters.fromFeature}">
&startIndex={{ fromFeature }}
</span>
<span *ngIf="resource.type === linkFormats.ws"
[ngClass]="{'is-active-parameter': queryableParameters.countFeatures}">
?maxfeatures={{ countFeatures }}
</span>
<span *ngIf="resource.type === linkFormats.ws"
[ngClass]="{'is-active-parameter': queryableParameters.fromFeature}">
&start={{ fromFeature }}
</span>
</a>
<span class="parameters-url column is-narrow-tablet">
<a [href]="queryableUrl" target="_blank">
<span>
{{ queryableParameters.baseUrl }}
</span>
<span>
{{ queryableParameters.baseParameters }}
</span>
<span>
{{ queryableParameters.layer }}
</span>
<span *ngIf="selectedProjection" [ngClass]="{'is-active-parameter': queryableParameters.projectionActive}">
{{ queryableParameters.projection }}
{{ queryableParameters.bbox }}
</span>
<span *ngIf="selectedFormat" [ngClass]="{'is-active-parameter': queryableParameters.outputFormatActive}">
{{ queryableParameters.outputFormat }}
</span>
<span *ngIf="selectedInsee" [ngClass]="{'is-active-parameter': queryableParameters.inseeActive}">
{{ queryableParameters.insee }}
</span>
<span *ngIf="resource.type === linkFormats.wfs"
[ngClass]="{'is-active-parameter': queryableParameters.countFeatures}">
&count={{ countFeatures }}
</span>
<span *ngIf="resource.type === linkFormats.wfs"
[ngClass]="{'is-active-parameter': queryableParameters.fromFeature}">
&startIndex={{ fromFeature }}
</span>
<span *ngIf="resource.type === linkFormats.ws"
[ngClass]="{'is-active-parameter': queryableParameters.countFeatures}">
?maxfeatures={{ countFeatures }}
</span>
<span *ngIf="resource.type === linkFormats.ws"
[ngClass]="{'is-active-parameter': queryableParameters.fromFeature}">
&start={{ fromFeature }}
</span>
</a>
</span>
<button type="button" (click)="copyToClipboard(queryableUrl)" class="button is-medium">
<svg xmlns="http://www.w3.org/2000/svg" id="copy" viewBox="0 0 18 18">
<path
......
@import '../../../../../../../scss/variables.scss';
.resource-item {
display: grid;
grid-auto-rows: auto;
......@@ -29,6 +28,50 @@
padding-bottom: 1rem;
}
.format-item {
grid-column: 1 / 2;
}
.projection-item {
grid-column: 2 / 3;
}
.division-item {
grid-column: 1 / 3;
}
.no-custom-url {
grid-column: 1 / 3;
span {
color: #eb7b3c;
}
}
.title-label {
margin-bottom: 0.4rem;
span,
label {
text-transform: uppercase;
color: $grey-dark-color;
font-size: 0.875rem;
line-height: 1.4;
}
}
.fromFeature-item {
grid-column: 2 / 3;
// Remove Bulma default 100% width
.input {
width: unset;
}
}
.parameters-url {
word-break: break-all;
}
.create-request {
cursor: pointer;
grid-column: 1 / 3;
......@@ -36,18 +79,64 @@
align-items: center;
justify-content: space-between;
padding-bottom: 1rem;
}
border-bottom: 2px solid $grey-background-color;
.format-item {
grid-column: 1 / 2;
span:first-of-type {
font-weight: 600;
}
}
.projection-item {
grid-column: 2 / 3;
.create-request-icon {
svg {
margin-right: 1.2rem;
width: 16px;
fill: grey;
transform: rotate(-90deg);
}
}
.division-item {
grid-column: 1 / 3;
.link-with-copy {
display: flex;
justify-content: space-between;
a,
a span {/* stylelint-disable-line */
color: $link-color;
text-decoration: none;
&:hover {
text-decoration: underline;
}
}
.parameters-url-icon {
color: $brand-color;
&:hover {
cursor: pointer;
}
}
.parameters-url {
background-color: $grey-background-color;
transition: all 0.5s ease;
word-break: break-all;
flex-grow: 1;
flex-shrink: 1;
padding: 0.7rem 0.5rem;
}
.button {
font-size: 0.875rem;
margin-left: 1rem;
height: 2.75rem;
svg {
width: 1.25rem;
fill: $grey-light-color;
margin-right: 0.5rem;
}
}
}
.maxFeatures-item {
......@@ -60,28 +149,19 @@
.warning {
margin-top: 0.5rem;
span {
span { /* stylelint-disable-line */
color: #eb7b3c;
}
}
}
.fromFeature-item {
grid-column: 2 / 3;
// Remove Bulma default 100% width
.input {
width: unset;
}
}
.personnalized-url {
grid-column: 1 / 3;
}
flex-wrap: wrap;
align-items: stretch;
.no-custom-url {
grid-column: 1 / 3;
span {
color: #eb7b3c;
.link-with-copy {
align-items: flex-start;
}
}
......@@ -91,18 +171,6 @@
pointer-events: initial !important;
}
.title-label {
margin-bottom: 0.4rem;
span,
label {
text-transform: uppercase;
color: $grey-dark-color;
font-size: 0.875rem;
line-height: 1.4;
}
}
.tooltip {
cursor: pointer;
}
......@@ -117,7 +185,10 @@ h3 {
.dropdown-trigger button,
.dropdown-menu {
width: 100%;
}
.dropdown-menu {
height: 2.5rem;
}
.dropdown-insee {
......@@ -129,10 +200,6 @@ h3 {
}
}
.dropdown-menu {
height: 2.5rem;
}
.dropdown-trigger .button {
justify-content: space-between;
}
......@@ -149,7 +216,6 @@ h3 {
.full-line-resource {
border-bottom: 1px solid white;
.resource-name {
font-size: $size-5;
......@@ -170,84 +236,6 @@ h3 {
padding-bottom: 0;
}
.personnalized-url {
flex-wrap: wrap;
align-items: stretch;
.link-with-copy {
align-items: flex-start;
}
}
.parameters-url {
word-break: break-all;
}
.link-with-copy {
display: flex;
justify-content: space-between;
a,
a span {
color: $link-color;
text-decoration: none;
&:hover {
text-decoration: underline;
}
}
.parameters-url-icon {
color: $brand-color;
&:hover {
cursor: pointer;
}
}
.parameters-url {
background-color: $grey-background-color;
transition: all .5s ease;
}
.parameters-url {
word-break: break-all;
flex-grow: 1;
flex-shrink: 1;
padding: 0.7rem 0.5rem;
}
.button {
font-size: 0.875rem;
margin-left: 1rem;
height: 2.75rem;
svg {
width: 1.25rem;
fill: $grey-light-color;
margin-right: 0.5rem
}
}
}
.create-request {
border-bottom: 2px solid $grey-background-color;
span:first-of-type {
font-weight: 600;
}
}
.create-request-icon {
svg {
margin-right: 1.2rem;
width: 16px;
fill: grey;
transform: rotate(-90deg);
}
}
.create-request.is-open {
border-bottom: none;
......
......@@ -4,6 +4,7 @@ import { Subscription } from 'rxjs';
import { Filter } from '../../models';
import { Aggregation, IActiveFiltersTemplate } from '../../models/filter.model';
import { scopesResearch } from '../../models/scopes-research';
import { geosource } from '../../../../i18n/traductions';
@Component({
selector: 'app-filter-list',
......@@ -46,6 +47,9 @@ export class FilterListComponent implements OnInit, OnDestroy {
filter.aggregations.forEach((aggregation) => {
if (aggregation.isActive) {
if (aggregation.label === 'null') {
aggregation.label = geosource.filter.other;
}
this.activeAggregations.push({
aggregation,
filter,
......@@ -53,6 +57,9 @@ export class FilterListComponent implements OnInit, OnDestroy {
} else if (aggregation.subAggregations.length > 0) {
aggregation.subAggregations.forEach((subAgg: Aggregation) => {
if (subAgg.isActive) {
if (subAgg.label === 'null') {
subAgg.label = geosource.filter.other;
}
this.activeAggregations.push({
filter,
aggregation: subAgg,
......
......@@ -32,15 +32,16 @@
line-height: 1.25rem;
font-weight: 600;
}
.subtitle {
color: $grey-light-color
color: $grey-light-color;
}
p {
padding-top: 0.25rem;
}
}
.providers {
color: $grey-light-color;
padding-top: 0;
......@@ -48,10 +49,13 @@
.description {
padding-top: 0;
p {
border-bottom: 1px solid $grey-super-light-color;
padding-bottom: 1.5rem;
text-align: left;
word-break: break-all;
overflow-wrap: break-word;
word-break: break-word;
hyphens: auto;
}
}
......@@ -47,9 +47,9 @@ export class Aggregation {
const execRegex = regex.exec(element);
if (execRegex !== null) {
const matches = Array.from(execRegex);
newLabel += `${matches[1]} / `;
newLabel += newLabel === '' ? matches[1] : ` / ${matches[1]}`;
} else {
newLabel += element;
newLabel += ` / ${element}`;
}
});
......
......@@ -487,6 +487,7 @@ 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) => {
......@@ -516,6 +517,9 @@ export class ElasticsearchService {
},
},
});
if (activeAgg.parentAggregation) {
hasParentAgg = activeAgg.parentAggregation;
}
} else {
// Special treatment for the licences
if (filter.label === geosource.filterCategories.licences &&
......@@ -550,6 +554,28 @@ 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"
......
......@@ -193,6 +193,9 @@ export const geosource = {
licence: {
other: 'Autre licence',
},
filter: {
other: 'Autres',
},
};
export const subjects = [
......
export const userServicesStatuses = {
pending: 'Pending',
opened: 'Ok',
......@@ -191,6 +192,9 @@ export const geosource = {
licence: {
other: 'Other license',
},
filter: {
other: 'Other',
},
};
export const subjects = [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment