# Panel 4: Additional Primary Axis Lines
# The following Notion provides an Overview and details on Workflows: https://www.notion.so/Line-Chart-User-Input-Forms-16fcae16861d80369c88c6a8a56c5ae6?pvs=4#175cae16861d80bdace8d858d0ab5a7d
- scroller:
    name: "additionalPrimaryAxis Lines"
    title: "Additional Primary Axis Lines"
    content:
      #Workflow AN1: Custom Build Index
      - divider:
          name: customBuiltIndex
          title: Custom Built Index
          type: primary

      # BEGIN CODE BLOCK: Index 1
      - divider:
          name: index1
          title: Index 1
          type: secondary
      - field:
          name: indexName
          type: string
          maxLength: 32
          title: Index Name
      #User defines the contribution approach. For now we will only offer Equal Weighted, but in the future will expand to also have Market Capitalization Weighted.
      - select:
          name: constituentContributionApproach
          title: Index Type
          options:
            - Equal Weighted
      # Workflow OW6: User Input Table. The below table is the same as the one we used on the Panel 2: Initial Inputs.
      - table:
          name: defineIndexContituents
          columns:
            # Workflow OW6(a)
            - Index Constituents:
                name: Index Constituents
                type: number
                dataIndex: id
            # Workflow OW6(b)
            - Company Name & Ticker:
                name: Company Name & Ticker
                type: string
                dataIndex: companyNameAndTicker
            - Remove Company: # New delete button column
                name: removeCompany
                type: button
                dataIndex: id  # Use the row's ID to identify deletion target
                iconType: SettingOutlined  # Icon for the button

      # Workflow OW6(c)
      # Workflow OW6(d)
      - button:
          name: addAPALCompany
          type: primary
          title: Add Company

      #Asking the users if they want to add an additional index like we did above
      - text:
          name: companySharePriceSelectionQuestion
          text: >
            <p><strong>Do you want to create an additional index?</strong></p>
      # Workflow AN2: If the below question is responded yes to, repeat the Index 1 code block
      - radio:
          name: radio
          title:
          options:
            - Yes
            - No
      # END CODE BLOCK: Index 1
#END OF CUSTOM BUILT INDEX SECTION


#Workflow AN3: Static Line Section
      - divider:
          name: staticLine
          title: Static Line
          type: primary

  # BEGIN CODE BLOCK: Line 1
      - divider:
          name: staticLine1
          title: Line 1
          type: secondary
      #User defines the name of the Static Line.
      - field:
          name: lineName
          type: string
          maxLength: 32
          title: Line Name
      # User defines the calculation approach.
      # Workflow OW1: Add information icon with additional infomration
      - select:
          name: calculationApproach
          title: Approach
          options:
            - Input Value
            - Derived Value

      #Workflow AN4: Select Block of Code (either A or B)


      # Code Block (A): Input Value
      # Workflow OW2: We should limit user inputs to integers.
      - field:
          name: value
          type: string
          maxLength: 32
          title: Value

      # END OF CODE BLOCK A

      # Code Block (B): Derived Value
      # Workflow OW3: Information icons
      - text:
          name: derivedDataCalculationQuestion
          text: >
            <p><strong>Value derived off of Time Series Data or a Point in Time Data?</strong></p>
      - radio:
          name: radio
          title:
          options:
            - Time Series
            - Point-in-Time
      # Workflow AN5: Select Block of Code (either B.1 or B.2)

      # Beginning of Code Block B.1. Derived Value. Time Series
      - text:
          name: derivedDataCalculationQuestion
          text: >
            <p><strong><u>Calculation Inputs</u></strong></p>
      - range:
          name: timePeriod
          title: Time Period
      - select:
          name: radio
          title: Calculation
          options:
            - High
            - 75th Percentile
            - Median
            - Mean
            - 25th Percentile
            - Low
      # Workflow OW4: The below should be a selection of companies / indices included in the Panel 2: Initial Inputs
      - select:
          name: radioCompanyNames
          title: Company
          options:
#            - "[TBC]"
#            - "[TBC]"
#            - "[TBC]"
#            - "[TBC]"
#            - "[TBC]"
#            - "[TBC]"
      # END OF CODE BLOCK B.1

      #Beginning of Code Block B.2. Derived Value. Point-in-Time
      - text:
          name: derivedDataCalculationQuestion
          text: >
            <p><strong><u>Calculation Inputs</u></strong></p>
      - date:
          name: staticLine1Date
          title: Date
      # Workflow OW5.
      - field:
          name: staticLine1Date
          type: string
          title: Premium to Date
          maxLength: 32
      # Workflow OW4: The below should be a selection of companies / indices included in the Panel 2: Initial Inputs
      - select:
          name: radioCompanyNames
          title: Company
          options:
#            - "[TBC]"
#            - "[TBC]"
#            - "[TBC]"
#            - "[TBC]"
#            - "[TBC]"
#            - "[TBC]"
      # END OF CODE BLOCK B.2


      #Asking the users if they want to add an additional static line like we did above
      - text:
          name: companySharePriceSelectionQuestion
          text: >
            <p><strong>Do you want to create an additional static line?</strong></p>
      - radio:
          name: radio
          title:
          options:
            - Yes
            - No
  # END CODE BLOCK: Line 1
  # Workflow AN6: Decision Point on Repeat Block of Code
#END OF STATIC LINE SECTION

      # Workflow NN1
      - button:
          name: backBtn
          type: default
          title: Back
      # Workflow NN2
      - button:
          name: nextBtn
          type: primary
          title: Next
      # Workflow NN1
      - button:
          name: btnCancel
          type: default
          title: Cancel
