feat(component): add form-errors custom element #108
Conversation
6315599
to
0f147d3
Compare
src/component/form-errors.html
Outdated
<template> | ||
<p class="help-block" repeat.for="message of messages">${message}</p> | ||
</template> | ||
|
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.
Remove newline.
<template> | ||
<p repeat.for="message of messages">${message}</p> | ||
</template> | ||
|
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.
Remove newline.
src/config.js
Outdated
// ValidationResult instance | ||
errorMessage: error => error.message, | ||
errorValid : error => error.valid | ||
|
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.
Remove newline
constructor(config) { | ||
this.config = config.configurations; |
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.
Align consecutive assignments
<association-select | ||
attributes.bind = "formField.element.attributes" | ||
multiple.bind = "formField.element.multiple" | ||
value.bind = "formField.value" | ||
property.bind = "formField.element.property" | ||
repository.bind = "formField.element.repository" | ||
resource.bind = "formField.element.resource" | ||
|
||
type.bind = "formField.element.selectType" |
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.
What's this?
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 allows for checkboxes or select type to be chose for aurelia-orm's association-select component.
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.
It might be best to make this part of a seperate pull request
src/component/form-fields.js
Outdated
@@ -10,7 +10,7 @@ export class FormFields { | |||
@bindable({defaultBindingMode: bindingMode.twoWay}) | |||
model | |||
|
|||
@bindable messages | |||
@bindable errors |
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.
Semicolon (apply everywhere);
src/component/form-errors.js
Outdated
} | ||
|
||
} | ||
|
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.
Remove newline
src/component/form-errors.js
Outdated
export class FormErrors { | ||
|
||
@bindable | ||
errors; |
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.
Put on same line as @bindable
Add a globalized form-errors component. Also adds the association-select's type bindable.