From ff1e3b81ab7cdf98c8154bb683056dc2c3a2a752 Mon Sep 17 00:00:00 2001 From: dzonidoo Date: Wed, 11 Dec 2024 14:47:26 +0100 Subject: [PATCH 1/2] set embargo default value to false --- scripts/appConfig.ts | 8 ++++++++ .../actions/send-to-tab.tsx | 2 +- scripts/core/superdesk-api.d.ts | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/appConfig.ts b/scripts/appConfig.ts index 11eaee563e..6e1dc52c86 100644 --- a/scripts/appConfig.ts +++ b/scripts/appConfig.ts @@ -12,6 +12,14 @@ if (appConfig.shortTimeFormat == null) { appConfig.shortTimeFormat = 'HH:mm'; // 24h format } +if (appConfig.ui == null) { + appConfig.ui = {}; +} + +if (appConfig.ui.sendEmbargo == null) { + appConfig.ui.sendEmbargo = false; +} + const defaultDateFormat = 'MM/DD'; const defaultTimeFormat = 'hh:mm'; diff --git a/scripts/core/interactive-article-actions-panel/actions/send-to-tab.tsx b/scripts/core/interactive-article-actions-panel/actions/send-to-tab.tsx index 07efe50690..dd2028a05d 100644 --- a/scripts/core/interactive-article-actions-panel/actions/send-to-tab.tsx +++ b/scripts/core/interactive-article-actions-panel/actions/send-to-tab.tsx @@ -146,7 +146,7 @@ export class SendToTab extends React.PureComponent { onChange={(val) => { this.setState({publishingDateOptions: val}); }} - allowSettingEmbargo={appConfig.ui.sendEmbargo !== false} + allowSettingEmbargo={appConfig.ui.sendEmbargo} /> ) } diff --git a/scripts/core/superdesk-api.d.ts b/scripts/core/superdesk-api.d.ts index b78f345601..769525cfe0 100644 --- a/scripts/core/superdesk-api.d.ts +++ b/scripts/core/superdesk-api.d.ts @@ -3420,7 +3420,7 @@ declare module 'superdesk-api' { sendPublishSchedule?: boolean; /** - * Can set embargo in "send to" pane. Defaults to true; + * Can set embargo in "send to" pane. Defaults to false; */ sendEmbargo?: boolean; From 73f91f70a8a7639c6f2548046bd12520df787fd9 Mon Sep 17 00:00:00 2001 From: dzonidoo Date: Thu, 12 Dec 2024 13:31:01 +0100 Subject: [PATCH 2/2] fix tests --- scripts/appConfig.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/scripts/appConfig.ts b/scripts/appConfig.ts index 6e1dc52c86..4bf152584c 100644 --- a/scripts/appConfig.ts +++ b/scripts/appConfig.ts @@ -20,6 +20,10 @@ if (appConfig.ui.sendEmbargo == null) { appConfig.ui.sendEmbargo = false; } +if (appConfig.ui.italicAbstract == null) { + appConfig.ui.italicAbstract = true; +} + const defaultDateFormat = 'MM/DD'; const defaultTimeFormat = 'hh:mm'; @@ -42,14 +46,6 @@ if (appConfig.longDateFormat == null) { appConfig.longDateFormat = 'LLL'; } -if (appConfig.ui == null) { - appConfig.ui = {}; - - if (appConfig.ui.italicAbstract == null) { - appConfig.ui.italicAbstract = true; - } -} - if (appConfig.features == null) { appConfig.features = {}; }