mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-01-24 23:36:48 -06:00
Ensure that the save button should be disabled by default on the Sort/Filter dialog in the query tool. #5058
This commit is contained in:
parent
dd25bb0fff
commit
b4fcb61d64
@ -447,7 +447,7 @@ function prepareData(val, createMode=false) {
|
||||
|
||||
/* If its the dialog */
|
||||
function SchemaDialogView({
|
||||
getInitData, viewHelperProps, loadingText, schema={}, showFooter=true, isTabView=true, ...props}) {
|
||||
getInitData, viewHelperProps, loadingText, schema={}, showFooter=true, isTabView=true, checkDirtyOnEnableSave=false, ...props}) {
|
||||
const classes = useDialogStyles();
|
||||
/* Some useful states */
|
||||
const [dirty, setDirty] = useState(false);
|
||||
@ -773,7 +773,7 @@ function SchemaDialogView({
|
||||
<DefaultButton data-test="Reset" onClick={onResetClick} startIcon={<SettingsBackupRestoreIcon />} disabled={!dirty || saving} className={classes.buttonMargin}>
|
||||
{gettext('Reset')}
|
||||
</DefaultButton>
|
||||
<PrimaryButton data-test="Save" onClick={onSaveClick} startIcon={ButtonIcon} disabled={ !(viewHelperProps.mode === 'edit' ? dirty : true) || saving || Boolean(formErr.name) || !formReady}>
|
||||
<PrimaryButton data-test="Save" onClick={onSaveClick} startIcon={ButtonIcon} disabled={ !(viewHelperProps.mode === 'edit' || checkDirtyOnEnableSave ? dirty : true) || saving || Boolean(formErr.name) || !formReady}>
|
||||
{props.customSaveBtnName ? gettext(props.customSaveBtnName) : gettext('Save')}
|
||||
</PrimaryButton>
|
||||
</Box>
|
||||
@ -812,6 +812,7 @@ SchemaDialogView.propTypes = {
|
||||
customSaveBtnIconType: PropTypes.string,
|
||||
formClassName: CustomPropTypes.className,
|
||||
Notifier: PropTypes.object,
|
||||
checkDirtyOnEnableSave: PropTypes.bool,
|
||||
};
|
||||
|
||||
const usePropsStyles = makeStyles((theme)=>({
|
||||
|
@ -145,6 +145,7 @@ export default function FilterDialog({onClose, onSave}) {
|
||||
disableDialogHelp={true}
|
||||
isTabView={false}
|
||||
formClassName={classes.root}
|
||||
checkDirtyOnEnableSave={true}
|
||||
/>
|
||||
</>);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user