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/dist/index.cjs +9 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +9 -4
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +9 -4
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/CollectionPage.js +7 -4
package/package.json
CHANGED
@@ -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
|
-
{
|
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 =
|
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);
|