From 9e73649633ae201059f33044244c1b03cf742366 Mon Sep 17 00:00:00 2001 From: Sreshta Gollapally Date: Sun, 10 Nov 2024 19:46:49 +0530 Subject: [PATCH 1/4] copying from the main branch --- .../main/default/classes/SoqlUtility.cls | 47 ++++++++++++++ .../default/classes/SoqlUtility.cls-meta.xml | 5 ++ .../main/default/classes/UtilityMethods.cls | 13 ++++ .../main/default/classes/utilityVariables.cls | 6 ++ .../lwc/UtilityComponents/lwc/tile/tile.html | 2 +- .../default/lwc/fileUploader/fileUploader.css | 64 ++++++++++++------- .../lwc/fileUploader/fileUploader.html | 20 +++--- .../lwc/logAnalysisView/logAnalysisView.html | 1 + .../lwc/logLineWrapper/logLineWrapper.css | 6 ++ .../lwc/logLineWrapper/logLineWrapper.js | 10 +++ .../default/lwc/logPreview/logPreview.html | 2 +- 11 files changed, 140 insertions(+), 36 deletions(-) create mode 100644 force-app/main/default/classes/SoqlUtility.cls create mode 100644 force-app/main/default/classes/SoqlUtility.cls-meta.xml diff --git a/force-app/main/default/classes/SoqlUtility.cls b/force-app/main/default/classes/SoqlUtility.cls new file mode 100644 index 0000000..50d3ae5 --- /dev/null +++ b/force-app/main/default/classes/SoqlUtility.cls @@ -0,0 +1,47 @@ +public class SoqlUtility { + + //11:43:50.1 (6696702)|SOQL_EXECUTE_BEGIN|[3]|Aggregations:0|SELECT Id FROM Opportunity + public static void processSoqlbegin(String line, String pattern) { + List splitArr = line.split('\\|'); + if (splitArr.size() == 5) { + LogLineSchema lls = new LogLineSchema(); + lls.type = 'SOQLB'; + lls.varName = splitArr[3]; + lls.varValue = splitArr[4]; + lls.lineNumber = splitArr[2]; + addToUnit(lls); + } + } + //11:43:50.1 (14725333)|SOQL_EXECUTE_END|[3]|Rows:7 + public static void processSoqlExit(String line, String pattern) { + List splitArr = line.split('\\|'); + if (splitArr.size() == 4) { + LogLineSchema lls = new LogLineSchema(); + lls.type = 'SOQLE'; + lls.varName = 'Retrieved'; + lls.varValue = splitArr[3]; + lls.lineNumber = splitArr[2]; + addToUnit(lls); + } + } + private static void addToUnit(LogLineSchema lls) { + /* + * 1. Check the correct codeunit/MethodUnit and add the logLine to the codeunit/MethodUnit + */ + if (!utilityVariables.methodUnitsStack.isEmpty()) { + MethodSchema currentMethodUnit = (MethodSchema) utilityVariables.methodUnitsStack.peek(); + //create a new ExecutingLineAndSubUnitSchema and push it to the current MethodUnit + ExecutedLineAndSubUnitSchema elss = new ExecutedLineAndSubUnitSchema(); + elss.logLine = lls; + //Add elsss to currentMenthodUnit + currentMethodUnit.executedLinesAndSubUnits.add(elss); + } else if (!utilityVariables.codeUnitsStack.isEmpty()) { + CodeUnitContainerSchema currentCodeUnit = (CodeUnitContainerSchema) utilityVariables.codeUnitsStack.peek(); + //create a new ExecutingLineAndSubUnitSchema and push it to the current codeUnit + ExecutedLineAndSubUnitSchema elss = new ExecutedLineAndSubUnitSchema(); + elss.logLine = lls; + //Add the elss to the currentCodeUnit + currentCodeUnit.executedLinesAndSubUnits.add(elss); + } + } +} diff --git a/force-app/main/default/classes/SoqlUtility.cls-meta.xml b/force-app/main/default/classes/SoqlUtility.cls-meta.xml new file mode 100644 index 0000000..998805a --- /dev/null +++ b/force-app/main/default/classes/SoqlUtility.cls-meta.xml @@ -0,0 +1,5 @@ + + + 62.0 + Active + diff --git a/force-app/main/default/classes/UtilityMethods.cls b/force-app/main/default/classes/UtilityMethods.cls index 7af77a6..09b11cb 100644 --- a/force-app/main/default/classes/UtilityMethods.cls +++ b/force-app/main/default/classes/UtilityMethods.cls @@ -224,6 +224,19 @@ public class UtilityMethods { */ UserInfoUtility.processUserInfo(line); break; + }else if (utilityVariables.currentLineEvent == 'SOQL_EXECUTE_BEGIN') { + /* + * 1. Use same methods as METHOD_ENTRY + * 2. Process all details and call METHOD_ENTRY methods + */ + SoqlUtility.processSoqlbegin(line,eventInfo.get(regex)); + break; + }else if (utilityVariables.currentLineEvent == 'SOQL_EXECUTE_END') { + /* + * 1. Use same methods as METHOD_EXIT + */ + SoqlUtility.processSoqlExit(line,eventInfo.get(regex)); + break; } } } diff --git a/force-app/main/default/classes/utilityVariables.cls b/force-app/main/default/classes/utilityVariables.cls index 9505a32..4c5a3d2 100644 --- a/force-app/main/default/classes/utilityVariables.cls +++ b/force-app/main/default/classes/utilityVariables.cls @@ -102,6 +102,12 @@ public class utilityVariables { }, 'USER_INFO' => new Map{ '^[0-9:.]+\\s\\([0-9]+\\)\\|(USER_INFO\\|)\\[([0-9]+|(EXTERNAL))\\](\\|\\w+\\|)[A-Za-z0-9\\._%+\\-]+@[A-Za-z0-9\\.\\-]+\\.[A-Za-z]{2,}(\\|.+\\|)(GMT[+0-9:-]+)' => 'User-Info-Generic' + }, + 'SOQL_EXECUTE_BEGIN'=>new Map{ + '^[0-9:.]+\\s\\([0-9]+\\)\\|(SOQL_EXECUTE_BEGIN\\|)\\[[0-9]+\\]+(\\|).*' => 'SOQL-Begin' + }, + 'SOQL_EXECUTE_END'=>new Map{ + '^[0-9:.]+\\s\\([0-9]+\\)\\|(SOQL_EXECUTE_END\\|)\\[[0-9]+\\]+(\\|).*' => 'SOQL-End' } }; diff --git a/force-app/main/default/lwc/UtilityComponents/lwc/tile/tile.html b/force-app/main/default/lwc/UtilityComponents/lwc/tile/tile.html index 5b33b06..9b916c9 100644 --- a/force-app/main/default/lwc/UtilityComponents/lwc/tile/tile.html +++ b/force-app/main/default/lwc/UtilityComponents/lwc/tile/tile.html @@ -1,6 +1,6 @@