Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle undefined source database name in restore dialog #25301

Merged
merged 1 commit into from
Feb 7, 2024

Conversation

corivera
Copy link
Member

@corivera corivera commented Feb 6, 2024

When first switching to File mode in the Restore dialog, the loading spinner in the corner would keep running forever without any data showing up in the table. This is because an error was being thrown (from the ModelView code) due to an undefined value in the source database dropdown, and so resetting the loading state would get skipped. This change fixes that undefined string issue and also adds a try-finally block for the loading logic so it doesn't get stuck on error.

@@ -235,7 +235,6 @@ export class RestoreDatabaseDialog extends ObjectManagementDialogBase<Database,
// Restore from
const restoreFromDropdownOptions = this.isManagedInstance ? [localizedConstants.RestoreFromUrlText, localizedConstants.RestoreFromS3UrlText] : [localizedConstants.RestoreFromDatabaseOptionText, localizedConstants.RestoreFromBackupFileOptionText, localizedConstants.RestoreFromUrlText, localizedConstants.RestoreFromS3UrlText];
this.restoreFrom = this.createDropdown(localizedConstants.RestoreFromText, async (newValue) => {
this.backupFilePath = this.backupURLPath = '';
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other small fix: this line was causing the file input box to be cleared when switching modes back and forth. These cached values get used immediately below this to restore the input box value, so they don't need to be here.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 7807458123

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 41.759%

Totals Coverage Status
Change from base Build 7806237309: 0.0%
Covered Lines: 30828
Relevant Lines: 69082

💛 - Coveralls

@corivera corivera merged commit 90f2315 into main Feb 7, 2024
15 checks passed
@corivera corivera deleted the corivera/restoreLoading branch February 7, 2024 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants