capitalized: Dyanmic Table Work
short: DT_WRK
tagColor: "#F6FF3C"
isDisabled: true
plural: Dynamic Tables

deployStrategy: advanced

config:
  - groupName: Dynamic Table Options
    items: 
    - displayName: Warehouse on which to execute Dynamic Table
      attributeName: warehouseName
      type: textBox
      default: dev_wh_xs
      isRequired: true

    - type: toggleButton
      attributeName: downstreamOption
      displayName: Downstream
      default: false
      isRequired: true

    - type: tabular
      displayName: 'Lag Specification'
      attributeName: lagSpecification
      columns:
  
      -  type: textBox
         displayName: Time Value
         attributeName: lagValue
         default: 60
         isRequired: false
         enableIf: "{% if config.downstreamOption %} false {% else %} true {% endif %}"
    
      -  type: dropdownSelector
         displayName: Time Period
         attributeName: lagPeriod
         default: "Minutes"
         options:
         - Seconds
         - Minutes
         - Hours
         - Days
         isRequired: false
         enableIf: "{% if config.downstreamOption %} false {% else %} true {% endif %}"
    
      isRequired: false
      enableIf: "{% if config.downstreamOption %} false {% else %} true {% endif %}"

    - type: dropdownSelector
      displayName: Refresh Mode
      attributeName: refresh_mode
      default: "AUTO"
      options:
      - AUTO
      - INCREMENTAL
      - FULL
      isRequired: true

    - type: dropdownSelector   
      displayName: Initialize
      attributeName: initialize
      default: "ON_CREATE"
      options:
      - ON_CREATE
      - ON_SCHEDULE 
      isRequired: true

  - groupName: General Options
    items: 
    - type: toggleButton
      attributeName: selectDistinct
      displayName: Distinct
      default: false
      enableIf: "{% if config.groupByAll %} false {% else %} true {% endif %}"

    - type: toggleButton
      attributeName: groupByAll
      displayName: Group By All
      default: false
      enableIf: "{% if config.selectDistinct %} false {% else %} true {% endif %}"

    - type: multisourceToggle

    - displayName: Multi Source Strategy
      attributeName: insertStrategy
      type: dropdownSelector
      default: UNION ALL
      options:
      - "UNION"
      - "UNION ALL" 
      isRequired: true
      enableIf: "{% if node.isMultisource %} true {% else %} false {% endif %}"

  - groupName: Hidden Config
    enableIf: "false"
    items:
    - displayName: Type
      type: materializationSelector
      default: Dynamic Table
      options:
      - Dynamic Table
      isRequired: false