@yadsh/dsh-qa-integrations 0.8.2 → 0.9.0

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 CHANGED
@@ -6493,7 +6493,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6493
6493
  },
6494
6494
  sourceLocation: {
6495
6495
  "file": "packages/dsh-qa-integrations/src/index.ts",
6496
- "line": 500,
6496
+ "line": 501,
6497
6497
  "column": 3
6498
6498
  }
6499
6499
  },
@@ -6520,7 +6520,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6520
6520
  },
6521
6521
  sourceLocation: {
6522
6522
  "file": "packages/dsh-qa-integrations/src/index.ts",
6523
- "line": 592,
6523
+ "line": 593,
6524
6524
  "column": 3
6525
6525
  }
6526
6526
  },
@@ -6556,7 +6556,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6556
6556
  },
6557
6557
  sourceLocation: {
6558
6558
  "file": "packages/dsh-qa-integrations/src/index.ts",
6559
- "line": 940,
6559
+ "line": 941,
6560
6560
  "column": 9
6561
6561
  }
6562
6562
  },
@@ -6574,7 +6574,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6574
6574
  },
6575
6575
  sourceLocation: {
6576
6576
  "file": "packages/dsh-qa-integrations/src/index.ts",
6577
- "line": 449,
6577
+ "line": 450,
6578
6578
  "column": 3
6579
6579
  }
6580
6580
  },
@@ -6601,7 +6601,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6601
6601
  },
6602
6602
  sourceLocation: {
6603
6603
  "file": "packages/dsh-qa-integrations/src/index.ts",
6604
- "line": 519,
6604
+ "line": 520,
6605
6605
  "column": 3
6606
6606
  }
6607
6607
  },
@@ -6628,7 +6628,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6628
6628
  },
6629
6629
  sourceLocation: {
6630
6630
  "file": "packages/dsh-qa-integrations/src/index.ts",
6631
- "line": 654,
6631
+ "line": 655,
6632
6632
  "column": 3
6633
6633
  }
6634
6634
  },
@@ -6655,7 +6655,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6655
6655
  },
6656
6656
  sourceLocation: {
6657
6657
  "file": "packages/dsh-qa-integrations/src/index.ts",
6658
- "line": 580,
6658
+ "line": 581,
6659
6659
  "column": 3
6660
6660
  }
6661
6661
  },
@@ -6682,7 +6682,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6682
6682
  },
6683
6683
  sourceLocation: {
6684
6684
  "file": "packages/dsh-qa-integrations/src/index.ts",
6685
- "line": 790,
6685
+ "line": 791,
6686
6686
  "column": 3
6687
6687
  }
6688
6688
  },
@@ -6709,7 +6709,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6709
6709
  },
6710
6710
  sourceLocation: {
6711
6711
  "file": "packages/dsh-qa-integrations/src/index.ts",
6712
- "line": 718,
6712
+ "line": 719,
6713
6713
  "column": 3
6714
6714
  }
6715
6715
  },
@@ -6736,7 +6736,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6736
6736
  },
6737
6737
  sourceLocation: {
6738
6738
  "file": "packages/dsh-qa-integrations/src/index.ts",
6739
- "line": 851,
6739
+ "line": 852,
6740
6740
  "column": 3
6741
6741
  }
6742
6742
  },
@@ -6763,7 +6763,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6763
6763
  },
6764
6764
  sourceLocation: {
6765
6765
  "file": "packages/dsh-qa-integrations/src/index.ts",
6766
- "line": 912,
6766
+ "line": 913,
6767
6767
  "column": 3
6768
6768
  }
6769
6769
  },
@@ -6790,7 +6790,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6790
6790
  },
6791
6791
  sourceLocation: {
6792
6792
  "file": "packages/dsh-qa-integrations/src/index.ts",
6793
- "line": 470,
6793
+ "line": 471,
6794
6794
  "column": 3
6795
6795
  }
6796
6796
  },
@@ -6817,7 +6817,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6817
6817
  },
6818
6818
  sourceLocation: {
6819
6819
  "file": "packages/dsh-qa-integrations/src/index.ts",
6820
- "line": 597,
6820
+ "line": 598,
6821
6821
  "column": 3
6822
6822
  }
6823
6823
  },
@@ -6844,7 +6844,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6844
6844
  },
6845
6845
  sourceLocation: {
6846
6846
  "file": "packages/dsh-qa-integrations/src/index.ts",
6847
- "line": 536,
6847
+ "line": 537,
6848
6848
  "column": 3
6849
6849
  }
6850
6850
  },
@@ -6871,7 +6871,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6871
6871
  },
6872
6872
  sourceLocation: {
6873
6873
  "file": "packages/dsh-qa-integrations/src/index.ts",
6874
- "line": 736,
6874
+ "line": 737,
6875
6875
  "column": 3
6876
6876
  }
6877
6877
  },
@@ -6898,7 +6898,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6898
6898
  },
6899
6899
  sourceLocation: {
6900
6900
  "file": "packages/dsh-qa-integrations/src/index.ts",
6901
- "line": 661,
6901
+ "line": 662,
6902
6902
  "column": 3
6903
6903
  }
6904
6904
  },
@@ -6925,7 +6925,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6925
6925
  },
6926
6926
  sourceLocation: {
6927
6927
  "file": "packages/dsh-qa-integrations/src/index.ts",
6928
- "line": 807,
6928
+ "line": 808,
6929
6929
  "column": 3
6930
6930
  }
6931
6931
  },
@@ -6952,7 +6952,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6952
6952
  },
6953
6953
  sourceLocation: {
6954
6954
  "file": "packages/dsh-qa-integrations/src/index.ts",
6955
- "line": 868,
6955
+ "line": 869,
6956
6956
  "column": 3
6957
6957
  }
6958
6958
  },
@@ -6979,7 +6979,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6979
6979
  },
6980
6980
  sourceLocation: {
6981
6981
  "file": "packages/dsh-qa-integrations/src/index.ts",
6982
- "line": 531,
6982
+ "line": 532,
6983
6983
  "column": 3
6984
6984
  }
6985
6985
  },
@@ -7006,7 +7006,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7006
7006
  },
7007
7007
  sourceLocation: {
7008
7008
  "file": "packages/dsh-qa-integrations/src/index.ts",
7009
- "line": 731,
7009
+ "line": 732,
7010
7010
  "column": 3
7011
7011
  }
7012
7012
  },
@@ -7033,7 +7033,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7033
7033
  },
7034
7034
  sourceLocation: {
7035
7035
  "file": "packages/dsh-qa-integrations/src/index.ts",
7036
- "line": 465,
7036
+ "line": 466,
7037
7037
  "column": 3
7038
7038
  }
7039
7039
  },
@@ -7060,7 +7060,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7060
7060
  },
7061
7061
  sourceLocation: {
7062
7062
  "file": "packages/dsh-qa-integrations/src/index.ts",
7063
- "line": 924,
7063
+ "line": 925,
7064
7064
  "column": 3
7065
7065
  }
7066
7066
  },
@@ -7096,7 +7096,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7096
7096
  },
7097
7097
  sourceLocation: {
7098
7098
  "file": "packages/dsh-qa-integrations/src/index.ts",
7099
- "line": 512,
7099
+ "line": 513,
7100
7100
  "column": 3
7101
7101
  }
7102
7102
  },
@@ -7132,7 +7132,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7132
7132
  },
7133
7133
  sourceLocation: {
7134
7134
  "file": "packages/dsh-qa-integrations/src/index.ts",
7135
- "line": 647,
7135
+ "line": 648,
7136
7136
  "column": 3
7137
7137
  }
7138
7138
  },
@@ -7168,7 +7168,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7168
7168
  },
7169
7169
  sourceLocation: {
7170
7170
  "file": "packages/dsh-qa-integrations/src/index.ts",
7171
- "line": 573,
7171
+ "line": 574,
7172
7172
  "column": 3
7173
7173
  }
7174
7174
  },
@@ -7204,7 +7204,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7204
7204
  },
7205
7205
  sourceLocation: {
7206
7206
  "file": "packages/dsh-qa-integrations/src/index.ts",
7207
- "line": 783,
7207
+ "line": 784,
7208
7208
  "column": 3
7209
7209
  }
7210
7210
  },
@@ -7240,7 +7240,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7240
7240
  },
7241
7241
  sourceLocation: {
7242
7242
  "file": "packages/dsh-qa-integrations/src/index.ts",
7243
- "line": 711,
7243
+ "line": 712,
7244
7244
  "column": 3
7245
7245
  }
7246
7246
  },
@@ -7276,7 +7276,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7276
7276
  },
7277
7277
  sourceLocation: {
7278
7278
  "file": "packages/dsh-qa-integrations/src/index.ts",
7279
- "line": 844,
7279
+ "line": 845,
7280
7280
  "column": 3
7281
7281
  }
7282
7282
  },
@@ -7312,7 +7312,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7312
7312
  },
7313
7313
  sourceLocation: {
7314
7314
  "file": "packages/dsh-qa-integrations/src/index.ts",
7315
- "line": 905,
7315
+ "line": 906,
7316
7316
  "column": 3
7317
7317
  }
7318
7318
  },
@@ -7339,7 +7339,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7339
7339
  },
7340
7340
  sourceLocation: {
7341
7341
  "file": "packages/dsh-qa-integrations/src/index.ts",
7342
- "line": 460,
7342
+ "line": 461,
7343
7343
  "column": 3
7344
7344
  }
7345
7345
  },
@@ -7375,7 +7375,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7375
7375
  },
7376
7376
  sourceLocation: {
7377
7377
  "file": "packages/dsh-qa-integrations/src/index.ts",
7378
- "line": 477,
7378
+ "line": 478,
7379
7379
  "column": 9
7380
7380
  }
7381
7381
  },
@@ -7411,7 +7411,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7411
7411
  },
7412
7412
  sourceLocation: {
7413
7413
  "file": "packages/dsh-qa-integrations/src/index.ts",
7414
- "line": 612,
7414
+ "line": 613,
7415
7415
  "column": 9
7416
7416
  }
7417
7417
  },
@@ -7447,7 +7447,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7447
7447
  },
7448
7448
  sourceLocation: {
7449
7449
  "file": "packages/dsh-qa-integrations/src/index.ts",
7450
- "line": 543,
7450
+ "line": 544,
7451
7451
  "column": 9
7452
7452
  }
7453
7453
  },
@@ -7483,7 +7483,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7483
7483
  },
7484
7484
  sourceLocation: {
7485
7485
  "file": "packages/dsh-qa-integrations/src/index.ts",
7486
- "line": 743,
7486
+ "line": 744,
7487
7487
  "column": 9
7488
7488
  }
7489
7489
  },
@@ -7519,7 +7519,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7519
7519
  },
7520
7520
  sourceLocation: {
7521
7521
  "file": "packages/dsh-qa-integrations/src/index.ts",
7522
- "line": 674,
7522
+ "line": 675,
7523
7523
  "column": 9
7524
7524
  }
7525
7525
  },
@@ -7555,7 +7555,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7555
7555
  },
7556
7556
  sourceLocation: {
7557
7557
  "file": "packages/dsh-qa-integrations/src/index.ts",
7558
- "line": 814,
7558
+ "line": 815,
7559
7559
  "column": 9
7560
7560
  }
7561
7561
  },
@@ -7591,7 +7591,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7591
7591
  },
7592
7592
  sourceLocation: {
7593
7593
  "file": "packages/dsh-qa-integrations/src/index.ts",
7594
- "line": 875,
7594
+ "line": 876,
7595
7595
  "column": 9
7596
7596
  }
7597
7597
  },
@@ -7627,7 +7627,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7627
7627
  },
7628
7628
  sourceLocation: {
7629
7629
  "file": "packages/dsh-qa-integrations/src/index.ts",
7630
- "line": 958,
7630
+ "line": 959,
7631
7631
  "column": 3
7632
7632
  }
7633
7633
  },
@@ -7663,7 +7663,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7663
7663
  },
7664
7664
  sourceLocation: {
7665
7665
  "file": "packages/dsh-qa-integrations/src/index.ts",
7666
- "line": 979,
7666
+ "line": 980,
7667
7667
  "column": 3
7668
7668
  }
7669
7669
  },
@@ -7690,7 +7690,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7690
7690
  },
7691
7691
  sourceLocation: {
7692
7692
  "file": "packages/dsh-qa-integrations/src/index.ts",
7693
- "line": 699,
7693
+ "line": 700,
7694
7694
  "column": 3
7695
7695
  }
7696
7696
  },
@@ -7717,7 +7717,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7717
7717
  },
7718
7718
  sourceLocation: {
7719
7719
  "file": "packages/dsh-qa-integrations/src/index.ts",
7720
- "line": 505,
7720
+ "line": 506,
7721
7721
  "column": 9
7722
7722
  }
7723
7723
  },
@@ -7744,7 +7744,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7744
7744
  },
7745
7745
  sourceLocation: {
7746
7746
  "file": "packages/dsh-qa-integrations/src/index.ts",
7747
- "line": 640,
7747
+ "line": 641,
7748
7748
  "column": 9
7749
7749
  }
7750
7750
  },
@@ -7771,7 +7771,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7771
7771
  },
7772
7772
  sourceLocation: {
7773
7773
  "file": "packages/dsh-qa-integrations/src/index.ts",
7774
- "line": 566,
7774
+ "line": 567,
7775
7775
  "column": 9
7776
7776
  }
7777
7777
  },
@@ -7798,7 +7798,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7798
7798
  },
7799
7799
  sourceLocation: {
7800
7800
  "file": "packages/dsh-qa-integrations/src/index.ts",
7801
- "line": 802,
7801
+ "line": 803,
7802
7802
  "column": 3
7803
7803
  }
7804
7804
  },
@@ -7825,7 +7825,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7825
7825
  },
7826
7826
  sourceLocation: {
7827
7827
  "file": "packages/dsh-qa-integrations/src/index.ts",
7828
- "line": 776,
7828
+ "line": 777,
7829
7829
  "column": 9
7830
7830
  }
7831
7831
  },
@@ -7852,7 +7852,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7852
7852
  },
7853
7853
  sourceLocation: {
7854
7854
  "file": "packages/dsh-qa-integrations/src/index.ts",
7855
- "line": 704,
7855
+ "line": 705,
7856
7856
  "column": 9
7857
7857
  }
7858
7858
  },
@@ -7879,7 +7879,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7879
7879
  },
7880
7880
  sourceLocation: {
7881
7881
  "file": "packages/dsh-qa-integrations/src/index.ts",
7882
- "line": 837,
7882
+ "line": 838,
7883
7883
  "column": 9
7884
7884
  }
7885
7885
  },
@@ -7906,7 +7906,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7906
7906
  },
7907
7907
  sourceLocation: {
7908
7908
  "file": "packages/dsh-qa-integrations/src/index.ts",
7909
- "line": 898,
7909
+ "line": 899,
7910
7910
  "column": 9
7911
7911
  }
7912
7912
  },
@@ -7933,7 +7933,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7933
7933
  },
7934
7934
  sourceLocation: {
7935
7935
  "file": "packages/dsh-qa-integrations/src/index.ts",
7936
- "line": 863,
7936
+ "line": 864,
7937
7937
  "column": 3
7938
7938
  }
7939
7939
  }
@@ -10212,6 +10212,17 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10212
10212
  else if (!HTTP_URL.test(baseUrl)) missing.push("абсолютный адрес http(s)://");
10213
10213
  return missing;
10214
10214
  }
10215
+ /** What a profile row is still missing; empty when the Host would take it. */
10216
+ function profileDraftMissing(row) {
10217
+ const missing = [];
10218
+ const id = row.id.trim();
10219
+ if (id === "") missing.push("id");
10220
+ else if (!ROW_ID.test(id)) missing.push("id строчными латинскими буквами, цифрами и дефисом");
10221
+ if (row.provider.trim() === "") missing.push("провайдер");
10222
+ if (row.instance.trim() === "") missing.push("инстанс");
10223
+ if (!row.resources.some(([key, value]) => key.trim() !== "" && value.trim() !== "")) missing.push("ограничение ресурсов");
10224
+ return missing;
10225
+ }
10215
10226
  /**
10216
10227
  * What the card says about a row it has not committed: the missing fields, or —
10217
10228
  * when nothing is missing and the Host still did not take the row — that the
@@ -10485,8 +10496,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10485
10496
  function InstanceListField(props) {
10486
10497
  const deployments = props.deployments;
10487
10498
  const [drafts, setDrafts] = (0, react.useState)(() => props.instances.map((row) => ({ ...row })));
10499
+ const storedCount = (0, react.useRef)(props.instances.length);
10488
10500
  (0, react.useEffect)(() => {
10489
- setDrafts((current) => [...props.instances.map((row) => ({ ...row })), ...current.slice(props.instances.length)]);
10501
+ setDrafts((current) => {
10502
+ const accepted = Math.max(0, props.instances.length - storedCount.current);
10503
+ const pending = current.slice(storedCount.current + accepted);
10504
+ storedCount.current = props.instances.length;
10505
+ return [...props.instances.map((row) => ({ ...row })), ...pending];
10506
+ });
10490
10507
  }, [props.instances]);
10491
10508
  /**
10492
10509
  * Writes the rows the Host can take — every stored row, plus the drafts that
@@ -10494,11 +10511,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10494
10511
  * to make the Host refuse the whole array, which is why «добавить» looked
10495
10512
  * like it did nothing.
10496
10513
  */
10497
- const commit = (next) => {
10514
+ const commit = (next, unsetWhenEmpty = next.length === 0) => {
10498
10515
  setDrafts(next);
10499
- const takeable = next.filter((row, at) => at < props.instances.length || instanceDraftMissing(row).length === 0);
10516
+ const takeable = next.filter((row, at) => at < storedCount.current || instanceDraftMissing(row).length === 0);
10500
10517
  if (takeable.length === 0) {
10501
- if (next.length === 0) props.unset(props.path);
10518
+ if (unsetWhenEmpty) props.unset(props.path);
10502
10519
  return;
10503
10520
  }
10504
10521
  props.write(props.path, takeable.map((row) => ({ ...row })));
@@ -10517,7 +10534,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10517
10534
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
10518
10535
  className: "qai-op__instances",
10519
10536
  children: drafts.map((row, index) => {
10520
- const stored = props.instances[index];
10537
+ const stored = index < storedCount.current ? props.instances[index] : void 0;
10521
10538
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
10522
10539
  className: "qai-op__instance",
10523
10540
  children: [
@@ -10613,11 +10630,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10613
10630
  className: "qai-op__row-remove",
10614
10631
  disabled: props.disabled,
10615
10632
  onClick: () => {
10616
- commit(drafts.filter((_, at) => at !== index));
10633
+ const removedStored = index < storedCount.current;
10634
+ if (removedStored) storedCount.current -= 1;
10635
+ commit(drafts.filter((_, at) => at !== index), removedStored);
10617
10636
  },
10618
10637
  children: "убрать"
10619
10638
  }),
10620
- index >= props.instances.length ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
10639
+ index >= storedCount.current ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
10621
10640
  className: "qai-op__pending",
10622
10641
  children: draftNote(instanceDraftMissing(row))
10623
10642
  }) : null
@@ -11016,34 +11035,43 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11016
11035
  */
11017
11036
  function ServiceProfilesField(props) {
11018
11037
  const [drafts, setDrafts] = (0, react.useState)(props.profiles);
11038
+ const storedCount = (0, react.useRef)(props.profiles.length);
11019
11039
  (0, react.useEffect)(() => {
11020
- setDrafts(props.profiles);
11040
+ setDrafts((current) => {
11041
+ const accepted = Math.max(0, props.profiles.length - storedCount.current);
11042
+ const pending = current.slice(storedCount.current + accepted);
11043
+ storedCount.current = props.profiles.length;
11044
+ return [...props.profiles, ...pending];
11045
+ });
11021
11046
  }, [props.profiles]);
11022
- const commit = (next) => {
11047
+ const commit = (next, unsetWhenEmpty = next.length === 0) => {
11023
11048
  setDrafts(next);
11024
- if (next.length === 0) {
11025
- props.unset(["managedServiceCredentials", "profiles"]);
11049
+ const persisted = next.slice(0, storedCount.current);
11050
+ if (persisted.some((row) => profileDraftMissing(row).length > 0)) return;
11051
+ const takeable = [...persisted, ...next.slice(storedCount.current).filter((row) => profileDraftMissing(row).length === 0)];
11052
+ if (takeable.length === 0) {
11053
+ if (unsetWhenEmpty) props.unset(["managedServiceCredentials", "profiles"]);
11026
11054
  return;
11027
11055
  }
11028
- props.write(["managedServiceCredentials", "profiles"], next.map(profileWire));
11056
+ props.write(["managedServiceCredentials", "profiles"], takeable.map(profileWire));
11029
11057
  };
11030
11058
  const edit = (index, patch) => {
11031
- commit(props.profiles.map((row, at) => at === index ? {
11059
+ commit(drafts.map((row, at) => at === index ? {
11032
11060
  ...row,
11033
11061
  ...patch
11034
11062
  } : row));
11035
11063
  };
11036
11064
  const commitRecord = (index, key, rows) => {
11037
11065
  if (rows.length === 0) {
11038
- commit(props.profiles.map((row, at) => at === index ? {
11066
+ commit(drafts.map((row, at) => at === index ? {
11039
11067
  ...row,
11040
11068
  [key]: []
11041
11069
  } : row));
11042
11070
  return;
11043
11071
  }
11044
- commit(props.profiles.map((row, at) => at === index ? {
11072
+ commit(drafts.map((row, at) => at === index ? {
11045
11073
  ...row,
11046
- [key]: key === "resources" ? resourceRecord(rows) : Object.fromEntries(rows.map(([operation]) => [operation, "deny"]))
11074
+ [key]: rows
11047
11075
  } : row));
11048
11076
  };
11049
11077
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
@@ -11058,7 +11086,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11058
11086
  }),
11059
11087
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
11060
11088
  className: "qai-op__profiles",
11061
- children: props.profiles.map((row, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
11089
+ children: drafts.map((row, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
11062
11090
  className: "qai-op__profile",
11063
11091
  children: [
11064
11092
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
@@ -11082,7 +11110,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11082
11110
  className: "qai-op__row-remove",
11083
11111
  disabled: props.disabled,
11084
11112
  onClick: () => {
11085
- commit(props.profiles.filter((_, at) => at !== index));
11113
+ const removedStored = index < storedCount.current;
11114
+ if (removedStored) storedCount.current -= 1;
11115
+ commit(drafts.filter((_, at) => at !== index), removedStored);
11086
11116
  },
11087
11117
  children: "убрать"
11088
11118
  })
@@ -11109,9 +11139,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11109
11139
  } : draft));
11110
11140
  },
11111
11141
  onBlur: () => {
11112
- const id = row.id.trim();
11113
11142
  const next = drafts[index]?.id.trim() ?? "";
11114
- if (next !== "" && next !== id) edit(index, { id: next });
11143
+ edit(index, { id: next });
11115
11144
  }
11116
11145
  })]
11117
11146
  }),
@@ -11151,9 +11180,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11151
11180
  } : draft));
11152
11181
  },
11153
11182
  onBlur: () => {
11154
- const instance = row.instance.trim();
11155
11183
  const next = drafts[index]?.instance.trim() ?? "";
11156
- if (next !== "" && next !== instance) edit(index, { instance: next });
11184
+ edit(index, { instance: next });
11157
11185
  }
11158
11186
  })]
11159
11187
  }),
@@ -11175,9 +11203,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11175
11203
  } : draft));
11176
11204
  },
11177
11205
  onBlur: () => {
11178
- const label = row.label.trim();
11179
11206
  const next = drafts[index]?.label.trim() ?? "";
11180
- if (next !== "" && next !== label) edit(index, { label: next });
11207
+ edit(index, { label: next });
11181
11208
  }
11182
11209
  })]
11183
11210
  }),
@@ -11199,9 +11226,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11199
11226
  } : draft));
11200
11227
  },
11201
11228
  onBlur: () => {
11202
- const secretFile = row.secretFile.trim();
11203
11229
  const next = drafts[index]?.secretFile.trim() ?? "";
11204
- if (next !== "" && next !== secretFile) edit(index, { secretFile: next });
11230
+ edit(index, { secretFile: next });
11205
11231
  }
11206
11232
  })]
11207
11233
  }),
@@ -11223,9 +11249,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11223
11249
  } : draft));
11224
11250
  },
11225
11251
  onBlur: () => {
11226
- const secretEnv = row.secretEnv.trim();
11227
11252
  const next = drafts[index]?.secretEnv.trim() ?? "";
11228
- if (next !== "" && next !== secretEnv) edit(index, { secretEnv: next });
11253
+ edit(index, { secretEnv: next });
11229
11254
  }
11230
11255
  })]
11231
11256
  })
@@ -11262,7 +11287,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11262
11287
  commitRecord(index, "policy", []);
11263
11288
  },
11264
11289
  overridden: props.overridden
11265
- })
11290
+ }),
11291
+ index >= storedCount.current || profileDraftMissing(row).length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
11292
+ className: "qai-op__pending",
11293
+ children: draftNote(profileDraftMissing(row))
11294
+ }) : null
11266
11295
  ]
11267
11296
  }, `${index}:${row.id}`))
11268
11297
  }),
@@ -11271,7 +11300,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11271
11300
  className: "qai-op__button",
11272
11301
  disabled: props.disabled,
11273
11302
  onClick: () => {
11274
- commit([...props.profiles, {
11303
+ commit([...drafts, {
11275
11304
  id: "",
11276
11305
  provider: "gitlab",
11277
11306
  instance: "",
@@ -11451,7 +11480,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11451
11480
  disabled: !writable,
11452
11481
  write,
11453
11482
  overridden: overridden(path)
11454
- });
11483
+ }, path.join("."));
11455
11484
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CardShell, {
11456
11485
  title: "Интеграции — конфигурация",
11457
11486
  description: "Операторские настройки подключений: провайдеры, адреса, возможности и сервисные доступы. Правка применяется к запущенному сервису сразу.",