Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
thecalcc committed Nov 13, 2024
1 parent 570e447 commit a5ef6ab
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 31 deletions.
27 changes: 11 additions & 16 deletions scripts/apps/authoring-react/authoring-integration-wrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable react/no-multi-comp */
/* eslint-disable no-case-declarations */
/* eslint-disable react/display-name */
import React from 'react';
import {
IArticle,
Expand Down Expand Up @@ -70,11 +71,9 @@ const getAuthoringCosmeticActions = (exposed: IExposedFromAuthoring<IArticle>):
),
group: 'end',
priority: 1,
keyBindings: {
'ctrl+shift+i': () => {
exposed.printPreview();
}
},
keyBindings: {'ctrl+shift+i': () => {
exposed.printPreview();
}},
},
{
availableOffline: true,
Expand All @@ -89,11 +88,9 @@ const getAuthoringCosmeticActions = (exposed: IExposedFromAuthoring<IArticle>):
),
group: 'end',
priority: 2,
keyBindings: {
'ctrl+shift+t': () => {
exposed.toggleTheme();
}
}
keyBindings: {'ctrl+shift+t': () => {
exposed.toggleTheme();
}},
},
{
availableOffline: true,
Expand All @@ -108,11 +105,9 @@ const getAuthoringCosmeticActions = (exposed: IExposedFromAuthoring<IArticle>):
),
group: 'end',
priority: 3,
keyBindings: {
'ctrl+shift+c': () => {
exposed.configureTheme();
}
},
keyBindings: {'ctrl+shift+c': () => {
exposed.configureTheme();
}},
}];

export type ISideWidget = {
Expand Down Expand Up @@ -433,7 +428,7 @@ export class AuthoringIntegrationWrapper extends React.PureComponent<IPropsWrapp
availableOffline: false,
group: 'start',
priority: 1,
}]
}];
})}
getLanguage={(article) => article.language ?? 'en'}
onEditingStart={(article) => {
Expand Down
26 changes: 14 additions & 12 deletions scripts/apps/authoring-react/authoring-react.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1222,7 +1222,7 @@ export class AuthoringReact<T extends IBaseRestApiResponse> extends React.PureCo
state.profile,
state.profile,
state.fieldsDataWithChanges,
)
);
},
configureTheme: () => {
this.showThemeConfigModal(state);
Expand Down Expand Up @@ -1373,9 +1373,10 @@ export class AuthoringReact<T extends IBaseRestApiResponse> extends React.PureCo
}

const extraPrimaryToolbarWidgets = this.props.getAuthoringPrimaryToolbarWidgets?.(exposed) ?? [];
const secondaryToolbarWidgets = this.props.getSecondaryToolbarWidgets(exposed);
const secondaryToolbarWidgets = this.props.getSecondaryToolbarWidgets?.(exposed) ?? [];

const allKeyBindings: IKeyBindings = {
...getKeyBindingsFromActions(secondaryToolbarWidgets),
...getKeyBindingsFromActions(authoringOptions?.actions ?? []),
...keyBindingsFromAuthoringActions,
...widgetKeybindings,
Expand Down Expand Up @@ -1417,22 +1418,23 @@ export class AuthoringReact<T extends IBaseRestApiResponse> extends React.PureCo
<Layout.AuthoringFrame
header={primaryToolbarWidgets.length < 1
&& extraPrimaryToolbarWidgets?.length < 1 ? null : (
<SubNav>
<AuthoringToolbar
entity={state.itemWithChanges}
coreWidgets={primaryToolbarWidgets}
extraWidgets={extraPrimaryToolbarWidgets}
backgroundColor={authoringOptions?.toolbarBgColor}
/>
</SubNav>
)}
<SubNav>
<AuthoringToolbar
entity={state.itemWithChanges}
coreWidgets={primaryToolbarWidgets}
extraWidgets={extraPrimaryToolbarWidgets}
backgroundColor={authoringOptions?.toolbarBgColor}
/>
</SubNav>
)
}
main={(
<Layout.AuthoringMain
noPaddingForContent
headerCollapsed={this.props.headerCollapsed}
toolbarCustom
toolBar={secondaryToolbarWidgets == null ? null : (
<SubNav className='px-2'>
<SubNav className="px-2">
<AuthoringToolbar
entity={state.itemWithChanges}
coreWidgets={secondaryToolbarWidgets}
Expand Down
2 changes: 2 additions & 0 deletions scripts/apps/authoring/authoring/authoring-topbar2-react.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable react/no-multi-comp */
/* eslint-disable react/display-name */
import React from 'react';
import {IArticle, IAuthoringActionType, ITopBarWidget} from 'superdesk-api';
import {flatMap} from 'lodash';
Expand Down
2 changes: 1 addition & 1 deletion scripts/core/superdesk-api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ declare module 'superdesk-api' {
getInlineToolbarActions?(options: IExposedFromAuthoring<T>): IAuthoringOptions<T>;

getAuthoringPrimaryToolbarWidgets?(options: IExposedFromAuthoring<T>): Array<ITopBarWidget<T>>;
getSecondaryToolbarWidgets: (exposed: IExposedFromAuthoring<T>) => Array<ITopBarWidget<T>>;
getSecondaryToolbarWidgets?: (exposed: IExposedFromAuthoring<T>) => Array<ITopBarWidget<T>>;

onEditingStart?(item: T): void;
onEditingEnd?(item: T): void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,6 @@ export class RundownTemplateViewEdit extends React.PureComponent<IProps, IState>
}}
getSideWidgetIdAtIndex={() => ''}
getAuthoringPrimaryToolbarWidgets={() => []}
secondaryToolbarWidgets={[]}
disableWidgetPinning
/>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,6 @@ export class RundownViewEditComponent extends React.PureComponent<IProps, IState
};
}}
getAuthoringPrimaryToolbarWidgets={() => []}
secondaryToolbarWidgets={[]}
getSidebarWidgetsCount={({item}) => {
return getAvailableSideWidgets(item).length;
}}
Expand Down

0 comments on commit a5ef6ab

Please sign in to comment.