From 66374c626ab72723a079f853e3a01d176afa5a6e Mon Sep 17 00:00:00 2001 From: njkim Date: Thu, 1 Feb 2024 11:17:48 -0800 Subject: [PATCH 01/10] Add a generic etl celery task --- arches/app/tasks.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/arches/app/tasks.py b/arches/app/tasks.py index d4035ba1604..66ef907d8fe 100644 --- a/arches/app/tasks.py +++ b/arches/app/tasks.py @@ -351,6 +351,41 @@ def bulk_data_deletion(userid, load_id, graph_id, nodegroup_id, resourceids): user = User.objects.get(id=userid) notify_completion(msg, user) + +@shared_task +def run_etl_task(**kwargs): + """ + this allows the user to run the custom etl module + import_module, import_class, loadid, userid are the required string parameter + importer_name can be added (not required) for messaging purpose + """ + + logger = logging.getLogger(__name__) + + import_module = kwargs.pop("import_module") + import_class = kwargs.pop("import_class") + importer_name = kwargs.pop("importer_name", import_class) + loadid = kwargs.get("loadid") + userid = kwargs.get("userid") + + try: + import_class = vars(__import__(import_module, globals(), locals(), [import_class]))[import_class] + import_class().run_load_task(**kwargs) + + load_event = models.LoadEvent.objects.get(loadid=loadid) + status = _("Completed") if load_event.status == "indexed" else _("Failed") + except Exception as e: + logger.error(e) + load_event = models.LoadEvent.objects.get(loadid=loadid) + load_event.status = "failed" + load_event.save() + status = _("Failed") + finally: + msg = _("{}: {}").format(importer_name, status) + user = User.objects.get(id=userid) + notify_completion(msg, user) + + @shared_task def reverse_etl_load(loadid): from arches.app.etl_modules import base_import_module From de277962e65555c7312b816c91adcb9c7dd4940b Mon Sep 17 00:00:00 2001 From: njkim Date: Fri, 2 Feb 2024 11:27:20 -0800 Subject: [PATCH 02/10] Add generic task to run any function, #10573 --- arches/app/tasks.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/arches/app/tasks.py b/arches/app/tasks.py index 66ef907d8fe..b16109dbb30 100644 --- a/arches/app/tasks.py +++ b/arches/app/tasks.py @@ -1,3 +1,4 @@ +import importlib import os import logging import shutil @@ -352,6 +353,19 @@ def bulk_data_deletion(userid, load_id, graph_id, nodegroup_id, resourceids): notify_completion(msg, user) +@shared_task +def run_task(module_name=None, class_name=None, method_to_run=None, **kwargs): + """ + this allows the user to run any method as a celery task + module_name, class_name, and method_to_run are required + pass any additional arguments to the method via the kwargs parameter + """ + + theClass = getattr(importlib.import_module(module_name), class_name) + theMethod = getattr(theClass(), method_to_run) + theMethod(**kwargs) + + @shared_task def run_etl_task(**kwargs): """ @@ -369,8 +383,7 @@ def run_etl_task(**kwargs): userid = kwargs.get("userid") try: - import_class = vars(__import__(import_module, globals(), locals(), [import_class]))[import_class] - import_class().run_load_task(**kwargs) + run_task(module_name=import_module, class_name=import_class, method_to_run="run_load_task", **kwargs) load_event = models.LoadEvent.objects.get(loadid=loadid) status = _("Completed") if load_event.status == "indexed" else _("Failed") From 55f0ddfcee2c483411b08366946f41a7d0d069ba Mon Sep 17 00:00:00 2001 From: Johnathan Clementi Date: Mon, 12 Feb 2024 16:33:41 -0500 Subject: [PATCH 03/10] prevent long titles from being hidden #10605 --- arches/app/media/css/arches.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arches/app/media/css/arches.scss b/arches/app/media/css/arches.scss index 496926d8018..e99ce20705c 100644 --- a/arches/app/media/css/arches.scss +++ b/arches/app/media/css/arches.scss @@ -5581,12 +5581,12 @@ div.card-grid-item.selected { width: 100%; height: 50px; overflow: hidden; + display: flex; } .ep-graph-title { font-size: 1.6rem; padding: 5px; - flex-wrap: wrap; align-items: center; } From b8188c3d7a20610e3f1455cc5ae161481a4f8295 Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Tue, 13 Feb 2024 08:31:44 -0500 Subject: [PATCH 04/10] Avoid logging exceptions for tiles holding only None Refs 4b02d35 --- arches/app/datatypes/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arches/app/datatypes/base.py b/arches/app/datatypes/base.py index 23425368f03..99de186407e 100644 --- a/arches/app/datatypes/base.py +++ b/arches/app/datatypes/base.py @@ -200,7 +200,7 @@ def get_tile_data(self, tile): logger.warning(_("Multiple provisional edits. Returning first edit")) userid = list(provisionaledits.keys())[0] return provisionaledits[userid]["value"] - else: + elif not data: logger.exception(_("Tile has no authoritative or provisional data")) From 39adac3bb512a992eefadec7dbbb98fe3405f159 Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Tue, 13 Feb 2024 08:31:55 -0500 Subject: [PATCH 05/10] Remove duplicative release note This change was made in 7.5.0 --- releases/7.5.1.md | 1 - 1 file changed, 1 deletion(-) diff --git a/releases/7.5.1.md b/releases/7.5.1.md index 7d7b4870bde..44fd8d0593b 100644 --- a/releases/7.5.1.md +++ b/releases/7.5.1.md @@ -15,7 +15,6 @@ Arches 7.5.1 Release Notes - Surface card help panel in main file widget area #10477 - z-index issue: When Adding Geometry, The Edit toolbar is still visible when opening the Help Option #10432 - Handle empty node values in map report #10473 -- Observe nodegroup permissions in tile excel export #10441 ### Dependency changes: From ed58c839723d13d25d8e57ddfc64eabd831fce48 Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Thu, 15 Feb 2024 08:46:14 -0500 Subject: [PATCH 06/10] Update 7.5 breaking changes with `` element. ### Upgrading Arches From 8559cd900f9745d1c2bcaa42a11403d04565bcb1 Mon Sep 17 00:00:00 2001 From: Johnathan Clementi Date: Thu, 15 Feb 2024 14:37:15 -0500 Subject: [PATCH 07/10] Add clarifying comment about aria-labels #10611 --- releases/7.5.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/releases/7.5.0.md b/releases/7.5.0.md index 0d104b57031..4b5bfcf87be 100644 --- a/releases/7.5.0.md +++ b/releases/7.5.0.md @@ -154,7 +154,7 @@ JavaScript: - The iiif_manifest table now has a globalid column (uuid). Imports to this table will need a uuid value for this field. - Descriptors will not always be calculated and saved on index. Custom import scripts will need to call `resource.save_descriptors()` before `resource.index()` to ensure descriptors are updated. - The `calculate_descriptors` method on the Resource proxy model has been renamed `save_descriptors`. Custom import scripts may need to reflect this change. -- The `select2-query` knockout binding now uses the `selectWoo` JS library in order to provide better accessibility than `select2`. As of this change, any HTML element with a binding like `data-bind="select2Query: { ... }"` must be a `` element. These elements should also have an aria-label, however the normal `aria-label` attribute will not work. To do this, use `attr: {'data-label': ...}` in the binding. ### Upgrading Arches From 604032f6264ed7398cf3ec9231cf52f12b30958f Mon Sep 17 00:00:00 2001 From: Alexei Peters Date: Fri, 1 Mar 2024 16:51:31 -0800 Subject: [PATCH 08/10] fix bug with creating json-ld with url datatypes, re #9190 --- arches/app/datatypes/url.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arches/app/datatypes/url.py b/arches/app/datatypes/url.py index c543be22a12..2646da1a294 100644 --- a/arches/app/datatypes/url.py +++ b/arches/app/datatypes/url.py @@ -172,7 +172,9 @@ def append_search_filters(self, value, node, query, request): pass def get_rdf_uri(self, node, data, which="r"): - return URIRef(data["url"]) + if data and "url" in data: + return URIRef(data["url"]) + return None def accepts_rdf_uri(self, uri): return self.URL_REGEX.match(uri) and not ( From 8713edf28b5ad8ac97e3af208e2465adc6025a74 Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Mon, 4 Mar 2024 09:39:02 -0500 Subject: [PATCH 09/10] Bump Django to 4.2.11 --- arches/install/requirements.txt | 2 +- releases/7.5.2.md | 58 +++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 releases/7.5.2.md diff --git a/arches/install/requirements.txt b/arches/install/requirements.txt index 150043e7a36..6529464593d 100644 --- a/arches/install/requirements.txt +++ b/arches/install/requirements.txt @@ -1,4 +1,4 @@ -Django==4.2.10 +Django==4.2.11 psycopg2==2.9.9 urllib3<2 elasticsearch>=8.3.1,<9.0.0 diff --git a/releases/7.5.2.md b/releases/7.5.2.md new file mode 100644 index 00000000000..9eaeda0f2d9 --- /dev/null +++ b/releases/7.5.2.md @@ -0,0 +1,58 @@ +Arches 7.5.2 Release Notes +-------------------------- + +### Bug Fixes and Enhancements + + +### Dependency changes: +``` +Python: + Upgraded: + Django 4.2.10 > 4.2.11 +``` + +### Upgrading Arches + +1. Upgrade to version 7.5.0 before proceeding. If upgrading from an earlier version, refer to the upgrade process in the [Version 7.5.0 release notes](https://github.com/archesproject/arches/blob/dev/7.5.x/releases/7.5.0.md) + +2. Upgrade to Arches 7.5.2 + ``` + pip install --upgrade arches==7.5.2 + ``` + +3. Update the JavaScript dependencies and devDependencies: + In the project's `package.json` file change arches from `stable/7.5.0` to `stable/7.5.2`: + ``` + "dependencies": { + "arches": "archesproject/arches#stable/7.5.2", + }, + "devDependencies": { + "arches-dev-dependencies": "archesproject/arches-dev-dependencies#stable/7.5.2" + } + ``` + In in your terminal navigate to the directory with your project's package.json file. Then run: + + yarn install + + +4. Start your application server in a separate terminal if it's not already running. Your webpack build will not complete without your application server running. + +5. In a different terminal navigate to the directory with your project's package.json file, run `yarn start` or `yarn build_development`. This will generate your `media/build` directory. + - If running your project in development: + - `yarn start` will build the frontend of the application and then start a webpack development server + - `yarn build_development` will build a development bundle for the frontend assests of the application -- this should complete in less than 2 minutes + - If running your project in production: + - `yarn build_production` This builds a production bundle. **takes up to 2hrs depending on resources** + - Alternatively you can `cd ..` up a directory and run `python manage.py build_production`. This will create a production bundle of frontend assessts and also call `collectstatic`. + + +6. If you are running Arches on Apache, be sure to run: + + ``` + collectstatic + ``` + and restart your server: + ``` + sudo service apache2 reload + ``` + From abd8de9adcd9d29649597de17ef43e33c7daa999 Mon Sep 17 00:00:00 2001 From: Alexei Peters Date: Fri, 8 Mar 2024 13:33:27 -0800 Subject: [PATCH 10/10] fix node sortoder on graph import, re #10668 --- arches/app/models/graph.py | 1 + 1 file changed, 1 insertion(+) diff --git a/arches/app/models/graph.py b/arches/app/models/graph.py index 8cf46b8c988..919fbc9c8bf 100644 --- a/arches/app/models/graph.py +++ b/arches/app/models/graph.py @@ -299,6 +299,7 @@ def add_node(self, node, nodegroups=None): node.issearchable = nodeobj.get("issearchable", True) node.isrequired = nodeobj.get("isrequired", False) node.exportable = nodeobj.get("exportable", False) + node.sortorder = nodeobj.get("sortorder", 0) node.fieldname = nodeobj.get("fieldname", "") node.hascustomalias = nodeobj.get("hascustomalias", False) node.sourcebranchpublication_id = nodeobj.get("sourcebranchpublication_id", None)