diff --git a/scripts/apps/authoring-react/authoring-react.tsx b/scripts/apps/authoring-react/authoring-react.tsx index 95f95d2c8c..c3ef60bfcd 100644 --- a/scripts/apps/authoring-react/authoring-react.tsx +++ b/scripts/apps/authoring-react/authoring-react.tsx @@ -16,6 +16,7 @@ import { IAuthoringOptions, IStoreValueIncomplete, IAuthoringSectionTheme, + IAuthoringValidationErrors, } from 'superdesk-api'; import { ButtonGroup, @@ -253,7 +254,6 @@ export const getUiThemeFontSizeHeading = (value: IFontSizeOption) => { * `true` means field is available - `false` - hidden. */ export type IToggledFields = {[fieldId: string]: boolean}; -export type IAuthoringValidationErrors = {[fieldId: string]: string}; interface IStateLoaded { initialized: true; diff --git a/scripts/apps/authoring-react/authoring-section/authoring-section.tsx b/scripts/apps/authoring-react/authoring-section/authoring-section.tsx index 6e94c63e67..8ac58db142 100644 --- a/scripts/apps/authoring-react/authoring-section/authoring-section.tsx +++ b/scripts/apps/authoring-react/authoring-section/authoring-section.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import {IAuthoringSectionTheme, IAuthoringSectionClassNames, IFieldsV2, IVocabularyItem} from 'superdesk-api'; +import {IAuthoringSectionTheme, IFieldsV2, IVocabularyItem, IAuthoringValidationErrors} from 'superdesk-api'; import {Map} from 'immutable'; -import {IAuthoringValidationErrors, IToggledFields} from '../authoring-react'; +import {IToggledFields} from '../authoring-react'; import {AuthoringSectionField} from './authoring-section-field'; export interface IPropsAuthoringSection { diff --git a/scripts/core/menu/authoring-switch.ts b/scripts/core/menu/authoring-switch.ts index 95460ff52b..4a655c6a0b 100644 --- a/scripts/core/menu/authoring-switch.ts +++ b/scripts/core/menu/authoring-switch.ts @@ -23,8 +23,10 @@ export const setupAuthoringReact = (url: string) => { (extensionUrl) => extensionUrl.startsWith(trimStartExact(parsedPath.hash, '#')), ) != null; + const isNavigatingToPlanning = parsedPath.hash.startsWith('#/planning'); + const action: 'register' | 'deregister' = (() => { - if (isNavigatingToAnExtensionPage) { + if (isNavigatingToAnExtensionPage || isNavigatingToPlanning) { // regardless of user setting, authoring-react // must be enabled in extensions return 'register'; diff --git a/scripts/core/superdesk-api.d.ts b/scripts/core/superdesk-api.d.ts index be14ae9e89..1e914651cc 100644 --- a/scripts/core/superdesk-api.d.ts +++ b/scripts/core/superdesk-api.d.ts @@ -133,6 +133,8 @@ declare module 'superdesk-api' { export type IFieldsData = import('immutable').Map; + export type IAuthoringValidationErrors = {[fieldId: string]: string}; + /** * Check authoring-react.tsx for comments on individual methods. */