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

marked 'not for publication' invisible publish tab #4356

Merged
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
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
Loading