TT#12781 ngcp-csc Remove Password section

Change-Id: I66faad60a03fddafb0748928874494633b2af5de
changes/84/12084/2
Carlo 9 years ago
parent 280d3a9889
commit aca392892b

@ -72,13 +72,6 @@ Ext.define('NgcpCsc.store.NavigationTree', {
routeId: 'reminder',
acl: ['administrator', 'restricted', 'host'],
leaf: true
}, {
text: 'Password',
iconCls: Ngcp.csc.icons.key,
viewType: 'password',
routeId: 'password',
acl: ['administrator', 'restricted', 'host'],
leaf: true
}, {
text: 'Theme Roller',
iconCls: Ngcp.csc.icons.paintbrush,

@ -599,87 +599,6 @@ Ext.define('Ngcp.csc.locales', {
sp: 'Mode'
}
},
password: {
title: {
en: 'Your personal settings.',
it: 'Your personal settings.',
de: 'Your personal settings.',
fr: 'Your personal settings.',
sp: 'Your personal settings.'
},
password_instructions: {
en: 'You may change the password for your self-administration login here.',
it: 'You may change the password for your self-administration login here.',
de: 'You may change the password for your self-administration login here.',
fr: 'You may change the password for your self-administration login here.',
sp: 'You may change the password for your self-administration login here.'
},
change_password: {
en: 'change password',
it: 'change password',
de: 'change password',
fr: 'change password',
sp: 'change password'
},
password_short: {
en: 'The password is too short, please use 6 characters at least.',
it: 'The password is too short, please use 6 characters at least.',
de: 'The password is too short, please use 6 characters at least.',
fr: 'The password is too short, please use 6 characters at least.',
sp: 'The password is too short, please use 6 characters at least.'
},
wrong_password: {
en: 'Wrong password, please verify your input.',
it: 'Wrong password, please verify your input.',
de: 'Wrong password, please verify your input.',
fr: 'Wrong password, please verify your input.',
sp: 'Wrong password, please verify your input.'
},
password_match: {
en: 'Passwords do not match, please try again.',
it: 'Passwords do not match, please try again.',
de: 'Passwords do not match, please try again.',
fr: 'Passwords do not match, please try again.',
sp: 'Passwords do not match, please try again.'
},
change_success: {
en: 'The password has been changed successfully.',
it: 'The password has been changed successfully.',
de: 'The password has been changed successfully.',
fr: 'The password has been changed successfully.',
sp: 'The password has been changed successfully.'
},
enter_current: {
en: 'Please enter your current password.',
it: 'Please enter your current password.',
de: 'Please enter your current password.',
fr: 'Please enter your current password.',
sp: 'Please enter your current password.'
},
field_labels: {
old_password: {
en: 'old password',
it: 'old password',
de: 'old password',
fr: 'old password',
sp: 'old password'
},
new_password: {
en: 'new password',
it: 'new password',
de: 'new password',
fr: 'new password',
sp: 'new password'
},
repeat_password: {
en: 'repeat',
it: 'repeat',
de: 'repeat',
fr: 'repeat',
sp: 'repeat'
}
}
},
callforward: {
title: {
en: 'Call forward settings.',

@ -1,47 +0,0 @@
Ext.define('NgcpCsc.view.pages.password.Password', {
extend: 'Ext.panel.Panel',
xtype: 'password',
controller: 'password',
viewModel: 'password',
initComponent: function() {
this.items = [{
layout: 'responsivecolumn',
xtype:'core-container',
items: [{
padding: '0 0 5 0',
html: Ngcp.csc.locales.common.password[localStorage.getItem('languageSelected')].toUpperCase()
}, {
padding: '0 0 5 0',
html: Ngcp.csc.locales.password.password_instructions[localStorage.getItem('languageSelected')]
}, {
userCls: 'big-66 small-100',
items:[{
xtype: 'passwordform'
},
{
layout: 'hbox',
margin: '20 0 0 0',
defaults: {
xtype: 'button',
flex: 1
},
items: [{
text: Ngcp.csc.locales.password.change_password[localStorage.getItem('languageSelected')].toLowerCase(),
margin: '0 5 0 0',
handler: 'submitForm'
}, {
text: Ngcp.csc.locales.common.reset_form[localStorage.getItem('languageSelected')].toLowerCase(),
handler: 'resetForm'
}]
}]
}
]
}];
this.callParent();
}
});

@ -1,38 +0,0 @@
Ext.define('NgcpCsc.view.pages.password.PasswordController', {
extend: 'Ext.app.ViewController',
alias: 'controller.password',
resetForm: function() {
this.getViewModel().set('credentials.old_password', '');
this.getViewModel().set('credentials.new_password', '');
this.getViewModel().set('credentials.repeat_password', '');
},
submitForm: function(field) {
var oldPassword = localStorage.getItem('password');
var enteredOldPassword = this.getViewModel().get('credentials.old_password');
var newPassword = this.getViewModel().get('credentials.new_password');
var repeatPassword = this.getViewModel().get('credentials.repeat_password');
if (enteredOldPassword === null) {
this.fireEvent('showmessage', false, Ngcp.csc.locales.password.enter_current[localStorage.getItem('languageSelected')]);
} else if (newPassword.length < 6 || repeatPassword.length < 6) {
this.fireEvent('showmessage', false, Ngcp.csc.locales.password.password_short[localStorage.getItem('languageSelected')]);
} else if (oldPassword === enteredOldPassword && newPassword === repeatPassword) {
localStorage.setItem('password', newPassword);
this.fireEvent('showmessage', true, Ngcp.csc.locales.password.change_success[localStorage.getItem('languageSelected')]);
} else if (newPassword !== repeatPassword) {
this.fireEvent('showmessage', false, Ngcp.csc.locales.password.password_match[localStorage.getItem('languageSelected')]);
} else if (oldPassword !== enteredOldPassword) {
this.fireEvent('showmessage', false, Ngcp.csc.locales.password.wrong_password[localStorage.getItem('languageSelected')]);
};
this.resetForm();
},
onEnterPressed: function (field, el) {
if (el.getKey() == el.ENTER) {
this.submitForm(field.id);
};
}
});

@ -1,48 +0,0 @@
Ext.define('NgcpCsc.view.pages.password.PasswordForm', {
extend: 'Ext.form.Panel',
xtype: 'passwordform',
defaults: {
width: '100%'
},
items: [{
xtype: 'container',
bind: '{username}',
margin: '0 0 10 0'
}, {
xtype: 'textfield',
inputType: 'password',
fieldLabel: Ngcp.csc.locales.password.field_labels.old_password[localStorage.getItem('languageSelected')],
name: 'account-old-password',
bind: '{credentials.old_password}',
listeners: {
specialKey: 'onEnterPressed'
}
}, {
xtype: 'fieldcontainer',
defaultType: 'textfield',
defaults: {
width: '100%'
},
items: [{
inputType: 'password',
fieldLabel: Ngcp.csc.locales.password.field_labels.new_password[localStorage.getItem('languageSelected')],
name: 'account-new-password',
bind: '{credentials.new_password}',
listeners: {
specialKey: 'onEnterPressed'
}
}, {
inputType: 'password',
fieldLabel: Ngcp.csc.locales.password.field_labels.repeat_password[localStorage.getItem('languageSelected')],
name: 'account-repeat-password',
bind: '{credentials.repeat_password}',
listeners: {
specialKey: 'onEnterPressed'
}
}]
}]
});

@ -1,18 +0,0 @@
Ext.define('NgcpCsc.view.pages.password.PasswordModel', {
extend: 'Ext.app.ViewModel',
alias: 'viewmodel.password',
links: {
credentials: {
type: 'NgcpCsc.model.Password',
id: Ext.id()
}
},
formulas: {
username: function(get) {
return Ext.String.format('{0}: <span class="account-username">{1}</span>', Ngcp.csc.locales.common.username[localStorage.getItem('languageSelected')], localStorage.getItem('username'));
}
}
});
Loading…
Cancel
Save