@concretecms/bedrock 1.5.3 → 1.5.4

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.
@@ -25,8 +25,8 @@
25
25
  <th></th>
26
26
  <th></th>
27
27
  <th>{{ i18n.id }}</th>
28
- <th :class="getSortColumnClassName('fv.fvTitle')">
29
- <a v-if="enableSort" href="#" @click.prevent="sortBy('fv.fvTitle')">{{ i18n.name }}</a>
28
+ <th :class="getSortColumnClassName('name')">
29
+ <a v-if="enableSort" href="#" @click.prevent="sortBy('name')">{{ i18n.name }}</a>
30
30
  <span v-else>{{ i18n.name }}</span>
31
31
  </th>
32
32
  <th :class="getSortColumnClassName(dateSortColumn)">
@@ -99,7 +99,7 @@ export default {
99
99
  fileList: [],
100
100
  selectedFiles: [],
101
101
  sortByColumn: '',
102
- sortByDirection: 'desc',
102
+ sortByDirection: 'asc',
103
103
  pagination: null,
104
104
  queryParams: {
105
105
  pagination_page: 'ccm_paging_p',
@@ -300,7 +300,7 @@ export default {
300
300
  })
301
301
  },
302
302
  sortBy(column) {
303
- if (column === this.sortByColumn || (this.sortByColumn === '' && column === this.dateSortColumn)) {
303
+ if (column === this.sortByColumn || (this.sortByColumn === '' && column === 'name')) {
304
304
  this.sortByDirection = this.sortByDirection === 'asc' ? 'desc' : 'asc'
305
305
  }
306
306
 
@@ -309,7 +309,7 @@ export default {
309
309
  getSortColumnClassName(column) {
310
310
  let className = ''
311
311
  if (this.enableSort) {
312
- if (column === this.sortByColumn || (this.sortByColumn === '' && column === this.dateSortColumn)) {
312
+ if (column === this.sortByColumn || (this.sortByColumn === '' && column === 'name')) {
313
313
  className = `ccm-results-list-active-sort-${this.sortByDirection}`
314
314
  }
315
315
  }
@@ -139,9 +139,7 @@ ConcreteTree.prototype = {
139
139
  select: function (select, data) {
140
140
  if (options.chooseNodeInForm) {
141
141
  const keys = my.getSelectedNodeKeys(data.tree.getRootNode(), ajaxData.treeNodeSelectedIDs)
142
- if (keys.length) {
143
- options.onSelect(keys)
144
- }
142
+ options.onSelect(keys)
145
143
  }
146
144
  },
147
145
 
@@ -307,15 +305,18 @@ ConcreteTree.prototype = {
307
305
  })
308
306
  },
309
307
 
308
+ // Fancytree provides a selected keys array, but it doesn't include the children of closed categories.
309
+ // So we need to walk through the entire tree to get all selected nodes.
310
310
  getSelectedNodeKeys: function (node, selected) {
311
311
  var my = this
312
312
 
313
313
  // Initialize selected array
314
314
  selected = selected || []
315
315
 
316
- // Remove keys that are not in the tree anymore
317
- selected = selected.filter(function (key) {
318
- return $.ui.fancytree.getTree(my.$element).getNodeByKey(parseInt(key)) !== null
316
+ // We need to remove 0 as a selected key, because sometimes it comes from php and means null.
317
+ // See: https://github.com/concretecms/concretecms/issues/12118
318
+ selected = selected.filter(function (value) {
319
+ return parseInt(value) > 0
319
320
  })
320
321
 
321
322
  // Walk through all child nodes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@concretecms/bedrock",
3
- "version": "1.5.3",
3
+ "version": "1.5.4",
4
4
  "description": "The asset framework and dependencies for Concrete CMS.",
5
5
  "scripts": {
6
6
  "lint": "standardx \"**/*.{js,vue}\" && stylelint assets/**/*.{scss,vue}",