# Panel 4:Custom Built Index
# 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: customBuiltIndex
    title: Create Custom Built Index
    content:

      - imageHeader:
          name: imageHeader
          image:  /assets/line_chart/customBuildIndexLine.png
          text: >
            <p><b><u>Inputs:</u></b> Add Custom Build Index</p>

      # BEGIN CODE BLOCK: Index 1
      - divider:
          name: index1
          title: Create Index 1
          type: primary
      - field:
          name: indexName
          dataIndex: 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
          dataIndex: 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)
            - "#":
                name: Index Constituents
                type: number
                dataIndex: id
            # Workflow OW6(b)
            - Company:
                name: Company Name & Ticker
                type: string
                dataIndex: companyNameAndTicker
            - Remove: # New delete button column
                name: removeCompany
                type: button
                dataIndex: hiddenId  # Use the row's ID to identify deletion target
                iconType: CloseOutlined  # Icon for the button

      # Workflow OW6(c)
      # Workflow OW6(d)
      - aligner:
          align: right
          width: auto
          content:
            - button:
                name: addAPALCompany
                type: primary
                title: Add Company
                style:
                  marginTop: "10px"
                  backgroundColor: "#FFC000"

      #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: radioAddIndex
          dataIndex: radioAddIndex
          title:
          options:
            - Yes
            - No
      - anchor:
          name: indexContainer
      # END CODE BLOCK: Index 1
      #END OF CUSTOM BUILT INDEX SECTION

      # Workflow NN1
      - aligner:
          align: right
          width: auto
          content:
            - 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
