Skip to content

Soql and Design changes #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Nov 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions force-app/main/default/classes/Soql/SoqlUtility.cls
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
public class SoqlUtility {

//11:43:50.1 (6696702)|SOQL_EXECUTE_BEGIN|[3]|Aggregations:0|SELECT Id FROM Opportunity
public static void processSoqlbegin(String line) {
List<String> 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) {
List<String> 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);
//update currentLog
utilityVariables.currentLog = lls;
} 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);
//update currentLog
utilityVariables.currentLog = lls;
}
}
}
5 changes: 5 additions & 0 deletions force-app/main/default/classes/Soql/SoqlUtility.cls-meta.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>62.0</apiVersion>
<status>Active</status>
</ApexClass>
13 changes: 13 additions & 0 deletions force-app/main/default/classes/UtilityMethods.cls
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,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);
break;
}else if (utilityVariables.currentLineEvent == 'SOQL_EXECUTE_END') {
/*
* 1. Use same methods as METHOD_EXIT
*/
SoqlUtility.processSoqlExit(line);
break;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,17 @@ public class VariableAssignUtility {
elss.logLine = lls;
//Add elsss to currentMenthodUnit
currentMethodUnit.executedLinesAndSubUnits.add(elss);
//update currentLog
utilityVariables.currentLog = lls;
} 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);
//update currentLog
utilityVariables.currentLog = lls;
}
}
}
6 changes: 6 additions & 0 deletions force-app/main/default/classes/utilityVariables.cls
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@ public class utilityVariables {
},
'USER_INFO' => new Map<String, String>{
'^[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<String,String>{
'^[0-9:.]+\\s\\([0-9]+\\)\\|(SOQL_EXECUTE_BEGIN\\|)\\[[0-9]+\\]+(\\|).*' => 'SOQL-Begin'
},
'SOQL_EXECUTE_END'=>new Map<String,String>{
'^[0-9:.]+\\s\\([0-9]+\\)\\|(SOQL_EXECUTE_END\\|)\\[[0-9]+\\]+(\\|).*' => 'SOQL-End'
}
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- sldsValidatorIgnore -->
<template>
<lightning-card>
<lightning-card style="--slds-c-card-header-spacing-block-end:0px;--slds-c-card-header-spacing-block-start:0px;">
<div class={sectionClass}>
<h3 class="slds-section__title">
<button
Expand Down
64 changes: 42 additions & 22 deletions force-app/main/default/lwc/fileUploader/fileUploader.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,35 +27,55 @@
}


ul {
font-family: monospace;
list-style-type: none;
margin: 0;
padding: 0;
.navbar {
position: sticky;
z-index: 1;
top: 0;
overflow: hidden;
background-color: rgb(15, 33, 60);
}

li {
.navbar b {
float: left;
display: block;
color: #f2f2f2;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-size: 17px;
transition: 0.3s;
}

li {
.navbar b:hover {
background-color: white;
color: black;
}

.brand {
background-color: rgb(15, 33, 60);
color: white;
font-size: bold;
float: left;
display: block;
text-align: center;
padding: 5px 16px;
text-decoration: none;
cursor: pointer;
border: 0px;
}

li .nav-btn {
--sds-c-button-brand-color-background: white;
--sds-c-button-brand-color-border: white;
--sds-c-button-brand-color-background-hover: white;
--sds-c-button-brand-color-border-hover: white;
--slds-c-button-brand-radius-border: 0.1rem;
--slds-c-button-brand-text-color-hover:black;
--slds-c-button-brand-text-color-active:black;
--slds-c-button-brand-text-color:black;
padding: 14px 16px;
font-size: 18px;
font-weight: bold;
}


.bugicon{
--slds-c-icon-color-background: rgb(15, 33, 60);
-slds-c-icon-color-foreground:white;
--slds-c-icon-color-foreground-default:white;
margin-right: 10px;
margin-top: 0px;
margin-bottom: 0px;
}
.fl-btn, .slds-button_neutral{
--slds-c-button-brand-text-color : white;
--slds-c-button-brand-color-background :rgb(15, 33, 60);
--slds-c-button-brand-color-background-hover:white;
--slds-c-button-brand-text-color-hover:rgb(15, 33, 60);
--slds-c-button-brand-text-color-active:white;
}
20 changes: 8 additions & 12 deletions force-app/main/default/lwc/fileUploader/fileUploader.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
<template>
<div><ul>
<li><lightning-button
class="nav-btn"
variant="brand"
label="Upload File"
title="Click to analyze the log"
onclick={resetApp}
type="submit"
></lightning-button></li>
</ul></div>
<div class="navbar">
<p class="brand"><lightning-icon icon-name='utility:bug' alternative-text='bug' size='small' title='bug' class="bugicon"></lightning-icon>DEBUG FORCE</p>
<b>Home</b>
<b>Latest Updates</b>
<b style="float:right" onclick={resetApp}>Reset App</b>
</div>
<lightning-card variant="base" title="Upload File" if:false={responseState}>
<template lwc:if={renderUploader}>
<div class="slds-grid slds-wrap">
Expand Down Expand Up @@ -41,8 +37,8 @@
</div>
<div class="slds-clearfix" lwc:if={displayButton}>
<lightning-button
variant="brand-outline"
class="slds-align_absolute-center"
variant="brand"
class="slds-align_absolute-center fl-btn"
label="Analyze Log"
title="Click to analyze the log"
onclick={handleSubmit}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
class={col.classComb}
scope="col"
key={col.label}
style="padding-left:20px;"
>
<div
class="slds-grid slds-grid_vertical-align-center slds-has-flexi-truncate"
Expand Down
6 changes: 6 additions & 0 deletions force-app/main/default/lwc/logLineWrapper/logLineWrapper.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
.varin {
color: rgb(240, 141, 73);
}
.soqb {
color: rgb(182, 240, 73);
}
.soqe {
color: rgb(73, 208, 63);
}

.debug {
color: rgb(248, 197, 85);
Expand Down
10 changes: 10 additions & 0 deletions force-app/main/default/lwc/logLineWrapper/logLineWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,16 @@ export default class LogLineWrapper extends LightningElement {
else if (logTemp.logLineData.type === "VALPS") {
logTemp.eventClassComb = "slds-line-clamp valps";
}
//<!-- SOQLB -->
else if (logTemp.logLineData.type === "SOQLB") {
logTemp.eventClassComb = "slds-line-clamp soqb";
//console.log("Query: ", JSON.stringify(logTemp.logLineData));
}
//<!-- SOQLE -->
else if (logTemp.logLineData.type === "SOQLE") {
logTemp.eventClassComb = "slds-line-clamp soqe";
//console.log("No.of Rows: ", JSON.stringify(logTemp.logLineData));
}
log = logTemp;
} else if (log.type === "unit") {
log.isLine = false;
Expand Down
2 changes: 1 addition & 1 deletion force-app/main/default/lwc/logPreview/logPreview.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- sldsValidatorIgnore -->
<template>
<div class="slds-var-m-bottom_x-small">
<div class="slds-grid slds-wrap">
<div class="slds-grid slds-wrap" style="padding: 3px 10px;">
<div class="slds-col">
<c-badge value={tableSize} type="slds-badge_inverse"></c-badge>
</div>
Expand Down
Loading