@dovetail-v2/refine 0.3.29-alpha.3 → 0.3.30-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.
- package/dist/refine.cjs +9 -2
- package/dist/refine.js +9 -2
- package/package.json +1 -1
package/dist/refine.cjs
CHANGED
|
@@ -12156,11 +12156,18 @@ function K8sDropdown(props) {
|
|
|
12156
12156
|
}
|
|
12157
12157
|
});
|
|
12158
12158
|
const formType = (_b = config == null ? void 0 : config.formConfig) == null ? void 0 : _b.formType;
|
|
12159
|
+
const { action } = core.useParsed();
|
|
12160
|
+
const { resource } = core.useResource();
|
|
12161
|
+
const isInShowPage = action === "show";
|
|
12162
|
+
const isSameResource = resourceName === (resource == null ? void 0 : resource.name);
|
|
12163
|
+
const isShowPageSameResource = isInShowPage && isSameResource;
|
|
12164
|
+
const shouldHideEdit = hideEditProp || isShowPageSameResource;
|
|
12165
|
+
const shouldHideEditYaml = hideEditYaml || formType !== FormType.FORM;
|
|
12159
12166
|
return /* @__PURE__ */ common.jsxRuntimeExports.jsx(common.jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ common.jsxRuntimeExports.jsx(
|
|
12160
12167
|
eagle.Dropdown,
|
|
12161
12168
|
{
|
|
12162
12169
|
overlay: /* @__PURE__ */ common.jsxRuntimeExports.jsxs(eagle.Menu, { children: [
|
|
12163
|
-
|
|
12170
|
+
shouldHideEdit || (canEditData == null ? void 0 : canEditData.can) === false || (config == null ? void 0 : config.hideEdit) ? null : /* @__PURE__ */ common.jsxRuntimeExports.jsx(
|
|
12164
12171
|
eagle.Menu.Item,
|
|
12165
12172
|
{
|
|
12166
12173
|
onClick: () => openForm({ id: record.id, resourceName, resourceConfig: config }),
|
|
@@ -12170,7 +12177,7 @@ function K8sDropdown(props) {
|
|
|
12170
12177
|
)}` : t2("dovetail.edit_yaml") })
|
|
12171
12178
|
}
|
|
12172
12179
|
),
|
|
12173
|
-
|
|
12180
|
+
shouldHideEditYaml || (canEditData == null ? void 0 : canEditData.can) === false || (config == null ? void 0 : config.hideEdit) ? null : /* @__PURE__ */ common.jsxRuntimeExports.jsx(
|
|
12174
12181
|
eagle.Menu.Item,
|
|
12175
12182
|
{
|
|
12176
12183
|
onClick: () => openForm({
|
package/dist/refine.js
CHANGED
|
@@ -12137,11 +12137,18 @@ function K8sDropdown(props) {
|
|
|
12137
12137
|
}
|
|
12138
12138
|
});
|
|
12139
12139
|
const formType = (_b = config == null ? void 0 : config.formConfig) == null ? void 0 : _b.formType;
|
|
12140
|
+
const { action } = useParsed();
|
|
12141
|
+
const { resource } = useResource();
|
|
12142
|
+
const isInShowPage = action === "show";
|
|
12143
|
+
const isSameResource = resourceName === (resource == null ? void 0 : resource.name);
|
|
12144
|
+
const isShowPageSameResource = isInShowPage && isSameResource;
|
|
12145
|
+
const shouldHideEdit = hideEditProp || isShowPageSameResource;
|
|
12146
|
+
const shouldHideEditYaml = hideEditYaml || formType !== FormType.FORM;
|
|
12140
12147
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12141
12148
|
Dropdown,
|
|
12142
12149
|
{
|
|
12143
12150
|
overlay: /* @__PURE__ */ jsxRuntimeExports.jsxs(Menu$1, { children: [
|
|
12144
|
-
|
|
12151
|
+
shouldHideEdit || (canEditData == null ? void 0 : canEditData.can) === false || (config == null ? void 0 : config.hideEdit) ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12145
12152
|
Menu$1.Item,
|
|
12146
12153
|
{
|
|
12147
12154
|
onClick: () => openForm({ id: record.id, resourceName, resourceConfig: config }),
|
|
@@ -12151,7 +12158,7 @@ function K8sDropdown(props) {
|
|
|
12151
12158
|
)}` : t2("dovetail.edit_yaml") })
|
|
12152
12159
|
}
|
|
12153
12160
|
),
|
|
12154
|
-
|
|
12161
|
+
shouldHideEditYaml || (canEditData == null ? void 0 : canEditData.can) === false || (config == null ? void 0 : config.hideEdit) ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12155
12162
|
Menu$1.Item,
|
|
12156
12163
|
{
|
|
12157
12164
|
onClick: () => openForm({
|