Skip to content

Commit

Permalink
Merge branch 'cn-develop' into CPCN-27
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkLark86 committed Oct 30, 2023
2 parents f6e9a51 + 9434e2d commit 98f7049
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 18 deletions.
2 changes: 1 addition & 1 deletion client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions server/cp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
20 changes: 14 additions & 6 deletions server/cp/cem.py
Original file line number Diff line number Diff line change
@@ -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()


Expand All @@ -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")
39 changes: 39 additions & 0 deletions server/features/mgmt_api_topics.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
15 changes: 9 additions & 6 deletions server/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions server/settings.py
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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

Expand Down
20 changes: 15 additions & 5 deletions server/theme/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -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%);

Expand Down Expand Up @@ -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 */
Expand All @@ -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 {
Expand Down

0 comments on commit 98f7049

Please sign in to comment.