@uxf/cms 11.74.2 → 11.74.3
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/package.json
CHANGED
@@ -27,7 +27,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
27
27
|
};
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
29
29
|
exports.GridPage = exports.dataGridLoader = void 0;
|
30
|
-
const translations_1 = require("@uxf/core-react/translations");
|
31
30
|
const empty_array_1 = require("@uxf/core/constants/empty-array");
|
32
31
|
const build_array_1 = require("@uxf/core/utils/build-array");
|
33
32
|
const is_nil_1 = require("@uxf/core/utils/is-nil");
|
@@ -138,7 +137,6 @@ GridPageComponent.displayName = "GridPageComponent";
|
|
138
137
|
/** @deprecated - use custom DataGrid on project */
|
139
138
|
const GridPage = (config) => {
|
140
139
|
var _a;
|
141
|
-
const t = (0, translations_1.useUxfTranslation)();
|
142
140
|
function Component() {
|
143
141
|
var _a, _b;
|
144
142
|
const router = (0, router_2.useRouter)();
|
@@ -156,6 +154,6 @@ const GridPage = (config) => {
|
|
156
154
|
}
|
157
155
|
return (react_1.default.createElement(GridPageComponent, { AddIcon: config.AddIcon, appName: config.appName, customActions: config.customActions, entityAlias: config.entityAlias, getEditUrl: config.getEditUrl, getOpenUrl: config.getOpenUrl, gridSchema: schema, initialHiddenColumns: (_b = userConfigQuery.data) !== null && _b !== void 0 ? _b : [], initialUserConfig: config.initialUserConfig, loader: config.loader, metaSchema: metadata, onAdd: config.onAdd, onAddTitle: config.onAddTitle, onEdit: config.onEdit, onOpen: config.onOpen, onRemove: config.onRemove, query: router.query, rowHeight: config.rowHeight, selectable: config.selectable, title: config.title, ui: config.ui }));
|
158
156
|
}
|
159
|
-
return (0, restricted_page_1.restrictedPage)(Component, { allowedRole: (_a = config.allowedRoles) !== null && _a !== void 0 ? _a : ["ROLE_ROOT"] }
|
157
|
+
return (0, restricted_page_1.restrictedPage)(Component, { allowedRole: (_a = config.allowedRoles) !== null && _a !== void 0 ? _a : ["ROLE_ROOT"] });
|
160
158
|
};
|
161
159
|
exports.GridPage = GridPage;
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import { useUxfTranslation } from "@uxf/core-react/translations";
|
2
1
|
import React, { ReactNode } from "react";
|
3
2
|
interface Config {
|
4
3
|
allowedRole: string[];
|
@@ -6,5 +5,5 @@ interface Config {
|
|
6
5
|
export declare function ErrorContent(props: {
|
7
6
|
error: any;
|
8
7
|
}): React.JSX.Element;
|
9
|
-
export declare function restrictedPage(Component: () => ReactNode, config: Config
|
8
|
+
export declare function restrictedPage(Component: () => ReactNode, config: Config): (props: any) => React.JSX.Element;
|
10
9
|
export {};
|
@@ -20,9 +20,10 @@ function ErrorContent(props) {
|
|
20
20
|
}
|
21
21
|
return react_1.default.createElement("div", null, t("uxf-cms-restricted-page:unknown-error"));
|
22
22
|
}
|
23
|
-
function restrictedPage(Component, config
|
23
|
+
function restrictedPage(Component, config) {
|
24
24
|
return function Page(props) {
|
25
25
|
const meQuery = (0, swr_1.useCmsMeQuery)();
|
26
|
+
const t = (0, translations_1.useUxfTranslation)();
|
26
27
|
if (meQuery.isLoading || typeof window === "undefined") {
|
27
28
|
return (react_1.default.createElement("div", { className: "flex min-h-screen w-full items-center justify-center" },
|
28
29
|
react_1.default.createElement(loader_1.Loader, null)));
|