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

Allow widgetsForControl configuration in SitePicker #1346

Merged

Conversation

AFaust
Copy link
Contributor

@AFaust AFaust commented Dec 26, 2016

Currently the widgetsForControl structure is initialised in the postMixInProperties function which prevents any customisation of the structure by simple JSON model configuration. The current initialisation can be moved to a simple prototype override, allowing configuration. This PR does just that.

@draperd
Copy link

draperd commented Dec 28, 2016

The reason why the model was not defined as an attribute of the widget was because of the references to this.singleItemMode within the model. I think that this will result in that attribute always being false regardless of configuration overrides. Therefore the correct solution would be to take advantage of model processing (provided by alfresco/core/ObjectProcessingMixin) and use the processInstanceTokens processor and update the model to use a token that is substituted.

This requires a call to clone the model prior to use, a call to processObject and also requires that the "alfresco/pickers/SitePicker" also be updated.

As it is, I don't think I can merge this PR currently.

@AFaust
Copy link
Contributor Author

AFaust commented Dec 28, 2016

The base module Picker already uses ObjectProcessingMixin to process the widget. I already adapted the reference to itemKey to be a textual token {itemKey}. I may have missed the reference to singleItemMode but strangely the changed variant worked without issues locally. I'll check and update the PR for any references I may have missed.

@draperd
Copy link

draperd commented Dec 28, 2016

OK, thanks.

@AFaust
Copy link
Contributor Author

AFaust commented Dec 28, 2016

Done - I added additional properties for the configuration of the relevant labels (select button, select dialog, remove button) and if they are not externally configured they are defaulted in postMixInProperties. Instance tokens in the widget model then refer to these properties.

@draperd
Copy link

draperd commented Dec 28, 2016

Thanks for making the changes, I'll run a regression test suite as soon as the one on your other PR completes.

@draperd draperd merged commit e50007d into Alfresco:develop Dec 28, 2016
@draperd
Copy link

draperd commented Dec 28, 2016

Tested and merged

@AFaust AFaust deleted the SitePicker_widgetsForControlCustomisation branch December 29, 2016 11:51
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