Skip to content

Commit

Permalink
remove whitespaces and configuration settings refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
NoelKova committed Jul 9, 2024
1 parent 0db3462 commit a95bb29
Show file tree
Hide file tree
Showing 18 changed files with 245 additions and 87 deletions.
3 changes: 2 additions & 1 deletion apps/sensenet/src/components/AddButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ const useStyles = makeStyles((theme: Theme) => {
display: 'flex',
alignItems: 'center',
justifyContent: 'space-evenly',
height: globals.common.drawerItemHeight,
height: globals.common.addButtonHeight,
paddingLeft: '2px',
},
listDropdown: {
padding: '10px 0 10px 10px',
Expand Down
3 changes: 2 additions & 1 deletion apps/sensenet/src/components/PageTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ const useStyles = makeStyles((theme: Theme) => {
pageTitle: {
color: theme.palette.type === 'light' ? theme.palette.common.black : theme.palette.common.white,
fontFamily: '"Larsseit", Roboto',
fontSize: '20px',
fontSize: '24px',
padding: '8px 16px',
},
})
})
Expand Down
3 changes: 2 additions & 1 deletion apps/sensenet/src/components/appbar/desktop-app-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ const useStyles = makeStyles(() => {
toolBar: {
position: 'static',
height: '100%',
paddingLeft: '32px',
minHeight: '42px',
paddingLeft: '16px',
paddingRight: 0,
},
logo: {
Expand Down
1 change: 1 addition & 0 deletions apps/sensenet/src/components/appbar/desktop-nav-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const useStyles = makeStyles((theme: Theme) =>
viewOptions: {
cursor: 'pointer',
marginRight: '16px',
padding: '7px',
},
navMenu: {
height: '100%',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@ const useStyles = makeStyles(() => {
},
iconButton: {
color: globals.common.headerText,
'&:hover': {
backgroundColor: 'initial',
},
padding: '7px',
marginRight: '6px',
},
comboBox: {
position: 'relative',
Expand Down
7 changes: 3 additions & 4 deletions apps/sensenet/src/components/content-list/content-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const isReferenceField = (fieldName: string, repo: Repository, schema = '
}

const rowHeightConst = 67
const headerHeightConst = 58
const headerHeightConst = 48

/**
* Compare passed minutes with
Expand Down Expand Up @@ -747,17 +747,16 @@ export const ContentList = <T extends GenericContent = GenericContent>(props: Co
rowStyle: {
position: 'relative',
top: 'unset',
height: 'auto',
height: '48px',
overflow: 'initial',
padding: '5px 0px',
padding: '0',
},
onRowDoubleClick: onItemDoubleClickFunc,
disableHeader: props.hideHeader,
containerStyle: {
display: 'flex',
flexDirection: 'column',
overflowY: 'auto',
paddingBottom: '15px',
minHeight: '100%',
height: 'inherit',
maxHeight: 'inherit',
Expand Down
1 change: 0 additions & 1 deletion apps/sensenet/src/components/content/Explore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ const useStyles = makeStyles((theme: Theme) => {
width: '100%',
position: 'relative',
overflow: 'hidden',
paddingTop: '8px',
},
})
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const ContentContextMenu: React.FunctionComponent<ContentContextMenuProps
disablePortal={true}
open={props.isOpened}
PaperProps={{ style: { paddingBottom: '2em' } }}>
<List>
<List style={{ padding: 0, backgroundColor: 'green' }}>
{actions?.map((action) => {
return (
<ListItem
Expand Down
5 changes: 3 additions & 2 deletions apps/sensenet/src/components/drawer/PermanentDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ const useStyles = makeStyles((theme: Theme) => {
width: '100%',
},
listButton: {
height: '65px',
height: '60px',
paddingLeft: '2px',
},
expandCollapseWrapper: {
height: '49px',
Expand Down Expand Up @@ -126,7 +127,7 @@ export const PermanentDrawer = () => {
</List>

{systemItems && (
<List>
<List style={{ padding: 0 }}>
{systemItems.map((item) => {
return (
<li key={item.itemType}>
Expand Down
3 changes: 2 additions & 1 deletion apps/sensenet/src/components/drawer/PermanentDrawerItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ const useStyles = makeStyles((theme: Theme) => {
},
},
listButton: {
height: '65px',
height: '60px',
paddingLeft: '2px',
},
listItemIconDark: {
color: theme.palette.common.white,
Expand Down
2 changes: 1 addition & 1 deletion apps/sensenet/src/components/event-list/event-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default function EventList() {
{currentEvent ? (
<EventDetails event={currentEvent} />
) : (
<List style={{ height: 'calc(100% - 48px)', overflow: 'auto' }} values={events} />
<List style={{ height: 'calc(100% - 48px)', overflow: 'auto', backgroundColor: 'green' }} values={events} />
)}
</div>
</FilterContextProvider>
Expand Down
5 changes: 1 addition & 4 deletions apps/sensenet/src/components/layout/DesktopLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ const useStyles = makeStyles((theme: Theme) => {
boxSizing: 'border-box',
overflow: 'hidden',
height: '100%',
paddingTop: '10px',
'& > *': {
paddingLeft: `${globals.common.explorePaddingLeft}`,
},
padding: '0px',
},
executeActionPaper: {
height: '100%',
Expand Down
130 changes: 72 additions & 58 deletions apps/sensenet/src/components/settings/content-card.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
import { createStyles, IconButton, makeStyles, Theme, Tooltip } from '@material-ui/core'
import {
createStyles,
IconButton,
makeStyles,
Table,
TableCell,
TableContainer,
TableHead,
TableRow,
Theme,
Tooltip,
} from '@material-ui/core'
import Button from '@material-ui/core/Button'
import Card from '@material-ui/core/Card'
import CardActions from '@material-ui/core/CardActions'
Expand Down Expand Up @@ -82,67 +93,70 @@ export const ContentCard = ({ settings, onContextMenu }: ContentCardProps) => {
const dataTestName = settingsTitle.replace(/\s+/g, '-').toLowerCase()

return (
<Card
onContextMenu={(ev) => {
ev.preventDefault()
onContextMenu(ev)
}}
className={classes.card}
data-test={`content-card-${settingsName.replace(/\s+/g, '-').toLowerCase()}`}>
<CardContent>
<Tooltip placement="top" title={settingsName}>
<Typography variant="h5" gutterBottom={true} className={classes.title}>
{settingsTitle}
</Typography>
</Tooltip>
<Typography
color="textSecondary"
style={{ wordWrap: 'break-word' }}
dangerouslySetInnerHTML={{ __html: settings.Description || '' }}
/>
</CardContent>
<CardActions style={{ justifyContent: 'flex-end' }}>
{!isSystemSettings.includes(settingsTitle) && (
<IconButton
data-test={`${dataTestName}-delete-button`}
aria-label="delete"
onClick={() => {
openDialog({
name: 'delete',
props: { content: [settings] },
dialogProps: { disableBackdropClick: true, disableEscapeKeyDown: true },
})
}}>
<DeleteIcon />
</IconButton>
)}
<Link
to={getPrimaryActionUrl({ content: settings, repository, uiSettings, location: history.location })}
style={{ textDecoration: 'none' }}>
<Button
aria-label={localization.edit}
size="small"
className={classes.button}
data-test={`${dataTestName}-edit-button`}>
{localization.edit}
</Button>
</Link>
{hasDocumentation.includes(settingsTitle) && (
<a
target="_blank"
rel="noopener noreferrer"
href={`${SETUP_DOCS_URL}${createAnchorFromName(settings.Name)}`}
<div>
<div />
<Card
onContextMenu={(ev) => {
ev.preventDefault()
onContextMenu(ev)
}}
className={classes.card}
data-test={`content-card-${settingsName.replace(/\s+/g, '-').toLowerCase()}`}>
<CardContent>
<Tooltip placement="top" title={settingsName}>
<Typography variant="h5" gutterBottom={true} className={classes.title}>
{settingsTitle}
</Typography>
</Tooltip>
<Typography
color="textSecondary"
style={{ wordWrap: 'break-word' }}
dangerouslySetInnerHTML={{ __html: settings.Description || '' }}
/>
</CardContent>
<CardActions style={{ justifyContent: 'flex-end' }}>
{!isSystemSettings.includes(settingsTitle) && (
<IconButton
data-test={`${dataTestName}-delete-button`}
aria-label="delete"
onClick={() => {
openDialog({
name: 'delete',
props: { content: [settings] },
dialogProps: { disableBackdropClick: true, disableEscapeKeyDown: true },
})
}}>
<DeleteIcon />
</IconButton>
)}
<Link
to={getPrimaryActionUrl({ content: settings, repository, uiSettings, location: history.location })}
style={{ textDecoration: 'none' }}>
<Button
aria-label={localization.learnMore}
aria-label={localization.edit}
size="small"
className={classes.button}
data-test={`${dataTestName}-learnmore-button`}>
{localization.learnMore}
data-test={`${dataTestName}-edit-button`}>
{localization.edit}
</Button>
</a>
)}
</CardActions>
</Card>
</Link>
{hasDocumentation.includes(settingsTitle) && (
<a
target="_blank"
rel="noopener noreferrer"
href={`${SETUP_DOCS_URL}${createAnchorFromName(settings.Name)}`}
style={{ textDecoration: 'none' }}>
<Button
aria-label={localization.learnMore}
size="small"
className={classes.button}
data-test={`${dataTestName}-learnmore-button`}>
{localization.learnMore}
</Button>
</a>
)}
</CardActions>
</Card>
</div>
)
}
Loading

0 comments on commit a95bb29

Please sign in to comment.