@xeplr/ui-jobs 1.6.4 → 1.6.5
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 +2 -2
- package/src/pages/Jobs.jsx +3 -27
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xeplr/ui-jobs",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.5",
|
|
4
4
|
"description": "The screens for @xeplr/jobs — schedule, run, pause and watch jobs — as routes a host app registers, or a standalone app",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.jsx",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@vitejs/plugin-react": "^5.2.0",
|
|
49
49
|
"@xeplr/ui-account": "^1.0.2",
|
|
50
|
-
"@xeplr/ui-utils": "^1.1.
|
|
50
|
+
"@xeplr/ui-utils": "^1.1.5",
|
|
51
51
|
"react": "^19.2.4",
|
|
52
52
|
"react-dom": "^19.2.4",
|
|
53
53
|
"react-router-dom": "^7.13.2",
|
package/src/pages/Jobs.jsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Fragment, useCallback, useEffect, useMemo, useState } from 'react'
|
|
2
|
-
import { raiseConfirm, raiseSnackbar } from '@xeplr/ui-utils'
|
|
2
|
+
import { fieldLabel, raiseConfirm, raiseSnackbar } from '@xeplr/ui-utils'
|
|
3
3
|
import { relativeTime } from './relativeTime.js'
|
|
4
4
|
import {
|
|
5
5
|
listJobs, listOccurrences, listJobOccurrences, listJobActions, listActiveRuns,
|
|
@@ -288,32 +288,8 @@ function visibleFields(action, inputs) {
|
|
|
288
288
|
}
|
|
289
289
|
|
|
290
290
|
// ── labels ────────────────────────────────────────────────────────────────
|
|
291
|
-
//
|
|
292
|
-
//
|
|
293
|
-
// "connectionInfoId", "dbInfoId", "streaming_mode" and "batchSize" in front of
|
|
294
|
-
// people as though those were English.
|
|
295
|
-
//
|
|
296
|
-
// A schema may carry its own `label`; this is the fallback, and it is good
|
|
297
|
-
// enough that most fields will never need one. `Id`/`Info` are suffixes of the
|
|
298
|
-
// storage, not of the thing — you pick a Connection, not a connectionInfoId.
|
|
299
|
-
const LABEL_WORDS = { db: 'Database', sql: 'SQL', url: 'URL', id: 'ID', api: 'API' }
|
|
300
|
-
|
|
301
|
-
function fieldLabel(field) {
|
|
302
|
-
if (field.label) return field.label
|
|
303
|
-
return String(field.name)
|
|
304
|
-
.replace(/Id$/, '')
|
|
305
|
-
.replace(/Info$/, '')
|
|
306
|
-
.replace(/[_-]+/g, ' ')
|
|
307
|
-
.replace(/([a-z0-9])([A-Z])/g, '$1 $2')
|
|
308
|
-
.trim()
|
|
309
|
-
.split(' ')
|
|
310
|
-
.map((w, i) => {
|
|
311
|
-
const known = LABEL_WORDS[w.toLowerCase()]
|
|
312
|
-
if (known) return known
|
|
313
|
-
return i === 0 ? w.charAt(0).toUpperCase() + w.slice(1) : w.toLowerCase()
|
|
314
|
-
})
|
|
315
|
-
.join(' ')
|
|
316
|
-
}
|
|
291
|
+
// A field's name as words ("connectionInfoId" → "Connection") is
|
|
292
|
+
// @xeplr/ui-utils' fieldLabel, shared with X-Flow's step editor.
|
|
317
293
|
|
|
318
294
|
/**
|
|
319
295
|
* Split the fields into what you fill in and what you almost never touch.
|