ywana-core8 0.0.458 → 0.0.461

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.458",
3
+ "version": "0.0.461",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
@@ -15,7 +15,7 @@ import "./CollectionPage.css"
15
15
  export const CollectionPage = (props) => {
16
16
 
17
17
  const site = useContext(SiteContext)
18
- const { version=0, id = "collection", icon, title, name = "Collection 1", schema, url, page, host, groupBy, editor, field, autosave = false, delay = 1000, actions, levels, onSelect, children } = props
18
+ const { id = "collection", icon, title, name = "Collection 1", schema, url, page, host, groupBy, editor, field, autosave = false, delay = 1000, actions, levels, onSelect, children } = props
19
19
  const [pageContext, setPageContext] = useContext(PageContext)
20
20
  const context = CollectionContext(url, field, host, page)
21
21
 
@@ -24,10 +24,6 @@ export const CollectionPage = (props) => {
24
24
  setPageContext(context)
25
25
  }, [])
26
26
 
27
- useEffect(() => {
28
- if (version>0) reload()
29
- }, [version])
30
-
31
27
  async function reload() {
32
28
  await pageContext.load()
33
29
  setPageContext(Object.assign({}, pageContext))
@@ -187,12 +187,23 @@ const TableSelector = (props) => {
187
187
  const { all, checked } = pageContext
188
188
 
189
189
  const count = `${checked.size}/${all.length}`
190
+
191
+ const columns = Object.keys(schema)
192
+ .filter(key => schema[key].selectorColumn === true)
193
+ .map(field => ({id: field.id, label: field.label }))
194
+
195
+ console.log("TableSelector ",columns, schema)
196
+
190
197
  const rows = all.filter(item => checked.has(item.id))
191
198
  const table = {
192
- columns: [
193
- { id: "id", label: "ID" },
194
- { id: "idMatricula", label: "ID Matricula" },
195
- ],
199
+ columns,
200
+ /*
201
+ columns: [
202
+ { id: "id", label: "ID" },
203
+ { id: "idMatricula", label: "ID Matricula" },
204
+ { id: "flow", "Circuito"},
205
+ ],
206
+ */
196
207
  rows: rows || []
197
208
  }
198
209
  const buttons = actions.map(({ label, action }) => {