diff --git a/src/components/views/dialogs/DevtoolsDialog.js b/src/components/views/dialogs/DevtoolsDialog.js
index a7155ad12..85ab40292 100644
--- a/src/components/views/dialogs/DevtoolsDialog.js
+++ b/src/components/views/dialogs/DevtoolsDialog.js
@@ -244,6 +244,8 @@ class SendAccountData extends GenericEditor {
class FilteredList extends React.Component {
static propTypes = {
children: PropTypes.any,
+ query: PropTypes.string,
+ onChange: PropTypes.func,
};
constructor(props, context) {
@@ -251,12 +253,17 @@ class FilteredList extends React.Component {
this.onQuery = this.onQuery.bind(this);
this.state = {
- query: '',
+ query: this.props.query,
};
}
+ componentWillReceiveProps(nextProps) {
+ if (this.state.query !== nextProps.query) this.setState({ query: nextProps.query });
+ }
+
onQuery(ev) {
this.setState({ query: ev.target.value });
+ if (this.props.onChange) this.props.onChange(ev.target.value);
}
filterChildren() {
@@ -295,11 +302,16 @@ class RoomStateExplorer extends DevtoolsComponent {
this.onBack = this.onBack.bind(this);
this.editEv = this.editEv.bind(this);
+ this.onQueryEventType = this.onQueryEventType.bind(this);
+ this.onQueryStateKey = this.onQueryStateKey.bind(this);
this.state = {
eventType: null,
event: null,
editing: false,
+
+ queryEventType: '',
+ queryStateKey: '',
};
}
@@ -331,6 +343,14 @@ class RoomStateExplorer extends DevtoolsComponent {
this.setState({ editing: true });
}
+ onQueryEventType(filterEventType) {
+ this.setState({ queryEventType: filterEventType });
+ }
+
+ onQueryStateKey(filterStateKey) {
+ this.setState({ queryStateKey: filterStateKey });
+ }
+
render() {
if (this.state.event) {
if (this.state.editing) {
@@ -352,41 +372,47 @@ class RoomStateExplorer extends DevtoolsComponent {
;
}
- const rows = [];
+ let list = null;
const classes = 'mx_DevTools_RoomStateExplorer_button';
if (this.state.eventType === null) {
- Object.keys(this.roomStateEvents).forEach((evType) => {
- const stateGroup = this.roomStateEvents[evType];
- const stateKeys = Object.keys(stateGroup);
+ list =