class Skr.Components.SystemSettings extends Lanes.React.Component dataObjects: banks: -> Skr.Models.BankAccount.Collection.fetch() sequentialIds: -> new Skr.Models.SequentialId ccgateway: -> Skr.Models.CreditCardGateway.fetchById() componentWillMount: -> @sequentialIds.fetch() setBankAccount: (value) -> Lanes.config.system_settings .setValueForExtension('skr', 'bank_account_id', value.id) @forceUpdate() getBankAccount: -> id = Lanes.config.system_settings.forExtension('skr').bank_account_id if id then {id} else undefined SequentialId: ({si}) -> {id, name, count} = si onChange = (num) => @sequentialIds.updateValue(id, num) {name} onSave: -> @sequentialIds.save() if @sequentialIds.isDirty @ccgateway.save() setGatewayType: (type) -> @ccgateway.type = type.id renderCreditCardGateway: -> render: ->
{for si in @sequentialIds.ids <@SequentialId si={si} key={si.id} />} {@renderCreditCardGateway()}