Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cookiecutter-web
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
m-team
ai
cookiecutter-web
Commits
eac2954d
Commit
eac2954d
authored
1 year ago
by
Christophe
Browse files
Options
Downloads
Patches
Plain Diff
fix(template): do not set label with for for empty/deephdc dummy fields
parent
41069852
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!10
Update ai4eosc branch with recent main (multiple templates)
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
frontend/components/template/Form.tsx
+10
-6
10 additions, 6 deletions
frontend/components/template/Form.tsx
with
10 additions
and
6 deletions
frontend/components/template/Form.tsx
+
10
−
6
View file @
eac2954d
...
...
@@ -5,22 +5,26 @@ import TextInput from './TextInput';
import
Badge
from
'
components/Badge
'
;
import
{
CutterField
}
from
'
lib/client
'
;
import
CheckboxInput
from
'
components/template/CheckboxInput
'
;
import
ErrorBox
from
'
components/ErrorBox
'
;
type
FormFieldProps
=
{
field
:
CutterField
;
flagged
:
boolean
};
const
Formfield
:
FC
<
FormFieldProps
>
=
({
field
,
flagged
})
=>
{
return
(
<
div
className
=
{
field
.
default
===
BLANK_FIELD
?
'
-mb-3
'
:
''
}
>
<
label
htmlFor
=
{
field
.
name
}
>
{
field
.
prompt
??
field
.
name
}
</
label
>
{
'
'
}
{
flagged
&&
<
Badge
type
=
"warning"
>
Missing
</
Badge
>
}
{
field
.
default
===
BLANK_FIELD
&&
<
div
>
{
field
.
prompt
??
field
.
name
}
</
div
>
}
{
field
.
default
!=
BLANK_FIELD
&&
(
<>
{
field
.
type
===
'
text
'
&&
(
<
label
htmlFor
=
{
field
.
name
}
>
{
field
.
prompt
??
field
.
name
}
</
label
>
{
'
'
}
{
flagged
&&
<
Badge
type
=
"warning"
>
Missing
</
Badge
>
}
{
field
.
type
===
'
text
'
?
(
<
TextInput
field
=
{
field
}
flagged
=
{
flagged
}
className
=
"mt-1"
/>
)
}
{
field
.
type
===
'
select
'
&&
(
)
:
field
.
type
===
'
select
'
?
(
<
SelectInput
field
=
{
field
}
flagged
=
{
flagged
}
className
=
"mt-1"
/>
)
:
field
.
type
===
'
checkbox
'
?
(
<
CheckboxInput
field
=
{
field
}
className
=
"mt-1"
/>
)
:
(
<
ErrorBox
error
=
{
`Unknown field type
${
field
.
type
}
`
}
/>
)
}
{
field
.
type
===
'
checkbox
'
&&
<
CheckboxInput
field
=
{
field
}
className
=
"mt-1"
/>
}
</>
)
}
</
div
>
...
...
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