@dovetail-v2/refine 0.3.26-alpha.2 → 0.3.27-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.
@@ -9,6 +9,12 @@ interface K8sDropdownProps {
9
9
  customButton?: React.ReactNode;
10
10
  resourceConfig?: Pick<ResourceConfig, 'name' | 'displayName' | 'kind' | 'initValue' | 'apiVersion' | 'basePath' | 'formConfig' | 'hideEdit'>;
11
11
  deleteDialogProps?: Partial<DeleteDialogProps>;
12
+ /**
13
+ * 为 true 时跳过基于路由上下文的操作隐藏逻辑,始终显示全部操作按钮(编辑、编辑 YAML、下载 YAML)。
14
+ * 适用于在详情页或表单中嵌套渲染的子资源列表(如 AccessMethodForm 中的 Service/Ingress),
15
+ * 这些场景下子资源需要独立的编辑和下载能力,不应被父资源详情页的隐藏规则影响。
16
+ */
17
+ forceShowAllActions?: boolean;
12
18
  }
13
19
  export declare function K8sDropdown(props: React.PropsWithChildren<K8sDropdownProps>): JSX.Element;
14
20
  export default K8sDropdown;
package/dist/i18n.d.ts CHANGED
@@ -277,6 +277,7 @@ export declare const resources: {
277
277
  pause_scheduling: string;
278
278
  port_name: string;
279
279
  target_port_range_limit: string;
280
+ service_port_name_tip: string;
280
281
  };
281
282
  };
282
283
  'zh-CN': {
@@ -274,6 +274,7 @@ declare const _default: {
274
274
  pause_scheduling: string;
275
275
  port_name: string;
276
276
  target_port_range_limit: string;
277
+ service_port_name_tip: string;
277
278
  };
278
279
  };
279
280
  export default _default;
package/dist/refine.cjs CHANGED
@@ -731,6 +731,7 @@ const no_annotations$1 = "No annotations";
731
731
  const pause_scheduling$1 = "Suspend scheduling";
732
732
  const port_name$1 = "Port name";
733
733
  const target_port_range_limit$1 = "Only integers between 1 and 65535, or strings, are supported.";
734
+ const service_port_name_tip$1 = "When the port count is 1, this field is optional; when it is greater than 1, this field is mandatory.";
734
735
  const dovetail$1 = {
735
736
  copy: copy$1,
736
737
  reset_arguments: reset_arguments$1,
@@ -1005,7 +1006,8 @@ const dovetail$1 = {
1005
1006
  no_annotations: no_annotations$1,
1006
1007
  pause_scheduling: pause_scheduling$1,
1007
1008
  port_name: port_name$1,
1008
- target_port_range_limit: target_port_range_limit$1
1009
+ target_port_range_limit: target_port_range_limit$1,
1010
+ service_port_name_tip: service_port_name_tip$1
1009
1011
  };
1010
1012
  const EN = {
1011
1013
  dovetail: dovetail$1
@@ -12003,7 +12005,8 @@ function K8sDropdown(props) {
12003
12005
  size = "normal",
12004
12006
  resourceConfig,
12005
12007
  customButton,
12006
- deleteDialogProps
12008
+ deleteDialogProps,
12009
+ forceShowAllActions
12007
12010
  } = props;
12008
12011
  const globalStore = useGlobalStore();
12009
12012
  const useResourceResult = core.useResource();
@@ -12025,8 +12028,8 @@ function K8sDropdown(props) {
12025
12028
  });
12026
12029
  const download2 = useDownloadYAML();
12027
12030
  const openForm = useOpenForm();
12028
- const isInShowPage = useResourceResult.action === "show";
12029
- const isChildResource = isInShowPage && ((_b = useResourceResult.resource) == null ? void 0 : _b.name) !== resourceName;
12031
+ const isInShowPage = forceShowAllActions ? false : useResourceResult.action === "show";
12032
+ const isChildResource = forceShowAllActions ? false : isInShowPage && ((_b = useResourceResult.resource) == null ? void 0 : _b.name) !== resourceName;
12030
12033
  const { data: canEditData } = core.useCan({
12031
12034
  resource: resourceName,
12032
12035
  action: AccessControlAuth.Edit,
package/dist/refine.js CHANGED
@@ -712,6 +712,7 @@ const no_annotations$1 = "No annotations";
712
712
  const pause_scheduling$1 = "Suspend scheduling";
713
713
  const port_name$1 = "Port name";
714
714
  const target_port_range_limit$1 = "Only integers between 1 and 65535, or strings, are supported.";
715
+ const service_port_name_tip$1 = "When the port count is 1, this field is optional; when it is greater than 1, this field is mandatory.";
715
716
  const dovetail$1 = {
716
717
  copy: copy$1,
717
718
  reset_arguments: reset_arguments$1,
@@ -986,7 +987,8 @@ const dovetail$1 = {
986
987
  no_annotations: no_annotations$1,
987
988
  pause_scheduling: pause_scheduling$1,
988
989
  port_name: port_name$1,
989
- target_port_range_limit: target_port_range_limit$1
990
+ target_port_range_limit: target_port_range_limit$1,
991
+ service_port_name_tip: service_port_name_tip$1
990
992
  };
991
993
  const EN = {
992
994
  dovetail: dovetail$1
@@ -11984,7 +11986,8 @@ function K8sDropdown(props) {
11984
11986
  size = "normal",
11985
11987
  resourceConfig,
11986
11988
  customButton,
11987
- deleteDialogProps
11989
+ deleteDialogProps,
11990
+ forceShowAllActions
11988
11991
  } = props;
11989
11992
  const globalStore = useGlobalStore();
11990
11993
  const useResourceResult = useResource();
@@ -12006,8 +12009,8 @@ function K8sDropdown(props) {
12006
12009
  });
12007
12010
  const download2 = useDownloadYAML();
12008
12011
  const openForm = useOpenForm();
12009
- const isInShowPage = useResourceResult.action === "show";
12010
- const isChildResource = isInShowPage && ((_b = useResourceResult.resource) == null ? void 0 : _b.name) !== resourceName;
12012
+ const isInShowPage = forceShowAllActions ? false : useResourceResult.action === "show";
12013
+ const isChildResource = forceShowAllActions ? false : isInShowPage && ((_b = useResourceResult.resource) == null ? void 0 : _b.name) !== resourceName;
12011
12014
  const { data: canEditData } = useCan({
12012
12015
  resource: resourceName,
12013
12016
  action: AccessControlAuth.Edit,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dovetail-v2/refine",
3
- "version": "0.3.26-alpha.2",
3
+ "version": "0.3.27-alpha.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",