diff --git a/superset-frontend/cypress-base/cypress/integration/explore/control.test.ts b/superset-frontend/cypress-base/cypress/integration/explore/control.test.ts
index ef4fef5aa..f90695805 100644
--- a/superset-frontend/cypress-base/cypress/integration/explore/control.test.ts
+++ b/superset-frontend/cypress-base/cypress/integration/explore/control.test.ts
@@ -55,7 +55,7 @@ describe('Datasource control', () => {
cy.get('a').contains('Edit Datasource').click();
cy.get(`input[value="${newMetricName}"]`)
.closest('tr')
- .find('.fa-close')
+ .find('.fa-trash')
.click();
cy.get('.modal-footer button').contains('Save').click();
cy.get('.modal-footer button').contains('OK').click();
diff --git a/superset-frontend/spec/javascripts/profile/EditableTitle_spec.tsx b/superset-frontend/spec/javascripts/profile/EditableTitle_spec.tsx
index c4a5ecee0..1b23b02ea 100644
--- a/superset-frontend/spec/javascripts/profile/EditableTitle_spec.tsx
+++ b/superset-frontend/spec/javascripts/profile/EditableTitle_spec.tsx
@@ -34,7 +34,7 @@ describe('EditableTitle', () => {
value: 'new title',
},
};
- const editableWrapper = shallow();
+ let editableWrapper = shallow();
const notEditableWrapper = shallow(
,
);
@@ -60,8 +60,7 @@ describe('EditableTitle', () => {
describe('should handle change', () => {
afterEach(() => {
- editableWrapper.setState({ title: 'my title' });
- editableWrapper.setState({ lastTitle: 'my title' });
+ editableWrapper = shallow();
});
it('should change title', () => {
editableWrapper.find('input').simulate('change', mockEvent);
@@ -79,8 +78,7 @@ describe('EditableTitle', () => {
});
afterEach(() => {
callback.resetHistory();
- editableWrapper.setState({ title: 'my title' });
- editableWrapper.setState({ lastTitle: 'my title' });
+ editableWrapper = shallow();
});
it('default input type should be text', () => {
@@ -88,7 +86,7 @@ describe('EditableTitle', () => {
});
it('should trigger callback', () => {
- editableWrapper.setState({ title: 'new title' });
+ editableWrapper.find('input').simulate('change', mockEvent);
editableWrapper.find('input').simulate('blur');
expect(editableWrapper.find('input').props().type).toBe('button');
expect(callback.callCount).toBe(1);
@@ -101,7 +99,6 @@ describe('EditableTitle', () => {
expect(callback.callCount).toBe(0);
});
it('should not save empty title', () => {
- editableWrapper.setState({ title: '' });
editableWrapper.find('input').simulate('blur');
expect(editableWrapper.find('input').props().type).toBe('button');
expect(editableWrapper.find('input').props().value).toBe('my title');
diff --git a/superset-frontend/src/CRUD/CollectionTable.jsx b/superset-frontend/src/CRUD/CollectionTable.tsx
similarity index 69%
rename from superset-frontend/src/CRUD/CollectionTable.jsx
rename to superset-frontend/src/CRUD/CollectionTable.tsx
index 848d26366..f8632bbdb 100644
--- a/superset-frontend/src/CRUD/CollectionTable.jsx
+++ b/superset-frontend/src/CRUD/CollectionTable.tsx
@@ -16,8 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-import React from 'react';
-import PropTypes from 'prop-types';
+import React, { ReactNode } from 'react';
import shortid from 'shortid';
import { t } from '@superset-ui/translation';
import Button from '../components/Button';
@@ -25,47 +24,42 @@ import Fieldset from './Fieldset';
import { recurseReactClone } from './utils';
import './crud.less';
-const propTypes = {
- collection: PropTypes.arrayOf(PropTypes.object).isRequired,
- itemGenerator: PropTypes.func,
- columnLabels: PropTypes.object,
- tableColumns: PropTypes.array.isRequired,
- onChange: PropTypes.func,
- itemRenderers: PropTypes.object,
- allowDeletes: PropTypes.bool,
- expandFieldset: PropTypes.node,
- emptyMessage: PropTypes.node,
- extraButtons: PropTypes.node,
- allowAddItem: PropTypes.bool,
-};
-const defaultProps = {
- onChange: () => {},
- itemRenderers: {},
- columnLabels: {},
- allowDeletes: false,
- emptyMessage: 'No entries',
- allowAddItem: false,
- itemGenerator: () => ({}),
- expandFieldset: null,
- extraButtons: null,
-};
-const Frame = props =>
{props.children}
;
-Frame.propTypes = { children: PropTypes.node };
+interface CRUDCollectionProps {
+ allowAddItem?: boolean;
+ allowDeletes?: boolean;
+ collection: Array