-
Notifications
You must be signed in to change notification settings - Fork 21
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
ChangesetForm: Only allow changeset as argument, removing auto mode #124
Merged
josemarluedke
merged 12 commits into
josemarluedke:master
from
betocantu93:changeset-react-to-changes
Dec 19, 2020
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
acbb1b6
allow the changeset to be replaced
betocantu93 4aa4cfd
manual mode
betocantu93 e8f53c7
types and assert
betocantu93 a3d2a7f
separate context binding to a ToC component so we can let clients cre…
betocantu93 105edf7
update dummy
betocantu93 7e602fd
update tests
betocantu93 29ec610
lints
betocantu93 3bb803e
lints..
betocantu93 3e939a6
updates docs
betocantu93 9dfe74d
fix
betocantu93 2c794b9
comment update
betocantu93 ac5e5eb
finx lint
betocantu93 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
15 changes: 15 additions & 0 deletions
15
packages/changeset-form/addon/components/changeset-form/context/index.hbs
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,15 @@ | ||
{{yield | ||
(hash | ||
Input=(component "changeset-form/fields/input" changeset=@changeset) | ||
Textarea=(component "changeset-form/fields/textarea" changeset=@changeset) | ||
Select=(component "changeset-form/fields/select" changeset=@changeset) | ||
Checkbox=(component "changeset-form/fields/checkbox" changeset=@changeset) | ||
CheckboxGroup=(component | ||
"changeset-form/fields/checkbox-group" changeset=@changeset | ||
) | ||
Radio=(component "changeset-form/fields/radio" changeset=@changeset) | ||
RadioGroup=(component | ||
"changeset-form/fields/radio-group" changeset=@changeset | ||
) | ||
) | ||
}} |
55 changes: 18 additions & 37 deletions
55
packages/changeset-form/addon/components/changeset-form/index.hbs
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 |
---|---|---|
@@ -1,42 +1,23 @@ | ||
<form | ||
{{on "submit" this.handleSubmit}} | ||
{{on "reset" this.handleReset}} | ||
...attributes | ||
{{on "submit" (fn this.handleSubmit @changeset)}} | ||
{{on "reset" (fn this.handleReset @changeset)}} | ||
> | ||
{{yield | ||
(hash | ||
Input=(component "changeset-form/fields/input" | ||
changeset=this.changeset | ||
hasSubmitted=this.hasSubmitted | ||
<ChangesetForm::Context @changeset={{@changeset}} as |Form|> | ||
{{yield | ||
(hash | ||
Input=(component Form.Input hasSubmitted=this.hasSubmitted) | ||
Textarea=(component Form.Textarea hasSubmitted=this.hasSubmitted) | ||
Select=(component Form.Select hasSubmitted=this.hasSubmitted) | ||
Checkbox=(component Form.Checkbox hasSubmitted=this.hasSubmitted) | ||
CheckboxGroup=(component | ||
Form.CheckboxGroup hasSubmitted=this.hasSubmitted | ||
) | ||
Radio=(component Form.Radio hasSubmitted=this.hasSubmitted) | ||
RadioGroup=(component Form.RadioGroup hasSubmitted=this.hasSubmitted) | ||
) | ||
Textarea=(component "changeset-form/fields/textarea" | ||
changeset=this.changeset | ||
hasSubmitted=this.hasSubmitted | ||
) | ||
Select=(component "changeset-form/fields/select" | ||
changeset=this.changeset | ||
hasSubmitted=this.hasSubmitted | ||
) | ||
Checkbox=(component "changeset-form/fields/checkbox" | ||
changeset=this.changeset | ||
hasSubmitted=this.hasSubmitted | ||
) | ||
CheckboxGroup=(component "changeset-form/fields/checkbox-group" | ||
changeset=this.changeset | ||
hasSubmitted=this.hasSubmitted | ||
) | ||
Radio=(component "changeset-form/fields/radio" | ||
changeset=this.changeset | ||
hasSubmitted=this.hasSubmitted | ||
) | ||
RadioGroup=(component "changeset-form/fields/radio-group" | ||
changeset=this.changeset | ||
hasSubmitted=this.hasSubmitted | ||
) | ||
) | ||
this.changeset | ||
(hash | ||
hasSubmitted=this.hasSubmitted | ||
) | ||
}} | ||
@changeset | ||
(hash hasSubmitted=this.hasSubmitted) | ||
}} | ||
</ChangesetForm::Context> | ||
</form> |
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
1 change: 1 addition & 0 deletions
1
packages/changeset-form/app/components/changeset-form/context/index.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 @@ | ||
export { default } from '@frontile/changeset-form/components/changeset-form/context'; |
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 think you need a correspondent TS/Js file here, I'm not sure if template-only components work in addons.
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 think we are good, reference: https://discuss.emberjs.com/t/can-addons-use-template-only-components/17399/6?u=betocantu93