From cebd5dba723fe936281c626a03a2e1265572404e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Ja=C5=A1ek?= Date: Thu, 19 Dec 2024 07:11:46 +0100 Subject: [PATCH 1/6] avoid extra fields mapped in elastic (#2164) trying to explicitly avoid those fields, they still get auto created. --- server/planning/events/events_schema.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/server/planning/events/events_schema.py b/server/planning/events/events_schema.py index 15b028232..d3b5bf9e3 100644 --- a/server/planning/events/events_schema.py +++ b/server/planning/events/events_schema.py @@ -78,7 +78,20 @@ "accreditation_deadline": {"type": "datetime"}, # Reference can be used to hold for example a court case reference number "reference": {"type": "string"}, - "anpa_category": metadata_schema["anpa_category"], + "anpa_category": { + "type": "list", + "nullable": True, + "mapping": { + "type": "object", + "dynamic": False, + "properties": { + "qcode": not_analyzed, + "name": not_analyzed, + "scheme": not_analyzed, + "translations": {"enabled": False}, # explicitly disable + }, + }, + }, "files": { "type": "list", "nullable": True, @@ -209,6 +222,7 @@ "address": {"type": "object", "dynamic": True}, "geo": {"type": "string"}, "location": {"type": "geo_point"}, + "translations": {"enabled": False}, # explicitly disable }, }, "nullable": True, @@ -268,6 +282,7 @@ "properties": { "qcode": not_analyzed, "name": not_analyzed, + "translations": {"enabled": False}, # explicitly disable }, }, }, From 432b543c756f5a898ae456e85be94b9776aef695 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Ja=C5=A1ek?= Date: Mon, 30 Dec 2024 16:04:45 +0100 Subject: [PATCH 2/6] reingest onclusive event on location change (#2171) SDCP-866 --- server/planning/events/events.py | 8 +++++++- server/planning/events/events_tests.py | 12 +++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/server/planning/events/events.py b/server/planning/events/events.py index b6f41bbc3..57e24f13e 100644 --- a/server/planning/events/events.py +++ b/server/planning/events/events.py @@ -119,7 +119,13 @@ def is_event_updated(new_item: Event, old_item: Event) -> bool: return True new_subject = set([get_subject_str(subject) for subject in new_item.get("subject", [])]) old_subject = set([get_subject_str(subject) for subject in old_item.get("subject", [])]) - return new_subject != old_subject + if new_subject != old_subject: + return True + old_location = old_item.get("location", []) + new_location = new_item.get("location", []) + if new_location != old_location: + return True + return False class EventsService(superdesk.Service): diff --git a/server/planning/events/events_tests.py b/server/planning/events/events_tests.py index d04fe0d8f..46229ce71 100644 --- a/server/planning/events/events_tests.py +++ b/server/planning/events/events_tests.py @@ -1,5 +1,6 @@ -from datetime import datetime, timedelta import pytz + +from datetime import datetime, timedelta from copy import deepcopy from mock import Mock, patch from superdesk import get_resource_service @@ -10,6 +11,8 @@ from planning.events.events import generate_recurring_dates from werkzeug.exceptions import BadRequest +from .events import is_event_updated + class EventTestCase(TestCase): def test_recurring_dates_generation(self): @@ -698,3 +701,10 @@ def test_related_planning_item_fields_validation_on_post(self): planning_item = planning_service.find_one(req=None, _id=planning_id[0]) self.assertEqual(len([planning_item]), 1) self.assertEqual(planning_item.get("state"), "scheduled") + + +def test_is_event_updated(): + new_event = {"location": [{"name": "test"}]} + old_events = {"location": [{"name": "test", "state": "bar"}]} + assert is_event_updated(new_event, old_events) + assert not is_event_updated(new_event, new_event) From afcb468177ce9ce1c5fdfd902917935e2c0a4576 Mon Sep 17 00:00:00 2001 From: Nikola Stojanovic <68916411+dzonidoo@users.noreply.github.com> Date: Fri, 3 Jan 2025 09:43:47 +0100 Subject: [PATCH 3/6] fix z index (#2168) --- index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/index.ts b/index.ts index 64cebf9e3..892d14bd1 100644 --- a/index.ts +++ b/index.ts @@ -81,6 +81,7 @@ function configurePlanning(superdesk) { label: gettext('Fulfil Assignment'), icon: 'calendar-list', modal: true, + zIndex: '1050', priority: 2000, controller: ctrl.FulFilAssignmentController, filters: [ From ef197d3b48dbfcd830b9d565d7a3e106e5b91882 Mon Sep 17 00:00:00 2001 From: Petr Jasek Date: Tue, 7 Jan 2025 10:32:50 +0100 Subject: [PATCH 4/6] release 2.8.4 --- package-lock.json | 6 +++--- package.json | 2 +- server/planning/__init__.py | 2 +- setup.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 275caad71..6d276250d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "superdesk-planning", - "version": "2.8.3", + "version": "2.8.4", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -12206,7 +12206,7 @@ } }, "superdesk-core": { - "version": "github:superdesk/superdesk-client-core#be5cb155334b485016df9eb9dea78e8e9848dedf", + "version": "github:superdesk/superdesk-client-core#60d561e73f3f97b6249ffaac255fd35a3091fe8f", "from": "github:superdesk/superdesk-client-core#develop", "dev": true, "requires": { @@ -12304,7 +12304,7 @@ "sass-loader": "6.0.6", "shortid": "2.2.8", "style-loader": "0.20.2", - "superdesk-ui-framework": "^3.1.28", + "superdesk-ui-framework": "4.0.3", "ts-loader": "3.5.0", "typescript": "4.9.5", "uuid": "8.3.1", diff --git a/package.json b/package.json index 66593c231..589418041 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "superdesk-planning", - "version": "2.8.3", + "version": "2.8.4", "license": "AGPL-3.0", "description": "", "repository": { diff --git a/server/planning/__init__.py b/server/planning/__init__.py index b31422c2b..aed4b31f8 100644 --- a/server/planning/__init__.py +++ b/server/planning/__init__.py @@ -78,7 +78,7 @@ from planning.planning_locks import init_app as init_planning_locks_app from planning.search.planning_autocomplete import init_app as init_planning_autocomplete_app -__version__ = "2.8.3" +__version__ = "2.8.4" _SERVER_PATH = os.path.dirname(os.path.realpath(__file__)) diff --git a/setup.py b/setup.py index b64b9f547..3fe57773b 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ setup( name="superdesk-planning", - version="2.8.3", + version="2.8.4", description=DESCRIPTION, long_description=DESCRIPTION, package_dir={"": "server"}, From 8810042ff045e5b6eba09cef2fc374e4010d6ebe Mon Sep 17 00:00:00 2001 From: Petr Jasek Date: Tue, 7 Jan 2025 10:48:26 +0100 Subject: [PATCH 5/6] stop testing on python3.8 --- .github/workflows/ci-server.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-server.yml b/.github/workflows/ci-server.yml index bc81425ba..c43fd0b26 100644 --- a/.github/workflows/ci-server.yml +++ b/.github/workflows/ci-server.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.8', '3.10'] + python-version: ['3.10'] env: INSTALL_PY_MODULES: true RUN_SERVICES: true @@ -28,7 +28,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.8', '3.10'] + python-version: ['3.10'] env: INSTALL_PY_MODULES: true RUN_SERVICES: true @@ -51,7 +51,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.8', '3.10'] + python-version: ['3.10'] env: INSTALL_PY_MODULES: true INSTALL_PY_EDITABLE: true From ee37c709b952f43ed4ffbf90c91e32fb1dffc364 Mon Sep 17 00:00:00 2001 From: Petr Jasek Date: Tue, 7 Jan 2025 11:09:01 +0100 Subject: [PATCH 6/6] stop using python3.8 in e2e --- .github/workflows/ci-e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-e2e.yml b/.github/workflows/ci-e2e.yml index 6bcb6b1b6..6be47f922 100644 --- a/.github/workflows/ci-e2e.yml +++ b/.github/workflows/ci-e2e.yml @@ -8,7 +8,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.8'] + python-version: ['3.10'] node-version: ['14'] e2e: ['a', 'b'] env: