Skip to content

Commit

Permalink
Moved dataset editor lock to top of component (#17930)
Browse files Browse the repository at this point in the history
  • Loading branch information
lyndsiWilliams authored Jan 10, 2022
1 parent f6b9393 commit df69920
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions superset-frontend/src/components/Datasource/DatasourceEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -879,6 +879,23 @@ class DatasourceEditor extends React.PureComponent {
const { datasource } = this.state;
return (
<div>
{this.allowEditSource && (
<EditLockContainer>
<span role="button" tabIndex={0} onClick={this.onChangeEditMode}>
{this.state.isEditMode ? (
<Icons.LockUnlocked iconColor={theme.colors.grayscale.base} />
) : (
<Icons.LockLocked iconColor={theme.colors.grayscale.base} />
)}
</span>
{!this.state.isEditMode && (
<div>{t('Click the lock to make changes.')}</div>
)}
{this.state.isEditMode && (
<div>{t('Click the lock to prevent further changes.')}</div>
)}
</EditLockContainer>
)}
<div className="m-l-10 m-t-20 m-b-10">
{DATASOURCE_TYPES_ARR.map(type => (
<Radio
Expand Down Expand Up @@ -1032,23 +1049,6 @@ class DatasourceEditor extends React.PureComponent {
</Col>
)}
</Fieldset>
{this.allowEditSource && (
<EditLockContainer>
<span role="button" tabIndex={0} onClick={this.onChangeEditMode}>
{this.state.isEditMode ? (
<Icons.LockUnlocked iconColor={theme.colors.grayscale.base} />
) : (
<Icons.LockLocked iconColor={theme.colors.grayscale.base} />
)}
</span>
{!this.state.isEditMode && (
<div>{t('Click the lock to make changes.')}</div>
)}
{this.state.isEditMode && (
<div>{t('Click the lock to prevent further changes.')}</div>
)}
</EditLockContainer>
)}
</div>
);
}
Expand Down

0 comments on commit df69920

Please sign in to comment.