Router: Modify /share and /imagewizard routing
Insights offers 'quickstarts', which can be used to provide mini-tutorials in a sidebar. Unfortunately, these quickstarts change our URL... they add an optional query parameter related to the quickstart. The process of doing so destroys our router's `location`, setting it to undefined. We have been using the location state to store the GUID of the image, needed when opening the wizard via the `Recreate image` action or when opening the share modal. As a workaround, we can simply accept that the quickstarts will change our URL and destroy our router's location. Instead, we now put the image id (its UUID) in the route itself. We can access it in the components as necessary via the useParams hook.
This commit is contained in:
parent
a81fb72523
commit
bc1435994d
12 changed files with 176 additions and 182 deletions
|
|
@ -129,14 +129,7 @@ const ImageLinkDirect = ({ imageId, isExpired, isInClonesTable }) => {
|
|||
component="a"
|
||||
target="_blank"
|
||||
variant="link"
|
||||
onClick={() =>
|
||||
navigate(resolveRelPath('imagewizard'), {
|
||||
state: {
|
||||
composeRequest: image.request,
|
||||
initialStep: 'review',
|
||||
},
|
||||
})
|
||||
}
|
||||
onClick={() => navigate(resolveRelPath(`imagewizard/${imageId}`))}
|
||||
isInline
|
||||
>
|
||||
Recreate image
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue