-
Notifications
You must be signed in to change notification settings - Fork 140
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
Add a WYSIWYG-esque editor for instructions #1426
Open
meg2208
wants to merge
12
commits into
popcodeorg:master
Choose a base branch
from
meg2208:instructions-WYSIWYG
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
3073cc9
add react-simplemde-editor dependency
meg2208 c1ad7d8
WYSIWYG-esque editor for instructions; controlled component pattern
meg2208 2864084
minor styling for instructions editor
meg2208 1544c8e
proper behavior on instructions cancel, load new project
meg2208 c81a8cf
add newline; remove unnecessary id
meg2208 4bfae0f
move css to simple-mde.css; updates from code review
meg2208 e2588eb
add logic explanation to getCurrentProjectInstructions
meg2208 04a6912
displayedInstructions --> draftInstructions
meg2208 903ad12
fix lint error
meg2208 d911f6c
disable stylelint for venor css
meg2208 229e3e1
Merge branch 'master' into instructions-WYSIWYG
meg2208 19a5f33
add react-coroutine, async load InstructionsEditor and fade in
meg2208 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import React from 'react'; | ||
import Coroutine from 'react-coroutine'; | ||
|
||
async function* InstructionsEditorAsync({ | ||
instructions, | ||
projectKey, | ||
onCancelEditing, | ||
onContinueEditing, | ||
onSaveChanges, | ||
}) { | ||
yield <span />; | ||
const {'default': InstructionsEditor} = await import('./InstructionsEditor'); | ||
return ( | ||
<InstructionsEditor | ||
instructions={instructions} | ||
projectKey={projectKey} | ||
onCancelEditing={onCancelEditing} | ||
onContinueEditing={onContinueEditing} | ||
onSaveChanges={onSaveChanges} | ||
/> | ||
); | ||
} | ||
|
||
export default Coroutine.create(InstructionsEditorAsync); |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn’t sure what
continueEditingInstructions
was based on the name (had to look at where it was used)—maybe we could do something more explicit/verbose likeupdateInProgressInstructions
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is of course the camel case version of the action name, and for the action I was following the pattern of the actions
{verb}_EDITING_INSTRUCTIONS
. Other verbs arestart
andcancel
. You would rather break that pattern? It just seems a bit less intuitive but I'm fine with it. So it would beUPDATE_IN_PROGRESS_INSTRUCTIONS
? I figurecontinueEditingInstructions
fits in nicely withstartEditingInstructions
andcancelEditingInstructions
. Another idea for something more verbose iscontinueEditingUnsavedInstructions
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely understand the appeal of the symmetry, but ultimately I think clarity/expressiveness is the overriding concern here. Given that you went with
draftInstructions
for the property name (which I like) I would proposeupdateDraftInstructions
here. WDYT?