fix(scaffolder): Allow user to retry creating a new software without refreshing the page

This is more of a bug fix than a new feature. The commit fixes 2 problems mainly.

1. When user clicks the close button on the JobStatusModal, it does not set the `modalOpen` state of its parent component. Thus, even after closing, JobStatusModal still persists in DOM, and modalOpen is still set to true. That is why, retrying by clicking on "Submit" again does not open the modal.

2. The useJobPolling hook does not consider starting the timer again when Job changes. Even if jobId changes, the logic to set `shouldBeRunningInterval` still uses a previous value of `currentJob` since it was never reset since the timer stopped. Using a effect hook and having jobId as a dependency to reset currentJob is the way to fix this.
This commit is contained in:
Himanshu Mishra
2020-12-29 00:00:57 +01:00
parent ede29f55c7
commit 8e083f41f3
4 changed files with 37 additions and 8 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder': patch
---
Bug fix: User can retry creating a new component if an error occurs, without having to reload the page.