1) Added spacing for message and loading spinner.

2) Rename the GrantWizard Dialog.
3) Return the activeStep from disableNextStep function.
This commit is contained in:
Akshay Joshi 2021-12-21 18:00:07 +05:30
parent 9754b0fe14
commit 02b83146be
5 changed files with 16 additions and 15 deletions

View File

@ -34,6 +34,9 @@ const useStyles = makeStyles((theme)=>({
},
loader: {
color: theme.otherVars.loader.color,
},
message: {
marginLeft: '0.5rem',
}
}));
@ -46,7 +49,7 @@ export default function Loader({message}) {
<Box className={classes.root}>
<Box className={classes.loaderRoot}>
<CircularProgress className={classes.loader} />
<Typography>{message}</Typography>
<Typography className={classes.message}>{message}</Typography>
</Box>
</Box>
);

View File

@ -136,7 +136,7 @@ function Wizard({ stepList, onStepChange, onSave, className, ...props }) {
React.useEffect(() => {
if (props.disableNextStep) {
setdisableNext(props.disableNextStep());
setdisableNext(props.disableNextStep(activeStep));
}
});

View File

@ -17,9 +17,7 @@ const useStyles = makeStyles(() =>
stepPanel: {
height: '100%',
width: '100%',
// paddingLeft: '2em',
minHeight: '100px',
// paddingTop: '1em',
paddingBottom: '1em',
paddingRight: '1em',
overflow: 'auto',

View File

@ -135,7 +135,7 @@ export default function GrantWizard({ sid, did, nodeInfo, nodeData }) {
isVisible: false
}
];
var steps = ['Object Selection', 'Privilege Selection', 'Review Selection'];
var steps = ['Object Selection', 'Privilege Selection', 'Review'];
const [selectedObject, setSelectedObject] = React.useState([]);
const [selectedAcl, setSelectedAcl] = React.useState({});
const [msqlData, setSQL] = React.useState('');

View File

@ -81,8 +81,8 @@ define([
start_grant_wizard: function() {
// Declare Wizard dialog
if (!Alertify.wizardDialog) {
Alertify.dialog('wizardDialog', function factory() {
if (!Alertify.grantWizardDialog) {
Alertify.dialog('grantWizardDialog', function factory() {
// Generate wizard main container
var $container = $('<div class=\'wizard_dlg\' id=\'grantWizardDlg\'></div>');
@ -122,10 +122,10 @@ define([
<GrantWizard sid={sid} did={did} nodeInfo={info} nodeData={d} />
</Theme>,
document.getElementById('grantWizardDlg'));
Alertify.wizardDialog().elements.modal.style.maxHeight=0;
Alertify.wizardDialog().elements.modal.style.maxWidth='none';
Alertify.wizardDialog().elements.modal.style.overflow='visible';
Alertify.wizardDialog().elements.dimmer.style.display='none';
Alertify.grantWizardDialog().elements.modal.style.maxHeight=0;
Alertify.grantWizardDialog().elements.modal.style.maxWidth='none';
Alertify.grantWizardDialog().elements.modal.style.overflow='visible';
Alertify.grantWizardDialog().elements.dimmer.style.display='none';
}
}, 500);
@ -139,7 +139,7 @@ define([
// Clear the view and remove the react component.
return setTimeout((function () {
ReactDOM.unmountComponentAtNode(document.getElementById('grantWizardDlg'));
return Alertify.wizardDialog().destroy();
return Alertify.grantWizardDialog().destroy();
}), 500);
},
}
@ -147,12 +147,12 @@ define([
});
}
// Call Grant Wizard Dialog and set dimensions for wizard
Alertify.wizardDialog('').set({
Alertify.grantWizardDialog('').set({
onmaximize:function(){
Alertify.wizardDialog().elements.modal.style.maxHeight='initial';
Alertify.grantWizardDialog().elements.modal.style.maxHeight='initial';
},
onrestore:function(){
Alertify.wizardDialog().elements.modal.style.maxHeight=0;
Alertify.grantWizardDialog().elements.modal.style.maxHeight=0;
},
}).resizeTo(pgBrowser.stdW.lg, pgBrowser.stdH.lg);
},