Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Dev/7.6.x with latest commits from dev/7.5.x #10673

Merged
merged 14 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion arches/app/datatypes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"))


Expand Down
4 changes: 3 additions & 1 deletion arches/app/datatypes/url.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion arches/app/media/css/arches.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
1 change: 1 addition & 0 deletions arches/app/models/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
48 changes: 48 additions & 0 deletions arches/app/tasks.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import importlib
import os
import logging
import shutil
Expand Down Expand Up @@ -351,6 +352,53 @@ 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_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):
"""
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:
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")
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
Expand Down
2 changes: 1 addition & 1 deletion arches/install/requirements.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions releases/7.5.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +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 `<select>` 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

Expand Down
1 change: 0 additions & 1 deletion releases/7.5.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
58 changes: 58 additions & 0 deletions releases/7.5.2.md
Original file line number Diff line number Diff line change
@@ -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
```