Skip to content

Commit

Permalink
Merging staging to production (#172)
Browse files Browse the repository at this point in the history
* Fix odia translations (#171)

* updated some odia translations

* removed FAQs and updated user manual

---------

Co-authored-by: Saiyan Abhishek <[email protected]>
  • Loading branch information
prtkjakhar and geeky-abhishek authored Sep 18, 2023
1 parent c88bb14 commit 1d387b3
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 66 deletions.
4 changes: 3 additions & 1 deletion apps/amakrushi/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
"label.refresh": "Refresh",
"label.type":"Type",
"label.speak":"Speak",
"label.manual":"User Manual - For VAWs",
"message.no_signal":"No signal. \nPlease check your internet connection",
"message.click_to_type": "Click here to type",
"message.downloading": "Downloading...",
"message.sharing": "Sharing...",
Expand Down Expand Up @@ -61,7 +63,7 @@
"message.rating" : "Did you find this useful?",
"message.rating_description" : "Tap a star to rate",
"message.review": "Write your review (optional)",
"message.review_description": "Please write your experience's feedback.",
"message.review_description": "Give positive/negative feedback for advisory",
"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...",
Expand Down
10 changes: 6 additions & 4 deletions apps/amakrushi/lang/or.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
"label.refresh": "ରିଫ୍ରେସ୍ କରନ୍ତୁ",
"label.type":"ଟାଇପ୍",
"label.speak":"କଥା ହୁଅନ୍ତୁ",
"label.manual":"ବ୍ୟବହାରକାରୀ ମାନୁଆଲ - VAWs ପାଇଁ",
"message.no_signal":"ସିଗ୍ନାଲ ନାହିଁ। \nଦୟାକରି ଆପଣଙ୍କ ଇଣ୍ଟରନେଟ ସଂଯୋଗ କୁ ଚେକ୍ କରନ୍ତ",
"message.click_to_type": "ଟାଇପ୍ କରିବାକୁ ଏଠାରେ କ୍ଲିକ୍ କରନ୍ତୁ",
"message.downloading": "ଡାଉନଲୋଡ୍ ହେଉଛି ....",
"message.sharing": "ସେୟାରିଂ ....",
Expand Down Expand Up @@ -57,12 +59,12 @@
"message.resend_again":"ପୁନର୍ବାର ପଠାନ୍ତୁ |",
"message.didnt_receive": "ଗୋଟିଏ ଥର ପାସୱାର୍ଡ ଗ୍ରହଣ କରିନାହାଁନ୍ତି କି?",
"message.coming_soon" : "ଶୀଘ୍ର ଆସୁଅଛି!",
"message.coming_soon_description" : "ଆମେ ଖୁବ୍ ଶୀଘ୍ର ଏହି ବ feature ଶିଷ୍ଟ୍ୟ ଲଞ୍ଚ କରିବାକୁ ଯାଉଛୁ | ସୁଣୁ ଥାନ୍ତୁ!",
"message.coming_soon_description" : "ଆମେ ଖୁବ୍ ଶୀଘ୍ର ଏହି ଫିଚର ଲଞ୍ଚ କରିବାକୁ ଯାଉଛୁ , ଶୁଣୁ ଥାନ୍ତୁ",
"message.dial_description" : "କଲ୍ ସେଣ୍ଟର ସହିତ ସଂଯୋଗ କରିବାକୁ |",
"message.rating" : "ଆପଣ ଏହା ଉପଯୋଗୀ ପାଇଛନ୍ତି କି?",
"message.rating_description" : "ରେଟ୍ କରିବାକୁ ଏକ ତାରକା ଟ୍ୟାପ୍ କରନ୍ତୁ |",
"message.review": "ଆପଣଙ୍କର ସମୀକ୍ଷା ଲେଖନ୍ତୁ (ବ al କଳ୍ପିକ)",
"message.review_description": "ଦୟାକରି ଆପଣଙ୍କର ଅଭିଜ୍ଞତା ମତାମତ ଲେଖନ୍ତୁ |",
"message.rating_description" : "ରେଟ୍ କରିବାକୁ ତାରକା କୁ ଟ୍ୟାପ୍ କରନ୍ତୁ",
"message.review": "ଆପଣଙ୍କର ସମୀକ୍ଷା ଲେଖନ୍ତୁ (ଅପ୍ସନାଲ)",
"message.review_description": "ଉଦିଷ୍ଟ ପରାମର୍ଶ ବିଷୟ ରେ ଆପଣଙ୍କର ସକାରାତ୍ମକ / ନକାରାତ୍ମକ ମତାମତ ଦିଅନ୍ତୁ",
"message.temporarily_down": "ଏକ ଜରୁରୀ ପ୍ରଶ୍ନ ଅଛି କି?",
"message.temporarily_down_description": "ଆମେ ଏହି ମୁହୂର୍ତ୍ତରେ ଉଚ୍ଚ ଉପଭୋକ୍ତା ଏହାକୁ ବ୍ୟବହାର କରୁଥିବା ର‌ ଅନୁଭବ କରୁଛୁ | ଦୟାକରି କିଛି ସମୟ ପରେ ଲଗଇନ୍ କରିବାକୁ ଚେଷ୍ଟା କରନ୍ତୁ|",
"message.recorder_wait": "ଆମେ ତୁମର ଅନୁରୋଧ ପ୍ରକ୍ରିୟା କରୁଥିବାବେଳେ ଦୟାକରି ଅପେକ୍ଷା କର...",
Expand Down
102 changes: 44 additions & 58 deletions apps/amakrushi/src/components/MorePage/FAQPage/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import { useCallback, useEffect, useState } from 'react';
import styles from './index.module.css';
import { Box, Input, InputGroup, InputLeftElement } from '@chakra-ui/react';
import {
Accordion,
AccordionItem,
AccordionButton,
AccordionPanel,
AccordionIcon,
} from '@chakra-ui/react';
import searchIcon from '../../../assets/icons/search.svg';
import callIcon from '../../../assets/icons/call-icon.svg';
import Image from 'next/image';
import Menu from '../../menu';
Expand All @@ -26,56 +24,55 @@ const FAQPage: React.FC = () => {
'show_dialer',
'dialer_number',
'show_pdf_buttons',
'odia_pdf_link',
'eng_pdf_link',
'manual_pdf_link',
]);
const [faqData, setFaqData] = useState<any[]>([]);
// const [faqData, setFaqData] = useState<any[]>([]);
console.log(flags);

useEffect(() => {
//@ts-ignore
logEvent(analytics, 'FAQ_page');
// useEffect(() => {
// //@ts-ignore
// logEvent(analytics, 'FAQ_page');

const fetchData = async () => {
let page = 1;
let allData: any[] = [];
// const fetchData = async () => {
// let page = 1;
// let allData: any[] = [];

while (true) {
try {
const response = await axios.get(
`${process.env.NEXT_PUBLIC_BASE_URL}/faq?page=${page}`,
{
headers: {
authorization: `Bearer ${localStorage.getItem('auth')}`,
},
}
);
const newData = response.data.faqs;
// while (true) {
// try {
// const response = await axios.get(
// `${process.env.NEXT_PUBLIC_BASE_URL}/faq?page=${page}`,
// {
// headers: {
// authorization: `Bearer ${localStorage.getItem('auth')}`,
// },
// }
// );
// const newData = response.data.faqs;

if (!newData.length) {
break; // no more data, exit loop
}
// if (!newData.length) {
// break; // no more data, exit loop
// }

allData = [...allData, ...newData];
page++;
} catch (error) {
console.log(error);
//@ts-ignore
logEvent(analytics, 'console_error', {
error_message: error.message,
});
break;
}
}
setFaqData(allData);
};
// allData = [...allData, ...newData];
// page++;
// } catch (error) {
// console.log(error);
// //@ts-ignore
// logEvent(analytics, 'console_error', {
// error_message: error.message,
// });
// break;
// }
// }
// setFaqData(allData);
// };

fetchData();
}, []);
// fetchData();
// }, []);

const downloadPDFHandler = useCallback(
(filename: any, language: any) => {
const link = flags?.[`${language}_pdf_link`]?.value;
() => {
const link: any = flags?.[`manual_pdf_link`]?.value;
const proxyUrl = 'https://cors-anywhere.herokuapp.com/';

window.open(link);
Expand All @@ -90,7 +87,7 @@ const FAQPage: React.FC = () => {
const a = document.createElement('a');
a.style.display = 'none';
a.href = url;
a.download = `${filename}.pdf`;
a.download = `User_Manual_For_VAWs.pdf`;

document.body.appendChild(a);
a.click();
Expand All @@ -116,14 +113,8 @@ const FAQPage: React.FC = () => {
<>
<div className={styles.main}>
<div className={styles.title}>{t('label.faqs')}</div>
{/* <InputGroup pb={2}>
<InputLeftElement pointerEvents="none">
<Image src={searchIcon} alt="" width={20} height={20} />
</InputLeftElement>
<Input type="text" placeholder={t('label.search')} />
</InputGroup> */}
{/* @ts-ignore */}
<Accordion allowMultiple>
{/* <Accordion allowMultiple>
{faqData.map((faq, idx) => (
<AccordionItem key={idx}>
<h2>
Expand All @@ -143,19 +134,14 @@ const FAQPage: React.FC = () => {
</AccordionPanel>
</AccordionItem>
))}
</Accordion>
</Accordion> */}
<section className={styles.bottomSection}>
{flags?.show_pdf_buttons?.enabled && (
<div className={styles.manualButtons}>
<button
onClick={() => downloadPDFHandler('my_eng_manual', 'eng')}
className={styles.submitButton}>
User Manual - &nbsp; English
</button>
<button
onClick={() => downloadPDFHandler('my_odia_manual', 'odia')}
onClick={downloadPDFHandler}
className={styles.submitButton}>
ବ୍ୟବହାରକାରୀ ମାନୁଆଲ - &nbsp; ଓଡିଆ
{t('label.manual')}
</button>
</div>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const ChatUiWindow: React.FC = () => {
const modifiedChatHistory = chatHistory.data.map((chat: any) => {
if (!chat.response) {
chat.response =
'No signal \nPlease check your internet connection';
t('message.no_signal');
}
return chat;
});
Expand Down
4 changes: 2 additions & 2 deletions apps/amakrushi/src/context/ContextProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const ContextProvider: FC<{
setIsOnline(false);
onMessageReceived({
content: {
title: 'No signal \nPlease check your internet connection',
title: t('message.no_signal'),
choices: null,
conversationId: conversationId,
msg_type: 'text',
Expand Down Expand Up @@ -323,7 +323,7 @@ const ContextProvider: FC<{
// toast.error(`${t('message.retry')}`);
onMessageReceived({
content: {
title: 'No signal \nPlease check your internet connection',
title: t('message.no_signal'),
choices: null,
conversationId: conversationId,
msg_type: 'text',
Expand Down

1 comment on commit 1d387b3

@vercel
Copy link

@vercel vercel bot commented on 1d387b3 Sep 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.