Skip to content

Commit

Permalink
S3 storages forms integration
Browse files Browse the repository at this point in the history
  • Loading branch information
xamelon committed Dec 26, 2024
1 parent 6eb23bc commit cf0b488
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 4 deletions.
20 changes: 16 additions & 4 deletions modules/aidbox-forms/aidbox-ui-builder-alpha/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,13 @@ A global Configuration resource can be instantiated to serve as the system-wide
* `description`: The human-readable description of the configuration resource.
* `default`: A boolean value that specifies whether the configuration is the default for the system or tenant.
* `language`: The default language for the UI.
* `translations`: Object containing [custom translations](#translations) strings for the UI.
* `translations`: Object containing [custom translations](#translations) strings for the UI.
* `theme`: An inlined copy of or reference to [QuestionnaireTheme](#theme) object.
* `storage`: Storage configuration for attachments types
* `account`: Reference to [storage resource](https://docs.aidbox.app/storage-1/s3-compatible-storages)
* `id`: id
* `resourceType`: One of (GcpServiceAccount, AwsAccount, AzureContainer)
* `bucket`: Bucket to store attachment files (required for GcpServiceAccount and AwsAccount)
* `builder`: Configuration settings for the form builder.
* `form-url-prefix`: The URL prefix used in URL generation for new forms.
* `hide-back-button`: A boolean value that specifies whether the back button should be hidden.
Expand Down Expand Up @@ -88,6 +93,13 @@ Content-Type: application/json
"id": "027cf3dd-dca7-4a38-b805-3e76c1886ac7",
"resourceType": "QuestionnaireTheme"
},
"storage": {
"account": {
"id": "aws-test-account",
"resourceType": "AwsAccount"
},
"bucket": "attachments-bucket"
},
"builder": {
"form-url-prefix": "https://example.com/forms/",
"hide-back-button": false
Expand Down Expand Up @@ -210,11 +222,11 @@ All of these properties are optional, and you can customize the theme to suit yo

# Translations

The translations object in the Configuration resource allows defining custom text for the Aidbox Form Builder and Renderer.
It uses a structured, hierarchical format where each key corresponds to a feature or component, and the leaf nodes specify locale-based translations.
The translations object in the Configuration resource allows defining custom text for the Aidbox Form Builder and Renderer.
It uses a structured, hierarchical format where each key corresponds to a feature or component, and the leaf nodes specify locale-based translations.
This structure supports multiple languages and regional variations by enabling you to specify locale codes such as en for English, fr for French, or more granular options like en-US for American English and fr-CA for Canadian French.

The example provided below represents a comprehensive translations object for English, covering all possible keys. You can extend this object by adding translations for additional languages.
The example provided below represents a comprehensive translations object for English, covering all possible keys. You can extend this object by adding translations for additional languages.
If a specific language (e.g., en for English or any other) is omitted, the Aidbox Form will use its standard default translations for that language.

```json
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
description: This article explains how to configure Aidbox Forms to store attachments in S3-Compatible storages
---

# Overview

Aidbox Forms provides an ability to store files from attachment items in cloud storages like S3.

## 1. Setup storage account

Aidbox supports Amazon S3, Google Cloud Storage, Azure Container.
Here is the guide on [how to setup this integration](/storage-1/s3-compatible-storages).

## 2. Update SDCConfig

After you setup the integration put the reference to storage credential resource into the SDCConfig resource and set the bucket.

```json
{"resourceType": "SDCConfig",
"default": true,
"storage": {
"account": {
"id": "test-account",
"resourceType": "AwsAccount"
},
"bucket": "sdc-files"
}
}
```

Now all files from attachment items will be stored in cloud storage.

0 comments on commit cf0b488

Please sign in to comment.