PR Feedback
This commit is contained in:
parent
601a855f13
commit
6b36b8824e
|
@ -31,16 +31,9 @@
|
||||||
config: get(configStore).config,
|
config: get(configStore).config,
|
||||||
name: get(nameStore).name,
|
name: get(nameStore).name,
|
||||||
})
|
})
|
||||||
} else {
|
|
||||||
notifications.send("Invalid fields", {
|
|
||||||
type: "error",
|
|
||||||
icon: "Alert",
|
|
||||||
autoDismiss: true,
|
|
||||||
})
|
|
||||||
|
|
||||||
// Prevent modal closing
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
let createVariableModal
|
let createVariableModal
|
||||||
|
|
|
@ -66,7 +66,7 @@
|
||||||
})
|
})
|
||||||
store.setDatasource(datasource)
|
store.setDatasource(datasource)
|
||||||
|
|
||||||
notifications.success("Datasource created successfully.")
|
notifications.success("Datasource created successfully")
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
notifications.error(`Error creating datasource: ${e.message}`)
|
notifications.error(`Error creating datasource: ${e.message}`)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<script>
|
<script>
|
||||||
import { Modal, notifications } from "@budibase/bbui"
|
import { Modal, notifications } from "@budibase/bbui"
|
||||||
import { integrationForDatasource } from "stores/selectors"
|
import { integrationForDatasource } from "stores/selectors"
|
||||||
import { datasources, integrations, tables } from "stores/backend"
|
import { datasources, integrations } from "stores/backend"
|
||||||
import DatasourceConfigEditor from "components/backend/Datasources/ConfigEditor/index.svelte"
|
import DatasourceConfigEditor from "components/backend/Datasources/ConfigEditor/index.svelte"
|
||||||
import EditDatasourceConfigButton from "./EditDatasourceConfigButton.svelte"
|
import EditDatasourceConfigButton from "./EditDatasourceConfigButton.svelte"
|
||||||
|
|
||||||
|
@ -18,14 +18,8 @@
|
||||||
datasource: { ...datasource, config, name },
|
datasource: { ...datasource, config, name },
|
||||||
})
|
})
|
||||||
|
|
||||||
if (datasource?.plus) {
|
|
||||||
await tables.fetch()
|
|
||||||
}
|
|
||||||
|
|
||||||
await datasources.fetch()
|
|
||||||
|
|
||||||
notifications.success(
|
notifications.success(
|
||||||
`Datasource ${datasource.name} updated successfully.`
|
`Datasource ${datasource.name} updated successfully`
|
||||||
)
|
)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
notifications.error(err?.message ?? "Error saving datasource")
|
notifications.error(err?.message ?? "Error saving datasource")
|
||||||
|
|
|
@ -92,7 +92,6 @@ export function createDatasourcesStore() {
|
||||||
const isDatasourceInvalid = async (integration, datasource) => {
|
const isDatasourceInvalid = async (integration, datasource) => {
|
||||||
if (integration.features?.[DatasourceFeature.CONNECTION_CHECKING]) {
|
if (integration.features?.[DatasourceFeature.CONNECTION_CHECKING]) {
|
||||||
const { connected } = await API.validateDatasource(datasource)
|
const { connected } = await API.validateDatasource(datasource)
|
||||||
console.log(connected)
|
|
||||||
if (!connected) return true
|
if (!connected) return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,7 +121,6 @@ export function createDatasourcesStore() {
|
||||||
}
|
}
|
||||||
|
|
||||||
const update = async ({ integration, datasource }) => {
|
const update = async ({ integration, datasource }) => {
|
||||||
console.log(integration, datasource)
|
|
||||||
if (await isDatasourceInvalid(integration, datasource)) {
|
if (await isDatasourceInvalid(integration, datasource)) {
|
||||||
throw new Error("Unable to connect")
|
throw new Error("Unable to connect")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue