@dovetail-v2/refine 0.3.26-alpha.3 → 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/refine.cjs
CHANGED
|
@@ -12005,7 +12005,8 @@ function K8sDropdown(props) {
|
|
|
12005
12005
|
size = "normal",
|
|
12006
12006
|
resourceConfig,
|
|
12007
12007
|
customButton,
|
|
12008
|
-
deleteDialogProps
|
|
12008
|
+
deleteDialogProps,
|
|
12009
|
+
forceShowAllActions
|
|
12009
12010
|
} = props;
|
|
12010
12011
|
const globalStore = useGlobalStore();
|
|
12011
12012
|
const useResourceResult = core.useResource();
|
|
@@ -12027,8 +12028,8 @@ function K8sDropdown(props) {
|
|
|
12027
12028
|
});
|
|
12028
12029
|
const download2 = useDownloadYAML();
|
|
12029
12030
|
const openForm = useOpenForm();
|
|
12030
|
-
const isInShowPage = useResourceResult.action === "show";
|
|
12031
|
-
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;
|
|
12032
12033
|
const { data: canEditData } = core.useCan({
|
|
12033
12034
|
resource: resourceName,
|
|
12034
12035
|
action: AccessControlAuth.Edit,
|
package/dist/refine.js
CHANGED
|
@@ -11986,7 +11986,8 @@ function K8sDropdown(props) {
|
|
|
11986
11986
|
size = "normal",
|
|
11987
11987
|
resourceConfig,
|
|
11988
11988
|
customButton,
|
|
11989
|
-
deleteDialogProps
|
|
11989
|
+
deleteDialogProps,
|
|
11990
|
+
forceShowAllActions
|
|
11990
11991
|
} = props;
|
|
11991
11992
|
const globalStore = useGlobalStore();
|
|
11992
11993
|
const useResourceResult = useResource();
|
|
@@ -12008,8 +12009,8 @@ function K8sDropdown(props) {
|
|
|
12008
12009
|
});
|
|
12009
12010
|
const download2 = useDownloadYAML();
|
|
12010
12011
|
const openForm = useOpenForm();
|
|
12011
|
-
const isInShowPage = useResourceResult.action === "show";
|
|
12012
|
-
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;
|
|
12013
12014
|
const { data: canEditData } = useCan({
|
|
12014
12015
|
resource: resourceName,
|
|
12015
12016
|
action: AccessControlAuth.Edit,
|