Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CPCN-27] ui: Modify versions label text for transcripts #144

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6,219 changes: 2,270 additions & 3,949 deletions client/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
},
"dependencies": {
"firebase": "9.6.11",
"newsroom-core": "github:superdesk/newsroom-core#release/2.5"
"newsroom-core": "github:superdesk/newsroom-core#develop"
},
"devDependencies": {
"babel-plugin-transform-object-rest-spread": "^6.26.0",
Expand Down
File renamed without changes.
21 changes: 21 additions & 0 deletions client/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import {startApp} from 'newsroom-core/assets';
import {IArticle} from 'newsroom-core/assets/interfaces';


startApp().then((newshubApi) => {
function getVersionsLabelText(item: IArticle, plural?: boolean): string {
const {gettext} = newshubApi.localization;

if (plural === true) {
return item.extra?.type === 'transcript' ?
gettext('segments') :
gettext('versions');
}

return item.extra?.type === 'transcript' ?
gettext('segment') :
gettext('version');
}

newshubApi.ui.wire.getVersionsLabelText = getVersionsLabelText;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if we should be overriding things in the newshubApi, would it fail to compile if the internal api changes the method signature?

});
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions client/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "newsroom-core/tsconfig.json",
"include": ["src"]
}
7 changes: 5 additions & 2 deletions client/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
const path = require('path');
const config = require('newsroom-core/webpack.config');

config.entry.login = path.resolve(__dirname, 'src', 'login.js');
config.entry.reset_password = path.resolve(__dirname, 'src', 'reset-password.js');
config.entry.login = path.resolve(__dirname, 'src', 'login.ts');
config.entry.reset_password = path.resolve(__dirname, 'src', 'reset-password.ts');

// Override `newsroom_js` from core to use `./src/index.ts` instead
config.entry.newsroom_js = path.resolve(__dirname, 'src', 'index.ts');

module.exports = config;
2 changes: 1 addition & 1 deletion server/requirements.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
google-auth==2.6.0
git+https://github.com/superdesk/newsroom-core.git@release/2.5#egg=Newsroom-Core
git+https://github.com/superdesk/newsroom-core.git@develop#egg=Newsroom-Core
14 changes: 9 additions & 5 deletions server/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.10
# This file is autogenerated by pip-compile with Python 3.8
# by the following command:
#
# pip-compile requirements.in
Expand Down Expand Up @@ -34,9 +34,9 @@ blinker==1.4
# raven
# sentry-sdk
# superdesk-core
boto3==1.28.72
boto3==1.28.73
# via superdesk-core
botocore==1.31.72
botocore==1.31.73
# via
# boto3
# s3transfer
Expand Down Expand Up @@ -225,7 +225,7 @@ mongolock==1.3.4
# via superdesk-core
natsort==8.4.0
# via croniter
newsroom-core @ git+https://github.com/superdesk/newsroom-core.git@release/2.5
newsroom-core @ git+https://github.com/superdesk/newsroom-core.git@develop
# via -r requirements.in
oauth2client==4.1.3
# via flask-oidc-ex
Expand Down Expand Up @@ -276,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 All @@ -301,6 +301,7 @@ python3-saml==1.15.0
# via newsroom-core
pytz==2023.3.post1
# via
# babel
# celery
# eve-elastic
# flask-babel
Expand Down Expand Up @@ -377,6 +378,7 @@ tinycss2==1.2.1
typing-extensions==4.8.0
# via
# limits
# pypdf
# qrcode
# superdesk-core
tzlocal==2.1
Expand Down Expand Up @@ -425,6 +427,8 @@ xhtml2pdf==0.2.11
# via newsroom-core
xmlsec==1.3.13
# via python3-saml
zipp==3.17.0
# via importlib-resources

# The following packages are considered to be unsafe in a requirements file:
# setuptools
Loading