Skip to content

Commit acc1c22

Browse files
committed
disabling other menu item on modal state
1 parent b7b7b93 commit acc1c22

File tree

5 files changed

+38
-5
lines changed

5 files changed

+38
-5
lines changed

src/components/BrowserFilter/BrowserFilter.react.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,9 @@ export default class BrowserFilter extends React.Component {
144144
if (this.props.filters.size) {
145145
buttonStyle.push(styles.active);
146146
}
147+
if (this.props.disabled) {
148+
buttonStyle.push(styles.disabled);
149+
}
147150
return (
148151
<div className={styles.wrap}>
149152
<div className={buttonStyle.join(' ')} onClick={this.toggle}>

src/components/BrowserFilter/BrowserFilter.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@
2222
&:hover svg {
2323
fill: white;
2424
}
25+
26+
&.disabled {
27+
cursor: not-allowed;
28+
color: #66637A;
29+
30+
&:hover svg {
31+
fill: #66637A;
32+
}
33+
}
2534
}
2635

2736
.entry.active {

src/components/ColumnsConfiguration/ColumnsConfiguration.react.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,19 @@ export default class ColumnsConfiguration extends React.Component {
4848
}
4949

5050
render() {
51-
const { handleColumnDragDrop, handleColumnsOrder, order } = this.props;
52-
const [ title, entry ] = [styles.title, styles.entry ].map(className => (
51+
const { handleColumnDragDrop, handleColumnsOrder, order, disabled } = this.props;
52+
let [ title, entry ] = [styles.title, styles.entry ].map(className => (
5353
<div className={className} onClick={this.toggle.bind(this)}>
5454
<Icon name='manage-columns' width={14} height={14} />
5555
<span>Manage Columns</span>
5656
</div>
5757
));
58+
if (disabled) {
59+
entry = <div className={styles.entry + ' ' + styles.disabled} onClick={null}>
60+
<Icon name='manage-columns' width={14} height={14} />
61+
<span>Manage Columns</span>
62+
</div>;
63+
}
5864

5965
let popover = null;
6066
if (this.state.open) {

src/components/ColumnsConfiguration/ColumnsConfiguration.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@
1212
&:hover svg {
1313
fill: white;
1414
}
15+
16+
&.disabled {
17+
cursor: not-allowed;
18+
color: #66637A;
19+
20+
&:hover svg {
21+
fill: #66637A;
22+
}
23+
}
1524
}
1625

1726
.title {

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import Separator from 'components/BrowserMenu/Separator.react';
1515
import styles from 'dashboard/Data/Browser/Browser.scss';
1616
import Toolbar from 'components/Toolbar/Toolbar.react';
1717
import SecurityDialog from 'dashboard/Data/Browser/SecurityDialog.react';
18-
import ColumnsConfiguration from 'components/ColumnsConfiguration/ColumnsConfiguration.react'
18+
import ColumnsConfiguration from 'components/ColumnsConfiguration/ColumnsConfiguration.react'
1919
import SecureFieldsDialog from 'dashboard/Data/Browser/SecureFieldsDialog.react';
2020

2121
let BrowserToolbar = ({
@@ -155,6 +155,10 @@ let BrowserToolbar = ({
155155
classes.push(styles.toolbarButtonDisabled);
156156
onClick = null;
157157
}
158+
if (isPendingEditCloneRows) {
159+
classes.push(styles.toolbarButtonDisabled);
160+
onClick = null;
161+
}
158162

159163
const columns = {};
160164
const userPointers = [];
@@ -203,9 +207,10 @@ let BrowserToolbar = ({
203207
handleColumnsOrder={handleColumnsOrder}
204208
handleColumnDragDrop={handleColumnDragDrop}
205209
order={order}
210+
disabled={isPendingEditCloneRows}
206211
/>
207212
<div className={styles.toolbarSeparator} />
208-
<a className={styles.toolbarButton} onClick={onRefresh}>
213+
<a className={classes.join(' ')} onClick={ isPendingEditCloneRows ? null : onRefresh}>
209214
<Icon name="refresh-solid" width={14} height={14} />
210215
<span>Refresh</span>
211216
</a>
@@ -217,6 +222,7 @@ let BrowserToolbar = ({
217222
onChange={onFilterChange}
218223
className={classNameForEditors}
219224
blacklistedFilters={onAddRow ? [] : ['unique']}
225+
disabled={isPendingEditCloneRows}
220226
/>
221227
{onAddRow && <div className={styles.toolbarSeparator} />}
222228
{perms && enableSecurityDialog ? (
@@ -270,7 +276,7 @@ let BrowserToolbar = ({
270276
{editCloneRows && editCloneRows.length > 0 && (
271277
<BrowserMenu title="Clone" icon="clone-icon">
272278
<MenuItem
273-
text={"Cancel All Pending Rows"}
279+
text={"Cancel all pending rows"}
274280
onClick={onCancelPendingEditRows}
275281
/>
276282
</BrowserMenu>

0 commit comments

Comments
 (0)