Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SSHOC
sshoc-marketplace-frontend
Commits
378b9ca1
Commit
378b9ca1
authored
Apr 19, 2021
by
Stefan Probst
Browse files
fix: pass initial values to steps edit form
parent
fb8f2036
Pipeline
#189472
passed with stages
in 13 minutes and 16 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/components/item/WorkflowEditForm/WorkflowEditForm.tsx
View file @
378b9ca1
...
...
@@ -552,14 +552,17 @@ function WorkflowStepsPage(props: FormPageProps) {
function
WorkflowStepPage
(
props
:
FormPageProps
)
{
const
prefix
=
props
.
prefix
??
''
const
initialValues
=
prefix
?
get
(
props
.
item
,
prefix
.
slice
(
0
,
-
1
))
:
undefined
return
(
<
Fragment
>
<
MainFormSection
prefix
=
{
prefix
}
/>
<
ActorsFormSection
prefix
=
{
prefix
}
/>
<
PropertiesFormSection
prefix
=
{
prefix
}
/>
<
RelatedItemsFormSection
prefix
=
{
prefix
}
/>
<
SourceFormSection
prefix
=
{
prefix
}
/>
<
ActorsFormSection
prefix
=
{
prefix
}
initialValues
=
{
initialValues
}
/>
<
PropertiesFormSection
prefix
=
{
prefix
}
initialValues
=
{
initialValues
}
/>
<
RelatedItemsFormSection
prefix
=
{
prefix
}
initialValues
=
{
initialValues
}
/>
<
SourceFormSection
prefix
=
{
prefix
}
initialValues
=
{
initialValues
}
/>
</
Fragment
>
)
}
...
...
src/screens/item/ItemLayout.tsx
View file @
378b9ca1
...
...
@@ -456,7 +456,7 @@ function useItemMetadata({
})
.
sort
(([
a
],
[
b
])
=>
(
a
>
b
?
1
:
-
1
))
metadata
.
properties
=
(
<
ul
className
=
"py-8 space-y-6"
>
<
ul
className
=
"py-8 space-y-6"
key
=
"item-properties"
>
{
sorted
.
map
(([
groupName
,
entries
])
=>
{
return
(
<
li
key
=
{
groupName
}
className
=
"flex flex-col space-y-2"
>
...
...
@@ -511,7 +511,7 @@ function useItemMetadata({
})
.
sort
(([
a
],
[
b
])
=>
(
a
>
b
?
1
:
-
1
))
metadata
.
contributors
=
(
<
ul
className
=
"py-8 space-y-6"
>
<
ul
className
=
"py-8 space-y-6"
key
=
"item-actors"
>
{
sorted
.
map
(([
role
,
actors
])
=>
{
return
(
<
li
key
=
{
role
}
className
=
"flex flex-col space-y-3"
>
...
...
@@ -546,7 +546,7 @@ function useItemMetadata({
if
(
dateCreated
!=
null
||
dateLastUpdated
!=
null
)
{
metadata
.
dates
=
(
<
dl
className
=
"py-8"
>
<
dl
className
=
"py-8"
key
=
"item-dates"
>
{
dateCreated
!=
null
?
(
<
div
>
<
dt
>
...
...
@@ -582,7 +582,7 @@ function useItemMetadata({
if
(
sourceItemId
!=
null
)
{
metadata
.
sourceItemId
=
(
<
div
className
=
"py-8"
>
<
div
className
=
"py-8"
key
=
"item-source"
>
<
span
className
=
"mr-2 font-medium text-gray-500 whitespace-nowrap"
>
Source:
</
span
>
...
...
@@ -605,7 +605,7 @@ function useItemMetadata({
if
(
Array
.
isArray
(
externalIds
)
&&
externalIds
.
length
>
0
)
{
metadata
.
externalIds
=
(
<
ul
className
=
"py-8 space-y-6"
>
<
ul
className
=
"py-8 space-y-6"
key
=
"item-externalids"
>
{
externalIds
.
map
((
id
)
=>
{
return
(
<
li
key
=
{
id
.
identifier
}
className
=
"flex space-x-2"
>
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment