Skip to content

Commit e7ac062

Browse files
committed
settings error, grid extre scrollbar
1 parent 96459d8 commit e7ac062

File tree

3 files changed

+68
-5
lines changed

3 files changed

+68
-5
lines changed

apps/sensenet/src/application-paths.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const PATHS = {
1616
configuration: { appPath: '/system/settings/:action?', snPath: '/Root/System/Settings' },
1717
localization: { appPath: '/system/localization/:action?', snPath: '/Root/Localization' },
1818
webhooks: { appPath: '/system/webhooks/:action?', snPath: '/Root/System/WebHooks' },
19-
settings: { appPath: '/system/:submenu?' },
19+
settings: { appPath: '/system/:submenu?', snPath: '/Root/System/Settings' },
2020
apiKeys: { appPath: '/system/apikeys' },
2121
landingPath: { appPath: '/content/explorer/' },
2222
root: { appPath: '/Root', snPath: '/Root' },

apps/sensenet/src/components/grid/Cols/ColumnDefs..tsx

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
import { IconButton } from '@material-ui/core'
2+
import { Edit, InfoOutlined } from '@material-ui/icons'
13
import { ColDef } from 'ag-grid-community'
24
import React from 'react'
3-
import { EnabledField, ReferenceField, RolesField } from '../../content-list'
5+
import { ReferenceField, RolesField } from '../../content-list'
6+
import { createAnchorFromName, SETUP_DOCS_URL, UpdatedSettings } from '../../settings/settings-table'
47
import { ActionFormatter } from '../Formatters/ActionFormatter'
58
import { DateTimeFormatter } from '../Formatters/DateTimeFormatter'
69
import { IconFormatter } from '../Formatters/IconFormatter'
@@ -705,3 +708,54 @@ export const webHooksColumnDefs: ColDef[] = [
705708
autoHeight: true,
706709
},
707710
]
711+
712+
const hasDocumentation = ['Portal', 'OAuth', 'DocumentPreview', 'OfficeOnline', 'Indexing', 'Sharing']
713+
714+
export const getSettingsColumnDefs = (history: any): ColDef[] => [
715+
{
716+
headerName: 'Display Name',
717+
field: 'DisplayName',
718+
sortable: true,
719+
resizable: true,
720+
flex: 1,
721+
},
722+
{
723+
headerName: 'Description',
724+
field: 'Description',
725+
resizable: true,
726+
flex: 4,
727+
},
728+
{
729+
headerName: 'Edit',
730+
resizable: false,
731+
width: 50,
732+
cellRenderer: (params: any) => {
733+
const content = encodeURIComponent(params.data?.Name || '')
734+
return (
735+
<IconButton
736+
style={{ padding: '3px', marginBottom: '6px' }}
737+
onClick={() => {
738+
history.push(`/system/settings/edit-binary?path=&content=%2F${content}`)
739+
}}>
740+
<Edit style={{ fontSize: '16px' }} />
741+
</IconButton>
742+
)
743+
},
744+
},
745+
{
746+
headerName: 'Learn More',
747+
resizable: false,
748+
cellRenderer: (params: { data: UpdatedSettings }) =>
749+
hasDocumentation.includes(params.data.Name.replace(/\.settings/gi, '')) ? (
750+
<a
751+
target="_blank"
752+
rel="noopener noreferrer"
753+
href={`${SETUP_DOCS_URL}${createAnchorFromName(params.data.Name)}`}>
754+
<IconButton style={{ padding: '3px', marginBottom: '6px' }}>
755+
<InfoOutlined style={{ fontSize: '16px' }} />
756+
</IconButton>
757+
</a>
758+
) : null,
759+
width: 90,
760+
},
761+
]

apps/sensenet/src/components/settings/index.tsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import { createStyles, ListItem, ListItemText, makeStyles, Theme } from '@materi
22
import SettingsIcon from '@material-ui/icons/Settings'
33
import { clsx } from 'clsx'
44
import React, { lazy } from 'react'
5-
import { matchPath, NavLink, useLocation, useRouteMatch } from 'react-router-dom'
5+
import { matchPath, NavLink, useHistory, useLocation, useRouteMatch } from 'react-router-dom'
66
import { PATHS, resolvePathParams } from '../../application-paths'
77
import { globals, useGlobalStyles } from '../../globalStyles'
88
import { useLocalization } from '../../hooks'
9-
import { localizationColumnDefs, webHooksColumnDefs } from '../grid/Cols/ColumnDefs.'
9+
import { getSettingsColumnDefs, localizationColumnDefs, webHooksColumnDefs } from '../grid/Cols/ColumnDefs.'
1010
import { ApiKeys } from './api-keys'
1111
import { Stats } from './stats'
1212

@@ -31,6 +31,8 @@ const useStyles = makeStyles((theme: Theme) =>
3131
borderRight: theme.palette.type === 'light' ? '1px solid #DBDBDB' : '1px solid rgba(255, 255, 255, 0.11)',
3232
},
3333
settingsContent: {
34+
display: 'flex',
35+
flexDirection: 'column',
3436
overflow: 'auto',
3537
width: `calc(100% - ${globals.common.settingsDrawerWidth}px)`,
3638
},
@@ -51,6 +53,7 @@ export const Settings: React.FunctionComponent = () => {
5153
const globalClasses = useGlobalStyles()
5254
const localizationDrawer = useLocalization().drawer
5355
const location = useLocation()
56+
const history = useHistory()
5457

5558
const settingsItems = [
5659
{
@@ -91,7 +94,13 @@ export const Settings: React.FunctionComponent = () => {
9194
/>
9295
)
9396
case 'settings':
94-
return <SetupComponent />
97+
return (
98+
<ContentComponent
99+
disableColumnSettings
100+
rootPath={PATHS.settings.snPath}
101+
colDef={getSettingsColumnDefs(history)}
102+
/>
103+
)
95104
case 'adminui':
96105
return <PersonalSettingsEditor />
97106
case 'stats':

0 commit comments

Comments
 (0)