Skip to content

Commit fb2fc76

Browse files
committed
show hide input descriptions
1 parent ef8d4d0 commit fb2fc76

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

apps/sensenet/src/components/appbar/desktop-nav-menu.tsx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ export const DesktopNavMenu: FunctionComponent = () => {
113113
service.setPersonalSettingsValue({ ...settings, theme: event.target.checked ? 'dark' : 'light' })
114114
}
115115

116+
const switchDescription = () => (event: ChangeEvent<HTMLInputElement>) => {
117+
const settings = service.userValue.getValue()
118+
service.setPersonalSettingsValue({ ...settings, showDescription: event.target.checked })
119+
}
120+
116121
const toggleHideSettingsFolder = () => (event: ChangeEvent<HTMLInputElement>) => {
117122
const settings = service.userValue.getValue()
118123
service.setPersonalSettingsValue({ ...settings, showHiddenItems: event.target.checked })
@@ -247,6 +252,22 @@ export const DesktopNavMenu: FunctionComponent = () => {
247252
</Grid>
248253
</Typography>
249254
</MenuItem>
255+
<MenuItem>
256+
<Typography component="div" className={classes.checkboxMenuItem} style={{ width: '100%' }}>
257+
<Grid component="label" container alignItems="center" justify="space-between">
258+
<Grid item style={{ paddingRight: '16px' }} data-test="description-status">
259+
{'Show Description'}
260+
</Grid>
261+
<Grid item>
262+
<Switch
263+
data-test="description-switcher"
264+
checked={personalSettings.showDescription}
265+
onChange={switchDescription()}
266+
/>
267+
</Grid>
268+
</Grid>
269+
</Typography>
270+
</MenuItem>
250271
<MenuItem>
251272
<Typography component="div" className={classes.checkboxMenuItem} style={{ width: '100%' }}>
252273
<Grid component="label" container alignItems="center" justify="space-between">

apps/sensenet/src/components/view-controls/edit-view.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export const EditView: React.FC<EditViewProps> = (props) => {
114114
cancel: localization.forms.cancel,
115115
advancedFields: localization.forms.advancedFields,
116116
}}
117-
hideDescription
117+
hideDescription={!personalSettings.showDescription}
118118
locale={LocalizationObject[personalSettings.language].locale}
119119
classes={{
120120
...classes,

apps/sensenet/src/services/PersonalSettings.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ export type PersonalSettingsType = PlatformDependent<UiSettings> & {
9393
logLevel: Array<keyof typeof LogLevel>
9494
language: 'default' | 'hungarian'
9595
theme: 'light' | 'dark'
96+
showDescription: boolean
9697
uploadHandlers: string[]
9798
}
9899

@@ -140,6 +141,7 @@ export const defaultSettings: PersonalSettingsType = {
140141
sendLogWithCrashReports: true,
141142
logLevel: ['Information', 'Warning', 'Error', 'Fatal'],
142143
theme: prefersDark ? 'dark' : 'light',
144+
showDescription: false,
143145
showHiddenItems: true,
144146
preferDisplayName: false,
145147
uploadHandlers: [

0 commit comments

Comments
 (0)