decap-cms-widget-list 3.4.0 → 3.5.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.
@@ -3,6 +3,12 @@ export default {
3
3
  allow_add: {
4
4
  type: 'boolean'
5
5
  },
6
+ allow_remove: {
7
+ type: 'boolean'
8
+ },
9
+ allow_reorder: {
10
+ type: 'boolean'
11
+ },
6
12
  collapsed: {
7
13
  type: 'boolean'
8
14
  },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "decap-cms-widget-list",
3
3
  "description": "Widget for editing lists in Decap CMS.",
4
- "version": "3.4.0",
4
+ "version": "3.5.0",
5
5
  "homepage": "https://www.decapcms.org/docs/widgets/#list",
6
6
  "repository": "https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-widget-list",
7
7
  "bugs": "https://github.com/decaporg/decap-cms/issues",
@@ -37,5 +37,5 @@
37
37
  "react": "^19.1.0",
38
38
  "react-immutable-proptypes": "^2.1.0"
39
39
  },
40
- "gitHead": "ed7e99318007b83f4c57f3237bf92b931676820a"
40
+ "gitHead": "13afe6686b32f7c03b4819d343d787c63f13664f"
41
41
  }
@@ -682,6 +682,8 @@ export default class ListControl extends React.Component {
682
682
  onCollapseToggle={partial(this.handleItemCollapseToggle, index)}
683
683
  dragHandle={DragHandle}
684
684
  id={key}
685
+ allowRemove={field.get('allow_remove', true)}
686
+ allowReorder={field.get('allow_reorder', true)}
685
687
  onRemove={partial(this.handleRemove, index)}
686
688
  data-testid={`styled-list-item-top-bar-${key}`}
687
689
  />
@@ -204,6 +204,8 @@ exports[`ListControl should add to list when add button is clicked 1`] = `
204
204
  class="emotion-15 emotion-16"
205
205
  >
206
206
  <mock-list-item-top-bar
207
+ allowremove=""
208
+ allowreorder=""
207
209
  class="emotion-17 emotion-18"
208
210
  data-testid="styled-list-item-top-bar-0"
209
211
  id="0"
@@ -454,6 +456,8 @@ exports[`ListControl should remove from list when remove button is clicked 1`] =
454
456
  class="emotion-15 emotion-16"
455
457
  >
456
458
  <mock-list-item-top-bar
459
+ allowremove=""
460
+ allowreorder=""
457
461
  class="emotion-17 emotion-18"
458
462
  data-testid="styled-list-item-top-bar-0"
459
463
  id="0"
@@ -482,6 +486,8 @@ exports[`ListControl should remove from list when remove button is clicked 1`] =
482
486
  class="emotion-15 emotion-16"
483
487
  >
484
488
  <mock-list-item-top-bar
489
+ allowremove=""
490
+ allowreorder=""
485
491
  class="emotion-17 emotion-18"
486
492
  data-testid="styled-list-item-top-bar-1"
487
493
  id="1"
@@ -732,6 +738,8 @@ exports[`ListControl should remove from list when remove button is clicked 2`] =
732
738
  class="emotion-15 emotion-16"
733
739
  >
734
740
  <mock-list-item-top-bar
741
+ allowremove=""
742
+ allowreorder=""
735
743
  class="emotion-17 emotion-18"
736
744
  collapsed=""
737
745
  data-testid="styled-list-item-top-bar-1"
@@ -995,6 +1003,8 @@ exports[`ListControl should render list with fields with collapse = "false" and
995
1003
  class="emotion-15 emotion-16"
996
1004
  >
997
1005
  <mock-list-item-top-bar
1006
+ allowremove=""
1007
+ allowreorder=""
998
1008
  class="emotion-17 emotion-18"
999
1009
  data-testid="styled-list-item-top-bar-0"
1000
1010
  id="0"
@@ -1023,6 +1033,8 @@ exports[`ListControl should render list with fields with collapse = "false" and
1023
1033
  class="emotion-15 emotion-16"
1024
1034
  >
1025
1035
  <mock-list-item-top-bar
1036
+ allowremove=""
1037
+ allowreorder=""
1026
1038
  class="emotion-17 emotion-18"
1027
1039
  data-testid="styled-list-item-top-bar-1"
1028
1040
  id="1"
@@ -1273,6 +1285,8 @@ exports[`ListControl should render list with fields with collapse = "false" and
1273
1285
  class="emotion-15 emotion-16"
1274
1286
  >
1275
1287
  <mock-list-item-top-bar
1288
+ allowremove=""
1289
+ allowreorder=""
1276
1290
  class="emotion-17 emotion-18"
1277
1291
  data-testid="styled-list-item-top-bar-0"
1278
1292
  id="0"
@@ -1301,6 +1315,8 @@ exports[`ListControl should render list with fields with collapse = "false" and
1301
1315
  class="emotion-15 emotion-16"
1302
1316
  >
1303
1317
  <mock-list-item-top-bar
1318
+ allowremove=""
1319
+ allowreorder=""
1304
1320
  class="emotion-17 emotion-18"
1305
1321
  data-testid="styled-list-item-top-bar-1"
1306
1322
  id="1"
@@ -1551,6 +1567,8 @@ exports[`ListControl should render list with fields with default collapse ("true
1551
1567
  class="emotion-15 emotion-16"
1552
1568
  >
1553
1569
  <mock-list-item-top-bar
1570
+ allowremove=""
1571
+ allowreorder=""
1554
1572
  class="emotion-17 emotion-18"
1555
1573
  collapsed=""
1556
1574
  data-testid="styled-list-item-top-bar-0"
@@ -1581,6 +1599,8 @@ exports[`ListControl should render list with fields with default collapse ("true
1581
1599
  class="emotion-15 emotion-16"
1582
1600
  >
1583
1601
  <mock-list-item-top-bar
1602
+ allowremove=""
1603
+ allowreorder=""
1584
1604
  class="emotion-17 emotion-18"
1585
1605
  collapsed=""
1586
1606
  data-testid="styled-list-item-top-bar-1"
@@ -2015,6 +2035,8 @@ exports[`ListControl should render list with nested object 1`] = `
2015
2035
  class="emotion-15 emotion-16"
2016
2036
  >
2017
2037
  <mock-list-item-top-bar
2038
+ allowremove=""
2039
+ allowreorder=""
2018
2040
  class="emotion-17 emotion-18"
2019
2041
  collapsed=""
2020
2042
  data-testid="styled-list-item-top-bar-0"
@@ -2045,6 +2067,8 @@ exports[`ListControl should render list with nested object 1`] = `
2045
2067
  class="emotion-15 emotion-16"
2046
2068
  >
2047
2069
  <mock-list-item-top-bar
2070
+ allowremove=""
2071
+ allowreorder=""
2048
2072
  class="emotion-17 emotion-18"
2049
2073
  collapsed=""
2050
2074
  data-testid="styled-list-item-top-bar-1"
@@ -2297,6 +2321,8 @@ exports[`ListControl should render list with nested object with collapse = false
2297
2321
  class="emotion-15 emotion-16"
2298
2322
  >
2299
2323
  <mock-list-item-top-bar
2324
+ allowremove=""
2325
+ allowreorder=""
2300
2326
  class="emotion-17 emotion-18"
2301
2327
  data-testid="styled-list-item-top-bar-0"
2302
2328
  id="0"
@@ -2325,6 +2351,8 @@ exports[`ListControl should render list with nested object with collapse = false
2325
2351
  class="emotion-15 emotion-16"
2326
2352
  >
2327
2353
  <mock-list-item-top-bar
2354
+ allowremove=""
2355
+ allowreorder=""
2328
2356
  class="emotion-17 emotion-18"
2329
2357
  data-testid="styled-list-item-top-bar-1"
2330
2358
  id="1"
package/src/schema.js CHANGED
@@ -1,6 +1,8 @@
1
1
  export default {
2
2
  properties: {
3
3
  allow_add: { type: 'boolean' },
4
+ allow_remove: { type: 'boolean' },
5
+ allow_reorder: { type: 'boolean' },
4
6
  collapsed: { type: 'boolean' },
5
7
  summary: { type: 'string' },
6
8
  minimize_collapsed: { type: 'boolean' },