Skip to content

Commit 20f6c4b

Browse files
Added new key in client config to support default tab in authoring actions, check when sidepane is rendered (#5013)
1 parent 6b188f7 commit 20f6c4b

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

scripts/core/interactive-article-actions-panel/index-ui.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {Button} from 'superdesk-ui-framework/react';
77
import {gettext} from 'core/utils';
88
import {Panel} from './panel/panel-main';
99
import {PanelHeader} from './panel/panel-header';
10-
import {authoringReactViewEnabled} from 'appConfig';
10+
import {authoringReactViewEnabled, appConfig} from 'appConfig';
1111
import {DuplicateToTab} from './actions/duplicate-to-tab';
1212
import {WithPublishTab} from './actions/publish-tab';
1313
import {logger} from 'core/services/logger';
@@ -63,8 +63,14 @@ export class InteractiveArticleActionsPanel
6363
constructor(props: IPropsInteractiveArticleActionsPanelStateless) {
6464
super(props);
6565

66+
const configuredDefaultTab = appConfig.authoring_actions_default_tab;
67+
const initialActiveTab =
68+
configuredDefaultTab != null && props.tabs.includes(configuredDefaultTab)
69+
? configuredDefaultTab
70+
: props.activeTab;
71+
6672
this.state = {
67-
activeTab: props.activeTab,
73+
activeTab: initialActiveTab,
6874
};
6975
}
7076

scripts/core/superdesk-api.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3536,6 +3536,9 @@ declare module 'superdesk-api' {
35363536

35373537
default_timezone: string;
35383538

3539+
/** allow setting default tab to open in authoring sidebar */
3540+
authoring_actions_default_tab?: 'publish' | 'send_to';
3541+
35393542
// TANSA SERVER CONFIG
35403543
tansa?: {
35413544
base_url: string;

0 commit comments

Comments
 (0)