Flip datasource and baseDatsource to not update store directly
This commit is contained in:
parent
26abf39b76
commit
7337ae6f67
|
@ -23,20 +23,23 @@
|
||||||
import ImportRestQueriesModal from "components/backend/DatasourceNavigator/modals/ImportRestQueriesModal.svelte"
|
import ImportRestQueriesModal from "components/backend/DatasourceNavigator/modals/ImportRestQueriesModal.svelte"
|
||||||
let importQueriesModal
|
let importQueriesModal
|
||||||
|
|
||||||
let baseDatasource, changed
|
let changed
|
||||||
const querySchema = {
|
const querySchema = {
|
||||||
name: {},
|
name: {},
|
||||||
queryVerb: { displayName: "Method" },
|
queryVerb: { displayName: "Method" },
|
||||||
}
|
}
|
||||||
|
|
||||||
$: datasource = $datasources.list.find(ds => ds._id === $datasources.selected)
|
$: baseDatasource = $datasources.list.find(
|
||||||
|
ds => ds._id === $datasources.selected
|
||||||
|
)
|
||||||
|
$: datasource = cloneDeep(datasource)
|
||||||
$: integration = datasource && $integrations[datasource.source]
|
$: integration = datasource && $integrations[datasource.source]
|
||||||
$: {
|
$: {
|
||||||
if (
|
if (
|
||||||
datasource &&
|
baseDatasource &&
|
||||||
(!baseDatasource || baseDatasource.source !== datasource.source)
|
(!datasource || datasource.source !== baseDatasource.source)
|
||||||
) {
|
) {
|
||||||
baseDatasource = cloneDeep(datasource)
|
datasource = cloneDeep(baseDatasource)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$: queryList = $queries.list.filter(
|
$: queryList = $queries.list.filter(
|
||||||
|
@ -90,7 +93,7 @@
|
||||||
height="26"
|
height="26"
|
||||||
width="26"
|
width="26"
|
||||||
/>
|
/>
|
||||||
<Heading size="M">{baseDatasource.name}</Heading>
|
<Heading size="M">{datasource.name}</Heading>
|
||||||
</header>
|
</header>
|
||||||
<Body size="M">{integration.description}</Body>
|
<Body size="M">{integration.description}</Body>
|
||||||
</Layout>
|
</Layout>
|
||||||
|
|
Loading…
Reference in New Issue