Bug fix for unable to navigate from sql screen
This commit is contained in:
parent
73ea7a8032
commit
c3a6e13103
|
@ -9,7 +9,6 @@
|
||||||
import ICONS from "components/backend/DatasourceNavigator/icons"
|
import ICONS from "components/backend/DatasourceNavigator/icons"
|
||||||
import { capitalise } from "helpers"
|
import { capitalise } from "helpers"
|
||||||
|
|
||||||
let unsaved = false
|
|
||||||
let relationshipModal
|
let relationshipModal
|
||||||
let displayColumnModal
|
let displayColumnModal
|
||||||
let selectedFromRelationship, selectedToRelationship
|
let selectedFromRelationship, selectedToRelationship
|
||||||
|
@ -71,7 +70,6 @@
|
||||||
// Create datasource
|
// Create datasource
|
||||||
await datasources.save(datasource)
|
await datasources.save(datasource)
|
||||||
notifications.success(`Datasource ${name} updated successfully.`)
|
notifications.success(`Datasource ${name} updated successfully.`)
|
||||||
unsaved = false
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
notifications.error(`Error saving datasource: ${err}`)
|
notifications.error(`Error saving datasource: ${err}`)
|
||||||
}
|
}
|
||||||
|
@ -81,7 +79,6 @@
|
||||||
try {
|
try {
|
||||||
await datasources.updateSchema(datasource)
|
await datasources.updateSchema(datasource)
|
||||||
notifications.success(`Datasource ${name} tables updated successfully.`)
|
notifications.success(`Datasource ${name} tables updated successfully.`)
|
||||||
unsaved = false
|
|
||||||
await tables.fetch()
|
await tables.fetch()
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
notifications.error(`Error updating datasource schema: ${err}`)
|
notifications.error(`Error updating datasource schema: ${err}`)
|
||||||
|
@ -98,10 +95,6 @@
|
||||||
$goto(`../../table/${table._id}`)
|
$goto(`../../table/${table._id}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
function setUnsaved() {
|
|
||||||
unsaved = true
|
|
||||||
}
|
|
||||||
|
|
||||||
function openRelationshipModal(fromRelationship, toRelationship) {
|
function openRelationshipModal(fromRelationship, toRelationship) {
|
||||||
selectedFromRelationship = fromRelationship || {}
|
selectedFromRelationship = fromRelationship || {}
|
||||||
selectedToRelationship = toRelationship || {}
|
selectedToRelationship = toRelationship || {}
|
||||||
|
@ -111,16 +104,6 @@
|
||||||
function openDisplayColumnModal() {
|
function openDisplayColumnModal() {
|
||||||
displayColumnModal.show()
|
displayColumnModal.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
$beforeUrlChange(() => {
|
|
||||||
if (unsaved) {
|
|
||||||
notifications.error(
|
|
||||||
"Unsaved changes. Please save your datasource configuration before leaving."
|
|
||||||
)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Modal bind:this={relationshipModal}>
|
<Modal bind:this={relationshipModal}>
|
||||||
|
@ -164,7 +147,6 @@
|
||||||
<IntegrationConfigForm
|
<IntegrationConfigForm
|
||||||
schema={integration.datasource}
|
schema={integration.datasource}
|
||||||
integration={datasource.config}
|
integration={datasource.config}
|
||||||
on:change={setUnsaved}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{#if datasource.plus}
|
{#if datasource.plus}
|
||||||
|
|
Loading…
Reference in New Issue