Skip to content

Commit

Permalink
Merge branch 'dev/7.6.x' into 1349_fix_long_name_accessibility_issues
Browse files Browse the repository at this point in the history
  • Loading branch information
CWDamm-Kint committed Feb 14, 2025
2 parents f744190 + 206a887 commit 8e36113
Show file tree
Hide file tree
Showing 24 changed files with 206 additions and 36 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Issue reports are encouraged! [Please read this article](http://polite.technolog
* [Report a Bug](https://github.com/archesproject/arches/issues/new?template=bug.md)
* [File a Feature Ticket](https://github.com/archesproject/arches/issues/new?template=feature.md)

[Version 7.6.4 release notes](https://github.com/archesproject/arches/blob/dev/7.6.x/releases/7.6.4.md)
[Version 7.6.7 release notes](https://github.com/archesproject/arches/blob/dev/7.6.x/releases/7.6.7.md)

#### Quick Install

Expand Down
2 changes: 1 addition & 1 deletion arches/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
pass

# VERSION[3] options = "alpha", "beta", "rc", or "final"
VERSION = (7, 6, 4, "beta", 0)
VERSION = (7, 6, 7, "beta", 0)

__version__ = get_version(VERSION)
7 changes: 5 additions & 2 deletions arches/app/etl_modules/save.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from django.db import connection
from django.http import HttpRequest
from django.utils.translation import gettext as _
from django.urls import reverse, resolve
from django.urls import reverse, resolve, get_script_prefix
from arches.app.models.system_settings import settings
from arches.app.utils.index_database import index_resources_by_transaction
import logging
Expand Down Expand Up @@ -187,7 +187,10 @@ def get_resourceids_from_search_url(search_url, user=None):
params = parse_qs(urlsplit(search_url).query)
for k, v in params.items():
request.GET.__setitem__(k, v[0])
func, args, kwargs = resolve(reverse("search_results"))
search_results_path = reverse("search_results")
if search_results_path.startswith(get_script_prefix()):
search_results_path = search_results_path.replace(get_script_prefix(), "/")
func, args, kwargs = resolve(search_results_path)
kwargs["request"] = request
response = func(*args, **kwargs)
results = json.loads(response.content)["results"]["hits"]["hits"]
Expand Down
4 changes: 4 additions & 0 deletions arches/app/media/css/arches.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12924,3 +12924,7 @@ table.csv-mapping-table td {
width: auto;
}
}

.cke_screen_reader_only {
position: fixed !important;
}
2 changes: 1 addition & 1 deletion arches/app/media/js/views/rdm/modals/manage-parent-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ define(['jquery', 'backbone', 'arches', 'views/concept-search', 'models/concept'

save: function(){
var self = this;
if (this.conceptsearch.searchbox.val() !== ''){
if (this.conceptsearch.searchbox.val()){
var parentConcept = new ConceptModel({
id: this.conceptsearch.searchbox.val(),
relationshiptype: this.relationshiptype.val()
Expand Down
16 changes: 9 additions & 7 deletions arches/app/models/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,7 @@ def get_related_resources(
user=None,
resourceinstance_graphid=None,
graphs=None,
include_rr_count=True,
):
"""
Returns an object that lists the related resources, the relationship types, and a reference to the current resource
Expand Down Expand Up @@ -928,13 +929,14 @@ def get_relations(
if related_resources:
for resource in related_resources["docs"]:
if resource["found"]:
rel_count = get_relations(
resourceinstanceid=resource["_id"],
start=0,
limit=0,
count_only=True,
)
resource["_source"]["total_relations"] = rel_count
if include_rr_count:
rel_count = get_relations(
resourceinstanceid=resource["_id"],
start=0,
limit=0,
count_only=True,
)
resource["_source"]["total_relations"] = rel_count
for descriptor_type in ("displaydescription", "displayname"):
descriptor = get_localized_descriptor(
resource, descriptor_type
Expand Down
3 changes: 3 additions & 0 deletions arches/app/permissions/arches_permission_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,9 @@ def has_perm(self, user_obj: User, perm: str, obj: Model | None = None) -> bool:
"given obj has '%s'" % (app_label, obj._meta.app_label)
)

if user_obj.is_superuser:
return True

obj_checker: ObjectPermissionChecker = CachedObjectPermissionChecker(
user_obj, obj
)
Expand Down
9 changes: 8 additions & 1 deletion arches/app/search/components/map_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ def _buffer(geojson, width=0, unit="ft"):
except Exception:
width = 0

try:
int(settings.ANALYSIS_COORDINATE_SYSTEM_SRID)
except Exception:
raise ValueError(
"Settings ANALYSIS_COORDINATE_SYSTEM_SRID value is not a number."
)

if width > 0:
if unit == "ft":
width = width / 3.28084
Expand All @@ -73,7 +80,7 @@ def _buffer(geojson, width=0, unit="ft"):
4326)""",
(
geom.hex.decode("utf-8"),
settings.ANALYSIS_COORDINATE_SYSTEM_SRID,
int(settings.ANALYSIS_COORDINATE_SYSTEM_SRID),
width,
),
)
Expand Down
8 changes: 5 additions & 3 deletions arches/app/search/search_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@
from django.core.files import File
from django.core.files.storage import default_storage
from django.utils.translation import gettext as _
from django.urls import reverse, resolve
from django.urls import reverse, resolve, get_script_prefix
from arches.app.models import models
from arches.app.models.system_settings import settings
from arches.app.datatypes.datatypes import DataTypeFactory
from arches.app.utils.flatten_dict import flatten_dict
from arches.app.utils.betterJSONSerializer import JSONDeserializer
Expand Down Expand Up @@ -166,7 +165,10 @@ def order_cards(subcards_added=True):

def export(self, format, report_link):
ret = []
func, args, kwargs = resolve(reverse("search_results"))
search_results_path = reverse("search_results")
if search_results_path.startswith(get_script_prefix()):
search_results_path = search_results_path.replace(get_script_prefix(), "/")
func, args, kwargs = resolve(search_results_path)
kwargs["request"] = self.search_request
search_res_json = func(*args, **kwargs)
if search_res_json.status_code == 500:
Expand Down
5 changes: 4 additions & 1 deletion arches/app/utils/activity_stream_jsonld.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,10 @@ def add_resource(editlog_object, perm_level=perm_level):
# Tombstone instead.
obj["formerType"] = obj["type"]
obj["type"] = "Tombstone"
obj["id"] = editlog_object.resourceinstanceid

obj["id"] = self.base_uri_for_arches + reverse(
"resources", args=(editlog_object.resourceinstanceid,)
)

return obj

Expand Down
4 changes: 3 additions & 1 deletion arches/app/views/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1299,7 +1299,9 @@ def get(self, request, resourceid):
get_params.update({"paginate": "false"})
request.GET = get_params

related_resources_response = RelatedResourcesView().get(request, resourceid)
related_resources_response = RelatedResourcesView().get(
request, resourceid, include_rr_count=False
)
related_resources = json.loads(related_resources_response.content)

related_resources_summary = self._generate_related_resources_summary(
Expand Down
3 changes: 0 additions & 3 deletions arches/app/views/manifest_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,6 @@ def change_canvas_label(manifest, canvas_id, label):
except TypeError:
metadata = []

if not os.path.exists(settings.CANTALOUPE_DIR):
os.mkdir(settings.CANTALOUPE_DIR)

if operation == "create":
canvases = []
for f in files:
Expand Down
4 changes: 3 additions & 1 deletion arches/app/views/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -1008,7 +1008,7 @@ def parse_relationshiptype_label(relationship):

return ret

def get(self, request, resourceid=None):
def get(self, request, resourceid=None, include_rr_count=True):
ret = {}

if self.action == "get_candidates":
Expand Down Expand Up @@ -1055,6 +1055,7 @@ def get(self, request, resourceid=None):
user=request.user,
resourceinstance_graphid=resourceinstance_graphid,
graphs=self.graphs,
include_rr_count=include_rr_count,
)

ret = self.paginate_related_resources(
Expand All @@ -1066,6 +1067,7 @@ def get(self, request, resourceid=None):
user=request.user,
resourceinstance_graphid=resourceinstance_graphid,
graphs=self.graphs,
include_rr_count=include_rr_count,
)

return JSONResponse(ret)
Expand Down
6 changes: 3 additions & 3 deletions arches/settings_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ def build_templates_config(
directories.append(os.path.join(app_root, "templates"))

# forces Arches-level overrides of generic Django templates
directories.append(
os.path.join(Path(__file__).resolve().parent, "app", "templates")
)
# directories.append(
# os.path.join(Path(__file__).resolve().parent, "app", "templates")
# )

return [
{
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "arches",
"version": "7.6.4",
"version": "7.6.7",
"license": "AGPL-3.0-only",
"scripts": {
"build_development": "npm run eslint:check && npm run ts:check && cross-env NODE_OPTIONS=--max-old-space-size=2048 webpack --config ./webpack/webpack.config.dev.js",
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dependencies = [
"arcgis2geojson==2.0.0",
"celery==5.3.6",
"defusedxml==0.7.1",
"Django>=4.2.17,<5.0.0",
"Django>=4.2.18,<5.0.0",
"django-celery-results==2.5.1",
"django-cors-headers==4.2.0",
"django-guardian==2.4.0",
Expand Down
2 changes: 1 addition & 1 deletion releases/7.6.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ Minor incompatibilities:
```
"license": "AGPL-3.0-only",
```
2. Update the value of `scripts`:
2. Update the value of `scripts`, taking care to replace `{{ project_name }}` with your project name in the `prettier:check` and `prettier:fix` commands:
```
"scripts": {
"build_development": "npm run eslint:check && npm run ts:check && cross-env NODE_OPTIONS=--max-old-space-size=2048 webpack --config ./webpack/webpack.config.dev.js",
Expand Down
36 changes: 36 additions & 0 deletions releases/7.6.5.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
## Arches 7.6.5 Release Notes

### Bug Fixes and Enhancements

- Fix Activity Stream id value [#11727](https://github.com/archesproject/arches/issues/11727)
- Prevent Arches templates from overriding App templates [#11731]https://github.com/archesproject/arches/pull/11731
- Fix search export when `FORCE_SCRIPT_NAME` is used #[11716](https://github.com/archesproject/arches/issues/11716)

### Dependency changes:

```
Python:
Upgraded:
Django == 4.2.18 (or <5.0.0)
JavaScript:
Upgraded:
none
```

### Upgrading Arches

1. Upgrade to version 7.6.0 before proceeding by following the upgrade process in the [Version 7.6.0 release notes](https://github.com/archesproject/arches/blob/dev/7.6.x/releases/7.6.0.md)

2. Upgrade to Arches 7.6.5

```
pip install --upgrade arches==7.6.5
```
3. If you are running Arches on Apache, restart your server:
```
sudo service apache2 reload
```
4. (Optional) The sass JavaScript dependency was pinned to [version 1.78 in the arches-dev-dependencies](https://github.com/archesproject/arches-dev-dependencies/pull/32) repository. This was done to silence unhelpful deprecation warnings. By default, this change will only affect projects newly created with Arches v7.6.5. Existing projects can take advantage of this change by ensuring their project's package.json file points to either the `dev/7.6.x` or `stable/7.6.5` branch of `arches-dev-dependencies` and then reinstalling and rebuilding their front-end dependencies.
35 changes: 35 additions & 0 deletions releases/7.6.6.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
## Arches 7.6.6 Release Notes

### Bug Fixes and Enhancements

- Fix inability to remove a second parent from a concept [#11742](https://github.com/archesproject/arches/pull/11742)
- Fix slow reports when used on systems with many related resources [#11748](https://github.com/archesproject/arches/pull/11748)
- Reimplement superuser bypass of nodegroup permission check [#11744](https://github.com/archesproject/arches/pull/11744)


### Dependency changes:

```
Python:
Upgraded:
none
JavaScript:
Upgraded:
none
```

### Upgrading Arches

1. Upgrade to version 7.6.0 before proceeding by following the upgrade process in the [Version 7.6.0 release notes](https://github.com/archesproject/arches/blob/dev/7.6.x/releases/7.6.0.md)

2. Upgrade to Arches 7.6.6

```
pip install --upgrade arches==7.6.6
```
3. If you are running Arches on Apache, restart your server:
```
sudo service apache2 reload
```
34 changes: 34 additions & 0 deletions releases/7.6.7.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
## Arches 7.6.7 Release Notes

### Bug Fixes and Enhancements

- ANALYSIS_COORDINATE_SYSTEM_SRID string compatibility [#11714](https://github.com/archesproject/arches/issues/11714)
- Removes need for required cantaloupe directory [#10289](https://github.com/archesproject/arches/issues/10289)
- Fixes frontend build for systems using poetry or uv [#11764](https://github.com/archesproject/arches/issues/11764)
- Fixes accessibility issues from extra scroll bar caused by CKEditor screen reader css class [#11713](https://github.com/archesproject/arches/issues/11713)

### Dependency changes:

```
Python:
Upgraded:
none
JavaScript:
Upgraded:
none
```

### Upgrading Arches

1. Upgrade to version 7.6.0 before proceeding by following the upgrade process in the [Version 7.6.0 release notes](https://github.com/archesproject/arches/blob/dev/7.6.x/releases/7.6.0.md)

2. Upgrade to Arches 7.6.7

```
pip install --upgrade arches==7.6.7
```
3. If you are running Arches on Apache, restart your server:
```
sudo service apache2 reload
```
12 changes: 11 additions & 1 deletion tests/search/search_export_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from django.contrib.auth.models import User
from django.test.client import RequestFactory
from django.urls import reverse
from django.urls import get_script_prefix, reverse, set_script_prefix

from arches.app.views.api import SearchExport
from tests.base_test import ArchesTestCase
Expand Down Expand Up @@ -227,6 +227,16 @@ def test_login_via_basic_auth_invalid(self):
self.assertEqual(request.user.username, "anonymous")
self.assertEqual(response.status_code, HTTPStatus.UNAUTHORIZED)

def test_script_prefix(self):
prefix = get_script_prefix()
set_script_prefix("/nginx")
self.addCleanup(set_script_prefix, prefix)

request = self.factory.get("/search?tiles=True&export=True&format=tilecsv")
request.user = self.user
exporter = SearchResultsExporter(search_request=request)
exporter.export(format="tilecsv", report_link="false")


def is_valid_uuid(value, version=4):
"""Check if value is a valid UUID."""
Expand Down
Loading

0 comments on commit 8e36113

Please sign in to comment.