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

Link to current user's edit view #1292

Merged
merged 7 commits into from
May 5, 2021
Merged
Show file tree
Hide file tree
Changes from 6 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
17 changes: 16 additions & 1 deletion apps/sensenet/src/components/appbar/desktop-nav-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ import KeyboardArrowDown from '@material-ui/icons/KeyboardArrowDown'
import Notifications from '@material-ui/icons/Notifications'
import clsx from 'clsx'
import React, { ChangeEvent, Dispatch, FunctionComponent, SetStateAction, useState } from 'react'
import { Link } from 'react-router-dom'
import { PATHS, resolvePathParams } from '../../application-paths'
import { useCurrentUser } from '../../context/current-user-provider'
import { globals, useGlobalStyles } from '../../globalStyles'
import { useLocalization, usePersonalSettings } from '../../hooks'
import { PersonalSettings } from '../../services'
import { pathWithQueryParams, PersonalSettings } from '../../services'
import { useDialog } from '../dialogs'
import { UserAvatar } from '../UserAvatar'

Expand Down Expand Up @@ -158,6 +160,19 @@ export const DesktopNavMenu: FunctionComponent = () => {
primary={`${currentUser.DisplayName || currentUser.Name}`}
/>
</MenuItem>
<MenuItem className={classes.userMenuItem}>
<Link
onClick={() => handleClose(setOpenUserMenu)}
to={pathWithQueryParams({
path: resolvePathParams({
path: PATHS.usersAndGroups.appPath,
params: { browseType: 'explorer', action: 'edit' },
}),
newParams: { content: `${currentUser.Path.replace(PATHS.usersAndGroups.snPath, '')}` },
})}>
{localization.topMenu.accountSettings}
</Link>
</MenuItem>
<MenuItem onClick={changePassword} className={classes.userMenuItem}>
{localization.topMenu.changePassword}
</MenuItem>
Expand Down
1 change: 1 addition & 0 deletions apps/sensenet/src/localization/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ const values = {
changePassword: 'Change password',
openUserMenu: 'Open user menu',
openNewMenu: `What's new`,
accountSettings: 'Account settings',
},
navigationCommandProvider: {
personalSettingsPrimary: 'Personal Settings',
Expand Down
1 change: 1 addition & 0 deletions apps/sensenet/src/localization/hungarian.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ const values: DeepPartial<typeof import('./default').default> = {
changePassword: 'Jelszó módosítása',
openUserMenu: 'Felhasználói menü kinyitása',
openNewMenu: 'Újdonságok',
accountSettings: 'Felhasználói beállítások',
},
settings: {
edit: 'Módosítás',
Expand Down