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

Expose simple value for FilePicker in "single selection" mode #1224

Merged

Conversation

AFaust
Copy link
Contributor

@AFaust AFaust commented Aug 31, 2016

Currently the FilePicker always exposes an array of (removed/added) values, even though the picker may be configured to only allow a single selection. For single-valued fields it is common (and expected) that the value is provided as a simple value and not wrapped inside a "dummy" array of a single element. This PR adds special handling for the case that multipleItemSelection is configured to false, yielding only the value of the itemKey without a wrapping array as the (added/removed) value of the field.

This PR also moves code that was specific to FilePicker from the BaseFormControl module (where it didn't belong) to the FilePicker itself.

Additionally it addresses a minor bug found during testing that could result in forms not being initialized correctly: calls to publishValue providing a Deferred may occur AFTER the widget has already been added to the DOM tree, resulting in the Deferred to never be resolved and thus the form to never complete its initialization.

@draperd
Copy link

draperd commented Sep 1, 2016

Thanks for raising this. I'll check out the branch and run the regression tests to verify nothing breaks (which I don't expect it will). I have to admit that I've implemented this picker in quite a hurry in order to progress with the FormsRuntimeService work so I'm very grateful to you for picking up these issues.

@draperd draperd merged commit e8f8e03 into Alfresco:develop Sep 1, 2016
@draperd
Copy link

draperd commented Sep 1, 2016

Regressions test passing, code merged - thanks again!

@AFaust AFaust deleted the FilePicker-singleSelection-formControlValue branch September 5, 2016 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants