Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google Cloud Storage Integration #12267

Draft
wants to merge 25 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
ec9c645
Added integration
deanhannigan Oct 30, 2023
880cdbb
Merge remote-tracking branch 'origin/master' into labday/google-cloud…
deanhannigan Nov 2, 2023
954ad8c
Fixes and refactoring
deanhannigan Nov 2, 2023
1b8c6a6
Tidying up and added some field types to the query screen
deanhannigan Nov 3, 2023
95574f0
Merge remote-tracking branch 'origin/master' into labday/google-cloud…
deanhannigan Nov 3, 2023
361784f
Removed unused auth dev code
deanhannigan Nov 3, 2023
4da5a5c
Lint
deanhannigan Nov 3, 2023
64040b9
Merge branch 'master' into labday/google-cloud-storage
aptkingston Nov 20, 2023
a43591e
Merge branch 'master' into labday/google-cloud-storage
aptkingston Nov 27, 2023
1cf0292
Merge remote-tracking branch 'origin/master' into labday/google-cloud…
deanhannigan Feb 1, 2024
e87afb2
Bump account portal
deanhannigan Feb 1, 2024
977e209
PR Feedback
deanhannigan Feb 1, 2024
fb7e74c
Linting
deanhannigan Feb 1, 2024
cf20b02
Merge branch 'master' into labday/google-cloud-storage
deanhannigan Feb 1, 2024
a0feba2
Merge branch 'master' into labday/google-cloud-storage
deanhannigan Feb 2, 2024
7814a67
Merge branch 'master' into labday/google-cloud-storage
deanhannigan Feb 2, 2024
fdd728f
Bump account portal
deanhannigan Feb 2, 2024
4545710
Merge branch 'master' into labday/google-cloud-storage
aptkingston Feb 12, 2024
ebb3355
Merge remote-tracking branch 'origin/master' into labday/google-cloud…
deanhannigan Feb 13, 2024
de30ea2
Bump account portal
deanhannigan Feb 13, 2024
ad12315
Merge branch 'master' into labday/google-cloud-storage
deanhannigan Feb 13, 2024
2b31505
packages/account-portal
deanhannigan Feb 13, 2024
898ab50
Merge remote-tracking branch 'origin/master' into labday/google-cloud…
deanhannigan Mar 13, 2024
c0177aa
Added monolith refactor updates
deanhannigan Mar 13, 2024
f5adca8
Added missing google cloud type config
deanhannigan Mar 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24px"
height="24px"
viewBox="0 0 24 24"
><defs
><style>
.cls-1 {
fill: #aecbfa;
}
.cls-2 {
fill: #669df6;
}
.cls-3 {
fill: #4285f4;
}
.cls-4 {
fill: #fff;
}
</style></defs
><title>Icon_24px_CloudStorage_Color</title><g data-name="Product Icons"
><rect class="cls-1" x="2" y="4" width="20" height="7" /><rect
class="cls-2"
x="20"
y="4"
width="2"
height="7"
/><polygon class="cls-3" points="22 4 20 4 20 11 22 4" /><rect
class="cls-2"
x="2"
y="4"
width="2"
height="7"
/><rect class="cls-4" x="6" y="7" width="6" height="1" /><rect
class="cls-4"
x="15"
y="6"
width="3"
height="3"
rx="1.5"
/><rect class="cls-1" x="2" y="13" width="20" height="7" /><rect
class="cls-2"
x="20"
y="13"
width="2"
height="7"
/><polygon class="cls-3" points="22 13 20 13 20 20 22 13" /><rect
class="cls-2"
x="2"
y="13"
width="2"
height="7"
/><rect class="cls-4" x="6" y="16" width="6" height="1" /><rect
class="cls-4"
x="15"
y="15"
width="3"
height="3"
rx="1.5"
/></g
></svg
>
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import Firebase from "./Firebase.svelte"
import Redis from "./Redis.svelte"
import Snowflake from "./Snowflake.svelte"
import Custom from "./Custom.svelte"
import GoogleCloudStorage from "./GoogleCloudStorage.svelte"
import { integrations } from "stores/builder"
import { get } from "svelte/store"

Expand All @@ -38,6 +39,7 @@ const ICONS = {
REDIS: Redis,
SNOWFLAKE: Snowflake,
CUSTOM: Custom,
GOOGLE_CLOUD: GoogleCloudStorage,
}

export default ICONS
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Checkbox, Select, RadioGroup, Stepper, Input } from "@budibase/bbui"
import DataSourceSelect from "./controls/DataSourceSelect/DataSourceSelect.svelte"
import S3DataSourceSelect from "./controls/S3DataSourceSelect.svelte"
import GoogleCloudStorageDataSourceSelect from "./controls/GoogleCloudStorageDataSourceSelect.svelte"
import DataProviderSelect from "./controls/DataProviderSelect.svelte"
import ButtonActionEditor from "./controls/ButtonActionEditor/ButtonActionEditor.svelte"
import TableSelect from "./controls/TableSelect.svelte"
Expand Down Expand Up @@ -35,6 +36,7 @@ const componentMap = {
radio: RadioGroup,
dataSource: DataSourceSelect,
"dataSource/s3": S3DataSourceSelect,
"dataSource/googleCloudStorage": GoogleCloudStorageDataSourceSelect,
dataProvider: DataProviderSelect,
boolean: Checkbox,
number: Stepper,
Expand Down Expand Up @@ -68,6 +70,7 @@ const componentMap = {
"field/datetime": FormFieldSelect,
"field/attachment": FormFieldSelect,
"field/s3": Input,
"field/gcs": Input,
"field/link": FormFieldSelect,
"field/array": FormFieldSelect,
"field/json": FormFieldSelect,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<script>
import { Select, Label } from "@budibase/bbui"
import { selectedScreen } from "stores/builder"
import { findAllMatchingComponents } from "helpers/components"

export let parameters

$: components = findAllMatchingComponents($selectedScreen?.props, component =>
component._component.endsWith("googlecloudupload")
)
</script>

<div class="root">
<Label small>Google Cloud Uploader</Label>
<Select
bind:value={parameters.componentId}
options={components}
getOptionLabel={x => x._instanceName}
getOptionValue={x => x._id}
/>
</div>

<style>
.root {
display: grid;
column-gap: var(--spacing-l);
row-gap: var(--spacing-s);
grid-template-columns: 120px 1fr;
align-items: center;
max-width: 400px;
margin: 0 auto;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export { default as UpdateState } from "./UpdateState.svelte"
export { default as RefreshDataProvider } from "./RefreshDataProvider.svelte"
export { default as DuplicateRow } from "./DuplicateRow.svelte"
export { default as S3Upload } from "./S3Upload.svelte"
export { default as GoogleCloudUpload } from "./GoogleCloudUpload.svelte"
export { default as ExportData } from "./ExportData.svelte"
export { default as ContinueIf } from "./ContinueIf.svelte"
export { default as UpdateFieldValue } from "./UpdateFieldValue.svelte"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,17 @@
}
]
},
{
"name": "Upload File to GoogleCloud",
"type": "data",
"component": "GoogleCloudUpload",
"context": [
{
"label": "File URL",
"value": "publicUrl"
}
]
},
{
"name": "Export Data",
"type": "data",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<script>
import { Select } from "@budibase/bbui"
import { datasources } from "stores/builder"

export let value = null

$: gcDataSources = $datasources.list
.filter(ds => ds.source === "GOOGLE_CLOUD")
.map(ds => ({
label: ds.name,
value: ds._id,
}))
</script>

<Select options={gcDataSources} {value} on:change />
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import { Label, Layout, Input } from "@budibase/bbui"
import { Label, Layout, Input, Select, Toggle } from "@budibase/bbui"
import Editor from "./QueryEditor.svelte"
import KeyValueBuilder from "./KeyValueBuilder.svelte"
import { capitalise } from "helpers"
Expand Down Expand Up @@ -45,6 +45,20 @@
value={fields[field]}
/>
</div>
{:else if schema.fields[field]?.type === "select"}
<Select
options={schema.fields[field].config.options}
value={fields[field]}
on:change={({ detail }) => (fields[field] = detail)}
label={schema.fields[field].display}
/>
{:else if schema.fields[field]?.type === "boolean"}
<Toggle
value={fields[field]}
on:change={({ detail }) => (fields[field] = detail)}
label={schema.fields[field].display}
text={"The contents of the entire bucket will be available online. Please make sure this is the intended behaviour"}
/>
{:else}
<div class="horizontal">
<Label small>{getDisplayName(field)}</Label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"multifieldselect",
"s3upload",
"codescanner",
"googlecloudupload",
"bbreferencefield"
]
},
Expand Down
60 changes: 60 additions & 0 deletions packages/client/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4592,6 +4592,66 @@
}
]
},
"googlecloudupload": {
"name": "Google Cloud Storage File Upload",
"icon": "UploadToCloud",
"styles": ["size"],
"editable": true,
"size": {
"width": 400,
"height": 200
},
"settings": [
{
"type": "field/gcs",
"label": "Field",
"key": "field",
"required": true
},
{
"type": "text",
"label": "Label",
"key": "label"
},
{
"type": "dataSource/googleCloudStorage",
"label": "Google Cloud Storage",
"key": "datasourceId"
},
{
"type": "text",
"label": "Bucket",
"key": "bucket"
},
{
"type": "text",
"label": "File name",
"key": "key"
},
{
"type": "event",
"label": "On change",
"key": "onChange",
"context": [
{
"label": "Field Value",
"key": "value"
}
]
},
{
"type": "boolean",
"label": "Disabled",
"key": "disabled",
"defaultValue": false
},
{
"type": "validation/attachment",
"label": "Validation",
"key": "validation"
}
]
},
"dataprovider": {
"name": "Data Provider",
"icon": "Data",
Expand Down
24 changes: 24 additions & 0 deletions packages/client/src/components/app/forms/GoogleCloudUpload.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<script>
import StoreUpload from "./StoreUpload.svelte"

export let datasourceId
export let bucket
export let key
export let field
export let label
export let disabled = false
export let validation
export let onChange
</script>

<StoreUpload
{datasourceId}
{bucket}
{key}
{field}
{label}
{disabled}
{validation}
{onChange}
storeFieldType={"googlecloudupload"}
/>
Loading
Loading