 kd                              = require 'kd'
 curryIn                         = require 'app/util/curryIn'
 
-CredentialListItem              = require 'app/stacks/credentiallistitem'
+CustomDataListItem              = require 'app/stacks/customdatalistitem'
 AccountCredentialList           = require 'account/accountcredentiallist'
 AccountCredentialListController = require 'account/views/accountcredentiallistcontroller'
 


  constructor: (options = {}, data) ->

    curryIn options, cssClass: 'stacks step-creds'

    super options, data


  viewAppended: ->

    { stackTemplate, selectedCredentials } = @getOptions()

    @list           = new AccountCredentialList {
      itemClass     : CredentialListItem
      itemOptions   : { stackTemplate }
      selectedCredentials
    }

    { requiredFields, defaultTitle } = @getOptions()

    @listController   = new AccountCredentialListController {
      view            : @list
      wrapper         : no
      scrollView      : no


    @credentialList = @listController.getView()

    @credentialList.on 'ItemSelected', (credential) =>

      { credentials } = stack
      credentials.userInput ?= []
      credentials.userInput.push credential.identifier

      stack.modify { credentials }, (err) =>
        kd.warn err  if err

        stack.credentials = credentials
        @emit 'RequirementsProvided', { stack, credential }


    @addSubView new kd.View
      partial: "Based on the Stack Template which this Stack generated,
                you first need to provide some information to build
                this stack properly."

    mainView = @addSubView new kd.View
      cssClass: 'stacks stacks-v2'
