forked from OpenCTI-Platform/opencti
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[frontend] Replaced Creation Floating Action Buttons for Events
- Loading branch information
1 parent
692a675
commit 568baed
Showing
20 changed files
with
264 additions
and
116 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
47 changes: 47 additions & 0 deletions
47
opencti-platform/opencti-front/src/components/CreateEntityControlledDial.tsx
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,47 @@ | ||
import { Button } from '@mui/material'; | ||
import React, { FunctionComponent } from 'react'; | ||
import { DrawerControlledDialProps } from '../private/components/common/drawer/Drawer'; | ||
import { useFormatter } from './i18n'; | ||
|
||
interface CreateEntityControlledDialProps extends DrawerControlledDialProps { | ||
entityType: string; | ||
color?: 'primary' | 'inherit' | 'secondary' | 'success' | 'error' | 'info' | 'warning'; | ||
size?: 'small' | 'medium' | 'large'; | ||
variant?: 'text' | 'contained' | 'outlined'; | ||
style?: React.CSSProperties; | ||
} | ||
|
||
const CreateEntityControlledDial: FunctionComponent<CreateEntityControlledDialProps> = ({ | ||
onOpen, | ||
entityType, | ||
color = 'primary', | ||
size = 'small', | ||
variant = 'contained', | ||
style, | ||
}) => { | ||
const { t_i18n } = useFormatter(); | ||
const buttonValue = t_i18n('', { | ||
id: 'Create ...', | ||
values: { entity_type: t_i18n(`entity_${entityType}`) }, | ||
}); | ||
return ( | ||
<Button | ||
onClick={onOpen} | ||
color={color} | ||
size={size} | ||
variant={variant} | ||
aria-label={buttonValue} | ||
title={buttonValue} | ||
sx={style ?? { | ||
marginLeft: '10px', | ||
padding: '7px 10px', | ||
}} | ||
> | ||
<div style={{ display: 'flex' }}> | ||
{buttonValue} | ||
</div> | ||
</Button> | ||
); | ||
}; | ||
|
||
export default CreateEntityControlledDial; |
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
31 changes: 0 additions & 31 deletions
31
...platform/opencti-front/src/private/components/common/menus/CreateEntityControlledDial.tsx
This file was deleted.
Oops, something went wrong.
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.