-
-
Notifications
You must be signed in to change notification settings - Fork 338
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Navigate to db page after adding connection
- Loading branch information
1 parent
d50edd1
commit d4c0fa0
Showing
2 changed files
with
19 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 14 additions & 1 deletion
15
mathesar_ui/src/systems/connections/AddConnectionModal.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,32 @@ | ||
<script lang="ts"> | ||
import { _ } from 'svelte-i18n'; | ||
import { router } from 'tinro'; | ||
import { | ||
ControlledModal, | ||
type ModalController, | ||
} from '@mathesar-component-library'; | ||
import type { Connection } from '@mathesar/api/connections'; | ||
import { getDatabasePageUrl } from '@mathesar/routes/urls'; | ||
import AddConnection from './AddConnection.svelte'; | ||
export let controller: ModalController; | ||
function handleCancel() { | ||
controller.close(); | ||
} | ||
function handleSuccess(connection: Connection) { | ||
controller.close(); | ||
const url = getDatabasePageUrl(connection.id); | ||
router.goto(url); | ||
} | ||
</script> | ||
|
||
<ControlledModal | ||
{controller} | ||
size="large" | ||
title={$_('new_postgresql_database_connection')} | ||
> | ||
<AddConnection onExit={() => controller.close()} /> | ||
<AddConnection onCancel={handleCancel} onSuccess={handleSuccess} /> | ||
</ControlledModal> |