ywana-core8 0.0.618 → 0.0.619

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ywana-core8",
3
- "version": "0.0.618",
3
+ "version": "0.0.619",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
@@ -79,7 +79,7 @@ export const CollectionPage = (props) => {
79
79
  </Header>
80
80
  <menu className={`collection-page ${className}`}>
81
81
  <Header title={<Text>{name}</Text>} >
82
- { canFilter ? showFilter ? <Icon icon="filter_list" size="small" clickable action={toggleFilters} /> : <Icon icon="filter_list_off" size="small" clickable action={toggleFilters} /> : false }
82
+ {canFilter ? showFilter ? <Icon icon="filter_list" size="small" clickable action={toggleFilters} /> : <Icon icon="filter_list_off" size="small" clickable action={toggleFilters} /> : false}
83
83
  </Header>
84
84
  {canFilter && showFilter ? <CollectionFilters schema={schema} /> : null}
85
85
  {levels ? <CollectionTree schema={schema} icon={icon} levels={levels} onSelect={onSelect} sorter={sorter} searchBy={searchBy} /> : <CollectionList groupBy={groupBy} onSelect={onSelect} searchBy={searchBy} />}
@@ -229,13 +229,16 @@ export const CollectionTree = (props) => {
229
229
 
230
230
  function group(items, by) {
231
231
 
232
- console.log(schema, items, by)
233
232
  const options = schema[by] ? schema[by].options : null
234
233
 
235
234
  return items.reduce((nodes, field) => {
236
235
  let node = nodes.find(n => n.name === field[by])
237
236
  if (!node) {
238
- let name = options ? options.find(option => option.value === field[by]) : field[by]
237
+ let name = field[by]
238
+ if (options) {
239
+ const opt = options.find(option => option.value === field[by])
240
+ if (opt) name = opt.label
241
+ }
239
242
  node = { name, items: [], field: by }
240
243
  nodes.push(node)
241
244
  }
@@ -385,7 +388,7 @@ export const CollectionContext = (url, field, host, page, fetching) => {
385
388
  changeFilters(filters) {
386
389
  this.filters = filters
387
390
  },
388
-
391
+
389
392
  async load() {
390
393
  try {
391
394
  const data = await API.all(null, page);