Skip to content

Commit 7971748

Browse files
committed
Use master key state property on editRowDialog and ObjectPickerDialog;
Enabled using useMasteKey property for save actions and other actions
1 parent d9164c0 commit 7971748

File tree

1 file changed

+20
-16
lines changed

1 file changed

+20
-16
lines changed

src/dashboard/Data/Browser/BrowserToolbar.react.js

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -246,23 +246,27 @@ let BrowserToolbar = ({
246246
className={classNameForEditors}
247247
blacklistedFilters={onAddRow ? [] : ['unique']}
248248
/>
249-
<div className={styles.toolbarSeparator} />
250-
<LoginDialog
251-
ref={loginDialogRef}
252-
currentUser={currentUser}
253-
login={login}
254-
logout={logout}
255-
/>
256-
<BrowserMenu
257-
setCurrent={setCurrent}
258-
title={currentUser ? 'Browsing' : 'Browse'}
259-
icon="users-solid"
260-
active={!!currentUser}
261-
>
262-
<MenuItem text={currentUser ? 'Switch User' : 'As User'} onClick={showLogin} />
263-
{currentUser ? <MenuItem text={<span>Use Master Key <Toggle type={Toggle.Types.HIDE_LABELS} value={useMasterKey} onChange={toggleMasterKeyUsage} switchNoMargin={true} additionalStyles={{ display: 'inline', lineHeight: 0, margin: 0, paddingLeft: 5 }} /></span>} onClick={toggleMasterKeyUsage} /> : <noscript />}
264-
{currentUser ? <MenuItem text={<span>Stop browsing (<b>{currentUser.get('username')}</b>)</span>} onClick={logout} /> : <noscript />}
249+
{onAddRow && <div className={styles.toolbarSeparator} />}
250+
{onAddRow && (
251+
<LoginDialog
252+
ref={loginDialogRef}
253+
currentUser={currentUser}
254+
login={login}
255+
logout={logout}
256+
/>
257+
)}
258+
{onAddRow && (
259+
<BrowserMenu
260+
setCurrent={setCurrent}
261+
title={currentUser ? 'Browsing' : 'Browse'}
262+
icon="users-solid"
263+
active={!!currentUser}
264+
>
265+
<MenuItem text={currentUser ? 'Switch User' : 'As User'} onClick={showLogin} />
266+
{currentUser ? <MenuItem text={<span>Use Master Key <Toggle type={Toggle.Types.HIDE_LABELS} value={useMasterKey} onChange={toggleMasterKeyUsage} switchNoMargin={true} additionalStyles={{ display: 'inline', lineHeight: 0, margin: 0, paddingLeft: 5 }} /></span>} onClick={toggleMasterKeyUsage} /> : <noscript />}
267+
{currentUser ? <MenuItem text={<span>Stop browsing (<b>{currentUser.get('username')}</b>)</span>} onClick={logout} /> : <noscript />}
265268
</BrowserMenu>
269+
)}
266270
{onAddRow && <div className={styles.toolbarSeparator} />}
267271
{perms && enableSecurityDialog ? (
268272
<SecurityDialog

0 commit comments

Comments
 (0)