Fixed an issue where passwords entered in the 'Connect To Server' dialog were truncated. Fixes #7440

This commit is contained in:
Nikhil Mohite 2022-06-22 17:35:22 +05:30 committed by Akshay Joshi
parent 93bc1f3c57
commit d90b2621da
6 changed files with 18 additions and 8 deletions

View File

@ -28,6 +28,7 @@ Bug fixes
*********
| `Issue #7423 <https://redmine.postgresql.org/issues/7423>`_ - Fixed an issue where there is no setting to turn off notifications in the Query Tool.
| `Issue #7440 <https://redmine.postgresql.org/issues/7440>`_ - Fixed an issue where passwords entered in the 'Connect To Server' dialog were truncated.
| `Issue #7441 <https://redmine.postgresql.org/issues/7441>`_ - Ensure that the Query Editor should be focused when switching between query tool tabs.
| `Issue #7443 <https://redmine.postgresql.org/issues/7443>`_ - Fixed and issue where 'Use spaces' not working in the query tool.
| `Issue #7453 <https://redmine.postgresql.org/issues/7453>`_ - Fixed an issue where the Database restriction is not working.

View File

@ -161,7 +161,8 @@ export default class SubscriptionSchema extends BaseUISchema{
}
},
{
id: 'password', label: gettext('Password'), type: 'password', maxlength: null,
id: 'password', label: gettext('Password'), type: 'password',
controlProps: { maxLength: null},
group: gettext('Connection'),
mode: ['create', 'edit'], skipChange: true,
deps: ['connect_now'],

View File

@ -210,13 +210,16 @@ export default class ServerSchema extends BaseUISchema {
id: 'gss_encrypted', label: gettext('GSS encrypted?'), type: 'switch',
group: gettext('Connection'), mode: ['properties'], visible: obj.isConnected,
},{
id: 'password', label: gettext('Password'), type: 'password', maxlength: null,
id: 'password', label: gettext('Password'), type: 'password',
group: gettext('Connection'),
mode: ['create'],
deps: ['connect_now', 'kerberos_conn'],
visible: function(state) {
return state.connect_now && obj.isNew(state);
},
controlProps: {
maxLength: null
},
disabled: function(state) {return state.kerberos_conn;},
},{
id: 'save_password', label: gettext('Save password?'),
@ -396,6 +399,9 @@ export default class ServerSchema extends BaseUISchema {
disabled: function(state) {
return !state.use_ssh_tunnel;
},
controlProps: {
maxLength: null
},
readonly: obj.isConnected,
}, {
id: 'save_tunnel_password', label: gettext('Save password?'),

View File

@ -62,7 +62,7 @@ export default function ConnectServerContent({closeModal, data, onOK, setHeight}
</span>
</Box>
<Box marginTop='12px'>
<InputText inputRef={firstEleRef} type="password" value={formData['tunnel_password']} maxLength={null}
<InputText inputRef={firstEleRef} type="password" value={formData['tunnel_password']} controlProps={{maxLength:null}}
onChange={(e)=>onTextChange(e, 'tunnel_password')} onKeyDown={(e)=>onKeyDown(e)} />
</Box>
<Box marginTop='12px' marginBottom='12px'>
@ -85,7 +85,7 @@ export default function ConnectServerContent({closeModal, data, onOK, setHeight}
/* Set only if no tunnel password asked */
firstEleRef.current = ele;
}
}} type="password" value={formData['password']} maxLength={null}
}} type="password" value={formData['password']} controlProps={{maxLength:null}}
onChange={(e)=>onTextChange(e, 'password')} onKeyDown={(e)=>onKeyDown(e)}/>
</Box>
<Box marginTop='12px'>

View File

@ -326,7 +326,9 @@ FormInputDateTimePicker.propTypes = {
/* Use forwardRef to pass ref prop to OutlinedInput */
export const InputText = forwardRef(({
cid, helpid, readonly, disabled, maxlength = 255, value, onChange, controlProps, type, ...props }, ref) => {
cid, helpid, readonly, disabled, value, onChange, controlProps, type, ...props }, ref) => {
const maxlength = typeof(controlProps?.maxLength) != 'undefined' ? controlProps.maxLength : 255;
const classes = useStyles();
const patterns = {
@ -388,7 +390,6 @@ InputText.propTypes = {
label: PropTypes.string,
readonly: PropTypes.bool,
disabled: PropTypes.bool,
maxlength: PropTypes.number,
value: PropTypes.any,
onChange: PropTypes.func,
controlProps: PropTypes.object,

View File

@ -74,10 +74,11 @@ describe('FormComponents', ()=>{
/* InputText */
readonly={false}
disabled={false}
maxlength={50}
value={'thevalue'}
controlProps={{
extraprop: 'test'
extraprop: 'test',
maxLength: 50,
}}
/>);
});