Sha256: 4d1e39856d579af0cf27a065a664a780c41d632680e4ab21804d4e544356ffd5

Contents?: true

Size: 715 Bytes

Versions: 6

Compression:

Stored size: 715 Bytes

Contents

require 'flipper/ui/action'
require 'flipper/ui/decorators/feature'

module Flipper
  module UI
    module Actions
      class AddFeature < UI::Action
        route %r{\A/features/new/?\Z}

        def get
          render_read_only if read_only?

          unless Flipper::UI.configuration.feature_creation_enabled
            status 403

            breadcrumb 'Home', '/'
            breadcrumb 'Features', '/features'
            breadcrumb 'Noooooope'

            halt view_response(:feature_creation_disabled)
          end

          breadcrumb 'Home', '/'
          breadcrumb 'Features', '/features'
          breadcrumb 'Add'

          view_response :add_feature
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
flipper-ui-1.2.2 lib/flipper/ui/actions/add_feature.rb
flipper-ui-1.2.1 lib/flipper/ui/actions/add_feature.rb
flipper-ui-1.2.0 lib/flipper/ui/actions/add_feature.rb
flipper-ui-1.1.2 lib/flipper/ui/actions/add_feature.rb
flipper-ui-1.1.1 lib/flipper/ui/actions/add_feature.rb
flipper-ui-1.1.0 lib/flipper/ui/actions/add_feature.rb