Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
1f0d8b8c
Commit
1f0d8b8c
authored
May 13, 2024
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add "start over" button for all form result
parent
c9b891a3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
PublicTagsSubmitResult.tsx
ui/publicTags/submit/PublicTagsSubmitResult.tsx
+12
-0
No files found.
ui/publicTags/submit/PublicTagsSubmitResult.tsx
View file @
1f0d8b8c
import
{
Alert
,
Box
,
Button
,
Grid
,
GridItem
}
from
'
@chakra-ui/react
'
;
import
{
Alert
,
Box
,
Button
,
Grid
,
GridItem
}
from
'
@chakra-ui/react
'
;
import
_pickBy
from
'
lodash/pickBy
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
type
{
FormSubmitResult
}
from
'
./types
'
;
import
type
{
FormSubmitResult
}
from
'
./types
'
;
...
@@ -25,6 +26,12 @@ const PublicTagsSubmitResult = ({ data }: Props) => {
...
@@ -25,6 +26,12 @@ const PublicTagsSubmitResult = ({ data }: Props) => {
const
hasErrors
=
groupedData
.
items
.
some
((
item
)
=>
item
.
error
!==
null
);
const
hasErrors
=
groupedData
.
items
.
some
((
item
)
=>
item
.
error
!==
null
);
const
companyWebsite
=
makePrettyLink
(
groupedData
.
companyWebsite
);
const
companyWebsite
=
makePrettyLink
(
groupedData
.
companyWebsite
);
const
startOverButtonQuery
=
hasErrors
?
_pickBy
({
requesterName
:
groupedData
.
requesterName
,
requesterEmail
:
groupedData
.
requesterEmail
,
companyName
:
groupedData
.
companyName
,
companyWebsite
:
groupedData
.
companyWebsite
,
},
Boolean
)
:
undefined
;
return
(
return
(
<
div
>
<
div
>
...
@@ -59,6 +66,11 @@ const PublicTagsSubmitResult = ({ data }: Props) => {
...
@@ -59,6 +66,11 @@ const PublicTagsSubmitResult = ({ data }: Props) => {
<
Box
as=
"h2"
textStyle=
"h4"
mt=
{
8
}
mb=
{
5
}
>
Public tags/labels
</
Box
>
<
Box
as=
"h2"
textStyle=
"h4"
mt=
{
8
}
mb=
{
5
}
>
Public tags/labels
</
Box
>
{
hasErrors
?
<
PublicTagsSubmitResultWithErrors
data=
{
groupedData
}
/>
:
<
PublicTagsSubmitResultSuccess
data=
{
groupedData
}
/>
}
{
hasErrors
?
<
PublicTagsSubmitResultWithErrors
data=
{
groupedData
}
/>
:
<
PublicTagsSubmitResultSuccess
data=
{
groupedData
}
/>
}
{
hasErrors
&&
(
<
Button
size=
"lg"
variant=
"outline"
mt=
{
8
}
mr=
{
6
}
as=
"a"
href=
{
route
({
pathname
:
'
/public-tags/submit
'
,
query
:
startOverButtonQuery
})
}
>
Start over
</
Button
>
)
}
<
Button
size=
"lg"
mt=
{
8
}
as=
"a"
href=
{
route
({
pathname
:
'
/public-tags/submit
'
})
}
>
Add new tag
</
Button
>
<
Button
size=
"lg"
mt=
{
8
}
as=
"a"
href=
{
route
({
pathname
:
'
/public-tags/submit
'
})
}
>
Add new tag
</
Button
>
</
div
>
</
div
>
);
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment