@dovetail-v2/refine 0.3.21-alpha.1 → 0.3.22

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.
@@ -30,6 +30,7 @@ interface KeyValueTableFormProps<T extends KeyValuePair> {
30
30
  errorMessage?: string;
31
31
  };
32
32
  onSubmit?: (value: T[]) => Promise<unknown> | undefined;
33
+ keyTitle?: string;
33
34
  }
34
35
  export type KeyValueTableFormHandle<T extends KeyValuePair = KeyValuePair> = {
35
36
  validate: () => Promise<boolean>;
package/dist/refine.cjs CHANGED
@@ -11796,7 +11796,8 @@ function _KeyValueTableForm(props, ref) {
11796
11796
  keyOptions,
11797
11797
  validateKey,
11798
11798
  validateValue,
11799
- onSubmit
11799
+ onSubmit,
11800
+ keyTitle
11800
11801
  } = props;
11801
11802
  const {
11802
11803
  t: t2,
@@ -11920,7 +11921,7 @@ function _KeyValueTableForm(props, ref) {
11920
11921
  },
11921
11922
  columns: [{
11922
11923
  key: "key",
11923
- title: t2("dovetail.key"),
11924
+ title: keyTitle || t2("dovetail.key"),
11924
11925
  type: "input",
11925
11926
  validator: ({
11926
11927
  value: value22
@@ -12483,7 +12484,7 @@ const WorkloadPodsTable = ({
12483
12484
  })]
12484
12485
  });
12485
12486
  };
12486
- const index_p1cude = "";
12487
+ const index_16qcivi = "";
12487
12488
  const WorkloadReplicasWrapperStyle = "w8ychfk";
12488
12489
  const DonutChartWrapperStyle = "d1o004do";
12489
12490
  const DonutChartStyle = "dfo80qq";
@@ -12499,12 +12500,10 @@ const WorkloadReplicasForm = React.forwardRef(function WorkloadReplicasForm2(pro
12499
12500
  record,
12500
12501
  label: label2
12501
12502
  } = props;
12502
- const {
12503
- resource
12504
- } = core.useResource();
12505
12503
  const {
12506
12504
  mutateAsync
12507
12505
  } = core.useUpdate();
12506
+ const configs = React.useContext(ConfigsContext);
12508
12507
  const {
12509
12508
  t: t2
12510
12509
  } = common.useTranslation();
@@ -12512,10 +12511,11 @@ const WorkloadReplicasForm = React.forwardRef(function WorkloadReplicasForm2(pro
12512
12511
  const submit = React.useCallback(() => {
12513
12512
  const v = record.scale(replicas);
12514
12513
  const id = record.id;
12514
+ const resourceName = getResourceNameByKind(v.kind, configs) || "";
12515
12515
  pruneBeforeEdit(v);
12516
12516
  return mutateAsync({
12517
12517
  id,
12518
- resource: (resource == null ? void 0 : resource.name) || "",
12518
+ resource: resourceName,
12519
12519
  values: v,
12520
12520
  successNotification() {
12521
12521
  return {
@@ -12531,7 +12531,7 @@ const WorkloadReplicasForm = React.forwardRef(function WorkloadReplicasForm2(pro
12531
12531
  },
12532
12532
  errorNotification: false
12533
12533
  });
12534
- }, [record, replicas, resource == null ? void 0 : resource.name, mutateAsync, t2]);
12534
+ }, [record, replicas, mutateAsync, t2, configs]);
12535
12535
  React.useImperativeHandle(ref, () => ({
12536
12536
  submit
12537
12537
  }), [submit]);
@@ -14347,11 +14347,12 @@ function FormLayout(props) {
14347
14347
  }
14348
14348
  function WorkloadDropdown(props) {
14349
14349
  const { record, size, children } = props;
14350
- const { resource } = core.useResource();
14351
14350
  const { mutateAsync } = core.useUpdate();
14351
+ const configs = React.useContext(ConfigsContext);
14352
+ const resourceName = getResourceNameByKind(record.kind, configs) || "";
14352
14353
  const { t: t2 } = common.useTranslation();
14353
14354
  const { data: canEditData } = core.useCan({
14354
- resource: resource == null ? void 0 : resource.name,
14355
+ resource: resourceName,
14355
14356
  action: AccessControlAuth.Edit,
14356
14357
  params: {
14357
14358
  namespace: record.namespace
@@ -14367,7 +14368,7 @@ function WorkloadDropdown(props) {
14367
14368
  pruneBeforeEdit(v);
14368
14369
  await mutateAsync({
14369
14370
  id,
14370
- resource: (resource == null ? void 0 : resource.name) || "",
14371
+ resource: resourceName,
14371
14372
  values: v,
14372
14373
  successNotification() {
14373
14374
  return {
@@ -16995,11 +16996,13 @@ function FormModal(props) {
16995
16996
  props: {
16996
16997
  onOk: () => {
16997
16998
  setMode(FormMode.FORM);
16999
+ setStep(0);
16998
17000
  }
16999
17001
  }
17000
17002
  });
17001
17003
  } else {
17002
17004
  setMode(value2);
17005
+ setStep(0);
17003
17006
  }
17004
17007
  }, [pushModal]);
17005
17008
  const errorText = React.useMemo(() => {
package/dist/refine.js CHANGED
@@ -11777,7 +11777,8 @@ function _KeyValueTableForm(props, ref) {
11777
11777
  keyOptions,
11778
11778
  validateKey,
11779
11779
  validateValue,
11780
- onSubmit
11780
+ onSubmit,
11781
+ keyTitle
11781
11782
  } = props;
11782
11783
  const {
11783
11784
  t: t2,
@@ -11901,7 +11902,7 @@ function _KeyValueTableForm(props, ref) {
11901
11902
  },
11902
11903
  columns: [{
11903
11904
  key: "key",
11904
- title: t2("dovetail.key"),
11905
+ title: keyTitle || t2("dovetail.key"),
11905
11906
  type: "input",
11906
11907
  validator: ({
11907
11908
  value: value22
@@ -12464,7 +12465,7 @@ const WorkloadPodsTable = ({
12464
12465
  })]
12465
12466
  });
12466
12467
  };
12467
- const index_p1cude = "";
12468
+ const index_16qcivi = "";
12468
12469
  const WorkloadReplicasWrapperStyle = "w8ychfk";
12469
12470
  const DonutChartWrapperStyle = "d1o004do";
12470
12471
  const DonutChartStyle = "dfo80qq";
@@ -12480,12 +12481,10 @@ const WorkloadReplicasForm = React.forwardRef(function WorkloadReplicasForm2(pro
12480
12481
  record,
12481
12482
  label: label2
12482
12483
  } = props;
12483
- const {
12484
- resource
12485
- } = useResource();
12486
12484
  const {
12487
12485
  mutateAsync
12488
12486
  } = useUpdate();
12487
+ const configs = useContext(ConfigsContext);
12489
12488
  const {
12490
12489
  t: t2
12491
12490
  } = useTranslation();
@@ -12493,10 +12492,11 @@ const WorkloadReplicasForm = React.forwardRef(function WorkloadReplicasForm2(pro
12493
12492
  const submit = useCallback(() => {
12494
12493
  const v = record.scale(replicas);
12495
12494
  const id = record.id;
12495
+ const resourceName = getResourceNameByKind(v.kind, configs) || "";
12496
12496
  pruneBeforeEdit(v);
12497
12497
  return mutateAsync({
12498
12498
  id,
12499
- resource: (resource == null ? void 0 : resource.name) || "",
12499
+ resource: resourceName,
12500
12500
  values: v,
12501
12501
  successNotification() {
12502
12502
  return {
@@ -12512,7 +12512,7 @@ const WorkloadReplicasForm = React.forwardRef(function WorkloadReplicasForm2(pro
12512
12512
  },
12513
12513
  errorNotification: false
12514
12514
  });
12515
- }, [record, replicas, resource == null ? void 0 : resource.name, mutateAsync, t2]);
12515
+ }, [record, replicas, mutateAsync, t2, configs]);
12516
12516
  useImperativeHandle(ref, () => ({
12517
12517
  submit
12518
12518
  }), [submit]);
@@ -14328,11 +14328,12 @@ function FormLayout(props) {
14328
14328
  }
14329
14329
  function WorkloadDropdown(props) {
14330
14330
  const { record, size, children } = props;
14331
- const { resource } = useResource();
14332
14331
  const { mutateAsync } = useUpdate();
14332
+ const configs = useContext(ConfigsContext);
14333
+ const resourceName = getResourceNameByKind(record.kind, configs) || "";
14333
14334
  const { t: t2 } = useTranslation();
14334
14335
  const { data: canEditData } = useCan({
14335
- resource: resource == null ? void 0 : resource.name,
14336
+ resource: resourceName,
14336
14337
  action: AccessControlAuth.Edit,
14337
14338
  params: {
14338
14339
  namespace: record.namespace
@@ -14348,7 +14349,7 @@ function WorkloadDropdown(props) {
14348
14349
  pruneBeforeEdit(v);
14349
14350
  await mutateAsync({
14350
14351
  id,
14351
- resource: (resource == null ? void 0 : resource.name) || "",
14352
+ resource: resourceName,
14352
14353
  values: v,
14353
14354
  successNotification() {
14354
14355
  return {
@@ -16976,11 +16977,13 @@ function FormModal(props) {
16976
16977
  props: {
16977
16978
  onOk: () => {
16978
16979
  setMode(FormMode.FORM);
16980
+ setStep(0);
16979
16981
  }
16980
16982
  }
16981
16983
  });
16982
16984
  } else {
16983
16985
  setMode(value2);
16986
+ setStep(0);
16984
16987
  }
16985
16988
  }, [pushModal]);
16986
16989
  const errorText = useMemo(() => {
package/dist/style.css CHANGED
@@ -1897,7 +1897,7 @@
1897
1897
  }
1898
1898
 
1899
1899
  .r1bm8olw {
1900
- color: #00122E;
1900
+ color: #00122e;
1901
1901
  }
1902
1902
 
1903
1903
  .r1oqudbh {
@@ -1916,7 +1916,7 @@
1916
1916
  }
1917
1917
 
1918
1918
  .v1ixr1me {
1919
- color: #00122E;
1919
+ color: #00122e;
1920
1920
  }/* // basic */
1921
1921
  /* FishEye Color Variables and Functions */
1922
1922
  /*
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dovetail-v2/refine",
3
- "version": "0.3.21-alpha.1",
3
+ "version": "0.3.22",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",