diff --git a/ui/components/scratchpad/ScratchpadRecordsContainer.js b/ui/components/scratchpad/ScratchpadRecordsContainer.js
index 43417ced7..9a51cd60b 100644
--- a/ui/components/scratchpad/ScratchpadRecordsContainer.js
+++ b/ui/components/scratchpad/ScratchpadRecordsContainer.js
@@ -1,44 +1,22 @@
import React from 'react';
import { connect } from 'react-redux';
-import Tabs, { TabPane } from 'rc-tabs';
-import TabContent from 'rc-tabs/lib/TabContent';
-import ScrollableInkTabBar from 'rc-tabs/lib/ScrollableInkTabBar';
-
+import classNames from 'classnames';
import i18n from 'vj/utils/i18n';
-import request from 'vj/utils/request';
import Icon from 'vj/components/react/IconComponent';
import Panel from './PanelComponent';
-import PanelButton from './PanelButtonComponent';
-import ScratchpadRecordsTable from './ScratchpadRecordsTableContainer';
+import ScratchpadRecordsRow from './ScratchpadRecordsRowContainer';
-const mapDispatchToProps = (dispatch) => ({
- loadSubmissions() {
- dispatch({
- type: 'SCRATCHPAD_RECORDS_LOAD_SUBMISSIONS',
- payload: request.get(Context.getSubmissionsUrl),
- });
- },
- handleClickClose() {
- dispatch({
- type: 'SCRATCHPAD_UI_SET_VISIBILITY',
- payload: {
- uiElement: 'records',
- visibility: false,
- },
- });
- },
- handleClickRefresh() {
- this.loadSubmissions();
- },
+const mapStateToProps = (state) => ({
+ rows: state.records.rows,
+ isLoading: state.ui.records.isLoading,
});
-@connect(null, mapDispatchToProps)
+@connect(mapStateToProps)
export default class ScratchpadRecordsContainer extends React.PureComponent {
- componentDidMount() {
- this.props.loadSubmissions();
- }
-
render() {
+ const cn = classNames('data-table is--full-row scratchpad__records__table', {
+ loading: this.props.isLoading,
+ });
return (
)}
>
- (
-
- this.props.handleClickRefresh()}
- >
- {i18n('Refresh')}
-
- this.props.handleClickClose()}
- >
-
-
-
- )}
- />
- )}
- renderTabContent={() => }
- >
- {i18n('All')}} key="all">
-
-
-
+
+
+
+
+
+
+
+
+ {this.props.rows.map((rowId) => (
+
+ ))}
+
+
);
}
diff --git a/ui/components/scratchpad/ScratchpadRecordsTableContainer.js b/ui/components/scratchpad/ScratchpadRecordsTableContainer.js
deleted file mode 100644
index 76ee3a185..000000000
--- a/ui/components/scratchpad/ScratchpadRecordsTableContainer.js
+++ /dev/null
@@ -1,33 +0,0 @@
-import React from 'react';
-import classNames from 'classnames';
-import { connect } from 'react-redux';
-import ScratchpadRecordsRow from './ScratchpadRecordsRowContainer';
-
-const mapStateToProps = (state) => ({
- rows: state.records.rows,
- isLoading: state.ui.records.isLoading,
-});
-
-@connect(mapStateToProps)
-export default class ScratchpadRecordsTableContainer extends React.PureComponent {
- render() {
- const cn = classNames('data-table is--full-row scratchpad__records__table', {
- loading: this.props.isLoading,
- });
- return (
-
-
-
-
-
-
-
-
- {this.props.rows.map((rowId) => (
-
- ))}
-
-
- );
- }
-}
diff --git a/ui/components/scratchpad/ScratchpadToolbarContainer.js b/ui/components/scratchpad/ScratchpadToolbarContainer.js
index 39f104b94..725fb0d73 100644
--- a/ui/components/scratchpad/ScratchpadToolbarContainer.js
+++ b/ui/components/scratchpad/ScratchpadToolbarContainer.js
@@ -59,6 +59,15 @@ const mapDispatchToProps = (dispatch) => ({
payload: req,
});
},
+ loadSubmissions() {
+ dispatch({
+ type: 'SCRATCHPAD_RECORDS_LOAD_SUBMISSIONS',
+ payload: request.get(Context.getSubmissionsUrl),
+ });
+ },
+ handleClickRefresh() {
+ this.loadSubmissions();
+ },
});
@connect(mapStateToProps, mapDispatchToProps)
@@ -67,6 +76,10 @@ export default class ScratchpadToolbarContainer extends React.PureComponent {
store: PropTypes.object,
};
+ componentDidMount() {
+ this.props.loadSubmissions();
+ }
+
render() {
return (
@@ -96,6 +109,18 @@ export default class ScratchpadToolbarContainer extends React.PureComponent {
{' '}
(F10)
+ this.props.handleClickRefresh()}
+ >
+
+ {' '}
+ {i18n('Refresh')}
+ {' '}
+ (Alt+F)
+