@asaleh37/ui-base 1.2.30 → 25.6.1
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/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -8
- package/src/components/administration/dev/AttachmentConfigGrid.tsx +11 -1
- package/src/components/administration/dev/ReportGrid.tsx +19 -17
- package/src/components/common/Home.tsx +1 -2
- package/src/components/common/MyNotificationsPanel.tsx +0 -1
- package/src/components/templates/DataEntryTemplates/TemplateDataForm/TemplateForm.tsx +0 -1
- package/src/components/templates/report/ExcelReportViewer.tsx +1 -2
- package/src/components/templates/report/ReportViewer.tsx +1 -2
- package/src/layout/NavigationTree.tsx +19 -15
- package/src/layout/TopBar.tsx +1 -3
- package/src/main.tsx +2 -2
- package/src/redux/features/common/CommonStoreSlice.ts +3 -3
- package/src/types/index.ts +1 -0
- package/vite.config.ts +14 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@asaleh37/ui-base",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "25.6.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "Ahmed Saleh Mohamed",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"types": "dist/index.d.ts",
|
|
11
11
|
"scripts": {
|
|
12
12
|
"build": "rollup -c --bundleConfigAsCjs",
|
|
13
|
-
"dev": "vite"
|
|
13
|
+
"dev": "vite --host"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@emotion/cache": "^11.14.0",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"@types/react-dom": "^19.0.3",
|
|
42
42
|
"@types/react-i18next": "^7.8.3",
|
|
43
43
|
"@vitejs/plugin-react": "^4.3.4",
|
|
44
|
-
"axios": "^1.8.1",
|
|
44
|
+
"axios": "^1.8.1",
|
|
45
45
|
"eslint": "^9.19.0",
|
|
46
46
|
"eslint-plugin-react-hooks": "^5.0.0",
|
|
47
47
|
"eslint-plugin-react-refresh": "^0.4.18",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"moment": "^2.30.1",
|
|
54
54
|
"oidc-client-ts": "^3.1.0",
|
|
55
55
|
"react": "^19.1.0",
|
|
56
|
-
"react-dom": "^19.0.0",
|
|
56
|
+
"react-dom": "^19.0.0",
|
|
57
57
|
"react-hook-form": "^7.54.2",
|
|
58
58
|
"react-i18next": "^15.4.0",
|
|
59
59
|
"react-redux": "^9.2.0",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"@mui/x-tree-view": "^7.26.0",
|
|
93
93
|
"@react-spring/web": "^9.7.5",
|
|
94
94
|
"@reduxjs/toolkit": "^2.5.1",
|
|
95
|
-
"axios": "^1.8.1",
|
|
95
|
+
"axios": "^1.8.1",
|
|
96
96
|
"global": "^4.4.0",
|
|
97
97
|
"i18next": "^24.2.2",
|
|
98
98
|
"i18next-browser-languagedetector": "^8.0.3",
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"moment": "^2.30.1",
|
|
101
101
|
"oidc-client-ts": "^3.1.0",
|
|
102
102
|
"react": "^19.0.0",
|
|
103
|
-
"react-dom": "^19.0.0",
|
|
103
|
+
"react-dom": "^19.0.0",
|
|
104
104
|
"react-hook-form": "^7.54.2",
|
|
105
105
|
"react-i18next": "^15.4.0",
|
|
106
106
|
"react-redux": "^9.2.0",
|
|
@@ -113,7 +113,8 @@
|
|
|
113
113
|
"stylis-plugin-rtl": "^2.1.1",
|
|
114
114
|
"zod": "^3.24.2"
|
|
115
115
|
},
|
|
116
|
-
"dependencies": {
|
|
117
|
-
"@rollup/plugin-json": "^6.1.0"
|
|
116
|
+
"dependencies": {
|
|
117
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
118
|
+
"rollup-plugin-terser": "^7.0.2"
|
|
118
119
|
}
|
|
119
120
|
}
|
|
@@ -4,7 +4,7 @@ import { FormElementProps } from "../../templates/DataEntryTemplates/DataEntryTy
|
|
|
4
4
|
import { useTranslation } from "react-i18next";
|
|
5
5
|
import { useApiActions } from "../../../hooks";
|
|
6
6
|
|
|
7
|
-
const storageTypes = [{ value: "FILE_SYSTEM" }, { value: "SFTP" }];
|
|
7
|
+
export const storageTypes = [{ value: "FILE_SYSTEM" }, { value: "SFTP" }];
|
|
8
8
|
|
|
9
9
|
const AttachmentConfigGrid: React.FC = () => {
|
|
10
10
|
const { t } = useTranslation();
|
|
@@ -116,6 +116,16 @@ const AttachmentConfigGrid: React.FC = () => {
|
|
|
116
116
|
optionValueField: "value",
|
|
117
117
|
},
|
|
118
118
|
},
|
|
119
|
+
{
|
|
120
|
+
type: "field",
|
|
121
|
+
mode: "props",
|
|
122
|
+
props: {
|
|
123
|
+
fieldLabel: "Include App Code in attachment path",
|
|
124
|
+
fieldName: "includeAppCodeInPath",
|
|
125
|
+
required: false,
|
|
126
|
+
fieldType: "checkbox",
|
|
127
|
+
},
|
|
128
|
+
},
|
|
119
129
|
{
|
|
120
130
|
type: "field",
|
|
121
131
|
mode: "props",
|
|
@@ -12,6 +12,7 @@ import { toast } from "react-toastify";
|
|
|
12
12
|
import ReportParametersForm from "./ReportParametersForm";
|
|
13
13
|
import ReportParameterGrid from "./ReportParameterGrid";
|
|
14
14
|
import ReportViewer from "../../templates/report/ReportViewer";
|
|
15
|
+
import { storageTypes } from "./AttachmentConfigGrid";
|
|
15
16
|
|
|
16
17
|
type ValidationCritria = {
|
|
17
18
|
isVisible: boolean;
|
|
@@ -26,7 +27,6 @@ type ReportValidationOptions = {
|
|
|
26
27
|
reportBluePrintId: ValidationCritria;
|
|
27
28
|
reportExcelDataQueryId: ValidationCritria;
|
|
28
29
|
reportJasperName: ValidationCritria;
|
|
29
|
-
reportJasperPath: ValidationCritria;
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
type validationObjectType = {
|
|
@@ -40,7 +40,6 @@ const validationObject: validationObjectType = {
|
|
|
40
40
|
reportBluePrintId: { isMandatory: true, isVisible: true },
|
|
41
41
|
reportExcelDataQueryId: { isMandatory: false, isVisible: false },
|
|
42
42
|
reportJasperName: { isMandatory: false, isVisible: false },
|
|
43
|
-
reportJasperPath: { isMandatory: false, isVisible: false },
|
|
44
43
|
},
|
|
45
44
|
Jasper: {
|
|
46
45
|
useSysDatasource: { isMandatory: false, isVisible: true },
|
|
@@ -48,7 +47,6 @@ const validationObject: validationObjectType = {
|
|
|
48
47
|
reportBluePrintId: { isMandatory: false, isVisible: false },
|
|
49
48
|
reportExcelDataQueryId: { isMandatory: false, isVisible: false },
|
|
50
49
|
reportJasperName: { isMandatory: true, isVisible: true },
|
|
51
|
-
reportJasperPath: { isMandatory: true, isVisible: true },
|
|
52
50
|
},
|
|
53
51
|
Excel: {
|
|
54
52
|
useSysDatasource: { isMandatory: false, isVisible: false },
|
|
@@ -56,7 +54,6 @@ const validationObject: validationObjectType = {
|
|
|
56
54
|
reportBluePrintId: { isMandatory: false, isVisible: false },
|
|
57
55
|
reportExcelDataQueryId: { isMandatory: true, isVisible: true },
|
|
58
56
|
reportJasperName: { isMandatory: false, isVisible: false },
|
|
59
|
-
reportJasperPath: { isMandatory: false, isVisible: false },
|
|
60
57
|
},
|
|
61
58
|
};
|
|
62
59
|
|
|
@@ -83,13 +80,11 @@ const adjustFormAccordingToReportType = (
|
|
|
83
80
|
formActions.hideField("reportBluePrintId");
|
|
84
81
|
formActions.hideField("reportExcelDataQueryId");
|
|
85
82
|
formActions.hideField("reportJasperName");
|
|
86
|
-
formActions.hideField("reportJasperPath");
|
|
87
83
|
formManager.setValue("useSysDatasource", null);
|
|
88
84
|
formManager.setValue("datasourceConId", null);
|
|
89
85
|
formManager.setValue("reportBluePrintId", null);
|
|
90
86
|
formManager.setValue("reportExcelDataQueryId", null);
|
|
91
87
|
formManager.setValue("reportJasperName", null);
|
|
92
|
-
formManager.setValue("reportJasperPath", null);
|
|
93
88
|
}
|
|
94
89
|
};
|
|
95
90
|
|
|
@@ -245,6 +240,19 @@ const ReportGrid: React.FC = () => {
|
|
|
245
240
|
fieldType: "text",
|
|
246
241
|
},
|
|
247
242
|
},
|
|
243
|
+
{
|
|
244
|
+
type: "field",
|
|
245
|
+
mode: "props",
|
|
246
|
+
props: {
|
|
247
|
+
fieldLabel: "ATTACHMENT_CONFIG_STORAGE_TYPE",
|
|
248
|
+
fieldName: "storageType",
|
|
249
|
+
required: true,
|
|
250
|
+
fieldType: "combobox",
|
|
251
|
+
options: storageTypes,
|
|
252
|
+
optionDisplayField: "value",
|
|
253
|
+
optionValueField: "value",
|
|
254
|
+
},
|
|
255
|
+
},
|
|
248
256
|
{
|
|
249
257
|
type: "field",
|
|
250
258
|
mode: "props",
|
|
@@ -375,14 +383,10 @@ const ReportGrid: React.FC = () => {
|
|
|
375
383
|
type: "field",
|
|
376
384
|
mode: "props",
|
|
377
385
|
props: {
|
|
378
|
-
fieldLabel: "
|
|
379
|
-
fieldName: "
|
|
380
|
-
hidden: true,
|
|
381
|
-
gridProps: {
|
|
382
|
-
hidden: true,
|
|
383
|
-
},
|
|
386
|
+
fieldLabel: "Include App Code in attachment path",
|
|
387
|
+
fieldName: "includeAppCodeInPath",
|
|
384
388
|
required: false,
|
|
385
|
-
fieldType: "
|
|
389
|
+
fieldType: "checkbox",
|
|
386
390
|
},
|
|
387
391
|
},
|
|
388
392
|
{
|
|
@@ -408,6 +412,7 @@ const ReportGrid: React.FC = () => {
|
|
|
408
412
|
<ReportParameterGrid selectedRecord={selectedRecord} />
|
|
409
413
|
</ReportParameterWindow>
|
|
410
414
|
<TemplateGrid
|
|
415
|
+
attachment={{ attachmentCode: "JASPER_REPORTS" }}
|
|
411
416
|
apiActions={apiActions}
|
|
412
417
|
data={data}
|
|
413
418
|
setData={setData}
|
|
@@ -474,10 +479,7 @@ const ReportGrid: React.FC = () => {
|
|
|
474
479
|
toast.error("You must enter the jasper report name");
|
|
475
480
|
return false;
|
|
476
481
|
}
|
|
477
|
-
|
|
478
|
-
toast.error("You must enter the jasper report path");
|
|
479
|
-
return false;
|
|
480
|
-
}
|
|
482
|
+
|
|
481
483
|
if (
|
|
482
484
|
record?.reportType === "Blueprint" &&
|
|
483
485
|
!record?.reportBluePrintId
|
|
@@ -8,8 +8,7 @@ import AttachmentPanel from "../templates/attachment/AttachmentPanel";
|
|
|
8
8
|
import { useSelector } from "react-redux";
|
|
9
9
|
|
|
10
10
|
const Home: React.FC = () => {
|
|
11
|
-
const AppInfo = useSelector((state: any) => state.AppInfo.value);
|
|
12
|
-
console.log("AppInfo", AppInfo);
|
|
11
|
+
const AppInfo = useSelector((state: any) => state.AppInfo.value);
|
|
13
12
|
return (
|
|
14
13
|
<Box
|
|
15
14
|
sx={{
|
|
@@ -186,8 +186,7 @@ const ReportViewer: React.FC<ReportViewerProps> = (props) => {
|
|
|
186
186
|
// Clean up
|
|
187
187
|
document.body.removeChild(link);
|
|
188
188
|
window.URL.revokeObjectURL(url);
|
|
189
|
-
}
|
|
190
|
-
console.log(response);
|
|
189
|
+
}
|
|
191
190
|
},
|
|
192
191
|
failureCallBkFn: (response) => {
|
|
193
192
|
setErrorMessage(
|
|
@@ -236,28 +236,32 @@ export default function NavigationTree() {
|
|
|
236
236
|
const isMobile = useIsMobile();
|
|
237
237
|
const { isUserAuthorized } = useSession();
|
|
238
238
|
const filterData = (data) => {
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
)
|
|
246
|
-
|
|
247
|
-
if (
|
|
248
|
-
|
|
239
|
+
const parentItems = [];
|
|
240
|
+
for (let parentItem of data) {
|
|
241
|
+
if (
|
|
242
|
+
parentItem.authority === undefined ||
|
|
243
|
+
parentItem.authority == null ||
|
|
244
|
+
isUserAuthorized(parentItem.authority)
|
|
245
|
+
) {
|
|
246
|
+
let newParentItem = structuredClone(parentItem);
|
|
247
|
+
if (parentItem?.children) {
|
|
248
|
+
newParentItem.children = filterData(parentItem.children);
|
|
249
249
|
}
|
|
250
|
-
|
|
251
|
-
}
|
|
250
|
+
parentItems.push(newParentItem);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
return parentItems;
|
|
252
254
|
};
|
|
253
255
|
|
|
254
256
|
const mergedNavigationItems = [];
|
|
255
257
|
if (AppInfo.enableAdministrationModule) {
|
|
256
|
-
mergedNavigationItems.push(...NavigationItems);
|
|
258
|
+
mergedNavigationItems.push(...structuredClone(NavigationItems));
|
|
257
259
|
}
|
|
258
|
-
mergedNavigationItems.push(
|
|
260
|
+
mergedNavigationItems.push(
|
|
261
|
+
...structuredClone(AppInfo.businessNavigationItems)
|
|
262
|
+
);
|
|
259
263
|
const authoriedNavigationItems = filterData(mergedNavigationItems);
|
|
260
|
-
|
|
264
|
+
console.log("authoriedNavigationItems", authoriedNavigationItems);
|
|
261
265
|
return (
|
|
262
266
|
<RichTreeView
|
|
263
267
|
items={authoriedNavigationItems}
|
package/src/layout/TopBar.tsx
CHANGED
|
@@ -80,9 +80,7 @@ const TopBar: React.FC = () => {
|
|
|
80
80
|
const handleLogout = async () => {
|
|
81
81
|
try {
|
|
82
82
|
await handleGetRequest({ endPointURI: "api/auth/logout" });
|
|
83
|
-
} catch (error) {
|
|
84
|
-
console.log("logout error", error);
|
|
85
|
-
}
|
|
83
|
+
} catch (error) {}
|
|
86
84
|
dispatch(UserSessionActions.setUnAuthenticated());
|
|
87
85
|
};
|
|
88
86
|
const toggleSideBar = () => {
|
package/src/main.tsx
CHANGED
|
@@ -4,8 +4,8 @@ import { BaseApp } from "./components";
|
|
|
4
4
|
|
|
5
5
|
createRoot(document.getElementById("root")!).render(
|
|
6
6
|
<BaseApp
|
|
7
|
-
apiBaseUrl="http://
|
|
8
|
-
appLogo={"/
|
|
7
|
+
apiBaseUrl="http://192.168.1.2:8081/api-base"
|
|
8
|
+
appLogo={"/logo.png"}
|
|
9
9
|
appName="UI Base Library"
|
|
10
10
|
appVersion="0.0"
|
|
11
11
|
businessCommonStoresMetaData={{}}
|
|
@@ -14,12 +14,12 @@ interface setStoreDataProps {
|
|
|
14
14
|
data: Array<any>;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
export
|
|
17
|
+
export type StoreMetaData = {
|
|
18
18
|
url: string;
|
|
19
19
|
data: Array<any>;
|
|
20
20
|
autoLoad: boolean;
|
|
21
21
|
authority?: string;
|
|
22
|
-
}
|
|
22
|
+
};
|
|
23
23
|
|
|
24
24
|
export const commonStoresInitialState: CommonStoresInterface = {
|
|
25
25
|
stores: {},
|
|
@@ -27,7 +27,7 @@ export const commonStoresInitialState: CommonStoresInterface = {
|
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
const commonStoreSlice = createSlice({
|
|
30
|
-
name: "
|
|
30
|
+
name: "commonStores",
|
|
31
31
|
initialState: commonStoresInitialState,
|
|
32
32
|
reducers: {
|
|
33
33
|
setStoresMetaData: (state, action) => {
|
package/src/types/index.ts
CHANGED
package/vite.config.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { defineConfig } from "vite";
|
|
|
2
2
|
import react from "@vitejs/plugin-react";
|
|
3
3
|
import rollupNodePolyFill from "rollup-plugin-polyfill-node";
|
|
4
4
|
import inject from "@rollup/plugin-inject";
|
|
5
|
+
import { terser } from "rollup-plugin-terser";
|
|
5
6
|
|
|
6
7
|
// https://vite.dev/config/
|
|
7
8
|
export default defineConfig({
|
|
@@ -13,8 +14,20 @@ export default defineConfig({
|
|
|
13
14
|
include: ["fbjs"],
|
|
14
15
|
},
|
|
15
16
|
build: {
|
|
17
|
+
minify: false,
|
|
16
18
|
rollupOptions: {
|
|
17
|
-
plugins: [
|
|
19
|
+
plugins: [
|
|
20
|
+
rollupNodePolyFill(),
|
|
21
|
+
terser({
|
|
22
|
+
compress: {
|
|
23
|
+
drop_debugger: false,
|
|
24
|
+
drop_console: false,
|
|
25
|
+
},
|
|
26
|
+
format: {
|
|
27
|
+
comments: false,
|
|
28
|
+
},
|
|
29
|
+
}),
|
|
30
|
+
],
|
|
18
31
|
},
|
|
19
32
|
},
|
|
20
33
|
server: {
|