Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ env:
global:
- CXX=g++-4.8
- DEPLOY_BRANCH=master
- secure: "EJJJclGX2TNXYdJe4A+rB3KFKYTaziq7VqgiphSku+oubVLTejVC1JzN4Ij6J/qUUY0azIDkeTClCiee54/uZl9d6tjHXt6zC7Ft4A4YqK+I/OzafIquUDibsUACMmxdDL+pK/88hzYIrB0Zi/VYLFtX8KyDYw8awketdWFq1COy6D2t7+gSg64M3ECqb6FNyyTbNRVerkAjH56PrGJsnXf6KIEtbro9wtRko62ngnCt+Tg2et53zSC5wK2R13CiqLXCxvosKkDzeFhekZh9pVEyuyx8SSAUk4RxGdKLLekD9eCOXzINhE39eLtf9/rP/9tpEhJ8Q/qiF2zTev8BY70sTpIf2Ks5j7MQ5zJG4NOZjrU/l+9ruTv5wU93yX18D3FcYJuZm7kIvHKMySxHLipTT6+O9ncN9hRxRt2VhLxYMpTrn9jAbO5RCwQpLYTeacxXxU2YbxpzVCXsRa55nRfVZNamlQ+XKSEK/V3DxFq0dRym0Wgk8SqVmLMm8HhtigzL1O6DV+az6lSWcts3MfExBNCS4YzspvNrOJSmq3rfEgxxGhTtbR1426ZSsix8E6jJCdiM2JwC+kZmG3ueWHjLOANI+UULame0MqKg8D2v8ks7EGxL+FnDWzUX0ujX+KpRoYWfcULmzArw0/OqzvYzqKMVlVDFilwhKvsRcDM="
- secure: "ryj7ydOUtqiNXdhY4dvoFKuZhMD5jAaJk5O/LXIyKzfgA12geyzr4tjomNr1onHjE5yo+08SmVw9nGneNMQqPl69K3vvqVdf8ZCkA9vYaOFxBCK/0J7rW2bqh2qX4wTWvAbNyzzMfuXS8R/3kdN8tBG1GOyTO+4uk5OwG593WK8jz/tfInqPeuJ8VyO3rieQz6uOepmuFpK6P31+Co8xcSoXBopUrCmhmSmLPRDcG8bT3hE6/7tzZC7w0qT7w+7PwVV+T/A2MEqkN36O2nj9ywQZSflVMW2y5JVfqR2bA5zp0bAQxuBXqQu2rPWrxoQzO+DDOO53tuSPrTTfg0+/napq60cUElzYr5riGdxM89kV0JI0v7CpC6fqhwg32UzgIXGJKljygNhPztJpB9Wtr0ox7NiBuC8p/B0Vh1j7FKn61XUhbtGcBFsUNkAy6DjOLaH7765VwzKN3KR/Xqn7z/8/HfSbvcryK6UwAOzdN2q+dEcSTkS6hjiTR9HA4Aq0o9u0ziFDvrbQIPCPcmMsvKImKx2SFpn8cNWBtHeDAaiL/FqepFtpQI/9HDjSXA4Ikb0DOCJqEMv4JTwQi5zY/nIkT6T+ZekJoXRCaFTtgWJUqWxNifJWFbUgesraM0q3NWxCemB1qcgdrA42REcma2JEEgIOANHbIHhKRIva0Kw="
addons:
apt:
sources:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# IFPRI Egypt Data Entry
# IFPRI Yemen Data Entry

Data Entry form for IFPRI backend. Authentication handled with Auth0.
Data Entry form for IFPRI backend. Authentication handled with Auth0.

## Development environment
To set up the development environment for this website, you'll need to install the following on your system:
Expand Down
2 changes: 1 addition & 1 deletion app/assets/scripts/components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Header extends React.Component {
<div className="wrapper-content">
<nav>
<ul>
<li><Link to='/'> MAP Egypt Dashboard</Link></li>
<li><Link to='/'> MAP Yemen Dashboard</Link></li>
<li><Link to='projects' className="browse-menu__item link--deco">Projects</Link></li>
<li><Link to='indicators' className="browse-menu__item link--deco">Indicators</Link></li>
</ul>
Expand Down
109 changes: 67 additions & 42 deletions app/assets/scripts/components/ProjectForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import CustomTextWidget from './widgets/CustomTextWidget';
import CustomNumberWidget from './widgets/CustomNumberWidget';
import Dropdown from './widgets/Dropdown';
import {setMaybe, transformErrors} from '../utils/nullUtils';
import {sdsLabels, sdgLabels} from '../utils/labels';
import {sdgLabels} from '../utils/labels';

export const schema = {
type: 'object',
Expand All @@ -23,7 +23,6 @@ export const schema = {
'planned_start_date',
'published',
'sdg_indicator',
'sds_indicator',
'status'
],
properties: {
Expand Down Expand Up @@ -107,16 +106,16 @@ export const schema = {
number_served_unit_ar: {type: 'string', title: 'الفئة', 'description': 'مثال: الاسر المستفيدة'}
}
},
sds_indicator: {
title: 'SDS Goals - أهداف استراتيجية التنمية المُستدامة',
type: 'array',
items: {
title: 'SDS Goal - هدف استراتيجية التنمية المُستدامة',
type: 'object',
required: ['en'],
properties: {en: {type: 'string', title: 'SDS Indicator'}, ar: {type: 'string'}}
}
},
// sds_indicator: {
// title: 'SDS Goals - أهداف استراتيجية التنمية المُستدامة',
// type: 'array',
// items: {
// title: 'SDS Goal - هدف استراتيجية التنمية المُستدامة',
// type: 'object',
// required: ['en'],
// properties: {en: {type: 'string', title: 'SDS Indicator'}, ar: {type: 'string'}}
// }
// },
sdg_indicator: {
title: 'SDG Goals - أهداف التنمية المستدامة',
type: 'array',
Expand Down Expand Up @@ -606,39 +605,57 @@ class ProjectForm extends React.Component {
[
'Planned',
'Ongoing',
'Closed'
'Closed',
'Suspended/Halted'
],
[
'مُخطط',
'جاري/ مستمر',
'مُغلق'
'مُغلق',
'معلق'
]
),
'select-ministry': Dropdown('Responsible Ministry - الوزارة المسؤولة', 'Select a Ministry',
[
'Ministry of Agriculture and Land Reclamation',
'Ministry of International Cooperation and Investment',
'Ministry of Environment – Egyptian Environment Affairs Agency',
'Ministry of Water Resources and Irrigation',
'Ministry of Trade and Industry',
'General Authority For Fish Resources Development'
'Ministry of Planning and International Cooperation',
'Ministry of Agriculture and Irrigation',
'Ministry of Water and Environment',
'Ministry of Local Administration',
'Ministry of Social Affairs and Labor',
'Ministry of Oil and Minerals',
'Ministry of Education',
'Ministry of Technical Education and Vocational Training',
'Ministry of Finance',
'Ministry of Electricity and Energy',
'Ministry of Public Health and Population',
'Ministry of Higher Education and Scientific Research',
'Ministry of Fish Wealth',
'Ministry of Industry and Trade'
],
[
'وزارة الزراعة واستصلاح الأراضي',
'وزارة الاستثمار و التعاون الدولى',
'وزارة البيئة - جهاز شئون البيئة',
'وزارة الموارد المائية والراي',
'وزارة التجارة والصناعة',
'الهيئة العامة لتنمية الثروة السمكية'
'وزارة التخطيط والتعاون الدولي',
'وزارة الزراعة والري',
'وزارة المياه والبيئة',
'وزارة الإدارة المحلية',
'وزارة الشؤون الإجتماعية والعمل',
'وزارة النفط والمعادن',
'وزارة التربية والتعليم',
'وزارة التعليم الفني والتدريب المهني',
'وزارة المالية',
'وزارة الكهرباء والطاقة',
'وزارة الصحة العامة والسكان',
'وزارة التعليم العالي والبحث العلمي',
'وزارة الثروة السمكية',
'وزارة الصناعة والتجارة'
]
),
'select-sds_indicator': Dropdown(
'SDS Goal - هدف استراتيجية التنمية المُستدامة',
sdsLabels.select,
sdsLabels.en,
sdsLabels.ar,
true
),
// 'select-sds_indicator': Dropdown(
// 'SDS Goal - هدف استراتيجية التنمية المُستدامة',
// sdsLabels.select,
// sdsLabels.en,
// sdsLabels.ar,
// true
// ),
'select-sdg_indicator': Dropdown(
'SDG Goal - هدف التنمية المستدامة',
sdgLabels.select,
Expand All @@ -650,20 +667,28 @@ class ProjectForm extends React.Component {
'Sub-sector - القطاع الفرعي',
'Select a sub-sector - يُرحى اختيار قطاع فرعي',
[
'Agriculture Extension & Research',
'Agro-industry, Marketing & Trade',
'Agriculture and food security',
'Health',
'Nutrition',
'Education',
'Rural Infrastructure and Irrigation',
'Crops',
'Fishing, Aquaculture & Forestry',
'Livestock',
'Rural Infrastructure & Irrigation'
'Agroindustry Marketing and Trade',
'Fisheries',
'Environment'
],
[
'الارشاد الزراعي والبحث',
'الصناعات الزراعية والتسويق والتجارة',
'الزراعة والأمن الغذائي',
'الصحة',
'التغذية',
'التعليم',
'لبنية التحتية الريفية والري',
'المحاصيل',
'صيد الأسماك و الزراعة المائية وعلم التحريج',
'الثروة الحيوانية',
'البنية التحتية بالمناطق الريفية والري'
'تربية الماشية',
'تسويق الصناعات الزراعية والتجارة',
'مصايد الأسماك',
'البيئة'
],
true
),
Expand Down
1 change: 1 addition & 0 deletions app/assets/scripts/components/widgets/CurrencyWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export default class CurrencyField extends React.Component {
<option value="THB">Thai Baht</option>
<option value="TRY">Turkish Lira</option>
<option value="USD">U.S. Dollar</option>
<option value="YER">Yemeni Rial</option>
</select>
</div>
<div className="col-sm-4">
Expand Down
6 changes: 3 additions & 3 deletions app/assets/scripts/config/production.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ var logo = require('./logo');
*/
module.exports = {
environment: 'production',
auth0_token: process.env.AUTH0_TOKEN,
auth0_namespace: process.env.AUTH0_NAMESPACE,
api_root: process.env.API_ROOT,
auth0_token: 'aAMY6pWnvscb5VCePYnH9w1Grv7c7QpH',
auth0_namespace: 'ifpri-yemen-silo.auth0.com',
api_root: 'https://ifpri-yemen-silo.herokuapp.com',
consoleMessage: logo
};

8 changes: 6 additions & 2 deletions app/assets/scripts/utils/AuthService.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,16 @@ export default class AuthService {

loggedIn () {
const token = this.getToken();
return !!token && !isTokenExpired(token) && isEditor(token);
return !!token && !isTokenExpired(token) && this.allowedAccess(token);
}

loggedInNotEditor () {
const token = this.getToken();
return !!token && !isTokenExpired(token) && !(isEditor(token) || isAdmin(token));
return !!token && !isTokenExpired(token) && !this.allowedAccess(token);
}

allowedAccess (token) {
return isEditor(token) || isAdmin(token);
}

isAdmin () {
Expand Down
Loading