From 8afd4c479395a1fe96ea97149893b0e2a1956b7d Mon Sep 17 00:00:00 2001 From: Alexander Watzinger Date: Mon, 13 Nov 2023 12:24:24 +0100 Subject: [PATCH 1/2] Fix #2117 - Modification events not showing at artifact view --- config/default.py | 2 +- install/upgrade/upgrade.md | 2 +- openatlas/display/base_display.py | 11 ++++++----- openatlas/views/changelog.py | 3 +++ 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/config/default.py b/config/default.py index 11d14da44..fc1f5bf6f 100644 --- a/config/default.py +++ b/config/default.py @@ -3,7 +3,7 @@ from config.database_versions import DATABASE_VERSIONS -VERSION = '7.17.2' +VERSION = '7.17.3' DATABASE_VERSION = DATABASE_VERSIONS[0] DEMO_MODE = False # If activated some options are disabled, login is prefilled DEBUG = False diff --git a/install/upgrade/upgrade.md b/install/upgrade/upgrade.md index 44c64481b..8236be2cd 100644 --- a/install/upgrade/upgrade.md +++ b/install/upgrade/upgrade.md @@ -18,7 +18,7 @@ then run the database upgrade script, then restart Apache: sudo python3 install/upgrade/database_upgrade.py sudo service apache2 restart -### 7.17.x to 7.17.2 +### 7.17.x to 7.17.3 A code base update (e.g. with git pull) and a webserver restart is sufficient. ### 7.16.x to 7.17.0 diff --git a/openatlas/display/base_display.py b/openatlas/display/base_display.py index fd9f92927..fd831d857 100644 --- a/openatlas/display/base_display.py +++ b/openatlas/display/base_display.py @@ -377,7 +377,13 @@ def add_tabs(self) -> None: for link_ in entity.get_links(['P31', 'P67'], inverse=True): domain = link_.domain + if domain.class_.view == 'reference_system': + entity.reference_systems.append(link_) + continue data = get_base_table_data(domain) + if domain.class_.view in ['event']: + self.tabs[domain.class_.view].table.rows.append(data) + continue if domain.class_.view == 'file': ext = data[3] data.append(profile_image_table_link(entity, domain, ext)) @@ -403,15 +409,10 @@ def add_tabs(self) -> None: place_id=entity.id, link_id=link_.id)) data.append(content) - if domain.class_.view == 'event': - continue if domain.class_.view not in ['source', 'file']: data.append(link_.description) data.append(edit_link( url_for('link_update', id_=link_.id, origin_id=entity.id))) - if domain.class_.view == 'reference_system': - entity.reference_systems.append(link_) - continue data.append( remove_link(domain.name, link_, entity, domain.class_.view)) self.tabs[domain.class_.view].table.rows.append(data) diff --git a/openatlas/views/changelog.py b/openatlas/views/changelog.py index 1e6a5b98f..14f7883b7 100644 --- a/openatlas/views/changelog.py +++ b/openatlas/views/changelog.py @@ -15,6 +15,9 @@ def index_changelog() -> str: versions = { + '7.17.3': ['2023-11-13', { + 'fix': { + '2117': 'Modification events not showing at artifact view'}}], '7.17.2': ['2023-11-09', { 'fix': { '2114': 'JavaSrcipt datatable error'}}], From 3f82b24262bb00a456c8bd3a4eff7a6d312093e2 Mon Sep 17 00:00:00 2001 From: Alexander Watzinger Date: Mon, 13 Nov 2023 13:01:05 +0100 Subject: [PATCH 2/2] Fix #2118 - Wrong listing of type orphans --- openatlas/__init__.py | 8 +++++--- openatlas/models/type.py | 7 +++++-- openatlas/views/admin.py | 2 +- openatlas/views/changelog.py | 5 +++-- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/openatlas/__init__.py b/openatlas/__init__.py index 99f9d590a..34bcc68e8 100644 --- a/openatlas/__init__.py +++ b/openatlas/__init__.py @@ -61,10 +61,12 @@ def before_request() -> None: g.properties = CidocProperty.get_all(session['language']) g.classes = OpenatlasClass.get_all() with_count = False - if request.path.startswith('/type') or \ - request.path.startswith('/api/type_tree/') or ( + if (request.path.startswith('/type') + or request.path.startswith('/api/type_tree/') + or request.path.startswith('/admin/orphans') + or ( request.path.startswith('/entity/') and - request.path.split('/entity/')[1].isdigit()): + request.path.split('/entity/')[1].isdigit())): with_count = True g.types = Type.get_all(with_count) g.reference_systems = ReferenceSystem.get_all() diff --git a/openatlas/models/type.py b/openatlas/models/type.py index c3ae58777..807f01055 100644 --- a/openatlas/models/type.py +++ b/openatlas/models/type.py @@ -230,5 +230,8 @@ def insert_hierarchy( @staticmethod def get_type_orphans() -> list[Type]: return [ - n for key, n in g.types.items() - if n.root and n.count < 1 and not n.subs] + node for key, node in g.types.items() + if node.root + and node.category not in ['system', 'tools'] + and node.count < 1 + and not node.subs] diff --git a/openatlas/views/admin.py b/openatlas/views/admin.py index 008d468d5..ee1260be1 100644 --- a/openatlas/views/admin.py +++ b/openatlas/views/admin.py @@ -487,7 +487,7 @@ def admin_orphans() -> str: table=Table( ['name', 'root'], [[link(type_), link(g.types[type_.root[0]])] - for type_ in Type.get_type_orphans()])), + for type_ in Type.get_type_orphans()])), 'missing_files': Tab('missing_files', table=Table(header)), 'orphaned_files': Tab( 'orphaned_files', diff --git a/openatlas/views/changelog.py b/openatlas/views/changelog.py index 14f7883b7..7504e52a5 100644 --- a/openatlas/views/changelog.py +++ b/openatlas/views/changelog.py @@ -17,10 +17,11 @@ def index_changelog() -> str: versions = { '7.17.3': ['2023-11-13', { 'fix': { - '2117': 'Modification events not showing at artifact view'}}], + '2117': 'Modification events not showing at artifact view', + '2118': 'Wrong listing of type orphans'}}], '7.17.2': ['2023-11-09', { 'fix': { - '2114': 'JavaSrcipt datatable error'}}], + '2114': 'JavaScript datatable error'}}], '7.17.1': ['2023-11-06', { 'fix': { '2110': 'API: licensed file overview broken',