mirror of
https://github.com/apache/superset.git
synced 2026-05-12 19:35:17 +00:00
Moved dataset editor lock to top of component (#17930)
This commit is contained in:
committed by
GitHub
parent
f6b9393999
commit
df69920a2e
@@ -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
|
||||
@@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user