Sha256: b376a2001674970fd0adabd61bd7c72e395bf5d34c89190e3ed604afadb8a269

Contents?: true

Size: 625 Bytes

Versions: 18

Compression:

Stored size: 625 Bytes

Contents

module Avo
  module Fields
    class StatusField < Field
      def initialize(name, **args, &block)
        @defaults = {
          sortable: true,
          component: 'status-field',
        }

        super(name, **args, &block)

        @loading_when = args[:loading_when].present? ? [args[:loading_when]].flatten : [:waiting, :running]
        @failed_when = args[:failed_when].present? ? [args[:failed_when]].flatten : [:failed]
      end

      def hydrate_field(fields, model, resource, view)
        {
          loading_when: @loading_when,
          failed_when: @failed_when,
        }
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
avo-0.4.10 lib/avo/app/fields/status_field.rb
avo-0.4.9 lib/avo/app/fields/status_field.rb
avo-0.4.8 lib/avo/app/fields/status_field.rb
avo-0.4.7 lib/avo/app/fields/status_field.rb
avo-0.4.6 lib/avo/app/fields/status_field.rb
avo-0.4.5 lib/avo/app/fields/status_field.rb
avo-0.4.4 lib/avo/app/fields/status_field.rb
avo-0.4.3 lib/avo/app/fields/status_field.rb
avo-0.4.2 lib/avo/app/fields/status_field.rb
avo-0.4.1 lib/avo/app/fields/status_field.rb
avo-0.3.2 lib/avo/app/fields/status_field.rb
avo-0.3.1 lib/avo/app/fields/status_field.rb
avo-0.2.5 lib/avo/app/fields/status_field.rb
avo-0.2.4 lib/avo/app/fields/status_field.rb
avo-0.2.3 lib/avo/app/fields/status_field.rb
avo-0.2.2 lib/avo/app/fields/status_field.rb
avo-0.2.1 lib/avo/app/fields/status_field.rb
avo-0.2.0 lib/avo/app/fields/status_field.rb