Skip to content
This repository has been archived by the owner on Mar 23, 2019. It is now read-only.

Commit

Permalink
Nits after rebasing on master
Browse files Browse the repository at this point in the history
  • Loading branch information
helfi92 committed Oct 17, 2018
1 parent 079d3c8 commit bf98c37
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 35 deletions.
1 change: 0 additions & 1 deletion src/utils/prop-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,4 +356,3 @@ export const pulseMessage = shape({
redelivered: bool,
cc: string,
});
.neutr
3 changes: 2 additions & 1 deletion src/views/Clients/ViewClients/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ export default class ViewClients extends PureComponent {
clientSearch: props.user.credentials.clientId,
previousClientId: props.user.credentials.clientId,
};
} else if (!props.user && state.previousClientId !== '') {
}
if (!props.user && state.previousClientId !== '') {
return {
clientSearch: '',
previousClientId: '',
Expand Down
62 changes: 29 additions & 33 deletions src/views/PulseMessages/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ export default class PulseMessages extends Component {
};
}

subscriptionObserver = null;

constructor(props) {
super(props);

Expand All @@ -130,40 +132,14 @@ export default class PulseMessages extends Component {
};
}

subscriptionObserver = null;

unsubscribe() {
if (this.subscriptionObserver) {
this.subscriptionObserver.unsubscribe();
}
}

componentWillUnmount() {
this.unsubscribe();
}

addMessage(message) {
const messages = removeKeys(this.state.messages.concat(message), [
'__typename',
]);
const params = btoa(JSON.stringify(messages, null, 2));

this.setState({
messages,
downloadLink: `data:application/json;base64,${params}`,
});
}

handleInputChange = ({ target: { name, value } }) => {
this.setState({ [name]: value });
};

static getDerivedStateFromProps(props) {
return {
bindings: getBindingsFromProps(props),
};
}

handleAddBinding = () => {
const { pulseExchange, pattern } = this.state;
const bindings = this.state.bindings.concat([
Expand Down Expand Up @@ -235,6 +211,24 @@ export default class PulseMessages extends Component {
a.dispatchEvent(new MouseEvent('click'));
};

addMessage(message) {
const messages = removeKeys(this.state.messages.concat(message), [
'__typename',
]);
const params = btoa(JSON.stringify(messages, null, 2));

this.setState({
messages,
downloadLink: `data:application/json;base64,${params}`,
});
}

unsubscribe() {
if (this.subscriptionObserver) {
this.subscriptionObserver.unsubscribe();
}
}

render() {
const { classes } = this.props;
const {
Expand Down Expand Up @@ -357,12 +351,14 @@ export default class PulseMessages extends Component {
noItemsMessage="No messages received."
renderRow={message => (
<TableRow
key={`message-${message.routingKey}-${message.exchange}`}>
key={`message-${message.routingKey}-${message.exchange}`}
>
<TableCell>
<Button
className={classes.infoButton}
size="small"
onClick={() => this.handleMessageDrawerOpen(message)}>
onClick={() => this.handleMessageDrawerOpen(message)}
>
<InformationVariantIcon size={iconSize} />
</Button>
{message.exchange}
Expand Down Expand Up @@ -406,17 +402,17 @@ export default class PulseMessages extends Component {
classes={{
paper: classes.drawerPaper,
}}
onClose={this.handleMessageDrawerClose}>
onClose={this.handleMessageDrawerClose}
>
<Fragment>
<IconButton
onClick={this.handleMessageDrawerClose}
className={classes.drawerCloseIcon}>
className={classes.drawerCloseIcon}
>
<CloseIcon />
</IconButton>
<div className={classes.drawerContainer}>
<Typography
variant="h5"
className={classes.drawerHeadline}>
<Typography variant="h5" className={classes.drawerHeadline}>
Message
</Typography>
<List>
Expand Down

0 comments on commit bf98c37

Please sign in to comment.