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

ChangesetForm: Only allow changeset as argument, removing auto mode #124

Merged
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<form
{{on "submit" this.handleSubmit}}
{{on "reset" this.handleReset}}
{{did-insert this.setup}}
josemarluedke marked this conversation as resolved.
Show resolved Hide resolved
{{did-update this.setup @changeset}}
{{did-update this.setup @model}}
...attributes
>
{{yield
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@ interface ChangesetFormArgs {
}

export default class ChangesetForm extends Component<ChangesetFormArgs> {
changeset!: BufferedChangeset;
@tracked changeset!: BufferedChangeset;
josemarluedke marked this conversation as resolved.
Show resolved Hide resolved

@tracked hasSubmitted = false;

constructor(owner: unknown, args: ChangesetFormArgs) {
josemarluedke marked this conversation as resolved.
Show resolved Hide resolved
super(owner, args);

@action
setup() {
if (typeof this.args.changeset === 'undefined') {
assert(
'@model must be defined on <ChangesetForm> component if you do not provide a @changeset argument',
Expand Down