Skip to content

Commit

Permalink
Merge pull request #18 from eea/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
kreafox authored Jan 16, 2023
2 parents 8c494b3 + 33401a7 commit 692d237
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 7 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

### [1.0.4](https://github.com/eea/volto-globalsearch/compare/1.0.3...1.0.4) - 16 January 2023

#### :hammer_and_wrench: Others

- update JenkinsFile [kreafox - [`cdf93f8`](https://github.com/eea/volto-globalsearch/commit/cdf93f8826b1f973ad71af3e3a9603a1b59bdd9f)]
- Add landing page URL [kreafox - [`ff613b6`](https://github.com/eea/volto-globalsearch/commit/ff613b675b0f0fcc64fb6b34006800fc7e7ceb99)]
- updated logo and label for Datahub [Zoltan Szabo - [`e6531c0`](https://github.com/eea/volto-globalsearch/commit/e6531c065b9461ed4d2973231a93fda58d4107c7)]
- Add special getActiveFilters method [Tiberiu Ichim - [`3ce32b9`](https://github.com/eea/volto-globalsearch/commit/3ce32b959cd169264efd628970c8133dd3554ca5)]
- Replace EEA logo in sources [kreafox - [`bfbce6f`](https://github.com/eea/volto-globalsearch/commit/bfbce6f6532c2e90a60a0220f9db7ec26b4d0018)]
- 'External data reference' are now displayed under the 'Others' cluster [Zoltan Szabo - [`fdefa68`](https://github.com/eea/volto-globalsearch/commit/fdefa68a3a4d3ff9afc0109267b26ea34c30686a)]
### [1.0.3](https://github.com/eea/volto-globalsearch/compare/1.0.2...1.0.3) - 12 January 2023

#### :hammer_and_wrench: Others
Expand Down
6 changes: 3 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pipeline {
NAMESPACE = "@eeacms"
SONARQUBE_TAGS = "volto.eea.europa.eu,demo-www.eea.europa.eu,prod-www.eea.europa.eu,circularity.eea.europa.eu"
DEPENDENCIES = ""
VOLTO = ""
VOLTO = "alpha"
}

stages {
Expand Down Expand Up @@ -41,7 +41,7 @@ pipeline {

"ES lint": {
node(label: 'docker') {
sh '''docker run -i --rm --name="$BUILD_TAG-eslint" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e VOLTO=$VOLTO plone/volto-addon-ci:alpha eslint'''
sh '''docker pull plone/volto-addon-ci:alpha; docker run -i --rm --name="$BUILD_TAG-eslint" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e VOLTO=$VOLTO plone/volto-addon-ci:alpha eslint'''
}
},

Expand Down Expand Up @@ -239,4 +239,4 @@ pipeline {
}
}
}
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eeacms/volto-globalsearch",
"version": "1.0.3",
"version": "1.0.4",
"description": "@eeacms/volto-globalsearch: Volto add-on",
"main": "src/index.js",
"author": "European Environment Agency: IDM2 A-Team",
Expand Down
8 changes: 6 additions & 2 deletions src/config/clusters.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const clusters = {
{
name: 'Data',
icon: { name: 'database' },
values: ['External data reference', 'Data set'],
values: ['Data set'],
defaultResultView: 'horizontalCard',
},
{
Expand All @@ -58,6 +58,7 @@ export const clusters = {
'Information portal',
'Tool',
'Case study',
'External data reference',
], // this will be transformed in "single type clusters".
defaultResultView: 'horizontalCard',
},
Expand All @@ -76,7 +77,7 @@ export default {
url: require('../static/website-logo.png'),
},
eea: {
url: require('../static/eea-logo.png'),
url: require('../static/eea-logo.svg'),
},
ias: {
url: require('../static/ias-logo.png'),
Expand Down Expand Up @@ -132,6 +133,9 @@ export default {
'etc-wmge': {
url: require('../static/etc-wmge.png'),
},
sdi: {
url: require('../static/eea-logo.svg'),
},
},
Countries: {
fallback: {
Expand Down
1 change: 1 addition & 0 deletions src/config/global-search-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const globalSearchConfig = {
runtime_mappings: build_runtime_mappings(clusters),
useSearchPhrases: false,
searchAsYouType: false,
landingPageURL: '/en/advanced-search',

...vocabs,
...facets,
Expand Down
41 changes: 40 additions & 1 deletion src/config/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { suiFacet, mergeConfig } from '@eeacms/search';
import {
suiFacet,
mergeConfig,
isFilterValueDefaultValue,
} from '@eeacms/search';
import { getGlobalsearchThumbUrl, getGlobalsearchIconUrl } from './../utils';
import { typesForClustersOptionsFilter } from './clusters';

Expand All @@ -16,6 +20,37 @@ const getClientProxyAddress = () => {
return url.toString();
};

const isActivePublishFilter = (f) => {
if (f.values?.[0] === 'All time') {
return false;
}

return true;
};

const getActiveFilters = (filters, appConfig) => {
const { facets = [] } = appConfig;
const filterableFacets = facets.filter(
(f) =>
f.isFilter ||
(typeof f.showInFacetsList !== 'undefined' ? f.showInFacetsList : true),
);
const facetNames = filterableFacets.map((f) => f.field);
const filterNames = filters
.filter((f) => facetNames.includes(f.field))
.map((f) => f.field);

const activeFilters = filters
.filter((f) => filterNames.includes(f.field))
.filter((f) =>
f.field === 'issued.date'
? isActivePublishFilter(f)
: !isFilterValueDefaultValue(f, appConfig),
);

return activeFilters;
};

export default function install(config) {
// console.log(process.env.RAZZLE_ENV_CONFIG);
const envConfig = process.env.RAZZLE_ENV_CONFIG
Expand Down Expand Up @@ -76,6 +111,10 @@ export default function install(config) {
component: UniversalCard,
};

config.resolve.getGlobalSearchActiveFilters = getActiveFilters;
config.searchui.globalsearch.getActiveFilters =
'getGlobalSearchActiveFilters';

// config.resolve.WebsiteFilterListComponent = {
// component: WebsiteFilterListComponent,
// };
Expand Down
1 change: 1 addition & 0 deletions src/config/vocabulary.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const vocab = {
'etc-icm': 'ETC on Inland, Coastal and Marine Waters',
'etc-uls': 'ETC on Urban, Land and Soil Systems',
'etc-wmge': 'ETC on Waste and Materials in Green Economy',
sdi: 'Datahub',
},
};

Expand Down
Binary file removed src/static/eea-logo.png
Binary file not shown.
1 change: 1 addition & 0 deletions src/static/eea-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 692d237

Please sign in to comment.