Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
SSHOC
sshoc-marketplace-frontend
Commits
72bd5e80
Commit
72bd5e80
authored
Apr 20, 2021
by
Stefan Probst
Browse files
fix: remove source form section
parent
378b9ca1
Changes
11
Hide whitespace changes
Inline
Side-by-side
src/components/item/DatasetCreateForm/DatasetCreateForm.tsx
View file @
72bd5e80
...
...
@@ -9,7 +9,6 @@ import { DateFormSection } from '@/components/item/DateFormSection/DateFormSecti
import
{
MainFormSection
}
from
'
@/components/item/MainFormSection/MainFormSection
'
import
{
PropertiesFormSection
}
from
'
@/components/item/PropertiesFormSection/PropertiesFormSection
'
import
{
RelatedItemsFormSection
}
from
'
@/components/item/RelatedItemsFormSection/RelatedItemsFormSection
'
import
{
SourceFormSection
}
from
'
@/components/item/SourceFormSection/SourceFormSection
'
import
{
Button
}
from
'
@/elements/Button/Button
'
import
{
useToast
}
from
'
@/elements/Toast/useToast
'
import
{
sanitizeFormValues
}
from
'
@/lib/sshoc/sanitizeFormValues
'
...
...
@@ -152,7 +151,6 @@ export function ItemForm(props: ItemFormProps<ItemFormValues>): JSX.Element {
<
ActorsFormSection
/>
<
PropertiesFormSection
/>
<
RelatedItemsFormSection
/>
<
SourceFormSection
/>
<
div
className
=
"flex items-center justify-end space-x-6"
>
<
Button
onPress
=
{
onCancel
}
variant
=
"link"
>
Cancel
...
...
src/components/item/DatasetEditForm/DatasetEditForm.tsx
View file @
72bd5e80
...
...
@@ -9,7 +9,6 @@ import { DateFormSection } from '@/components/item/DateFormSection/DateFormSecti
import
{
MainFormSection
}
from
'
@/components/item/MainFormSection/MainFormSection
'
import
{
PropertiesFormSection
}
from
'
@/components/item/PropertiesFormSection/PropertiesFormSection
'
import
{
RelatedItemsFormSection
}
from
'
@/components/item/RelatedItemsFormSection/RelatedItemsFormSection
'
import
{
SourceFormSection
}
from
'
@/components/item/SourceFormSection/SourceFormSection
'
import
{
Button
}
from
'
@/elements/Button/Button
'
import
{
useToast
}
from
'
@/elements/Toast/useToast
'
import
{
sanitizeFormValues
}
from
'
@/lib/sshoc/sanitizeFormValues
'
...
...
@@ -154,7 +153,6 @@ export function ItemForm(props: ItemFormProps<ItemFormValues>): JSX.Element {
<
ActorsFormSection
initialValues
=
{
props
.
item
}
/>
<
PropertiesFormSection
initialValues
=
{
props
.
item
}
/>
<
RelatedItemsFormSection
initialValues
=
{
props
.
item
}
/>
<
SourceFormSection
initialValues
=
{
props
.
item
}
/>
<
div
className
=
"flex items-center justify-end space-x-6"
>
<
Button
onPress
=
{
onCancel
}
variant
=
"link"
>
Cancel
...
...
src/components/item/PublicationCreateForm/PublicationCreateForm.tsx
View file @
72bd5e80
...
...
@@ -9,7 +9,6 @@ import { DateFormSection } from '@/components/item/DateFormSection/DateFormSecti
import
{
MainFormSection
}
from
'
@/components/item/MainFormSection/MainFormSection
'
import
{
PropertiesFormSection
}
from
'
@/components/item/PropertiesFormSection/PropertiesFormSection
'
import
{
RelatedItemsFormSection
}
from
'
@/components/item/RelatedItemsFormSection/RelatedItemsFormSection
'
import
{
SourceFormSection
}
from
'
@/components/item/SourceFormSection/SourceFormSection
'
import
{
Button
}
from
'
@/elements/Button/Button
'
import
{
useToast
}
from
'
@/elements/Toast/useToast
'
import
{
sanitizeFormValues
}
from
'
@/lib/sshoc/sanitizeFormValues
'
...
...
@@ -151,7 +150,6 @@ export function ItemForm(props: ItemFormProps<ItemFormValues>): JSX.Element {
<
ActorsFormSection
/>
<
PropertiesFormSection
/>
<
RelatedItemsFormSection
/>
<
SourceFormSection
/>
<
div
className
=
"flex items-center justify-end space-x-6"
>
<
Button
onPress
=
{
onCancel
}
variant
=
"link"
>
Cancel
...
...
src/components/item/PublicationEditForm/PublicationEditForm.tsx
View file @
72bd5e80
...
...
@@ -9,7 +9,6 @@ import { DateFormSection } from '@/components/item/DateFormSection/DateFormSecti
import
{
MainFormSection
}
from
'
@/components/item/MainFormSection/MainFormSection
'
import
{
PropertiesFormSection
}
from
'
@/components/item/PropertiesFormSection/PropertiesFormSection
'
import
{
RelatedItemsFormSection
}
from
'
@/components/item/RelatedItemsFormSection/RelatedItemsFormSection
'
import
{
SourceFormSection
}
from
'
@/components/item/SourceFormSection/SourceFormSection
'
import
{
Button
}
from
'
@/elements/Button/Button
'
import
{
useToast
}
from
'
@/elements/Toast/useToast
'
import
{
sanitizeFormValues
}
from
'
@/lib/sshoc/sanitizeFormValues
'
...
...
@@ -154,7 +153,6 @@ export function ItemForm(props: ItemFormProps<ItemFormValues>): JSX.Element {
<
ActorsFormSection
initialValues
=
{
props
.
item
}
/>
<
PropertiesFormSection
initialValues
=
{
props
.
item
}
/>
<
RelatedItemsFormSection
initialValues
=
{
props
.
item
}
/>
<
SourceFormSection
initialValues
=
{
props
.
item
}
/>
<
div
className
=
"flex items-center justify-end space-x-6"
>
<
Button
onPress
=
{
onCancel
}
variant
=
"link"
>
Cancel
...
...
src/components/item/SourceFormSection/SourceFormSection.tsx
deleted
100644 → 0
View file @
378b9ca1
import
{
useState
}
from
'
react
'
import
{
useGetSources
}
from
'
@/api/sshoc
'
import
{
useDebouncedState
}
from
'
@/lib/hooks/useDebouncedState
'
import
{
FormComboBox
}
from
'
@/modules/form/components/FormComboBox/FormComboBox
'
import
{
FormSection
}
from
'
@/modules/form/components/FormSection/FormSection
'
import
{
FormTextField
}
from
'
@/modules/form/components/FormTextField/FormTextField
'
export
interface
SoureFormSectionProps
{
initialValues
?:
any
prefix
?:
string
}
/**
* Form section for item source.
*/
export
function
SourceFormSection
(
props
:
SoureFormSectionProps
):
JSX
.
Element
{
const
prefix
=
props
.
prefix
??
''
return
(
<
FormSection
title
=
{
'
Source
'
}
>
<
div
className
=
"flex space-x-4"
>
<
SourceComboBox
name
=
{
`
${
prefix
}
source.id`
}
label
=
{
'
Source
'
}
initialValues
=
{
props
.
initialValues
}
/>
<
FormTextField
name
=
{
`
${
prefix
}
sourceItemId`
}
label
=
{
'
Source ID
'
}
variant
=
"form"
style
=
{
{
flex
:
1
}
}
/>
</
div
>
</
FormSection
>
)
}
interface
SourceSelectProps
{
name
:
string
label
:
string
initialValues
?:
any
}
/**
* Source.
*/
function
SourceComboBox
(
props
:
SourceSelectProps
):
JSX
.
Element
{
const
initialLabel
=
props
.
initialValues
?.
source
?.
label
??
''
const
[
searchTerm
,
setSearchTerm
]
=
useState
(
initialLabel
)
const
debouncedSearchTerm
=
useDebouncedState
(
searchTerm
,
150
)
const
sources
=
useGetSources
(
{
q
:
debouncedSearchTerm
},
{
// enabled: debouncedSearchTerm.length > 2,
keepPreviousData
:
true
,
},
)
return
(
<
FormComboBox
name
=
{
props
.
name
}
label
=
{
props
.
label
}
items
=
{
sources
.
data
?.
sources
??
[]
}
onInputChange
=
{
setSearchTerm
}
isLoading
=
{
sources
.
isLoading
}
variant
=
"form"
>
{
(
item
)
=>
<
FormComboBox
.
Item
>
{
item
.
label
}
</
FormComboBox
.
Item
>
}
</
FormComboBox
>
)
}
src/components/item/ToolCreateForm/ToolCreateForm.tsx
View file @
72bd5e80
...
...
@@ -8,7 +8,6 @@ import { ActorsFormSection } from '@/components/item/ActorsFormSection/ActorsFor
import
{
MainFormSection
}
from
'
@/components/item/MainFormSection/MainFormSection
'
import
{
PropertiesFormSection
}
from
'
@/components/item/PropertiesFormSection/PropertiesFormSection
'
import
{
RelatedItemsFormSection
}
from
'
@/components/item/RelatedItemsFormSection/RelatedItemsFormSection
'
import
{
SourceFormSection
}
from
'
@/components/item/SourceFormSection/SourceFormSection
'
import
{
Button
}
from
'
@/elements/Button/Button
'
import
{
useToast
}
from
'
@/elements/Toast/useToast
'
import
{
sanitizeFormValues
}
from
'
@/lib/sshoc/sanitizeFormValues
'
...
...
@@ -147,7 +146,6 @@ export function ItemForm(props: ItemFormProps<ItemFormValues>): JSX.Element {
<
ActorsFormSection
/>
<
PropertiesFormSection
/>
<
RelatedItemsFormSection
/>
<
SourceFormSection
/>
<
div
className
=
"flex items-center justify-end space-x-6"
>
<
Button
onPress
=
{
onCancel
}
variant
=
"link"
>
Cancel
...
...
src/components/item/ToolEditForm/ToolEditForm.tsx
View file @
72bd5e80
...
...
@@ -8,7 +8,6 @@ import { ActorsFormSection } from '@/components/item/ActorsFormSection/ActorsFor
import
{
MainFormSection
}
from
'
@/components/item/MainFormSection/MainFormSection
'
import
{
PropertiesFormSection
}
from
'
@/components/item/PropertiesFormSection/PropertiesFormSection
'
import
{
RelatedItemsFormSection
}
from
'
@/components/item/RelatedItemsFormSection/RelatedItemsFormSection
'
import
{
SourceFormSection
}
from
'
@/components/item/SourceFormSection/SourceFormSection
'
import
{
Button
}
from
'
@/elements/Button/Button
'
import
{
useToast
}
from
'
@/elements/Toast/useToast
'
import
{
sanitizeFormValues
}
from
'
@/lib/sshoc/sanitizeFormValues
'
...
...
@@ -150,7 +149,6 @@ export function ItemForm(props: ItemFormProps<ItemFormValues>): JSX.Element {
<
ActorsFormSection
initialValues
=
{
props
.
item
}
/>
<
PropertiesFormSection
initialValues
=
{
props
.
item
}
/>
<
RelatedItemsFormSection
initialValues
=
{
props
.
item
}
/>
<
SourceFormSection
initialValues
=
{
props
.
item
}
/>
<
div
className
=
"flex items-center justify-end space-x-6"
>
<
Button
onPress
=
{
onCancel
}
variant
=
"link"
>
Cancel
...
...
src/components/item/TrainingMaterialCreateForm/TrainingMaterialCreateForm.tsx
View file @
72bd5e80
...
...
@@ -8,7 +8,6 @@ import { ActorsFormSection } from '@/components/item/ActorsFormSection/ActorsFor
import
{
MainFormSection
}
from
'
@/components/item/MainFormSection/MainFormSection
'
import
{
PropertiesFormSection
}
from
'
@/components/item/PropertiesFormSection/PropertiesFormSection
'
import
{
RelatedItemsFormSection
}
from
'
@/components/item/RelatedItemsFormSection/RelatedItemsFormSection
'
import
{
SourceFormSection
}
from
'
@/components/item/SourceFormSection/SourceFormSection
'
import
{
Button
}
from
'
@/elements/Button/Button
'
import
{
useToast
}
from
'
@/elements/Toast/useToast
'
import
{
sanitizeFormValues
}
from
'
@/lib/sshoc/sanitizeFormValues
'
...
...
@@ -147,7 +146,6 @@ export function ItemForm(props: ItemFormProps<ItemFormValues>): JSX.Element {
<
ActorsFormSection
/>
<
PropertiesFormSection
/>
<
RelatedItemsFormSection
/>
<
SourceFormSection
/>
<
div
className
=
"flex items-center justify-end space-x-6"
>
<
Button
onPress
=
{
onCancel
}
variant
=
"link"
>
Cancel
...
...
src/components/item/TrainingMaterialEditForm/TrainingMaterialEditForm.tsx
View file @
72bd5e80
...
...
@@ -8,7 +8,6 @@ import { ActorsFormSection } from '@/components/item/ActorsFormSection/ActorsFor
import
{
MainFormSection
}
from
'
@/components/item/MainFormSection/MainFormSection
'
import
{
PropertiesFormSection
}
from
'
@/components/item/PropertiesFormSection/PropertiesFormSection
'
import
{
RelatedItemsFormSection
}
from
'
@/components/item/RelatedItemsFormSection/RelatedItemsFormSection
'
import
{
SourceFormSection
}
from
'
@/components/item/SourceFormSection/SourceFormSection
'
import
{
Button
}
from
'
@/elements/Button/Button
'
import
{
useToast
}
from
'
@/elements/Toast/useToast
'
import
{
sanitizeFormValues
}
from
'
@/lib/sshoc/sanitizeFormValues
'
...
...
@@ -150,7 +149,6 @@ export function ItemForm(props: ItemFormProps<ItemFormValues>): JSX.Element {
<
ActorsFormSection
initialValues
=
{
props
.
item
}
/>
<
PropertiesFormSection
initialValues
=
{
props
.
item
}
/>
<
RelatedItemsFormSection
initialValues
=
{
props
.
item
}
/>
<
SourceFormSection
initialValues
=
{
props
.
item
}
/>
<
div
className
=
"flex items-center justify-end space-x-6"
>
<
Button
onPress
=
{
onCancel
}
variant
=
"link"
>
Cancel
...
...
src/components/item/WorkflowCreateForm/WorkflowCreateForm.tsx
View file @
72bd5e80
...
...
@@ -20,7 +20,6 @@ import { ActorsFormSection } from '@/components/item/ActorsFormSection/ActorsFor
import
{
MainFormSection
}
from
'
@/components/item/MainFormSection/MainFormSection
'
import
{
PropertiesFormSection
}
from
'
@/components/item/PropertiesFormSection/PropertiesFormSection
'
import
{
RelatedItemsFormSection
}
from
'
@/components/item/RelatedItemsFormSection/RelatedItemsFormSection
'
import
{
SourceFormSection
}
from
'
@/components/item/SourceFormSection/SourceFormSection
'
import
{
WorkflowStepsFormSection
}
from
'
@/components/item/WorkflowStepsFormSection/WorkflowStepsFormSection
'
import
{
Button
}
from
'
@/elements/Button/Button
'
import
{
useToast
}
from
'
@/elements/Toast/useToast
'
...
...
@@ -473,7 +472,6 @@ function WorkflowPage() {
<
ActorsFormSection
/>
<
PropertiesFormSection
/>
<
RelatedItemsFormSection
/>
<
SourceFormSection
/>
</
Fragment
>
)
}
...
...
@@ -495,7 +493,6 @@ function WorkflowStepPage(props: FormPageProps) {
<
ActorsFormSection
prefix
=
{
prefix
}
/>
<
PropertiesFormSection
prefix
=
{
prefix
}
/>
<
RelatedItemsFormSection
prefix
=
{
prefix
}
/>
<
SourceFormSection
prefix
=
{
prefix
}
/>
</
Fragment
>
)
}
...
...
src/components/item/WorkflowEditForm/WorkflowEditForm.tsx
View file @
72bd5e80
...
...
@@ -21,7 +21,6 @@ import { ActorsFormSection } from '@/components/item/ActorsFormSection/ActorsFor
import
{
MainFormSection
}
from
'
@/components/item/MainFormSection/MainFormSection
'
import
{
PropertiesFormSection
}
from
'
@/components/item/PropertiesFormSection/PropertiesFormSection
'
import
{
RelatedItemsFormSection
}
from
'
@/components/item/RelatedItemsFormSection/RelatedItemsFormSection
'
import
{
SourceFormSection
}
from
'
@/components/item/SourceFormSection/SourceFormSection
'
import
{
WorkflowStepsFormSection
}
from
'
@/components/item/WorkflowStepsFormSection/WorkflowStepsFormSection
'
import
{
Button
}
from
'
@/elements/Button/Button
'
import
{
useToast
}
from
'
@/elements/Toast/useToast
'
...
...
@@ -537,7 +536,6 @@ function WorkflowPage(props: FormPageProps) {
<
ActorsFormSection
initialValues
=
{
props
.
item
}
/>
<
PropertiesFormSection
initialValues
=
{
props
.
item
}
/>
<
RelatedItemsFormSection
initialValues
=
{
props
.
item
}
/>
<
SourceFormSection
initialValues
=
{
props
.
item
}
/>
</
Fragment
>
)
}
...
...
@@ -562,7 +560,6 @@ function WorkflowStepPage(props: FormPageProps) {
<
ActorsFormSection
prefix
=
{
prefix
}
initialValues
=
{
initialValues
}
/>
<
PropertiesFormSection
prefix
=
{
prefix
}
initialValues
=
{
initialValues
}
/>
<
RelatedItemsFormSection
prefix
=
{
prefix
}
initialValues
=
{
initialValues
}
/>
<
SourceFormSection
prefix
=
{
prefix
}
initialValues
=
{
initialValues
}
/>
</
Fragment
>
)
}
...
...
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