From 4086d3953515892befb63c51b262628d9edf8d5b Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Tue, 4 May 2021 11:49:34 +0100 Subject: [PATCH] merge with next --- .../bbui/src/ButtonGroup/ButtonGroup.svelte | 4 -- packages/bbui/src/Form/Checkbox.svelte | 2 +- packages/bbui/src/Form/Combobox.svelte | 6 +-- packages/bbui/src/Form/Core/Checkbox.svelte | 2 +- packages/bbui/src/Form/Core/Combobox.svelte | 10 ++--- packages/bbui/src/Form/Core/DatePicker.svelte | 6 +-- packages/bbui/src/Form/Core/Dropzone.svelte | 4 +- .../bbui/src/Form/Core/Multiselect.svelte | 18 ++++----- packages/bbui/src/Form/Core/Picker.svelte | 6 +-- packages/bbui/src/Form/Core/RadioGroup.svelte | 6 +-- packages/bbui/src/Form/Core/Search.svelte | 6 +-- packages/bbui/src/Form/Core/Select.svelte | 10 ++--- packages/bbui/src/Form/Core/Switch.svelte | 2 +- packages/bbui/src/Form/Core/TextArea.svelte | 10 ++--- packages/bbui/src/Form/Core/TextField.svelte | 6 +-- packages/bbui/src/Form/DatePicker.svelte | 2 +- packages/bbui/src/Form/Dropzone.svelte | 2 +- packages/bbui/src/Form/Input.svelte | 2 +- packages/bbui/src/Form/Multiselect.svelte | 6 +-- packages/bbui/src/Form/RadioGroup.svelte | 6 +-- packages/bbui/src/Form/Search.svelte | 2 +- packages/bbui/src/Form/Select.svelte | 6 +-- packages/bbui/src/Form/TextArea.svelte | 2 +- packages/bbui/src/Form/Toggle.svelte | 2 +- .../bbui/src/Table/AttachmentRenderer.svelte | 2 +- packages/bbui/src/Table/CellRenderer.svelte | 2 +- .../src/Table/RelationshipRenderer.svelte | 2 +- packages/bbui/src/Table/Table.svelte | 20 ++++------ .../AutomationBuilder.svelte | 2 +- .../AutomationBuilder/BlockList.svelte | 2 +- .../FlowChart/AutomationBlockTagline.svelte | 6 +-- .../FlowChart/FlowItem.svelte | 8 +--- .../SetupPanel/AutomationBlockSetup.svelte | 37 +------------------ .../SetupPanel/QueryParamSelector.svelte | 4 +- .../automation/SetupPanel/RowSelector.svelte | 9 +---- .../automation/SetupPanel/SchemaSetup.svelte | 14 +++---- .../SetupPanel/TableSelector.svelte | 5 --- .../backend/DataTable/DataTable.svelte | 2 +- .../DataTable/RelationshipDataTable.svelte | 4 +- .../backend/DataTable/ViewDataTable.svelte | 4 +- .../backend/DataTable/cells/RoleCell.svelte | 2 +- .../DataTable/modals/CalculateModal.svelte | 7 +--- .../DataTable/modals/CreateEditColumn.svelte | 28 ++------------ .../DataTable/modals/CreateEditRow.svelte | 2 +- .../DataTable/modals/CreateEditUser.svelte | 18 ++------- .../DataTable/modals/CreateViewModal.svelte | 2 +- .../backend/DataTable/modals/EditRoles.svelte | 23 ++---------- .../DataTable/modals/ExportModal.svelte | 5 --- .../DataTable/modals/GroupByModal.svelte | 2 +- .../modals/CreateDatasourceModal.svelte | 4 +- .../TableNavigator/TableDataImport.svelte | 13 ++----- .../modals/CreateTableModal.svelte | 8 ++-- .../common/LinkedRowSelector.svelte | 13 +------ .../src/components/common/ValuesList.svelte | 2 +- .../CreateWebhookDeploymentModal.svelte | 2 +- .../deploy/DeploymentHistory.svelte | 4 +- .../AppPreview/ComponentSelectionList.svelte | 4 +- .../ComponentTree.svelte | 8 ++-- .../ComponentNavigationTree/index.svelte | 2 +- .../NavigationPanel/NewScreenModal.svelte | 17 ++------- .../design/PropertiesPanel/CategoryTab.svelte | 2 +- .../design/PropertiesPanel/DesignView.svelte | 6 +-- .../PropertiesPanel/PropertiesPanel.svelte | 2 +- .../PropertyControls/ColorPicker.svelte | 2 +- .../DataProviderSelect.svelte | 7 +--- .../PropertyControls/DataSourceSelect.svelte | 22 ++++------- .../EventsEditor/actions/DeleteRow.svelte | 13 ------- .../EventsEditor/actions/LogIn.svelte | 8 ---- .../EventsEditor/actions/NavigateTo.svelte | 4 -- .../actions/TriggerAutomation.svelte | 13 ++----- .../EventsEditor/actions/ValidateForm.svelte | 5 --- .../PropertyControls/FieldSelect.svelte | 4 -- .../FlatButtonGroup/FlatButtonGroup.svelte | 6 +-- .../PropertyControls/FormFieldSelect.svelte | 6 +-- .../IconSelect/IconSelect.svelte | 4 +- .../PropertyControls/LayoutSelect.svelte | 5 --- .../PropertyControls/MultiFieldSelect.svelte | 4 +- .../PropertyControls/PropertyGroup.svelte | 8 +--- .../PropertyControls/RoleSelect.svelte | 5 --- .../components/settings/tabs/APIKeys.svelte | 4 -- .../settings/tabs/DangerZone.svelte | 2 +- .../components/settings/tabs/General.svelte | 8 ++-- .../pages/builder/[application]/_reset.svelte | 8 ++-- .../automate/[automation]/_layout.svelte | 2 +- .../builder/[application]/data/_layout.svelte | 2 +- .../[query]/_layout.svelte | 2 +- .../[selectedDatasource]/[query]/index.svelte | 2 +- .../[selectedDatasource]/_layout.svelte | 2 +- .../data/table/[selectedTable]/_layout.svelte | 2 +- .../design/[assetType]/_layout.svelte | 6 +-- .../design/[assetType]/index.svelte | 8 ++-- packages/builder/yarn.lock | 8 ++-- .../client/src/components/Component.svelte | 4 +- packages/client/src/components/Router.svelte | 4 +- packages/server/src/api/index.js | 10 ----- .../src/DataProvider.svelte | 6 +-- .../src/charts/BarChart.svelte | 22 ----------- .../src/charts/CandleStickChart.svelte | 14 +++---- .../src/charts/LineChart.svelte | 16 ++++---- .../src/charts/PieChart.svelte | 8 ++-- .../src/forms/AttachmentField.svelte | 6 +-- .../src/forms/BooleanField.svelte | 4 -- .../src/forms/DateTimeField.svelte | 2 +- .../standard-components/src/forms/Form.svelte | 12 +++--- .../src/forms/LongFormField.svelte | 2 +- .../src/forms/OptionsField.svelte | 4 -- .../src/forms/RelationshipField.svelte | 20 ++++------ .../src/forms/StringField.svelte | 2 +- .../src/table/Table.svelte | 4 +- packages/standard-components/yarn.lock | 8 ++-- 110 files changed, 239 insertions(+), 508 deletions(-) diff --git a/packages/bbui/src/ButtonGroup/ButtonGroup.svelte b/packages/bbui/src/ButtonGroup/ButtonGroup.svelte index e299f085ca..b845a770e1 100644 --- a/packages/bbui/src/ButtonGroup/ButtonGroup.svelte +++ b/packages/bbui/src/ButtonGroup/ButtonGroup.svelte @@ -4,11 +4,7 @@ function group(element) { const buttons = Array.from(element.getElementsByTagName("button")) -<<<<<<< HEAD - buttons.forEach((button) => { -======= buttons.forEach(button => { ->>>>>>> 900637c221e4034babd21d69dcaa71b360a2adb2 button.classList.add("spectrum-ButtonGroup-item") }) } diff --git a/packages/bbui/src/Form/Checkbox.svelte b/packages/bbui/src/Form/Checkbox.svelte index c8d473e7c8..1f3e439c2a 100644 --- a/packages/bbui/src/Form/Checkbox.svelte +++ b/packages/bbui/src/Form/Checkbox.svelte @@ -11,7 +11,7 @@ export let error = null const dispatch = createEventDispatcher() - const onChange = (e) => { + const onChange = e => { value = e.detail dispatch("change", e.detail) } diff --git a/packages/bbui/src/Form/Combobox.svelte b/packages/bbui/src/Form/Combobox.svelte index 4926ef1f18..e08e609732 100644 --- a/packages/bbui/src/Form/Combobox.svelte +++ b/packages/bbui/src/Form/Combobox.svelte @@ -10,11 +10,11 @@ export let error = null export let placeholder = "Choose an option" export let options = [] - export let getOptionLabel = (option) => extractProperty(option, "label") - export let getOptionValue = (option) => extractProperty(option, "value") + export let getOptionLabel = option => extractProperty(option, "label") + export let getOptionValue = option => extractProperty(option, "value") const dispatch = createEventDispatcher() - const onChange = (e) => { + const onChange = e => { value = e.detail dispatch("change", e.detail) } diff --git a/packages/bbui/src/Form/Core/Checkbox.svelte b/packages/bbui/src/Form/Core/Checkbox.svelte index 510a67a185..7d564d2a9d 100644 --- a/packages/bbui/src/Form/Core/Checkbox.svelte +++ b/packages/bbui/src/Form/Core/Checkbox.svelte @@ -10,7 +10,7 @@ export let disabled = false const dispatch = createEventDispatcher() - const onChange = (event) => { + const onChange = event => { dispatch("change", event.target.checked) } diff --git a/packages/bbui/src/Form/Core/Combobox.svelte b/packages/bbui/src/Form/Core/Combobox.svelte index 1d1df810d9..1bce8ba3c4 100644 --- a/packages/bbui/src/Form/Core/Combobox.svelte +++ b/packages/bbui/src/Form/Core/Combobox.svelte @@ -11,8 +11,8 @@ export let disabled = false export let error = null export let options = [] - export let getOptionLabel = (option) => option - export let getOptionValue = (option) => option + export let getOptionLabel = option => option + export let getOptionValue = option => option const dispatch = createEventDispatcher() let open = false @@ -31,16 +31,16 @@ } // Render the label if the selected option is found, otherwise raw value - const selected = options.find((option) => getOptionValue(option) === value) + const selected = options.find(option => getOptionValue(option) === value) return selected ? getOptionLabel(selected) : value } - const selectOption = (value) => { + const selectOption = value => { dispatch("change", value) open = false } - const onChange = (e) => { + const onChange = e => { selectOption(e.target.value) } diff --git a/packages/bbui/src/Form/Core/DatePicker.svelte b/packages/bbui/src/Form/Core/DatePicker.svelte index 1b57e55b27..f76e42a55a 100644 --- a/packages/bbui/src/Form/Core/DatePicker.svelte +++ b/packages/bbui/src/Form/Core/DatePicker.svelte @@ -27,12 +27,12 @@ wrap: true, } - const handleChange = (event) => { + const handleChange = event => { const [dates] = event.detail dispatch("change", dates[0]) } - const clearDateOnBackspace = (event) => { + const clearDateOnBackspace = event => { if (["Backspace", "Clear", "Delete"].includes(event.key)) { dispatch("change", null) flatpickr.close() @@ -53,7 +53,7 @@ // We need to blur both because the focus styling does not get properly // applied. const els = document.querySelectorAll(`#${flatpickrId} input`) - els.forEach((el) => el.blur()) + els.forEach(el => el.blur()) } diff --git a/packages/bbui/src/Form/Core/Dropzone.svelte b/packages/bbui/src/Form/Core/Dropzone.svelte index 77099b09a4..9dd2cbbc73 100644 --- a/packages/bbui/src/Form/Core/Dropzone.svelte +++ b/packages/bbui/src/Form/Core/Dropzone.svelte @@ -28,7 +28,7 @@ "bmp", "jfif", ] - const onChange = (event) => { + const onChange = event => { dispatch("change", event.target.checked) } @@ -42,7 +42,7 @@ async function processFileList(fileList) { if ( handleFileTooLarge && - Array.from(fileList).some((file) => file.size >= fileSizeLimit) + Array.from(fileList).some(file => file.size >= fileSizeLimit) ) { handleFileTooLarge(fileSizeLimit, value) return diff --git a/packages/bbui/src/Form/Core/Multiselect.svelte b/packages/bbui/src/Form/Core/Multiselect.svelte index 46ec5d9157..d659a63582 100644 --- a/packages/bbui/src/Form/Core/Multiselect.svelte +++ b/packages/bbui/src/Form/Core/Multiselect.svelte @@ -8,14 +8,14 @@ export let disabled = false export let error = null export let options = [] - export let getOptionLabel = (option) => option - export let getOptionValue = (option) => option + export let getOptionLabel = option => option + export let getOptionValue = option => option const dispatch = createEventDispatcher() $: selectedLookupMap = getSelectedLookupMap(value) $: optionLookupMap = getOptionLookupMap(options) $: fieldText = getFieldText(value, optionLookupMap, placeholder) - $: isOptionSelected = (optionValue) => selectedLookupMap[optionValue] === true + $: isOptionSelected = optionValue => selectedLookupMap[optionValue] === true $: toggleOption = makeToggleOption(selectedLookupMap, value) const getFieldText = (value, map, placeholder) => { @@ -23,17 +23,17 @@ if (!map) { return "" } - const vals = value.map((option) => map[option] || option).join(", ") + const vals = value.map(option => map[option] || option).join(", ") return `(${value.length}) ${vals}` } else { return placeholder || "Choose some options" } } - const getSelectedLookupMap = (value) => { + const getSelectedLookupMap = value => { let map = {} if (value?.length) { - value.forEach((option) => { + value.forEach(option => { if (option) { map[option] = true } @@ -42,7 +42,7 @@ return map } - const getOptionLookupMap = (options) => { + const getOptionLookupMap = options => { let map = null if (options?.length) { map = {} @@ -57,9 +57,9 @@ } const makeToggleOption = (map, value) => { - return (optionValue) => { + return optionValue => { if (map[optionValue]) { - const filtered = value.filter((option) => option !== optionValue) + const filtered = value.filter(option => option !== optionValue) dispatch("change", filtered) } else { dispatch("change", [...value, optionValue]) diff --git a/packages/bbui/src/Form/Core/Picker.svelte b/packages/bbui/src/Form/Core/Picker.svelte index 3911eee306..05fb196064 100644 --- a/packages/bbui/src/Form/Core/Picker.svelte +++ b/packages/bbui/src/Form/Core/Picker.svelte @@ -15,13 +15,13 @@ export let options = [] export let isOptionSelected = () => false export let onSelectOption = () => {} - export let getOptionLabel = (option) => option - export let getOptionValue = (option) => option + export let getOptionLabel = option => option + export let getOptionValue = option => option export let open = false export let readonly = false const dispatch = createEventDispatcher() - const onClick = (e) => { + const onClick = e => { dispatch("click") if (readonly) { return diff --git a/packages/bbui/src/Form/Core/RadioGroup.svelte b/packages/bbui/src/Form/Core/RadioGroup.svelte index b29d39c017..4ead9ed311 100644 --- a/packages/bbui/src/Form/Core/RadioGroup.svelte +++ b/packages/bbui/src/Form/Core/RadioGroup.svelte @@ -8,11 +8,11 @@ export let options = [] export let error = null export let disabled = false - export let getOptionLabel = (option) => option - export let getOptionValue = (option) => option + export let getOptionLabel = option => option + export let getOptionValue = option => option const dispatch = createEventDispatcher() - const onChange = (e) => dispatch("change", e.target.value) + const onChange = e => dispatch("change", e.target.value)
diff --git a/packages/bbui/src/Form/Core/Search.svelte b/packages/bbui/src/Form/Core/Search.svelte index 9ffba779e4..dbc8582ac3 100644 --- a/packages/bbui/src/Form/Core/Search.svelte +++ b/packages/bbui/src/Form/Core/Search.svelte @@ -10,7 +10,7 @@ const dispatch = createEventDispatcher() let focus = false - const updateValue = (value) => { + const updateValue = value => { dispatch("change", value) } @@ -18,12 +18,12 @@ focus = true } - const onBlur = (event) => { + const onBlur = event => { focus = false updateValue(event.target.value) } - const updateValueOnEnter = (event) => { + const updateValueOnEnter = event => { if (event.key === "Enter") { updateValue(event.target.value) } diff --git a/packages/bbui/src/Form/Core/Select.svelte b/packages/bbui/src/Form/Core/Select.svelte index 01aa8ea067..abc8610064 100644 --- a/packages/bbui/src/Form/Core/Select.svelte +++ b/packages/bbui/src/Form/Core/Select.svelte @@ -8,8 +8,8 @@ export let disabled = false export let error = null export let options = [] - export let getOptionLabel = (option) => option - export let getOptionValue = (option) => option + export let getOptionLabel = option => option + export let getOptionValue = option => option export let readonly = false const dispatch = createEventDispatcher() @@ -34,7 +34,7 @@ return index !== -1 ? getOptionLabel(options[index], index) : value } - const selectOption = (value) => { + const selectOption = value => { dispatch("change", value) open = false } @@ -53,10 +53,6 @@ {getOptionValue} isPlaceholder={value == null || value === ""} placeholderOption={placeholder} -<<<<<<< HEAD - isOptionSelected={(option) => option === value} -======= isOptionSelected={option => option === value} ->>>>>>> 900637c221e4034babd21d69dcaa71b360a2adb2 onSelectOption={selectOption} /> diff --git a/packages/bbui/src/Form/Core/Switch.svelte b/packages/bbui/src/Form/Core/Switch.svelte index a4df7547c6..a2f7e5ce01 100644 --- a/packages/bbui/src/Form/Core/Switch.svelte +++ b/packages/bbui/src/Form/Core/Switch.svelte @@ -9,7 +9,7 @@ export let disabled = false const dispatch = createEventDispatcher() - const onChange = (event) => { + const onChange = event => { dispatch("change", event.target.checked) } diff --git a/packages/bbui/src/Form/Core/TextArea.svelte b/packages/bbui/src/Form/Core/TextArea.svelte index 85650f3356..28e5955b8d 100644 --- a/packages/bbui/src/Form/Core/TextArea.svelte +++ b/packages/bbui/src/Form/Core/TextArea.svelte @@ -15,7 +15,7 @@ let focus = false let textarea const dispatch = createEventDispatcher() - const onChange = (event) => { + const onChange = event => { dispatch("change", event.target.value) focus = false } @@ -29,7 +29,8 @@ > {#if error}