From 717548dcfe252182453071a8c156da82a1f860b2 Mon Sep 17 00:00:00 2001 From: Aga Domanska Date: Tue, 3 Jan 2023 14:54:34 +0000 Subject: [PATCH 01/14] add filter to public journal search --- .../static/js/edges/public.journal.edge.js | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/portality/static/js/edges/public.journal.edge.js b/portality/static/js/edges/public.journal.edge.js index e661e2caf4..574210a6f5 100644 --- a/portality/static/js/edges/public.journal.edge.js +++ b/portality/static/js/edges/public.journal.edge.js @@ -98,6 +98,16 @@ $.extend(true, doaj, { value: false }) ] + }, + { + id : "retains_copyrigths", + display: "Where author holds copyright without restrictions", + must : [ + es.newTermFilter({ + field: "bibjson.copyright.author_retains", + value: true + }) + ] } ], renderer : doaj.renderers.newFacetFilterSetterRenderer({ @@ -203,6 +213,23 @@ $.extend(true, doaj, { }) }), + // edges.newORTermSelector({ + // id: "copyright", + // category: "facet", + // field: "bibjson.copyright.author_retains.exact", + // display: "Author retains copyright", + // size: 99, + // syncCounts: false, + // lifecycle: "update", + // updateType: "fresh", + // renderer : doaj.renderers.newORTermSelectorRenderer({ + // showCount: true, + // hideEmpty: false, + // open: false, + // togglable: true + // }) + // }), + edges.newDateHistogramSelector({ id : "year_added", category: "facet", @@ -288,6 +315,7 @@ $.extend(true, doaj, { "index.country.exact" : "Publishers' countries", "index.language.exact" : "Languages", "bibjson.editorial.review_process.exact" : "Peer review", + "bibjson.copyright.author_retains" : "Author retains copyrights", "created_date" : "Date added" }, rangeFunctions : { @@ -298,7 +326,8 @@ $.extend(true, doaj, { }, renderer : doaj.renderers.newSelectedFiltersRenderer({ hideValues : [ - "index.has_seal.exact" + "index.has_seal.exact", + "bibjson.copyright.author_retains" ], omit : [ "bibjson.apc.has_apc", From 900c2264e24fb028d46ead8ee16bac4e18b55cf2 Mon Sep 17 00:00:00 2001 From: Aga Domanska Date: Wed, 4 Jan 2023 11:54:45 +0000 Subject: [PATCH 02/14] modify functional test for public search to include filters --- doajtest/testbook/public_site/public_search.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doajtest/testbook/public_site/public_search.yml b/doajtest/testbook/public_site/public_search.yml index 2a3e545af4..abdde6a615 100644 --- a/doajtest/testbook/public_site/public_search.yml +++ b/doajtest/testbook/public_site/public_search.yml @@ -14,6 +14,13 @@ tests: results: - The number of journals on the page increases and decreases and the number of pages changes + - step: Choose filters on the left (one or more at the time) + results: + - Search results adjust accordingly + - The number of search results changes. You can still select values from other + facets and filters + - The filters you have selected appear as black lozenges at the top of the search + results - step: Open and Collapse all the facets on the left results: - The facet opens and closes as expected From 1b0c7eb6b617d9e2f18818b42ca74829cee16372 Mon Sep 17 00:00:00 2001 From: Aga Domanska Date: Fri, 6 Jan 2023 10:11:51 +0000 Subject: [PATCH 03/14] remove commented out code --- .../static/js/edges/public.journal.edge.js | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/portality/static/js/edges/public.journal.edge.js b/portality/static/js/edges/public.journal.edge.js index 574210a6f5..82356e1e7a 100644 --- a/portality/static/js/edges/public.journal.edge.js +++ b/portality/static/js/edges/public.journal.edge.js @@ -213,23 +213,6 @@ $.extend(true, doaj, { }) }), - // edges.newORTermSelector({ - // id: "copyright", - // category: "facet", - // field: "bibjson.copyright.author_retains.exact", - // display: "Author retains copyright", - // size: 99, - // syncCounts: false, - // lifecycle: "update", - // updateType: "fresh", - // renderer : doaj.renderers.newORTermSelectorRenderer({ - // showCount: true, - // hideEmpty: false, - // open: false, - // togglable: true - // }) - // }), - edges.newDateHistogramSelector({ id : "year_added", category: "facet", From 0ca01faaf47f39d1029a46e0da19a8bced0275f9 Mon Sep 17 00:00:00 2001 From: Aga Domanska Date: Mon, 9 Jan 2023 11:32:43 +0000 Subject: [PATCH 04/14] make sure data-attr is interpreted correctly when reading the filter --- portality/static/js/doaj.fieldrender.edges.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/portality/static/js/doaj.fieldrender.edges.js b/portality/static/js/doaj.fieldrender.edges.js index 7a1a016a19..5b32686d8a 100644 --- a/portality/static/js/doaj.fieldrender.edges.js +++ b/portality/static/js/doaj.fieldrender.edges.js @@ -2320,7 +2320,8 @@ $.extend(true, doaj, { var value = false; if (ft === "terms" || ft === "term") { - value = el.attr("data-value"); + val = el.attr("data-value"); + value = val == "true" ? true : (val == "false" ? false : val); } else if (ft === "range") { value = {}; From d61a9230422a4a53e0a5716522749c60f8099d96 Mon Sep 17 00:00:00 2001 From: Aga Domanska Date: Mon, 9 Jan 2023 11:38:06 +0000 Subject: [PATCH 05/14] add comment --- portality/static/js/doaj.fieldrender.edges.js | 1 + 1 file changed, 1 insertion(+) diff --git a/portality/static/js/doaj.fieldrender.edges.js b/portality/static/js/doaj.fieldrender.edges.js index 5b32686d8a..f1fd7027c2 100644 --- a/portality/static/js/doaj.fieldrender.edges.js +++ b/portality/static/js/doaj.fieldrender.edges.js @@ -2321,6 +2321,7 @@ $.extend(true, doaj, { var value = false; if (ft === "terms" || ft === "term") { val = el.attr("data-value"); + // change to bool if "true" or "false", leave as string otherwise value = val == "true" ? true : (val == "false" ? false : val); } else if (ft === "range") { value = {}; From 9abc34c4e9605b7a1f433989f24d440af08bd495 Mon Sep 17 00:00:00 2001 From: Aga Domanska Date: Fri, 27 Jan 2023 13:32:09 +0000 Subject: [PATCH 06/14] remove int filter correctly --- portality/static/js/doaj.fieldrender.edges.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/portality/static/js/doaj.fieldrender.edges.js b/portality/static/js/doaj.fieldrender.edges.js index f1fd7027c2..b974630106 100644 --- a/portality/static/js/doaj.fieldrender.edges.js +++ b/portality/static/js/doaj.fieldrender.edges.js @@ -2322,7 +2322,18 @@ $.extend(true, doaj, { if (ft === "terms" || ft === "term") { val = el.attr("data-value"); // change to bool if "true" or "false", leave as string otherwise - value = val == "true" ? true : (val == "false" ? false : val); + if (val === "true"){ + value = true; + } + else if (val === "false"){ + value = false; + } + else if (!isNaN(parseInt(val))){ + value = parseInt(val); + } + else { + value = val; + } } else if (ft === "range") { value = {}; From b3dd3dbab0c25eb8e732a9e8221492f1f47d4c71 Mon Sep 17 00:00:00 2001 From: Aga Domanska Date: Tue, 14 Feb 2023 15:07:34 +0000 Subject: [PATCH 07/14] change wording --- portality/static/js/edges/public.journal.edge.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/portality/static/js/edges/public.journal.edge.js b/portality/static/js/edges/public.journal.edge.js index 82356e1e7a..ce52f5ee0a 100644 --- a/portality/static/js/edges/public.journal.edge.js +++ b/portality/static/js/edges/public.journal.edge.js @@ -101,7 +101,7 @@ $.extend(true, doaj, { }, { id : "retains_copyrigths", - display: "Where author holds copyright without restrictions", + display: "Author retains all rights", must : [ es.newTermFilter({ field: "bibjson.copyright.author_retains", From 6b46377dcf7d2413b423b9aa85688b68c99ce372 Mon Sep 17 00:00:00 2001 From: Aga Domanska Date: Mon, 27 Feb 2023 10:07:40 +0000 Subject: [PATCH 08/14] text change for consistency --- portality/static/js/edges/public.journal.edge.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/portality/static/js/edges/public.journal.edge.js b/portality/static/js/edges/public.journal.edge.js index ce52f5ee0a..a258001a93 100644 --- a/portality/static/js/edges/public.journal.edge.js +++ b/portality/static/js/edges/public.journal.edge.js @@ -298,7 +298,7 @@ $.extend(true, doaj, { "index.country.exact" : "Publishers' countries", "index.language.exact" : "Languages", "bibjson.editorial.review_process.exact" : "Peer review", - "bibjson.copyright.author_retains" : "Author retains copyrights", + "bibjson.copyright.author_retains" : "Author retains all rights", "created_date" : "Date added" }, rangeFunctions : { From f182977f9163125af584461cc17cf814177ea63b Mon Sep 17 00:00:00 2001 From: Aga Domanska Date: Mon, 27 Feb 2023 11:25:10 +0000 Subject: [PATCH 09/14] comment change --- portality/static/js/doaj.fieldrender.edges.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/portality/static/js/doaj.fieldrender.edges.js b/portality/static/js/doaj.fieldrender.edges.js index 400ad10bd2..b2016e66db 100644 --- a/portality/static/js/doaj.fieldrender.edges.js +++ b/portality/static/js/doaj.fieldrender.edges.js @@ -2321,7 +2321,7 @@ $.extend(true, doaj, { var value = false; if (ft === "terms" || ft === "term") { val = el.attr("data-value"); - // change to bool if "true" or "false", leave as string otherwise + // translate string value to a type required by a model if (val === "true"){ value = true; } From d5ca856a72a69117029d6478592f924c3dee706d Mon Sep 17 00:00:00 2001 From: Aga Domanska Date: Mon, 27 Feb 2023 12:50:47 +0000 Subject: [PATCH 10/14] add info about the rights retainment to the public result field --- portality/static/js/doaj.fieldrender.edges.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/portality/static/js/doaj.fieldrender.edges.js b/portality/static/js/doaj.fieldrender.edges.js index b2016e66db..1cb65ef962 100644 --- a/portality/static/js/doaj.fieldrender.edges.js +++ b/portality/static/js/doaj.fieldrender.edges.js @@ -2615,6 +2615,15 @@ $.extend(true, doaj, { } apcs += ''; + var rights = ""; + if (resultobj.bibjson.copyright) { + var copyright_url = resultobj.bibjson.copyright.url; + rights += ''; + rights += resultobj.bibjson.copyright.author_retains ? 'Author retains all rights' : 'Author doesn\'t retain all rights'; + rights += ''; + } + + var licenses = ""; if (resultobj.bibjson.license && resultobj.bibjson.license.length > 0) { var terms_url = resultobj.bibjson.ref.license_terms; @@ -2717,6 +2726,9 @@ $.extend(true, doaj, {
  • \ ' + apcs + '\
  • \ +
  • \ + ' + rights + '\ +
  • \
  • \ ' + licenses + '\
  • \ From 9dc463c0ae6d6a58f46801769404afa6d8a8b941 Mon Sep 17 00:00:00 2001 From: Steven Eardley Date: Tue, 28 Feb 2023 11:56:10 +0000 Subject: [PATCH 11/14] Add .circleci/config.yml --- .circleci/config.yml | 49 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000000..ff221159cd --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,49 @@ +# Use the latest 2.1 version of CircleCI pipeline process engine. +# See: https://circleci.com/docs/2.0/configuration-reference +version: 2.1 + +# Orbs are reusable packages of CircleCI configuration that you may share across projects, enabling you to create encapsulated, parameterized commands, jobs, and executors that can be used across multiple projects. +# See: https://circleci.com/docs/2.0/orb-intro/ +orbs: + # The python orb contains a set of prepackaged CircleCI configuration you can use repeatedly in your configuration files + # Orb commands and jobs help you with common scripting around a language/tool + # so you dont have to copy and paste it everywhere. + # See the orb documentation here: https://circleci.com/developer/orbs/orb/circleci/python + python: circleci/python@2.1.1 + +# Define a job to be invoked later in a workflow. +# See: https://circleci.com/docs/2.0/configuration-reference/#jobs +jobs: + build-and-test: # This is the name of the job, feel free to change it to better match what you're trying to do! + # These next lines defines a Docker executors: https://circleci.com/docs/2.0/executor-types/ + # You can specify an image from Dockerhub or use one of the convenience images from CircleCI's Developer Hub + # A list of available CircleCI Docker convenience images are available here: https://circleci.com/developer/images/image/cimg/python + # The executor is the environment in which the steps below will be executed - below will use a python 3.10.2 container + # Change the version below to your required version of python + docker: + - image: elasticsearch:7.10.1 + - image: cimg/python:3.8.10 + # Checkout the code as the first step. This is a dedicated CircleCI step. + # The python orb's install-packages step will install the dependencies from a Pipfile via Pipenv by default. + # Here we're making sure we use just use the system-wide pip. By default it uses the project root's requirements.txt. + # Then run your tests! + # CircleCI will report the results back to your VCS provider. + executor: python/default + steps: + - checkout + - python/install-packages: + pkg-manager: pip + args: test + - run: | + python portality/cms/build_fragments.py + python portality/cms/build_sass.py + echo "ELASTIC_SEARCH_HOST = \"http://localhost:9200\"" > dev.cfg + pytest -v --color=yes --code-highlight=yes --log-level=DEBUG doajtest/unit + +# Invoke jobs via workflows +# See: https://circleci.com/docs/2.0/configuration-reference/#workflows +workflows: + sample: # This is the name of the workflow, feel free to change it to better match your workflow. + # Inside the workflow, you define the jobs you want to run. + jobs: + - build-and-test From 31dc1b9a3a5e81dadbe58a97ef9cde72fd91f4b3 Mon Sep 17 00:00:00 2001 From: Steven Eardley Date: Tue, 28 Feb 2023 12:00:07 +0000 Subject: [PATCH 12/14] Add .circleci/config.yml --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ff221159cd..17a126e90e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -28,7 +28,7 @@ jobs: # Here we're making sure we use just use the system-wide pip. By default it uses the project root's requirements.txt. # Then run your tests! # CircleCI will report the results back to your VCS provider. - executor: python/default + #executor: python/default steps: - checkout - python/install-packages: @@ -46,4 +46,4 @@ workflows: sample: # This is the name of the workflow, feel free to change it to better match your workflow. # Inside the workflow, you define the jobs you want to run. jobs: - - build-and-test + - build-and-test \ No newline at end of file From cd6a8afeea1f2c5bfe32e3c65cf2d02d6c03003c Mon Sep 17 00:00:00 2001 From: Steve Eardley Date: Tue, 28 Feb 2023 12:08:49 +0000 Subject: [PATCH 13/14] CircleCI configuration file for DOAJ --- .circleci/config.yml | 45 ++++++++++++++------------------------------ .python-version | 2 +- setup.py | 2 +- 3 files changed, 16 insertions(+), 33 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 17a126e90e..01386dc2f3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,49 +1,32 @@ -# Use the latest 2.1 version of CircleCI pipeline process engine. -# See: https://circleci.com/docs/2.0/configuration-reference version: 2.1 - -# Orbs are reusable packages of CircleCI configuration that you may share across projects, enabling you to create encapsulated, parameterized commands, jobs, and executors that can be used across multiple projects. -# See: https://circleci.com/docs/2.0/orb-intro/ orbs: - # The python orb contains a set of prepackaged CircleCI configuration you can use repeatedly in your configuration files - # Orb commands and jobs help you with common scripting around a language/tool - # so you dont have to copy and paste it everywhere. - # See the orb documentation here: https://circleci.com/developer/orbs/orb/circleci/python python: circleci/python@2.1.1 -# Define a job to be invoked later in a workflow. -# See: https://circleci.com/docs/2.0/configuration-reference/#jobs jobs: - build-and-test: # This is the name of the job, feel free to change it to better match what you're trying to do! - # These next lines defines a Docker executors: https://circleci.com/docs/2.0/executor-types/ - # You can specify an image from Dockerhub or use one of the convenience images from CircleCI's Developer Hub - # A list of available CircleCI Docker convenience images are available here: https://circleci.com/developer/images/image/cimg/python - # The executor is the environment in which the steps below will be executed - below will use a python 3.10.2 container - # Change the version below to your required version of python + build-and-test: docker: - - image: elasticsearch:7.10.1 - image: cimg/python:3.8.10 - # Checkout the code as the first step. This is a dedicated CircleCI step. - # The python orb's install-packages step will install the dependencies from a Pipfile via Pipenv by default. - # Here we're making sure we use just use the system-wide pip. By default it uses the project root's requirements.txt. - # Then run your tests! - # CircleCI will report the results back to your VCS provider. - #executor: python/default + environment: + DOAJENV: test + - image: elasticsearch:7.10.1 + environment: + - xpack.security.enabled: false + - transport.host: localhost + - discovery.type: single-node steps: - checkout + - run: git submodule update --init --recursive - python/install-packages: - pkg-manager: pip - args: test + pkg-manager: pip-dist + pip-dependency-file: setup.py + path-args: .[test] - run: | + echo "ELASTICSEARCH_HOSTS = [{'host': 'localhost', 'port': 9200}]" > test.cfg python portality/cms/build_fragments.py python portality/cms/build_sass.py - echo "ELASTIC_SEARCH_HOST = \"http://localhost:9200\"" > dev.cfg pytest -v --color=yes --code-highlight=yes --log-level=DEBUG doajtest/unit -# Invoke jobs via workflows -# See: https://circleci.com/docs/2.0/configuration-reference/#workflows workflows: - sample: # This is the name of the workflow, feel free to change it to better match your workflow. - # Inside the workflow, you define the jobs you want to run. + unit_tests: jobs: - build-and-test \ No newline at end of file diff --git a/.python-version b/.python-version index 548d71365f..8137a6c16c 100644 --- a/.python-version +++ b/.python-version @@ -1 +1 @@ -3.7 \ No newline at end of file +3.8.10 \ No newline at end of file diff --git a/setup.py b/setup.py index f84c3813d3..d38c6f6e5d 100644 --- a/setup.py +++ b/setup.py @@ -55,7 +55,7 @@ "flask-swagger @ git+https://github.com/DOAJ/flask-swagger.git@f1dbf918d9903a588eed3cce2a87eeccc9f8cc0e#egg=flask-swagger" ] + (["setproctitle==1.1.10"] if "linux" in sys.platform else []), extras_require={ - "test": ["pytest", "pytest-cov", "pytest-xdist", "selenium", + "test": ["pytest", "pytest-cov", "pytest-xdist", "selenium==3.141", # prevent backtracking through all versions "combinatrix @ git+https://github.com/CottageLabs/combinatrix.git@740d255f0050d53a20324df41c08981499bb292c#egg=combinatrix"], "docs": [ "featuremap @ git+https://github.com/CottageLabs/FeatureMap.git@cb52c345b942e50726767b1a7190f1a01b81e722#egg=featuremap", From ac850e8a6fe1148c39a952202c497c624d96898c Mon Sep 17 00:00:00 2001 From: Steve Eardley Date: Tue, 7 Mar 2023 09:42:36 +0000 Subject: [PATCH 14/14] version bump for live JS changes --- portality/settings.py | 4 ++-- setup.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/portality/settings.py b/portality/settings.py index eb2066d2a6..b386d97b8e 100644 --- a/portality/settings.py +++ b/portality/settings.py @@ -9,7 +9,7 @@ # Application Version information # ~~->API:Feature~~ -DOAJ_VERSION = "6.2.18" +DOAJ_VERSION = "6.2.19" API_VERSION = "3.0.1" ###################################### @@ -1371,4 +1371,4 @@ ## Public data dump settings # how long should the temporary URL for public data dumps last -PUBLIC_DATA_DUMP_URL_TIMEOUT = 3600 \ No newline at end of file +PUBLIC_DATA_DUMP_URL_TIMEOUT = 3600 diff --git a/setup.py b/setup.py index d38c6f6e5d..bbce71129c 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setup( name='doaj', - version='6.2.18', + version='6.2.19', packages=find_packages(), install_requires=[ "awscli==1.20.50",