+  |
{this.state.isTableRenaming &&
{
+ this.setState({isItemFreezed: true});
+ }
+
+ onUnfreezedItem = () => {
+ this.setState({isItemFreezed: false});
+ }
+
onAddTable = () => {
this.setState({
isShowAddTableDialog: !this.state.isShowAddTableDialog,
@@ -220,120 +247,96 @@ class Workspace extends Component {
this.setState({ dropdownOpen: !this.state.dropdownOpen });
}
+ componentWillReceiveProps(nextProps) {
+ if (nextProps.workspace.table_list !== this.props.workspace.table_list) {
+ this.setState({
+ tableList: nextProps.workspace.table_list
+ });
+ }
+ }
+
render() {
let workspace = this.props.workspace;
return(
-
-
-
- {this.state.isWorkspaceRenaming &&
-
- }
- {!this.state.isWorkspaceRenaming &&
-
- {workspace.name}
-
-
-
-
- {gettext('Rename')}
- {gettext('Delete')}
-
-
- {this.state.isWorkspaceDeleting &&
-
- }
-
- }
- |
-
- {this.state.tableList.map((table, index) => {
- return (
-
+
+ {this.state.isWorkspaceRenaming &&
+
- );
- })}
-
-
-
- {this.state.isShowAddTableDialog &&
-
- }
- |
- {gettext('Add a DTable')} |
-
-
+ }
+ {!this.state.isWorkspaceRenaming &&
+
+ {workspace.name}
+
+
+
+
+ {gettext('Rename')}
+ {gettext('Delete')}
+
+
+ {this.state.isWorkspaceDeleting &&
+
+ }
+
+ }
+
+
+
+
+
+ {this.state.isShowAddTableDialog &&
+
+ }
+ {gettext('Add a DTable')}
+
+
+
+
+
+
+ {this.state.tableList.map((table, index) => {
+ return (
+
+ );
+ })}
+
+
+
);
}
}
Workspace.propTypes = workspacePropTypes;
-
-const contentPropTypes = {
- workspaceList: PropTypes.array.isRequired,
- renameWorkspace: PropTypes.func.isRequired,
- deleteWorkspace: PropTypes.func.isRequired,
-};
-
-class Content extends Component {
-
- render() {
- let workspaceList = this.props.workspaceList;
-
- return (
-
-
-
-
-
-
-
-
-
- {workspaceList.map((workspace, index) => {
- return (
-
- );
- })}
-
-
- );
- }
-}
-
-Content.propTypes = contentPropTypes;
-
-
class DTable extends Component {
constructor(props) {
super(props);
@@ -429,16 +432,20 @@ class DTable extends Component {
}
{!this.state.loading &&
-
-
+ {this.state.workspaceList.map((workspace, index) => {
+ return (
+
+ );
+ })}
-
+
+ {' '}{gettext('Add a Workspace')}
+
{this.state.isShowAddWorkspaceDialog &&
+
+
|