-
-
Notifications
You must be signed in to change notification settings - Fork 315
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
Db connection UI #3223
Merged
Merged
Db connection UI #3223
Changes from 18 commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
0bb7d38
add database connection page
rajatvijay e401e9f
edit database connection
rajatvijay 5110a40
delete database connection
rajatvijay ad09ba3
lint fixes
rajatvijay 7819bdd
Merge branch 'develop' of github.com:centerofci/mathesar into db-conn…
rajatvijay 62b4ee4
add db connection button on the admin pages
rajatvijay e7a9d1c
database connection list page & rounting
rajatvijay 19c845e
Merge branch 'db_config_api' of github.com:centerofci/mathesar into d…
rajatvijay 9b6c339
Merge branch 'db_config_api' of github.com:centerofci/mathesar into d…
rajatvijay cce8e0c
renamed user form component
rajatvijay 10d814f
no database found component
rajatvijay 6e80ec9
database connection error ui
rajatvijay 7c12f77
renamed connections list vars
rajatvijay fea9634
lint fixes
rajatvijay 8c194d4
user flow bug fixes
rajatvijay 1043ca4
Merge branch 'db_config_api' of github.com:centerofci/mathesar into d…
rajatvijay 070bd90
lint fixes
rajatvijay 668f922
removed todos
rajatvijay a8424f7
bring back old todo
rajatvijay 25c5b24
Merge branch 'develop' into db-connection-pages
pavish 1d768c3
removed instaces of successfullDatabases
rajatvijay 9781a7e
Merge branch 'db-connection-pages' of github.com:centerofci/mathesar …
rajatvijay a94015d
fixed formatting
rajatvijay 5eb453f
loader while reloading the db
rajatvijay ddb942b
placeholder for links
rajatvijay 0fa711d
created database utils
rajatvijay 41853f3
created database utils
rajatvijay 1967ee1
moved isMatch out of parent function
rajatvijay d4b4813
lint fixes
rajatvijay 810f49f
database store to have done as initial state
rajatvijay ef901b6
regression fix on users flow
rajatvijay d1353b4
regression fix on users flow
rajatvijay bd018fb
Merge branch 'db-connection-pages' of github.com:centerofci/mathesar …
rajatvijay ce24035
connections list ui fixes
rajatvijay fe6c7b6
no condition on schema page on connection error
rajatvijay e590725
disconnect database flow ux fixes
rajatvijay 60b53e5
lint fixes
rajatvijay 3edd094
Merge branch 'develop' into db-connection-pages
rajatvijay cb08572
fixes related to review comments
rajatvijay 8028323
Merge branch 'develop' into db-connection-pages
seancolsen File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
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
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
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import type { SuccessfullyConnectedDatabase } from '@mathesar/AppTypes'; | ||
import { deleteAPI, patchAPI, postAPI } from './utils/requestUtils'; | ||
|
||
export interface NewConnection { | ||
name: string; | ||
db_name: string; | ||
username: string; | ||
host: string; | ||
port: string; | ||
password: string; | ||
} | ||
|
||
export type ConnectionUpdates = Partial<Omit<NewConnection, 'name'>>; | ||
|
||
function add(connectionDetails: NewConnection) { | ||
return postAPI<SuccessfullyConnectedDatabase>( | ||
'/api/db/v0/databases/', | ||
connectionDetails, | ||
); | ||
} | ||
|
||
function update(databaseId: number, updates: ConnectionUpdates) { | ||
return patchAPI<SuccessfullyConnectedDatabase>( | ||
`/api/db/v0/databases/${databaseId}/`, | ||
updates, | ||
); | ||
} | ||
|
||
function deleteConnection(databaseId: number, removeMathesarSchemas = false) { | ||
const param = removeMathesarSchemas ? '?del_msar_schemas=True' : ''; | ||
return deleteAPI(`/api/db/v0/databases/${databaseId}/${param}`); | ||
} | ||
|
||
export default { | ||
add, | ||
update, | ||
delete: deleteConnection, | ||
}; |
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
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
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
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
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
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
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
File renamed without changes.
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
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Anish9901 added attributes here required when editing