Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #247 from Plant-for-the-Planet-org/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Nitesh Garg authored Jul 7, 2018
2 parents a6498f7 + c8db2ca commit 88f67d0
Show file tree
Hide file tree
Showing 16 changed files with 44 additions and 44 deletions.
10 changes: 3 additions & 7 deletions app/actions/EditMyTree.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,17 @@ export function editTree(plantContribution, plantId) {
plantContribution: plantId
})
.then(res => {
const { statusText, status } = res;
const { statusText } = res;
const { contribution, treecounter } = res.data;

NotificationManager.success(statusText, status, 5000);
NotificationManager.success(statusText, 'Success', 5000);
dispatch(mergeEntities(normalize(treecounter, treecounterSchema)));
dispatch(mergeEntities(normalize(contribution, contributionSchema)));
updateRoute('app_myTrees', dispatch);
})
.catch(error => {
debug(error.response);
NotificationManager.error(
error.response.data.message,
error.response.data.code,
5000
);
NotificationManager.error(error.response.data.message, 'Error', 5000);
});
};
}
10 changes: 3 additions & 7 deletions app/actions/pledgeAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,12 @@ export function postPledge(data, params) {
postRequest('eventPledge_post', data, params)
.then(res => {
console.log(dispatch, res);
const { statusText, status } = res;
const { statusText } = res;

NotificationManager.success('Success', status, 5000);
NotificationManager.success(statusText, 'Success', 5000);
})
.catch(error => {
NotificationManager.error(
error.response.data.message,
error.response.data.code,
5000
);
NotificationManager.error(error.response.data.message, 'Error', 5000);
});
};
}
Expand Down
10 changes: 3 additions & 7 deletions app/actions/registerTree.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,17 @@ export function registerTree(plantContribution, treecounterId, mode) {
mode: mode
})
.then(res => {
const { statusText, status } = res;
const { statusText } = res;
const { contribution, treecounter } = res.data;

NotificationManager.success(statusText, status, 5000);
NotificationManager.success(statusText, 'Success', 5000);
dispatch(mergeEntities(normalize(treecounter, treecounterSchema)));
dispatch(mergeEntities(normalize(contribution, contributionSchema)));
history.push(getLocalRoute('app_userHome'));
})
.catch(error => {
debug(error.response);
NotificationManager.error(
error.response.data.message,
error.response.data.code,
5000
);
NotificationManager.error(error.response.data.message, 'Error', 5000);
});
};
}
6 changes: 1 addition & 5 deletions app/actions/targetAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ export function SubmitTarget(treecounterData) {
})
.catch(error => {
debug(error);
NotificationManager.error(
error.response.data.message,
error.response.data.code,
5000
);
NotificationManager.error(error.response.data.message, 'Error', 5000);
});
};
}
Binary file modified app/assets/images/logo_esri.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions app/components/GiftTrees/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,9 @@ export default class GiftTrees extends Component {
<PaymentSelector
paymentMethods={paymentMethods}
accounts={plantProject.paymentSetup.accounts}
stripePublishableKey={
plantProject.paymentSetup.stripePublishableKey
}
amount={this.state.selectedAmount}
currency={this.state.selectedCurrency}
expandedOption={this.state.expandedOption}
Expand Down
14 changes: 8 additions & 6 deletions app/components/PlantProjects/PlantProjectCarousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@ class PlantProjectCarousel extends React.Component {
return (
<Slider {...settings}>
{plantProjects.map(plantProject => (
<PlantProjectFull
key={`plantProject-${plantProject.id}`}
expanded={false}
tpoName={tpoName}
plantProject={plantProject}
/>
<div className="plant_project_carousal__content">
<PlantProjectFull
key={`plantProject-${plantProject.id}`}
expanded={false}
tpoName={tpoName}
plantProject={plantProject}
/>
</div>
))}
</Slider>
);
Expand Down
3 changes: 1 addition & 2 deletions app/components/SelectPlantProject/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ export default class SelectPlantProject extends Component {
const settings = {
dots: true,
infinite: false,
adaptiveHeight: true,
prevArrow: (
<CarouselNavigation
styleName="tpo-footer-nav-img__left"
Expand Down Expand Up @@ -212,7 +211,7 @@ export default class SelectPlantProject extends Component {
<Slider {...settings}>
{featuredProjects.length !== 0
? featuredProjects.map(project => (
<div key={project.id}>
<div key={project.id} className="plant_project_content">
<PlantProjectFull
callExpanded={() => this.callExpanded()}
expanded={false}
Expand Down
3 changes: 2 additions & 1 deletion app/locales/en/commonlabels.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ export default {
notification_error: 'Login Error',
isRequired: ' is Required',
enterValidEmail: 'Enter valid Email',
invalidLength: 'Invalid Length: should be less than '
invalidLength: 'Invalid Length: should be less than ',
invalidValueMsg: 'Please enter valid '
};
4 changes: 3 additions & 1 deletion app/server/formSchemas/target.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ export default {
type: 'integer',
title: 'label.target_year',
pattern: '[0-9]{4}',
propertyOrder: 2
propertyOrder: 2,
minimum: 1000,
maximum: 9999
},
targetComment: {
type: 'string',
Expand Down
1 change: 1 addition & 0 deletions app/server/parserLiformToTcomb.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ export default function parseJsonToTcomb(liformSchemaJson, config = {}) {
attr: liformSchema.properties[propertyKey].attr
};
}
options.error = commonValidator;
}
}
return schemaOptions;
Expand Down
7 changes: 6 additions & 1 deletion app/server/validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import i18n from '../locales/i18n.js';

export const commonValidator = function(value, path, context) {
let hasConfig = context && context.options.config;

if (!value && hasConfig && hasConfig.required) {
console.log('TEST_ERROR', value, path, context);
return (
Expand All @@ -23,5 +22,11 @@ export const commonValidator = function(value, path, context) {
);
}
}
} else {
return (
<div className="error-msg">
{i18n.t('label.invalidValueMsg') + i18n.t(context.options.label)}
</div>
);
}
};
6 changes: 1 addition & 5 deletions app/utils/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ function checkStatus(response) {

function onAPIError(error) {
if (error.response) {
NotificationManager.error(
error.response.data.message,
error.response.data.code,
5000
);
NotificationManager.error(error.response.data.message, 'Error', 5000);
}
if (error.response && error.response.status === 401) {
getStore().dispatch(logoutUser());
Expand Down
1 change: 1 addition & 0 deletions web/stylesheet/_register_trees.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
fieldset {
flex: 1;
display: flex;
flex-direction: column;
}
}
}
4 changes: 4 additions & 0 deletions web/stylesheet/donateTrees/_donate_trees.scss
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@
display: inline-block;
}
}
.plant_project_content {
max-height:500px;
overflow: auto;
}
}

.projects-list {
Expand Down
6 changes: 4 additions & 2 deletions web/stylesheet/treeCounter/_tpo_footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
.tpo-footer__container {
position: relative;
width: 100%;
.plant_project_carousal__content {
height: 380px;
overflow: auto;
}
}

.tpo-footer-card-layout {
Expand Down Expand Up @@ -190,7 +194,6 @@
.project-images-carousal__container {
background-color: $placeholderColor;
margin-bottom: 39px;
min-height: 300px;
.image-carousal {
width: 100%;
border: 0;
Expand Down Expand Up @@ -220,7 +223,6 @@
.youtube-video__container {
margin-top: 76px;
margin-bottom: 43px;
min-height: 350px;
}
}
}
Expand Down

0 comments on commit 88f67d0

Please sign in to comment.