Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX Create campaign success message #37

Merged
merged 14 commits into from
Aug 3, 2017
5 changes: 5 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,10 @@
},
"rules": {
"init-declarations": 1
},
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true
}
}
}
Binary file added client/dist/images/empty-campaign-preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion client/dist/js/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/dist/styles/bundle.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion client/dist/styles/bundle.css.map

This file was deleted.

4 changes: 2 additions & 2 deletions client/lang/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if (typeof(ss) === 'undefined' || typeof(ss.i18n) === 'undefined') {
}
} else {
ss.i18n.addDictionary('en', {
"CampaignAdmin.ADDCAMPAIGN": "Add campaign",
"CampaignAdmin.ADDCAMPAIGN": "Add new",
"CampaignAdmin.DELETECAMPAIGN": "Are you sure you want to delete this record?",
"CampaignAdmin.DRAFT": "Draft",
"CampaignAdmin.ITEM_SUMMARY_PLURAL": "%s items",
Expand All @@ -17,4 +17,4 @@ if (typeof(ss) === 'undefined' || typeof(ss.i18n) === 'undefined') {
"CampaignAdmin.REMOVED": "Removed",
"CampaignAdmin.REVERTCAMPAIGN": "Revert"
});
}
}
4 changes: 2 additions & 2 deletions client/lang/src/en.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"CampaignAdmin.ADDCAMPAIGN": "Add campaign",
"CampaignAdmin.ADDCAMPAIGN": "Add new",
"CampaignAdmin.DELETECAMPAIGN": "Are you sure you want to delete this record?",
"CampaignAdmin.DRAFT": "Draft",
"CampaignAdmin.ITEM_SUMMARY_PLURAL": "%s items",
Expand All @@ -9,4 +9,4 @@
"CampaignAdmin.PUBLISHCAMPAIGN": "Publish campaign",
"CampaignAdmin.REMOVED": "Removed",
"CampaignAdmin.REVERTCAMPAIGN": "Revert"
}
}
6 changes: 5 additions & 1 deletion client/src/containers/CampaignAdmin/CampaignAdmin.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { bindActionCreators } from 'redux';
import { withRouter } from 'react-router';
import getFormState from 'lib/getFormState';
import backend from 'lib/Backend';
import * as campaignActions from 'state/campaign/CampaignActions';
import * as breadcrumbsActions from 'state/breadcrumbs/BreadcrumbsActions';
import Breadcrumb from 'components/Breadcrumb/Breadcrumb';
import SilverStripeComponent from 'lib/SilverStripeComponent';
Expand Down Expand Up @@ -119,7 +120,8 @@ class CampaignAdmin extends SilverStripeComponent {
// open the new campaign in edit mode after save completes
const sectionUrl = this.props.sectionConfig.url;
const id = response.record.id;
this.props.router.push(`${sectionUrl}/set/${id}/edit`);
this.props.campaignActions.setNewItem(id);
this.props.router.push(`${sectionUrl}/set/${id}/show`);
}

return response;
Expand Down Expand Up @@ -166,6 +168,7 @@ class CampaignAdmin extends SilverStripeComponent {
const formActionProps = {
title: i18n._t('CampaignAdmin.ADDCAMPAIGN'),
icon: 'plus',
extraClass: 'btn-primary',
handleClick: this.addCampaign.bind(this),
};
const formBuilderProps = {
Expand Down Expand Up @@ -410,6 +413,7 @@ function mapStateToProps(state, ownProps) {
function mapDispatchToProps(dispatch) {
return {
breadcrumbsActions: bindActionCreators(breadcrumbsActions, dispatch),
campaignActions: bindActionCreators(campaignActions, dispatch),
};
}

Expand Down
39 changes: 39 additions & 0 deletions client/src/containers/CampaignAdmin/CampaignAdmin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,24 @@
}
}
}

.campaign-admin__campaign-preview--empty {
align-items: center;
justify-content: center;
}

.campaign-admin__empty-heading {
font-size: $font-size-h1;
margin-bottom: 1em;
}

.campaign-admin__empty-info {
padding-top: calc(270px + 0.5em);
background-image: url('empty-campaign-preview.png');
background-repeat: no-repeat;
background-position: 50% 0;
font-size: $font-size-lg;
}
}

.campaign-admin__campaign-items {
Expand Down Expand Up @@ -77,6 +95,27 @@
}
}

.list-group-wrapper--empty {
.list-group {
border-bottom: 0;
}

.list-group-item {
background: transparent;
font-style: italic;
border-bottom: 0;
cursor: default;
}

.accordion__title {
cursor: default;

&:before {
display: none;
}
}
}

.campaign-admin__item-links--is-linked {
opacity: 1;

Expand Down
Loading