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

Merging main into production for VAW launch #165

Merged
merged 33 commits into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
8d21714
Style: fixed odia title (#104)
prtkjakhar May 9, 2023
beec8fe
Feat chat history (#106)
geeky-abhishek May 9, 2023
69137b3
Delete .env.production
geeky-abhishek May 9, 2023
61e535f
UI changes (#112)
geeky-abhishek May 10, 2023
fb95fbc
fix: conversation id (#115)
geeky-abhishek May 11, 2023
3c16d52
Merge branch 'production' into main
geeky-abhishek May 11, 2023
f9192d4
Added down time page (#117)
prtkjakhar May 11, 2023
091ed6e
Update ContextProvider.tsx (#118)
prtkjakhar May 11, 2023
585157e
Feat dialer popup (#120)
prtkjakhar May 12, 2023
939e319
Merge branch 'production' into main
geeky-abhishek May 12, 2023
ad9f44b
Added Auth header (#122)
prtkjakhar May 12, 2023
425947c
Merge branch 'production' into main
geeky-abhishek May 15, 2023
5db5d56
chore: msgId display for testing (#127)
geeky-abhishek May 16, 2023
ecfa55c
Feat dsply msg (#128)
geeky-abhishek May 16, 2023
e8e157c
Merge branch 'production' into main
geeky-abhishek May 17, 2023
129d6eb
chore: fixed userID bug (#130)
prtkjakhar May 23, 2023
4af2c31
Feat fcm (#133)
prtkjakhar May 23, 2023
b4e863b
fix: update in conversation api (#135)
prtkjakhar May 29, 2023
5caf66f
fix: added firebase event for msg delay (#136)
prtkjakhar May 29, 2023
cd31282
fix: flagsmith init inside useeffect (#140)
geeky-abhishek Jun 1, 2023
5e0760b
Merge branch 'production' into main
geeky-abhishek Jun 1, 2023
8b9f282
Added query log and splash screen log (#143)
prtkjakhar Jun 2, 2023
3c79987
Feat trans (#134)
prtkjakhar Jun 5, 2023
6796a5b
Merge branch 'production' into main
geeky-abhishek Jun 5, 2023
8defe56
Fix: fcm logic updated (#146)
prtkjakhar Jun 7, 2023
8eb2122
Feat: Added example questions to flagsmith (#147)
prtkjakhar Jun 8, 2023
bf0929e
Feat: Feature Pop Up (#148)
prtkjakhar Jun 12, 2023
eaaf5c0
Merge branch 'production' into main
geeky-abhishek Jun 12, 2023
0dfb454
fix: empty feature details bug (#152)
prtkjakhar Jun 12, 2023
13d1d3b
Merge branch 'production' into main
geeky-abhishek Jun 12, 2023
80c4a8b
fix: handled new history api (#157)
prtkjakhar Jun 21, 2023
27cfafd
fix: no internet error for otp verify in offline (#158)
geeky-abhishek Jun 28, 2023
9ad530b
feat:Speech to text added (#114)
geeky-abhishek Sep 8, 2023
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 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*
packages/

# local env files
.env.local
.env.development.local
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"svg.preview.background": "dark-transparent"
"svg.preview.background": "white"
}
21 changes: 17 additions & 4 deletions apps/amakrushi/lang/en.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"label.title":"Ama KrushAI",
"label.title":"Ama Krushi AI Chatbot",
"label.welcome":"Welcome",
"label.chats":"Chats",
"label.farmer":"Farmer",
Expand All @@ -17,11 +17,19 @@
"label.submit":"Submit",
"label.submit_review":"Submit Review",
"label.mobile_number":"Mobile Number",
"label.examples":"Examples",
"label.ask_me":"Ask me anything about farming",
"label.click":"Reload",
"label.new_chat":"New chat",
"label.confirm_delete":"Are you sure you want to delete this conversation?",
"label.no_history":"No Chats",
"label.call_amakrushi":"Call Ama Krushi",
"label.no_internet":"No Internet",
"label.refresh": "Refresh",
"label.type":"Type",
"label.speak":"Speak",
"message.click_to_type": "Click here to type",
"message.downloading": "Downloading...",
"message.sharing": "Sharing...",
"message.no_history":"Your Chat History with AI will come here",
"message.socket_disconnect_msg": "to connect again.",
"message.enter_mobile":"Enter Mobile Number",
Expand All @@ -39,7 +47,9 @@
"message.wait_resending_otp": "Please wait before resending OTP",
"message.helpful": "Was this helpful?",
"message.retry":"Please retry.",
"message.down_time_retry":"Retry",
"message.down_time_title":"We're under maintenance",
"message.down_time_retry":"Try again",
"message.down_time_view_prev_chats": "View previous chats",
"message.taking_longer":"Please wait, servers are taking longer than usual.",
"message.rating_submitted": "Rating Submitted!",
"message.review_submitted": "Review Submitted!",
Expand All @@ -52,9 +62,12 @@
"message.rating_description" : "Tap a star to rate",
"message.review": "Write your review (optional)",
"message.review_description": "Please write your experience's feedback.",
"message.temporarily_down": "We're temporarily down",
"message.temporarily_down": "Have an urgent query?",
"message.temporarily_down_description": "We are experiencing high user volume at the moment, please try logging in after some time",
"message.recorder_wait": "Please wait while we process your request...",
"message.recorder_error": "Your question was not recognised. Pls try speaking more clearly.",
"message.dialer_popup":"You may speak to an Ama Krushi expert to get a satisfactory response",
"message.cannot_share": "Your system doesn't support sharing this file.",
"error.fail_to_submit":"Failed to submit rating.",
"error.fail_to_submit_review": "Failed to submit review.",
"error.sending_otp":"Error sending OTP",
Expand Down
21 changes: 17 additions & 4 deletions apps/amakrushi/lang/or.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"label.title":"ଆମ କୃଷି",
"label.title":"ଆମ କୃଷି ଏ ଆଇ ଚାଟ୍ ବୋଟ୍",
"label.welcome":"ସ୍ୱାଗତ",
"label.chats":"ଚାଟ୍",
"label.farmer":"କୃଷକ",
Expand All @@ -17,11 +17,19 @@
"label.submit":"ଦାଖଲ କର",
"label.submit_review":"ସମୀକ୍ଷା ଦାଖଲ କରନ୍ତୁ",
"label.mobile_number":"ମୋବାଇଲ୍ ନମ୍ବର",
"label.examples":"ଉଦାହରଣଗୁଡିକ",
"label.ask_me":"ଚାଷ ବିଷୟରେ ମୋତେ କିଛି ପଚାର",
"label.click":"ସତେଜ କରନ୍ତୁ",
"label.new_chat":"ନୂଆ ଚାଟ୍",
"label.confirm_delete":"ଆପଣ ନିଶ୍ଚିତ କି ଆପଣ ଏହି ବାର୍ତ୍ତାଳାପକୁ ବିଲୋପ କରିବାକୁ ଚାହୁଁଛନ୍ତି?",
"label.no_history":"କ chat ଣସି ଚାଟ୍ ନାହିଁ |",
"label.call_amakrushi":"ଆମା କ୍ରୁସିଙ୍କୁ ଡାକ",
"label.no_internet":"ନା ଇଣ୍ଟରନେଟ୍ ",
"label.refresh": "ରିଫ୍ରେସ୍ କରନ୍ତୁ",
"label.type":"ଟାଇପ୍",
"label.speak":"କଥା ହୁଅନ୍ତୁ",
"message.click_to_type": "ଟାଇପ୍ କରିବାକୁ ଏଠାରେ କ୍ଲିକ୍ କରନ୍ତୁ",
"message.downloading": "ଡାଉନଲୋଡ୍ ହେଉଛି ....",
"message.sharing": "ସେୟାରିଂ ....",
"message.no_history":"AI ସହିତ ଆପଣଙ୍କର ଚାଟ୍ ଇତିହାସ ଏଠାକୁ ଆସିବ |",
"message.socket_disconnect_msg": "ପୁନର୍ବାର ସଂଯୋଗ କରିବାକୁ |",
"message.enter_mobile":"ମୋବାଇଲ୍ ନମ୍ବର ପ୍ରବେଶ କରନ୍ତୁ |",
Expand All @@ -39,7 +47,9 @@
"message.wait_resending_otp": "OTP ପଠାଇବା ପୂର୍ବରୁ ଦୟାକରି ଅପେକ୍ଷା କରନ୍ତୁ |",
"message.helpful": "ଏହା ସାହାଯ୍ୟକାରୀ ଥିଲା କି?",
"message.retry":"ପୁନର୍ବାର ଚେଷ୍ଟା କରନ୍ତୁ",
"message.down_time_retry": "ପୂର୍ଣ୍ଣବାର ଚେଷ୍ଟା କରନ୍ତୁ",
"message.down_time_title":"ଆମେ ରକ୍ଷଣାବେକ୍ଷଣ ଅଧୀନରେ ଅଛୁ",
"message.down_time_retry": "ପୁଣି ଥରେ ଚେଷ୍ଟା କର",
"message.down_time_view_prev_chats": "ପୂର୍ବ ଚାଟ୍ ଗୁଡିକ ଦେଖନ୍ତୁ",
"message.taking_longer":"ଦୟାକରି ଅପେକ୍ଷା କରନ୍ତୁ, ସର୍ଭର୍ ସାଧାରଣ ସମୟ ରୁ ଅଧିକ ସମୟ ନେଉଛି",
"message.rating_submitted": "ମୂଲ୍ୟାୟନ ଦାଖଲ!",
"message.review_submitted": "ସମୀକ୍ଷା ଦାଖଲ!",
Expand All @@ -53,9 +63,12 @@
"message.rating_description" : "ରେଟ୍ କରିବାକୁ ଏକ ତାରକା ଟ୍ୟାପ୍ କରନ୍ତୁ |",
"message.review": "ଆପଣଙ୍କର ସମୀକ୍ଷା ଲେଖନ୍ତୁ (ବ al କଳ୍ପିକ)",
"message.review_description": "ଦୟାକରି ଆପଣଙ୍କର ଅଭିଜ୍ଞତା ମତାମତ ଲେଖନ୍ତୁ |",
"message.temporarily_down": "କିଛି ସମୟ ପାଇଁ ସର୍ଭର ଡାଉନ୍ ଅଛି |",
"message.temporarily_down": "ଏକ ଜରୁରୀ ପ୍ରଶ୍ନ ଅଛି କି?",
"message.temporarily_down_description": "ଆମେ ଏହି ମୁହୂର୍ତ୍ତରେ ଉଚ୍ଚ ଉପଭୋକ୍ତା ଏହାକୁ ବ୍ୟବହାର କରୁଥିବା ର‌ ଅନୁଭବ କରୁଛୁ | ଦୟାକରି କିଛି ସମୟ ପରେ ଲଗଇନ୍ କରିବାକୁ ଚେଷ୍ଟା କରନ୍ତୁ|",
"message.recorder_wait": "ଆମେ ତୁମର ଅନୁରୋଧ ପ୍ରକ୍ରିୟା କରୁଥିବାବେଳେ ଦୟାକରି ଅପେକ୍ଷା କର...",
"message.recorder_error": "ଆପଣଙ୍କ ପ୍ରଶ୍ନ ଚିହ୍ନଟ ହୋଇନାହିଁ। ଦୟାକରି ଅଧିକ ସ୍ପଷ୍ଟ ଭାବରେ କହିବାକୁ ଚେଷ୍ଟା କରନ୍ତୁ।",
"message.dialer_popup":"ଏକ ସନ୍ତୋଷଜନକ ପ୍ରତିକ୍ରିୟା ପାଇବା ପାଇଁ ଆପଣ ଆମା କ୍ରୁଶି ବିଶେଷଜ୍ଞଙ୍କ ସହିତ କଥା ହେଇପାରିବେ |",
"message.cannot_share": "ଆପଣଙ୍କ ସିଷ୍ଟମ୍ ଏହି ଫାଇଲ୍ ଅଂଶୀଦାର କରିବାକୁ ସମର୍ଥନ କରେ ନାହିଁ।",
"error.fail_to_submit":"ମୂଲ୍ୟାୟନ ଦାଖଲ କରିବାରେ ବିଫଳ |",
"error.fail_to_submit_review": "ସମୀକ୍ଷା ଦାଖଲ କରିବାରେ ବିଫଳ |",
"error.sending_otp":"ଗୋଟିଏ ଥର ପାସୱାର୍ଡ ପଠାଇବାରେ ତ୍ରୁଟି |",
Expand Down
1 change: 1 addition & 0 deletions apps/amakrushi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"react-router-dom": "^6.3.0",
"react-scripts": "5.0.0",
"react-toastify": "^9.0.5",
"socket-package": "0.13.0",
"socket.io-client": "^4.5.1",
"typescript": "^4.9.3",
"underscore": "^1.13.6",
Expand Down
Binary file added apps/amakrushi/public/example_image_one.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/amakrushi/public/example_image_three.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/amakrushi/public/example_image_two.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 23 additions & 15 deletions apps/amakrushi/public/firebase-messaging-sw.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
importScripts("https://www.gstatic.com/firebasejs/8.10.0/firebase-app.js");
importScripts('https://www.gstatic.com/firebasejs/8.10.0/firebase-app.js');
importScripts(
"https://www.gstatic.com/firebasejs/8.10.0/firebase-messaging.js"
'https://www.gstatic.com/firebasejs/8.10.0/firebase-messaging.js'
);

// Set Firebase configuration, once available
self.addEventListener("fetch", () => {
self.addEventListener('fetch', () => {
const urlParams = new URLSearchParams(location.search);
self.firebaseConfig = Object.fromEntries(urlParams);
});
Expand All @@ -22,14 +22,14 @@ firebase.initializeApp(self.firebaseConfig || defaultConfig);
const messaging = firebase.messaging();

messaging.onBackgroundMessage((payload) => {
console.log("Received background message ", payload);
console.log('Received background message ', payload);

const { title, body, image } = payload.notification;

const notificationOptions = {
body,
icon: image,
tag: "notification",
tag: 'notification',
vibrate: [200, 100, 200],
renotify: true,
data: { url: payload.data?.[`gcm.notification.data`] },
Expand All @@ -43,16 +43,21 @@ messaging.onBackgroundMessage((payload) => {
});

//Code for adding event on click of notification
self.addEventListener("notificationclick", (event) => {
console.log("hi", event);
self.addEventListener('notificationclick', (event) => {
console.log('hi', event);
if (event.notification.data && event.notification.data.url) {
self.clients.openWindow(event.notification.data.url);
} else {
self.clients.openWindow(event.currentTarget.origin);
}
// Retrieve the feature details from the notification payload
const featureDetails = event.notification.data.featureDetails;
if (featureDetails) {
const parsedFeatureDetails = JSON.parse(featureDetails);
if (
featureDetails &&
parsedFeatureDetails?.title &&
parsedFeatureDetails?.description
) {
// Store the feature details in IndexedDB
storeFeatureDetails(featureDetails);
}
Expand All @@ -62,21 +67,24 @@ self.addEventListener("notificationclick", (event) => {

function storeFeatureDetails(details) {
// Open IndexedDB database
const request = self.indexedDB.open("featureDetailsDB", 1);
const request = self.indexedDB.open('featureDetailsDB', 1);

request.onupgradeneeded = (event) => {
const db = event.target.result;
// Check if the object store already exists
if (!db.objectStoreNames.contains("featureDetailsStore")) {
if (!db.objectStoreNames.contains('featureDetailsStore')) {
// Create the object store
db.createObjectStore("featureDetailsStore", { keyPath: "id", autoIncrement: true });
db.createObjectStore('featureDetailsStore', {
keyPath: 'id',
autoIncrement: true,
});
}
};

request.onsuccess = (event) => {
const db = event.target.result;
const transaction = db.transaction(["featureDetailsStore"], "readwrite");
const objectStore = transaction.objectStore("featureDetailsStore");
const db = event.target.result;
const transaction = db.transaction(['featureDetailsStore'], 'readwrite');
const objectStore = transaction.objectStore('featureDetailsStore');

// Check if the entry exists
const getRequest = objectStore.get(1);
Expand All @@ -96,4 +104,4 @@ function storeFeatureDetails(details) {
db.close();
};
};
}
}
30 changes: 30 additions & 0 deletions apps/amakrushi/src/assets/icons/downloadHistory.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/amakrushi/src/assets/icons/error.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions apps/amakrushi/src/assets/icons/keyboard.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/amakrushi/src/assets/icons/process.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions apps/amakrushi/src/assets/icons/shareHistory.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/amakrushi/src/assets/icons/startIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/amakrushi/src/assets/icons/stop.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions apps/amakrushi/src/assets/icons/stopIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 0 additions & 4 deletions apps/amakrushi/src/assets/icons/sun.svg

This file was deleted.

Binary file added apps/amakrushi/src/assets/images/downTimeGIF.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/amakrushi/src/assets/images/sendButton.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion apps/amakrushi/src/components/HistoryPage/index.module.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.main {
margin: 1vh 0 1vh 1vh;
height: 83vh;
height: 78vh;
overflow-x: hidden;
overflow-y: scroll !important;
}
Expand Down
Loading