Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[frontend] more alias button aligned with content (#9616) #9758

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import StixCoreObjectEnrichment from '../stix_core_objects/StixCoreObjectEnrichm
// Do not use it for new code.
const useStyles = makeStyles(() => ({
alias: {
margin: '4px 7px 0 0',
marginRight: '4px',
fontSize: 12,
lineHeight: '12px',
height: 28,
Expand Down Expand Up @@ -448,7 +448,7 @@ const StixDomainObjectHeader = (props) => {
</FormControl>
</div>
)}
<div style={{ display: 'flex' }}>
<div style={{ display: 'flex', marginTop: '4px' }}>
{(!noAliases && aliases.length > 0) && (
<div>
{R.take(5, aliases).map(
Expand All @@ -467,7 +467,12 @@ const StixDomainObjectHeader = (props) => {
>
<Tooltip title={label}>
<Chip
classes={{ root: classes.alias }}
sx={{
marginRight: theme.spacing(1),
fontSize: 12,
lineHeight: '12px',
height: 28,
}}
label={truncate(label, 40)}
onDelete={
enableReferences
Expand All @@ -489,6 +494,7 @@ const StixDomainObjectHeader = (props) => {
unmountOnExit={true}
>
<div>
aze
<Formik
initialValues={{ new_alias: '' }}
onSubmit={onSubmitCreateAlias}
Expand Down Expand Up @@ -533,31 +539,33 @@ const StixDomainObjectHeader = (props) => {
</Slide>
)}
{!noAliases && (
<Security needs={[KNOWLEDGE_KNUPDATE]}>
{aliases.length > 5 ? (
<IconButton
color="primary"
aria-label="More"
onClick={handleToggleOpenAliases}
size="small"
>
<DotsHorizontalCircleOutline fontSize="small" />
</IconButton>
) : (
<IconButton
color="primary"
aria-label="Alias"
onClick={handleToggleCreateAlias}
size="small"
>
{openAlias ? (
<Close fontSize="small" />
) : (
<Add fontSize="small" />
)}
</IconButton>
)}
</Security>
<div>
<Security needs={[KNOWLEDGE_KNUPDATE]}>
{aliases.length > 5 ? (
<IconButton
color="primary"
aria-label="More"
onClick={handleToggleOpenAliases}
size="small"
>
<DotsHorizontalCircleOutline fontSize="small" />
</IconButton>
) : (
<IconButton
color="primary"
aria-label="Alias"
onClick={handleToggleCreateAlias}
size="small"
>
{openAlias ? (
<Close fontSize="small" />
) : (
<Add fontSize="small" />
)}
</IconButton>
)}
</Security>
</div>
)}
</div>
</div>
Expand Down