store: rename updatecompose to compose updated

Our compose actions will follow the naming convention of *name*_*event*.
Therefore, when we receive an updated compose from the api, the action
should be called COMPOSE_UPDATED.
This commit is contained in:
Jacob Kozol 2021-04-13 17:51:00 +02:00 committed by Sanne Raymaekers
parent 04aac0d7f0
commit fbada9d990
7 changed files with 18 additions and 18 deletions

View file

@ -51,7 +51,7 @@ class ImagesTable extends Component {
}
pollComposeStatuses() {
let { updateCompose, composes } = this.props;
let { composeUpdated, composes } = this.props;
Object.entries(composes).map(([ id, compose ]) => {
/* Skip composes that have been complete */
if (compose.image_status.status === 'success' || compose.image_status.status === 'failure') {
@ -61,7 +61,7 @@ class ImagesTable extends Component {
api.getComposeStatus(id).then(response => {
let newCompose = {};
newCompose[id] = Object.assign({}, compose, { image_status: response.image_status });
updateCompose(newCompose);
composeUpdated(newCompose);
});
});
}
@ -131,13 +131,13 @@ function mapStateToProps(state) {
function mapDispatchToProps(dispatch) {
return {
updateCompose: (compose) => dispatch(actions.updateCompose(compose)),
composeUpdated: (compose) => dispatch(actions.composeUpdated(compose)),
};
}
ImagesTable.propTypes = {
composes: PropTypes.object,
updateCompose: PropTypes.func,
composeUpdated: PropTypes.func,
};
export default connect(mapStateToProps, mapDispatchToProps)(ImagesTable);