Skip to content

Commit

Permalink
Modify versions label text for transcripts
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkLark86 committed Oct 30, 2023
1 parent 4b83b55 commit f6e9a51
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 118 deletions.
23 changes: 0 additions & 23 deletions client/src/auth.js

This file was deleted.

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;
});
51 changes: 0 additions & 51 deletions client/src/login.js

This file was deleted.

42 changes: 0 additions & 42 deletions client/src/reset-password.js

This file was deleted.

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;

0 comments on commit f6e9a51

Please sign in to comment.