contentful-management 2.1.1 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2f95f883c330daeed001dad534024cc80a84e774630afd0fa69790d03e88e222
4
- data.tar.gz: 26fc16a41a90bc8721e1b053d6377896519ce76210430f1542e13e9f8fbce9e6
3
+ metadata.gz: d377237ac5fae9287e980db31e4968afa5b8ecd1628ffdc2adce1035332b57a8
4
+ data.tar.gz: 3a5116a7e471a60e25baa932e64efaef17a0c3b5866a8223c2d124dff4ef2b33
5
5
  SHA512:
6
- metadata.gz: 7342e52fb154aa3998cc3c11b3fc3eeb47fa1113f43e1dedc36e6a1042f553b9be7ca6caaa76d92267980cc654753f5d3c1ed8b127e9599e4964afe55fc477fd
7
- data.tar.gz: 29ca251cdd60a04312551ba6cd2ca5b2443a674cac6a170f58e074264633f23ec6e2a8841cc3172287976a5892d63ee654222d8c48f53f41d5f162a7115cce3c
6
+ metadata.gz: 91fce556a7f693dd2f8d08970eabfbc576cd40b21be13abfbb385ad42cba7fdab347b22f68dde00593753777516f6620592348b34a75b0838c76a2350f6712a0
7
+ data.tar.gz: cd4b54ccd6a43acecb2d021096b4dd5e1142e6fd3327d2c217b38ce3e0df7d1a796162321d6f81eeec3652485df3a989b54dc7fa80d7c0ea94b486d2a5a0f0ec
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Master
4
4
 
5
+ ## 2.2.0
6
+ ### Added
7
+ * Added `#save` as a shortcut for `editor_interface.update(controls: editor_interface.controls)`. [#155](https://github.com/contentful/contentful-management.rb/issues/155)
8
+
5
9
  ## 2.1.1
6
10
  ### Fixed
7
11
  * Fixed query parameter forwarding when querying from an environment proxy. [#160](https://github.com/contentful/contentful-management.rb/issues/160)
@@ -71,6 +71,14 @@ module Contentful
71
71
  )
72
72
  end
73
73
 
74
+ # Saves the current editor interface.
75
+ # @see _ README for details.
76
+ #
77
+ # @return [Contentful::Management::EditorInterface]
78
+ def save
79
+ update(controls: controls) if id
80
+ end
81
+
74
82
  # Destroys an EditorInterface.
75
83
  #
76
84
  # Not Supported
@@ -3,6 +3,6 @@ module Contentful
3
3
  # Management Namespace
4
4
  module Management
5
5
  # Gem Version
6
- VERSION = '2.1.1'.freeze
6
+ VERSION = '2.2.0'.freeze
7
7
  end
8
8
  end
@@ -5,7 +5,7 @@ require 'contentful/management/client'
5
5
  module Contentful
6
6
  module Management
7
7
  describe EditorInterface do
8
- let(:token) { '<ACCESS_TOKEN>' }
8
+ let(:token) { ENV.fetch('CF_TEST_CMA_TOKEN', '<ACCESS_TOKEN>') }
9
9
  let(:space_id) { 'oe3b689om6k5' }
10
10
  let(:content_type_id) { 'testInterfaces' }
11
11
  let(:editor_interface_id) { 'default' }
@@ -52,6 +52,25 @@ module Contentful
52
52
  end
53
53
  end
54
54
  end
55
+
56
+ describe '#save' do
57
+ let(:content_type_id) { 'smallerType' }
58
+
59
+ it 'can update the editor_interface - a shortcut to #update(controls: editor_interface.controls)' do
60
+ vcr('editor_interfaces/update') do
61
+ editor_interface = described_class.default(client, space_id, 'master', content_type_id)
62
+
63
+ expect(editor_interface.controls.first['widgetId']).to eq 'singleline'
64
+
65
+ editor_interface.controls.first['widgetId'] = 'urlEditor'
66
+ editor_interface.save
67
+
68
+ editor_interface.reload
69
+
70
+ expect(editor_interface.controls.first['widgetId']).to eq 'urlEditor'
71
+ end
72
+ end
73
+ end
55
74
  end
56
75
  end
57
76
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contentful-management
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Protas
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2018-05-15 00:00:00.000000000 Z
13
+ date: 2018-06-05 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: http