PR Feedback
This commit is contained in:
parent
14ae38982e
commit
4fd9d2262e
|
@ -9,7 +9,7 @@
|
||||||
} from "builderStore/dataBinding"
|
} from "builderStore/dataBinding"
|
||||||
import { currentAsset } from "builderStore"
|
import { currentAsset } from "builderStore"
|
||||||
import DraggableList from "../DraggableList/DraggableList.svelte"
|
import DraggableList from "../DraggableList/DraggableList.svelte"
|
||||||
import { createEventDispatcher, getContext } from "svelte"
|
import { createEventDispatcher } from "svelte"
|
||||||
import { store, selectedScreen } from "builderStore"
|
import { store, selectedScreen } from "builderStore"
|
||||||
import FieldSetting from "./FieldSetting.svelte"
|
import FieldSetting from "./FieldSetting.svelte"
|
||||||
import { convertOldFieldFormat, getComponentForField } from "./utils"
|
import { convertOldFieldFormat, getComponentForField } from "./utils"
|
||||||
|
@ -17,8 +17,6 @@
|
||||||
export let componentInstance
|
export let componentInstance
|
||||||
export let value
|
export let value
|
||||||
|
|
||||||
const updates = getContext("settings")
|
|
||||||
|
|
||||||
const dispatch = createEventDispatcher()
|
const dispatch = createEventDispatcher()
|
||||||
let sanitisedFields
|
let sanitisedFields
|
||||||
let fieldList
|
let fieldList
|
||||||
|
@ -29,7 +27,6 @@
|
||||||
let unconfigured
|
let unconfigured
|
||||||
|
|
||||||
let selectAll = true
|
let selectAll = true
|
||||||
let updating = false
|
|
||||||
|
|
||||||
$: bindings = getBindableProperties($selectedScreen, componentInstance._id)
|
$: bindings = getBindableProperties($selectedScreen, componentInstance._id)
|
||||||
$: actionType = componentInstance.actionType
|
$: actionType = componentInstance.actionType
|
||||||
|
@ -49,10 +46,6 @@
|
||||||
cachedValue = cloneDeep(value)
|
cachedValue = cloneDeep(value)
|
||||||
}
|
}
|
||||||
|
|
||||||
$: if (typeof $updates.resp == "string") {
|
|
||||||
updating = false
|
|
||||||
}
|
|
||||||
|
|
||||||
const updateState = value => {
|
const updateState = value => {
|
||||||
schema = getSchema($currentAsset, datasource)
|
schema = getSchema($currentAsset, datasource)
|
||||||
options = Object.keys(schema || {})
|
options = Object.keys(schema || {})
|
||||||
|
@ -161,7 +154,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
const toggleAll = update => {
|
const toggleAll = update => {
|
||||||
updating = true
|
|
||||||
listUpdated(update)
|
listUpdated(update)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -180,7 +172,6 @@
|
||||||
text=""
|
text=""
|
||||||
bind:value={selectAll}
|
bind:value={selectAll}
|
||||||
thin
|
thin
|
||||||
disabled={updating}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{#if fieldList?.length}
|
{#if fieldList?.length}
|
||||||
|
@ -193,9 +184,7 @@
|
||||||
listTypeProps={{
|
listTypeProps={{
|
||||||
componentBindings,
|
componentBindings,
|
||||||
bindings,
|
bindings,
|
||||||
updating,
|
|
||||||
}}
|
}}
|
||||||
draggable={!updating}
|
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
import { getComponentForSetting } from "components/design/settings/componentSettings"
|
import { getComponentForSetting } from "components/design/settings/componentSettings"
|
||||||
import InfoDisplay from "./InfoDisplay.svelte"
|
import InfoDisplay from "./InfoDisplay.svelte"
|
||||||
import analytics, { Events } from "analytics"
|
import analytics, { Events } from "analytics"
|
||||||
import { setContext } from "svelte"
|
|
||||||
import { writable } from "svelte/store"
|
|
||||||
|
|
||||||
export let componentDefinition
|
export let componentDefinition
|
||||||
export let componentInstance
|
export let componentInstance
|
||||||
|
@ -21,21 +19,6 @@
|
||||||
export let includeHidden = false
|
export let includeHidden = false
|
||||||
export let tag
|
export let tag
|
||||||
|
|
||||||
let status = writable({
|
|
||||||
status: null,
|
|
||||||
lastUpdate: null,
|
|
||||||
})
|
|
||||||
|
|
||||||
const updateStatus = resp => {
|
|
||||||
status.update(state => ({
|
|
||||||
...state,
|
|
||||||
resp,
|
|
||||||
lastUpdate: new Date().getTime(),
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
|
|
||||||
setContext("settings", status)
|
|
||||||
|
|
||||||
$: sections = getSections(
|
$: sections = getSections(
|
||||||
componentInstance,
|
componentInstance,
|
||||||
componentDefinition,
|
componentDefinition,
|
||||||
|
@ -93,7 +76,6 @@
|
||||||
} else {
|
} else {
|
||||||
await store.actions.components.updateSetting(setting.key, value)
|
await store.actions.components.updateSetting(setting.key, value)
|
||||||
}
|
}
|
||||||
updateStatus("success")
|
|
||||||
// Send event if required
|
// Send event if required
|
||||||
if (setting.sendEvents) {
|
if (setting.sendEvents) {
|
||||||
analytics.captureEvent(Events.COMPONENT_UPDATED, {
|
analytics.captureEvent(Events.COMPONENT_UPDATED, {
|
||||||
|
@ -103,7 +85,6 @@
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
updateStatus("failed")
|
|
||||||
notifications.error("Error updating component prop")
|
notifications.error("Error updating component prop")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue