@asaleh37/ui-base 25.6.2 → 25.6.17-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.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 +8 -9
- package/src/components/administration/dev/AttachmentConfigGrid.tsx +1 -11
- package/src/components/administration/dev/ReportGrid.tsx +17 -19
- package/src/components/common/Home.tsx +2 -1
- package/src/components/common/MyNotificationsPanel.tsx +1 -0
- package/src/components/templates/DataEntryTemplates/TemplateDataForm/TemplateForm.tsx +1 -0
- package/src/components/templates/report/ExcelReportViewer.tsx +2 -1
- package/src/components/templates/report/ReportViewer.tsx +2 -1
- package/src/layout/NavigationTree.tsx +15 -19
- package/src/layout/TopBar.tsx +3 -1
- package/src/main.tsx +2 -2
- package/src/redux/features/common/CommonStoreSlice.ts +3 -3
- package/vite.config.ts +1 -14
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@asaleh37/ui-base",
|
|
3
|
-
"version": "25.6.
|
|
3
|
+
"version": "25.6.17-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"
|
|
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,8 +113,7 @@
|
|
|
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"
|
|
118
|
-
"rollup-plugin-terser": "^7.0.2"
|
|
116
|
+
"dependencies": {
|
|
117
|
+
"@rollup/plugin-json": "^6.1.0"
|
|
119
118
|
}
|
|
120
119
|
}
|
|
@@ -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
|
-
|
|
7
|
+
const storageTypes = [{ value: "FILE_SYSTEM" }, { value: "SFTP" }];
|
|
8
8
|
|
|
9
9
|
const AttachmentConfigGrid: React.FC = () => {
|
|
10
10
|
const { t } = useTranslation();
|
|
@@ -116,16 +116,6 @@ 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
|
-
},
|
|
129
119
|
{
|
|
130
120
|
type: "field",
|
|
131
121
|
mode: "props",
|
|
@@ -12,7 +12,6 @@ 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";
|
|
16
15
|
|
|
17
16
|
type ValidationCritria = {
|
|
18
17
|
isVisible: boolean;
|
|
@@ -27,6 +26,7 @@ type ReportValidationOptions = {
|
|
|
27
26
|
reportBluePrintId: ValidationCritria;
|
|
28
27
|
reportExcelDataQueryId: ValidationCritria;
|
|
29
28
|
reportJasperName: ValidationCritria;
|
|
29
|
+
reportJasperPath: ValidationCritria;
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
type validationObjectType = {
|
|
@@ -40,6 +40,7 @@ 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 },
|
|
43
44
|
},
|
|
44
45
|
Jasper: {
|
|
45
46
|
useSysDatasource: { isMandatory: false, isVisible: true },
|
|
@@ -47,6 +48,7 @@ const validationObject: validationObjectType = {
|
|
|
47
48
|
reportBluePrintId: { isMandatory: false, isVisible: false },
|
|
48
49
|
reportExcelDataQueryId: { isMandatory: false, isVisible: false },
|
|
49
50
|
reportJasperName: { isMandatory: true, isVisible: true },
|
|
51
|
+
reportJasperPath: { isMandatory: true, isVisible: true },
|
|
50
52
|
},
|
|
51
53
|
Excel: {
|
|
52
54
|
useSysDatasource: { isMandatory: false, isVisible: false },
|
|
@@ -54,6 +56,7 @@ const validationObject: validationObjectType = {
|
|
|
54
56
|
reportBluePrintId: { isMandatory: false, isVisible: false },
|
|
55
57
|
reportExcelDataQueryId: { isMandatory: true, isVisible: true },
|
|
56
58
|
reportJasperName: { isMandatory: false, isVisible: false },
|
|
59
|
+
reportJasperPath: { isMandatory: false, isVisible: false },
|
|
57
60
|
},
|
|
58
61
|
};
|
|
59
62
|
|
|
@@ -80,11 +83,13 @@ const adjustFormAccordingToReportType = (
|
|
|
80
83
|
formActions.hideField("reportBluePrintId");
|
|
81
84
|
formActions.hideField("reportExcelDataQueryId");
|
|
82
85
|
formActions.hideField("reportJasperName");
|
|
86
|
+
formActions.hideField("reportJasperPath");
|
|
83
87
|
formManager.setValue("useSysDatasource", null);
|
|
84
88
|
formManager.setValue("datasourceConId", null);
|
|
85
89
|
formManager.setValue("reportBluePrintId", null);
|
|
86
90
|
formManager.setValue("reportExcelDataQueryId", null);
|
|
87
91
|
formManager.setValue("reportJasperName", null);
|
|
92
|
+
formManager.setValue("reportJasperPath", null);
|
|
88
93
|
}
|
|
89
94
|
};
|
|
90
95
|
|
|
@@ -240,19 +245,6 @@ const ReportGrid: React.FC = () => {
|
|
|
240
245
|
fieldType: "text",
|
|
241
246
|
},
|
|
242
247
|
},
|
|
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
|
-
},
|
|
256
248
|
{
|
|
257
249
|
type: "field",
|
|
258
250
|
mode: "props",
|
|
@@ -383,10 +375,14 @@ const ReportGrid: React.FC = () => {
|
|
|
383
375
|
type: "field",
|
|
384
376
|
mode: "props",
|
|
385
377
|
props: {
|
|
386
|
-
fieldLabel: "
|
|
387
|
-
fieldName: "
|
|
378
|
+
fieldLabel: "REPORT_REPORT_JASPER_PATH",
|
|
379
|
+
fieldName: "reportJasperPath",
|
|
380
|
+
hidden: true,
|
|
381
|
+
gridProps: {
|
|
382
|
+
hidden: true,
|
|
383
|
+
},
|
|
388
384
|
required: false,
|
|
389
|
-
fieldType: "
|
|
385
|
+
fieldType: "text",
|
|
390
386
|
},
|
|
391
387
|
},
|
|
392
388
|
{
|
|
@@ -412,7 +408,6 @@ const ReportGrid: React.FC = () => {
|
|
|
412
408
|
<ReportParameterGrid selectedRecord={selectedRecord} />
|
|
413
409
|
</ReportParameterWindow>
|
|
414
410
|
<TemplateGrid
|
|
415
|
-
attachment={{ attachmentCode: "JASPER_REPORTS" }}
|
|
416
411
|
apiActions={apiActions}
|
|
417
412
|
data={data}
|
|
418
413
|
setData={setData}
|
|
@@ -479,7 +474,10 @@ const ReportGrid: React.FC = () => {
|
|
|
479
474
|
toast.error("You must enter the jasper report name");
|
|
480
475
|
return false;
|
|
481
476
|
}
|
|
482
|
-
|
|
477
|
+
if (record?.reportType === "Jasper" && !record?.reportJasperPath) {
|
|
478
|
+
toast.error("You must enter the jasper report path");
|
|
479
|
+
return false;
|
|
480
|
+
}
|
|
483
481
|
if (
|
|
484
482
|
record?.reportType === "Blueprint" &&
|
|
485
483
|
!record?.reportBluePrintId
|
|
@@ -8,7 +8,8 @@ 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);
|
|
11
|
+
const AppInfo = useSelector((state: any) => state.AppInfo.value);
|
|
12
|
+
console.log("AppInfo", AppInfo);
|
|
12
13
|
return (
|
|
13
14
|
<Box
|
|
14
15
|
sx={{
|
|
@@ -186,7 +186,8 @@ const ReportViewer: React.FC<ReportViewerProps> = (props) => {
|
|
|
186
186
|
// Clean up
|
|
187
187
|
document.body.removeChild(link);
|
|
188
188
|
window.URL.revokeObjectURL(url);
|
|
189
|
-
}
|
|
189
|
+
}
|
|
190
|
+
console.log(response);
|
|
190
191
|
},
|
|
191
192
|
failureCallBkFn: (response) => {
|
|
192
193
|
setErrorMessage(
|
|
@@ -236,32 +236,28 @@ 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
|
+
return data
|
|
240
|
+
.filter(
|
|
241
|
+
(item: any) =>
|
|
242
|
+
item.authority === undefined ||
|
|
243
|
+
item.authority == null ||
|
|
244
|
+
isUserAuthorized(item.authority)
|
|
245
|
+
)
|
|
246
|
+
.map((item: any) => {
|
|
247
|
+
if (item.children) {
|
|
248
|
+
item.children = filterData(item.children);
|
|
249
249
|
}
|
|
250
|
-
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
return parentItems;
|
|
250
|
+
return item;
|
|
251
|
+
});
|
|
254
252
|
};
|
|
255
253
|
|
|
256
254
|
const mergedNavigationItems = [];
|
|
257
255
|
if (AppInfo.enableAdministrationModule) {
|
|
258
|
-
mergedNavigationItems.push(...
|
|
256
|
+
mergedNavigationItems.push(...NavigationItems);
|
|
259
257
|
}
|
|
260
|
-
mergedNavigationItems.push(
|
|
261
|
-
...structuredClone(AppInfo.businessNavigationItems)
|
|
262
|
-
);
|
|
258
|
+
mergedNavigationItems.push(...AppInfo.businessNavigationItems);
|
|
263
259
|
const authoriedNavigationItems = filterData(mergedNavigationItems);
|
|
264
|
-
|
|
260
|
+
|
|
265
261
|
return (
|
|
266
262
|
<RichTreeView
|
|
267
263
|
items={authoriedNavigationItems}
|
package/src/layout/TopBar.tsx
CHANGED
|
@@ -80,7 +80,9 @@ const TopBar: React.FC = () => {
|
|
|
80
80
|
const handleLogout = async () => {
|
|
81
81
|
try {
|
|
82
82
|
await handleGetRequest({ endPointURI: "api/auth/logout" });
|
|
83
|
-
} catch (error) {
|
|
83
|
+
} catch (error) {
|
|
84
|
+
console.log("logout error", error);
|
|
85
|
+
}
|
|
84
86
|
dispatch(UserSessionActions.setUnAuthenticated());
|
|
85
87
|
};
|
|
86
88
|
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={"/logo.png"}
|
|
7
|
+
apiBaseUrl="http://localhost:8080/api-base"
|
|
8
|
+
appLogo={"/public/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 type StoreMetaData
|
|
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: "loadingMask",
|
|
31
31
|
initialState: commonStoresInitialState,
|
|
32
32
|
reducers: {
|
|
33
33
|
setStoresMetaData: (state, action) => {
|
package/vite.config.ts
CHANGED
|
@@ -2,7 +2,6 @@ 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";
|
|
6
5
|
|
|
7
6
|
// https://vite.dev/config/
|
|
8
7
|
export default defineConfig({
|
|
@@ -14,20 +13,8 @@ export default defineConfig({
|
|
|
14
13
|
include: ["fbjs"],
|
|
15
14
|
},
|
|
16
15
|
build: {
|
|
17
|
-
minify: false,
|
|
18
16
|
rollupOptions: {
|
|
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
|
-
],
|
|
17
|
+
plugins: [rollupNodePolyFill()],
|
|
31
18
|
},
|
|
32
19
|
},
|
|
33
20
|
server: {
|