-
Notifications
You must be signed in to change notification settings - Fork 7
Orit/settings page #153
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
base: main
Are you sure you want to change the base?
Orit/settings page #153
Changes from all commits
843c91f
f130d92
4ac6859
a89bef6
2896608
5ded6ab
d9d359e
c69db44
187373f
295afe0
842942c
4f7a72d
8808de5
a6519d7
028c1d1
9147309
d177ceb
890589f
0ae6e0e
f40f872
d26fda1
9d800fa
6261724
1279057
fc3e8d5
c27ab1a
3ac92d7
f18c450
f6c00e2
47db70c
4b45e24
264b8bc
f846fc3
ff39dfa
c0280ca
b3bdf59
74b5c4f
dc8828b
9f53eae
fd716c4
552e69b
7ca2911
385827d
f29bb8e
97ee80b
27551ef
c59f522
1995293
459c43b
e032adc
8ac58dd
b40767e
9e49278
91ae836
89e8724
8d3649e
76947da
d17a491
75bd770
37b5bde
9f5677e
285a866
c2a2939
4ba4b9c
f171e25
2bc543f
d3059ba
f5b4af8
5aba1e1
7fbf33c
2ba750d
bfd4d06
8c05d2c
aa5eafc
19afb63
37fed04
a580153
d7c1244
39cd170
e527fe4
8e988c8
c2d9b03
659ed3d
c7c1b3c
bb4f2a1
6dc2536
4926158
7c46e1f
1738f66
da981e9
7ff1707
9845e42
ee47ec1
36839ae
40bb67d
c7b8b6a
65a63c5
bf92c09
843cc67
5f8c011
d603379
5496346
af41c7f
e12e705
34a29d0
c0f78f8
3486c1e
7796128
d747132
959e44c
42cc1c5
4867a0f
4b9f5d7
04dfd2b
3647f26
5689cd5
e4e73f2
1b2a8f7
db08c23
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,13 @@ | ||
| PORT=5000 | ||
| password=EuACQK5n92JI3vn4 | ||
| DB_URL=mongodb+srv://sh3000444:EuACQK5n92JI3vn4@cluster0.2ttcjcg.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0 | ||
| BCRYPT_SALT=10 | ||
| JWT_SECRET=aetvbkiy | ||
| <<<<<<< HEAD | ||
| PORT=3000 | ||
| password=EuACQK5n92JI3vn4 | ||
| DB_URL=mongodb+srv://sh3000444:EuACQK5n92JI3vn4@cluster0.2ttcjcg.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0 | ||
| BCRYPT_SALT=10 | ||
| JWT_SECRET=aetvbkiy | ||
| ======= | ||
| PORT=5000 | ||
| password=EuACQK5n92JI3vn4 | ||
| DB_URL=mongodb+srv://sh3000444:EuACQK5n92JI3vn4@cluster0.2ttcjcg.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0 | ||
| BCRYPT_SALT=10 | ||
| JWT_SECRET=aetvbkiy | ||
| >>>>>>> bfbcc67dc1c843746542105d3d6332eedff71e83 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,8 @@ | ||
| .vscode/settings.json | ||
| package-lock.json | ||
| <<<<<<< HEAD | ||
| .vscode/settings.json | ||
| package-lock.json | ||
| node_modules | ||
| ======= | ||
| .vscode/settings.json | ||
| package-lock.json | ||
| >>>>>>> bfbcc67dc1c843746542105d3d6332eedff71e83 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| REACT_APP_BASE_URL='http://localhost:3000' | ||
| REACT_APP_APOLLO_SERVER_URL='http://localhost:4000' | ||
| REACT_APP_SECRET_CODE_CAPVAL='6Ld5uBoqAAAAAKwPXqo5eanm9ZFSuOoBBSdl00pE' | ||
| REACT_APP_SERVER_URL='http://localhost:5000' | ||
| REACT_APP_SERVER_URL='http://localhost:3000' | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,47 @@ | ||
| { | ||
| "welcome":"bienvenida {{user-name}}", | ||
| "send preferences":" change setting ", | ||
| "change-ringtone":"change ringtoe", | ||
| "home":"Home", | ||
| "settings":"Settings", | ||
| "reports":"reports", | ||
| "statistics":"statistic", | ||
| "profiles":"profiles", | ||
| "timeout":"TimeOut", | ||
| "sleect-language":"sleect language", | ||
| "change-notification-time":"change notification time", | ||
| "Acount" :"Acount", | ||
| "Notifications" :"Notifications", | ||
| "Preference":"Preference", | ||
| "Display-Setting" :"Display Setting", | ||
| "Message" :"Message", | ||
| "account":"Account", | ||
| "display-setting":"Display Setting", | ||
| "fotter":"© Developed by ExtraTech team. visit us:", | ||
| "open-settings":"Open settings" | ||
| "welcome": "bienvenida {{user-name}}", | ||
| "send preferences": " change setting ", | ||
| "change-ringtone": "change ringtoe", | ||
| "select language":"select language", | ||
| "home": "Home", | ||
| "settings": "Settings", | ||
| "reports": "reports", | ||
| "statistics": "statistic", | ||
| "profiles": "profiles", | ||
| "timeout": "TimeOut", | ||
| "sleect-language": "sleect language", | ||
| "change-notification-time": "change notification time", | ||
| "Acount": "Acount", | ||
| "Notifications": "Notifications", | ||
| "Preference": "Preference", | ||
| "Display-Setting": "Display Setting", | ||
| "Message": "Message", | ||
| "account": "Account", | ||
| "display-setting": "Display Setting", | ||
| "fotter": "© Developed by ExtraTech team. visit us:", | ||
| "open-settings": "Open settings", | ||
| "Select Email Frequency": "Select Email Frequency", | ||
| "never": "never", | ||
| "daily": "daily", | ||
| "weekly": "weekly", | ||
| "monthly": "monthly", | ||
| "yearly": "yearly", | ||
| "Select Time Zone": "Select Time Zone", | ||
| "Update": "Update", | ||
| "select date format": "select date format", | ||
| "MM-DD-YYYY": "MM-DD-YYYY", | ||
| "DD-MM-YYYY": "DD-MM-YYYY", | ||
| "YYYY-MM-DD": "YYYY-MM-DD", | ||
| "Display notification for income messages": "Display notification for income messages", | ||
| "Display browsing time limit notification": "Display browsing time limit notification", | ||
| "Message Box":"Message Box", | ||
| "Messages Inbox":"Messages Inbox", | ||
| "Messages Count":"Messages Count", | ||
| "title only":"title only", | ||
| "abbreviated message":"abbreviated message", | ||
| "full messages":"full messages", | ||
| "group by date":"group by date", | ||
| "group by read":"group by read", | ||
| "group by unread":"group by unread" | ||
|
|
||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,44 @@ | ||
| { | ||
| "welcome":" {{user-name}} ברוכה הבאה !!", | ||
| "send preferences":"שינוי העדפות", | ||
| "change-ringtone":"שנה צליל", | ||
| "home":"בית", | ||
| "reports":"דוחות", | ||
| "statistics":"סטטיסטיקות", | ||
| "profiles":"פרופילים", | ||
| "timeout":"פסק-זמן", | ||
| "sleect-language":"בחר שפה", | ||
| "change-notification-time":"שנה זמן קבלת התראות", | ||
| "Account" :"Cuenta", | ||
| "Notifications" :"התראות", | ||
| "Preference":"הגדרות אישיות", | ||
| "Display-Setting" :" הגדרות תצוגה", | ||
| "Message" :"הודעות", | ||
| "account":"חשבון", | ||
| "display-setting":"הגדרות תצוגה", | ||
| "fotter":"בקרו אותנו ExtraTech פותח עי צות", | ||
| "settings":"הגדרות", | ||
| "open-settings":"פתח הגדרות" | ||
| { "welcome": " {{user-name}} ברוכה הבאה !!", | ||
| "send preferences": "שינוי העדפות", | ||
| "change-ringtone": "שנה צליל", | ||
| "home": "בית", | ||
| "reports": "דוחות", | ||
| "statistics": "סטטיסטיקות", | ||
| "profiles": "פרופילים", | ||
| "timeout": "פסק-זמן", | ||
| "select language": "בחר שפה", | ||
| "change-notification-time": "שנה זמן קבלת התראות", | ||
| "Account": "Cuenta", | ||
| "Notifications": "התראות", | ||
| "Preference": "הגדרות אישיות", | ||
| "Display-Setting": " הגדרות תצוגה", | ||
| "Message": "הודעות", | ||
| "account": "חשבון", | ||
| "display-setting": "הגדרות תצוגה", | ||
| "fotter": "בקרו אותנו ExtraTech פותח עי צות", | ||
| "settings": "הגדרות", | ||
| "open-settings": "פתח הגדרות", | ||
| "Select Email Frequency": "בחר תדירות אימייל", | ||
| "never": "אף פעם", | ||
| "daily": "יומי", | ||
| "weekly": "שבועי", | ||
| "monthly": "חודשי", | ||
| "yearly": "שנתי", | ||
| "Select Time Zone": "בחר אזור זמן", | ||
| "Update": "עדכן", | ||
| "select date format": "בחר פורמט תאריך", | ||
| "MM-DD-YYYY": "חודש / יום / שנה", | ||
| "DD-MM-YYYY": "שנה / חודש / יום", | ||
| "YYYY-MM-DD": "יום / חודש / שנה", | ||
| "Display notification for income messages":"הצג התראה עבור הודעות נכנסות", | ||
| "Display browsing time limit notification":"הצג הודעת מגבלת זמן גלישה", | ||
| "Message Box":"תיבת הודעות", | ||
| "Messages Inbox":"הודעות דואר נכנס", | ||
| "Messages Count":"מספר הודעות", | ||
| "title only":"כותרת בלבד", | ||
| "abbreviated message":"הודעה מקוצרת", | ||
| "full messages":"הודעות מלאות", | ||
| "group by date":"קבץ לפי תאריך", | ||
| "group by read":"קבץ לפי נקרא" | ||
|
|
||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,17 +5,17 @@ import Footer from './stories/footer/FooterComponent'; | |
| import { router } from './router/router.jsx'; | ||
| import { store } from './redux/store.jsx'; | ||
| import { SnackbarProvider } from 'notistack'; | ||
| import Messages from './components/Messages/Messages.jsx'; | ||
| import './App.scss'; | ||
|
|
||
| function App() { | ||
|
|
||
| return ( | ||
|
|
||
| <> | ||
| <RouterProvider router={router} /> | ||
| <SnackbarProvider maxSnack={3}> | ||
| <Provider store={store}> | ||
| <RouterProvider router={router} /> | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why did you delete the router? |
||
| <Messages/> | ||
| <Footer /> | ||
| </Provider> | ||
| </SnackbarProvider> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| import axios from 'axios'; | ||
|
|
||
| const url = process.env.REACT_APP_SERVER_URL; | ||
| const url = process.env.REACT_APP_BASE_URL; | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why did you change it? |
||
|
|
||
|
|
||
| export async function handleGet(path) { | ||
| const response = await axios.create({ baseURL: url }).get(path); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| module.exports = { | ||
| presets: [ | ||
| 'react-app', | ||
|
|
||
| ], | ||
| plugins: [ | ||
| '@babel/plugin-proposal-private-property-in-object', | ||
|
|
||
| ], | ||
| }; | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,113 @@ | ||
| import React, { useState,useEffect } from 'react'; | ||
| import PropTypes from 'prop-types'; | ||
| import { useTranslation } from 'react-i18next' | ||
| import Select from '../../stories/Select/Select.jsx'; | ||
| import GenericInput from '../../stories/GenericInput/genericInput.jsx' | ||
| import CONSTANTS from './constantSetting.js' | ||
| import './Notifications.scss'; | ||
|
|
||
| const Notifications = ({ currentUser , onUpdate}) => { | ||
| const { EMAIL_FREQUENCY_ENUM, TITLES, LABELS } = CONSTANTS; | ||
| const { sendNotificationTime:notificationTime, soundVoice:initialSoundVoice,displayIncomeMessages:showIncomeMessages, | ||
| displayBrowsingTimeLimit:showBrowsingTimeLimit, emailFrequency: initialEmailFrequency, } = currentUser.preference; | ||
| const [emailFrequency, setEmailFrequency] = useState(initialEmailFrequency); | ||
| const [ringtoneFile, setRingtoneFile] = useState(null); | ||
| const url = process.env.REACT_APP_BASE_URL; | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do you have to save it in variable? |
||
| const [soundVoice, setSoundVoice] = useState(`${url}/uploads/${initialSoundVoice}`); | ||
| const [sendNotificationTime, setSendNotificationTime] = useState(notificationTime); | ||
| const [displayIncomeMessages, setDisplayIncomeMessages] = useState(showIncomeMessages); | ||
| const [displayBrowsingTimeLimit, setDisplayBrowsingTimeLimit] = useState(showBrowsingTimeLimit); | ||
| const { t } = useTranslation(); | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. rename t to meaningful name |
||
|
|
||
| useEffect(() => { | ||
| onUpdate({ | ||
| emailFrequency, | ||
| ringtoneFile, | ||
| sendNotificationTime, | ||
| displayIncomeMessages, | ||
| displayBrowsingTimeLimit | ||
| }); | ||
| }, [emailFrequency, ringtoneFile, sendNotificationTime, displayIncomeMessages, displayBrowsingTimeLimit, onUpdate]); | ||
|
|
||
| const handleFileChange = (e) => { | ||
| if (e.target.files[0]) { | ||
| setRingtoneFile(e.target.files[0]); | ||
| setSoundVoice(URL.createObjectURL(e.target.files[0])); | ||
| } | ||
|
|
||
| }; | ||
| const handleChangeEmailFreq = (selectedFrequency) => { | ||
| if (!Object.keys(EMAIL_FREQUENCY_ENUM).includes(selectedFrequency.toUpperCase())) { | ||
| return; | ||
| } | ||
| setEmailFrequency(selectedFrequency); | ||
| }; | ||
|
|
||
| const changeNotificationTime = (event) => { | ||
| setSendNotificationTime(event); | ||
| } | ||
|
|
||
|
|
||
| return ( | ||
| <div className="notifications-container"> | ||
| <div className="notifications-settings"> | ||
| <GenericInput | ||
| label={t(LABELS.DISPLAY_INCOME_MESSAGES)} | ||
| type="checkbox" | ||
| checked={displayIncomeMessages} | ||
| onChange={(e) => setDisplayIncomeMessages(e)} | ||
| /> | ||
| <GenericInput | ||
| label={t(LABELS.DISPLAY_BROWSING_TIME_LIMIT)} | ||
| type="checkbox" | ||
| checked={displayBrowsingTimeLimit} | ||
| onChange={(e) => setDisplayBrowsingTimeLimit(e)} | ||
| /> | ||
| </div> | ||
| <div className="select-container"> | ||
| <Select | ||
| className='select-email-frequency' | ||
| options={Object.keys(EMAIL_FREQUENCY_ENUM).map(key => ({ | ||
| text: t(key.toLowerCase()), | ||
| value: EMAIL_FREQUENCY_ENUM[key] | ||
| }))} | ||
| title={t(TITLES.SELECT_EMAIL_FREQUENCY)} | ||
| onChange={handleChangeEmailFreq} | ||
| value={emailFrequency} | ||
| size='medium' | ||
| widthOfSelect='210px' | ||
| /> | ||
| </div> | ||
| <div className="input-container"> | ||
| <GenericInput | ||
| size='medium' | ||
| width='210px' | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please use only % without pixels |
||
| label={t(LABELS.CHANGE_NOTIFICATION_TIME)} | ||
| onChange={changeNotificationTime} | ||
| value={sendNotificationTime} | ||
| type='number' | ||
| className='gInput' | ||
| min={0} max={60} | ||
| /> | ||
| </div> | ||
| <div className="file-container"> | ||
| <GenericInput | ||
| type='file' | ||
| label={t(LABELS.CHANGE_RINGTONE)} | ||
| onChange={handleFileChange} | ||
| size='medium' | ||
| width='210px' | ||
| accept='audio/mp3' | ||
| /> | ||
| <audio controls className="audio-player"> | ||
| <source src={soundVoice} /> | ||
| </audio> | ||
| </div> | ||
| </div> | ||
| ); | ||
| }; | ||
| Notifications.propTypes = { | ||
| currentUser: PropTypes.object.isRequired, | ||
| onUpdate: PropTypes.func.isRequired | ||
| } | ||
| export default Notifications; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you cant use port 3000 both for server url & base url, please return the port 5000