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

Authoring-react keybindings #4196

Merged
Prev Previous commit
Next Next commit
fix lint
  • Loading branch information
dzonidoo committed Feb 1, 2023
commit 3713c6a731a95e1aedc0cabb643a3b0c3644092a
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ function getInlineToolbarActions(options: IExposedFromAuthoring<IArticle>): IAut
actions.push(getManageHighlights());
}


// eslint-disable-next-line no-case-declarations
const manageDesksButton: ITopBarWidget<IArticle> = ({
group: 'start',
Expand Down Expand Up @@ -213,7 +212,7 @@ function getInlineToolbarActions(options: IExposedFromAuthoring<IArticle>): IAut
keyBindings: {
'ctrl+shift+u': () => {
stealLock();
}
},
},
availableOffline: false,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ import {CompareArticleVersionsModal} from './toolbar/compare-article-versions';
import {httpRequestJsonLocal} from 'core/helpers/network';
import {getArticleAdapter} from './article-adapter';
import {ui} from 'core/ui-utils';
import TranslateModal from './toolbar/translate-modal';
import {MarkForDesksModal} from './toolbar/mark-for-desks/mark-for-desks-modal';

function getAuthoringActionsFromExtensions(
Expand Down Expand Up @@ -212,7 +211,6 @@ const getSaveAsTemplate = (getItem: () => IArticle): IAuthoringAction => ({
),
});


const getTranslateModal = (getItem: () => IArticle): IAuthoringAction => ({
label: gettext('Translate'),
onTrigger: () => {
Expand Down
11 changes: 1 addition & 10 deletions scripts/apps/authoring-react/authoring-react.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1091,8 +1091,6 @@ export class AuthoringReact<T extends IBaseRestApiResponse> extends React.PureCo
},
keyBindings: {
'ctrl+shift+y': () => {

console.log('trigered');
this.setState({
...state,
spellcheckerEnabled: nextValue,
Expand Down Expand Up @@ -1129,8 +1127,6 @@ export class AuthoringReact<T extends IBaseRestApiResponse> extends React.PureCo
},
keyBindings: {
'ctrl+shift+y': () => {
console.log('trigered');

const nextValue = true;

this.setState({
Expand All @@ -1151,9 +1147,6 @@ export class AuthoringReact<T extends IBaseRestApiResponse> extends React.PureCo
}
}

console.log(coreActions);


return [...coreActions, ...actions];
});
}}
Expand All @@ -1173,8 +1166,6 @@ export class AuthoringReact<T extends IBaseRestApiResponse> extends React.PureCo
}
});



const pinned = state.openWidget?.pinned === true;

const preview = {
Expand Down Expand Up @@ -1214,7 +1205,7 @@ export class AuthoringReact<T extends IBaseRestApiResponse> extends React.PureCo
keyBindings={
{
...preview.keybindings,
...getKeyBindingsFromActions(authoringOptions.actions)
...getKeyBindingsFromActions(authoringOptions.actions),
}
}
>
Expand Down
2 changes: 1 addition & 1 deletion scripts/apps/authoring-react/fields/date/editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class Editor extends React.PureComponent<IProps> {
}}
dateFormat={appConfig.view.dateformat}
locale={getLocaleForDatePicker(this.props.language)}
shortcuts={this.props.config?.shortcuts?.map(({label, value, term}) => {
headerButtonBar={this.props.config?.shortcuts?.map(({label, value, term}) => {
return {
label,
days: differenceInCalendarDays(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class MarkForDesksModal extends React.PureComponent<IProps, IState> {
>
<Spacer v gap="8">
<MultiSelect
onChange={({value}) => {
onChange={(value) => {
this.setState({
...this.state,
selectedDesks: value.map((desk) => desk._id),
Expand Down