From e49c0dc1d3f674e403a85cfd68d1dd81d1cc50c9 Mon Sep 17 00:00:00 2001 From: Or Malka Date: Wed, 22 Nov 2023 21:42:42 +0200 Subject: [PATCH 01/12] Bug report form Creating the form in the UI. --- src/locale/en.json | 22 +++++- src/locale/he.json | 22 +++++- src/pages/BugReportForm .tsx | 129 +++++++++++++++++++++++++++++++++++ src/pages/BugReportForm.scss | 60 ++++++++++++++++ src/resources/texts.tsx | 19 ++++++ src/routes/index.tsx | 5 +- 6 files changed, 252 insertions(+), 5 deletions(-) create mode 100644 src/pages/BugReportForm .tsx create mode 100644 src/pages/BugReportForm.scss diff --git a/src/locale/en.json b/src/locale/en.json index d1313677..bd35ff6f 100644 --- a/src/locale/en.json +++ b/src/locale/en.json @@ -69,5 +69,25 @@ "innovation_authority": "Innovation Authority", "migdal_company": "\"A tower in the community\"", "and_smaller_donors": "And other small contributions from my friends and fans of the workshop.", - "github_link": "Go to GitHub" + "github_link": "Go to GitHub", + "bug_title": "Title/Summary", + "bug_title_message": "Please enter a title/summary!", + "bug_description": "Description", + "bug_description_message": "Please enter a description!", + "bug_environment": "Environment", + "bug_environment_message": "Please enter the environment!", + "bug_expected_behavior": "Expected Behavior", + "bug_expected_behavior_message": "Please describe the expected behavior!", + "bug_actual_behavior": "Actual Behavior", + "bug_actual_behavior_message": "Please describe the actual behavior!", + "bug_reproducibility": "Frequency/Reproducibility", + "bug_reproducibility_message": "Please describe the frequency/reproducibility!", + "bug_attachments": "Attachments/Screenshots", + "bug_attachments_upload_button": "Click to Upload", + "bug_submit":"Submit Bug Report", + "bug_contact_name":"Full Name", + "bug_contact_name_message":"Please enter your full name!", + "bug_contact_email":"Email", + "bug_contact_email_message":"Please enter your email!" + } diff --git a/src/locale/he.json b/src/locale/he.json index 2dfd2081..f6a22f83 100644 --- a/src/locale/he.json +++ b/src/locale/he.json @@ -69,6 +69,24 @@ "migdal_company": "“מגדל בקהילה“", "and_smaller_donors": "ותרומות קטנות נוספות של ידידי ואוהדי הסדנא.", "gaps_patterns_page_title": "דפוסי נסיעות שלא יצאו", - "github_link": "למעבר אל GitHub" - + "github_link": "למעבר אל GitHub", + "bug_title": "כותרת/סיכום", + "bug_title_message": "אנא הזן כותרת/סיכום!", + "bug_description": "תיאור", + "bug_description_message": "אנא הזן תיאור!", + "bug_environment": "סביבה (דפדפן, מערכת)", + "bug_environment_message": "אנא הזן את הסביבה!", + "bug_expected_behavior": "התנהגות צפויה", + "bug_expected_behavior_message": "אנא תיאר את התנהגות הצפויה!", + "bug_actual_behavior": "התנהגות נוכחית", + "bug_actual_behavior_message": "אנא תיאר את התנהגות הנוכחית!", + "bug_reproducibility": "תדירות/ חוזרות", + "bug_reproducibility_message": "אנא תיאר את התדירות/חוזרות!", + "bug_attachments": "קבצים מצורפים/ צילומי מסך", + "bug_attachments_upload_button": "לחץ להעלאה", + "bug_submit": "שלח את הדוח", + "bug_contact_name":"שם מלא", + "bug_contact_name_message":"אנא הזן את שמך!", + "bug_contact_email":"אי-מייל", + "bug_contact_email_message":"אנא הזן כתובת אי-מייל!" } diff --git a/src/pages/BugReportForm .tsx b/src/pages/BugReportForm .tsx new file mode 100644 index 00000000..201c087b --- /dev/null +++ b/src/pages/BugReportForm .tsx @@ -0,0 +1,129 @@ +import React from 'react' +import { TEXT_KEYS } from 'src/resources/texts' +import { useTranslation } from 'react-i18next' +import { Form, Input, Button, Upload, message } from 'antd' +import { UploadOutlined } from '@ant-design/icons' +import './BugReportForm.scss' + +interface BugReportFormProps { + onSubmit: (values: BugReportFormData) => void +} + +interface BugReportFormData { + title: string + description: string + environment: string + expectedBehavior: string + actualBehavior: string + reproducibility: string + attachments: any[] // Adjust the type based on your requirements + contactName: string + contactEmail: string +} + +const BugReportForm: React.FC = ({ onSubmit }) => { + const { t } = useTranslation() + const [form] = Form.useForm() + + const onFinish = async (values: BugReportFormData) => { + try { + onSubmit(values) + message.success('Bug report submitted successfully!') + form.resetFields() + } catch (error) { + console.error('Error submitting bug report:', error) + message.error('Error submitting bug report. Please try again.') + } + } + + const onFinishFailed = (errorInfo: any) => { + console.log('Failed:', errorInfo) + } + + return ( +
+

דאטאבוס

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + false} listType="picture"> + + + + + + + +
+
+ ) +} + +export default BugReportForm diff --git a/src/pages/BugReportForm.scss b/src/pages/BugReportForm.scss new file mode 100644 index 00000000..5b1e390b --- /dev/null +++ b/src/pages/BugReportForm.scss @@ -0,0 +1,60 @@ +// BugReportForm.scss + +.bug-report-form-container { + max-width: 800px; + margin: 0 auto; + padding: 30px; + background-color: #fff; + border: 1px solid #e8e8e8; + border-radius: 8px; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); +} + +.bug-report-form-container h1.logo { + position: relative; + margin: 20px auto; + width: 119px; + font-size: 30px; + border-top: 6px solid gray; + border-bottom: 8px solid gray; + padding-bottom: 0; + line-height: 25px; + text-align: center; /* Center the logo */ +} + +.bug-report-form-container .ant-form-item { + margin-bottom: 20px; +} + +.bug-report-form-container .ant-form-item-label { + font-weight: bold; + text-align: right; /* Align the label to the right */ +} + +.bug-report-form-container .ant-input, +.bug-report-form-container .ant-input-textarea { + width: 100%; +} + +.bug-report-form-container .ant-upload { + width: 100%; +} + +.bug-report-form-container .ant-btn { + margin-right: 8px; +} + +.bug-report-form-container .ant-btn-primary { + background-color: #1890ff; + border-color: #1890ff; + width: 100%; /* Make the button 100% width */ +} + +.bug-report-form-container .ant-btn-primary:hover { + background-color: #40a9ff; + border-color: #40a9ff; +} + +.bug-report-form-container .ant-btn-primary:focus { + box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2); +} diff --git a/src/resources/texts.tsx b/src/resources/texts.tsx index 2af6b4d9..75098fc0 100644 --- a/src/resources/texts.tsx +++ b/src/resources/texts.tsx @@ -75,6 +75,25 @@ export const TEXT_KEYS = { and_smaller_donors: 'and_smaller_donors', gaps_patterns_page_title: 'gaps_patterns_page_title', github_link: 'github_link', + bug_title: "bug_title", + bug_title_message: "bug_title_message", + bug_description: "bug_description", + bug_description_message: "bug_description_message", + bug_environment: "bug_environment", + bug_environment_message: "bug_environment_message", + bug_expected_behavior: "bug_expected_behavior", + bug_expected_behavior_message: "bug_expected_behavior_message", + bug_actual_behavior: "bug_actual_behavior", + bug_actual_behavior_message: "bug_actual_behavior_message", + bug_reproducibility: "bug_reproducibility", + bug_reproducibility_message: "bug_reproducibility_message", + bug_attachments: "bug_attachments", + bug_attachments_upload_button: "bug_attachments_upload_button", + bug_submit:"bug_submit", + bug_contact_name:"bug_contact_name", + bug_contact_name_message:"bug_contact_name_message", + bug_contact_email:"bug_contact_email", + bug_contact_email_message:"bug_contact_email_message" } export const TEXTS = { diff --git a/src/routes/index.tsx b/src/routes/index.tsx index c5b01395..75a348c8 100644 --- a/src/routes/index.tsx +++ b/src/routes/index.tsx @@ -8,6 +8,7 @@ const GapsPatternsPage = lazy(() => import('../pages/gapsPatterns')) const RealtimeMapPage = lazy(() => import('../pages/RealtimeMapPage')) const SingleLineMapPage = lazy(() => import('../pages/SingleLineMapPage')) const About = lazy(() => import('../pages/About')) +const BugReportForm = lazy(() => import('../pages/BugReportForm ')) import CircularProgress from '@mui/material/CircularProgress' import { @@ -70,9 +71,9 @@ export const PAGES = [ }, { label: TEXT_KEYS.report_a_bug_title, - path: 'https://github.com/hasadna/open-bus-map-search/issues', + path: 'report-a-bug', icon: , - element: null, + element: , }, { label: TEXT_KEYS.donate_title, From 0aa030d178b5352e6fc887e5ad8a4976cdc5ce14 Mon Sep 17 00:00:00 2001 From: Or Malka Date: Thu, 23 Nov 2023 13:20:14 +0200 Subject: [PATCH 02/12] Bug report form update --- src/pages/BugReportForm .tsx | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/src/pages/BugReportForm .tsx b/src/pages/BugReportForm .tsx index 201c087b..1a7a5a04 100644 --- a/src/pages/BugReportForm .tsx +++ b/src/pages/BugReportForm .tsx @@ -1,14 +1,11 @@ -import React from 'react' +import React, { useState } from 'react'; import { TEXT_KEYS } from 'src/resources/texts' import { useTranslation } from 'react-i18next' import { Form, Input, Button, Upload, message } from 'antd' import { UploadOutlined } from '@ant-design/icons' +import axios from 'axios' import './BugReportForm.scss' -interface BugReportFormProps { - onSubmit: (values: BugReportFormData) => void -} - interface BugReportFormData { title: string description: string @@ -16,20 +13,32 @@ interface BugReportFormData { expectedBehavior: string actualBehavior: string reproducibility: string - attachments: any[] // Adjust the type based on your requirements + attachments: any[] contactName: string contactEmail: string } -const BugReportForm: React.FC = ({ onSubmit }) => { +const BugReportForm: React.FC = () => { const { t } = useTranslation() const [form] = Form.useForm() + const [fileList, setFileList] = useState([]) const onFinish = async (values: BugReportFormData) => { try { - onSubmit(values) + // Send the bug report data to the server + // Include fileList in the values if needed + + // const response = await axios.post('http://localhost:3001/create-issue', { + // ...values, + // attachments: fileList, + // }) + + console.log(values) + + // Handle the server response message.success('Bug report submitted successfully!') form.resetFields() + setFileList([]) // Reset fileList after submission } catch (error) { console.error('Error submitting bug report:', error) message.error('Error submitting bug report. Please try again.') @@ -40,6 +49,10 @@ const BugReportForm: React.FC = ({ onSubmit }) => { console.log('Failed:', errorInfo) } + const onFileChange = (info: any) => { + setFileList(info.fileList) + } + return (

דאטאבוס

@@ -111,7 +124,11 @@ const BugReportForm: React.FC = ({ onSubmit }) => { - false} listType="picture"> + false} + listType="picture" + fileList={fileList} + onChange={onFileChange}> From b212723d933a1b88a055b4b1ad0f21d35960e327 Mon Sep 17 00:00:00 2001 From: Or Malka Date: Thu, 23 Nov 2023 13:42:44 +0200 Subject: [PATCH 03/12] fix: Dynamic display on mobile --- src/pages/BugReportForm.scss | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/pages/BugReportForm.scss b/src/pages/BugReportForm.scss index 5b1e390b..a13a820d 100644 --- a/src/pages/BugReportForm.scss +++ b/src/pages/BugReportForm.scss @@ -8,6 +8,27 @@ border: 1px solid #e8e8e8; border-radius: 8px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); + + @media (max-width: 600px) { + padding: 15px; + + h1.logo { + font-size: 24px; + margin: 10px auto; + border-top: 4px solid gray; + border-bottom: 6px solid gray; + } + + .ant-form-item-label { + text-align: left; + } + + .ant-btn-primary { + max-width: calc(100% - 100px); + margin: 0 auto; + display: block; + } + } } .bug-report-form-container h1.logo { From c46442227d9496406fbcf63f43bce50f894e03d4 Mon Sep 17 00:00:00 2001 From: Or Malka Date: Sun, 26 Nov 2023 20:29:49 +0200 Subject: [PATCH 04/12] fix: Nested css rules --- src/pages/BugReportForm.scss | 81 ++++++++++++++++++------------------ 1 file changed, 41 insertions(+), 40 deletions(-) diff --git a/src/pages/BugReportForm.scss b/src/pages/BugReportForm.scss index a13a820d..18e880df 100644 --- a/src/pages/BugReportForm.scss +++ b/src/pages/BugReportForm.scss @@ -2,6 +2,7 @@ .bug-report-form-container { max-width: 800px; + width: 100%; margin: 0 auto; padding: 30px; background-color: #fff; @@ -29,53 +30,53 @@ display: block; } } -} -.bug-report-form-container h1.logo { - position: relative; - margin: 20px auto; - width: 119px; - font-size: 30px; - border-top: 6px solid gray; - border-bottom: 8px solid gray; - padding-bottom: 0; - line-height: 25px; - text-align: center; /* Center the logo */ -} + h1.logo { + position: relative; + margin: 20px auto; + width: 119px; + font-size: 30px; + border-top: 6px solid gray; + border-bottom: 8px solid gray; + padding-bottom: 0; + line-height: 25px; + text-align: center; + } -.bug-report-form-container .ant-form-item { - margin-bottom: 20px; -} + .ant-form-item { + margin-bottom: 20px; -.bug-report-form-container .ant-form-item-label { - font-weight: bold; - text-align: right; /* Align the label to the right */ -} + &-label { + font-weight: bold; + text-align: right; + } + } -.bug-report-form-container .ant-input, -.bug-report-form-container .ant-input-textarea { - width: 100%; -} + .ant-input, + .ant-input-textarea { + width: 100%; + } -.bug-report-form-container .ant-upload { - width: 100%; -} + .ant-upload { + width: 100%; + } -.bug-report-form-container .ant-btn { - margin-right: 8px; -} + .ant-btn { + margin-right: 8px; -.bug-report-form-container .ant-btn-primary { - background-color: #1890ff; - border-color: #1890ff; - width: 100%; /* Make the button 100% width */ -} + &-primary { + background-color: #1890ff; + border-color: #1890ff; + width: 100%; -.bug-report-form-container .ant-btn-primary:hover { - background-color: #40a9ff; - border-color: #40a9ff; -} + &:hover { + background-color: #40a9ff; + border-color: #40a9ff; + } -.bug-report-form-container .ant-btn-primary:focus { - box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2); + &:focus { + box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2); + } + } + } } From 7634cb00071ef96b9e2abe319331c6f0c59d645f Mon Sep 17 00:00:00 2001 From: Or Malka Date: Sun, 26 Nov 2023 20:40:41 +0200 Subject: [PATCH 05/12] fix: Not implemented message and comment. --- src/pages/BugReportForm .tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/pages/BugReportForm .tsx b/src/pages/BugReportForm .tsx index 1a7a5a04..c079373f 100644 --- a/src/pages/BugReportForm .tsx +++ b/src/pages/BugReportForm .tsx @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import React, { useState } from 'react' import { TEXT_KEYS } from 'src/resources/texts' import { useTranslation } from 'react-i18next' import { Form, Input, Button, Upload, message } from 'antd' @@ -13,7 +13,7 @@ interface BugReportFormData { expectedBehavior: string actualBehavior: string reproducibility: string - attachments: any[] + attachments: any[] contactName: string contactEmail: string } @@ -23,6 +23,7 @@ const BugReportForm: React.FC = () => { const [form] = Form.useForm() const [fileList, setFileList] = useState([]) + //Not implemented yet const onFinish = async (values: BugReportFormData) => { try { // Send the bug report data to the server @@ -36,7 +37,8 @@ const BugReportForm: React.FC = () => { console.log(values) // Handle the server response - message.success('Bug report submitted successfully!') + // message.success('Bug report submitted successfully!') + message.success('Not implemented!') form.resetFields() setFileList([]) // Reset fileList after submission } catch (error) { From 43723f156d2d3b2a0b301f1eefeabfc71a7e1be2 Mon Sep 17 00:00:00 2001 From: Or Malka Date: Sun, 26 Nov 2023 20:43:06 +0200 Subject: [PATCH 06/12] fix: Description of the purpose of the form. --- src/locale/en.json | 3 ++- src/locale/he.json | 3 ++- src/pages/BugReportForm .tsx | 4 ++++ src/resources/texts.tsx | 3 ++- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/locale/en.json b/src/locale/en.json index bd35ff6f..022b0fd2 100644 --- a/src/locale/en.json +++ b/src/locale/en.json @@ -88,6 +88,7 @@ "bug_contact_name":"Full Name", "bug_contact_name_message":"Please enter your full name!", "bug_contact_email":"Email", - "bug_contact_email_message":"Please enter your email!" + "bug_contact_email_message":"Please enter your email!", + "bug_form_description":"This form is designed so that we can receive feedback and improve the application." } diff --git a/src/locale/he.json b/src/locale/he.json index f6a22f83..c25fb1a1 100644 --- a/src/locale/he.json +++ b/src/locale/he.json @@ -88,5 +88,6 @@ "bug_contact_name":"שם מלא", "bug_contact_name_message":"אנא הזן את שמך!", "bug_contact_email":"אי-מייל", - "bug_contact_email_message":"אנא הזן כתובת אי-מייל!" + "bug_contact_email_message":"אנא הזן כתובת אי-מייל!", + "bug_form_description":"טופס זה נועד על מנת שנוכל לקבל פידבק ולשפר את האפליקציה." } diff --git a/src/pages/BugReportForm .tsx b/src/pages/BugReportForm .tsx index c079373f..4456d713 100644 --- a/src/pages/BugReportForm .tsx +++ b/src/pages/BugReportForm .tsx @@ -59,6 +59,10 @@ const BugReportForm: React.FC = () => {

דאטאבוס

+ {t(TEXT_KEYS.bug_form_description)} +
+
+
Date: Sun, 26 Nov 2023 21:00:13 +0200 Subject: [PATCH 07/12] fix: Request type. --- src/locale/en.json | 10 ++++++++-- src/locale/he.json | 6 +++++- src/pages/BugReportForm .tsx | 20 ++++++++++++++++++-- src/resources/texts.tsx | 6 +++++- 4 files changed, 36 insertions(+), 6 deletions(-) diff --git a/src/locale/en.json b/src/locale/en.json index 022b0fd2..01829586 100644 --- a/src/locale/en.json +++ b/src/locale/en.json @@ -89,6 +89,12 @@ "bug_contact_name_message":"Please enter your full name!", "bug_contact_email":"Email", "bug_contact_email_message":"Please enter your email!", - "bug_form_description":"This form is designed so that we can receive feedback and improve the application." - + "bug_form_description":"This form is designed so that we can receive feedback and improve the application.", + "bug_type":"Type of request", + "bug_type_message":"Please enter the type of request", + "bug_type_bug":"Bug", + "bug_type_feature":"Feature Request" + + + } diff --git a/src/locale/he.json b/src/locale/he.json index c25fb1a1..9fcc1b97 100644 --- a/src/locale/he.json +++ b/src/locale/he.json @@ -89,5 +89,9 @@ "bug_contact_name_message":"אנא הזן את שמך!", "bug_contact_email":"אי-מייל", "bug_contact_email_message":"אנא הזן כתובת אי-מייל!", - "bug_form_description":"טופס זה נועד על מנת שנוכל לקבל פידבק ולשפר את האפליקציה." + "bug_form_description":"טופס זה נועד על מנת שנוכל לקבל פידבק ולשפר את האפליקציה.", + "bug_type":"סוג הבקשה", + "bug_type_message":"אנא הזן סוג בקשה!", + "bug_type_bug":"באג", + "bug_type_feature":"בקשה לפיתוח" } diff --git a/src/pages/BugReportForm .tsx b/src/pages/BugReportForm .tsx index 4456d713..bab1cbe8 100644 --- a/src/pages/BugReportForm .tsx +++ b/src/pages/BugReportForm .tsx @@ -1,10 +1,13 @@ import React, { useState } from 'react' import { TEXT_KEYS } from 'src/resources/texts' import { useTranslation } from 'react-i18next' -import { Form, Input, Button, Upload, message } from 'antd' +import { Form, Input, Button, Upload, message, Select } from 'antd'; import { UploadOutlined } from '@ant-design/icons' import axios from 'axios' import './BugReportForm.scss' +const { Option } = Select; + + interface BugReportFormData { title: string @@ -22,6 +25,8 @@ const BugReportForm: React.FC = () => { const { t } = useTranslation() const [form] = Form.useForm() const [fileList, setFileList] = useState([]) + const [selectedType, setSelectedType] = useState(undefined); + //Not implemented yet const onFinish = async (values: BugReportFormData) => { @@ -62,7 +67,7 @@ const BugReportForm: React.FC = () => { {t(TEXT_KEYS.bug_form_description)}

- + { onFinishFailed={onFinishFailed} labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}> + + + + Date: Sun, 26 Nov 2023 21:04:54 +0200 Subject: [PATCH 08/12] fix: Fequency term. --- src/locale/en.json | 4 ++-- src/locale/he.json | 8 ++++---- src/pages/BugReportForm .tsx | 1 + 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/locale/en.json b/src/locale/en.json index 01829586..9bab1c13 100644 --- a/src/locale/en.json +++ b/src/locale/en.json @@ -80,8 +80,8 @@ "bug_expected_behavior_message": "Please describe the expected behavior!", "bug_actual_behavior": "Actual Behavior", "bug_actual_behavior_message": "Please describe the actual behavior!", - "bug_reproducibility": "Frequency/Reproducibility", - "bug_reproducibility_message": "Please describe the frequency/reproducibility!", + "bug_reproducibility": "How often does it happen?", + "bug_reproducibility_message": "Please describe how often does it happen!", "bug_attachments": "Attachments/Screenshots", "bug_attachments_upload_button": "Click to Upload", "bug_submit":"Submit Bug Report", diff --git a/src/locale/he.json b/src/locale/he.json index 9fcc1b97..40a52007 100644 --- a/src/locale/he.json +++ b/src/locale/he.json @@ -77,11 +77,11 @@ "bug_environment": "סביבה (דפדפן, מערכת)", "bug_environment_message": "אנא הזן את הסביבה!", "bug_expected_behavior": "התנהגות צפויה", - "bug_expected_behavior_message": "אנא תיאר את התנהגות הצפויה!", + "bug_expected_behavior_message": "אנא תאר את התנהגות הצפויה!", "bug_actual_behavior": "התנהגות נוכחית", - "bug_actual_behavior_message": "אנא תיאר את התנהגות הנוכחית!", - "bug_reproducibility": "תדירות/ חוזרות", - "bug_reproducibility_message": "אנא תיאר את התדירות/חוזרות!", + "bug_actual_behavior_message": "אנא תאר את התנהגות הנוכחית!", + "bug_reproducibility": "באיזו תדירות זה קורה?", + "bug_reproducibility_message": "אנא תאר את באיזו תדירות זה קורה!", "bug_attachments": "קבצים מצורפים/ צילומי מסך", "bug_attachments_upload_button": "לחץ להעלאה", "bug_submit": "שלח את הדוח", diff --git a/src/pages/BugReportForm .tsx b/src/pages/BugReportForm .tsx index bab1cbe8..0d890cdb 100644 --- a/src/pages/BugReportForm .tsx +++ b/src/pages/BugReportForm .tsx @@ -75,6 +75,7 @@ const BugReportForm: React.FC = () => { onFinishFailed={onFinishFailed} labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}> + Date: Sun, 26 Nov 2023 21:32:35 +0200 Subject: [PATCH 09/12] fix: lint --- src/pages/BugReportForm .tsx | 12 +++------ src/resources/texts.tsx | 48 ++++++++++++++++++------------------ src/routes/index.tsx | 2 +- 3 files changed, 29 insertions(+), 33 deletions(-) diff --git a/src/pages/BugReportForm .tsx b/src/pages/BugReportForm .tsx index 0d890cdb..19d1d651 100644 --- a/src/pages/BugReportForm .tsx +++ b/src/pages/BugReportForm .tsx @@ -1,13 +1,11 @@ import React, { useState } from 'react' import { TEXT_KEYS } from 'src/resources/texts' import { useTranslation } from 'react-i18next' -import { Form, Input, Button, Upload, message, Select } from 'antd'; +import { Form, Input, Button, Upload, message, Select } from 'antd' import { UploadOutlined } from '@ant-design/icons' -import axios from 'axios' +// import axios from 'axios' import './BugReportForm.scss' -const { Option } = Select; - - +const { Option } = Select interface BugReportFormData { title: string @@ -25,8 +23,7 @@ const BugReportForm: React.FC = () => { const { t } = useTranslation() const [form] = Form.useForm() const [fileList, setFileList] = useState([]) - const [selectedType, setSelectedType] = useState(undefined); - + const [selectedType, setSelectedType] = useState(undefined) //Not implemented yet const onFinish = async (values: BugReportFormData) => { @@ -75,7 +72,6 @@ const BugReportForm: React.FC = () => { onFinishFailed={onFinishFailed} labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}> - import('../pages/dashboard/DashboardPage')) const TimelinePage = lazy(() => import('../pages/TimelinePage')) const GapsPage = lazy(() => import('../pages/GapsPage')) From cd82d5f96e983338ed92fdbd3bc5c7c35b387e1c Mon Sep 17 00:00:00 2001 From: Noam Gaash Date: Mon, 27 Nov 2023 12:04:43 +0200 Subject: [PATCH 10/12] fix: type --- src/pages/BugReportForm .tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/pages/BugReportForm .tsx b/src/pages/BugReportForm .tsx index 19d1d651..55ff6963 100644 --- a/src/pages/BugReportForm .tsx +++ b/src/pages/BugReportForm .tsx @@ -1,10 +1,11 @@ import React, { useState } from 'react' import { TEXT_KEYS } from 'src/resources/texts' import { useTranslation } from 'react-i18next' -import { Form, Input, Button, Upload, message, Select } from 'antd' +import { Form, Input, Button, Upload, message, Select, FormProps } from 'antd' import { UploadOutlined } from '@ant-design/icons' // import axios from 'axios' import './BugReportForm.scss' +import { UploadChangeParam, UploadFile } from 'antd/lib/upload' const { Option } = Select interface BugReportFormData { @@ -22,7 +23,7 @@ interface BugReportFormData { const BugReportForm: React.FC = () => { const { t } = useTranslation() const [form] = Form.useForm() - const [fileList, setFileList] = useState([]) + const [fileList, setFileList] = useState([]) const [selectedType, setSelectedType] = useState(undefined) //Not implemented yet @@ -49,11 +50,11 @@ const BugReportForm: React.FC = () => { } } - const onFinishFailed = (errorInfo: any) => { + const onFinishFailed: FormProps['onFinishFailed'] = (errorInfo) => { console.log('Failed:', errorInfo) } - const onFileChange = (info: any) => { + const onFileChange = (info: UploadChangeParam) => { setFileList(info.fileList) } From fa8f6a3203e05656767f58b5d134538c26c933d2 Mon Sep 17 00:00:00 2001 From: Noam Gaash Date: Mon, 27 Nov 2023 12:06:45 +0200 Subject: [PATCH 11/12] fix: type --- src/pages/BugReportForm .tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/BugReportForm .tsx b/src/pages/BugReportForm .tsx index 55ff6963..abc530c8 100644 --- a/src/pages/BugReportForm .tsx +++ b/src/pages/BugReportForm .tsx @@ -15,7 +15,7 @@ interface BugReportFormData { expectedBehavior: string actualBehavior: string reproducibility: string - attachments: any[] + attachments: UploadFile[] contactName: string contactEmail: string } From e732fd4d250401ae1e7d6ee79ada34f5843c0ca4 Mon Sep 17 00:00:00 2001 From: Or Malka Date: Mon, 27 Nov 2023 12:36:13 +0200 Subject: [PATCH 12/12] fix: lint --- src/routes/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/index.tsx b/src/routes/index.tsx index d75d2ca0..0bf69697 100644 --- a/src/routes/index.tsx +++ b/src/routes/index.tsx @@ -69,7 +69,7 @@ export const PAGES = [ icon: , element: , }, - { + { label: TEXT_KEYS.report_a_bug_title, path: 'report-a-bug', icon: ,