Browse Source

Fix placement of 'reset fields' button for field groups

master
Andrew Kingston 5 years ago
parent
commit
be37720dc5
  1. 4
      packages/builder/src/components/design/PropertiesPanel/ComponentSettingsSection.svelte
  2. 2
      packages/builder/src/components/design/PropertiesPanel/PropertiesPanel.svelte
  3. 5
      packages/builder/src/components/design/PropertiesPanel/PropertyControls/ResetFieldsButton.svelte

4
packages/builder/src/components/design/PropertiesPanel/ComponentSettingsSection.svelte

@ -30,6 +30,7 @@
import DateTimeFieldSelect from "./PropertyControls/DateTimeFieldSelect.svelte" import DateTimeFieldSelect from "./PropertyControls/DateTimeFieldSelect.svelte"
import AttachmentFieldSelect from "./PropertyControls/AttachmentFieldSelect.svelte" import AttachmentFieldSelect from "./PropertyControls/AttachmentFieldSelect.svelte"
import RelationshipFieldSelect from "./PropertyControls/RelationshipFieldSelect.svelte" import RelationshipFieldSelect from "./PropertyControls/RelationshipFieldSelect.svelte"
import ResetFieldsButton from "./PropertyControls/ResetFieldsButton.svelte"
export let componentDefinition export let componentDefinition
export let componentInstance export let componentInstance
@ -122,6 +123,9 @@
{/if} {/if}
{/each} {/each}
{/if} {/if}
{#if componentDefinition?.component?.endsWith("/fieldgroup")}
<ResetFieldsButton {componentInstance} />
{/if}
{#if componentDefinition?.info} {#if componentDefinition?.info}
<div class="text"> <div class="text">
{@html componentDefinition?.info} {@html componentDefinition?.info}

2
packages/builder/src/components/design/PropertiesPanel/PropertiesPanel.svelte

@ -5,7 +5,6 @@
import ComponentSettingsSection from "./ComponentSettingsSection.svelte" import ComponentSettingsSection from "./ComponentSettingsSection.svelte"
import DesignSection from "./DesignSection.svelte" import DesignSection from "./DesignSection.svelte"
import CustomStylesSection from "./CustomStylesSection.svelte" import CustomStylesSection from "./CustomStylesSection.svelte"
import ActionsSection from "./ActionsSection.svelte"
$: componentInstance = $selectedComponent $: componentInstance = $selectedComponent
$: componentDefinition = store.actions.components.getDefinition( $: componentDefinition = store.actions.components.getDefinition(
@ -20,7 +19,6 @@
<ComponentSettingsSection {componentInstance} {componentDefinition} /> <ComponentSettingsSection {componentInstance} {componentDefinition} />
<DesignSection {componentInstance} {componentDefinition} /> <DesignSection {componentInstance} {componentDefinition} />
<CustomStylesSection {componentInstance} {componentDefinition} /> <CustomStylesSection {componentInstance} {componentDefinition} />
<ActionsSection {componentInstance} {componentDefinition} />
</div> </div>
</Tab> </Tab>
</Tabs> </Tabs>

5
packages/builder/src/components/design/PropertiesPanel/ActionsSection.svelte → packages/builder/src/components/design/PropertiesPanel/PropertyControls/ResetFieldsButton.svelte

@ -5,7 +5,6 @@
import { makeDatasourceFormComponents } from "builderStore/store/screenTemplates/utils/commonComponents" import { makeDatasourceFormComponents } from "builderStore/store/screenTemplates/utils/commonComponents"
import ConfirmDialog from "components/common/ConfirmDialog.svelte" import ConfirmDialog from "components/common/ConfirmDialog.svelte"
export let componentDefinition
export let componentInstance export let componentInstance
let confirmResetFieldsDialog let confirmResetFieldsDialog
@ -25,7 +24,7 @@
} }
</script> </script>
{#if componentDefinition?.component?.endsWith("/fieldgroup")} <div>
<ActionButton <ActionButton
secondary secondary
wide wide
@ -33,7 +32,7 @@
> >
Update form fields Update form fields
</ActionButton> </ActionButton>
{/if} </div>
<ConfirmDialog <ConfirmDialog
bind:this={confirmResetFieldsDialog} bind:this={confirmResetFieldsDialog}
Loading…
Cancel
Save