ywana-core8 0.0.421 → 0.0.422

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.421",
3
+ "version": "0.0.422",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
@@ -30,10 +30,17 @@ export const TablePage = (props) => {
30
30
  } = props
31
31
 
32
32
  const [pageContext, setPageContext] = useContext(PageContext)
33
+ const context = TableContext(url, field, host, urlQuery)
33
34
  const { selected } = pageContext
34
35
  const timer = useRef(null)
35
36
  const [form, setForm] = useState(selected)
36
37
 
38
+ useEffect(() => {
39
+ await context.load()
40
+ if (canQuery) await context.loadQueries(user)
41
+ setPageContext(context)
42
+ }, [])
43
+
37
44
  useEffect(() => {
38
45
  setForm(selected)
39
46
  }, [selected])
@@ -47,12 +54,10 @@ export const TablePage = (props) => {
47
54
  }
48
55
  }, [form])
49
56
 
50
- useEffect(async () => {
51
- const context = TableContext(url, field, host, urlQuery)
52
- await context.load()
53
- if (canQuery) await context.loadQueries(user)
54
- setPageContext(context)
55
- }, [])
57
+ async function reload() {
58
+ await pageContext.load()
59
+ setPageContext(Object.assign({}, pageContext))
60
+ }
56
61
 
57
62
  function add() {
58
63
  const onOK = async (form) => {
@@ -130,6 +135,8 @@ export const TablePage = (props) => {
130
135
  <Fragment>
131
136
  <Header className="table-page" title={<Text>{title}</Text>}>
132
137
  {canAdd ? <Button icon="add" label="Añadir" action={add} raised /> : null}
138
+ &nbsp;
139
+ <Button icon="refresh" label="Reload" action={reload} />
133
140
  {dev ? (
134
141
  <MenuIcon align="alignRight">
135
142
  <MenuItem label="Cargar Escenario 1" onSelect={playScenario} />
@@ -124,7 +124,6 @@ export const DropDown = (props) => {
124
124
  const [label, setLabel] = useState()
125
125
 
126
126
  useEffect(() => {
127
- console.log('DD change value', label)
128
127
  if (Array.isArray(options)) {
129
128
  const option = options.find(option => option.value === value)
130
129
  const label = option ? option.label : ""
@@ -20,8 +20,15 @@ const TextFieldTest = (prop) => {
20
20
  { label: "Five", value: "5" },
21
21
  ]
22
22
 
23
+ const options2 = [
24
+ { label: "YES", value: "true" },
25
+ { label: "NO", value: "false" },
26
+ ]
27
+
28
+ console.log(form)
23
29
  return (
24
30
  <>
31
+ <DropDown id="b1" label="Boolean1" onChange={change} options={options2} value={form.b1} />
25
32
  <TokenField id="token1" label="Tokens" onChange={change} options={options}/>
26
33
  <TextField id="name" label="Name" value={form.name} onChange={change} />
27
34
  <DropDown id="gender1" label="Dropdown 1" value={form.gender1} onChange={change} options={options} predictive={false}/>