Skip to content

Commit

Permalink
marked 'not for publication' invisible publish tab (#4356)
Browse files Browse the repository at this point in the history
  • Loading branch information
dzonidoo authored Nov 8, 2023
1 parent 65c68b7 commit 352a7a9
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions scripts/core/interactive-article-actions-panel/index-ui.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,22 @@ export class InteractiveArticleActionsPanel
const markupV2 = authoringReactViewEnabled && this.props.markupV2 === true;
const handleUnsavedChanges = this.props.handleUnsavedChanges ?? handleUnsavedChangesDefault;

const filteredTabs = tabs.filter((tab) => {
if (tab === 'publish') {
const item = items[0]; // only one item is supported in publishing tab
const notForPublication = item?.flags?.marked_for_not_publication ?? false;

return notForPublication !== true;
} else {
return true;
}
});

const panelHeader = (
<PanelHeader markupV2={markupV2}>
<div className="space-between" style={{width: '100%', paddingRight: 10}}>
<TabList
tabs={
tabs.map((id) => ({id, label: getTabLabel(id)}))
}
tabs={filteredTabs.map((id) => ({id, label: getTabLabel(id)}))}
selectedTabId={activeTab}
onChange={(tab: IArticleActionInteractive) => {
this.setState({
Expand Down Expand Up @@ -132,7 +141,7 @@ export class InteractiveArticleActionsPanel
);
}

const item = items[0];
const item = items[0]; // only one item is supported in publishing tab

return (
<WithPublishTab
Expand Down Expand Up @@ -165,7 +174,7 @@ export class InteractiveArticleActionsPanel
);
}

const item = items[0];
const item = items[0]; // only one item is supported in correction tab

return (
<PanelWithHeader>
Expand Down

0 comments on commit 352a7a9

Please sign in to comment.