diff --git a/client/package-lock.json b/client/package-lock.json index 36ff8f2..455510d 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -8308,7 +8308,7 @@ "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==" }, "newsroom-core": { - "version": "github:superdesk/newsroom-core#b3eb0869b835f966b2ec6c64683f9adf9d09bd94", + "version": "github:superdesk/newsroom-core#ba780950fd0625905f8a1e0f37c09e24ee25cad7", "from": "github:superdesk/newsroom-core#develop", "requires": { "@dnd-kit/core": "^6.0.8", diff --git a/server/cp/__init__.py b/server/cp/__init__.py index 17a6a97..3b85720 100644 --- a/server/cp/__init__.py +++ b/server/cp/__init__.py @@ -9,5 +9,9 @@ # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license +import logging + HEADLINE2 = "headline_extended" CORRECTION = "correction" + +logging.basicConfig(level=logging.INFO) diff --git a/server/cp/cem.py b/server/cp/cem.py index 407a805..8130150 100644 --- a/server/cp/cem.py +++ b/server/cp/cem.py @@ -1,9 +1,11 @@ +import logging import requests from typing import Literal from flask import current_app as app +logger = logging.getLogger(__name__) session = requests.Session() @@ -20,9 +22,15 @@ def send_notification(_type, user, id_key: Literal["_id", "email"] = "_id"): } if user.get("company") and id_key == "_id": payload["company"] = str(user["company"]) - session.patch( - url, - timeout=5, - json=payload, - headers=headers, - ) + try: + session.patch( + url, + json=payload, + headers=headers, + timeout=int(app.config.get("CEM_TIMEOUT", 10)), + verify=bool(app.config.get("CEM_VERIFY_TLS", True)), + ) + except requests.exceptions.RequestException as err: + logger.error(err) + return + logger.info("Notification sent to CEM") diff --git a/server/features/mgmt_api_topics.feature b/server/features/mgmt_api_topics.feature index 0864862..31a1237 100644 --- a/server/features/mgmt_api_topics.feature +++ b/server/features/mgmt_api_topics.feature @@ -117,3 +117,42 @@ Feature: Management API - Topics """ When we get "/topics" Then we get list with 1 items + + Scenario: Validate if navigation exists + When we post to "/topics" + """ + { + "label": "topic1", + "company": "#companies._id#", + "topic_type": "wire", + "query": "topic1", + "is_global": true, + "user": "#users._id#", + "navigation": ["619277ef8bbbbfac6034aab7"] + } + """ + Then we get response code 400 + + When we post to "navigations" + """ + { + "name": "navigation1", + "description": "navigation1", + "order": 1 + } + """ + Then we get response code 201 + + When we post to "/topics" + """ + { + "label": "topic1", + "company": "#companies._id#", + "topic_type": "wire", + "query": "topic1", + "is_global": true, + "user": "#users._id#", + "navigation": ["#navigations._id#"] + } + """ + Then we get response code 201 diff --git a/server/requirements.txt b/server/requirements.txt index fa30240..6c4b46a 100644 --- a/server/requirements.txt +++ b/server/requirements.txt @@ -34,9 +34,9 @@ blinker==1.4 # raven # sentry-sdk # superdesk-core -boto3==1.28.71 +boto3==1.28.73 # via superdesk-core -botocore==1.31.71 +botocore==1.31.73 # via # boto3 # s3transfer @@ -262,6 +262,8 @@ pyhanko-certvalidator==0.22.0 # via # pyhanko # xhtml2pdf +pyjwt==2.4.0 + # via superdesk-core pymemcache==4.0.0 # via superdesk-core pymongo==3.11.4 @@ -274,7 +276,7 @@ pyparsing==3.1.1 # via # httplib2 # pyrtf3 -pypdf==3.16.4 +pypdf==3.17.0 # via xhtml2pdf pypng==0.20220715.0 # via qrcode @@ -323,9 +325,10 @@ redis==4.5.5 # superdesk-core regex==2020.7.14 # via superdesk-core -reportlab==3.6.6 +reportlab==3.6.13 # via # newsroom-core + # superdesk-core # svglib # xhtml2pdf requests==2.31.0 @@ -362,9 +365,9 @@ six==1.16.0 # oauth2client # python-bidi # python-dateutil -superdesk-core @ git+https://github.com/superdesk/superdesk-core.git@develop +superdesk-core @ git+https://github.com/superdesk/superdesk-core.git@v2.7.0-rc1 # via newsroom-core -superdesk-planning @ git+https://github.com/superdesk/superdesk-planning.git@develop +superdesk-planning @ git+https://github.com/superdesk/superdesk-planning.git@v2.7.0-rc1 # via newsroom-core svglib==1.5.1 # via xhtml2pdf diff --git a/server/settings.py b/server/settings.py index 99aa4e7..d07af13 100644 --- a/server/settings.py +++ b/server/settings.py @@ -1,6 +1,7 @@ import os import pathlib from flask_babel import lazy_gettext +from superdesk.default_settings import strtobool from newsroom.web.default_settings import ( env, CLIENT_CONFIG, @@ -274,6 +275,8 @@ CEM_URL = os.environ.get("CEM_URL", "") CEM_APIKEY = os.environ.get("CEM_APIKEY", "") CEM_PLATFORM = os.environ.get("CEM_PLATFORM", "MyNP") +CEM_VERIFY_TLS = strtobool(os.environ.get("CEM_VERIFY_TLS", "off")) +CEM_TIMEOUT = int(os.environ.get("CEM_TIMEOUT") or 10) DEFAULT_ALLOW_COMPANIES_TO_MANAGE_PRODUCTS = True diff --git a/server/theme/theme.css b/server/theme/theme.css index 3610614..3b22a5d 100644 --- a/server/theme/theme.css +++ b/server/theme/theme.css @@ -2,6 +2,8 @@ /* CORE: TYPOGRAPHY */ --font-family-core--sans: "Lato", sans-serif; --font-family-core--serif: "Titillium Web", sans-serif; + + --color-background: hsl(0, 0%, 97%); --badge-bg-highlight1: hsl(356, 72%, 46%); --color-primary: hsl(356, 72%, 46%); @@ -43,11 +45,13 @@ /* COMPONENT: SIDENAV */ - --sidenav-color-bg: hsl(0, 3%, 15%); - --sidenav-color-item-bg--active: hsl(356, 72%, 46%); - --sidenav-color-item-fg--active: hsla(0, 0%, 100%, 1); - --sidenav-color-badge-bg: hsla(0, 0%, 98%, 1); - --sidenav-color-badge-fg: hsl(356, 72%, 46%); + --sidenav-color-bg: hsl(0, 3%, 15%); + --sidenav-color-item-bg--active: hsl(356, 72%, 46%); + --sidenav-color-item-fg--active: hsla(0, 0%, 100%, 1); + --sidenav-color-badge-bg: hsla(0, 0%, 98%, 1); + --sidenav-color-badge-bg--active: hsla(0, 0%, 98%, 1); + --sidenav-color-badge-fg: hsl(356, 72%, 46%); + --sidenav-color-badge-fg--active: hsl(356, 72%, 46%); /* COMPONENT: BUTTONS */ /* // Primary */ @@ -74,6 +78,12 @@ /* COMPONENT: MAIN FOOTER */ --footer-size--height: 48px; + + /* COMPONENT: ALERTIFY NOTIFIER */ + --ajs-message-color-bg--success: hsl(0, 3%, 15%); + + /* COMPONENT: SEARCH RESULT PANEL (Tags list) */ + --search-result-tags-list-color-bg: var(--main-header-color-bg); } .navbar__logo img.navbar__logo-img--fr {