diff --git a/app/actions/EditMyTree.js b/app/actions/EditMyTree.js index 912440c4c..ef38e080f 100644 --- a/app/actions/EditMyTree.js +++ b/app/actions/EditMyTree.js @@ -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); }); }; } diff --git a/app/actions/pledgeAction.js b/app/actions/pledgeAction.js index 280aa28d3..40c88c313 100644 --- a/app/actions/pledgeAction.js +++ b/app/actions/pledgeAction.js @@ -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); }); }; } diff --git a/app/actions/registerTree.js b/app/actions/registerTree.js index d3c42e5e0..2f903d8bc 100644 --- a/app/actions/registerTree.js +++ b/app/actions/registerTree.js @@ -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); }); }; } diff --git a/app/actions/targetAction.js b/app/actions/targetAction.js index 55f0663d9..141a78db6 100644 --- a/app/actions/targetAction.js +++ b/app/actions/targetAction.js @@ -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); }); }; } diff --git a/app/assets/images/logo_esri.png b/app/assets/images/logo_esri.png index c165af381..d764d12c2 100644 Binary files a/app/assets/images/logo_esri.png and b/app/assets/images/logo_esri.png differ diff --git a/app/components/GiftTrees/index.js b/app/components/GiftTrees/index.js index 959c9675e..a1569161e 100644 --- a/app/components/GiftTrees/index.js +++ b/app/components/GiftTrees/index.js @@ -467,6 +467,9 @@ export default class GiftTrees extends Component { {plantProjects.map(plantProject => ( - +
+ +
))} ); diff --git a/app/components/SelectPlantProject/index.js b/app/components/SelectPlantProject/index.js index c4ecfc790..1b4afe683 100644 --- a/app/components/SelectPlantProject/index.js +++ b/app/components/SelectPlantProject/index.js @@ -165,7 +165,6 @@ export default class SelectPlantProject extends Component { const settings = { dots: true, infinite: false, - adaptiveHeight: true, prevArrow: ( {featuredProjects.length !== 0 ? featuredProjects.map(project => ( -
+
this.callExpanded()} expanded={false} diff --git a/app/locales/en/commonlabels.js b/app/locales/en/commonlabels.js index 56d112f02..c26f0fd58 100644 --- a/app/locales/en/commonlabels.js +++ b/app/locales/en/commonlabels.js @@ -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 ' }; diff --git a/app/server/formSchemas/target.js b/app/server/formSchemas/target.js index 053e77fad..9b7909320 100644 --- a/app/server/formSchemas/target.js +++ b/app/server/formSchemas/target.js @@ -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', diff --git a/app/server/parserLiformToTcomb.js b/app/server/parserLiformToTcomb.js index ce4e3ed0a..9c010402d 100644 --- a/app/server/parserLiformToTcomb.js +++ b/app/server/parserLiformToTcomb.js @@ -193,6 +193,7 @@ export default function parseJsonToTcomb(liformSchemaJson, config = {}) { attr: liformSchema.properties[propertyKey].attr }; } + options.error = commonValidator; } } return schemaOptions; diff --git a/app/server/validator.js b/app/server/validator.js index 25cd14ff3..16225ba60 100644 --- a/app/server/validator.js +++ b/app/server/validator.js @@ -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 ( @@ -23,5 +22,11 @@ export const commonValidator = function(value, path, context) { ); } } + } else { + return ( +
+ {i18n.t('label.invalidValueMsg') + i18n.t(context.options.label)} +
+ ); } }; diff --git a/app/utils/api.js b/app/utils/api.js index cb98f249e..35f33da78 100644 --- a/app/utils/api.js +++ b/app/utils/api.js @@ -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()); diff --git a/web/stylesheet/_register_trees.scss b/web/stylesheet/_register_trees.scss index c990804b4..5f8caa16d 100644 --- a/web/stylesheet/_register_trees.scss +++ b/web/stylesheet/_register_trees.scss @@ -16,6 +16,7 @@ fieldset { flex: 1; display: flex; + flex-direction: column; } } } diff --git a/web/stylesheet/donateTrees/_donate_trees.scss b/web/stylesheet/donateTrees/_donate_trees.scss index 98151ddb6..d427a7dcb 100644 --- a/web/stylesheet/donateTrees/_donate_trees.scss +++ b/web/stylesheet/donateTrees/_donate_trees.scss @@ -155,6 +155,10 @@ display: inline-block; } } + .plant_project_content { + max-height:500px; + overflow: auto; + } } .projects-list { diff --git a/web/stylesheet/treeCounter/_tpo_footer.scss b/web/stylesheet/treeCounter/_tpo_footer.scss index 3241ebfe2..45a62c54e 100644 --- a/web/stylesheet/treeCounter/_tpo_footer.scss +++ b/web/stylesheet/treeCounter/_tpo_footer.scss @@ -7,6 +7,10 @@ .tpo-footer__container { position: relative; width: 100%; + .plant_project_carousal__content { + height: 380px; + overflow: auto; + } } .tpo-footer-card-layout { @@ -190,7 +194,6 @@ .project-images-carousal__container { background-color: $placeholderColor; margin-bottom: 39px; - min-height: 300px; .image-carousal { width: 100%; border: 0; @@ -220,7 +223,6 @@ .youtube-video__container { margin-top: 76px; margin-bottom: 43px; - min-height: 350px; } } }