ywana-core8 0.0.831 → 0.0.832

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.831",
3
+ "version": "0.0.832",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
@@ -1,7 +1,7 @@
1
1
  import React, { useEffect, useContext, useState } from 'react'
2
2
  import { CollectionAPI } from '../domain/CollectionAPI'
3
3
  import { FORMATS, TYPES } from '../domain/ContentType'
4
- import { LinearProgress, Header, DataTable, Icon, TextField } from '../html'
4
+ import { LinearProgress, Header, DataTable, Icon, Chip } from '../html'
5
5
  import "./task.css"
6
6
 
7
7
  /**
@@ -94,6 +94,7 @@ export const TaskContextProvider = (props) => {
94
94
  createTask,
95
95
  updateTask,
96
96
  removeTask,
97
+ listeners: _listeners,
97
98
  addListener,
98
99
  removeListener
99
100
  };
@@ -151,7 +152,6 @@ export const TaskMonitor = (props) => {
151
152
  const { title = "Task Monitor", filters = {}, editors } = props
152
153
  const context = useContext(TaskContext)
153
154
  const [tasks = [], setTasks] = useState([])
154
- const [from, setFrom ] = useState(props.from)
155
155
 
156
156
  useEffect(() => {
157
157
  refresh()
@@ -162,8 +162,6 @@ export const TaskMonitor = (props) => {
162
162
  }, [])
163
163
 
164
164
  async function refresh() {
165
- if (from) filters["from"] = from
166
- console.log("refresh", filters)
167
165
  const tasks = await context.tasks(filters)
168
166
  setTasks(tasks)
169
167
  }
@@ -173,14 +171,10 @@ export const TaskMonitor = (props) => {
173
171
  refresh()
174
172
  }
175
173
 
176
- function changeFrom(id, value) {
177
- setFrom(value)
178
- }
179
-
180
174
  const table = {
181
175
  columns: [
182
176
  { id: "state", label: "Estado" },
183
- { id: "init", label: "Inicio", type: TYPES.STRING, format: FORMATS.DATE},
177
+ { id: "init", label: "Inicio", type: TYPES.STRING, format: FORMATS.DATE },
184
178
  { id: "end", label: "Fin", type: TYPES.STRING, format: FORMATS.DATE },
185
179
  { id: "description", label: "Descripcion" },
186
180
  { id: "progress", label: "%" },
@@ -218,7 +212,7 @@ export const TaskMonitor = (props) => {
218
212
  return (
219
213
  <div className="task-manager">
220
214
  <Header icon="list" title={title} >
221
- { from ? <TextField id="from" type="date" label="From" value={from} onChange={changeFrom} /> : null }
215
+ { context.listeners ? <Chip label={Object.keys(context.listeners).length} /> : null }
222
216
  </Header>
223
217
  <main>
224
218
  <DataTable {...table} />