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

Bring approved fixes from hotfix to integration #2175

Merged
merged 32 commits into from
Jul 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
167a36d
Merge pull request #1859 from LiteFarmOrg/hotfix/3.1.1-translation
smattingly Apr 15, 2022
1bf544d
Merge branch 'integration' into main: v3.2.0
smattingly Jun 8, 2022
a34ade2
Merge branch 'integration' into main v3.2.1
smattingly Jun 13, 2022
0e6851d
Translated "MISSING" tags for FR, PT, and SP
smattingly Jun 20, 2022
d017c39
WIP
jagDhillon077 Jun 15, 2022
ebf8249
Bug fix
jagDhillon077 Jun 15, 2022
d25a477
Bug fix for map and crop variety detail page
AbdusShaikh Jun 17, 2022
882d838
Fix code, English for incorrect wording
smattingly Jun 17, 2022
bb72bac
Finish translations
smattingly Jun 17, 2022
c80d537
More general fix
AbdusShaikh Jun 20, 2022
ce285f7
Revert back to pre release functionality - changing units changes values
jagDhillon077 Jun 20, 2022
77fd2d3
Additional translation error
dtrapplitefarm Jun 20, 2022
ebffb31
Updated names
Cali0707 Jun 21, 2022
e849078
Added quote escapes
Cali0707 Jun 21, 2022
25fd0b8
Bump version to 3.2.2
smattingly Jun 21, 2022
c3c2d3a
Merge pull request #2137 from LiteFarmOrg/v3.2.2
smattingly Jul 11, 2022
02c1bf8
fix: continue with google on invite issue
fsayyid Jul 6, 2022
b02343a
Log API crash in Docker container, restart service
smattingly Jul 11, 2022
ad77332
Bump to v3.2.3
smattingly Jul 11, 2022
d60cf2d
Fixed update user
Cali0707 Jul 14, 2022
f31b7ab
Update index.jsx
AbdusShaikh Jul 11, 2022
0c93fde
Made cherry pick
Cali0707 Jul 18, 2022
9e15792
Made cherry pick
Cali0707 Jul 18, 2022
dc68726
Added sandbox_user column to users table
Cali0707 Jul 18, 2022
1e0e187
Merge pull request #2161 from LiteFarmOrg/LF-2554/cherry-pick
smattingly Jul 18, 2022
0c0963a
Added sandbox_user column to users model
Cali0707 Jul 19, 2022
6c48c5f
Merge pull request #2160 from LiteFarmOrg/LF-2576/cherry-pick
smattingly Jul 19, 2022
c91acc0
Fixed merge conflicts
Cali0707 Jul 21, 2022
7f61281
Merge pull request #2151 from LiteFarmOrg/LF-2649-adding-a-salary-to-…
smattingly Jul 21, 2022
a820485
Merge pull request #2162 from LiteFarmOrg/LF-2555-add-sandbox-user-bo…
smattingly Jul 21, 2022
8ae2a84
Fixed merge conflicts
Cali0707 Jul 21, 2022
1b7122a
Merge pull request #2176 from LiteFarmOrg/fixes-jul-2022-merge-resolu…
smattingly Jul 21, 2022
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
27 changes: 27 additions & 0 deletions packages/api/db/migration/20220718193208_add_sandbox_column.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright 2019, 2020, 2021, 2022 LiteFarm.org
* This file is part of LiteFarm.
*
* LiteFarm is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* LiteFarm is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details, see <https://www.gnu.org/licenses/>.
*/

exports.up = async function (knex) {
await knex.schema.alterTable('users', (table) => {
table.boolean('sandbox_user').defaultTo(false);
});
return knex('users').update({ sandbox_user: false });
};

exports.down = async function (knex) {
return knex.schema.alterTable('users', (table) => {
table.dropColumns('sandbox_user');
});
};
4 changes: 2 additions & 2 deletions packages/api/package-lock.json

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

2 changes: 1 addition & 1 deletion packages/api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "litefarm-api",
"version": "3.2.1",
"version": "3.2.3",
"description": "LiteFarm API server",
"main": "./api/src/server.js",
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions packages/api/src/models/userModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class User extends Model {
phone_number: { type: ['string', null] },
user_address: { type: ['string', null] },
email: { type: 'email' },
sandbox_user: { type: 'boolean' },
notification_setting: {
type: 'object',
required: [
Expand Down
2 changes: 1 addition & 1 deletion packages/webapp/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "litefarm-webapp",
"version": "3.2.1",
"version": "3.2.3",
"description": "LiteFarm Web application",
"scripts": {
"dev": "CYPRESS_COVERAGE=TRUE vite",
Expand Down
2 changes: 1 addition & 1 deletion packages/webapp/public/locales/es/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@
"DRAWING_MANAGER": {
"REDRAW": "Repintar",
"ZERO_AREA_DETECTED": "Campo sin area detectado. Por favor, agrega mas puntos o comienza de nuevo.",
"ZERO_LENGTH_DETECTED": "Linea sin medida. Por favor, comienza de nuevo."
"ZERO_LENGTH_DETECTED": "Línea sin longitud detectada. Por favor dibuja de nuevo."
},
"EXPORT_MODAL": {
"BODY": "Como quieres exportar el mapa?",
Expand Down
2 changes: 1 addition & 1 deletion packages/webapp/public/locales/pt/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@
"DRAWING_MANAGER": {
"REDRAW": "Redesenhar",
"ZERO_AREA_DETECTED": "Campo sem área detectado. Por favor adicione mais pontos ao desenho atual ou desenhe novamente.",
"ZERO_LENGTH_DETECTED": "MISSING"
"ZERO_LENGTH_DETECTED": "Linha sem comprimento detectado. Por favor, desenhe novamente."
},
"EXPORT_MODAL": {
"BODY": "Como você quer exportar o seu mapa?",
Expand Down
2 changes: 2 additions & 0 deletions packages/webapp/src/components/Profile/EditUser/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export default function PureEditUser({
3: t('role:WORKER'),
5: t('role:EXTENSION_OFFICER'),
};

const genderOptions = [
{ value: 'MALE', label: t('gender:MALE') },
{ value: 'FEMALE', label: t('gender:FEMALE') },
Expand All @@ -51,6 +52,7 @@ export default function PureEditUser({
value: role_id,
label: dropDownMap[role_id],
}));

const roleOption = isPseudoUser
? { value: 3, label: dropDownMap[3] }
: { value: userFarm.role_id, label: dropDownMap[userFarm.role_id] };
Expand Down
1 change: 0 additions & 1 deletion packages/webapp/src/containers/Map/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ export default function Map({ history }) {
maps.event.addListener(drawingManagerInit, 'polylinecomplete', function (polyline) {
const polylineLengthCheck = (path) => {
if (Math.round(maps.geometry.spherical.computeLength(path)) === 0) {
console.log('Zero length!');
setShowZeroLengthWarning(true);
} else {
setShowZeroLengthWarning(false);
Expand Down
4 changes: 2 additions & 2 deletions packages/webapp/src/containers/Profile/EditUser.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ export default function EditUser({ history, match }) {
}, [user_id, currentUserId]);

const getReqBody = (data) => {
const role_id = parseInt(data.role_id.value);
const role_id = data.role_id ? parseInt(data.role_id?.value) : null;
const reqBody = {
...data,
user_id,
role_id,
wage: { amount: data.wage.amount, type: userFarm.wage?.type || 'hourly' },
};
if (role_id === userFarm.role_id) delete reqBody.role_id;
if (role_id === userFarm.role_id || !role_id) delete reqBody.role_id;
if (data.wage?.amount === userFarm.wage?.amount) delete reqBody.wage;
return reqBody;
};
Expand Down
2 changes: 1 addition & 1 deletion packages/webapp/src/util/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ export const DO_ORIGIN_URL = `https://${
export const DO_CDN_URL = `https://${
import.meta.env.VITE_DO_BUCKET_NAME
}.nyc3.cdn.digitaloceanspaces.com`;
export const APP_VERSION = '3.2.1';
export const APP_VERSION = '3.2.3';