@dovetail-v2/refine 0.1.14 → 0.1.15-alpha.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.
@@ -1,4 +1,4 @@
1
- import { j as jsxRuntimeExports } from "./index-0a0a8e71.js";
1
+ import { j as jsxRuntimeExports } from "./index-11293d19.js";
2
2
  import * as monaco from "monaco-editor";
3
3
  import { useRef, useEffect } from "react";
4
4
  import "i18next";
@@ -12184,7 +12184,8 @@ function KeyValueSecret(props) {
12184
12184
  });
12185
12185
  }
12186
12186
  function validateLabelKey(key2) {
12187
- const labelRegex = /(^[a-zA-Z0-9]$)|(^[a-zA-Z0-9][a-zA-Z0-9\.\-\_]*[a-zA-Z0-9]$)/;
12187
+ const labelPrefixRegex = /(^[a-zA-Z0-9]$)|(^[a-zA-Z0-9][a-zA-Z0-9\.]*[a-zA-Z0-9]$)/;
12188
+ const labelNameRegex = /(^[a-zA-Z0-9]$)|(^[a-zA-Z0-9][a-zA-Z0-9\.\-]*[a-zA-Z0-9]$)/;
12188
12189
  let prefix, name2;
12189
12190
  const splitResult = key2.split("/");
12190
12191
  if (splitResult.length === 1) {
@@ -12196,10 +12197,10 @@ function validateLabelKey(key2) {
12196
12197
  if (prefix === "") {
12197
12198
  return { isValid: false, errorMessage: "EMPTY_PREFIX" };
12198
12199
  }
12199
- if (prefix && !labelRegex.test(prefix)) {
12200
+ if (prefix && !labelPrefixRegex.test(prefix)) {
12200
12201
  return { isValid: false, errorMessage: "INVALID_PREFIX" };
12201
12202
  }
12202
- if (!labelRegex.test(name2)) {
12203
+ if (!labelNameRegex.test(name2)) {
12203
12204
  return { isValid: false, errorMessage: "INVALID_NAME" };
12204
12205
  }
12205
12206
  if (prefix && prefix.length > 253) {
@@ -12211,7 +12212,7 @@ function validateLabelKey(key2) {
12211
12212
  return { isValid: true };
12212
12213
  }
12213
12214
  function validateLabelValue(value2) {
12214
- const labelValueRegex = /(^[a-zA-Z0-9]$)|(^[a-zA-Z0-9][a-zA-Z0-9\.\-\_]*[a-zA-Z0-9]$)/;
12215
+ const labelValueRegex = /(^[a-zA-Z0-9]$)|(^[a-zA-Z0-9][a-zA-Z0-9\.\-]*[a-zA-Z0-9]$)/;
12215
12216
  if (value2 === "") {
12216
12217
  return { isValid: true };
12217
12218
  }
@@ -12225,37 +12226,31 @@ function validateLabelValue(value2) {
12225
12226
  }
12226
12227
  const LabelFormatPopover_105yfzn = "";
12227
12228
  const PodLabelFormatRulePopoverStyle = "p5jt6nm";
12228
- const LabelFormatPopover = ({
12229
- noValueValidation
12230
- }) => {
12229
+ const LabelFormatPopover = () => {
12231
12230
  const {
12232
12231
  t: t2
12233
12232
  } = useTranslation();
12234
- const data2 = [{
12235
- object: t2("dovetail.key"),
12236
- contains: t2("dovetail.suffix"),
12237
- optional: t2("dovetail.no"),
12238
- rule: [t2("dovetail.suffix_format_rule_1"), t2("dovetail.suffix_format_rule_2"), t2("dovetail.suffix_format_rule_3")]
12239
- }, {
12240
- object: t2("dovetail.key"),
12241
- contains: t2("dovetail.name"),
12242
- optional: t2("dovetail.yes"),
12243
- rule: [t2("dovetail.name_format_rule_1"), t2("dovetail.name_format_rule_2"), t2("dovetail.name_format_rule_3")]
12244
- }];
12245
- if (!noValueValidation) {
12246
- data2.push({
12247
- object: t2("dovetail.value"),
12248
- contains: t2("dovetail.name"),
12249
- optional: t2("dovetail.no"),
12250
- rule: [t2("dovetail.name_format_rule_1"), t2("dovetail.name_format_rule_2"), t2("dovetail.name_format_rule_3")]
12251
- });
12252
- }
12253
12233
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Popover, {
12254
12234
  overlayClassName: PodLabelFormatRulePopoverStyle,
12255
12235
  placement: "bottomRight",
12256
12236
  content: /* @__PURE__ */ jsxRuntimeExports.jsx(AntdTable, {
12257
12237
  bordered: true,
12258
- dataSource: data2,
12238
+ dataSource: [{
12239
+ object: t2("dovetail.key"),
12240
+ contains: t2("dovetail.suffix"),
12241
+ optional: t2("dovetail.no"),
12242
+ rule: [t2("dovetail.suffix_format_rule_1"), t2("dovetail.suffix_format_rule_2"), t2("dovetail.suffix_format_rule_3")]
12243
+ }, {
12244
+ object: t2("dovetail.key"),
12245
+ contains: t2("dovetail.name"),
12246
+ optional: t2("dovetail.yes"),
12247
+ rule: [t2("dovetail.name_format_rule_1"), t2("dovetail.name_format_rule_2"), t2("dovetail.name_format_rule_3")]
12248
+ }, {
12249
+ object: t2("dovetail.value"),
12250
+ contains: t2("dovetail.name"),
12251
+ optional: t2("dovetail.no"),
12252
+ rule: [t2("dovetail.name_format_rule_1"), t2("dovetail.name_format_rule_2"), t2("dovetail.name_format_rule_3")]
12253
+ }],
12259
12254
  columns: [{
12260
12255
  key: "object",
12261
12256
  title: t2("dovetail.object"),
@@ -12307,8 +12302,7 @@ function _KeyValueTableFormForm(props, ref) {
12307
12302
  defaultValue,
12308
12303
  onSubmit,
12309
12304
  extraColumns,
12310
- addButtonText,
12311
- noValueValidation
12305
+ addButtonText
12312
12306
  } = props;
12313
12307
  const {
12314
12308
  t: t2
@@ -12378,8 +12372,6 @@ function _KeyValueTableFormForm(props, ref) {
12378
12372
  validator: ({
12379
12373
  value: value22
12380
12374
  }) => {
12381
- if (noValueValidation)
12382
- return;
12383
12375
  const {
12384
12376
  isValid
12385
12377
  } = validateLabelValue(value22 || "");
@@ -12398,9 +12390,7 @@ function _KeyValueTableFormForm(props, ref) {
12398
12390
  row: {
12399
12391
  deletable: true
12400
12392
  }
12401
- }), /* @__PURE__ */ jsxRuntimeExports.jsx(LabelFormatPopover, {
12402
- noValueValidation
12403
- })]
12393
+ }), /* @__PURE__ */ jsxRuntimeExports.jsx(LabelFormatPopover, {})]
12404
12394
  });
12405
12395
  }
12406
12396
  const KeyValueTableFormForm = React__default.forwardRef(_KeyValueTableFormForm);
@@ -19483,13 +19473,13 @@ const PodContainersTable = ({
19483
19473
  },
19484
19474
  {
19485
19475
  key: "started",
19486
- dataIndex: ["state", "running", "startedAt"],
19476
+ dataIndex: ["startedAt"],
19487
19477
  title: i18n2.t("dovetail.created_time"),
19488
19478
  sortable: true,
19489
- sorter: CommonSorter(["state", "running", "startedAt"]),
19479
+ sorter: CommonSorter(["startedAt"]),
19490
19480
  width: 120,
19491
19481
  render: (_, record) => {
19492
- const value2 = get$3(record, ["state", "running", "startedAt"]) || get$3(record, ["state", "terminated", "startedAt"]);
19482
+ const value2 = record.startedAt;
19493
19483
  if (value2)
19494
19484
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Time, { date: new Date(value2) });
19495
19485
  return /* @__PURE__ */ jsxRuntimeExports.jsx(ValueDisplay, { value: "" });
@@ -19499,7 +19489,10 @@ const PodContainersTable = ({
19499
19489
  [i18n2, initContainerStatuses]
19500
19490
  );
19501
19491
  const dataSource = useMemo(
19502
- () => addId(containerStatuses.concat(initContainerStatuses), "containerID"),
19492
+ () => addId(containerStatuses.concat(initContainerStatuses), "containerID").map((container2) => ({
19493
+ ...container2,
19494
+ startedAt: get$3(container2, ["state", "running", "startedAt"]) || get$3(container2, ["state", "terminated", "startedAt"])
19495
+ })),
19503
19496
  [containerStatuses, initContainerStatuses]
19504
19497
  );
19505
19498
  const {
@@ -19511,7 +19504,7 @@ const PodContainersTable = ({
19511
19504
  data: dataSource,
19512
19505
  columns,
19513
19506
  defaultSorters: [{
19514
- field: "state.running.startedAt",
19507
+ field: "startedAt",
19515
19508
  order: "desc"
19516
19509
  }]
19517
19510
  });
@@ -38400,7 +38393,7 @@ const Separator = () => {
38400
38393
  });
38401
38394
  };
38402
38395
  const MonacoYamlEditor = React__default.lazy(() => Promise.resolve().then(() => MonacoYamlEditor$2));
38403
- const MonacoYamlDiffEditor = React__default.lazy(() => import("./MonacoYamlDiffEditor-fdc5faf9.js"));
38396
+ const MonacoYamlDiffEditor = React__default.lazy(() => import("./MonacoYamlDiffEditor-22b5ead6.js"));
38404
38397
  const YamlEditorComponent = forwardRef(
38405
38398
  function YamlEditorComponent2(props, ref) {
38406
38399
  const {
@@ -39609,8 +39602,7 @@ const EditAnnotationForm = React__default.forwardRef(function EditAnnotationForm
39609
39602
  ref,
39610
39603
  defaultValue,
39611
39604
  onSubmit,
39612
- addButtonText: t2("dovetail.add_annotation"),
39613
- noValueValidation: true
39605
+ addButtonText: t2("dovetail.add_annotation")
39614
39606
  }
39615
39607
  );
39616
39608
  });
package/dist/refine.js CHANGED
@@ -1,4 +1,4 @@
1
- import { bN, cC, A, aW, aY, aF, ca, bk, a1, co, cc, aQ, T, C, i, cG, aI, bp, ac, cI, ai, ap, cR, ax, cd, cb, cU, aM, bw, w, aD, bD, cT, cD, bG, D, b1, as, bJ, ar, at, a0, c9, c8, cS, bi, aU, ad, bQ, cF, cH, cm, aG, aj, s, q, cJ, I, bt, aT, t, M, be, bg, ce, cL, aL, bs, aq, ay, az, a8, aA, aX, aE, bE, bH, a9, d2, cn, cx, bM, N, a2, e, aV, a6, bP, by, bx, cK, b$, cZ, g, cY, aJ, bq, cg, L, ba, bb, bo, H, bc, J, bd, B, b5, cA, z, b4, G, b8, E, b6, F, b7, K, c0, b9, cz, aa, d0, c$, P, bm, v, ae, ah, b_, bj, cP, cO, a$, bu, c6, c5, p, aK, bl, x, bv, b0, d1, y, cq, cE, bK, bR, bS, d4, aH, R, ag, an, am, bL, ak, cQ, c2, al, cB, c7, bh, bA, au, h, Q, O, bf, ct, cw, cs, cr, cu, cv, cp, ch, ck, cl, cj, ci, cf, cy, bT, aN, br, aB, m, bW, l, aZ, cX, o, bX, a_, n, aS, bn, k, cW, aP, aR, c4, bC, bB, c3, aO, S, bF, cV, c_, b2, b3, bz, bI, c1, bY, bZ, ab, $, cN, af, W, cM, ao, aw, av, f, aC, bU, U, a3, d, d7, d6, d9, d3, a7, da, d5, d8, a5, a4, r, a, c, X, V, Y, Z, u, bO, _, bV, b } from "./index-0a0a8e71.js";
1
+ import { bN, cC, A, aW, aY, aF, ca, bk, a1, co, cc, aQ, T, C, i, cG, aI, bp, ac, cI, ai, ap, cR, ax, cd, cb, cU, aM, bw, w, aD, bD, cT, cD, bG, D, b1, as, bJ, ar, at, a0, c9, c8, cS, bi, aU, ad, bQ, cF, cH, cm, aG, aj, s, q, cJ, I, bt, aT, t, M, be, bg, ce, cL, aL, bs, aq, ay, az, a8, aA, aX, aE, bE, bH, a9, d2, cn, cx, bM, N, a2, e, aV, a6, bP, by, bx, cK, b$, cZ, g, cY, aJ, bq, cg, L, ba, bb, bo, H, bc, J, bd, B, b5, cA, z, b4, G, b8, E, b6, F, b7, K, c0, b9, cz, aa, d0, c$, P, bm, v, ae, ah, b_, bj, cP, cO, a$, bu, c6, c5, p, aK, bl, x, bv, b0, d1, y, cq, cE, bK, bR, bS, d4, aH, R, ag, an, am, bL, ak, cQ, c2, al, cB, c7, bh, bA, au, h, Q, O, bf, ct, cw, cs, cr, cu, cv, cp, ch, ck, cl, cj, ci, cf, cy, bT, aN, br, aB, m, bW, l, aZ, cX, o, bX, a_, n, aS, bn, k, cW, aP, aR, c4, bC, bB, c3, aO, S, bF, cV, c_, b2, b3, bz, bI, c1, bY, bZ, ab, $, cN, af, W, cM, ao, aw, av, f, aC, bU, U, a3, d, d7, d6, d9, d3, a7, da, d5, d8, a5, a4, r, a, c, X, V, Y, Z, u, bO, _, bV, b } from "./index-11293d19.js";
2
2
  import "@cloudtower/eagle";
3
3
  import "@refinedev/core";
4
4
  import "react";
@@ -12190,7 +12190,8 @@ var __publicField = (obj, key, value) => {
12190
12190
  });
12191
12191
  }
12192
12192
  function validateLabelKey(key2) {
12193
- const labelRegex = /(^[a-zA-Z0-9]$)|(^[a-zA-Z0-9][a-zA-Z0-9\.\-\_]*[a-zA-Z0-9]$)/;
12193
+ const labelPrefixRegex = /(^[a-zA-Z0-9]$)|(^[a-zA-Z0-9][a-zA-Z0-9\.]*[a-zA-Z0-9]$)/;
12194
+ const labelNameRegex = /(^[a-zA-Z0-9]$)|(^[a-zA-Z0-9][a-zA-Z0-9\.\-]*[a-zA-Z0-9]$)/;
12194
12195
  let prefix, name2;
12195
12196
  const splitResult = key2.split("/");
12196
12197
  if (splitResult.length === 1) {
@@ -12202,10 +12203,10 @@ var __publicField = (obj, key, value) => {
12202
12203
  if (prefix === "") {
12203
12204
  return { isValid: false, errorMessage: "EMPTY_PREFIX" };
12204
12205
  }
12205
- if (prefix && !labelRegex.test(prefix)) {
12206
+ if (prefix && !labelPrefixRegex.test(prefix)) {
12206
12207
  return { isValid: false, errorMessage: "INVALID_PREFIX" };
12207
12208
  }
12208
- if (!labelRegex.test(name2)) {
12209
+ if (!labelNameRegex.test(name2)) {
12209
12210
  return { isValid: false, errorMessage: "INVALID_NAME" };
12210
12211
  }
12211
12212
  if (prefix && prefix.length > 253) {
@@ -12217,7 +12218,7 @@ var __publicField = (obj, key, value) => {
12217
12218
  return { isValid: true };
12218
12219
  }
12219
12220
  function validateLabelValue(value2) {
12220
- const labelValueRegex = /(^[a-zA-Z0-9]$)|(^[a-zA-Z0-9][a-zA-Z0-9\.\-\_]*[a-zA-Z0-9]$)/;
12221
+ const labelValueRegex = /(^[a-zA-Z0-9]$)|(^[a-zA-Z0-9][a-zA-Z0-9\.\-]*[a-zA-Z0-9]$)/;
12221
12222
  if (value2 === "") {
12222
12223
  return { isValid: true };
12223
12224
  }
@@ -12231,37 +12232,31 @@ var __publicField = (obj, key, value) => {
12231
12232
  }
12232
12233
  const LabelFormatPopover_105yfzn = "";
12233
12234
  const PodLabelFormatRulePopoverStyle = "p5jt6nm";
12234
- const LabelFormatPopover = ({
12235
- noValueValidation
12236
- }) => {
12235
+ const LabelFormatPopover = () => {
12237
12236
  const {
12238
12237
  t: t2
12239
12238
  } = useTranslation();
12240
- const data2 = [{
12241
- object: t2("dovetail.key"),
12242
- contains: t2("dovetail.suffix"),
12243
- optional: t2("dovetail.no"),
12244
- rule: [t2("dovetail.suffix_format_rule_1"), t2("dovetail.suffix_format_rule_2"), t2("dovetail.suffix_format_rule_3")]
12245
- }, {
12246
- object: t2("dovetail.key"),
12247
- contains: t2("dovetail.name"),
12248
- optional: t2("dovetail.yes"),
12249
- rule: [t2("dovetail.name_format_rule_1"), t2("dovetail.name_format_rule_2"), t2("dovetail.name_format_rule_3")]
12250
- }];
12251
- if (!noValueValidation) {
12252
- data2.push({
12253
- object: t2("dovetail.value"),
12254
- contains: t2("dovetail.name"),
12255
- optional: t2("dovetail.no"),
12256
- rule: [t2("dovetail.name_format_rule_1"), t2("dovetail.name_format_rule_2"), t2("dovetail.name_format_rule_3")]
12257
- });
12258
- }
12259
12239
  return /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.Popover, {
12260
12240
  overlayClassName: PodLabelFormatRulePopoverStyle,
12261
12241
  placement: "bottomRight",
12262
12242
  content: /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.AntdTable, {
12263
12243
  bordered: true,
12264
- dataSource: data2,
12244
+ dataSource: [{
12245
+ object: t2("dovetail.key"),
12246
+ contains: t2("dovetail.suffix"),
12247
+ optional: t2("dovetail.no"),
12248
+ rule: [t2("dovetail.suffix_format_rule_1"), t2("dovetail.suffix_format_rule_2"), t2("dovetail.suffix_format_rule_3")]
12249
+ }, {
12250
+ object: t2("dovetail.key"),
12251
+ contains: t2("dovetail.name"),
12252
+ optional: t2("dovetail.yes"),
12253
+ rule: [t2("dovetail.name_format_rule_1"), t2("dovetail.name_format_rule_2"), t2("dovetail.name_format_rule_3")]
12254
+ }, {
12255
+ object: t2("dovetail.value"),
12256
+ contains: t2("dovetail.name"),
12257
+ optional: t2("dovetail.no"),
12258
+ rule: [t2("dovetail.name_format_rule_1"), t2("dovetail.name_format_rule_2"), t2("dovetail.name_format_rule_3")]
12259
+ }],
12265
12260
  columns: [{
12266
12261
  key: "object",
12267
12262
  title: t2("dovetail.object"),
@@ -12313,8 +12308,7 @@ var __publicField = (obj, key, value) => {
12313
12308
  defaultValue,
12314
12309
  onSubmit,
12315
12310
  extraColumns,
12316
- addButtonText,
12317
- noValueValidation
12311
+ addButtonText
12318
12312
  } = props;
12319
12313
  const {
12320
12314
  t: t2
@@ -12384,8 +12378,6 @@ var __publicField = (obj, key, value) => {
12384
12378
  validator: ({
12385
12379
  value: value22
12386
12380
  }) => {
12387
- if (noValueValidation)
12388
- return;
12389
12381
  const {
12390
12382
  isValid
12391
12383
  } = validateLabelValue(value22 || "");
@@ -12404,9 +12396,7 @@ var __publicField = (obj, key, value) => {
12404
12396
  row: {
12405
12397
  deletable: true
12406
12398
  }
12407
- }), /* @__PURE__ */ jsxRuntimeExports.jsx(LabelFormatPopover, {
12408
- noValueValidation
12409
- })]
12399
+ }), /* @__PURE__ */ jsxRuntimeExports.jsx(LabelFormatPopover, {})]
12410
12400
  });
12411
12401
  }
12412
12402
  const KeyValueTableFormForm = React.forwardRef(_KeyValueTableFormForm);
@@ -19489,13 +19479,13 @@ var __publicField = (obj, key, value) => {
19489
19479
  },
19490
19480
  {
19491
19481
  key: "started",
19492
- dataIndex: ["state", "running", "startedAt"],
19482
+ dataIndex: ["startedAt"],
19493
19483
  title: i18n2.t("dovetail.created_time"),
19494
19484
  sortable: true,
19495
- sorter: CommonSorter(["state", "running", "startedAt"]),
19485
+ sorter: CommonSorter(["startedAt"]),
19496
19486
  width: 120,
19497
19487
  render: (_, record) => {
19498
- const value2 = lodashEs.get(record, ["state", "running", "startedAt"]) || lodashEs.get(record, ["state", "terminated", "startedAt"]);
19488
+ const value2 = record.startedAt;
19499
19489
  if (value2)
19500
19490
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Time, { date: new Date(value2) });
19501
19491
  return /* @__PURE__ */ jsxRuntimeExports.jsx(ValueDisplay, { value: "" });
@@ -19505,7 +19495,10 @@ var __publicField = (obj, key, value) => {
19505
19495
  [i18n2, initContainerStatuses]
19506
19496
  );
19507
19497
  const dataSource = React.useMemo(
19508
- () => addId(containerStatuses.concat(initContainerStatuses), "containerID"),
19498
+ () => addId(containerStatuses.concat(initContainerStatuses), "containerID").map((container2) => ({
19499
+ ...container2,
19500
+ startedAt: lodashEs.get(container2, ["state", "running", "startedAt"]) || lodashEs.get(container2, ["state", "terminated", "startedAt"])
19501
+ })),
19509
19502
  [containerStatuses, initContainerStatuses]
19510
19503
  );
19511
19504
  const {
@@ -19517,7 +19510,7 @@ var __publicField = (obj, key, value) => {
19517
19510
  data: dataSource,
19518
19511
  columns,
19519
19512
  defaultSorters: [{
19520
- field: "state.running.startedAt",
19513
+ field: "startedAt",
19521
19514
  order: "desc"
19522
19515
  }]
19523
19516
  });
@@ -39615,8 +39608,7 @@ WARNING: This link could potentially be dangerous`)) {
39615
39608
  ref,
39616
39609
  defaultValue,
39617
39610
  onSubmit,
39618
- addButtonText: t2("dovetail.add_annotation"),
39619
- noValueValidation: true
39611
+ addButtonText: t2("dovetail.add_annotation")
39620
39612
  }
39621
39613
  );
39622
39614
  });
@@ -10,7 +10,6 @@ interface KeyValueTableFormFormProps<T extends KeyValuePair> {
10
10
  onSubmit: (value: T[]) => Promise<unknown> | undefined;
11
11
  extraColumns?: TableFormColumn[];
12
12
  addButtonText?: string;
13
- noValueValidation?: boolean;
14
13
  }
15
14
  export declare const KeyValueTableFormForm: React.ForwardRefExoticComponent<KeyValueTableFormFormProps<KeyValuePair> & React.RefAttributes<EditFieldFormHandler>>;
16
15
  export {};
@@ -1,5 +1,3 @@
1
1
  import React from 'react';
2
2
  export declare const PodLabelFormatRulePopoverStyle: import("@linaria/core").LinariaClassName;
3
- export declare const LabelFormatPopover: React.FC<{
4
- noValueValidation?: boolean;
5
- }>;
3
+ export declare const LabelFormatPopover: React.FC;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dovetail-v2/refine",
3
- "version": "0.1.14",
3
+ "version": "0.1.15-alpha.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",