Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add SSO mappings to groups (#2175)
* feat: add SSO mappings to groups * add feature flag to conditionally render * fix EditGroupUsers * fix: update snap
- Loading branch information
Showing
14 changed files
with
243 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import { Add } from '@mui/icons-material'; | ||
import { Button, Chip, Stack, styled } from '@mui/material'; | ||
import Input from 'component/common/Input/Input'; | ||
import { useState } from 'react'; | ||
|
||
const StyledItemListAdd = styled('div')(({ theme }) => ({ | ||
display: 'flex', | ||
marginBottom: theme.spacing(1), | ||
'& > div:first-of-type': { | ||
width: '100%', | ||
marginRight: theme.spacing(1), | ||
'& > div:first-of-type': { | ||
width: '100%', | ||
}, | ||
}, | ||
})); | ||
|
||
interface IItemListProps { | ||
label: string; | ||
value: string[]; | ||
onChange: React.Dispatch<React.SetStateAction<string[]>>; | ||
} | ||
|
||
export const ItemList = ({ | ||
label, | ||
value, | ||
onChange, | ||
...props | ||
}: IItemListProps) => { | ||
const [inputValue, setInputValue] = useState(''); | ||
|
||
const addItem = () => { | ||
onChange(prev => [...prev, inputValue]); | ||
setInputValue(''); | ||
}; | ||
|
||
const removeItem = (value: string) => { | ||
onChange(prev => prev.filter(item => item !== value)); | ||
}; | ||
|
||
return ( | ||
<div {...props}> | ||
<StyledItemListAdd> | ||
<Input | ||
label={label} | ||
value={inputValue} | ||
onChange={e => setInputValue(e.target.value)} | ||
onKeyPress={e => { | ||
if (e.key === 'Enter') { | ||
addItem(); | ||
} | ||
}} | ||
/> | ||
<Button | ||
startIcon={<Add />} | ||
onClick={addItem} | ||
variant="outlined" | ||
color="primary" | ||
disabled={!inputValue.trim() || value.includes(inputValue)} | ||
> | ||
Add | ||
</Button> | ||
</StyledItemListAdd> | ||
<Stack flexDirection="row" flexWrap={'wrap'} gap={1}> | ||
{value?.map((item, index) => ( | ||
<Chip | ||
key={index} | ||
label={item} | ||
onDelete={() => removeItem(item)} | ||
/> | ||
))} | ||
</Stack> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.