-
Notifications
You must be signed in to change notification settings - Fork 20
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 #124 from betocantu93/changeset-react-to-changes
ChangesetForm: Only allow changeset as argument, removing auto mode
- Loading branch information
Showing
8 changed files
with
254 additions
and
292 deletions.
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.