Disabled delete button in Targets & Settings, Fixed empty dropdown in targets section (#2254)
Signed-off-by: Vansh Bhatia <vansh.bhatia@mayadata.io>
This commit is contained in:
		
							parent
							
								
									371338fb0e
								
							
						
					
					
						commit
						360f299970
					
				| 
						 | 
					@ -164,6 +164,11 @@ chaosWorkflows:
 | 
				
			||||||
      once: Once
 | 
					      once: Once
 | 
				
			||||||
      seeAnalytics: See analytics
 | 
					      seeAnalytics: See analytics
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					createWorkflow:
 | 
				
			||||||
 | 
					  workflowCluster:
 | 
				
			||||||
 | 
					    activeCluster: Choose an active cluster
 | 
				
			||||||
 | 
					    none: None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
settings:
 | 
					settings:
 | 
				
			||||||
  teamingTab:
 | 
					  teamingTab:
 | 
				
			||||||
    deleteModal:
 | 
					    deleteModal:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -75,7 +75,8 @@ const ClusterInfo: React.FC<ClusterVarsProps> = ({ location }) => {
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
              </div>
 | 
					              </div>
 | 
				
			||||||
              <div className={classes.expDiv}>
 | 
					              <div className={classes.expDiv}>
 | 
				
			||||||
                <ButtonOutline handleClick={() => {}} isDisabled={false}>
 | 
					                {/* Set isDisabled to false when implemented */}
 | 
				
			||||||
 | 
					                <ButtonOutline handleClick={() => {}} isDisabled>
 | 
				
			||||||
                  <div className={classes.expDiv}>
 | 
					                  <div className={classes.expDiv}>
 | 
				
			||||||
                    <img
 | 
					                    <img
 | 
				
			||||||
                      src="/icons/bin-red.svg"
 | 
					                      src="/icons/bin-red.svg"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -26,11 +26,11 @@ const useStyles = makeStyles((theme: Theme) => ({
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  buttonBox: {
 | 
					  buttonBox: {
 | 
				
			||||||
    display: 'flex',
 | 
					    display: 'flex',
 | 
				
			||||||
    flexDirection: 'row',
 | 
					    paddingLeft: theme.spacing(3),
 | 
				
			||||||
 | 
					    paddingTop: theme.spacing(2.5),
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  copyText: {
 | 
					  copyText: {
 | 
				
			||||||
    display: 'flex',
 | 
					    display: 'flex',
 | 
				
			||||||
    flexDirection: 'row',
 | 
					 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  yamlLink: {
 | 
					  yamlLink: {
 | 
				
			||||||
    width: '90%',
 | 
					    width: '90%',
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -123,21 +123,23 @@ const WorkflowCluster: React.FC<WorkflowClusterProps> = ({ gotoStep }) => {
 | 
				
			||||||
        </Typography>
 | 
					        </Typography>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        <div className={classes.radiobutton}>
 | 
					        <div className={classes.radiobutton}>
 | 
				
			||||||
          <FormControl
 | 
					          <FormControl variant="outlined" className={classes.formControl}>
 | 
				
			||||||
            variant="outlined"
 | 
					 | 
				
			||||||
            className={classes.formControl}
 | 
					 | 
				
			||||||
            color="secondary"
 | 
					 | 
				
			||||||
          >
 | 
					 | 
				
			||||||
            <InputLabel className={classes.selectText}>
 | 
					            <InputLabel className={classes.selectText}>
 | 
				
			||||||
              {t('workflowCluster.header.selectCluster')}
 | 
					              {t('createWorkflow.workflowCluster.activeCluster')}
 | 
				
			||||||
            </InputLabel>
 | 
					            </InputLabel>
 | 
				
			||||||
            <Select
 | 
					            <Select
 | 
				
			||||||
 | 
					              labelId="Active Cluster"
 | 
				
			||||||
              value={name}
 | 
					              value={name}
 | 
				
			||||||
              onChange={handleChange}
 | 
					              onChange={handleChange}
 | 
				
			||||||
 | 
					              label="Active Cluster"
 | 
				
			||||||
              input={<Input />}
 | 
					              input={<Input />}
 | 
				
			||||||
              MenuProps={MenuProps}
 | 
					              MenuProps={MenuProps}
 | 
				
			||||||
              className={classes.selectText}
 | 
					              className={classes.selectText}
 | 
				
			||||||
 | 
					              color="secondary"
 | 
				
			||||||
            >
 | 
					            >
 | 
				
			||||||
 | 
					              <MenuItem value="" disabled>
 | 
				
			||||||
 | 
					                <em> {t('createWorkflow.workflowCluster.none')}</em>
 | 
				
			||||||
 | 
					              </MenuItem>
 | 
				
			||||||
              {clusterData.map((name: Cluster) => (
 | 
					              {clusterData.map((name: Cluster) => (
 | 
				
			||||||
                <MenuItem key={name.cluster_id} value={name.cluster_id}>
 | 
					                <MenuItem key={name.cluster_id} value={name.cluster_id}>
 | 
				
			||||||
                  {name.cluster_name}
 | 
					                  {name.cluster_name}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -65,7 +65,7 @@ const UserDetails: React.FC<PersonalDetailsProps> = ({
 | 
				
			||||||
              className={classes.avatarBackground}
 | 
					              className={classes.avatarBackground}
 | 
				
			||||||
              src={avatar}
 | 
					              src={avatar}
 | 
				
			||||||
            />
 | 
					            />
 | 
				
			||||||
            <Button className={classes.edit} onClick={handleOpen}>
 | 
					            <Button className={classes.edit} onClick={handleOpen} disabled>
 | 
				
			||||||
              {t('settings.userManagementTab.createUser.userDetails.button')}
 | 
					              {t('settings.userManagementTab.createUser.userDetails.button')}
 | 
				
			||||||
            </Button>
 | 
					            </Button>
 | 
				
			||||||
            <Unimodal isOpen={open} handleClose={handleClose} hasCloseBtn>
 | 
					            <Unimodal isOpen={open} handleClose={handleClose} hasCloseBtn>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
import { IconButton, Typography } from '@material-ui/core';
 | 
					import { Typography } from '@material-ui/core';
 | 
				
			||||||
import React from 'react';
 | 
					import React from 'react';
 | 
				
			||||||
import { useTranslation } from 'react-i18next';
 | 
					import { useTranslation } from 'react-i18next';
 | 
				
			||||||
import ButtonFilled from '../../../../../components/Button/ButtonFilled';
 | 
					import ButtonFilled from '../../../../../components/Button/ButtonFilled';
 | 
				
			||||||
| 
						 | 
					@ -20,7 +20,6 @@ const DelUser: React.FC<DelUserProps> = ({
 | 
				
			||||||
  tableDelete,
 | 
					  tableDelete,
 | 
				
			||||||
  teammingDel,
 | 
					  teammingDel,
 | 
				
			||||||
  handleTable,
 | 
					  handleTable,
 | 
				
			||||||
  disabled,
 | 
					 | 
				
			||||||
}) => {
 | 
					}) => {
 | 
				
			||||||
  const classes = useStyles();
 | 
					  const classes = useStyles();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -35,51 +34,6 @@ const DelUser: React.FC<DelUserProps> = ({
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return (
 | 
					  return (
 | 
				
			||||||
    <div>
 | 
					    <div>
 | 
				
			||||||
      {tableDelete ? (
 | 
					 | 
				
			||||||
        <>
 | 
					 | 
				
			||||||
          {/*  <MenuItem
 | 
					 | 
				
			||||||
            value="delete"
 | 
					 | 
				
			||||||
            onClick={() => {
 | 
					 | 
				
			||||||
              setOpen(true);
 | 
					 | 
				
			||||||
            }}
 | 
					 | 
				
			||||||
          >
 | 
					 | 
				
			||||||
            <IconButton disabled>
 | 
					 | 
				
			||||||
              <img alt="delete" src="./icons/bin.svg" />
 | 
					 | 
				
			||||||
            </IconButton>
 | 
					 | 
				
			||||||
            <Typography>Delete User</Typography>
 | 
					 | 
				
			||||||
          </MenuItem> */}
 | 
					 | 
				
			||||||
        </>
 | 
					 | 
				
			||||||
      ) : (
 | 
					 | 
				
			||||||
        <>
 | 
					 | 
				
			||||||
          {teammingDel ? (
 | 
					 | 
				
			||||||
            <>
 | 
					 | 
				
			||||||
              <IconButton
 | 
					 | 
				
			||||||
                disabled={disabled}
 | 
					 | 
				
			||||||
                onClick={() => {
 | 
					 | 
				
			||||||
                  setOpen(true);
 | 
					 | 
				
			||||||
                }}
 | 
					 | 
				
			||||||
              >
 | 
					 | 
				
			||||||
                <img alt="delete" src="./icons/bin-grey.svg" />
 | 
					 | 
				
			||||||
              </IconButton>
 | 
					 | 
				
			||||||
            </>
 | 
					 | 
				
			||||||
          ) : (
 | 
					 | 
				
			||||||
            <div
 | 
					 | 
				
			||||||
              role="button"
 | 
					 | 
				
			||||||
              tabIndex={0}
 | 
					 | 
				
			||||||
              onKeyDown={() => {
 | 
					 | 
				
			||||||
                setOpen(true);
 | 
					 | 
				
			||||||
              }}
 | 
					 | 
				
			||||||
              className={classes.delDiv}
 | 
					 | 
				
			||||||
              onClick={() => {
 | 
					 | 
				
			||||||
                setOpen(true);
 | 
					 | 
				
			||||||
              }}
 | 
					 | 
				
			||||||
            >
 | 
					 | 
				
			||||||
              <img src="./icons/bin.svg" alt="delete" className={classes.bin} />
 | 
					 | 
				
			||||||
              <Typography>Delete user </Typography>
 | 
					 | 
				
			||||||
            </div>
 | 
					 | 
				
			||||||
          )}
 | 
					 | 
				
			||||||
        </>
 | 
					 | 
				
			||||||
      )}
 | 
					 | 
				
			||||||
      <Unimodal isOpen={open} handleClose={handleClose} hasCloseBtn>
 | 
					      <Unimodal isOpen={open} handleClose={handleClose} hasCloseBtn>
 | 
				
			||||||
        <div className={classes.body}>
 | 
					        <div className={classes.body}>
 | 
				
			||||||
          <img src="./icons/userDel.svg" alt="lock" />
 | 
					          <img src="./icons/userDel.svg" alt="lock" />
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue