@syncended/dsh-automations 0.3.0 → 0.3.1
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/lib/client.js +13 -2
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -40,6 +40,7 @@ window.__ModuleLoader__.load({
|
|
|
40
40
|
const MIN_TIMEOUT_MS = 1000;
|
|
41
41
|
const MAX_TIMEOUT_MS = 86400000;
|
|
42
42
|
const JOB_ID_PATTERN = /^[a-z0-9][a-z0-9-]{0,62}$/;
|
|
43
|
+
let formInstanceSerial = 0;
|
|
43
44
|
|
|
44
45
|
const BROWSER_TIMEZONE = (() => {
|
|
45
46
|
try {
|
|
@@ -600,6 +601,11 @@ window.__ModuleLoader__.load({
|
|
|
600
601
|
return h("span", { className: "dsh-auto-status dsh-auto-status-" + props.status }, props.status);
|
|
601
602
|
}
|
|
602
603
|
|
|
604
|
+
function nextFormInstancePrefix(reactFormId) {
|
|
605
|
+
formInstanceSerial += 1;
|
|
606
|
+
return "dsh-auto-form-" + formInstanceSerial + "-" + reactFormId;
|
|
607
|
+
}
|
|
608
|
+
|
|
603
609
|
function JobForm(props) {
|
|
604
610
|
const { meta, draft, editing, saving, error, onChange, onIdTouched, onSubmit, onCancel } = props;
|
|
605
611
|
const providers = meta && Array.isArray(meta.providers) ? meta.providers : [];
|
|
@@ -611,8 +617,12 @@ window.__ModuleLoader__.load({
|
|
|
611
617
|
: ["workspace-write"];
|
|
612
618
|
const agentPresets = meta && Array.isArray(meta.agentPresets) ? meta.agentPresets : [];
|
|
613
619
|
const creating = editing === null;
|
|
614
|
-
const
|
|
615
|
-
const
|
|
620
|
+
const reactFormId = String(useId()).replace(/[^A-Za-z0-9_-]/g, "");
|
|
621
|
+
const formPrefixRef = useRef(null);
|
|
622
|
+
if (formPrefixRef.current === null) {
|
|
623
|
+
formPrefixRef.current = nextFormInstancePrefix(reactFormId);
|
|
624
|
+
}
|
|
625
|
+
const fieldId = (name) => formPrefixRef.current + "-" + name;
|
|
616
626
|
|
|
617
627
|
return h(
|
|
618
628
|
"form",
|
|
@@ -1878,6 +1888,7 @@ window.__ModuleLoader__.load({
|
|
|
1878
1888
|
exports.agentPresetDisplayLabel = agentPresetDisplayLabel;
|
|
1879
1889
|
exports.permissionPresetPresentation = permissionPresetPresentation;
|
|
1880
1890
|
exports.PermissionPresetPicker = PermissionPresetPicker;
|
|
1891
|
+
exports.__testing = Object.freeze({ nextFormInstancePrefix });
|
|
1881
1892
|
exports.inject = inject;
|
|
1882
1893
|
exports.apply = apply;
|
|
1883
1894
|
return module.exports;
|