@visns-studio/visns-components 5.15.16 → 5.15.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.
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"@fontsource/barlow": "^5.2.6",
|
|
8
8
|
"@inovua/reactdatagrid-community": "^5.10.2",
|
|
9
9
|
"@inovua/reactdatagrid-enterprise": "^5.10.2",
|
|
10
|
-
"@mapbox/mapbox-gl-geocoder": "^5.1.
|
|
10
|
+
"@mapbox/mapbox-gl-geocoder": "^5.1.1",
|
|
11
11
|
"@nivo/bar": "^0.99.0",
|
|
12
12
|
"@nivo/core": "^0.99.0",
|
|
13
13
|
"@nivo/line": "^0.99.0",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"array-move": "^4.0.0",
|
|
25
25
|
"awesome-debounce-promise": "^2.1.0",
|
|
26
26
|
"browser-image-compression": "^2.0.2",
|
|
27
|
-
"dayjs": "^1.11.
|
|
27
|
+
"dayjs": "^1.11.14",
|
|
28
28
|
"fabric": "^6.7.1",
|
|
29
29
|
"file-saver": "^2.0.5",
|
|
30
30
|
"framer-motion": "^12.23.12",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"html2canvas": "^1.4.1",
|
|
33
33
|
"lodash": "^4.17.21",
|
|
34
34
|
"lodash.debounce": "^4.0.8",
|
|
35
|
-
"lucide-react": "^0.
|
|
35
|
+
"lucide-react": "^0.542.0",
|
|
36
36
|
"mapbox-gl": "^3.14.0",
|
|
37
37
|
"moment": "^2.30.1",
|
|
38
38
|
"motion": "^12.23.12",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"reactjs-popup": "^2.0.6",
|
|
65
65
|
"style-loader": "^4.0.0",
|
|
66
66
|
"swapy": "^1.0.5",
|
|
67
|
-
"sweetalert2": "^11.22.
|
|
67
|
+
"sweetalert2": "^11.22.5",
|
|
68
68
|
"tesseract.js": "^6.0.1",
|
|
69
69
|
"truncate": "^3.0.0",
|
|
70
70
|
"uuid": "^11.1.0",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"mini-css-extract-plugin": "^2.9.4",
|
|
87
87
|
"react": "^18.3.1",
|
|
88
88
|
"react-dom": "^18.3.1",
|
|
89
|
-
"sass": "^1.
|
|
89
|
+
"sass": "^1.91.0",
|
|
90
90
|
"sass-loader": "^16.0.5"
|
|
91
91
|
},
|
|
92
92
|
"peerDependencies": {
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"react-dom": "^17.0.0 || ^18.0.0"
|
|
95
95
|
},
|
|
96
96
|
"name": "@visns-studio/visns-components",
|
|
97
|
-
"version": "5.15.
|
|
97
|
+
"version": "5.15.17",
|
|
98
98
|
"description": "Various packages to assist in the development of our Custom Applications.",
|
|
99
99
|
"main": "src/index.js",
|
|
100
100
|
"files": [
|
|
@@ -1513,10 +1513,49 @@ const GenericReportImproved = ({
|
|
|
1513
1513
|
|
|
1514
1514
|
// Start again function to reset wizard to home
|
|
1515
1515
|
const startAgain = () => {
|
|
1516
|
-
|
|
1516
|
+
console.log('🔄 [DEBUG] StartAgain called - BEFORE reset:', {
|
|
1517
|
+
selectedTemplate: selectedTemplate?.id,
|
|
1518
|
+
customUrls: customUrls,
|
|
1519
|
+
groupingConfig: groupingConfig,
|
|
1520
|
+
});
|
|
1521
|
+
|
|
1522
|
+
// Reset wizard state
|
|
1523
|
+
setCurrentWizardStep(0);
|
|
1524
|
+
setShowTemplates(true);
|
|
1525
|
+
setShowBusinessTemplates(false);
|
|
1526
|
+
|
|
1527
|
+
// CRITICAL FIX: Reset template selection
|
|
1528
|
+
setSelectedTemplate(null);
|
|
1529
|
+
|
|
1530
|
+
// Reset database schema state
|
|
1517
1531
|
setSelectedTable(null);
|
|
1532
|
+
setTableColumns([]);
|
|
1533
|
+
setAvailableTables([]);
|
|
1534
|
+
setDetectedJoins({});
|
|
1535
|
+
setIsLoadingDetectedJoins({});
|
|
1536
|
+
|
|
1537
|
+
// Reset report configuration
|
|
1518
1538
|
setSelectedColumns([]);
|
|
1519
1539
|
setJoins([]);
|
|
1540
|
+
setReportName('');
|
|
1541
|
+
setIsPublic(false);
|
|
1542
|
+
setLoadedReportId(null);
|
|
1543
|
+
|
|
1544
|
+
// Reset manual relationship state
|
|
1545
|
+
setShowManualJoinForm(false);
|
|
1546
|
+
setManualJoin({
|
|
1547
|
+
sourceTable: '',
|
|
1548
|
+
targetTable: '',
|
|
1549
|
+
sourceColumn: '',
|
|
1550
|
+
targetColumn: '',
|
|
1551
|
+
joinType: 'INNER JOIN',
|
|
1552
|
+
});
|
|
1553
|
+
setManualJoinColumns({
|
|
1554
|
+
source: [],
|
|
1555
|
+
target: [],
|
|
1556
|
+
});
|
|
1557
|
+
|
|
1558
|
+
// Reset sorting and filtering
|
|
1520
1559
|
setFilterCriteria({
|
|
1521
1560
|
operator: 'AND',
|
|
1522
1561
|
groups: [
|
|
@@ -1529,16 +1568,68 @@ const GenericReportImproved = ({
|
|
|
1529
1568
|
setSortCriteria([]);
|
|
1530
1569
|
setShowSortingSection(false);
|
|
1531
1570
|
setShowFilteringSection(false);
|
|
1571
|
+
setShowSelectedFields(false);
|
|
1572
|
+
|
|
1573
|
+
// CRITICAL FIX: Reset grouping configuration
|
|
1574
|
+
setGroupingConfig({
|
|
1575
|
+
enabled: false,
|
|
1576
|
+
groupByField: '',
|
|
1577
|
+
groupDisplayName: '',
|
|
1578
|
+
sortBy: '',
|
|
1579
|
+
sortDirection: 'asc',
|
|
1580
|
+
rowsPerGroup: 10,
|
|
1581
|
+
showEmptyRows: false,
|
|
1582
|
+
showGroupTotals: false,
|
|
1583
|
+
expandable: true,
|
|
1584
|
+
groupHeaderStyle: 'primary',
|
|
1585
|
+
emptyRowStyle: 'light',
|
|
1586
|
+
});
|
|
1587
|
+
|
|
1588
|
+
// CRITICAL FIX: Reset custom URLs
|
|
1589
|
+
setCustomUrls({
|
|
1590
|
+
executeUrl: '',
|
|
1591
|
+
exportUrl: '',
|
|
1592
|
+
});
|
|
1593
|
+
|
|
1594
|
+
// Reset report execution and preview
|
|
1532
1595
|
setPreviewData([]);
|
|
1596
|
+
setGroupedData(null);
|
|
1533
1597
|
setGridColumns([]);
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1598
|
+
setTotalResults(0);
|
|
1599
|
+
setHasAutoExecuted(false);
|
|
1600
|
+
|
|
1601
|
+
// Reset pagination
|
|
1602
|
+
setCurrentPage(1);
|
|
1603
|
+
setPageSize(10);
|
|
1604
|
+
setTotalPages(0);
|
|
1605
|
+
setTotalCount(0);
|
|
1606
|
+
|
|
1607
|
+
// Reset calculated fields
|
|
1608
|
+
setCustomCalculatedFields([]);
|
|
1609
|
+
setCalculatedFieldForm({
|
|
1610
|
+
displayName: '',
|
|
1611
|
+
formula: '',
|
|
1612
|
+
type: 'decimal',
|
|
1613
|
+
});
|
|
1614
|
+
setShowCalculatedFieldModal(false);
|
|
1615
|
+
|
|
1616
|
+
// Reset unique fields and exclusions
|
|
1617
|
+
setUniqueFieldConfig({
|
|
1618
|
+
enabled: false,
|
|
1619
|
+
selectedField: '',
|
|
1620
|
+
});
|
|
1621
|
+
setExcludedRows(new Set());
|
|
1622
|
+
setShowRowExclusionModal(false);
|
|
1623
|
+
setExportType('regular');
|
|
1624
|
+
|
|
1625
|
+
// Reset UI state
|
|
1626
|
+
setShowHiddenFields(false);
|
|
1627
|
+
|
|
1628
|
+
console.log('✅ [DEBUG] StartAgain completed - AFTER reset:', {
|
|
1629
|
+
selectedTemplate: null,
|
|
1630
|
+
customUrls: { executeUrl: '', exportUrl: '' },
|
|
1631
|
+
groupingConfig: { enabled: false },
|
|
1632
|
+
});
|
|
1542
1633
|
|
|
1543
1634
|
toast.info(
|
|
1544
1635
|
'Report builder reset. You can start creating a new report.'
|
|
@@ -2336,6 +2427,13 @@ const GenericReportImproved = ({
|
|
|
2336
2427
|
}
|
|
2337
2428
|
} else {
|
|
2338
2429
|
// For predefined templates, use the existing approach
|
|
2430
|
+
console.log('🚨 [DEBUG] Using predefined template approach:', {
|
|
2431
|
+
selectedTemplate: selectedTemplate,
|
|
2432
|
+
selectedTemplateId: selectedTemplate?.id,
|
|
2433
|
+
fallbackId: 'utilization_planning',
|
|
2434
|
+
finalTemplateId: selectedTemplate?.id || 'utilization_planning',
|
|
2435
|
+
});
|
|
2436
|
+
|
|
2339
2437
|
payload = {
|
|
2340
2438
|
template_id:
|
|
2341
2439
|
selectedTemplate?.id || 'utilization_planning',
|
|
@@ -2756,7 +2854,7 @@ const GenericReportImproved = ({
|
|
|
2756
2854
|
lowerKey.includes('disabled')
|
|
2757
2855
|
) {
|
|
2758
2856
|
// Check if values look like boolean/status values
|
|
2759
|
-
const sampleValues =
|
|
2857
|
+
const sampleValues = dataToProcess
|
|
2760
2858
|
.slice(0, 5)
|
|
2761
2859
|
.map((row) => row[key]);
|
|
2762
2860
|
const hasStatusValues = sampleValues.some(
|
|
@@ -2814,7 +2912,15 @@ const GenericReportImproved = ({
|
|
|
2814
2912
|
setGridColumns(dynamicColumns);
|
|
2815
2913
|
} else {
|
|
2816
2914
|
// Fallback to selected columns if no data
|
|
2817
|
-
|
|
2915
|
+
console.log('🔧 [DEBUG] Creating fallback columns from selectedColumns:', selectedColumns);
|
|
2916
|
+
if (!Array.isArray(selectedColumns) || selectedColumns.length === 0) {
|
|
2917
|
+
console.warn('⚠️ selectedColumns is not a valid array:', selectedColumns);
|
|
2918
|
+
setGridColumns([]);
|
|
2919
|
+
return;
|
|
2920
|
+
}
|
|
2921
|
+
|
|
2922
|
+
const columns = selectedColumns.map((col, index) => {
|
|
2923
|
+
try {
|
|
2818
2924
|
// Find column type from table columns with enhanced detection
|
|
2819
2925
|
let columnType = 'varchar';
|
|
2820
2926
|
const tableColumn = tableColumns.find(
|
|
@@ -2852,37 +2958,52 @@ const GenericReportImproved = ({
|
|
|
2852
2958
|
|
|
2853
2959
|
return {
|
|
2854
2960
|
name:
|
|
2855
|
-
col.displayName || `${col.table}.${col.column}`,
|
|
2856
|
-
header: col.displayName || formatName(col.column),
|
|
2961
|
+
col.displayName || `${col.table || 'unknown'}.${col.column}`,
|
|
2962
|
+
header: col.displayName || formatName(col.column || 'Unknown Column'),
|
|
2857
2963
|
defaultFlex: 1,
|
|
2858
2964
|
minWidth: 100,
|
|
2859
2965
|
render: ({ value }) => {
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
// For JSON content, wrap in a container that allows full height expansion
|
|
2867
|
-
if (isJsonValue(value)) {
|
|
2868
|
-
return (
|
|
2869
|
-
<div
|
|
2870
|
-
style={{
|
|
2871
|
-
whiteSpace: 'normal',
|
|
2872
|
-
wordWrap: 'break-word',
|
|
2873
|
-
lineHeight: '1.4',
|
|
2874
|
-
padding: '4px 0',
|
|
2875
|
-
width: '100%',
|
|
2876
|
-
}}
|
|
2877
|
-
>
|
|
2878
|
-
{formattedValue}
|
|
2879
|
-
</div>
|
|
2966
|
+
try {
|
|
2967
|
+
const formattedValue = formatSmartValue(
|
|
2968
|
+
value,
|
|
2969
|
+
col.column,
|
|
2970
|
+
columnType
|
|
2880
2971
|
);
|
|
2881
|
-
}
|
|
2882
2972
|
|
|
2883
|
-
|
|
2973
|
+
// For JSON content, wrap in a container that allows full height expansion
|
|
2974
|
+
if (isJsonValue(value)) {
|
|
2975
|
+
return (
|
|
2976
|
+
<div
|
|
2977
|
+
style={{
|
|
2978
|
+
whiteSpace: 'normal',
|
|
2979
|
+
wordWrap: 'break-word',
|
|
2980
|
+
lineHeight: '1.4',
|
|
2981
|
+
padding: '4px 0',
|
|
2982
|
+
width: '100%',
|
|
2983
|
+
}}
|
|
2984
|
+
>
|
|
2985
|
+
{formattedValue}
|
|
2986
|
+
</div>
|
|
2987
|
+
);
|
|
2988
|
+
}
|
|
2989
|
+
|
|
2990
|
+
return formattedValue;
|
|
2991
|
+
} catch (renderError) {
|
|
2992
|
+
console.warn('🚨 Cell render error:', renderError, 'for value:', value);
|
|
2993
|
+
return String(value || '');
|
|
2994
|
+
}
|
|
2884
2995
|
},
|
|
2885
2996
|
};
|
|
2997
|
+
} catch (colError) {
|
|
2998
|
+
console.warn('🚨 Column mapping error:', colError, 'for column:', col);
|
|
2999
|
+
return {
|
|
3000
|
+
name: `error_col_${index}`,
|
|
3001
|
+
header: 'Error Column',
|
|
3002
|
+
defaultFlex: 1,
|
|
3003
|
+
minWidth: 100,
|
|
3004
|
+
render: () => 'Error',
|
|
3005
|
+
};
|
|
3006
|
+
}
|
|
2886
3007
|
});
|
|
2887
3008
|
setGridColumns(columns);
|
|
2888
3009
|
}
|
|
@@ -2899,8 +3020,24 @@ const GenericReportImproved = ({
|
|
|
2899
3020
|
typeof fetchedDataCount
|
|
2900
3021
|
);
|
|
2901
3022
|
} catch (error) {
|
|
2902
|
-
|
|
3023
|
+
console.group('🚨 [ERROR] executeReport failed');
|
|
2903
3024
|
console.error('Error executing report:', error);
|
|
3025
|
+
console.log('Error name:', error.name);
|
|
3026
|
+
console.log('Error message:', error.message);
|
|
3027
|
+
console.log('Error stack:', error.stack);
|
|
3028
|
+
console.log('Current state at error:', {
|
|
3029
|
+
selectedTable,
|
|
3030
|
+
selectedColumns: selectedColumns.length,
|
|
3031
|
+
hasGrouping: selectedTemplate?.grouping?.enabled || groupingConfig.enabled,
|
|
3032
|
+
currentPage,
|
|
3033
|
+
pageSize,
|
|
3034
|
+
});
|
|
3035
|
+
console.groupEnd();
|
|
3036
|
+
|
|
3037
|
+
// Only show toast error for actual failures, not for successful pagination
|
|
3038
|
+
if (!error.message?.includes('successful')) {
|
|
3039
|
+
toast.error(`Failed to execute report: ${error.message || 'Unknown error'}`);
|
|
3040
|
+
}
|
|
2904
3041
|
} finally {
|
|
2905
3042
|
setIsLoading(false);
|
|
2906
3043
|
}
|