-
Notifications
You must be signed in to change notification settings - Fork 946
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[frontend] add user confidence control in creation/edition forms (#5697)
Co-authored-by: Laurent Bonnet <laurent.bonnet@filigran.io> Co-authored-by: Laurent Bonnet <146674147+labo-flg@users.noreply.github.com>
- Loading branch information
1 parent
f7f82ea
commit 949fac8
Showing
93 changed files
with
889 additions
and
227 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
31 changes: 31 additions & 0 deletions
31
opencti-platform/opencti-front/src/components/AlertConfidenceForEntity.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,31 @@ | ||
import React from 'react'; | ||
import Alert from '@mui/material/Alert'; | ||
import useConfidenceLevel from '../utils/hooks/useConfidenceLevel'; | ||
import { useFormatter } from './i18n'; | ||
|
||
type AlertConfidenceForEntityProps = { | ||
entity: { | ||
confidence?: number | null | ||
} | ||
}; | ||
|
||
const AlertConfidenceForEntity: React.FC<AlertConfidenceForEntityProps> = ({ entity }) => { | ||
const { t_i18n } = useFormatter(); | ||
const { checkConfidenceForEntity } = useConfidenceLevel(); | ||
|
||
if (checkConfidenceForEntity(entity)) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<Alert | ||
severity="warning" | ||
variant="outlined" | ||
style={{ marginTop: 20, marginBottom: 20 }} | ||
> | ||
{t_i18n('Your confidence level is insufficient to edit this object.')} | ||
</Alert> | ||
); | ||
}; | ||
|
||
export default AlertConfidenceForEntity; |
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
Oops, something went wrong.