Sha256: a273a82adbbeb76f0369ed61ac519d3787346bc621042d8d875c8f4164ea6962

Contents?: true

Size: 1.09 KB

Versions: 2

Compression:

Stored size: 1.09 KB

Contents

class Skr.Extension extends Lanes.Extensions.Base

    identifier: "skr"

    # Data that is provided by lib/skr/extension.rb's
    # client_bootstrap_data method ends up here
    setBootstrapData: (data) ->
        Lanes.Models.Query.LIKE_QUERY_TYPES.push 'visible_id'
        Skr.Models.GlAccount.initialize(
            accounts: data.gl_accounts
            default_ids: data.default_gl_account_ids,
        )
        Skr.Models.Location.initialize(
            locations: data.locations
        )
        Skr.Models.PaymentTerm.initialize(
            payment_terms: data.payment_terms
        )
        for type, choices of data.templates
            klass = Skr.Models[_.classify(type)]
            if klass
                klass.Templates = choices
            else
                console.log "Unable to find model for #{type}"

    title: ->
        "Stockor"

    rootComponent: (viewport) ->
        Lanes.Workspace.Layout

    getPreferenceElement: (props) ->
        React.createElement(SC.UserPreferences, props)

    getSettingsElement: (props) ->
        React.createElement(SC.SystemSettings, props)

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
stockor-0.5.0 client/skr/Extension.coffee
stockor-0.4.0 client/skr/Extension.coffee