mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-22 07:10:53 +00:00
feat: Add forceNavigate option when navigating to new item
The DuplicateModel component in CommonUI has been updated to include a new option, forceNavigate, when navigating to a new item. This option allows for forced navigation to the new item, bypassing any checks or validations. This change provides more control over the navigation behavior and ensures consistent navigation to the new item.
This commit is contained in:
parent
703c4b7685
commit
3bb1d93f3e
@ -86,7 +86,10 @@ const DuplicateModel: <TBaseModel extends BaseModel>(
|
||||
Navigation.navigate(
|
||||
new Route(props.navigateToOnSuccess.toString()).addRoute(
|
||||
`/${newItem.data.id!.toString()}`
|
||||
)
|
||||
),
|
||||
{
|
||||
forceNavigate: true,
|
||||
}
|
||||
);
|
||||
}
|
||||
} catch (err) {
|
||||
|
@ -632,7 +632,8 @@ const FormField: <T extends GenericObject>(
|
||||
? (props.currentValues as any)[
|
||||
props.fieldName
|
||||
]
|
||||
: false
|
||||
: (props.field.defaultValue as boolean) ||
|
||||
false
|
||||
}
|
||||
/>
|
||||
)}
|
||||
|
@ -226,8 +226,8 @@ const MonitorCriteria: FunctionComponent<PageComponentProps> = (
|
||||
title: 'Disable Monitor',
|
||||
description:
|
||||
'Should the new monitor be disabled when its duplicated?',
|
||||
defaultValue: true,
|
||||
fieldType: FormFieldSchemaType.Toggle,
|
||||
defaultValue: true,
|
||||
required: false,
|
||||
},
|
||||
]}
|
||||
|
Loading…
Reference in New Issue
Block a user