@xeplr/ui-jobs 1.7.2 → 1.7.3
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/README.md +1 -0
- package/package.json +1 -1
- package/src/pages/Jobs.jsx +16 -3
package/README.md
CHANGED
|
@@ -190,6 +190,7 @@ registerJobsUI({
|
|
|
190
190
|
- **A kind with no source gets a plain text input.** An empty dropdown looks broken; a text box is what you have without a catalogue.
|
|
191
191
|
- A field with `dependsOn: 'connectionInfoId'` stays disabled until that field has a value, then requests `?connectionInfoId=<value>` and keeps only rows whose `connectionId` equals it.
|
|
192
192
|
- A field of `type: 'array'` with `optionsFrom` is **ticks**: several chosen at once, saved as a list (`["taskie", "taskie_jobs"]`), in the options' order. A saved value the source no longer offers stays ticked, marked "not offered now", so a save never drops it silently.
|
|
193
|
+
- An option the host marks **locked** (`locked`/`why` in its source, from `@xeplr/ui-utils` 1.2) is shown greyed with its reason, "Fraud check — Needs an AutoML seat", and cannot be picked. One already picked stays, with the reason under it, so the job says why it will not run.
|
|
193
194
|
- A failed fetch says "Could not load the list" rather than showing an empty one.
|
|
194
195
|
|
|
195
196
|
## Other exports
|
package/package.json
CHANGED
package/src/pages/Jobs.jsx
CHANGED
|
@@ -417,9 +417,9 @@ function RemoteSelect({ field, value, onChange, dependsOnValue }) {
|
|
|
417
417
|
<div className="jb-picks-list">
|
|
418
418
|
{shown.map((o) => (
|
|
419
419
|
<label key={o.value} className="jb-pick">
|
|
420
|
-
<input type="checkbox" checked={picked.includes(String(o.value))}
|
|
420
|
+
<input type="checkbox" checked={picked.includes(String(o.value))} disabled={Boolean(o.locked) && !picked.includes(String(o.value))}
|
|
421
421
|
onChange={() => onChange(toggled(picked, String(o.value), options))} />
|
|
422
|
-
<span>{o
|
|
422
|
+
<span>{optionText(o)}</span>
|
|
423
423
|
</label>
|
|
424
424
|
))}
|
|
425
425
|
</div>
|
|
@@ -444,15 +444,28 @@ function RemoteSelect({ field, value, onChange, dependsOnValue }) {
|
|
|
444
444
|
: options.length ? 'Choose…'
|
|
445
445
|
: 'Nothing to choose from'}
|
|
446
446
|
</option>
|
|
447
|
-
{(options || []).map((o) => <option key={o.value} value={o.value}
|
|
447
|
+
{(options || []).map((o) => <option key={o.value} value={o.value} disabled={Boolean(o.locked)}>{optionText(o)}</option>)}
|
|
448
448
|
</select>
|
|
449
449
|
{failed
|
|
450
450
|
? <span className="jb-help jb-warn">Could not load the list.</span>
|
|
451
|
+
: lockedPick(options, value) ? <span className="jb-help jb-warn">{lockedPick(options, value)}</span>
|
|
451
452
|
: field.description && <span className="jb-help">{field.description}</span>}
|
|
452
453
|
</div>
|
|
453
454
|
)
|
|
454
455
|
}
|
|
455
456
|
|
|
457
|
+
// A LOCKED OPTION (the host's list marks it: @xeplr/ui-utils createOptionSources
|
|
458
|
+
// `locked`/`why`) is offered greyed with its reason — "Fraud check — Needs an
|
|
459
|
+
// AutoML seat" — and cannot be picked. One already picked says why it will
|
|
460
|
+
// not run.
|
|
461
|
+
function optionText(o) {
|
|
462
|
+
return o.locked && o.why ? o.label + ' — ' + o.why : o.label
|
|
463
|
+
}
|
|
464
|
+
function lockedPick(options, value) {
|
|
465
|
+
const o = (options || []).find((x) => x.locked && String(x.value) === String(value))
|
|
466
|
+
return o ? o.label + ': ' + (o.why || 'cannot be used') : ''
|
|
467
|
+
}
|
|
468
|
+
|
|
456
469
|
/** One input, rendered as whatever its declared type actually is. */
|
|
457
470
|
function ActionInput({ field, value, onChange, inputs, contract }) {
|
|
458
471
|
const id = `jb-in-${field.name}`
|