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

Mobile: Add quick actions #2247

Merged
merged 27 commits into from
Feb 18, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
faedf46
Super basic QuickAction is working!
devonzuegel Dec 30, 2019
5cc99df
QuickAction successfully creates notes
devonzuegel Dec 31, 2019
21b340e
Update icons
devonzuegel Dec 31, 2019
b775726
Update icons and support new to-do
devonzuegel Dec 31, 2019
28c2e82
Update icons and support new to-do
devonzuegel Dec 31, 2019
be06fa2
Fixed
devonzuegel Dec 31, 2019
e15abc8
Extract QuickActions
devonzuegel Dec 31, 2019
c7f3983
It works as long as you go out of the edit screen (saving is not suff…
devonzuegel Dec 31, 2019
54cfaca
working? but still kinda buggy...
devonzuegel Dec 31, 2019
e0d1a3b
Cleanup
devonzuegel Jan 1, 2020
73b7cd5
Cleanup
devonzuegel Jan 1, 2020
ad335b2
Cleanup
devonzuegel Jan 1, 2020
c94d3e8
Use the same pattern as onJoplinLinkClick_
devonzuegel Jan 1, 2020
812feb2
Cleanup
devonzuegel Jan 1, 2020
ec94a00
Cleanup
devonzuegel Jan 2, 2020
2024fb1
Remove pluginAssets/index.js change
devonzuegel Jan 6, 2020
2ed5634
manual Andoid linking
tessus Jan 8, 2020
260460f
Transition QuickActions.js to .ts
devonzuegel Jan 27, 2020
c474ece
Merge branch 'mobile-quick-actions' of https://github.com/devonzuegel…
devonzuegel Jan 27, 2020
e7c3466
Unstage QuickActions.js in favor of .ts
devonzuegel Jan 27, 2020
5ccc2f7
Move QuickActions out of lib/
devonzuegel Jan 27, 2020
d06dddb
Add comment about userInfo in QuickActions
devonzuegel Jan 27, 2020
27e6c18
Remove redundant QuickActions file
devonzuegel Feb 9, 2020
7ac3e1e
Remove pluginAssets/index to resolve conflict
devonzuegel Feb 16, 2020
5fc3226
Merge branch 'master' into mobile-quick-actions
devonzuegel Feb 16, 2020
1086e8d
Update CONTRIBUTING.md to include test runner troubleshooting
devonzuegel Feb 16, 2020
91538ca
Add `npm run tsc` to Unit Tests docs
devonzuegel Feb 16, 2020
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
Prev Previous commit
Next Next commit
Use the same pattern as onJoplinLinkClick_
  • Loading branch information
devonzuegel committed Jan 6, 2020
commit c94d3e8283f04e64c680cfdc961ebbd38f3295d8
11 changes: 5 additions & 6 deletions ReactNativeClient/lib/QuickActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,17 @@ export default (dispatch, folderId/* , state*/) => {
]);

DeviceEventEmitter.addListener('quickActionShortcut', data => {
// Momentarily go back to `All notes` home screen to reset state.
// Momentarily go back to reset state, similar to what happens in
// onJoplinLinkClick_(). Easier to just go back, then go to the note since
// the Note screen doesn't handle reloading a different note.
// This hack is needed because otherwise you get this problem:
// The first time you create a note from the quick-action menu, it works
// perfectly. But if you do it again immediately later, it re-opens the
// page to that first note you made rather than creating an entirely new
// note. If you navigate around enough (which I think changes the redux
// state sufficiently or something), then it'll work again.
dispatch({
type: 'NAV_GO',
routeName: 'Notes',
smartFilterId: 'c3176726992c11e9ac940492261af972',
});

dispatch({type: 'NAV_BACK'});

if (data.type === 'New note') {
dispatch({
Expand Down
4 changes: 2 additions & 2 deletions ReactNativeClient/lib/components/screens/note.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ class NoteScreenComponent extends BaseScreenComponent {
if (!item) throw new Error(_('No item with ID %s', itemId));

if (item.type_ === BaseModel.TYPE_NOTE) {
// TODO: Maybe similar to this?
// Easier to just go back, then go to the note since
// the Note screen doesn't handle reloading a different note
// the Note screen doesn't handle reloading a different note.
// Similar to creating a new note via QuickActions.

this.props.dispatch({
type: 'NAV_BACK',
Expand Down