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

Added shortcut for edit mode #2845

Merged
merged 5 commits into from
Sep 29, 2017

Conversation

Akarshit
Copy link
Contributor

This PR adds a shortcut("e" key pressed) for switching in and out of Edit Mode. Fix for #2776

To test this PR ->

  1. Run reaction
  2. Use e key to switch in and out of Edit Mode.

Maybe we can discuss a better shortcut.

@aaronjudd
Copy link
Contributor

We can merge this into 1.4.3 if that happens, but it'd be easier if you want to update the PR to merge to marketplace, which we'll be bundling up in v1.5.0 this week. @zenweasel can you shepherd this into marketplace?

@brent-hoover
Copy link
Collaborator

@Akarshit What would you think about changing the key command for this to be Option/Alt-E?

@brent-hoover brent-hoover changed the base branch from master to marketplace September 19, 2017 07:31
@brent-hoover brent-hoover changed the base branch from marketplace to master September 19, 2017 07:31
@Akarshit Akarshit force-pushed the enhan-editShortcut branch 2 times, most recently from 4c5c15d to a720785 Compare September 20, 2017 16:42
@Akarshit Akarshit changed the base branch from master to marketplace September 20, 2017 16:43
@Akarshit Akarshit force-pushed the enhan-editShortcut branch 4 times, most recently from 0507738 to f911123 Compare September 20, 2017 16:54
@Akarshit
Copy link
Contributor Author

@zenweasel Updated the PR for marketplace and changed the shortcut to Option + e

Copy link
Collaborator

@brent-hoover brent-hoover left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of little code changes here

// hideActionView during isPreview === true
Reaction.hideActionView();
} else {
// // Reload previous actionView, if saved. Otherwise, don't show.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we aren't using this code any more let's just remove it? Sorry I didn't catch that earlier.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, removing the else portion. Didn't remove it before because I thought it might be something we have disabled temporarily.

const userIs = userWas === "customer" ? "administrator" : "customer";
handleViewContextChange(event, userIs);
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ESLint says missing semi-colon here

@Akarshit Akarshit force-pushed the enhan-editShortcut branch 3 times, most recently from 6b608de to 55c17d9 Compare September 21, 2017 12:47
@brent-hoover
Copy link
Collaborator

@jshimko This seems fine but I would like someone else to look at it and test.

@@ -34,6 +34,28 @@ const styles = {
}
};


const handleViewContextChange = (event, value) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These arrow functions should be moved inside the App component. This will ensure that if someone ever wanted to extend the App class, they get these as well.

ex: class MyClass extends App {}

if (Reaction.isPreview() === true) {
// Save last action view state
const saveActionViewState = Reaction.getActionView();
Reaction.setUserPreferences("reaction-dashboard", "savedActionViewState", saveActionViewState);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to import Reaction.

import { Reaction } from "/client/api";

@Akarshit
Copy link
Contributor Author

@mikemurray I have updated the PR. Thanks :)

@mikemurray mikemurray removed the request for review from jshimko September 29, 2017 21:05
@mikemurray mikemurray merged commit 55c84a6 into reactioncommerce:marketplace Sep 29, 2017
@spencern spencern mentioned this pull request Oct 11, 2017
@Akarshit Akarshit deleted the enhan-editShortcut branch February 23, 2021 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants