mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Publish loading indicator
This commit is contained in:
parent
aefc1a5c01
commit
37d3d22fbd
@ -115,6 +115,7 @@ class CampaignListContainer extends SilverStripeComponent {
|
||||
<FormAction
|
||||
label={i18n._t('Campaigns.PUBLISHCAMPAIGN')}
|
||||
style={'success'}
|
||||
loading={this.props.campaign.isPublishing}
|
||||
handleClick={this.handlePublish}
|
||||
/>
|
||||
);
|
||||
@ -212,6 +213,7 @@ class CampaignListContainer extends SilverStripeComponent {
|
||||
|
||||
CampaignListContainer.propTypes = {
|
||||
publishApi: React.PropTypes.func.isRequired,
|
||||
isPublishing: React.PropTypes.bool,
|
||||
};
|
||||
|
||||
function mapStateToProps(state, ownProps) {
|
||||
@ -222,6 +224,7 @@ function mapStateToProps(state, ownProps) {
|
||||
}
|
||||
return {
|
||||
record: record || [],
|
||||
campaign: state.campaign,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -15,6 +15,17 @@ function campaignReducer(state = initialState, action) {
|
||||
view: action.payload.view,
|
||||
}));
|
||||
|
||||
case ACTION_TYPES.PUBLISH_CAMPAIGN_REQUEST:
|
||||
return deepFreeze(Object.assign({}, state, {
|
||||
isPublishing: true,
|
||||
}));
|
||||
|
||||
case ACTION_TYPES.PUBLISH_CAMPAIGN_SUCCESS:
|
||||
case ACTION_TYPES.PUBLISH_CAMPAIGN_FAILURE:
|
||||
return deepFreeze(Object.assign({}, state, {
|
||||
isPublishing: false,
|
||||
}));
|
||||
|
||||
default:
|
||||
return state;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user