-
- value ? Promise.resolve() : Promise.reject(new Error('You must accept the terms and conditions')),
- },
- ]}
- >
- I accept the terms and conditions
-
+ {!hasEverScrolledToBottom && (
+
+
You must scroll to the bottom of the Terms and Conditions before accepting.
+
+ )}
}
+export default connect(mapStateToProps, mapDispatchToProps)(Eula);
\ No newline at end of file
diff --git a/client/src/components/eula/testData.json b/client/src/components/eula/testData.json
deleted file mode 100644
index 03827a783..000000000
--- a/client/src/components/eula/testData.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "eula": "# End User License Agreement (EULA)\n## 1. Introduction\n\nThis End User License Agreement (\"EULA\") governs your use of our website and any related services. By using our website, you agree to be bound by the terms of this EULA.\n\n## 2. License Grant\n\nWe grant you a non-exclusive, non-transferable, revocable license to use our website for your personal, non-commercial use.\n\n## 3. Restrictions\n\nYou agree not to:\n\n- Use our website for any illegal or unauthorized purpose\n- Attempt to reverse engineer or otherwise derive the source code of our website\n\n## 4. Termination\n\nWe reserve the right to terminate your license to use our website at any time and for any reason.\n\n## 5. Disclaimer of Warranties\n\nOur website is provided \"as is\" and without any warranty of any kind.\n\n## 6. Limitation of Liability\n\nWe will not be liable for any damages or losses arising from your use of our website.\n\n## 7. Governing Law\n\nThis EULA is governed by the laws of [Your Jurisdiction].\n\n## 8. Changes to this EULA\n\nWe reserve the right to modify this EULA at any time. Your continued use of our website after any such changes constitutes your acceptance of the new EULA.\n\n## 9. Contact Us\n\nIf you have any questions about this EULA, please contact us at [Your Contact Information].\n## 1. Introduction\n\nThis End User License Agreement (\"EULA\") governs your use of our website and any related services. By using our website, you agree to be bound by the terms of this EULA.\n\n## 2. License Grant\n\nWe grant you a non-exclusive, non-transferable, revocable license to use our website for your personal, non-commercial use.\n\n## 3. Restrictions\n\nYou agree not to:\n\n- Use our website for any illegal or unauthorized purpose\n- Attempt to reverse engineer or otherwise derive the source code of our website\n\n## 4. Termination\n\nWe reserve the right to terminate your license to use our website at any time and for any reason.\n\n## 5. Disclaimer of Warranties\n\nOur website is provided \"as is\" and without any warranty of any kind.\n\n## 6. Limitation of Liability\n\nWe will not be liable for any damages or losses arising from your use of our website.\n\n## 7. Governing Law\n\nThis EULA is governed by the laws of [Your Jurisdiction].\n\n## 8. Changes to this EULA\n\nWe reserve the right to modify this EULA at any time. Your continued use of our website after any such changes constitutes your acceptance of the new EULA.\n\n## 9. Contact Us\n\nIf you have any questions about this EULA, please contact us at [Your Contact Information].\n## 1. Introduction\n\nThis End User License Agreement (\"EULA\") governs your use of our website and any related services. By using our website, you agree to be bound by the terms of this EULA.\n\n## 2. License Grant\n\nWe grant you a non-exclusive, non-transferable, revocable license to use our website for your personal, non-commercial use.\n\n## 3. Restrictions\n\nYou agree not to:\n\n- Use our website for any illegal or unauthorized purpose\n- Attempt to reverse engineer or otherwise derive the source code of our website\n\n## 4. Termination\n\nWe reserve the right to terminate your license to use our website at any time and for any reason.\n\n## 5. Disclaimer of Warranties\n\nOur website is provided \"as is\" and without any warranty of any kind.\n\n## 6. Limitation of Liability\n\nWe will not be liable for any damages or losses arising from your use of our website.\n\n## 7. Governing Law\n\nThis EULA is governed by the laws of [Your Jurisdiction].\n\n## 8. Changes to this EULA\n\nWe reserve the right to modify this EULA at any time. Your continued use of our website after any such changes constitutes your acceptance of the new EULA.\n\n## 9. Contact Us\n\nIf you have any questions about this EULA, please contact us at [Your Contact Information]."
-}
\ No newline at end of file
diff --git a/client/src/graphql/user.queries.js b/client/src/graphql/user.queries.js
index 09ba53787..d69429ba5 100644
--- a/client/src/graphql/user.queries.js
+++ b/client/src/graphql/user.queries.js
@@ -31,6 +31,14 @@ export const UPDATE_ASSOCIATION = gql`
}
`;
+export const INSERT_EULA_ACCEPTANCE = gql`
+ mutation INSERT_EULA_ACCEPTANCE($eulaAcceptance:eula_acceptances_insert_input!) {
+ insert_eula_acceptances_one(object: $eulaAcceptance){
+ id
+ }
+ }
+`;
+
export const UPSERT_USER = gql`
mutation UPSERT_USER($authEmail: String!, $authToken: String!) {
insert_users(
diff --git a/client/src/redux/user/user.actions.js b/client/src/redux/user/user.actions.js
index f5a9a2d4f..b5c62a73c 100644
--- a/client/src/redux/user/user.actions.js
+++ b/client/src/redux/user/user.actions.js
@@ -110,8 +110,12 @@ export const setAuthlevel = (authlevel) => ({
payload: authlevel,
});
-export const setEulaContentToShow = (eulaContent) => ({
- type: UserActionTypes.SET_EULA_CONTENT,
- payload: eulaContent,
+export const setCurrentEula = (eula) => ({
+ type: UserActionTypes.SET_CURRENT_EULA,
+ payload: eula,
+});
+
+export const acceptEula = () => ({
+ type: UserActionTypes.EULA_ACCEPTED,
});
diff --git a/client/src/redux/user/user.reducer.js b/client/src/redux/user/user.reducer.js
index 641d127c2..5a1644f3b 100644
--- a/client/src/redux/user/user.reducer.js
+++ b/client/src/redux/user/user.reducer.js
@@ -18,7 +18,7 @@ const INITIAL_STATE = {
loading: false,
},
authLevel: 0,
- eulaContentToShow:null
+ currentEula: null,
};
const userReducer = (state = INITIAL_STATE, action) => {
@@ -65,11 +65,19 @@ const userReducer = (state = INITIAL_STATE, action) => {
loading: false,
},
};
+ case UserActionTypes.EULA_ACCEPTED:
+ return {
+ ...state,
+ currentUser:{...state.currentUser, eulaIsAccepted: true},
+ currentEula: null,
+ };
case UserActionTypes.SIGN_IN_SUCCESS:
+ const{ currentEula,...currentUser} = action.payload
return {
...state,
loginLoading: false,
- currentUser: action.payload,
+ currentUser: currentUser,
+ currentEula,
error: null,
};
case UserActionTypes.SIGN_OUT_SUCCESS:
diff --git a/client/src/redux/user/user.sagas.js b/client/src/redux/user/user.sagas.js
index 867c8e0cb..50201ba5d 100644
--- a/client/src/redux/user/user.sagas.js
+++ b/client/src/redux/user/user.sagas.js
@@ -97,7 +97,7 @@ export function* isUserAuthenticated() {
},
});
- const isEulaAccepted = eulaQuery.data.eulas.length > 0 && eulaQuery.data.eulas[0].eula_acceptances.length > 0;
+ const eulaIsAccepted = eulaQuery.data.eulas.length > 0 && eulaQuery.data.eulas[0].eula_acceptances.length > 0;
yield put(
signInSuccess({
@@ -106,7 +106,8 @@ export function* isUserAuthenticated() {
displayName: user.displayName,
photoURL: user.photoURL,
authorized: true,
- isEulaAccepted,
+ eulaIsAccepted,
+ currentEula: eulaIsAccepted ? null : eulaQuery.data.eulas[0],
})
);
} catch (error) {
diff --git a/client/src/redux/user/user.selectors.js b/client/src/redux/user/user.selectors.js
index c3d0fe572..6e2193a10 100644
--- a/client/src/redux/user/user.selectors.js
+++ b/client/src/redux/user/user.selectors.js
@@ -37,7 +37,7 @@ export const selectLoginLoading = createSelector(
(user) => user.loginLoading
);
-export const selectEulaContentToShow = createSelector(
+export const selectCurrentEula = createSelector(
[selectUser],
- (user) => user.eulaContentToShow
+ (user) => user.currentEula
);
diff --git a/client/src/redux/user/user.types.js b/client/src/redux/user/user.types.js
index cd4e952cd..0e153b31a 100644
--- a/client/src/redux/user/user.types.js
+++ b/client/src/redux/user/user.types.js
@@ -32,6 +32,7 @@ const UserActionTypes = {
CHECK_ACTION_CODE_START: "CHECK_ACTION_CODE_START",
CHECK_ACTION_CODE_SUCCESS: "CHECK_ACTION_CODE_SUCCESS",
CHECK_ACTION_CODE_FAILURE: "CHECK_ACTION_CODE_FAILURE",
- SET_EULA_CONTENT: "SET_EULA_CONTENT"
+ SET_CURRENT_EULA: "SET_CURRENT_EULA",
+ EULA_ACCEPTED : "EULA_ACCEPTED",
};
export default UserActionTypes;
diff --git a/client/test.md b/client/test.md
new file mode 100644
index 000000000..186553d61
--- /dev/null
+++ b/client/test.md
@@ -0,0 +1,31 @@
+# End User License Agreement (EULA)
+
+## 1. Introduction
+
+This End User License Agreement ("EULA") is a legal agreement between you and [Your Company Name] ("Company"). This EULA governs your acquisition and use of our [Software Name] ("Software") directly from [Your Company Name] or indirectly through a [Your Company Name] authorized reseller or distributor.
+
+By installing and/or using the [Software Name], you are confirming your acceptance of the Software and agreeing to become bound by the terms of this EULA agreement.
+
+## 2. License
+
+[Your Company Name] hereby grants you a personal, non-transferable, non-exclusive licence to use the [Software Name] on your devices in accordance with the terms of this EULA agreement.
+
+## 3. Restrictions
+
+You are not permitted to:
+
+- Edit, alter, modify, adapt, translate or otherwise change the whole or any part of the Software nor permit the whole or any part of the Software to be combined with or become incorporated in any other software, nor decompile, disassemble or reverse engineer the Software or attempt to do any such things.
+
+- Reproduce, copy, distribute, resell or otherwise use the Software for any commercial purpose.
+
+- Allow any third party to use the Software on behalf of or for the benefit of any third party.
+
+- Use the Software in any way which breaches any applicable local, national or international law.
+
+## 4. Termination
+
+This EULA agreement is effective from the date you first use the Software and shall continue until terminated. You may terminate it at any time upon written notice to [Your Company Name].
+
+## 5. Governing Law
+
+This EULA agreement, and any dispute arising out of or in connection with this EULA agreement, shall be governed by and construed in accordance with the laws of [Your Country].
\ No newline at end of file
diff --git a/hasura/metadata/functions.yaml b/hasura/metadata/functions.yaml
index 3ef10184a..5dd1b8640 100644
--- a/hasura/metadata/functions.yaml
+++ b/hasura/metadata/functions.yaml
@@ -1,3 +1,6 @@
+- function:
+ name: jobs_ar_summary
+ schema: public
- function:
name: search_bills
schema: public
diff --git a/hasura/metadata/tables.yaml b/hasura/metadata/tables.yaml
index f4e4d99a7..a8e271f93 100644
--- a/hasura/metadata/tables.yaml
+++ b/hasura/metadata/tables.yaml
@@ -2442,7 +2442,7 @@
_eq: X-Hasura-User-Id
columns:
- address
- - buisness_name
+ - business_name
- date_accepted
- eulaid
- first_name
@@ -2454,7 +2454,7 @@
permission:
columns:
- address
- - buisness_name
+ - business_name
- first_name
- last_name
- phone_number
@@ -2673,6 +2673,9 @@
- table:
name: ioevents
schema: public
+- table:
+ name: job_ar_schema
+ schema: public
- table:
name: job_conversations
schema: public
@@ -3812,6 +3815,7 @@
- referral_source
- referral_source_extra
- regie_number
+ - remove_from_ar
- ro_number
- scheduled_completion
- scheduled_delivery
@@ -4093,6 +4097,7 @@
- referral_source
- referral_source_extra
- regie_number
+ - remove_from_ar
- ro_number
- scheduled_completion
- scheduled_delivery
diff --git a/hasura/migrations/1705712927924_alter_table_public_eula_acceptances_alter_column_buisness_name/down.sql b/hasura/migrations/1705712927924_alter_table_public_eula_acceptances_alter_column_buisness_name/down.sql
new file mode 100644
index 000000000..8c4d38542
--- /dev/null
+++ b/hasura/migrations/1705712927924_alter_table_public_eula_acceptances_alter_column_buisness_name/down.sql
@@ -0,0 +1 @@
+alter table "public"."eula_acceptances" rename column "business_name" to "buisness_name";
diff --git a/hasura/migrations/1705712927924_alter_table_public_eula_acceptances_alter_column_buisness_name/up.sql b/hasura/migrations/1705712927924_alter_table_public_eula_acceptances_alter_column_buisness_name/up.sql
new file mode 100644
index 000000000..7dc59b9f6
--- /dev/null
+++ b/hasura/migrations/1705712927924_alter_table_public_eula_acceptances_alter_column_buisness_name/up.sql
@@ -0,0 +1 @@
+alter table "public"."eula_acceptances" rename column "buisness_name" to "business_name";
diff --git a/hasura/migrations/1705715500461_alter_table_public_eula_acceptances_alter_column_phone_number/down.sql b/hasura/migrations/1705715500461_alter_table_public_eula_acceptances_alter_column_phone_number/down.sql
new file mode 100644
index 000000000..08ab66099
--- /dev/null
+++ b/hasura/migrations/1705715500461_alter_table_public_eula_acceptances_alter_column_phone_number/down.sql
@@ -0,0 +1 @@
+alter table "public"."eula_acceptances" alter column "phone_number" set not null;
diff --git a/hasura/migrations/1705715500461_alter_table_public_eula_acceptances_alter_column_phone_number/up.sql b/hasura/migrations/1705715500461_alter_table_public_eula_acceptances_alter_column_phone_number/up.sql
new file mode 100644
index 000000000..de5721802
--- /dev/null
+++ b/hasura/migrations/1705715500461_alter_table_public_eula_acceptances_alter_column_phone_number/up.sql
@@ -0,0 +1 @@
+alter table "public"."eula_acceptances" alter column "phone_number" drop not null;
diff --git a/hasura/migrations/1705715523486_alter_table_public_eula_acceptances_alter_column_address/down.sql b/hasura/migrations/1705715523486_alter_table_public_eula_acceptances_alter_column_address/down.sql
new file mode 100644
index 000000000..fa66ebd58
--- /dev/null
+++ b/hasura/migrations/1705715523486_alter_table_public_eula_acceptances_alter_column_address/down.sql
@@ -0,0 +1 @@
+alter table "public"."eula_acceptances" alter column "address" set not null;
diff --git a/hasura/migrations/1705715523486_alter_table_public_eula_acceptances_alter_column_address/up.sql b/hasura/migrations/1705715523486_alter_table_public_eula_acceptances_alter_column_address/up.sql
new file mode 100644
index 000000000..d571c7cf3
--- /dev/null
+++ b/hasura/migrations/1705715523486_alter_table_public_eula_acceptances_alter_column_address/up.sql
@@ -0,0 +1 @@
+alter table "public"."eula_acceptances" alter column "address" drop not null;