ywana-core8 0.0.827 → 0.0.828
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/dist/index.cjs +21 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +2 -4
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +21 -2
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +21 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/incubator/task-test.js +1 -1
- package/src/incubator/task.css +3 -4
- package/src/incubator/task.js +13 -3
package/package.json
CHANGED
@@ -63,7 +63,7 @@ const TaskTest = (props) => {
|
|
63
63
|
|
64
64
|
return (
|
65
65
|
<TaskContextProvider host="http://localhost:3001" listeners={taskListeners} >
|
66
|
-
<TaskMonitor editors={taskEditors}/>
|
66
|
+
<TaskMonitor editors={taskEditors} from="2023-10-21"/>
|
67
67
|
<CreateTaskButton />
|
68
68
|
</TaskContextProvider>
|
69
69
|
)
|
package/src/incubator/task.css
CHANGED
@@ -4,8 +4,8 @@
|
|
4
4
|
flex-direction: column;
|
5
5
|
}
|
6
6
|
|
7
|
-
.task-manager>header {
|
8
|
-
|
7
|
+
.task-manager>header>.actions .from {
|
8
|
+
max-width: 14rem;
|
9
9
|
}
|
10
10
|
|
11
11
|
.task-manager>main {
|
@@ -27,5 +27,4 @@
|
|
27
27
|
|
28
28
|
.linear-progress>progress::-webkit-progress-value {
|
29
29
|
background-color: #2196f3;
|
30
|
-
}
|
31
|
-
|
30
|
+
}
|
package/src/incubator/task.js
CHANGED
@@ -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 } from '../html'
|
4
|
+
import { LinearProgress, Header, DataTable, Icon, TextField } from '../html'
|
5
5
|
import "./task.css"
|
6
6
|
|
7
7
|
/**
|
@@ -20,6 +20,7 @@ export const TaskContextProvider = (props) => {
|
|
20
20
|
|
21
21
|
async function tasks(filters, likes) {
|
22
22
|
try {
|
23
|
+
console.log("tasks", filters)
|
23
24
|
const response = await API.all(filters, likes);
|
24
25
|
return response;
|
25
26
|
} catch (error) {
|
@@ -149,9 +150,10 @@ export const TaskProgress = (props) => {
|
|
149
150
|
*/
|
150
151
|
export const TaskMonitor = (props) => {
|
151
152
|
|
152
|
-
const { title = "Task Monitor", filters, editors } = props
|
153
|
+
const { title = "Task Monitor", filters = {}, editors } = props
|
153
154
|
const context = useContext(TaskContext)
|
154
155
|
const [tasks = [], setTasks] = useState([])
|
156
|
+
const [from, setFrom ] = useState(props.from)
|
155
157
|
|
156
158
|
useEffect(() => {
|
157
159
|
refresh()
|
@@ -162,6 +164,8 @@ export const TaskMonitor = (props) => {
|
|
162
164
|
}, [])
|
163
165
|
|
164
166
|
async function refresh() {
|
167
|
+
if (from) filters["from"] = from
|
168
|
+
console.log("refresh", filters)
|
165
169
|
const tasks = await context.tasks(filters)
|
166
170
|
setTasks(tasks)
|
167
171
|
}
|
@@ -171,6 +175,10 @@ export const TaskMonitor = (props) => {
|
|
171
175
|
refresh()
|
172
176
|
}
|
173
177
|
|
178
|
+
function changeFrom(id, value) {
|
179
|
+
setFrom(value)
|
180
|
+
}
|
181
|
+
|
174
182
|
const table = {
|
175
183
|
columns: [
|
176
184
|
{ id: "state", label: "Estado" },
|
@@ -211,7 +219,9 @@ export const TaskMonitor = (props) => {
|
|
211
219
|
|
212
220
|
return (
|
213
221
|
<div className="task-manager">
|
214
|
-
<Header icon="list" title={title}
|
222
|
+
<Header icon="list" title={title} >
|
223
|
+
{ from ? <TextField id="from" type="date" label="From" value={from} onChange={changeFrom} /> : null }
|
224
|
+
</Header>
|
215
225
|
<main>
|
216
226
|
<DataTable {...table} />
|
217
227
|
</main>
|