contentful-management 3.2.0 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: caefa93b06c479fb9b2d87a27e7d360b7c7cbd87fd4d849f083486df39bb43de
4
- data.tar.gz: '029cebff0c301345930e183480a6e24d54e4a778ad5b8afda88cd15a3abef9d2'
3
+ metadata.gz: df8e043eb2757aa5fc7ac3a679a7f7ac945869b350920f660586079e954fb540
4
+ data.tar.gz: 8e58ce2d681d748c68987a7db23d7bbe846feea6c9b93f35be369a84e9b84bb4
5
5
  SHA512:
6
- metadata.gz: 838ee33007dd1b5caa7777e08aaafc1fc0f4a5869772dcf7e7eaab781e41e45454f8a91d78799e283d028ad4ad290f4d989c450d293171fcc41b1b8b28f38fc4
7
- data.tar.gz: 6986a8b83df08cbb573634c5c35697c8ecfee5e27bc4e759ab90335ce88dacbf14ba5303eed081cc00aaedffc30546ca7751de122ab17239b84a7d404d49678a
6
+ metadata.gz: c19c035a3ab9a8dbb85c2e8679c15bfa83b7499c4e83927996536f595847d1201c636561d63a300bf2d8edbee507e57b020a56ac0b512ee290af121fecfe9107
7
+ data.tar.gz: 91ed42d0f1356e1d0bc7076566587b6a54870472c16391272fb8b0cec7b834539b19682f3e42a3c232667fe97506cbbd8d0f9e25f29ab7368774d470b3afa5e0
data/CHANGELOG.md CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  ## Master
4
4
 
5
+ ## 3.3.0
6
+ * Added getter/setter for EditorInterface#sidebar
7
+
5
8
  ## 3.2.0
6
9
  * Added support for parameters on Users API. [#227](https://github.com/contentful/contentful-management.rb/pull/227)
7
10
 
@@ -11,6 +11,7 @@ module Contentful
11
11
  include Contentful::Management::Resource::EnvironmentAware
12
12
 
13
13
  property :controls, :array
14
+ property :sidebar, :array
14
15
 
15
16
  # Gets the Default Editor Interface
16
17
  #
@@ -39,7 +40,10 @@ module Contentful
39
40
 
40
41
  # @private
41
42
  def self.create_attributes(_client, attributes)
42
- { 'controls' => attributes.fetch(:controls) }
43
+ {
44
+ 'controls' => attributes.fetch(:controls),
45
+ 'sidebar' => attributes.fetch(:sidebar)
46
+ }
43
47
  end
44
48
 
45
49
  # @private
@@ -54,7 +58,7 @@ module Contentful
54
58
  # Updates an Editor Interface
55
59
  #
56
60
  # @param [Hash] attributes
57
- # @option attributes [Array<Hash>] :controls
61
+ # @option attributes [Array<Hash>] :controls, :sidebar
58
62
  #
59
63
  # @return [Contentful::Management::EditorInterface]
60
64
  def update(attributes)
@@ -66,7 +70,10 @@ module Contentful
66
70
  content_type_id: content_type.id,
67
71
  editor_id: id
68
72
  },
69
- { 'controls' => attributes[:controls] || controls },
73
+ {
74
+ 'controls' => attributes[:controls] || controls,
75
+ 'sidebar' => attributes[:sidebar] || sidebar
76
+ },
70
77
  version: sys[:version]
71
78
  )
72
79
  end
@@ -86,7 +93,8 @@ module Contentful
86
93
 
87
94
  def query_attributes(attributes)
88
95
  {
89
- controls: controls
96
+ controls: controls,
97
+ sidebar: sidebar
90
98
  }.merge(
91
99
  attributes.each_with_object({}) { |(k, v), result| result[k.to_sym] = v }
92
100
  )
@@ -3,6 +3,6 @@ module Contentful
3
3
  # Management Namespace
4
4
  module Management
5
5
  # Gem Version
6
- VERSION = '3.2.0'.freeze
6
+ VERSION = '3.3.0'.freeze
7
7
  end
8
8
  end
@@ -0,0 +1,553 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.contentful.com/spaces/oe3b689om6k5/environments/master/content_types/smallerType/editor_interface
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ X-Contentful-User-Agent:
11
+ - sdk contentful-management.rb/3.2.0; platform ruby/2.7.1; os macOS/19;
12
+ Authorization:
13
+ - Bearer <ACCESS_TOKEN>
14
+ Content-Type:
15
+ - application/vnd.contentful.management.v1+json
16
+ Connection:
17
+ - close
18
+ Host:
19
+ - api.contentful.com
20
+ User-Agent:
21
+ - http.rb/4.4.1
22
+ response:
23
+ status:
24
+ code: 200
25
+ message: OK
26
+ headers:
27
+ Access-Control-Allow-Headers:
28
+ - Accept,Accept-Language,Authorization,Cache-Control,Content-Length,Content-Range,Content-Type,DNT,Destination,Expires,If-Match,If-Modified-Since,If-None-Match,Keep-Alive,Last-Modified,Origin,Pragma,Range,User-Agent,X-Http-Method-Override,X-Mx-ReqToken,X-Requested-With,X-Contentful-Version,X-Contentful-Content-Type,X-Contentful-Organization,X-Contentful-Skip-Transformation,X-Contentful-Tag-Visibility,X-Contentful-User-Agent,X-Contentful-Enable-Alpha-Feature,X-Contentful-Source-Environment,X-Contentful-Team,X-Contentful-Parent-Id,x-contentful-validate-only,X-Contentful-Skip-UI-Draft-Validation,X-Contentful-Marketplace,X-Contentful-UI-Content-Auto-Save,cf-trace
29
+ Access-Control-Allow-Methods:
30
+ - DELETE,GET,HEAD,POST,PUT,PATCH,OPTIONS
31
+ Access-Control-Allow-Origin:
32
+ - "*"
33
+ Access-Control-Expose-Headers:
34
+ - Etag
35
+ Access-Control-Max-Age:
36
+ - '1728000'
37
+ Cache-Control:
38
+ - no-store
39
+ Cf-Environment-Id:
40
+ - master
41
+ Cf-Environment-Uuid:
42
+ - master
43
+ Cf-Space-Id:
44
+ - oe3b689om6k5
45
+ Content-Type:
46
+ - application/vnd.contentful.management.v1+json
47
+ Contentful-Api:
48
+ - cma
49
+ Contentful-Origin-Time:
50
+ - '0.131'
51
+ Contentful-Upstream:
52
+ - content-api
53
+ Date:
54
+ - Tue, 31 Aug 2021 10:20:18 GMT
55
+ Etag:
56
+ - '"15587330661490795785"'
57
+ Server:
58
+ - Contentful
59
+ Strict-Transport-Security:
60
+ - max-age=15768000
61
+ X-Content-Type-Options:
62
+ - nosniff
63
+ X-Contentful-Ratelimit-Hour-Limit:
64
+ - '36000'
65
+ X-Contentful-Ratelimit-Hour-Remaining:
66
+ - '35999'
67
+ X-Contentful-Ratelimit-Reset:
68
+ - '0'
69
+ X-Contentful-Ratelimit-Second-Limit:
70
+ - '10'
71
+ X-Contentful-Ratelimit-Second-Remaining:
72
+ - '9'
73
+ X-Contentful-Request-Id:
74
+ - 909dfebd4dbdddf6f747ab30c0b4f592
75
+ X-Contentful-Route:
76
+ - "/spaces/:space/environments/:environment/content_types/:content_type/editor_interface"
77
+ Content-Length:
78
+ - '1841'
79
+ Connection:
80
+ - Close
81
+ Set-Cookie:
82
+ - incap_ses_1515_673446=vyF6JNujfST81/F8glwGFWICLmEAAAAAL/egJdWqfHY5oKS/0Xvt1A==;
83
+ path=/; Domain=.contentful.com
84
+ - nlbi_673446=l8iIfOdwUwEhh490swL+7AAAAABYRaSf2NJeodzLLO5jxPnD; path=/; Domain=.contentful.com
85
+ - visid_incap_673446=YNRw1nHSQbm8j6L4BDrhJ2ICLmEAAAAAQUIPAAAAAADihgw1AWdXcwJhU2G6pIu+;
86
+ expires=Wed, 31 Aug 2022 09:15:16 GMT; HttpOnly; path=/; Domain=.contentful.com
87
+ X-Cdn:
88
+ - Imperva
89
+ X-Iinfo:
90
+ - 12-108821744-108821763 NNNY CT(97 96 0) RT(1630405218206 59) q(0 0 0 -1) r(2
91
+ 2) U5
92
+ body:
93
+ encoding: ASCII-8BIT
94
+ string: |
95
+ {
96
+ "sys": {
97
+ "id": "default",
98
+ "type": "EditorInterface",
99
+ "space": {
100
+ "sys": {
101
+ "id": "oe3b689om6k5",
102
+ "type": "Link",
103
+ "linkType": "Space"
104
+ }
105
+ },
106
+ "version": 30,
107
+ "createdAt": "2021-08-26T09:56:09.043Z",
108
+ "createdBy": {
109
+ "sys": {
110
+ "id": "59Erm8D1JuuD273aXNb65T",
111
+ "type": "Link",
112
+ "linkType": "User"
113
+ }
114
+ },
115
+ "updatedAt": "2021-08-31T10:19:33.152Z",
116
+ "updatedBy": {
117
+ "sys": {
118
+ "id": "59Erm8D1JuuD273aXNb65T",
119
+ "type": "Link",
120
+ "linkType": "User"
121
+ }
122
+ },
123
+ "contentType": {
124
+ "sys": {
125
+ "id": "smallerType",
126
+ "type": "Link",
127
+ "linkType": "ContentType"
128
+ }
129
+ },
130
+ "environment": {
131
+ "sys": {
132
+ "id": "master",
133
+ "type": "Link",
134
+ "linkType": "Environment"
135
+ }
136
+ }
137
+ },
138
+ "sidebar": [
139
+ {
140
+ "settings": {},
141
+ "widgetId": "flow-editor",
142
+ "widgetNamespace": "extension"
143
+ },
144
+ {
145
+ "settings": {},
146
+ "widgetId": "publication-widget",
147
+ "widgetNamespace": "sidebar-builtin"
148
+ },
149
+ {
150
+ "settings": {},
151
+ "widgetId": "content-workflows-tasks-widget",
152
+ "widgetNamespace": "sidebar-builtin"
153
+ },
154
+ {
155
+ "settings": {},
156
+ "widgetId": "content-preview-widget",
157
+ "widgetNamespace": "sidebar-builtin"
158
+ },
159
+ {
160
+ "settings": {},
161
+ "widgetId": "incoming-links-widget",
162
+ "widgetNamespace": "sidebar-builtin"
163
+ },
164
+ {
165
+ "settings": {},
166
+ "widgetId": "translation-widget",
167
+ "widgetNamespace": "sidebar-builtin"
168
+ },
169
+ {
170
+ "settings": {},
171
+ "widgetId": "versions-widget",
172
+ "widgetNamespace": "sidebar-builtin"
173
+ }
174
+ ],
175
+ "controls": [
176
+ {
177
+ "fieldId": "number",
178
+ "widgetId": "numberEditor",
179
+ "widgetNamespace": "builtin"
180
+ }
181
+ ]
182
+ }
183
+ http_version:
184
+ recorded_at: Tue, 31 Aug 2021 10:20:18 GMT
185
+ - request:
186
+ method: put
187
+ uri: https://api.contentful.com/spaces/oe3b689om6k5/environments/master/content_types/smallerType/editor_interface
188
+ body:
189
+ encoding: UTF-8
190
+ string: '{"controls":[{"fieldId":"number","widgetId":"numberEditor","widgetNamespace":"builtin"}],"sidebar":[{"settings":{},"widgetId":"date-range-editor","widgetNamespace":"extension"},{"settings":{},"widgetId":"publication-widget","widgetNamespace":"sidebar-builtin"},{"settings":{},"widgetId":"content-workflows-tasks-widget","widgetNamespace":"sidebar-builtin"},{"settings":{},"widgetId":"content-preview-widget","widgetNamespace":"sidebar-builtin"},{"settings":{},"widgetId":"incoming-links-widget","widgetNamespace":"sidebar-builtin"},{"settings":{},"widgetId":"translation-widget","widgetNamespace":"sidebar-builtin"},{"settings":{},"widgetId":"versions-widget","widgetNamespace":"sidebar-builtin"}]}'
191
+ headers:
192
+ X-Contentful-User-Agent:
193
+ - sdk contentful-management.rb/3.2.0; platform ruby/2.7.1; os macOS/19;
194
+ Authorization:
195
+ - Bearer <ACCESS_TOKEN>
196
+ Content-Type:
197
+ - application/vnd.contentful.management.v1+json
198
+ X-Contentful-Version:
199
+ - '30'
200
+ Version:
201
+ - '30'
202
+ Connection:
203
+ - close
204
+ Host:
205
+ - api.contentful.com
206
+ User-Agent:
207
+ - http.rb/4.4.1
208
+ response:
209
+ status:
210
+ code: 200
211
+ message: OK
212
+ headers:
213
+ Access-Control-Allow-Headers:
214
+ - Accept,Accept-Language,Authorization,Cache-Control,Content-Length,Content-Range,Content-Type,DNT,Destination,Expires,If-Match,If-Modified-Since,If-None-Match,Keep-Alive,Last-Modified,Origin,Pragma,Range,User-Agent,X-Http-Method-Override,X-Mx-ReqToken,X-Requested-With,X-Contentful-Version,X-Contentful-Content-Type,X-Contentful-Organization,X-Contentful-Skip-Transformation,X-Contentful-Tag-Visibility,X-Contentful-User-Agent,X-Contentful-Enable-Alpha-Feature,X-Contentful-Source-Environment,X-Contentful-Team,X-Contentful-Parent-Id,x-contentful-validate-only,X-Contentful-Skip-UI-Draft-Validation,X-Contentful-Marketplace,X-Contentful-UI-Content-Auto-Save,cf-trace
215
+ Access-Control-Allow-Methods:
216
+ - DELETE,GET,HEAD,POST,PUT,PATCH,OPTIONS
217
+ Access-Control-Allow-Origin:
218
+ - "*"
219
+ Access-Control-Expose-Headers:
220
+ - Etag
221
+ Access-Control-Max-Age:
222
+ - '1728000'
223
+ Cache-Control:
224
+ - no-store
225
+ Cf-Environment-Id:
226
+ - master
227
+ Cf-Environment-Uuid:
228
+ - master
229
+ Cf-Space-Id:
230
+ - oe3b689om6k5
231
+ Content-Type:
232
+ - application/vnd.contentful.management.v1+json
233
+ Contentful-Api:
234
+ - cma
235
+ Contentful-Origin-Time:
236
+ - '0.106'
237
+ Contentful-Upstream:
238
+ - content-api
239
+ Date:
240
+ - Tue, 31 Aug 2021 10:20:18 GMT
241
+ Etag:
242
+ - '"16854008209802380657"'
243
+ Server:
244
+ - Contentful
245
+ Strict-Transport-Security:
246
+ - max-age=15768000
247
+ X-Content-Type-Options:
248
+ - nosniff
249
+ X-Contentful-Ratelimit-Hour-Limit:
250
+ - '36000'
251
+ X-Contentful-Ratelimit-Hour-Remaining:
252
+ - '35998'
253
+ X-Contentful-Ratelimit-Reset:
254
+ - '0'
255
+ X-Contentful-Ratelimit-Second-Limit:
256
+ - '10'
257
+ X-Contentful-Ratelimit-Second-Remaining:
258
+ - '8'
259
+ X-Contentful-Request-Id:
260
+ - 6afaeff64b98fe67bf0383dc0b15b2a1
261
+ X-Contentful-Route:
262
+ - "/spaces/:space/environments/:environment/content_types/:content_type/editor_interface"
263
+ Content-Length:
264
+ - '1840'
265
+ Connection:
266
+ - Close
267
+ Set-Cookie:
268
+ - incap_ses_1515_673446=ZprePJmr8U8o2PF8glwGFWICLmEAAAAAWFRwxxnguDRExm4+p7HjTA==;
269
+ path=/; Domain=.contentful.com
270
+ - nlbi_673446=hmodGzv1U0O/86DFswL+7AAAAADOsaNMuMYnNwQq4Y+8/ihw; path=/; Domain=.contentful.com
271
+ - visid_incap_673446=Pf58drgyRLaipS+XicrkrmICLmEAAAAAQUIPAAAAAAD6uBvCoIA8z3dbW2aFi83c;
272
+ expires=Wed, 31 Aug 2022 09:15:16 GMT; HttpOnly; path=/; Domain=.contentful.com
273
+ X-Cdn:
274
+ - Imperva
275
+ X-Iinfo:
276
+ - 12-108821825-108821843 NNNY CT(91 92 0) RT(1630405218569 86) q(0 0 0 -1) r(2
277
+ 2) U5
278
+ body:
279
+ encoding: ASCII-8BIT
280
+ string: |
281
+ {
282
+ "controls": [
283
+ {
284
+ "fieldId": "number",
285
+ "widgetId": "numberEditor",
286
+ "widgetNamespace": "builtin"
287
+ }
288
+ ],
289
+ "sidebar": [
290
+ {
291
+ "settings": {},
292
+ "widgetId": "date-range-editor",
293
+ "widgetNamespace": "extension"
294
+ },
295
+ {
296
+ "settings": {},
297
+ "widgetId": "publication-widget",
298
+ "widgetNamespace": "sidebar-builtin"
299
+ },
300
+ {
301
+ "settings": {},
302
+ "widgetId": "content-workflows-tasks-widget",
303
+ "widgetNamespace": "sidebar-builtin"
304
+ },
305
+ {
306
+ "settings": {},
307
+ "widgetId": "content-preview-widget",
308
+ "widgetNamespace": "sidebar-builtin"
309
+ },
310
+ {
311
+ "settings": {},
312
+ "widgetId": "incoming-links-widget",
313
+ "widgetNamespace": "sidebar-builtin"
314
+ },
315
+ {
316
+ "settings": {},
317
+ "widgetId": "translation-widget",
318
+ "widgetNamespace": "sidebar-builtin"
319
+ },
320
+ {
321
+ "settings": {},
322
+ "widgetId": "versions-widget",
323
+ "widgetNamespace": "sidebar-builtin"
324
+ }
325
+ ],
326
+ "sys": {
327
+ "id": "default",
328
+ "type": "EditorInterface",
329
+ "space": {
330
+ "sys": {
331
+ "id": "oe3b689om6k5",
332
+ "type": "Link",
333
+ "linkType": "Space"
334
+ }
335
+ },
336
+ "version": 31,
337
+ "createdAt": "2021-08-26T09:56:09.043Z",
338
+ "createdBy": {
339
+ "sys": {
340
+ "id": "59Erm8D1JuuD273aXNb65T",
341
+ "type": "Link",
342
+ "linkType": "User"
343
+ }
344
+ },
345
+ "updatedAt": "2021-08-31T10:20:18.813Z",
346
+ "updatedBy": {
347
+ "sys": {
348
+ "type": "Link",
349
+ "linkType": "User",
350
+ "id": "59Erm8D1JuuD273aXNb65T"
351
+ }
352
+ },
353
+ "contentType": {
354
+ "sys": {
355
+ "id": "smallerType",
356
+ "type": "Link",
357
+ "linkType": "ContentType"
358
+ }
359
+ },
360
+ "environment": {
361
+ "sys": {
362
+ "id": "master",
363
+ "type": "Link",
364
+ "linkType": "Environment"
365
+ }
366
+ }
367
+ }
368
+ }
369
+ http_version:
370
+ recorded_at: Tue, 31 Aug 2021 10:20:18 GMT
371
+ - request:
372
+ method: get
373
+ uri: https://api.contentful.com/spaces/oe3b689om6k5/environments/master/content_types/smallerType/editor_interface
374
+ body:
375
+ encoding: UTF-8
376
+ string: ''
377
+ headers:
378
+ X-Contentful-User-Agent:
379
+ - sdk contentful-management.rb/3.2.0; platform ruby/2.7.1; os macOS/19;
380
+ Authorization:
381
+ - Bearer <ACCESS_TOKEN>
382
+ Content-Type:
383
+ - application/vnd.contentful.management.v1+json
384
+ Connection:
385
+ - close
386
+ Host:
387
+ - api.contentful.com
388
+ User-Agent:
389
+ - http.rb/4.4.1
390
+ response:
391
+ status:
392
+ code: 200
393
+ message: OK
394
+ headers:
395
+ Access-Control-Allow-Headers:
396
+ - Accept,Accept-Language,Authorization,Cache-Control,Content-Length,Content-Range,Content-Type,DNT,Destination,Expires,If-Match,If-Modified-Since,If-None-Match,Keep-Alive,Last-Modified,Origin,Pragma,Range,User-Agent,X-Http-Method-Override,X-Mx-ReqToken,X-Requested-With,X-Contentful-Version,X-Contentful-Content-Type,X-Contentful-Organization,X-Contentful-Skip-Transformation,X-Contentful-Tag-Visibility,X-Contentful-User-Agent,X-Contentful-Enable-Alpha-Feature,X-Contentful-Source-Environment,X-Contentful-Team,X-Contentful-Parent-Id,x-contentful-validate-only,X-Contentful-Skip-UI-Draft-Validation,X-Contentful-Marketplace,X-Contentful-UI-Content-Auto-Save,cf-trace
397
+ Access-Control-Allow-Methods:
398
+ - DELETE,GET,HEAD,POST,PUT,PATCH,OPTIONS
399
+ Access-Control-Allow-Origin:
400
+ - "*"
401
+ Access-Control-Expose-Headers:
402
+ - Etag
403
+ Access-Control-Max-Age:
404
+ - '1728000'
405
+ Cache-Control:
406
+ - no-store
407
+ Cf-Environment-Id:
408
+ - master
409
+ Cf-Environment-Uuid:
410
+ - master
411
+ Cf-Space-Id:
412
+ - oe3b689om6k5
413
+ Content-Type:
414
+ - application/vnd.contentful.management.v1+json
415
+ Contentful-Api:
416
+ - cma
417
+ Contentful-Origin-Time:
418
+ - '0.090'
419
+ Contentful-Upstream:
420
+ - content-api
421
+ Date:
422
+ - Tue, 31 Aug 2021 10:20:19 GMT
423
+ Etag:
424
+ - '"1520404690701152005"'
425
+ Server:
426
+ - Contentful
427
+ Strict-Transport-Security:
428
+ - max-age=15768000
429
+ X-Content-Type-Options:
430
+ - nosniff
431
+ X-Contentful-Ratelimit-Hour-Limit:
432
+ - '36000'
433
+ X-Contentful-Ratelimit-Hour-Remaining:
434
+ - '35999'
435
+ X-Contentful-Ratelimit-Reset:
436
+ - '0'
437
+ X-Contentful-Ratelimit-Second-Limit:
438
+ - '10'
439
+ X-Contentful-Ratelimit-Second-Remaining:
440
+ - '9'
441
+ X-Contentful-Request-Id:
442
+ - 768aefbd1bf920c59cb9219bd8503a1e
443
+ X-Contentful-Route:
444
+ - "/spaces/:space/environments/:environment/content_types/:content_type/editor_interface"
445
+ Content-Length:
446
+ - '1840'
447
+ Connection:
448
+ - Close
449
+ Set-Cookie:
450
+ - incap_ses_1515_673446=sIrAAatDWjJM2PF8glwGFWMCLmEAAAAAU60Unkt3cCzyaJSs9NLddw==;
451
+ path=/; Domain=.contentful.com
452
+ - nlbi_673446=CDYjLr3981KAf82TswL+7AAAAABuWgoj4uumDJKCPTYjt8ae; path=/; Domain=.contentful.com
453
+ - visid_incap_673446=5N5gnlJFTi2KEfSfLYA7WGMCLmEAAAAAQUIPAAAAAABs1rzsXdvwPOA6NmaFNZuU;
454
+ expires=Wed, 31 Aug 2022 09:15:15 GMT; HttpOnly; path=/; Domain=.contentful.com
455
+ X-Cdn:
456
+ - Imperva
457
+ X-Iinfo:
458
+ - 13-163708873-163708881 NNNY CT(101 200 0) RT(1630405218957 58) q(0 0 0 -1)
459
+ r(2 2) U5
460
+ body:
461
+ encoding: ASCII-8BIT
462
+ string: |
463
+ {
464
+ "sys": {
465
+ "id": "default",
466
+ "type": "EditorInterface",
467
+ "space": {
468
+ "sys": {
469
+ "id": "oe3b689om6k5",
470
+ "type": "Link",
471
+ "linkType": "Space"
472
+ }
473
+ },
474
+ "version": 31,
475
+ "createdAt": "2021-08-26T09:56:09.043Z",
476
+ "createdBy": {
477
+ "sys": {
478
+ "id": "59Erm8D1JuuD273aXNb65T",
479
+ "type": "Link",
480
+ "linkType": "User"
481
+ }
482
+ },
483
+ "updatedAt": "2021-08-31T10:20:18.813Z",
484
+ "updatedBy": {
485
+ "sys": {
486
+ "id": "59Erm8D1JuuD273aXNb65T",
487
+ "type": "Link",
488
+ "linkType": "User"
489
+ }
490
+ },
491
+ "contentType": {
492
+ "sys": {
493
+ "id": "smallerType",
494
+ "type": "Link",
495
+ "linkType": "ContentType"
496
+ }
497
+ },
498
+ "environment": {
499
+ "sys": {
500
+ "id": "master",
501
+ "type": "Link",
502
+ "linkType": "Environment"
503
+ }
504
+ }
505
+ },
506
+ "sidebar": [
507
+ {
508
+ "settings": {},
509
+ "widgetId": "date-range-editor",
510
+ "widgetNamespace": "extension"
511
+ },
512
+ {
513
+ "settings": {},
514
+ "widgetId": "publication-widget",
515
+ "widgetNamespace": "sidebar-builtin"
516
+ },
517
+ {
518
+ "settings": {},
519
+ "widgetId": "content-workflows-tasks-widget",
520
+ "widgetNamespace": "sidebar-builtin"
521
+ },
522
+ {
523
+ "settings": {},
524
+ "widgetId": "content-preview-widget",
525
+ "widgetNamespace": "sidebar-builtin"
526
+ },
527
+ {
528
+ "settings": {},
529
+ "widgetId": "incoming-links-widget",
530
+ "widgetNamespace": "sidebar-builtin"
531
+ },
532
+ {
533
+ "settings": {},
534
+ "widgetId": "translation-widget",
535
+ "widgetNamespace": "sidebar-builtin"
536
+ },
537
+ {
538
+ "settings": {},
539
+ "widgetId": "versions-widget",
540
+ "widgetNamespace": "sidebar-builtin"
541
+ }
542
+ ],
543
+ "controls": [
544
+ {
545
+ "fieldId": "number",
546
+ "widgetId": "numberEditor",
547
+ "widgetNamespace": "builtin"
548
+ }
549
+ ]
550
+ }
551
+ http_version:
552
+ recorded_at: Tue, 31 Aug 2021 10:20:19 GMT
553
+ recorded_with: VCR 4.0.0
@@ -51,6 +51,21 @@ module Contentful
51
51
  expect(editor_interface.controls.first['widgetId']).to eq 'urlEditor'
52
52
  end
53
53
  end
54
+
55
+ it 'can update the sidebar' do
56
+ vcr('editor_interfaces/update_sidebar') do
57
+ editor_interface = described_class.default(client, space_id, 'master', content_type_id)
58
+
59
+ expect(editor_interface.sidebar.first['widgetId']).to eq 'flow-editor'
60
+
61
+ editor_interface.sidebar.first['widgetId'] = 'date-range-editor'
62
+ editor_interface.update(sidebar: editor_interface.sidebar)
63
+
64
+ editor_interface.reload
65
+
66
+ expect(editor_interface.sidebar.first['widgetId']).to eq 'date-range-editor'
67
+ end
68
+ end
54
69
  end
55
70
 
56
71
  describe '#save' do
@@ -70,6 +85,21 @@ module Contentful
70
85
  expect(editor_interface.controls.first['widgetId']).to eq 'urlEditor'
71
86
  end
72
87
  end
88
+
89
+ it 'can save sidebar' do
90
+ vcr('editor_interfaces/update_sidebar') do
91
+ editor_interface = described_class.default(client, space_id, 'master', content_type_id)
92
+
93
+ expect(editor_interface.sidebar.first['widgetId']).to eq 'flow-editor'
94
+
95
+ editor_interface.sidebar.first['widgetId'] = 'date-range-editor'
96
+ editor_interface.save
97
+
98
+ editor_interface.reload
99
+
100
+ expect(editor_interface.sidebar.first['widgetId']).to eq 'date-range-editor'
101
+ end
102
+ end
73
103
  end
74
104
  end
75
105
  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: 3.2.0
4
+ version: 3.3.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: 2021-06-11 00:00:00.000000000 Z
13
+ date: 2021-08-31 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: http
@@ -546,6 +546,7 @@ files:
546
546
  - spec/fixtures/vcr_cassettes/delete_request.yml
547
547
  - spec/fixtures/vcr_cassettes/editor_interfaces/default_for_space.yml
548
548
  - spec/fixtures/vcr_cassettes/editor_interfaces/update.yml
549
+ - spec/fixtures/vcr_cassettes/editor_interfaces/update_sidebar.yml
549
550
  - spec/fixtures/vcr_cassettes/entry/all.yml
550
551
  - spec/fixtures/vcr_cassettes/entry/archive.yml
551
552
  - spec/fixtures/vcr_cassettes/entry/archive_published.yml
@@ -959,6 +960,7 @@ test_files:
959
960
  - spec/fixtures/vcr_cassettes/delete_request.yml
960
961
  - spec/fixtures/vcr_cassettes/editor_interfaces/default_for_space.yml
961
962
  - spec/fixtures/vcr_cassettes/editor_interfaces/update.yml
963
+ - spec/fixtures/vcr_cassettes/editor_interfaces/update_sidebar.yml
962
964
  - spec/fixtures/vcr_cassettes/entry/all.yml
963
965
  - spec/fixtures/vcr_cassettes/entry/archive.yml
964
966
  - spec/fixtures/vcr_cassettes/entry/archive_published.yml