@eeacms/volto-globalsearch 1.0.20 → 1.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/.eslintignore +1 -0
  2. package/.husky/pre-commit +2 -0
  3. package/CHANGELOG.md +43 -8
  4. package/DEVELOP.md +6 -8
  5. package/README.md +5 -2
  6. package/RELEASE.md +14 -14
  7. package/cypress.config.js +2 -2
  8. package/docker-compose.yml +5 -1
  9. package/locales/en/LC_MESSAGES/volto.po +14 -0
  10. package/package.json +26 -2
  11. package/src/config/facets.js +1 -1
  12. package/src/config/filters.js +26 -22
  13. package/src/config/global-search-config.js +20 -0
  14. package/src/config/healthcheck.js +314 -83
  15. package/src/config/healthcheck.test.js +300 -0
  16. package/src/config/healthcheck_queries/empty_resp.json +18 -0
  17. package/src/config/healthcheck_queries/failed_scheduled_atempts_since_last_started.json +36 -0
  18. package/src/config/healthcheck_queries/failed_scheduled_atempts_since_last_started_resp.json +41 -0
  19. package/src/config/healthcheck_queries/failed_site_since_last_started.json +31 -0
  20. package/src/config/healthcheck_queries/last_scheduled_indexing.json +28 -0
  21. package/src/config/healthcheck_queries/last_scheduled_started_indexing.json +29 -0
  22. package/src/config/healthcheck_queries/last_scheduled_started_indexing_resp.json +41 -0
  23. package/src/config/healthcheck_queries/last_sync_task_since_last_start.json +36 -0
  24. package/src/config/healthcheck_queries/last_sync_task_since_last_start_resp.json +63 -0
  25. package/src/config/healthcheck_queries/latest_tasks_for_site.json +23 -0
  26. package/src/config/healthcheck_queries/latest_tasks_for_site_resp.json +70 -0
  27. package/src/config/healthcheck_queries/started_or_finished_site_since_last_started.json +35 -0
  28. package/src/config/healthcheck_queries/started_or_finished_site_since_last_started_resp.json +36 -0
  29. package/src/config/index.test.js +16 -0
  30. /package/src/{utlis.test.js → utils.test.js} +0 -0
package/.eslintignore CHANGED
@@ -1 +1,2 @@
1
1
  src/config/json/*.json
2
+ src/config/healthcheck_queries/*.json
@@ -0,0 +1,2 @@
1
+ [ -n "$CI" ] && exit 0
2
+ yarn lint-staged
package/CHANGELOG.md CHANGED
@@ -4,6 +4,49 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ ### [1.0.22](https://github.com/eea/volto-globalsearch/compare/1.0.21...1.0.22) - 12 December 2023
8
+
9
+ #### :house: Internal changes
10
+
11
+ - chore: husky, lint-staged use fixed versions [valentinab25 - [`866609d`](https://github.com/eea/volto-globalsearch/commit/866609d540bd0efe4bab088305bb2127105d8df7)]
12
+ - chore:volto 16 in tests, update docs, fix stylelint overrides [valentinab25 - [`e09f5e2`](https://github.com/eea/volto-globalsearch/commit/e09f5e2c1161b4b867c04eb1c0421274bd6c7110)]
13
+
14
+ #### :hammer_and_wrench: Others
15
+
16
+ - removed try/catch [Zoltan Szabo - [`86cec5d`](https://github.com/eea/volto-globalsearch/commit/86cec5d49d06d41541dc6d42464e9b95769da745)]
17
+ - avoid async promise executor functions [Zoltan Szabo - [`61012e3`](https://github.com/eea/volto-globalsearch/commit/61012e331776fadaa9eafe9f7667b18d08b2351a)]
18
+ ### [1.0.21](https://github.com/eea/volto-globalsearch/compare/1.0.20...1.0.21) - 29 September 2023
19
+
20
+ #### :house: Internal changes
21
+
22
+ - style: lint-staged reorder in package.json [Alin Voinea - [`06a080f`](https://github.com/eea/volto-globalsearch/commit/06a080f12993015398d29cba5c0629247512833b)]
23
+
24
+ #### :house: Documentation changes
25
+
26
+ - docs: Update README and DEVELOP [Alin Voinea - [`decd2dc`](https://github.com/eea/volto-globalsearch/commit/decd2dcc9719917d5718545bc114d6095a9ce2d9)]
27
+ - docs: Update DEVELOP [Alin Voinea - [`63221f1`](https://github.com/eea/volto-globalsearch/commit/63221f15c1ae25f2de80e7fad0fcde98991945ab)]
28
+
29
+ #### :hammer_and_wrench: Others
30
+
31
+ - typo [Zoltan Szabo - [`0464524`](https://github.com/eea/volto-globalsearch/commit/0464524e8b956f059903ed1a9b89d25067a31dcb)]
32
+ - added more tests [Zoltan Szabo - [`236e4f2`](https://github.com/eea/volto-globalsearch/commit/236e4f2fbb2931dd3a1dff75b8d41135c5925af3)]
33
+ - added more tests [Zoltan Szabo - [`a46e825`](https://github.com/eea/volto-globalsearch/commit/a46e82505eb9a9b0131da77e3f38b8b22f8bd062)]
34
+ - prettier jsons [Zoltan Szabo - [`b3617b2`](https://github.com/eea/volto-globalsearch/commit/b3617b263262210c38989814f620701012b35fab)]
35
+ - added missing files [Zoltan Szabo - [`9d99b47`](https://github.com/eea/volto-globalsearch/commit/9d99b4791dde155ebaa8746afe3fae76717f110a)]
36
+ - refactor, and updated tests [Zoltan Szabo - [`e8ee669`](https://github.com/eea/volto-globalsearch/commit/e8ee669a99b3827f4b74dc4fba463a22163d2444)]
37
+ - removed debug code [Zoltan Szabo - [`e776630`](https://github.com/eea/volto-globalsearch/commit/e776630d1a6842cc750b6091f9d4692bc47410cb)]
38
+ - added more tests for healthcheck [Zoltan Szabo - [`bb38530`](https://github.com/eea/volto-globalsearch/commit/bb3853004af289a73bf6b5343bac92f4a559cf0d)]
39
+ - added more tests for healthcheck [Zoltan Szabo - [`3254d57`](https://github.com/eea/volto-globalsearch/commit/3254d57f7afac5410f54b86f91ae1257490fa201)]
40
+ - added tests for healthcheck [Zoltan Szabo - [`7d42dfc`](https://github.com/eea/volto-globalsearch/commit/7d42dfc481a3a355d54c2d679f0fb83c702190e8)]
41
+ - made queries prettier [Zoltan Szabo - [`f5b3f1e`](https://github.com/eea/volto-globalsearch/commit/f5b3f1e65108df9b0e5fe749de80cb8a1581e9db)]
42
+ - fixed eslints [Zoltan Szabo - [`c1f0cb5`](https://github.com/eea/volto-globalsearch/commit/c1f0cb52edd363ef8db748d9d7141eac40a8dec6)]
43
+ - test: EN locales, pre-commit fix, feature PRs checks Refs #257193 [valentinab25 - [`a4633e7`](https://github.com/eea/volto-globalsearch/commit/a4633e770e0b4c211dbdda83fe5005bcb74895bd)]
44
+ - updated labels for reading time aggregations [Zoltan Szabo - [`4061905`](https://github.com/eea/volto-globalsearch/commit/4061905d84b38364d5ac8dbf13665b1fb7130969)]
45
+ - i18n: Add en [Alin Voinea - [`3359382`](https://github.com/eea/volto-globalsearch/commit/33593824d993c09ca3530e6fe29d6e4a8770f110)]
46
+ - test: Update Makefile and docker-compose to align it with Jenkinsfile [valentinab25 - [`fcf08e3`](https://github.com/eea/volto-globalsearch/commit/fcf08e34e4cb504bc65233b8cde37dbc5f69efe6)]
47
+ - remove debugger [Zoltan Szabo - [`d8fed25`](https://github.com/eea/volto-globalsearch/commit/d8fed255f24bf3be9d50295906c38b95888baffd)]
48
+ - updated tests [Zoltan Szabo - [`6712800`](https://github.com/eea/volto-globalsearch/commit/6712800eee7cfc9ded4f2eed15ec61f19091eb27)]
49
+ - added new permanent filter, so we can exclude some documents from global search [Zoltan Szabo - [`4a1095b`](https://github.com/eea/volto-globalsearch/commit/4a1095bedc3970ee14728ee1e90b30223e50913e)]
7
50
  ### [1.0.20](https://github.com/eea/volto-globalsearch/compare/1.0.19...1.0.20) - 17 August 2023
8
51
 
9
52
  #### :house: Documentation changes
@@ -34,13 +77,11 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
34
77
 
35
78
  #### :house: Internal changes
36
79
 
37
- - chore: [JENKINS] Deprecate circularity website [valentinab25 - [`ae6efed`](https://github.com/eea/volto-globalsearch/commit/ae6efed386f8fd053972a388a3f8714ff36cf575)]
38
80
 
39
81
  #### :hammer_and_wrench: Others
40
82
 
41
83
  - added missing logo [Zoltan Szabo - [`94684b9`](https://github.com/eea/volto-globalsearch/commit/94684b979698c47de353ecc2a9014a8f70d7ecc1)]
42
84
  - updated frontend with configuration for 'Climate Advisory Board' [Zoltan Szabo - [`28cf22c`](https://github.com/eea/volto-globalsearch/commit/28cf22c93237226c3957223b497a33ab3cb73623)]
43
- - Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`b655d51`](https://github.com/eea/volto-globalsearch/commit/b655d51fa3631ae42c89eb85bdcc850f70d9c72c)]
44
85
  ### [1.0.15](https://github.com/eea/volto-globalsearch/compare/1.0.14...1.0.15) - 14 March 2023
45
86
 
46
87
  #### :hammer_and_wrench: Others
@@ -60,7 +101,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
60
101
  #### :hammer_and_wrench: Others
61
102
 
62
103
  - set the middleware proxy address for globalsearchbase [Zoltan Szabo - [`d0a0802`](https://github.com/eea/volto-globalsearch/commit/d0a08026fa73ce8fd15b666c922e7db71104a5d1)]
63
- - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`b710a4f`](https://github.com/eea/volto-globalsearch/commit/b710a4f73f61e164ecf502a83e7f07d0daf578b3)]
64
104
  ### [1.0.12](https://github.com/eea/volto-globalsearch/compare/1.0.11...1.0.12) - 1 March 2023
65
105
 
66
106
  #### :hammer_and_wrench: Others
@@ -128,14 +168,12 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
128
168
  - Make last 2 years default [Tiberiu Ichim - [`ff765e2`](https://github.com/eea/volto-globalsearch/commit/ff765e24a1d93c60f091aeffa7c3156d8fb98e49)]
129
169
  - Add compact listing, placeholder for now [Tiberiu Ichim - [`3f6104f`](https://github.com/eea/volto-globalsearch/commit/3f6104fb1725f7e3c22736a30629f64e4882242a)]
130
170
  - test(Jenkins): Run tests and cypress with latest canary @plone/volto [Alin Voinea - [`8120264`](https://github.com/eea/volto-globalsearch/commit/812026495c31b272e6ae6415642cf1a6b2f783cf)]
131
- - yarn 3 [Alin Voinea - [`b61ad50`](https://github.com/eea/volto-globalsearch/commit/b61ad5075a79bebfce1044a6cd4978c92d98fbdc)]
132
171
  ### [1.0.1](https://github.com/eea/volto-globalsearch/compare/1.0.0...1.0.1) - 16 November 2022
133
172
 
134
173
  #### :hammer_and_wrench: Others
135
174
 
136
175
  - Fix eslint [Tiberiu Ichim - [`cf2886b`](https://github.com/eea/volto-globalsearch/commit/cf2886b412013f9427cf5d39cdf00004bdd9f80b)]
137
176
  - test(estlint): Fix .project.eslintrc.js [Alin Voinea - [`40c08d2`](https://github.com/eea/volto-globalsearch/commit/40c08d2d4eda81ce306225a81f09e0bcfe6794eb)]
138
- - Add Sonarqube tag using circularity-frontend addons list [EEA Jenkins - [`af6e020`](https://github.com/eea/volto-globalsearch/commit/af6e020794798c1f69fee8c08bdf71fc3992230a)]
139
177
  ## [1.0.0](https://github.com/eea/volto-globalsearch/compare/0.1.7...1.0.0) - 28 October 2022
140
178
 
141
179
  #### :nail_care: Enhancements
@@ -154,7 +192,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
154
192
  #### :hammer_and_wrench: Others
155
193
 
156
194
  - Fix dependencies [kreafox - [`50ad307`](https://github.com/eea/volto-globalsearch/commit/50ad307d64140c43df9dded27c0b532923885764)]
157
- - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`c2d848e`](https://github.com/eea/volto-globalsearch/commit/c2d848e1efa456f53d883c50769882101e1ce19f)]
158
195
  ### [0.1.5](https://github.com/eea/volto-globalsearch/compare/0.1.4...0.1.5) - 28 July 2022
159
196
 
160
197
  #### :hammer_and_wrench: Others
@@ -167,7 +204,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
167
204
 
168
205
  #### :hammer_and_wrench: Others
169
206
 
170
- - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`5dce07b`](https://github.com/eea/volto-globalsearch/commit/5dce07ba7d1e82776a426e9746d5dab1b0acf738)]
171
207
  ### [0.1.3](https://github.com/eea/volto-globalsearch/compare/0.1.2...0.1.3) - 10 June 2022
172
208
 
173
209
  ### [0.1.2](https://github.com/eea/volto-globalsearch/compare/0.1.1...0.1.2) - 10 June 2022
@@ -190,7 +226,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
190
226
  - ignore eslint for *.json files [Zoltan Szabo - [`e18919e`](https://github.com/eea/volto-globalsearch/commit/e18919e1255818c5cf33bf769cca078d75ca3422)]
191
227
  - formatting [Zoltan Szabo - [`18282ed`](https://github.com/eea/volto-globalsearch/commit/18282ed159865bcbc50e2fd17417cf6d90d3e593)]
192
228
  - updated dependencies [Zoltan Szabo - [`cfcf46e`](https://github.com/eea/volto-globalsearch/commit/cfcf46ee33b23bb31f76955c12a857411f042daf)]
193
- - [JENKINSFILE] fix after bootstrap [valentinab25 - [`61c8c46`](https://github.com/eea/volto-globalsearch/commit/61c8c46891edf3b52768f12cf7505c034ef7bb89)]
194
229
  ### 0.0.1 - 19 May 2022
195
230
 
196
231
  #### :hammer_and_wrench: Others
package/DEVELOP.md CHANGED
@@ -16,12 +16,14 @@
16
16
 
17
17
  1. Go to http://localhost:3000
18
18
 
19
- 1. Happy hacking!
19
+ 1. Initialize git hooks
20
20
 
21
21
  ```Bash
22
- cd src/addons/volto-globalsearch/
22
+ yarn prepare
23
23
  ```
24
24
 
25
+ 1. Happy hacking!
26
+
25
27
  ### Or add @eeacms/volto-globalsearch to your Volto project
26
28
 
27
29
  Before starting make sure your development environment is properly set. See [Volto Developer Documentation](https://docs.voltocms.com/getting-started/install/)
@@ -48,18 +50,15 @@ Before starting make sure your development environment is properly set. See [Vol
48
50
 
49
51
  1. Install
50
52
 
51
- yarn develop
53
+ make develop
52
54
  yarn
53
55
 
54
56
  1. Start backend
55
57
 
56
- docker pull plone
57
- docker run -d --name plone -p 8080:8080 -e SITE=Plone -e PROFILES="profile-plone.restapi:blocks" plone
58
+ docker run --pull always -it --rm --name plone -p 8080:8080 -e SITE=Plone plone/plone-backend
58
59
 
59
60
  ...wait for backend to setup and start - `Ready to handle requests`:
60
61
 
61
- docker logs -f plone
62
-
63
62
  ...you can also check http://localhost:8080/Plone
64
63
 
65
64
  1. Start frontend
@@ -71,7 +70,6 @@ Before starting make sure your development environment is properly set. See [Vol
71
70
  1. Happy hacking!
72
71
 
73
72
  cd src/addons/volto-globalsearch/
74
- n-template/
75
73
 
76
74
  ## Cypress
77
75
 
package/README.md CHANGED
@@ -14,9 +14,12 @@
14
14
  [![Bugs](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-globalsearch-develop&metric=bugs)](https://sonarqube.eea.europa.eu/dashboard?id=volto-globalsearch-develop)
15
15
  [![Duplicated Lines (%)](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-globalsearch-develop&metric=duplicated_lines_density)](https://sonarqube.eea.europa.eu/dashboard?id=volto-globalsearch-develop)
16
16
 
17
-
18
17
  EEA Elastic Search Block with NLP integration [Volto](https://github.com/plone/volto) add-on
19
18
 
19
+ ## Features
20
+
21
+ ![Globalsearch](https://raw.githubusercontent.com/eea/volto-globalsearch/master/docs/volto-globalsearch.gif)
22
+
20
23
  ## Demo
21
24
 
22
25
  - https://demo-www.eea.europa.eu/en/advanced-search
@@ -58,7 +61,7 @@ Go to http://localhost:3000
58
61
 
59
62
  ```
60
63
  npm install -g yo @plone/generator-volto
61
- yo @plone/volto my-volto-project --addon @eeacms/volto-globalsearch
64
+ yo @plone/volto my-volto-project --canary --addon @eeacms/volto-globalsearch
62
65
  cd my-volto-project
63
66
  ```
64
67
 
package/RELEASE.md CHANGED
@@ -20,9 +20,9 @@ You need to first install the [release-it](https://github.com/release-it/release
20
20
  ```
21
21
  npm install -g release-it
22
22
  ```
23
-
23
+
24
24
  Release-it uses the configuration written in the [`.release-it.json`](./.release-it.json) file located in the root of the repository.
25
-
25
+
26
26
  Release-it is a tool that automates 4 important steps in the release process:
27
27
 
28
28
  1. Version increase in `package.json` ( increased from the current version in `package.json`)
@@ -30,45 +30,45 @@ Release-it is a tool that automates 4 important steps in the release process:
30
30
  3. GitHub release on the commit with the changelog and package.json modification on the develop branch
31
31
  4. NPM release ( by default it's disabled, but can be enabled in the configuration file )
32
32
 
33
- To configure the authentification, you need to export GITHUB_TOKEN for [GitHub](https://github.com/settings/tokens)
33
+ To configure the authentification, you need to export GITHUB_TOKEN for [GitHub](https://github.com/settings/tokens)
34
34
 
35
35
  ```
36
36
  export GITHUB_TOKEN=XXX-XXXXXXXXXXXXXXXXXXXXXX
37
37
  ```
38
-
38
+
39
39
  To configure npm, you can use the `npm login` command or use a configuration file with a TOKEN :
40
-
40
+
41
41
  ```
42
42
  echo "//registry.npmjs.org/:_authToken=YYYYYYYYYYYYYYYYYYYYYYYYYYYYYY" > .npmrc
43
43
  ```
44
44
 
45
45
  #### Using release-it tool
46
-
46
+
47
47
  There are 3 yarn scripts that can be run to do the release
48
48
 
49
49
  ##### yarn release-beta
50
50
 
51
- Automatically calculates and presents 3 beta versions - patch, minor and major for you to choose ( or Other for manual input).
51
+ Automatically calculates and presents 3 beta versions - patch, minor and major for you to choose ( or Other for manual input).
52
52
 
53
53
  ```
54
- ? Select increment (next version):
55
- ❯ prepatch (0.1.1-beta.0)
56
- preminor (0.2.0-beta.0)
57
- premajor (1.0.0-beta.0)
58
- Other, please specify...
54
+ ? Select increment (next version):
55
+ ❯ prepatch (0.1.1-beta.0)
56
+ preminor (0.2.0-beta.0)
57
+ premajor (1.0.0-beta.0)
58
+ Other, please specify...
59
59
  ```
60
60
 
61
61
  ##### yarn release-major-beta
62
62
 
63
63
  Same as `yarn release-beta`, but with premajor version pre-selected.
64
-
64
+
65
65
  ##### yarn release
66
66
 
67
67
  Generic command, does not automatically add the `beta` to version, but you can still manually write it if you choose Other.
68
68
 
69
69
  #### Important notes
70
70
 
71
- > Do not use release-it tool on master branch, the commit on CHANGELOG.md file and the version increase in the package.json file can't be done without a PULL REQUEST.
71
+ > Do not use release-it tool on master branch, the commit on CHANGELOG.md file and the version increase in the package.json file can't be done without a PULL REQUEST.
72
72
 
73
73
  > Do not keep Pull Requests from develop to master branches open when you are doing beta releases from the develop branch. As long as a PR to master is open, an automatic script will run on every commit and will update both the version and the changelog to a production-ready state - ( MAJOR.MINOR.PATCH mandatory format for version).
74
74
 
package/cypress.config.js CHANGED
@@ -5,9 +5,9 @@ module.exports = defineConfig({
5
5
  defaultCommandTimeout: 8888,
6
6
  chromeWebSecurity: false,
7
7
  reporter: 'junit',
8
- video: true,
8
+ video: false,
9
9
  retries: {
10
- runMode: 8,
10
+ runMode: 2,
11
11
  openMode: 0,
12
12
  },
13
13
  reporterOptions: {
@@ -1,11 +1,12 @@
1
1
  version: "3"
2
2
  services:
3
3
  backend:
4
- image: plone/plone-backend:${PLONE_VERSION:-6}
4
+ image: eeacms/plone-backend
5
5
  ports:
6
6
  - "8080:8080"
7
7
  environment:
8
8
  SITE: "Plone"
9
+ PROFILES: "eea.kitkat:testing"
9
10
 
10
11
  frontend:
11
12
  build:
@@ -23,6 +24,9 @@ services:
23
24
  volumes:
24
25
  - ./:/app/src/addons/${ADDON_PATH}
25
26
  environment:
27
+ CI: "true"
28
+ NODE_ENV: "development"
29
+ RAZZLE_JEST_CONFIG: "src/addons/${ADDON_PATH}/jest-addon.config.js"
26
30
  RAZZLE_INTERNAL_API_PATH: "http://backend:8080/Plone"
27
31
  RAZZLE_DEV_PROXY_API_PATH: "http://backend:8080/Plone"
28
32
  HOST: "0.0.0.0"
@@ -0,0 +1,14 @@
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: \n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: \n"
6
+ "PO-Revision-Date: \n"
7
+ "Last-Translator: \n"
8
+ "Language: \n"
9
+ "Language-Team: \n"
10
+ "Content-Type: \n"
11
+ "Content-Transfer-Encoding: \n"
12
+ "Plural-Forms: \n"
13
+
14
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-globalsearch",
3
- "version": "1.0.20",
3
+ "version": "1.0.22",
4
4
  "description": "@eeacms/volto-globalsearch: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -28,8 +28,31 @@
28
28
  "@cypress/code-coverage": "^3.10.0",
29
29
  "@plone/scripts": "*",
30
30
  "babel-plugin-transform-class-properties": "^6.24.1",
31
+ "husky": "^8.0.3",
32
+ "lint-staged": "^14.0.1",
31
33
  "md5": "^2.3.0"
32
34
  },
35
+ "lint-staged": {
36
+ "src/**/*.{js,jsx,ts,tsx,json}": [
37
+ "make lint-fix",
38
+ "make prettier-fix"
39
+ ],
40
+ "src/**/*.{jsx}": [
41
+ "make i18n"
42
+ ],
43
+ "theme/**/*.{css,less}": [
44
+ "make stylelint-fix"
45
+ ],
46
+ "src/**/*.{css,less}": [
47
+ "make stylelint-fix"
48
+ ],
49
+ "theme/**/*.overrides": [
50
+ "make stylelint-fix"
51
+ ],
52
+ "src/**/*.overrides": [
53
+ "make stylelint-fix"
54
+ ]
55
+ },
33
56
  "scripts": {
34
57
  "release": "release-it",
35
58
  "release-major-beta": "release-it major --preRelease=beta",
@@ -47,6 +70,7 @@
47
70
  "lint:fix": "make lint-fix",
48
71
  "i18n": "make i18n",
49
72
  "cypress:run": "make cypress-run",
50
- "cypress:open": "make cypress-open"
73
+ "cypress:open": "make cypress-open",
74
+ "prepare": "husky install"
51
75
  }
52
76
  }
@@ -223,7 +223,7 @@ const facets = [
223
223
  { from: 0, to: 4.99999, key: 'Short (<5 minutes)' },
224
224
  { from: 5, to: 24.9999, key: 'Medium (5-25 minutes)' },
225
225
  { from: 25, to: 10000, key: 'Large (25+ minutes)' },
226
- // { to: -0.0001, key: 'Unknown' },
226
+ { to: -0.0001, key: 'Not applicable' },
227
227
  ],
228
228
  // factory: 'ModalFixedRangeFacet',
229
229
  default: {
@@ -1,30 +1,34 @@
1
1
  import { getTodayWithTime } from '../utils';
2
-
3
- export default {
4
- // filter values that are always added to the ES requests
5
- permanentFilters: [
6
- { term: { hasWorkflowState: 'published' } },
7
- () => ({
8
- constant_score: {
9
- filter: {
10
- bool: {
11
- should: [
12
- {
13
- bool: {
14
- must_not: {
15
- exists: {
16
- field: 'issued',
17
- },
2
+ function constantScore() {
3
+ return {
4
+ constant_score: {
5
+ filter: {
6
+ bool: {
7
+ should: [
8
+ {
9
+ bool: {
10
+ must_not: {
11
+ exists: {
12
+ field: 'issued',
18
13
  },
19
14
  },
20
15
  },
21
- {
22
- range: { 'issued.date': { lte: getTodayWithTime() } },
23
- },
24
- ],
25
- },
16
+ },
17
+ {
18
+ range: { 'issued.date': { lte: getTodayWithTime() } },
19
+ },
20
+ ],
26
21
  },
27
22
  },
28
- }),
23
+ },
24
+ };
25
+ }
26
+ constantScore.id = 'constantScore';
27
+
28
+ export default {
29
+ // filter values that are always added to the ES requests
30
+ permanentFilters: [
31
+ { term: { hasWorkflowState: 'published' } },
32
+ constantScore,
29
33
  ],
30
34
  };
@@ -9,4 +9,24 @@ globalSearchConfig.facets = globalSearchConfig.facets.filter(
9
9
  (facet) => facet['field'] !== 'subject.keyword',
10
10
  );
11
11
 
12
+ // customize permanent filters
13
+ const index = globalSearchConfig.permanentFilters.findIndex(
14
+ (f) => f.id === 'constantScore',
15
+ );
16
+ const baseConstantScore = globalSearchConfig.permanentFilters[index];
17
+
18
+ function updatedConstantScore() {
19
+ const base = baseConstantScore();
20
+ base.constant_score.filter.bool.must_not = {
21
+ exists: {
22
+ field: 'exclude_from_globalsearch',
23
+ },
24
+ };
25
+ return base;
26
+ }
27
+
28
+ updatedConstantScore.id = 'constantScore';
29
+
30
+ globalSearchConfig.permanentFilters[index] = updatedConstantScore;
31
+
12
32
  export default globalSearchConfig;