ywana-core8 0.0.782 → 0.0.783

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.782",
3
+ "version": "0.0.783",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
package/src/html/table.js CHANGED
@@ -381,7 +381,6 @@ export const StringCellEditor = ({ id, value = '', options, onChange }) => {
381
381
  */
382
382
  const SortIcon = (props) => {
383
383
  const { sortDir, onChange } = props
384
- console.log("sortDir", sortDir)
385
384
  const icon = sortDir ? sortDir > 0 ? "arrow_upward" : "arrow_downward" : "swap_vert"
386
385
  return <Icon icon={icon} size="small" clickable action={onChange} />
387
386
  }
@@ -167,7 +167,6 @@ export const TaskMonitor = (props) => {
167
167
  }
168
168
 
169
169
  async function remove(task) {
170
- console.log("remove", task)
171
170
  await context.removeTask(task)
172
171
  refresh()
173
172
  }
@@ -175,30 +174,39 @@ export const TaskMonitor = (props) => {
175
174
  const table = {
176
175
  columns: [
177
176
  { id: "state", label: "Estado" },
177
+ { id: "init", label: "Inicio", type: TYPES.STRING, format: FORMATS.DATE},
178
+ { id: "end", label: "Fin", type: TYPES.STRING, format: FORMATS.DATE },
178
179
  { id: "description", label: "Descripcion" },
179
180
  { id: "progress", label: "%" },
180
181
  { id: "percentage", label: "" },
181
- { id: "init", label: "Inicio", type: TYPES.STRING, format: FORMATS.DATE },
182
- { id: "end", label: "Fin", type: TYPES.STRING, format: FORMATS.DATE },
183
- { id: "resourceID", label: "Recurso" },
184
- { id: "owner", label: "Propietario" },
182
+ // { id: "resourceID", label: "Recurso" },
183
+ // { id: "owner", label: "Propietario" },
185
184
  { id: "actions", label: "" }
186
185
  ],
187
- rows: tasks.map(task => {
188
- return {
189
- id: task.id,
190
- state: task.state,
191
- description: task.description,
192
- progress: <LinearProgress progress={task.percentage} />,
193
- percentage: task.percentage,
194
- init: task.init,
195
- end: task.end,
196
- resourceID: task.resourceID,
197
- owner: task.owner,
198
- actions: <Icon size="small" icon="cancel" clickable action={() => remove(task)} />,
199
- info: editors && task.result ? <TaskInfo task={task} editors={editors} /> : null
200
- }
201
- })
186
+ rows: tasks
187
+
188
+ // sort by init date from recent to old
189
+ .sort((a, b) => {
190
+ if (a.init > b.init) return -1
191
+ if (a.init < b.init) return 1
192
+ return 0
193
+ })
194
+
195
+ .map(task => {
196
+ return {
197
+ id: task.id,
198
+ state: task.state,
199
+ description: task.description,
200
+ progress: <LinearProgress progress={task.percentage} />,
201
+ percentage: task.percentage,
202
+ init: task.init,
203
+ end: task.end,
204
+ resourceID: task.resourceID,
205
+ owner: task.owner,
206
+ actions: <Icon size="small" icon="cancel" clickable action={() => remove(task)} />,
207
+ info: editors && task.result ? <TaskInfo task={task} editors={editors} /> : null
208
+ }
209
+ })
202
210
  }
203
211
 
204
212
  return (