-
Notifications
You must be signed in to change notification settings - Fork 12
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
editor: fix hidden field with value from the model #234
Conversation
6313b74
to
80da232
Compare
@jma I think this PR closes rero/rero-ils#1119, at least the main part of if. |
@@ -62,6 +62,7 @@ export class ArrayTypeComponent extends FieldArrayType implements OnInit { | |||
const numberOfItemsToRemove = this.field.fieldGroup.length - minItems; | |||
// remove the extra elements | |||
// force removing the elements in the next event loop else this cause errors when removing multiple values | |||
// TODO: try to remove this hack | |||
setTimeout(() => { |
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.
setTimeout
cannot be removed here?
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.
Commit message: Some fields containing values given with the input model
, "given with" is not clear, I think. Maybe "coming from"?
Typo in the commit message: As ngx formly made the think cleaner these hacks have been removed.
to `As ngx formly made the think cleaner these hacks have
been removed.
And do not forget to close the related issue: #234 (comment)
5890107
to
4d56ab1
Compare
Some fields containing values comming from the input model should be visible after the editor initialization. This is not the case with a recent version of ngx formly. This is due to the use of bad hack `setTimeout` at several places in the code. As ngx formly made the think cleaner these hacks have been removed. * Cleans hidden field list at the component destruction instead of initialization. * Reloads the JSONSchema once the model has changed. * Rewrites the add field component by using observers only. Co-Authored-by: Johnny Mariéthoz <Johnny.Mariethoz@rero.ch> Co-Authored-by: Sébastien Délèze <sebastien.deleze@rero.ch>
Some fields containing values given with the input model should be visible
after the editor initializations. This is not the case with a recent version of
ngx formly. This is due to the use of bad hack
setTimeout
at severalplaces in the code. As ngx formly made the think cleaner these hacks have
been removed.
initialization.
hidden only when the values are reset.
Co-Authored-by: Johnny Mariéthoz Johnny.Mariethoz@rero.ch
Why are you opening this PR?
rero-ils-ui
project.How to test?
rero-ils-ui
start the admin server, import a record from the BNF containing adimensions
value. This field should not be hidden. Check that not error is present in the console.Code review check list