FBI-2293:Workspace> You can create a new ws with different password

Documentation
This commit is contained in:
Fabio Guachalla
2018-01-19 12:44:16 -04:00
committed by Rodrigo Quelca
parent 659bffc95a
commit 71f4dcd0c1

View File

@@ -6,8 +6,10 @@
Ext.Ajax.timeout = 300000;
Ext.onReady(function(){
var fieldNameWS,
wspaceAdmWS;
var fieldNameWS=new Ext.form.TextField({
fieldNameWS=new Ext.form.TextField({
id: 'NW_TITLE',
fieldLabel: _('ID_NAME'),
xtype:'textfield',
@@ -104,6 +106,12 @@ Ext.onReady(function(){
validator: function (v) {
v = v.trim();
return !/^\s+$/.test(v);
},
enableKeyEvents: true,
listeners: {
keyup: function () {
validationPassword();
}
}
},
{
@@ -117,8 +125,21 @@ Ext.onReady(function(){
validator: function (v) {
v = v.trim();
return !/^\s+$/.test(v);
},
enableKeyEvents: true,
listeners: {
keyup: function () {
validationPassword();
}
}
},
{
xtype: 'label',
fieldLabel: ' ',
id:'passwordConfirm',
width: 200,
labelSeparator: ''
}
]
});
@@ -167,7 +188,13 @@ Ext.onReady(function(){
formNewSite.getForm().reset();
Ext.getCmp('_idTest').enable();
}
/**
* Test for create new Site.
* @constructor
*/
function TestSite() {
if (validationPassword()) {
formNewSite.getForm().submit({
url: '../newSiteProxy/testingNW',
params: {
@@ -192,7 +219,7 @@ Ext.onReady(function(){
}
if (a.failureType === Ext.form.Action.SERVER_INVALID) {
var text = JSON.parse(a.response.responseText);
if (typeof(text.message) != 'undefined') {
if (typeof(text.message) !== 'undefined') {
Ext.Msg.alert(_('ID_ERROR'), _('ID_MYSQL_ERROR', text.message));
} else {
Ext.Msg.alert(_('ID_WARNING'), _('NEW_SITE_NOT_AVAILABLE'));
@@ -200,6 +227,9 @@ Ext.onReady(function(){
}
}
});
} else {
Ext.Msg.alert( _('ID_ERROR'), _('ID_PASSWORDS_DONT_MATCH'));
}
}
function createNW(nwTitle, aoDbWf, aoDbRb, aoDbRp, nwUsername, nwPassword, nwPassword2){
@@ -246,3 +276,25 @@ Ext.onReady(function(){
});
});
}
/**
* Validation if the field password and the field re-write password are similar.
* @returns {boolean}
*/
function validationPassword () {
var spanErrorConfirm,
imageErrorConfirm,
labelErrorConfirm;
if (Ext.getCmp('NW_PASSWORD').getValue() !== Ext.getCmp('NW_PASSWORD2').getValue()) {
spanErrorConfirm = '<span style="color: red; font: 9px tahoma,arial,helvetica,sans-serif;">';
imageErrorConfirm = '<img width="13" height="13" border="0" src="/images/delete.png">';
labelErrorConfirm = _('ID_PASSWORDS_DONT_MATCH');
Ext.getCmp('passwordConfirm').setText(spanErrorConfirm + imageErrorConfirm + labelErrorConfirm + '</span>', false);
Ext.getCmp('passwordConfirm').setVisible(true);
return false;
} else {
Ext.getCmp('passwordConfirm').setVisible(false);
return true;
}
}