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
5eb7ded4
Commit
5eb7ded4
authored
Mar 17, 2021
by
Stefan Probst
Browse files
fix: don't redirect at all when saving as draft
parent
0e9a8ad1
Pipeline
#181560
passed with stage
in 5 minutes and 24 seconds
Changes
10
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/components/item/DatasetCreateForm/DatasetCreateForm.tsx
View file @
5eb7ded4
...
...
@@ -78,7 +78,8 @@ export function ItemForm(props: ItemFormProps<ItemFormValues>): JSX.Element {
if
(
data
.
status
===
'
approved
'
)
{
router
.
push
({
pathname
:
`/
${
data
.
category
}
/
${
data
.
persistentId
}
`
})
}
else
if
(
data
.
status
===
'
draft
'
)
{
router
.
push
({
pathname
:
'
/
'
})
/** Stay on page and don't clear form when saving as draft. */
// router.push({ pathname: '/' })
}
else
{
router
.
push
({
pathname
:
'
/success
'
})
}
...
...
src/components/item/DatasetEditForm/DatasetEditForm.tsx
View file @
5eb7ded4
...
...
@@ -80,7 +80,8 @@ export function ItemForm(props: ItemFormProps<ItemFormValues>): JSX.Element {
if
(
data
.
status
===
'
approved
'
)
{
router
.
push
({
pathname
:
`/
${
data
.
category
}
/
${
data
.
persistentId
}
`
})
}
else
if
(
data
.
status
===
'
draft
'
)
{
router
.
push
({
pathname
:
'
/
'
})
/** Stay on page and don't clear form when saving as draft. */
// router.push({ pathname: '/' })
}
else
{
router
.
push
({
pathname
:
'
/success
'
})
}
...
...
src/components/item/PublicationCreateForm/PublicationCreateForm.tsx
View file @
5eb7ded4
...
...
@@ -78,7 +78,8 @@ export function ItemForm(props: ItemFormProps<ItemFormValues>): JSX.Element {
if
(
data
.
status
===
'
approved
'
)
{
router
.
push
({
pathname
:
`/
${
data
.
category
}
/
${
data
.
persistentId
}
`
})
}
else
if
(
data
.
status
===
'
draft
'
)
{
router
.
push
({
pathname
:
'
/
'
})
/** Stay on page and don't clear form when saving as draft. */
// router.push({ pathname: '/' })
}
else
{
router
.
push
({
pathname
:
'
/success
'
})
}
...
...
src/components/item/PublicationEditForm/PublicationEditForm.tsx
View file @
5eb7ded4
...
...
@@ -80,7 +80,8 @@ export function ItemForm(props: ItemFormProps<ItemFormValues>): JSX.Element {
if
(
data
.
status
===
'
approved
'
)
{
router
.
push
({
pathname
:
`/
${
data
.
category
}
/
${
data
.
persistentId
}
`
})
}
else
if
(
data
.
status
===
'
draft
'
)
{
router
.
push
({
pathname
:
'
/
'
})
/** Stay on page and don't clear form when saving as draft. */
// router.push({ pathname: '/' })
}
else
{
router
.
push
({
pathname
:
'
/success
'
})
}
...
...
src/components/item/ToolCreateForm/ToolCreateForm.tsx
View file @
5eb7ded4
...
...
@@ -76,7 +76,8 @@ export function ItemForm(props: ItemFormProps<ItemFormValues>): JSX.Element {
if
(
data
.
status
===
'
approved
'
)
{
router
.
push
({
pathname
:
`/
${
data
.
category
}
/
${
data
.
persistentId
}
`
})
}
else
if
(
data
.
status
===
'
draft
'
)
{
router
.
push
({
pathname
:
'
/
'
})
/** Stay on page and don't clear form when saving as draft. */
// router.push({ pathname: '/' })
}
else
{
router
.
push
({
pathname
:
'
/success
'
})
}
...
...
src/components/item/ToolEditForm/ToolEditForm.tsx
View file @
5eb7ded4
...
...
@@ -78,7 +78,8 @@ export function ItemForm(props: ItemFormProps<ItemFormValues>): JSX.Element {
if
(
data
.
status
===
'
approved
'
)
{
router
.
push
({
pathname
:
`/
${
data
.
category
}
/
${
data
.
persistentId
}
`
})
}
else
if
(
data
.
status
===
'
draft
'
)
{
router
.
push
({
pathname
:
'
/
'
})
/** Stay on page and don't clear form when saving as draft. */
// router.push({ pathname: '/' })
}
else
{
router
.
push
({
pathname
:
'
/success
'
})
}
...
...
src/components/item/TrainingMaterialCreateForm/TrainingMaterialCreateForm.tsx
View file @
5eb7ded4
...
...
@@ -76,7 +76,8 @@ export function ItemForm(props: ItemFormProps<ItemFormValues>): JSX.Element {
if
(
data
.
status
===
'
approved
'
)
{
router
.
push
({
pathname
:
`/
${
data
.
category
}
/
${
data
.
persistentId
}
`
})
}
else
if
(
data
.
status
===
'
draft
'
)
{
router
.
push
({
pathname
:
'
/
'
})
/** Stay on page and don't clear form when saving as draft. */
// router.push({ pathname: '/' })
}
else
{
router
.
push
({
pathname
:
'
/success
'
})
}
...
...
src/components/item/TrainingMaterialEditForm/TrainingMaterialEditForm.tsx
View file @
5eb7ded4
...
...
@@ -78,7 +78,8 @@ export function ItemForm(props: ItemFormProps<ItemFormValues>): JSX.Element {
if
(
data
.
status
===
'
approved
'
)
{
router
.
push
({
pathname
:
`/
${
data
.
category
}
/
${
data
.
persistentId
}
`
})
}
else
if
(
data
.
status
===
'
draft
'
)
{
router
.
push
({
pathname
:
'
/
'
})
/** Stay on page and don't clear form when saving as draft. */
// router.push({ pathname: '/' })
}
else
{
router
.
push
({
pathname
:
'
/success
'
})
}
...
...
src/components/item/WorkflowCreateForm/WorkflowCreateForm.tsx
View file @
5eb7ded4
...
...
@@ -122,7 +122,8 @@ export function ItemForm(props: ItemFormProps<ItemFormValues>): JSX.Element {
if
(
data
.
status
===
'
approved
'
)
{
router
.
push
({
pathname
:
`/
${
data
.
category
}
/
${
data
.
persistentId
}
`
})
}
else
if
(
data
.
status
===
'
draft
'
)
{
router
.
push
({
pathname
:
'
/
'
})
/** Stay on page and don't clear form when saving as draft. */
// router.push({ pathname: '/' })
}
else
{
router
.
push
({
pathname
:
'
/success
'
})
}
...
...
src/components/item/WorkflowEditForm/WorkflowEditForm.tsx
View file @
5eb7ded4
...
...
@@ -136,7 +136,8 @@ export function ItemForm(props: ItemFormProps<ItemFormValues>): JSX.Element {
if
(
data
.
status
===
'
approved
'
)
{
router
.
push
({
pathname
:
`/
${
data
.
category
}
/
${
data
.
persistentId
}
`
})
}
else
if
(
data
.
status
===
'
draft
'
)
{
router
.
push
({
pathname
:
'
/
'
})
/** Stay on page and don't clear form when saving as draft. */
// router.push({ pathname: '/' })
}
else
{
router
.
push
({
pathname
:
'
/success
'
})
}
...
...
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