ywana-core8 0.0.303 → 0.0.304

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.303",
3
+ "version": "0.0.304",
4
4
  "description": "ywana-core8",
5
5
  "author": "Ernesto Roldan Garcia",
6
6
  "license": "MIT",
@@ -23,7 +23,7 @@ export const TablePage = (props) => {
23
23
  editable,
24
24
  actions = [], dev = false, tableActions, selectionActions = [],
25
25
  canFilter = false, canAdd = true, canDelete = true, canEdit = true,
26
- canQuery = false, urlQuery,
26
+ canQuery = false, urlQuery, user,
27
27
  groupBy, validator, scenario,
28
28
  formFilter, tableFilter, editorFilter = false
29
29
  } = props
@@ -49,7 +49,7 @@ export const TablePage = (props) => {
49
49
  useEffect(async () => {
50
50
  const context = TableContext(url, field, host, urlQuery)
51
51
  await context.load()
52
- if (canQuery) await context.loadQueries()
52
+ if (canQuery) await context.loadQueries(user)
53
53
  setPageContext(context)
54
54
  }, [])
55
55
 
@@ -64,6 +64,8 @@ export const TablePage = (props) => {
64
64
  function saveQuery(filters) {
65
65
  const onOK = async (form) => {
66
66
  form.filters = filters
67
+ form.layout = {}
68
+ form.user = user
67
69
  await pageContext.createQuery(form)
68
70
  setPageContext(Object.assign({}, pageContext))
69
71
  }
@@ -520,9 +522,9 @@ const TableContext = (url, field, host, urlQuery) => {
520
522
  this.filters = filters
521
523
  },
522
524
 
523
- async loadQueries() {
525
+ async loadQueries(user) {
524
526
  try {
525
- this.queries = await API.queries(urlQuery)
527
+ this.queries = await API.queries(user,urlQuery)
526
528
  } catch (error) {
527
529
  console.log(error)
528
530
  }
@@ -598,9 +600,11 @@ const TableAPI = (url, host) => {
598
600
  return http.DELETE(`${url}/${id}`)
599
601
  },
600
602
 
601
- queries(url2) {
602
- const url3 = url2 ? url2 : url
603
- return http.GET(`${url3}queries`)
603
+ queries(user,url2) {
604
+ let url3 = url2 ? url2 : url
605
+ url3 = url3+"queries"
606
+ if (user) url3 = url3 + `?user=${user}`
607
+ return http.GET(url3)
604
608
  },
605
609
 
606
610
  createQuery(form, url2) {
@@ -1,6 +1,6 @@
1
1
  import { TYPES } from "ywana-core8";
2
2
 
3
3
  export const QUERY = {
4
- id : { section: "Info", id: "id" , type: TYPES.STRING , editable: false },
5
- name : { section: "Info", id: "name" , type: TYPES.STRING , required: true , label: "Name" },
4
+ id : { id: "id" , type: TYPES.STRING, editable: false },
5
+ name : { id: "name", type: TYPES.STRING, required: true , label: "Name" },
6
6
  }