# 1x3 grid
title_container_prefix: &title_container_prefix
  - type: text
    name: title
    label: Storage Name
    required: true
  - type: text
    name: container
    label: Container Name
    required: true
  - type: text
    name: prefix
    label: Container Prefix

# 1x2 grid
azure_params: &azure_params
  - type: password
    name: account_name
    label: Account Name
    autoComplete: "off"
    skipAutofill: true
    allowEmpty: false
    protectedValue: true
  - type: password
    name: account_key
    label: Account Key
    autoComplete: "new-password"
    skipAutofill: true
    allowEmpty: false
    protectedValue: true

ImportStorage:
  # Title, Bucket, Prefix
  - columnCount: 3
    fields: *title_container_prefix
  # Regex filter
  - columnCount: 1
    fields:
      - type: text
        name: regex_filter
        label: File Filter Regex
        placeholder: '.*csv or .*(jpe?g|png|tiff) or .\w+-\d+.text'
        validators:
          - regexp
  # AWS specific params
  - columnCount: 3
    fields: *azure_params

  # Import method selection
  - columnCount: 1
    fields:
      - type: select
        name: use_blob_urls
        label: Import method
        description: Choose how to import your data from storage
        placeholder: "Select an option"
        required: true
        options:
          - value: true
            label: "Files - Automatically creates a task for each storage object (e.g. JPG, MP3, TXT)"
          - value: false
            label: "Tasks - Treat each JSON or JSONL file as a task definition (one or more tasks per file)"

  # 2 columns grid
  - columnCount: 2
    columns:
      - width: 468
        fields:
          - type: toggle
            name: presign
            label: "Use pre-signed URLs (On)\n Proxy through the platform (Off)"
            description: "When pre-signed URLs are enabled, all data bypasses the platform and user browsers directly read data from storage"
            value: true
      - fields:
          - type: counter
            name: presign_ttl
            label: Expire pre-signed URLs (minutes)
            min: 1
            value: 15
            dependency: presign

ExportStorage:
  - columnCount: 3
    fields: *title_container_prefix
  - columnCount: 2
    fields: *azure_params
