Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/SenseNet/sn-client into …
Browse files Browse the repository at this point in the history
…2067-file-tpye-default-action
  • Loading branch information
VargaJoe committed Mar 13, 2024
2 parents 431b618 + ca7e501 commit 4a2907b
Showing 1 changed file with 23 additions and 11 deletions.
34 changes: 23 additions & 11 deletions apps/sensenet/src/components/view-controls/common/view-title.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@ const useStyles = makeStyles(() => {
actionBar: {
display: 'flex',
},
typeinfo: {
fontSize: '12px',
color: 'grey',
marginLeft: '5px',
},

viewTitle: {
'& span': {
display: 'inline-block',
verticalAlign: 'middle',
},
},
})
})

Expand Down Expand Up @@ -63,8 +75,9 @@ export const ViewTitle: React.FunctionComponent<ViewTitleProps> = (props) => {

return (
<div className={clsx(classes.title, globalClasses.centered)}>
<div data-test="viewtitle">
<div data-test="viewtitle" className={classes.viewTitle}>
{props.title} <span className={classes.textBolder}>{props.titleBold}</span>
<span className={classes.typeinfo}>({props.content!.Type})</span>
</div>
<div className={classes.actionBar}>
{props.actionName === 'browse' && (
Expand Down Expand Up @@ -130,16 +143,15 @@ export const ViewTitle: React.FunctionComponent<ViewTitleProps> = (props) => {
title={`Open ${contentDisplayName} CTD`}
onClick={async () => {
const content = await getContentTypeId(props.content!.Type)
history.push(
getPrimaryActionUrl({
content,
repository,
location: history.location,
uiSettings,
snRoute,
removePath: true,
}),
)
const url = getPrimaryActionUrl({
content,
repository,
location: history.location,
uiSettings,
snRoute,
removePath: true,
})
window.open(url, '_blank')
}}
className={globalClasses.centered}>
<Icon
Expand Down

0 comments on commit 4a2907b

Please sign in to comment.