Skip to content

Commit

Permalink
Merge pull request #3231 from LiteFarmOrg/patch/3.6.4
Browse files Browse the repository at this point in the history
Patch 3.6.4
  • Loading branch information
kathyavini authored Jun 12, 2024
2 parents 9923733 + 79eab18 commit 0136673
Show file tree
Hide file tree
Showing 16 changed files with 294 additions and 297 deletions.
2 changes: 1 addition & 1 deletion 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.6.3",
"version": "3.6.4",
"description": "LiteFarm API server",
"main": "./api/src/server.js",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ if (process.env.SENTRY_DSN && environment !== 'development') {
// Automatically instrument Node.js libraries and frameworks
...Sentry.autoDiscoverNodePerformanceMonitoringIntegrations(),
],
release: '3.6.3',
release: '3.6.4',
// Set tracesSampleRate to 1.0 to capture 100%
// of transactions for performance monitoring.
// We recommend adjusting this value in production
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.6.3",
"version": "3.6.4",
"description": "LiteFarm Web application",
"type": "module",
"scripts": {
Expand Down
5 changes: 2 additions & 3 deletions packages/webapp/src/containers/Consent/index.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { useForm } from 'react-hook-form';
import React, { useState } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import PureConsent from '../../components/Consent';
import { userFarmSelector } from '../userFarmSlice';
Expand All @@ -15,6 +14,7 @@ import PortugueseWorkerConsent from './locales/pt/Worker.Consent.md';
import SpanishOwnerConsent from './locales/es/Owner.Consent.md';
import SpanishWorkerConsent from './locales/es/Worker.Consent.md';
import { getLanguageFromLocalStorage } from '../../util/getLanguageFromLocalStorage';
import { CONSENT_VERSION } from '../../util/constants';

const languageConsent = {
en: { worker: <EnglishWorkerConsent />, owner: <EnglishOwnerConsent /> },
Expand Down Expand Up @@ -42,7 +42,6 @@ function ConsentForm({

formState: { errors },
} = useForm();
const [consentVersion] = useState('5.0');
const consent =
role.role_id === 3 ? getLanguageConsent(language).worker : getLanguageConsent(language).owner;
const checkboxName = 'consentCheckbox';
Expand All @@ -58,7 +57,7 @@ function ConsentForm({
};

const updateConsent = (data) => {
dispatch(patchConsent({ has_consent: true, consent_version: consentVersion, goForwardTo }));
dispatch(patchConsent({ has_consent: true, consent_version: CONSENT_VERSION, goForwardTo }));
};

return (
Expand Down
78 changes: 41 additions & 37 deletions packages/webapp/src/containers/Consent/locales/en/Owner.Consent.md

Large diffs are not rendered by default.

52 changes: 27 additions & 25 deletions packages/webapp/src/containers/Consent/locales/en/Worker.Consent.md

Large diffs are not rendered by default.

103 changes: 53 additions & 50 deletions packages/webapp/src/containers/Consent/locales/es/Owner.Consent.md

Large diffs are not rendered by default.

70 changes: 38 additions & 32 deletions packages/webapp/src/containers/Consent/locales/es/Worker.Consent.md

Large diffs are not rendered by default.

79 changes: 32 additions & 47 deletions packages/webapp/src/containers/Consent/locales/fr/Owner.Consent.md

Large diffs are not rendered by default.

78 changes: 30 additions & 48 deletions packages/webapp/src/containers/Consent/locales/fr/Worker.Consent.md

Large diffs are not rendered by default.

58 changes: 32 additions & 26 deletions packages/webapp/src/containers/Consent/locales/pt/Owner.Consent.md

Large diffs are not rendered by default.

52 changes: 28 additions & 24 deletions packages/webapp/src/containers/Consent/locales/pt/Worker.Consent.md

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions packages/webapp/src/containers/userFarmSlice.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { createSlice } from '@reduxjs/toolkit';
import { createSelector } from 'reselect';
import { CONSENT_VERSION } from '../util/constants';

export function onLoadingStart(state) {
state.loading = true;
Expand Down Expand Up @@ -218,6 +219,9 @@ export const userFarmSelector = createSelector(
? {
is_admin: adminRoles.includes(byFarmIdUserId[farm_id][user_id].role_id),
...byFarmIdUserId[farm_id][user_id],
has_consent:
byFarmIdUserId[farm_id][user_id].has_consent &&
byFarmIdUserId[farm_id][user_id].consent_version === CONSENT_VERSION,
}
: {};
},
Expand Down
2 changes: 1 addition & 1 deletion packages/webapp/src/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ if (import.meta.env.VITE_SENTRY_DSN) {
Sentry.init({
dsn: import.meta.env.VITE_SENTRY_DSN,
integrations: [new Integrations.BrowserTracing()],
release: '3.6.3',
release: '3.6.4',
// Set tracesSampleRate to 1.0 to capture 100%
// of transactions for performance monitoring.
// We recommend adjusting this value in production
Expand Down
2 changes: 2 additions & 0 deletions packages/webapp/src/util/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ export const DO_CDN_URL = `https://${
// Changing this forces logout and updates the new release card
export const APP_VERSION = '3.6.0';
export const VERSION_RELEASE_NOTES_LINK = 'https://www.litefarm.org/post/a-new-look-for-a-new-year';

export const CONSENT_VERSION = '6.0';

0 comments on commit 0136673

Please sign in to comment.