ywana-core8 0.0.457 → 0.0.460

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.457",
3
+ "version": "0.0.460",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
@@ -15,14 +15,14 @@ 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
 
22
22
  useEffect(async () => {
23
23
  await context.load()
24
24
  setPageContext(context)
25
- }, [version])
25
+ }, [])
26
26
 
27
27
  async function reload() {
28
28
  await pageContext.load()
@@ -187,12 +187,21 @@ 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
+
190
195
  const rows = all.filter(item => checked.has(item.id))
191
196
  const table = {
192
- columns: [
193
- { id: "id", label: "ID" },
194
- { id: "idMatricula", label: "ID Matricula" },
195
- ],
197
+ columns,
198
+ /*
199
+ columns: [
200
+ { id: "id", label: "ID" },
201
+ { id: "idMatricula", label: "ID Matricula" },
202
+ { id: "flow", "Circuito"},
203
+ ],
204
+ */
196
205
  rows: rows || []
197
206
  }
198
207
  const buttons = actions.map(({ label, action }) => {