@solidxai/solidctl 0.1.16 → 0.1.17

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.
Files changed (40) hide show
  1. package/package.json +1 -1
  2. package/templates/ui-template/src/App.tsx +5 -19
  3. package/templates/ui-template/src/extensions/solid-extensions.ts +2 -68
  4. package/templates/ui-template/src/routes/AppRoutes.tsx +2 -21
  5. package/templates/ui-template/src/extensions/venue/call-log/custom-widgets/.gitkeep +0 -0
  6. package/templates/ui-template/src/extensions/venue/call-log/form-buttons/.gitkeep +0 -0
  7. package/templates/ui-template/src/extensions/venue/call-log/form-event-listeners/.gitkeep +0 -0
  8. package/templates/ui-template/src/extensions/venue/call-log/form-event-listeners/callLogsDispositionHandler.ts +0 -47
  9. package/templates/ui-template/src/extensions/venue/call-log/list-buttons/.gitkeep +0 -0
  10. package/templates/ui-template/src/extensions/venue/call-log/list-event-listeners/.gitkeep +0 -0
  11. package/templates/ui-template/src/extensions/venue/call-log/row-buttons/.gitkeep +0 -0
  12. package/templates/ui-template/src/extensions/venue/hierarchy-import-transaction/custom-widgets/.gitkeep +0 -0
  13. package/templates/ui-template/src/extensions/venue/hierarchy-import-transaction/form-buttons/.gitkeep +0 -0
  14. package/templates/ui-template/src/extensions/venue/hierarchy-import-transaction/form-buttons/ImportHierarchyComponent.tsx +0 -377
  15. package/templates/ui-template/src/extensions/venue/hierarchy-import-transaction/form-buttons/SolidCustomImportHeader.tsx +0 -14
  16. package/templates/ui-template/src/extensions/venue/hierarchy-import-transaction/form-event-listeners/.gitkeep +0 -0
  17. package/templates/ui-template/src/extensions/venue/hierarchy-import-transaction/form-event-listeners/CallLogsDispositionHandler.ts +0 -47
  18. package/templates/ui-template/src/extensions/venue/hierarchy-import-transaction/form-event-listeners/onHierarchyImportFormLoadHandler.ts +0 -45
  19. package/templates/ui-template/src/extensions/venue/hierarchy-import-transaction/list-buttons/.gitkeep +0 -0
  20. package/templates/ui-template/src/extensions/venue/hierarchy-import-transaction/list-event-listeners/.gitkeep +0 -0
  21. package/templates/ui-template/src/extensions/venue/hierarchy-import-transaction/row-buttons/.gitkeep +0 -0
  22. package/templates/ui-template/src/extensions/venue/venue-master/custom-widgets/.gitkeep +0 -0
  23. package/templates/ui-template/src/extensions/venue/venue-master/form-buttons/.gitkeep +0 -0
  24. package/templates/ui-template/src/extensions/venue/venue-master/form-event-listeners/.gitkeep +0 -0
  25. package/templates/ui-template/src/extensions/venue/venue-master/form-event-listeners/venueMasterFormViewLoadHandler.ts +0 -57
  26. package/templates/ui-template/src/extensions/venue/venue-master/list-buttons/.gitkeep +0 -0
  27. package/templates/ui-template/src/extensions/venue/venue-master/list-event-listeners/.gitkeep +0 -0
  28. package/templates/ui-template/src/extensions/venue/venue-master/row-buttons/.gitkeep +0 -0
  29. package/templates/ui-template/src/extensions/venue/venue-user/custom-widgets/.gitkeep +0 -0
  30. package/templates/ui-template/src/extensions/venue/venue-user/form-buttons/.gitkeep +0 -0
  31. package/templates/ui-template/src/extensions/venue/venue-user/form-event-listeners/.gitkeep +0 -0
  32. package/templates/ui-template/src/extensions/venue/venue-user/form-event-listeners/venueUserFormViewChangeHandler.ts +0 -21
  33. package/templates/ui-template/src/extensions/venue/venue-user/form-event-listeners/venueUserFormViewLoadHandler.ts +0 -97
  34. package/templates/ui-template/src/extensions/venue/venue-user/list-buttons/.gitkeep +0 -0
  35. package/templates/ui-template/src/extensions/venue/venue-user/list-event-listeners/.gitkeep +0 -0
  36. package/templates/ui-template/src/extensions/venue/venue-user/row-buttons/.gitkeep +0 -0
  37. package/templates/ui-template/src/pages/admin/AdminInfoPage.tsx +0 -15
  38. package/templates/ui-template/src/pages/auth/HelloAuthPage.tsx +0 -15
  39. package/templates/ui-template/src/pages/static/AboutPage.tsx +0 -17
  40. package/templates/ui-template/src/redux/hierarchyImportTransactionApi.tsx +0 -28
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solidxai/solidctl",
3
- "version": "0.1.16",
3
+ "version": "0.1.17",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -1,34 +1,20 @@
1
1
  import "@solidxai/core-ui";
2
- import "primeicons/primeicons.css";
3
2
  import "primeflex/primeflex.css";
3
+ import "primeicons/primeicons.css";
4
4
 
5
- import { useMemo } from "react";
6
- import { BrowserRouter } from "react-router-dom";
5
+ import { AppEventListener, LayoutProvider, SolidThemeProvider, StoreProvider } from "@solidxai/core-ui";
7
6
  import { PrimeReactProvider } from "primereact/api";
8
- import { LayoutProvider, SolidThemeProvider, StoreProvider, AppEventListener } from "@solidxai/core-ui";
9
- import { hierarchyImportTransactionApi } from "./redux/hierarchyImportTransactionApi";
7
+ import { BrowserRouter } from "react-router-dom";
10
8
 
11
- import { AppRoutes } from "./routes/AppRoutes";
12
9
  import "./extensions/solid-extensions";
13
10
  import "./index.css";
11
+ import { AppRoutes } from "./routes/AppRoutes";
14
12
 
15
13
  function App() {
16
14
 
17
- // custom reducers and middlewares can be added to the StoreProvider
18
- const venueReducers = useMemo(
19
- () => ({
20
- [hierarchyImportTransactionApi.reducerPath]: hierarchyImportTransactionApi.reducer,
21
- }),
22
- []
23
- );
24
- const venueMiddlewares = useMemo(
25
- () => [hierarchyImportTransactionApi.middleware],
26
- []
27
- );
28
-
29
15
  return (
30
16
  <BrowserRouter>
31
- <StoreProvider reducers={venueReducers} middlewares={venueMiddlewares}>
17
+ <StoreProvider>
32
18
  <PrimeReactProvider>
33
19
  <LayoutProvider>
34
20
  <SolidThemeProvider />
@@ -1,71 +1,6 @@
1
- import { registerExtensionComponent, registerExtensionFunction } from "@solidxai/core-ui";
2
- import callLogsDispositionHandler from "./venue/call-log/form-event-listeners/callLogsDispositionHandler";
3
- import { ImportHierarchyComponent } from "./venue/hierarchy-import-transaction/form-buttons/ImportHierarchyComponent";
4
- import onHierarchyImportFormLayoutLoadHandler from "./venue/hierarchy-import-transaction/form-event-listeners/onHierarchyImportFormLoadHandler";
5
- import handleVenueUserFormViewChange from "./venue/venue-user/form-event-listeners/venueUserFormViewChangeHandler";
6
- import handleVenueUserFormViewLoad from "./venue/venue-user/form-event-listeners/venueUserFormViewLoadHandler";
7
-
8
- // Module - venue
9
-
10
- // - - - - - - - - - - - - - - - - - - - -
11
- // Model - call-log
12
- // - - - - - - - - - - - - - - - - - - - -
13
-
14
- // custom-widgets
15
-
16
- // form-buttons
17
-
18
- // form-event-listeners (onFormLayoutLoad, onFormDataLoad, onFormLoad)
19
- registerExtensionFunction('callLogsDispositionHandler', callLogsDispositionHandler);
20
-
21
- // list-buttons
22
-
23
- // list-event-listeners (onListLoad, onBeforeListDataLoad)
24
-
25
- // row-buttons
26
-
27
-
28
-
29
- // - - - - - - - - - - - - - - - - - - - -
30
- // Model - hierarchy-import-transaction
31
- // - - - - - - - - - - - - - - - - - - - -
32
-
33
- // custom-widgets
34
-
35
- // form-buttons
36
- registerExtensionComponent('ImportHierarchyComponent', ImportHierarchyComponent);
37
-
38
- // form-event-listeners (onFormLayoutLoad, onFormDataLoad, onFormLoad)
39
- registerExtensionFunction('onHierarchyImportFormLayoutLoadHandler', onHierarchyImportFormLayoutLoadHandler);
40
-
41
- // list-buttons
42
-
43
- // list-event-listeners (onListLoad, onBeforeListDataLoad)
44
-
45
- // row-buttons
46
-
47
-
48
-
49
- // - - - - - - - - - - - - - - - - - - - -
50
- // Model - venue-user
51
- // - - - - - - - - - - - - - - - - - - - -
52
-
53
- // custom-widgets
54
-
55
- // form-buttons
56
-
57
- // form-event-listeners (onFormLayoutLoad, onFormDataLoad, onFormLoad)
58
- registerExtensionFunction('venueUserFormViewChangeHandler', handleVenueUserFormViewChange);
59
-
60
- // list-buttons
61
-
62
- // list-event-listeners (onListLoad, onBeforeListDataLoad)
63
-
64
- // row-buttons
65
-
66
1
 
67
2
  // - - - - - - - - - - - - - - - - - - - -
68
- // Model - venue-master
3
+ // Model - <Your Model Name>
69
4
  // - - - - - - - - - - - - - - - - - - - -
70
5
 
71
6
  // custom-widgets
@@ -73,10 +8,9 @@ registerExtensionFunction('venueUserFormViewChangeHandler', handleVenueUserFormV
73
8
  // form-buttons
74
9
 
75
10
  // form-event-listeners (onFormLayoutLoad, onFormDataLoad, onFormLoad)
76
- registerExtensionFunction('venueUserFormViewLoadHandler', handleVenueUserFormViewLoad);
77
11
 
78
12
  // list-buttons
79
13
 
80
14
  // list-event-listeners (onListLoad, onBeforeListDataLoad)
81
15
 
82
- // row-buttons
16
+ // row-buttons
@@ -1,27 +1,8 @@
1
- import { useRoutes } from "react-router-dom";
2
1
  import { getSolidRoutes } from "@solidxai/core-ui";
3
- import { HelloAuthPage } from "../pages/auth/HelloAuthPage";
4
- import { AboutPage } from "../pages/static/AboutPage";
5
- import { AdminInfoPage } from "../pages/admin/AdminInfoPage";
2
+ import { useRoutes } from "react-router-dom";
6
3
 
7
4
  export function AppRoutes() {
8
- // Example of adding an extra route that uses the AuthLayout...
9
- const extraAuthRoutes = [
10
- { path: "/auth/hello", element: <HelloAuthPage /> },
11
- ];
12
- // Example of adding an extra route that uses the AdminLayout...
13
- const extraAdminRoutes = [
14
- { path: "/admin/info", element: <AdminInfoPage /> },
15
- ];
16
- // Example of adding an extra route that uses the MainLayout...
17
- const extraRoutes = [
18
- { path: "/about", element: <AboutPage /> },
19
- ]
20
- const routes = getSolidRoutes({
21
- extraAuthRoutes,
22
- extraRoutes,
23
- extraAdminRoutes,
24
- });
5
+ const routes = getSolidRoutes();
25
6
 
26
7
  return useRoutes(routes);
27
8
  }
@@ -1,47 +0,0 @@
1
- import { SolidUiEvent, SolidViewLayoutManager } from "@solidxai/core-ui";
2
-
3
- const callLogsDispositionHandler = async (event: SolidUiEvent) => {
4
- const { modifiedField, modifiedFieldValue, formViewLayout } = event;
5
-
6
- const layout = formViewLayout;
7
- const layoutManager = new SolidViewLayoutManager(layout);
8
-
9
- if (modifiedField === 'category') {
10
- const dispositionWhereClause = {
11
- category: {
12
- id: { $eq: modifiedFieldValue?.id }
13
- }
14
- };
15
-
16
-
17
- layoutManager.updateNodeAttributes('disposition', {
18
- "whereClause": JSON.stringify(dispositionWhereClause)
19
- });
20
-
21
- return {
22
- layoutChanged: true,
23
- dataChanged: false,
24
- newLayout: layoutManager.getLayout(),
25
- }
26
- }
27
-
28
- if (modifiedField === 'disposition') {
29
- const subDispositionWhereClause = {
30
- disposition: {
31
- id: { $eq: modifiedFieldValue?.id }
32
- }
33
- };
34
-
35
- layoutManager.updateNodeAttributes('subDisposition', {
36
- "whereClause": JSON.stringify(subDispositionWhereClause)
37
- });
38
-
39
- return {
40
- layoutChanged: true,
41
- dataChanged: false,
42
- newLayout: layoutManager.getLayout(),
43
- }
44
- }
45
- }
46
-
47
- export default callLogsDispositionHandler;
@@ -1,377 +0,0 @@
1
- "use client"
2
- import { DataTable } from "primereact/datatable";
3
- import { Column } from "primereact/column";
4
- import React, { useEffect, useRef, useState } from 'react'
5
- import { SolidCustomImportHeader } from './SolidCustomImportHeader';
6
- import { useDispatch } from 'react-redux';
7
- import { ProgressSpinner } from 'primereact/progressspinner';
8
- import { Message } from 'primereact/message';
9
- import { Button } from 'primereact/button';
10
- import { closePopup } from "@solidxai/core-ui";
11
- import { useTriggerHierarchyImportMutation, useValidateHierarchyImportMutation } from "../../../../redux/hierarchyImportTransactionApi";
12
-
13
- interface VenueConflict {
14
- venueName: string;
15
- combinations: {
16
- leader: string;
17
- regionalHead: string;
18
- areaManager: string;
19
- venueManager: string;
20
- manager: string;
21
- }[];
22
- }
23
-
24
- export interface RowError {
25
- rowNumber: number;
26
- field: string;
27
- value: string;
28
- message: string;
29
- }
30
-
31
- interface ValidationResult {
32
-
33
- canProceed: boolean;
34
-
35
- headerValidation: any;
36
-
37
- newVenuesCount: number;
38
- venuesWithHierarchyConflictCount: number;
39
-
40
- newVenues: string[];
41
- venuesWithHierarchyConflict: VenueConflict[];
42
-
43
- rowErrors?: RowError[];
44
-
45
- }
46
-
47
- export const ImportHierarchyComponent = (e: any): React.JSX.Element => {
48
- console.log("form data", e);
49
-
50
- // const { formData } = props;
51
- const dispatch = useDispatch();
52
-
53
- const [validationResult, setValidationResult] = useState<ValidationResult | null>(null);
54
-
55
- const [validateImport, { isLoading: isValidating }] = useValidateHierarchyImportMutation();
56
- const [triggerImport, { isLoading: isTriggering }] = useTriggerHierarchyImportMutation();
57
-
58
- const hasValidatedRef = useRef(false);
59
-
60
- // Auto-trigger validation when component mounts
61
- useEffect(() => {
62
- console.log(`Timepass...`);
63
-
64
- if (e.params?.id && !hasValidatedRef.current) {
65
- hasValidatedRef.current = true;
66
- runValidation();
67
- }
68
- }, [e.params?.id]);
69
-
70
- const runValidation = async () => {
71
- try {
72
- const result = await validateImport({ id: e.params?.id }).unwrap();
73
- setValidationResult(result?.data);
74
- } catch (error: any) {
75
- console.error('Validation failed:', error);
76
- setValidationResult({
77
- canProceed: false,
78
- headerValidation: {},
79
- newVenuesCount: 0,
80
- venuesWithHierarchyConflictCount: 0,
81
- newVenues: [],
82
- venuesWithHierarchyConflict: [],
83
- });
84
- }
85
- };
86
-
87
- const handleContinueImport = async () => {
88
- if (!e.params?.id) return;
89
-
90
- try {
91
- await triggerImport({ id: e.params?.id }).unwrap();
92
- dispatch(closePopup());
93
- // You can add success toast notification here
94
- // toast.success('Import job has been queued successfully');
95
- } catch (error: any) {
96
- console.error('Import failed:', error);
97
- // You can add error toast notification here
98
- // toast.error('Failed to trigger import');
99
- }
100
- };
101
-
102
- const getUniqueCombinations = (combinations: any[]) => {
103
- const uniqueMap = new Map();
104
- combinations.forEach(combo => {
105
- const key = `${combo.leader}-${combo.regionalHead}-${combo.areaManager}-${combo.venueManager}`;
106
- if (!uniqueMap.has(key)) {
107
- uniqueMap.set(key, combo);
108
- }
109
- });
110
- return Array.from(uniqueMap.values());
111
- };
112
-
113
- console.log("validationResult", validationResult);
114
- return (
115
- <div>
116
- <SolidCustomImportHeader />
117
-
118
- <div className="p-4">
119
-
120
- {/* Loading State */}
121
- {isValidating && (
122
- <div className="flex flex-column align-items-center justify-content-center py-6">
123
- <ProgressSpinner style={{ width: '50px', height: '50px' }} />
124
- <p className="mt-3 text-600">Validating import data...</p>
125
- </div>
126
- )}
127
-
128
- {/* Validation Results */}
129
- {!isValidating && validationResult && (
130
- <div className="flex flex-column gap-3">
131
- {/* Errors Section (STOP) */}
132
- {/* Errors Section (STOP) - excluding conflict errors if no actual conflicts */}
133
- {!validationResult?.canProceed && !validationResult?.headerValidation?.ok && (
134
- <div className='overflow-x-auto py-3'>
135
- <div className="px-3 py-2 bg-red-50 border-round mb-1 flex align-items-center gap-1">
136
- <i className="pi pi-times-circle text-red-500 mr-2"></i>
137
- <span className="text-red-500">{validationResult?.headerValidation?.note}</span>
138
- </div>
139
-
140
- {validationResult?.headerValidation?.expectedHeaders?.length > 0 && (
141
- <div className='mt-3'>
142
- <div className="font-bold white-space-nowrap">Expected Headers:</div>
143
- <div className='flex mt-2'>
144
- {validationResult?.headerValidation?.expectedHeaders.map((header: string, idx: number) => (
145
- <div key={idx} className={`px-2 py-1 flex-shrink-0 border border-right-1 border-top-1 border-bottom-1 border-gray-300 ${idx === 0 ? 'border-left-1' : ''}`}>
146
- <span className="text-sm white-space-nowrap">{header}</span>
147
- </div>
148
- ))}
149
- </div>
150
- </div>
151
- )}
152
- {/*
153
- {validationResult?.headerValidation?.actualHeaders?.length > 0 && (
154
- <div className='mt-3'>
155
- <div className="font-bold white-space-nowrap">Actual Headers:</div>
156
- <div className='flex mt-2'>
157
- {validationResult?.headerValidation?.actualHeaders.map((header: string, idx: number) => (
158
- <div key={idx} className={`px-2 py-1 flex-shrink-0 border border-right-1 border-top-1 border-bottom-1 border-gray-300 ${idx === 0 ? 'border-left-1' : ''}`}>
159
- <span className="text-sm white-space-nowrap">{header}</span>
160
- </div>
161
- ))}
162
- </div>
163
- </div>
164
- )} */}
165
-
166
- {validationResult?.headerValidation?.missingHeaders?.length > 0 && (
167
- <div className='mt-3'>
168
- <div className="font-bold white-space-nowrap">Missing Headers:</div>
169
- <div className='flex mt-2'>
170
- {validationResult?.headerValidation?.missingHeaders.map((header: string, idx: number) => (
171
- <div key={idx} className={`px-2 py-1 flex-shrink-0 border border-right-1 border-top-1 border-bottom-1 border-gray-300 ${idx === 0 ? 'border-left-1' : ''}`}>
172
- <span className="text-sm white-space-nowrap">{header}</span>
173
- </div>
174
- ))}
175
- </div>
176
- </div>
177
- )}
178
-
179
- {validationResult?.headerValidation?.unexpectedHeaders?.length > 0 && (
180
- <div className='mt-3'>
181
- <div className="font-bold white-space-nowrap">Unexpected Headers:</div>
182
- <div className='flex mt-2'>
183
- {validationResult?.headerValidation?.unexpectedHeaders.map((header: string, idx: number) => (
184
- <div key={idx} className={`px-2 py-1 flex-shrink-0 border border-right-1 border-top-1 border-bottom-1 border-gray-300 ${idx === 0 ? 'border-left-1' : ''}`}>
185
- <span className="text-sm white-space-nowrap">{header}</span>
186
- </div>
187
- ))}
188
- </div>
189
- </div>
190
- )}
191
-
192
- {/* Only show non-conflict errors, or conflict errors with actual unique conflicts */}
193
- {/* {validationResult.errors.filter(error =>
194
- !error.includes('hierarchy combinations') ||
195
- (validationResult.conflicts && validationResult.conflicts.some(c => getUniqueCombinations(c.combinations).length > 1))
196
- ).length > 0 && (
197
- <>
198
- <Message severity="error" text="❌ Errors - Import cannot proceed" className="w-full mb-2" />
199
- {validationResult.errors.filter(error =>
200
- !error.includes('hierarchy combinations') ||
201
- (validationResult.conflicts && validationResult.conflicts.some(c => getUniqueCombinations(c.combinations).length > 1))
202
- ).map((error, idx) => (
203
- <div key={idx} className="p-2 bg-red-50 border-round mb-1">
204
- <i className="pi pi-times-circle text-red-500 mr-2"></i>
205
- <span className="text-sm">{error}</span>
206
- </div>
207
- ))}
208
- </>
209
- )} */}
210
- </div>
211
- )}
212
-
213
- {validationResult?.canProceed && (
214
- <div className='overflow-x-auto py-3'>
215
- <div className="px-3 py-2 bg-green-50 border-round mb-1 flex align-items-center gap-1">
216
- <i className="pi pi-check-circle text-green-500 mr-2"></i>
217
- <span className="text-green-500">{validationResult?.headerValidation?.note}</span>
218
- </div>
219
- </div>
220
- )}
221
-
222
- {/* Conflicts Section (STOP) - only show if there are actual unique conflicts */}
223
- {/* {validationResult.conflicts && validationResult.conflicts.length > 0 && (
224
- <div>
225
- {validationResult.conflicts.filter(conflict => getUniqueCombinations(conflict.combinations).length > 1).length > 0 && (
226
- <>
227
- <Message
228
- severity="error"
229
- text={`❌ STOP: ${validationResult.conflicts.filter(c => getUniqueCombinations(c.combinations).length > 1).length} venue(s) with multiple hierarchy combinations`}
230
- className="w-full mb-2"
231
- />
232
- <div className="max-h-20rem overflow-auto">
233
- {validationResult.conflicts
234
- .filter(conflict => getUniqueCombinations(conflict.combinations).length > 1)
235
- .map((conflict, idx) => {
236
- const uniqueCombos = getUniqueCombinations(conflict.combinations);
237
- return (
238
- <div key={idx} className="p-3 bg-red-50 border-round mb-2">
239
- <div className="font-semibold text-red-700 mb-2">
240
- 📍 Venue: {conflict.venueName}
241
- </div>
242
- <div className="text-sm">
243
- <strong>Multiple hierarchy combinations found:</strong>
244
- {uniqueCombos.map((combo, cIdx) => (
245
- <div key={cIdx} className="ml-3 mt-1 p-2 bg-white border-round">
246
- <div><strong>Combination #{cIdx + 1}</strong></div>
247
- <div>• Leader: {combo.leader || 'N/A'}</div>
248
- <div>• Regional Head: {combo.regionalHead || 'N/A'}</div>
249
- <div>• Area Manager: {combo.areaManager || 'N/A'}</div>
250
- <div>• Venue Manager: {combo.venueManager || 'N/A'}</div>
251
- </div>
252
- ))}
253
- </div>
254
- </div>
255
- );
256
- })}
257
- </div>
258
- </>
259
- )}
260
- </div>
261
- )} */}
262
-
263
- {/* Warnings Section (WARNING) */}
264
- {/* {validationResult.warnings && validationResult.warnings.length > 0 && (
265
- <div>
266
- <Message severity="warn" text="⚠️ Warnings" className="w-full mb-2" />
267
- {validationResult.warnings.map((warning, idx) => (
268
- <div key={idx} className="p-2 bg-yellow-50 border-round mb-1">
269
- <i className="pi pi-exclamation-triangle text-yellow-600 mr-2"></i>
270
- <span className="text-sm">{warning}</span>
271
- </div>
272
- ))}
273
- </div>
274
- )} */}
275
-
276
- {/* New Venues Section (WARNING) */}
277
- {validationResult.newVenuesCount > 0 && (
278
- <div>
279
- <Message
280
- severity="warn"
281
- text={`⚠️ WARNING: ${validationResult.newVenuesCount} new venue(s) will be created`}
282
- className="w-full mb-2"
283
- />
284
- <div className="max-h-15rem overflow-auto p-3 bg-yellow-50 border-round">
285
- <div className="font-semibold mb-2">New Venues:</div>
286
- {validationResult.newVenues.map((venue, idx) => (
287
- <div key={idx} className="text-sm py-1 pl-2">
288
- <i className="pi pi-plus-circle text-yellow-600 mr-2"></i>
289
- {venue}
290
- </div>
291
- ))}
292
- </div>
293
- </div>
294
- )}
295
- {/*
296
- <div className="px-3 py-2 bg-red-50 border-round mb-1 flex align-items-center gap-1">
297
- <i className="pi pi-times-circle text-red-500 mr-2"></i>
298
- <span className="text-red-500">{validationResult?.headerValidation?.note}</span>
299
- </div> */}
300
-
301
- {validationResult.rowErrors && (
302
- <div className="w-full">
303
- <Message
304
- severity="error"
305
- text={`⚠️ ERROR: ${validationResult.rowErrors.length} row errors`}
306
- className="w-full mb-2"
307
- />
308
-
309
- <div className="p-2 bg-red-50 border-round border-1 border-red-200">
310
- {/* <div className="font-semibold mb-2">Invalid Dates:</div> */}
311
-
312
- <DataTable
313
- value={validationResult.rowErrors}
314
- size="small"
315
- stripedRows
316
- showGridlines
317
- scrollable
318
- scrollHeight="240px" // vertical scroll
319
- className="p-datatable-sm"
320
- tableStyle={{ minWidth: "70rem" }} // forces horizontal scroll
321
- emptyMessage="No date errors"
322
- >
323
- <Column field="rowNumber" header="Row" style={{ width: "6rem", whiteSpace: "nowrap" }} />
324
- <Column field="field" header="Field" style={{ width: "8rem", whiteSpace: "nowrap" }} />
325
- <Column field="value" header="Value" style={{ minWidth: "22rem" }} />
326
- <Column field="message" header="Message" style={{ minWidth: "24rem" }} />
327
- </DataTable>
328
-
329
- </div>
330
- </div>
331
- )}
332
- {/* Success Message */}
333
- {/* {(validationResult.canProceed ||
334
- (validationResult.conflicts && validationResult.conflicts.every(c => getUniqueCombinations(c.combinations).length <= 1))) &&
335
- validationResult.errors.filter(error => !error.includes('hierarchy combinations')).length === 0 && (
336
- <Message
337
- severity="success"
338
- text="✅ Validation passed. You can proceed with the import."
339
- className="w-full"
340
- />
341
- )} */}
342
-
343
- {/* Action Buttons */}
344
- <div className="flex justify-content-end gap-2 pt-3 border-top-1 surface-border">
345
- <Button
346
- label="Cancel"
347
- icon="pi pi-times"
348
- onClick={() => dispatch(closePopup())}
349
- severity="secondary"
350
- outlined
351
- size='small'
352
- />
353
- <Button
354
- label="Continue Import"
355
- icon="pi pi-check"
356
- onClick={handleContinueImport}
357
- disabled={!validationResult.canProceed || isTriggering}
358
- loading={isTriggering}
359
- severity="success"
360
- size='small'
361
- />
362
- </div>
363
-
364
- {/* Helper Text */}
365
- {!validationResult.canProceed && (
366
- <div className="text-center text-sm text-600 mt-2">
367
- <i className="pi pi-info-circle mr-2"></i>
368
- Please resolve the errors above before continuing with the import.
369
- </div>
370
- )}
371
- </div>
372
- )}
373
- </div>
374
-
375
- </div>
376
- )
377
- }
@@ -1,14 +0,0 @@
1
- import { closePopup } from '@solidxai/core-ui';
2
- import { Button } from 'primereact/button'
3
- import React from 'react'
4
- import { useDispatch } from 'react-redux';
5
-
6
- export const SolidCustomImportHeader = () => {
7
- const dispatch = useDispatch();
8
- return (
9
- <div className='px-4 py-2 secondary-border-bottom flex align-items-center justify-content-between'>
10
- <h5 className='m-0'>Import Hierarchy</h5>
11
- <Button icon="pi pi-times" onClick={() => dispatch(closePopup())} size='small' severity='secondary' text style={{ height: 30, width: 30 }} />
12
- </div>
13
- )
14
- }
@@ -1,47 +0,0 @@
1
- import { SolidUiEvent, SolidViewLayoutManager } from "@solidxai/core-ui";
2
-
3
- const callLogsDispositionHandler = async (event: SolidUiEvent) => {
4
- const { modifiedField, modifiedFieldValue, formViewLayout } = event;
5
-
6
- const layout = formViewLayout;
7
- const layoutManager = new SolidViewLayoutManager(layout);
8
-
9
- if (modifiedField === 'category') {
10
- const dispositionWhereClause = {
11
- category: {
12
- id: { $eq: modifiedFieldValue?.id }
13
- }
14
- };
15
-
16
-
17
- layoutManager.updateNodeAttributes('disposition', {
18
- "whereClause": JSON.stringify(dispositionWhereClause)
19
- });
20
-
21
- return {
22
- layoutChanged: true,
23
- dataChanged: false,
24
- newLayout: layoutManager.getLayout(),
25
- }
26
- }
27
-
28
- if (modifiedField === 'disposition') {
29
- const subDispositionWhereClause = {
30
- disposition: {
31
- id: { $eq: modifiedFieldValue?.id }
32
- }
33
- };
34
-
35
- layoutManager.updateNodeAttributes('subDisposition', {
36
- "whereClause": JSON.stringify(subDispositionWhereClause)
37
- });
38
-
39
- return {
40
- layoutChanged: true,
41
- dataChanged: false,
42
- newLayout: layoutManager.getLayout(),
43
- }
44
- }
45
- }
46
-
47
- export default callLogsDispositionHandler;
@@ -1,45 +0,0 @@
1
- import { SolidLoadForm, SolidViewLayoutManager } from "@solidxai/core-ui";
2
-
3
- const onHierarchyImportFormLayoutLoadHandler = async (event: SolidLoadForm) => {
4
- const { viewMetadata } = event;
5
-
6
- const layout = viewMetadata.layout;
7
- const layoutManager = new SolidViewLayoutManager(layout);
8
-
9
- const currentUrl = window.location.href;
10
-
11
- const { pathname } = new URL(currentUrl);
12
- const isNewForm = pathname.endsWith('/new');
13
-
14
- const urlParams = new URLSearchParams(window.location.search);
15
- const viewMode = urlParams.get('viewMode');
16
- const isViewMode = viewMode === 'view';
17
- const isEditMode = viewMode === 'edit';
18
-
19
- // Hide errorDetails field when it's a new form
20
- if (isNewForm) {
21
- layoutManager.updateNodeAttributes('errorDetails', {
22
- visible: false
23
- });
24
-
25
- layoutManager.updateFormButtonByAction('ImportHierarchyComponent', {
26
- visible: false
27
- });
28
- }
29
-
30
- if (isEditMode) {
31
- layoutManager.updateNodeAttributes('errorDetails', {
32
- visible: true,
33
- disabled: true
34
- });
35
- }
36
-
37
- return {
38
- layoutChanged: isNewForm || isViewMode || isEditMode,
39
- dataChanged: false,
40
- newLayout: layoutManager.getLayout()
41
- }
42
-
43
- }
44
-
45
- export default onHierarchyImportFormLayoutLoadHandler;
@@ -1,57 +0,0 @@
1
- import { SolidUiEvent, SolidViewLayoutManager } from '@solidxai/core-ui';
2
-
3
- const handleVenueMasterFormViewLoad = (event: SolidUiEvent) => {
4
-
5
- const { viewMetadata } = event;
6
- console.log("handleVenueMasterFormViewLoad handler", viewMetadata);
7
-
8
- const layout = viewMetadata.layout;
9
- const layoutManager = new SolidViewLayoutManager(layout);
10
-
11
- const currentUrl = window.location.href;
12
- const isNewForm = currentUrl.endsWith('/new');
13
-
14
- const urlParams = new URLSearchParams(window.location.search);
15
- const viewMode = urlParams.get('viewMode');
16
- const isViewMode = viewMode === 'view';
17
- const isEditMode = viewMode === 'edit';
18
-
19
- // Hide leader, regionHead, areaHead, venueManager, manager fields when it's a new form
20
- if (isNewForm) {
21
- layoutManager.updateNodeAttributes('leader', { visible: false });
22
- layoutManager.updateNodeAttributes('regionHead', { visible: false });
23
- layoutManager.updateNodeAttributes('areaHead', { visible: false });
24
- layoutManager.updateNodeAttributes('venueManager', { visible: false });
25
- layoutManager.updateNodeAttributes('manager', { visible: false });
26
-
27
- if (isEditMode) {
28
- layoutManager.updateNodeAttributes('leader', {
29
- visible: true,
30
- disabled: true
31
- });
32
- layoutManager.updateNodeAttributes('regionHead', {
33
- visible: true,
34
- disabled: true
35
- });
36
- layoutManager.updateNodeAttributes('areaHead', {
37
- visible: true,
38
- disabled: true
39
- });
40
- layoutManager.updateNodeAttributes('venueManager', {
41
- visible: true,
42
- disabled: true
43
- });
44
- layoutManager.updateNodeAttributes('manager', {
45
- visible: true,
46
- disabled: true
47
- });
48
- }
49
-
50
- return {
51
- layoutChanged: isNewForm || isViewMode || isEditMode,
52
- dataChanged: false,
53
- newLayout: layoutManager.getLayout()
54
- }
55
- }
56
- }
57
- export default handleVenueMasterFormViewLoad;
@@ -1,21 +0,0 @@
1
- import { SolidUiEvent, SolidViewLayoutManager } from '@solidxai/core-ui';
2
-
3
- const handleVenueUserFormViewChange = (event: SolidUiEvent) => {
4
-
5
- const { modifiedField, modifiedFieldValue, formViewLayout } = event;
6
-
7
- const layout = formViewLayout;
8
- const layoutManager = new SolidViewLayoutManager(layout);
9
-
10
- if (modifiedField === 'code') {
11
- return {
12
- layoutChanged: false,
13
- dataChanged: true,
14
- newFormData: {
15
- username: modifiedFieldValue
16
- },
17
- newLayout: layoutManager.getLayout(),
18
- }
19
- }
20
- }
21
- export default handleVenueUserFormViewChange;
@@ -1,97 +0,0 @@
1
- import { SolidUiEvent, SolidViewLayoutManager } from '@solidxai/core-ui';
2
-
3
- const handleVenueUserFormViewLoad = (event: SolidUiEvent) => {
4
- const { viewMetadata } = event;
5
-
6
- const layout = viewMetadata.layout;
7
- const layoutManager = new SolidViewLayoutManager(layout);
8
-
9
- const currentUrl = window.location.href;
10
-
11
- const { pathname } = new URL(currentUrl);
12
- const isNewForm = pathname.endsWith('/new');
13
-
14
- const urlParams = new URLSearchParams(window.location.search);
15
- const viewMode = urlParams.get('viewMode');
16
- const isViewMode = viewMode === 'view';
17
- const isEditMode = viewMode === 'edit';
18
-
19
- // Hide leader, regionHead, areaHead, venueManager, manager fields when it's a new form
20
- if (isNewForm) {
21
- layoutManager.updateNodeAttributes('code', { visible: false });
22
- layoutManager.updateNodeAttributes('internalExternal', { visible: false });
23
- layoutManager.updateNodeAttributes('designation', { visible: false });
24
- layoutManager.updateNodeAttributes('exitStatus', { visible: false });
25
- layoutManager.updateNodeAttributes('doj', { visible: false });
26
- layoutManager.updateNodeAttributes('dol', { visible: false });
27
- layoutManager.updateNodeAttributes('lastImportedOn', { visible: false });
28
- layoutManager.updateNodeAttributes('leader', { visible: false });
29
- layoutManager.updateNodeAttributes('regionHead', { visible: false });
30
- layoutManager.updateNodeAttributes('zonalHead', { visible: false });
31
- layoutManager.updateNodeAttributes('areaHead', { visible: false });
32
- layoutManager.updateNodeAttributes('venueManager', { visible: false });
33
- layoutManager.updateNodeAttributes('manager', { visible: false });
34
-
35
- if (isEditMode) {
36
- layoutManager.updateNodeAttributes('code', {
37
- visible: true,
38
- disabled: true
39
- });
40
- layoutManager.updateNodeAttributes('internalExternal', {
41
- visible: true,
42
- disabled: true
43
- });
44
- layoutManager.updateNodeAttributes('designation', {
45
- visible: true,
46
- disabled: true
47
- });
48
- layoutManager.updateNodeAttributes('exitStatus', {
49
- visible: true,
50
- disabled: true
51
- });
52
- layoutManager.updateNodeAttributes('doj', {
53
- visible: true,
54
- disabled: true
55
- });
56
- layoutManager.updateNodeAttributes('dol', {
57
- visible: true,
58
- disabled: true
59
- });
60
- layoutManager.updateNodeAttributes('lastImportedOn', {
61
- visible: true,
62
- disabled: true
63
- });
64
- layoutManager.updateNodeAttributes('leader', {
65
- visible: true,
66
- disabled: true
67
- });
68
- layoutManager.updateNodeAttributes('regionHead', {
69
- visible: true,
70
- disabled: true
71
- });
72
- layoutManager.updateNodeAttributes('zonalHead', {
73
- visible: true,
74
- disabled: true
75
- });
76
- layoutManager.updateNodeAttributes('areaHead', {
77
- visible: true,
78
- disabled: true
79
- });
80
- layoutManager.updateNodeAttributes('venueManager', {
81
- visible: true,
82
- disabled: true
83
- });
84
- layoutManager.updateNodeAttributes('manager', {
85
- visible: true,
86
- disabled: true
87
- });
88
- }
89
-
90
- return {
91
- layoutChanged: isNewForm || isViewMode || isEditMode,
92
- dataChanged: false,
93
- newLayout: layoutManager.getLayout()
94
- }
95
- }
96
- }
97
- export default handleVenueUserFormViewLoad;
@@ -1,15 +0,0 @@
1
- import { Card } from "primereact/card";
2
-
3
- export function AdminInfoPage() {
4
- return (
5
- <div className="flex align-items-center justify-content-center" style={{ minHeight: "70vh" }}>
6
- <Card className="w-full" style={{ maxWidth: 520 }}>
7
- <div className="flex flex-column align-items-center text-center gap-2">
8
- <i className="pi pi-shield" style={{ fontSize: 28, color: "#22c55e" }} />
9
- <h2 className="m-0">Admin Message</h2>
10
- <p className="m-0 text-sm">This is a guarded admin route.</p>
11
- </div>
12
- </Card>
13
- </div>
14
- );
15
- }
@@ -1,15 +0,0 @@
1
- import { Card } from "primereact/card";
2
-
3
- export function HelloAuthPage() {
4
- return (
5
- <div className="flex align-items-center justify-content-center" style={{ minHeight: "70vh" }}>
6
- <Card className="w-full" style={{ maxWidth: 420 }}>
7
- <div className="flex flex-column align-items-center text-center gap-3">
8
- <i className="pi pi-sparkles" style={{ fontSize: 28, color: "#7c3aed" }} />
9
- <h2 className="m-0">Hello!</h2>
10
- <p className="m-0 text-sm">This is an unguarded auth route.</p>
11
- </div>
12
- </Card>
13
- </div>
14
- );
15
- }
@@ -1,17 +0,0 @@
1
- import { Card } from "primereact/card";
2
-
3
- export function AboutPage() {
4
- return (
5
- <div className="flex align-items-center justify-content-center" style={{ minHeight: "70vh" }}>
6
- <Card className="w-full" style={{ maxWidth: 520 }}>
7
- <div className="flex flex-column align-items-center text-center gap-2">
8
- <i className="pi pi-info-circle" style={{ fontSize: 28, color: "#2563eb" }} />
9
- <h2 className="m-0">About Us</h2>
10
- <p className="m-0 text-sm">
11
- This is a public, unguarded route outside the auth layout.
12
- </p>
13
- </div>
14
- </Card>
15
- </div>
16
- );
17
- }
@@ -1,28 +0,0 @@
1
- import { createApi } from "@reduxjs/toolkit/query/react";
2
- import { baseQueryWithAuth } from "@solidxai/core-ui";
3
-
4
- export const hierarchyImportTransactionApi = createApi({
5
- reducerPath: "hierarchyImportTransactionApi",
6
- baseQuery: baseQueryWithAuth,
7
- tagTypes: ["HierarchyImportTransaction"],
8
- endpoints: (builder) => ({
9
- validateHierarchyImport: builder.mutation({
10
- query: ({ id }) => ({
11
- url: `/hierarchy-import-transaction/${id}/validate-import`,
12
- method: "POST",
13
- }),
14
- }),
15
- triggerHierarchyImport: builder.mutation({
16
- query: ({ id }) => ({
17
- url: `/hierarchy-import-transaction/${id}/trigger-import`,
18
- method: "POST",
19
- }),
20
- invalidatesTags: ["HierarchyImportTransaction"],
21
- }),
22
- }),
23
- });
24
-
25
- export const {
26
- useValidateHierarchyImportMutation,
27
- useTriggerHierarchyImportMutation,
28
- } = hierarchyImportTransactionApi;