Dear Gitlab users, due to maintenance reasons, Gitlab will not be available on Thursday 30.09.2021 from 5:00 pm to approximately 5:30 pm.

Commit 378b9ca1 authored by Stefan Probst's avatar 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
......@@ -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>
)
}
......
......@@ -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">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment