ywana-core8 0.0.577 → 0.0.580

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.577",
3
+ "version": "0.0.580",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
@@ -38,13 +38,14 @@ export const TabbedTablePage = (props) => {
38
38
  const [tabs, setTabs] = useState([])
39
39
 
40
40
  useEffect(async () => {
41
+ if (canQuery) await context.loadQueries(user)
41
42
  const field = Object.values(schema).find(field => field.tab && field.tab === true)
42
43
  const tabs = field.options.map(option => Object.assign({}, option, { field: field.id }))
43
44
  setTabs(tabs)
44
45
  context.changeTab(tabs[0])
45
46
  setPageContext(context)
46
47
  }, [])
47
-
48
+
48
49
  useEffect(async () => {
49
50
  if (tab) {
50
51
  const filter = { [tab.field]: tab.value }
@@ -333,14 +334,11 @@ const TableFilters = (props) => {
333
334
  }, [schema])
334
335
 
335
336
  useEffect(() => {
336
- if (filters && !equal(filters, form)) setForm(filters)
337
+ if (filters) setForm(filters)
337
338
  }, [filters])
338
339
 
339
340
  useEffect(() => {
340
- if (pageContext.changeFilters && !equal(filters,form)) {
341
- pageContext.changeFilters(form)
342
- setPageContext(Object.assign({}, pageContext))
343
- }
341
+ reload()
344
342
  }, [form])
345
343
 
346
344
  async function change(next) {
@@ -387,13 +385,6 @@ export const TableEditor = (props) => {
387
385
  const { icon, title, schema, editable, canDelete, filter, actions, tabs, className } = props
388
386
  const [groupBy, setGroupBy] = useState(props.groupBy)
389
387
 
390
- useEffect(async () => {
391
- if (filters) {
392
- await pageContext.load(filters)
393
- setPageContext(Object.assign({}, pageContext))
394
- }
395
- }, [filters])
396
-
397
388
  function changeGroup(id, value) {
398
389
  setGroupBy(value)
399
390
  }