Use form view to build password change form

This commit is contained in:
guerler
2016-08-15 10:03:14 -04:00
parent cb79eac22e
commit d7c6ca2bbd
14 changed files with 134 additions and 187 deletions
@@ -14,6 +14,7 @@ define(['utils/utils',
/** Available parameter types */
types: {
'text' : '_fieldText',
'password' : '_fieldText',
'select' : '_fieldSelect',
'data_column' : '_fieldSelect',
'genomebuild' : '_fieldSelect',
@@ -145,6 +146,7 @@ define(['utils/utils',
// create input element
return new Ui.Input({
id : 'field-' + input_def.id,
type : input_def.type,
area : input_def.area,
placeholder : input_def.placeholder,
onchange : input_def.onchange
@@ -1,95 +1,54 @@
/** Change password view */
define(['mvc/user/manage-user-information'], function( Manage ) {
define( [ 'mvc/form/form-view', 'mvc/ui/ui-misc' ], function( Form, Ui ) {
var ChangePassword = Backbone.View.extend({
initialize: function ( options ) {
var self = this;
this.model = options && options.model || new Backbone.Model( options );
this.form = new Form({
title : 'Change Password',
icon : 'fa-key',
inputs : [ { name: 'current', type: 'password', label: 'Current password' }, {
name: 'password', type: 'password', label: 'New password' }, {
name: 'confirm', type: 'password', label: 'Confirm password' }, {
name: 'token', type: 'hidden', hidden: true, ignore: null } ],
operations : {
'back' : new Ui.ButtonIcon({
icon : 'fa-caret-left',
tooltip : 'Return to user preferences',
title : 'Preferences',
onclick : function() {
//Implement go back;
}
})
},
buttons : {
'save' : new Ui.Button({
icon : 'fa-save',
tooltip : 'Save settings',
title : 'Save Password',
cls : 'ui-button btn btn-primary',
floating: 'clear',
onclick : function() { self._savePassword() }
})
}
});
this.setElement( this.form.$el );
},
var ChangePassword = Backbone.View.extend({
initialize: function ( data ) {
this.render( data );
},
/** renders the error message when manage user info page is rebuilt */
renderMessage: function( msg, status ) {
return '<div class="'+ ( status === "" ? 'done': status ) +'message'+ ( status === "error" ? " validate" : "" ) + '">'+ msg +'</div>';
},
/** renders the markup of change password feature */
render: function( data ) {
var template = "",
self = this;
$( '.user-pref' ).hide();
$('.change-password-section').remove();
Manage.ManageUserInformation.prototype.hideErrorDoneMessage();
if( data["status"] ) {
template = self.renderMessage( data["message"], data["status"] );
/** Saves the changed password */
_savePassword: function( self ) {
var self = this;
$.getJSON( Galaxy.root + 'api/user_preferences/change_password', this.form.data.create(), function( response ) {
self.form.message.update({
message : response.message,
status : response.status === 'error' ? 'danger' : 'success',
});
});
}
template = template + '<div class="change-password-section"> <h2>Change Password</h2>';
template = template + '<ul class="manage-table-actions">' +
'<li>' +
'<a class="action-button back-user-pref" target="galaxy_main">User preferences</a>' +
'</li></ul>';
template = template + '<div class="toolForm">' +
'<form name="change_password" id="change_password">' +
'<input type="hidden" name="display_top" value="'+ data["display_top"] +'"/>' +
'<div class="toolFormTitle">Change Password</div>';
if( data["token"] ) {
template = template + '<input type="hidden" name="token" value="'+ data["token"] +'"/>';
}
else {
template = template + '<div class="form-row">' +
'<label>Current password:</label>' +
'<input type="password" name="current" value="" size="40"/>' +
'</div>';
}
template = template + '<div class="form-row">' +
'<label>New password:</label>' +
'<input type="password" name="password" value="" size="40"/>' +
'</div>' +
'<div class="form-row">' +
'<label>Confirm:</label>' +
'<input type="password" name="confirm" value="" size="40"/>' +
'</div>' +
'<div class="form-row">' +
'<input type="button" class="save-password action-button" name="change_password_button" value="Save"/>' +
'</div>' +
'</form>' +
'</div>';
template = template + '</div>';
$('.user-preferences-all').append( template );
$('.save-password').on( 'click', function( e ) { self.savePassword( self, e ) } );
$('.back-user-pref').on( 'click', function( e ) {
$('.change-password-section').remove();
Manage.ManageUserInformation.prototype.hideErrorDoneMessage();
$( '.user-pref' ).show();
});
},
/** saves the changed password */
savePassword: function( self, e ) {
var url = Galaxy.root + 'api/user_preferences/change_password',
current = $( "input[name='current']" ).val(),
password = $( "input[name='password']" ).val(),
confirm = $( "input[name='confirm']" ).val(),
data = {},
messageBar = Manage.ManageUserInformation.prototype;
data = { 'change_password_button': true, 'password': password, 'current': current, 'confirm': confirm, 'token': "" }
$.getJSON( url, data, function( response ) {
if( response["status"] === 'error' ) {
messageBar.renderError( response["message"] );
}
else {
$('.change-password-section').remove();
messageBar.renderDone( response["message"] );
$( '.user-pref' ).show();
}
});
}
});
return {
ChangePassword: ChangePassword
};
});
return {
ChangePassword: ChangePassword
};
});
@@ -9,6 +9,7 @@ function( Manage, Password, Permissions, Keys, ToolboxFilter, ChangeCommunicatio
var UserPreferences = Backbone.View.extend({
initialize: function ( ) {
this.setElement( '<div/>' );
this.getUserPreferencesData()
},
@@ -26,9 +27,10 @@ var UserPreferences = Backbone.View.extend({
/** redirects to change password view */
callChangePassword: function( e ) {
$( '.user-pref' ).hide();
var url = Galaxy.root + 'api/user_preferences/change_password';
$.getJSON( url, function( data ) {
changePassword = new Password.ChangePassword( data );
var self = this;
$.getJSON( Galaxy.root + 'api/user_preferences/change_password', function( data ) {
changePassword = new Password.ChangePassword( data );
window.console.log( self.$el );
});
},
@@ -152,7 +154,7 @@ var UserPreferences = Backbone.View.extend({
}
template = template + "</div></div>";
// adds this markup to the center section of the Galaxy
$( "#center-panel" ).html( template );
this.$el.empty().append( template );
$( ".manage-userinfo" ).on( "click", self.callManageInfo );
$( ".change-password" ).on( "click", self.callChangePassword );
$( ".change-permissions" ).on( "click", self.callChangePermissions );
+1
View File
@@ -366,6 +366,7 @@
word-break: break-word;
display: inline;
vertical-align: middle;
font-weight: bold;
.portlet-title-text {
vertical-align: middle;
line-height: 22px;
@@ -484,69 +484,52 @@ class UserPreferencesAPIController( BaseAPIController, BaseUIController, UsesTag
}
@expose_api
def change_password( self, trans, token=None, **kwd):
def change_password( self, trans, password=None, confirm=None, current=None, token=None, **kwd):
"""
Provides a form with which one can change their password. If token is
Provides a form with which one can change their password. If token is
provided, don't require current password.
"""
status = None
message = kwd.get( 'message', '' )
user = None
if kwd.get( 'change_password_button', False ):
password = kwd.get( 'password', '' )
confirm = kwd.get( 'confirm', '' )
current = kwd.get( 'current', '' )
token_result = None
if token:
# If a token was supplied, validate and set user
token_result = trans.sa_session.query( trans.app.model.PasswordResetToken ).get(token)
if token_result and token_result.expiration_time > datetime.utcnow():
user = token_result.user
else:
return trans.show_error_message("Invalid or expired password reset token, please request a new one.")
token_result = None
if token:
# If a token was supplied, validate and set user
token_result = trans.sa_session.query( trans.app.model.PasswordResetToken ).get(token)
if token_result and token_result.expiration_time > datetime.utcnow():
user = token_result.user
else:
# The user is changing their own password, validate their current password
(ok, message) = trans.app.auth_manager.check_change_password(trans.user, current )
if ok:
user = trans.user
else:
status = 'error'
if user:
# Validate the new password
message = validate_password( trans, password, confirm )
if message:
status = 'error'
else:
# Save new password
user.set_password_cleartext( password )
# if we used a token, invalidate it and log the user in.
if token_result:
trans.handle_user_login(token_result.user)
token_result.expiration_time = datetime.utcnow()
trans.sa_session.add(token_result)
# Invalidate all other sessions
for other_galaxy_session in trans.sa_session.query( trans.app.model.GalaxySession ) \
.filter( and_( trans.app.model.GalaxySession.table.c.user_id == user.id,
trans.app.model.GalaxySession.table.c.is_valid == true(),
trans.app.model.GalaxySession.table.c.id != trans.galaxy_session.id ) ):
other_galaxy_session.is_valid = False
trans.sa_session.add( other_galaxy_session )
trans.sa_session.add( user )
trans.sa_session.flush()
trans.log_event( "User change password" )
if kwd.get('display_top', False) == 'True':
#return trans.response.send_redirect( url_for( '/', message='Password has been changed' ))
return { 'message': 'Password has been changed', 'status': 'done', 'display_top': True }
else:
#return trans.show_ok_message('The password has been changed and any other existing Galaxy sessions have been logged out (but jobs in histories in those sessions will not be interrupted).')
return { 'message': 'The password has been changed and any other existing Galaxy sessions have been logged out (but jobs in histories in those sessions will not be interrupted).', 'status': 'done', 'display_top': False }
return {
'token': token,
'status': status,
'message': message,
'display_top': kwd.get('redirect_home', False)
}
return { message: 'Invalid or expired password reset token, please request a new one.', 'status': 'error' }
else:
# The user is changing their own password, validate their current password
( ok, message ) = trans.app.auth_manager.check_change_password( trans.user, current )
if ok:
user = trans.user
else:
return { 'message': message, 'status': 'error' }
if user:
# Validate the new password
message = validate_password( trans, password, confirm )
if message:
return { 'message': message, 'status': 'error' }
else:
# Save new password
user.set_password_cleartext( password )
# if we used a token, invalidate it and log the user in.
if token_result:
trans.handle_user_login( token_result.user )
token_result.expiration_time = datetime.utcnow()
trans.sa_session.add( token_result )
# Invalidate all other sessions
for other_galaxy_session in trans.sa_session.query( trans.app.model.GalaxySession ) \
.filter( and_( trans.app.model.GalaxySession.table.c.user_id == user.id,
trans.app.model.GalaxySession.table.c.is_valid == true(),
trans.app.model.GalaxySession.table.c.id != trans.galaxy_session.id ) ):
other_galaxy_session.is_valid = False
trans.sa_session.add( other_galaxy_session )
trans.sa_session.add( user )
trans.sa_session.flush()
trans.log_event( "User change password" )
return { 'message': 'Password has been changed', 'status': 'done' }
return { 'message': 'Failed to determine user, access denied', 'status': 'error' }
@expose_api
def set_default_permissions( self, trans, cntrller='user_preferences', **kwd ):
+1 -1
View File
@@ -1 +1 @@
{"version":3,"file":"form-parameters.js","sources":["../../../src/mvc/form/form-parameters.js"],"names":["define","Utils","Ui","SelectContent","SelectLibrary","SelectFtp","ColorPicker","Backbone","Model","extend","types","text","select","data_column","genomebuild","data","data_collection","integer","float","boolean","drill_down","color","hidden","hidden_data","baseurl","library_data","ftpfile","create","input_def","fieldClass","this","type","field","call","options","_fieldSelect","_fieldText","Galaxy","emit","debug","undefined","value","_fieldData","View","id","extensions","optional","multiple","flavor","onchange","is_workflow","error_text","_","each","option","push","label","SelectClass","Select","display","Checkbox","Radio","RadioButton","_fieldDrilldown","Drilldown","area","isEmpty","$","isArray","str_value","i","String","Input","placeholder","_fieldSlider","Slider","precise","min","max","_fieldHidden","Hidden","info","_fieldBoolean","_fieldColor","_fieldLibrary","_fieldFtp"],"mappings":"AAGAA,QAAQ,cACA,iBACA,2BACA,2BACA,uBACA,0BACJ,SAAUC,EAAOC,EAAIC,EAAeC,EAAeC,EAAWC,GAG9D,MAAOC,UAASC,MAAMC,QAElBC,OACIC,KAAsB,aACtBC,OAAsB,eACtBC,YAAsB,eACtBC,YAAsB,eACtBC,KAAsB,aACtBC,gBAAsB,aACtBC,QAAsB,eACtBC,QAAsB,e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AAWhB,EAAUgB,GACnC7B,OAAkByC,MAAQ,MAAOf,MAAQ,SACvBe,MAAQ,KAAOf,MAAQ,UACzCQ,SAAcrB,EAAUqB,YAKhCkC,YAAa,SAAUvD,GACnB,MAAO,IAAItB,IACPsC,GAAc,SAAWhB,EAAUgB,GACnCK,SAAcrB,EAAUqB,YAKhCmC,cAAe,SAAUxD,GACrB,MAAO,IAAIxB,GAAcuC,MACrBC,GAAc,SAAWhB,EAAUgB,GACnCE,SAAclB,EAAUkB,SACxBC,SAAcnB,EAAUmB,SACxBE,SAAcrB,EAAUqB,YAMhCoC,UAAW,SAAUzD,GACjB,MAAO,IAAIvB,GAAUsC,MACjBC,GAAc,SAAWhB,EAAUgB,GACnCE,SAAclB,EAAUkB,SACxBC,SAAcnB,EAAUmB,SACxBE,SAAcrB,EAAUqB"}
{"version":3,"file":"form-parameters.js","sources":["../../../src/mvc/form/form-parameters.js"],"names":["define","Utils","Ui","SelectContent","SelectLibrary","SelectFtp","ColorPicker","Backbone","Model","extend","types","text","password","select","data_column","genomebuild","data","data_collection","integer","float","boolean","drill_down","color","hidden","hidden_data","baseurl","library_data","ftpfile","create","input_def","fieldClass","this","type","field","call","options","_fieldSelect","_fieldText","Galaxy","emit","debug","undefined","value","_fieldData","View","id","extensions","optional","multiple","flavor","onchange","is_workflow","error_text","_","each","option","push","label","SelectClass","Select","display","Checkbox","Radio","RadioButton","_fieldDrilldown","Drilldown","area","isEmpty","$","isArray","str_value","i","String","Input","placeholder","_fieldSlider","Slider","precise","min","max","_fieldHidden","Hidden","info","_fieldBoolean","_fieldColor","_fieldLibrary","_fieldFtp"],"mappings":"AAGAA,QAAQ,cACA,iBACA,2BACA,2BACA,uBACA,0BACJ,SAAUC,EAAOC,EAAIC,EAAeC,EAAeC,EAAWC,GAG9D,MAAOC,UAASC,MAAMC,QAElBC,OACIC,KAAsB,aACtBC,SAAsB,aACtBC,OAAsB,eACtBC,YAAsB,eACtBC,YAAsB,eACtBC,KAAsB,aACtBC,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,SAAUtD,GACrB,MAAO,IAAI3B,GAAG6D,YAAYnB,MACtBC,GAAc,SAAWhB,EAAUgB,GACnC7B,OAAkByC,MAAQ,MAAOf,MAAQ,SACvBe,MAAQ,KAAOf,MAAQ,UACzCQ,SAAcrB,EAAUqB,YAKhCkC,YAAa,SAAUvD,GACnB,MAAO,IAAIvB,IACPuC,GAAc,SAAWhB,EAAUgB,GACnCK,SAAcrB,EAAUqB,YAKhCmC,cAAe,SAAUxD,GACrB,MAAO,IAAIzB,GAAcwC,MACrBC,GAAc,SAAWhB,EAAUgB,GACnCE,SAAclB,EAAUkB,SACxBC,SAAcnB,EAAUmB,SACxBE,SAAcrB,EAAUqB,YAMhCoC,UAAW,SAAUzD,GACjB,MAAO,IAAIxB,GAAUuC,MACjBC,GAAc,SAAWhB,EAAUgB,GACnCE,SAAclB,EAAUkB,SACxBC,SAAcnB,EAAUmB,SACxBE,SAAcrB,EAAUqB"}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,2 +1,2 @@
webpackJsonp([4],[function(e,r,n){(function(e){var r=n(1),a=r,i=n(59).GalaxyApp,o=n(11),t=n(5),l=n(61);window.app=function(n,c){window.Galaxy=new i(n,c),Galaxy.debug("login app");var d=encodeURI(n.redirect);if(!n.show_welcome_with_login){var w=r.param({use_panels:"True",redirect:d});return void(window.location.href=Galaxy.root+"user/login?"+w)}var p=new l.PageLayoutView(e.extend(n,{el:"body",center:new o.CenterPanel({el:"#center"}),right:new o.RightPanel({title:t("Login required"),el:"#right"})}));a(function(){var e=r.param({redirect:d}),a=Galaxy.root+"user/login?"+e;p.render(),p.center.$("#galaxy_main").prop("src",n.welcome_url),p.right.$(".unified-panel-body").css("overflow","hidden").html('<iframe src="'+a+'" frameborder="0" style="width: 100%; height: 100%;"/>')})}}).call(r,n(3))}]);
webpackJsonp([4],[function(e,r,n){(function(e){var r=n(1),a=r,i=n(45).GalaxyApp,o=n(10),t=n(4),l=n(47);window.app=function(n,c){window.Galaxy=new i(n,c),Galaxy.debug("login app");var d=encodeURI(n.redirect);if(!n.show_welcome_with_login){var w=r.param({use_panels:"True",redirect:d});return void(window.location.href=Galaxy.root+"user/login?"+w)}var p=new l.PageLayoutView(e.extend(n,{el:"body",center:new o.CenterPanel({el:"#center"}),right:new o.RightPanel({title:t("Login required"),el:"#right"})}));a(function(){var e=r.param({redirect:d}),a=Galaxy.root+"user/login?"+e;p.render(),p.center.$("#galaxy_main").prop("src",n.welcome_url),p.right.$(".unified-panel-body").css("overflow","hidden").html('<iframe src="'+a+'" frameborder="0" style="width: 100%; height: 100%;"/>')})}}).call(r,n(2))}]);
//# sourceMappingURL=login.bundled.js.map
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,2 +1,2 @@
define(["utils/utils","mvc/ui/ui-misc","mvc/ui/ui-select-content","mvc/ui/ui-select-library","mvc/ui/ui-select-ftp","mvc/ui/ui-color-picker"],function(a,b,c,d,e,f){return Backbone.Model.extend({types:{text:"_fieldText",select:"_fieldSelect",data_column:"_fieldSelect",genomebuild:"_fieldSelect",data:"_fieldData",data_collection:"_fieldData",integer:"_fieldSlider","float":"_fieldSlider","boolean":"_fieldBoolean",drill_down:"_fieldDrilldown",color:"_fieldColor",hidden:"_fieldHidden",hidden_data:"_fieldHidden",baseurl:"_fieldHidden",library_data:"_fieldLibrary",ftpfile:"_fieldFtp"},create:function(a){var b=this.types[a.type],c="function"==typeof this[b]?this[b].call(this,a):null;return c||(c=a.options?this._fieldSelect(a):this._fieldText(a),Galaxy.emit.debug("form-parameters::_addRow()","Auto matched field type ("+a.type+").")),void 0===a.value&&(a.value=null),c.value(a.value),c},_fieldData:function(a){return new c.View({id:"field-"+a.id,extensions:a.extensions,optional:a.optional,multiple:a.multiple,type:a.type,flavor:a.flavor,data:a.options,onchange:a.onchange})},_fieldSelect:function(a){if(a.is_workflow)return this._fieldText(a);"data_column"==a.type&&(a.error_text="Missing columns in referenced dataset.");var c=a.data;c||(c=[],_.each(a.options,function(a){c.push({label:a[0],value:a[1]})}));var d=b.Select;switch(a.display){case"checkboxes":d=b.Checkbox;break;case"radio":d=b.Radio;break;case"radiobutton":d=b.RadioButton}return new d.View({id:"field-"+a.id,data:c,error_text:a.error_text||"No options available",multiple:a.multiple,optional:a.optional,onchange:a.onchange})},_fieldDrilldown:function(a){return a.is_workflow?this._fieldText(a):new b.Drilldown.View({id:"field-"+a.id,data:a.options,display:a.display,optional:a.optional,onchange:a.onchange})},_fieldText:function(c){if(c.options&&c.data)if(c.area=c.multiple,a.isEmpty(c.value))c.value=null;else if($.isArray(c.value)){var d="";for(var e in c.value){if(d+=String(c.value[e]),!c.multiple)break;d+="\n"}c.value=d}return new b.Input({id:"field-"+c.id,area:c.area,placeholder:c.placeholder,onchange:c.onchange})},_fieldSlider:function(a){return new b.Slider.View({id:"field-"+a.id,precise:"float"==a.type,is_workflow:a.is_workflow,min:a.min,max:a.max,onchange:a.onchange})},_fieldHidden:function(a){return new b.Hidden({id:"field-"+a.id,info:a.info})},_fieldBoolean:function(a){return new b.RadioButton.View({id:"field-"+a.id,data:[{label:"Yes",value:"true"},{label:"No",value:"false"}],onchange:a.onchange})},_fieldColor:function(a){return new f({id:"field-"+a.id,onchange:a.onchange})},_fieldLibrary:function(a){return new d.View({id:"field-"+a.id,optional:a.optional,multiple:a.multiple,onchange:a.onchange})},_fieldFtp:function(a){return new e.View({id:"field-"+a.id,optional:a.optional,multiple:a.multiple,onchange:a.onchange})}})});
define(["utils/utils","mvc/ui/ui-misc","mvc/ui/ui-select-content","mvc/ui/ui-select-library","mvc/ui/ui-select-ftp","mvc/ui/ui-color-picker"],function(a,b,c,d,e,f){return Backbone.Model.extend({types:{text:"_fieldText",password:"_fieldText",select:"_fieldSelect",data_column:"_fieldSelect",genomebuild:"_fieldSelect",data:"_fieldData",data_collection:"_fieldData",integer:"_fieldSlider","float":"_fieldSlider","boolean":"_fieldBoolean",drill_down:"_fieldDrilldown",color:"_fieldColor",hidden:"_fieldHidden",hidden_data:"_fieldHidden",baseurl:"_fieldHidden",library_data:"_fieldLibrary",ftpfile:"_fieldFtp"},create:function(a){var b=this.types[a.type],c="function"==typeof this[b]?this[b].call(this,a):null;return c||(c=a.options?this._fieldSelect(a):this._fieldText(a),Galaxy.emit.debug("form-parameters::_addRow()","Auto matched field type ("+a.type+").")),void 0===a.value&&(a.value=null),c.value(a.value),c},_fieldData:function(a){return new c.View({id:"field-"+a.id,extensions:a.extensions,optional:a.optional,multiple:a.multiple,type:a.type,flavor:a.flavor,data:a.options,onchange:a.onchange})},_fieldSelect:function(a){if(a.is_workflow)return this._fieldText(a);"data_column"==a.type&&(a.error_text="Missing columns in referenced dataset.");var c=a.data;c||(c=[],_.each(a.options,function(a){c.push({label:a[0],value:a[1]})}));var d=b.Select;switch(a.display){case"checkboxes":d=b.Checkbox;break;case"radio":d=b.Radio;break;case"radiobutton":d=b.RadioButton}return new d.View({id:"field-"+a.id,data:c,error_text:a.error_text||"No options available",multiple:a.multiple,optional:a.optional,onchange:a.onchange})},_fieldDrilldown:function(a){return a.is_workflow?this._fieldText(a):new b.Drilldown.View({id:"field-"+a.id,data:a.options,display:a.display,optional:a.optional,onchange:a.onchange})},_fieldText:function(c){if(c.options&&c.data)if(c.area=c.multiple,a.isEmpty(c.value))c.value=null;else if($.isArray(c.value)){var d="";for(var e in c.value){if(d+=String(c.value[e]),!c.multiple)break;d+="\n"}c.value=d}return new b.Input({id:"field-"+c.id,type:c.type,area:c.area,placeholder:c.placeholder,onchange:c.onchange})},_fieldSlider:function(a){return new b.Slider.View({id:"field-"+a.id,precise:"float"==a.type,is_workflow:a.is_workflow,min:a.min,max:a.max,onchange:a.onchange})},_fieldHidden:function(a){return new b.Hidden({id:"field-"+a.id,info:a.info})},_fieldBoolean:function(a){return new b.RadioButton.View({id:"field-"+a.id,data:[{label:"Yes",value:"true"},{label:"No",value:"false"}],onchange:a.onchange})},_fieldColor:function(a){return new f({id:"field-"+a.id,onchange:a.onchange})},_fieldLibrary:function(a){return new d.View({id:"field-"+a.id,optional:a.optional,multiple:a.multiple,onchange:a.onchange})},_fieldFtp:function(a){return new e.View({id:"field-"+a.id,optional:a.optional,multiple:a.multiple,onchange:a.onchange})}})});
//# sourceMappingURL=../../../maps/mvc/form/form-parameters.js.map
File diff suppressed because one or more lines are too long