ywana-core8 0.0.715 → 0.0.717

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.715",
3
+ "version": "0.0.717",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
@@ -8,11 +8,11 @@ export const CollectionContext = React.createContext()
8
8
  */
9
9
  export const CollectionContextProvider = (props) => {
10
10
 
11
- const { host, url, page, fetching=true, field, versioning = false, children } = props
11
+ const { host, url, page, fetching=true, field, versioning = false, children, filtersValue } = props
12
12
  const API = CollectionAPI(url, host)
13
13
 
14
14
  const [all, setAll] = useState([])
15
- const [filters, setFilters] = useState()
15
+ const [filters, setFilters] = useState(filtersValue)
16
16
  const [likes, setLikes] = useState([])
17
17
  const [customFilters, setCustomFilters] = useState({})
18
18
  const [queries, setQueries] = useState([])
@@ -9,13 +9,12 @@ import './CollectionFilters.css'
9
9
  */
10
10
  export const CollectionFilters = (props) => {
11
11
 
12
- const { schema, children, value } = props
12
+ const { schema, children } = props
13
13
  const context = useContext(CollectionContext)
14
14
  const { filters } = context
15
15
  const [open, setOpen] = useState(false)
16
16
 
17
17
  useEffect(() => {
18
- context.setFilters(value)
19
18
  const likes = Object.keys(schema).filter(id => schema[id].like === true)
20
19
  context.setLikes(likes)
21
20
  }, [schema])
@@ -22,11 +22,11 @@ export const CollectionPage = (props) => {
22
22
 
23
23
  return (
24
24
  <div className={`collection-page ${layout}`}>
25
- <CollectionContextProvider host={host} url={url}>
25
+ <CollectionContextProvider host={host} url={url} filtersValue={filtersValue}>
26
26
  <Header title={title} >
27
27
  {actions}
28
28
  </Header>
29
- {canFilter ? <CollectionFilters schema={schema} value={filtersValue} >{customFilters}</CollectionFilters> : null}
29
+ {canFilter ? <CollectionFilters schema={schema} >{customFilters}</CollectionFilters> : null}
30
30
  <CollectionList itemRenderer={listItemRenderer} groupBy={listGroupBy} searchBy={listSearchBy} />
31
31
  <CollectionEditor customEditor={customEditor} />
32
32
  </CollectionContextProvider>