mirror of
https://github.com/apache/superset.git
synced 2024-09-17 11:09:47 -04:00
fix: Add Item Overflow on Dataset Editor (#10983)
* move add item button to the top * fix cypress * fix cypress
This commit is contained in:
parent
d992c306c2
commit
02ab5cc644
@ -24,18 +24,16 @@ import { FORM_DATA_DEFAULTS, NUM_METRIC } from './visualizations/shared.helper';
|
|||||||
describe('Datasource control', () => {
|
describe('Datasource control', () => {
|
||||||
const newMetricName = `abc${Date.now()}`;
|
const newMetricName = `abc${Date.now()}`;
|
||||||
|
|
||||||
before(() => {
|
|
||||||
cy.server();
|
|
||||||
cy.login();
|
|
||||||
cy.route('GET', '/superset/explore_json/**').as('getJson');
|
|
||||||
cy.route('POST', '/superset/explore_json/**').as('postJson');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should allow edit datasource', () => {
|
it('should allow edit datasource', () => {
|
||||||
let numScripts = 0;
|
let numScripts = 0;
|
||||||
|
|
||||||
|
cy.login();
|
||||||
|
cy.server();
|
||||||
|
cy.route('GET', '/superset/explore_json/**').as('getJson');
|
||||||
|
cy.route('POST', '/superset/explore_json/**').as('postJson');
|
||||||
cy.visitChartByName('Num Births Trend');
|
cy.visitChartByName('Num Births Trend');
|
||||||
cy.verifySliceSuccess({ waitAlias: '@postJson' });
|
cy.verifySliceSuccess({ waitAlias: '@postJson' });
|
||||||
|
|
||||||
cy.get('#datasource_menu').click();
|
cy.get('#datasource_menu').click();
|
||||||
|
|
||||||
cy.get('script').then(nodes => {
|
cy.get('script').then(nodes => {
|
||||||
@ -50,7 +48,7 @@ describe('Datasource control', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// create new metric
|
// create new metric
|
||||||
cy.get('table button').contains('Add Item', { timeout: 10000 }).click();
|
cy.get('button').contains('Add Item', { timeout: 10000 }).click();
|
||||||
cy.get('input[value="<new metric>"]').click();
|
cy.get('input[value="<new metric>"]').click();
|
||||||
cy.get('input[value="<new metric>"]')
|
cy.get('input[value="<new metric>"]')
|
||||||
.focus()
|
.focus()
|
||||||
|
@ -160,12 +160,7 @@ export default class CRUDCollection extends React.PureComponent<
|
|||||||
|
|
||||||
renderHeaderRow() {
|
renderHeaderRow() {
|
||||||
const cols = this.effectiveTableColumns();
|
const cols = this.effectiveTableColumns();
|
||||||
const {
|
const { allowDeletes, expandFieldset, extraButtons } = this.props;
|
||||||
allowAddItem,
|
|
||||||
allowDeletes,
|
|
||||||
expandFieldset,
|
|
||||||
extraButtons,
|
|
||||||
} = this.props;
|
|
||||||
return (
|
return (
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@ -174,16 +169,9 @@ export default class CRUDCollection extends React.PureComponent<
|
|||||||
<th key={col}>{this.getLabel(col)}</th>
|
<th key={col}>{this.getLabel(col)}</th>
|
||||||
))}
|
))}
|
||||||
{extraButtons}
|
{extraButtons}
|
||||||
{allowDeletes && !allowAddItem && (
|
{allowDeletes && (
|
||||||
<th key="delete-item" aria-label="Delete" className="tiny-cell" />
|
<th key="delete-item" aria-label="Delete" className="tiny-cell" />
|
||||||
)}
|
)}
|
||||||
{allowAddItem && (
|
|
||||||
<th key="add-item">
|
|
||||||
<Button buttonStyle="primary" onClick={this.onAddItem}>
|
|
||||||
<i className="fa fa-plus" /> {t('Add Item')}
|
|
||||||
</Button>
|
|
||||||
</th>
|
|
||||||
)}
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
);
|
);
|
||||||
@ -293,6 +281,17 @@ export default class CRUDCollection extends React.PureComponent<
|
|||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div className="CRUD">
|
<div className="CRUD">
|
||||||
|
<span className="float-right m-t-10 m-r-10">
|
||||||
|
{this.props.allowAddItem && (
|
||||||
|
<Button
|
||||||
|
buttonSize="sm"
|
||||||
|
buttonStyle="primary"
|
||||||
|
onClick={this.onAddItem}
|
||||||
|
>
|
||||||
|
<i className="fa fa-plus" /> {t('Add Item')}
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
<table className="table">
|
<table className="table">
|
||||||
{this.renderHeaderRow()}
|
{this.renderHeaderRow()}
|
||||||
{this.renderTableBody()}
|
{this.renderTableBody()}
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
@import './less/variables.less';
|
@import './less/variables.less';
|
||||||
@import './less/index.less';
|
@import './less/index.less';
|
||||||
|
|
||||||
@datasource-sql-expression-width: 450px;
|
@datasource-sql-expression-width: 315px;
|
||||||
|
|
||||||
.alert.alert-danger > .debugger {
|
.alert.alert-danger > .debugger {
|
||||||
color: @danger;
|
color: @danger;
|
||||||
@ -229,6 +229,7 @@ table.table-no-hover tr:hover {
|
|||||||
font-family: @font-family-monospace;
|
font-family: @font-family-monospace;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
min-width: @datasource-sql-expression-width;
|
min-width: @datasource-sql-expression-width;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editable-title.datasource-sql-expression input {
|
.editable-title.datasource-sql-expression input {
|
||||||
|
Loading…
Reference in New Issue
Block a user