lib/contentful/management/editor_interface.rb in contentful-management-3.2.0 vs lib/contentful/management/editor_interface.rb in contentful-management-3.3.0

- old
+ new

@@ -9,10 +9,11 @@ include Contentful::Management::Resource::Refresher include Contentful::Management::Resource::SystemProperties include Contentful::Management::Resource::EnvironmentAware property :controls, :array + property :sidebar, :array # Gets the Default Editor Interface # # @param [Contentful::Management::Client] client # @param [String] space_id @@ -37,11 +38,14 @@ fail 'Not supported' end # @private def self.create_attributes(_client, attributes) - { 'controls' => attributes.fetch(:controls) } + { + 'controls' => attributes.fetch(:controls), + 'sidebar' => attributes.fetch(:sidebar) + } end # @private def self.build_endpoint(endpoint_options) space_id = endpoint_options.fetch(:space_id) @@ -52,11 +56,11 @@ end # Updates an Editor Interface # # @param [Hash] attributes - # @option attributes [Array<Hash>] :controls + # @option attributes [Array<Hash>] :controls, :sidebar # # @return [Contentful::Management::EditorInterface] def update(attributes) ResourceRequester.new(client, self.class).update( self, @@ -64,11 +68,14 @@ space_id: space.id, environment_id: environment_id, content_type_id: content_type.id, editor_id: id }, - { 'controls' => attributes[:controls] || controls }, + { + 'controls' => attributes[:controls] || controls, + 'sidebar' => attributes[:sidebar] || sidebar + }, version: sys[:version] ) end # Destroys an EditorInterface. @@ -84,10 +91,11 @@ self.class.default(client, space.id, environment_id, content_type.id) end def query_attributes(attributes) { - controls: controls + controls: controls, + sidebar: sidebar }.merge( attributes.each_with_object({}) { |(k, v), result| result[k.to_sym] = v } ) end end