This repository has been archived by the owner on Dec 13, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #304 from metasfresh/dev-215
fix #215 - added shortcut for change doc status to complete
- Loading branch information
Showing
3 changed files
with
59 additions
and
5 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
src/components/shortcuts/DocumentStatusContextShortcuts.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import React, { Component } from 'react'; | ||
import { Shortcuts } from 'react-shortcuts'; | ||
|
||
class DocumentStatusContextShortcuts extends Component { | ||
handleShortcuts = (action) => { | ||
const { | ||
handleDocumentCompleteStatus | ||
} = this.props; | ||
|
||
switch (action) { | ||
case 'COMPLETE_STATUS': | ||
return handleDocumentCompleteStatus(); | ||
} | ||
} | ||
|
||
render() { | ||
return ( | ||
<Shortcuts | ||
name={"DOCUMENT_STATUS_CONTEXT"} | ||
handler = { this.handleShortcuts } | ||
targetNodeSelector = { "body" } | ||
isolate = { true } | ||
preventDefault = { true } | ||
stopPropagation = { true } | ||
/> | ||
) | ||
} | ||
} | ||
|
||
export default DocumentStatusContextShortcuts; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters