Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
minerva
frontend
Commits
357e28b9
Commit
357e28b9
authored
10 months ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
reflect data checked in the form that we want to send
parent
8b7687db
No related branches found
No related tags found
2 merge requests
!223
reset the pin numbers before search results are fetch (so the results will be...
,
!199
Resolve "[MIN-321] form for reporting errors in minerva"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/FunctionalArea/Modal/ErrorReportModal/ErroReportModal.component.tsx
+56
-17
56 additions, 17 deletions
...Area/Modal/ErrorReportModal/ErroReportModal.component.tsx
with
56 additions
and
17 deletions
src/components/FunctionalArea/Modal/ErrorReportModal/ErroReportModal.component.tsx
+
56
−
17
View file @
357e28b9
...
@@ -26,18 +26,38 @@ export const ErrorReportModal: React.FC = () => {
...
@@ -26,18 +26,38 @@ export const ErrorReportModal: React.FC = () => {
const
message
=
getValue
(
errorData
?.
message
);
const
message
=
getValue
(
errorData
?.
message
);
// eslint-disable-next-line @typescript-eslint/no-unused-vars
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const
[
errorDataToSend
,
setValue
]
=
React
.
useState
(
errorData
);
const
[
errorDataToSend
,
setValue
]
=
React
.
useState
({
url
,
browser
,
comment
,
login
,
email
,
javaStacktrace
,
stacktrace
,
version
,
message
,
});
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const
handleChange
=
(
e
:
React
.
ChangeEvent
<
HTMLInputElement
>
):
void
=>
{
const
handleChange
=
(
e
:
React
.
ChangeEvent
<
HTMLInputElement
>
):
void
=>
{
const
{
name
,
value
}
=
e
.
target
;
const
{
name
,
checked
}
=
e
.
target
;
let
{
value
}
=
e
.
target
;
setValue
(
errorData2
=>
{
setValue
(
errorData2
=>
{
// eslint-disable-next-line no-console
if
(
name
===
'
login
'
)
{
console
.
log
(
name
);
const
loginValue
=
checked
?
login
:
''
;
// eslint-disable-next-line no-console
const
emailValue
=
checked
?
email
:
''
;
console
.
log
(
value
);
return
errorData2
;
return
{
...
errorData2
,
login
:
loginValue
,
email
:
emailValue
};
}
if
(
name
===
'
url
'
)
{
value
=
checked
?
url
:
''
;
}
if
(
name
===
'
browser
'
)
{
value
=
checked
?
browser
:
''
;
}
if
(
name
===
'
version
'
)
{
value
=
checked
?
version
:
''
;
}
return
{
...
errorData2
,
[
name
]:
value
};
});
});
};
};
...
@@ -48,21 +68,31 @@ export const ErrorReportModal: React.FC = () => {
...
@@ -48,21 +68,31 @@ export const ErrorReportModal: React.FC = () => {
return
(
return
(
<
div
className
=
"w-[800px] border border-t-[#E1E0E6] bg-white"
>
<
div
className
=
"w-[800px] border border-t-[#E1E0E6] bg-white"
>
<
form
onSubmit
=
{
handleSubmit
}
className
=
"p-4"
>
<
form
onSubmit
=
{
handleSubmit
}
className
=
"p-4"
>
<
p
className
=
"my-4 font-bold"
>
{
message
}
</
p
>
<
p
className
=
"my-4 font-bold"
>
{
errorDataToSend
.
message
}
</
p
>
<
p
className
=
"my-4"
>
<
p
className
=
"my-4"
>
If you agree to submit the following information to the minerva maintainers please uncheck
If you agree to submit the following information to the minerva maintainers please uncheck
all boxes that might contain sensitive data.
all boxes that might contain sensitive data.
</
p
>
</
p
>
<
label
className
=
"mb-1 mt-4 block text-sm"
>
<
label
className
=
"mb-1 mt-4 block text-sm"
htmlFor
=
"comment"
>
<
span
className
=
"font-semibold"
>
Add comment
</
span
>
(max 1000 characters):
<
span
className
=
"font-semibold"
>
Add comment
</
span
>
(max 1000 characters):
</
label
>
</
label
>
<
Input
type
=
"textarea"
value
=
{
comment
}
className
=
"mb-4 text-sm font-medium text-font-400"
/>
<
Input
type
=
"textarea"
name
=
"comment"
id
=
"comment"
onChange
=
{
handleChange
}
value
=
{
errorDataToSend
.
comment
}
className
=
"mb-4 text-sm font-medium text-font-400"
/>
<
div
className
=
"grid grid-cols-[15px_743px] gap-2"
>
<
div
className
=
"grid grid-cols-[15px_743px] gap-2"
>
<
label
className
=
"flex-1 text-sm font-semibold"
htmlFor
=
"url"
>
<
label
className
=
"flex-1 text-sm font-semibold"
htmlFor
=
"url"
>
<
Input
<
Input
styleVariant
=
"primaryWithoutFull"
styleVariant
=
"primaryWithoutFull"
id
=
"url"
name
=
"url"
type
=
"checkbox"
type
=
"checkbox"
checked
onChange
=
{
handleChange
}
checked
=
{
errorDataToSend
.
url
!==
''
}
className
=
"flex-1 align-bottom text-sm font-semibold"
className
=
"flex-1 align-bottom text-sm font-semibold"
/>
/>
</
label
>
</
label
>
...
@@ -72,8 +102,11 @@ export const ErrorReportModal: React.FC = () => {
...
@@ -72,8 +102,11 @@ export const ErrorReportModal: React.FC = () => {
<
label
className
=
"block text-sm font-semibold"
>
<
label
className
=
"block text-sm font-semibold"
>
<
Input
<
Input
styleVariant
=
"primaryWithoutFull"
styleVariant
=
"primaryWithoutFull"
id
=
"browser"
name
=
"browser"
type
=
"checkbox"
type
=
"checkbox"
checked
onChange
=
{
handleChange
}
checked
=
{
errorDataToSend
.
browser
!==
''
}
className
=
"flex-1 align-bottom text-sm font-semibold"
className
=
"flex-1 align-bottom text-sm font-semibold"
/>
/>
</
label
>
</
label
>
...
@@ -82,9 +115,12 @@ export const ErrorReportModal: React.FC = () => {
...
@@ -82,9 +115,12 @@ export const ErrorReportModal: React.FC = () => {
</
label
>
</
label
>
<
label
className
=
"block text-sm font-semibold"
>
<
label
className
=
"block text-sm font-semibold"
>
<
Input
<
Input
id
=
"login"
name
=
"login"
type
=
"checkbox"
type
=
"checkbox"
onChange
=
{
handleChange
}
checked
=
{
errorDataToSend
.
login
!==
''
}
styleVariant
=
"primaryWithoutFull"
styleVariant
=
"primaryWithoutFull"
checked
className
=
"flex-1 align-bottom text-sm font-semibold"
className
=
"flex-1 align-bottom text-sm font-semibold"
/>
/>
</
label
>
</
label
>
...
@@ -94,8 +130,11 @@ export const ErrorReportModal: React.FC = () => {
...
@@ -94,8 +130,11 @@ export const ErrorReportModal: React.FC = () => {
<
label
className
=
"block text-sm font-semibold"
>
<
label
className
=
"block text-sm font-semibold"
>
<
Input
<
Input
styleVariant
=
"primaryWithoutFull"
styleVariant
=
"primaryWithoutFull"
id
=
"version"
name
=
"version"
type
=
"checkbox"
type
=
"checkbox"
checked
onChange
=
{
handleChange
}
checked
=
{
errorDataToSend
.
version
!==
''
}
className
=
"flex-1 align-bottom text-sm font-semibold"
className
=
"flex-1 align-bottom text-sm font-semibold"
/>
/>
</
label
>
</
label
>
...
@@ -106,11 +145,11 @@ export const ErrorReportModal: React.FC = () => {
...
@@ -106,11 +145,11 @@ export const ErrorReportModal: React.FC = () => {
<
div
className
=
"my-4 block max-h-20 overflow-auto border border-transparent bg-cultured px-2 py-2.5 text-sm font-medium outline-none hover:border-greyscale-600 focus:border-greyscale-600"
>
<
div
className
=
"my-4 block max-h-20 overflow-auto border border-transparent bg-cultured px-2 py-2.5 text-sm font-medium outline-none hover:border-greyscale-600 focus:border-greyscale-600"
>
Stacktrace:
Stacktrace:
<
pre
>
{
stacktrace
}
</
pre
>
<
pre
>
{
errorDataToSend
.
stacktrace
}
</
pre
>
</
div
>
</
div
>
<
div
className
=
"my-4 block max-h-20 overflow-auto border border-transparent bg-cultured px-2 py-2.5 text-sm font-medium outline-none hover:border-greyscale-600 focus:border-greyscale-600"
>
<
div
className
=
"my-4 block max-h-20 overflow-auto border border-transparent bg-cultured px-2 py-2.5 text-sm font-medium outline-none hover:border-greyscale-600 focus:border-greyscale-600"
>
Backend stacktrace:
Backend stacktrace:
<
pre
>
{
javaStacktrace
}
</
pre
>
<
pre
>
{
errorDataToSend
.
javaStacktrace
}
</
pre
>
</
div
>
</
div
>
<
Button
type
=
"submit"
className
=
"w-full justify-center text-base font-medium"
>
<
Button
type
=
"submit"
className
=
"w-full justify-center text-base font-medium"
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment