Skip to content

Commit

Permalink
Merge pull request #12 from charangirijala/callstack
Browse files Browse the repository at this point in the history
Resizable cols added for call tree 🌲
  • Loading branch information
charangirijala authored Jan 4, 2025
2 parents 80279dc + 44818b9 commit 977863d
Show file tree
Hide file tree
Showing 9 changed files with 549 additions and 307 deletions.
3 changes: 3 additions & 0 deletions src/modules/main/logFileProcessor/logFileProcessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,9 @@ export default class LogFileProcessor extends LightningElement {
//publish fileData to MessageChannel
this.publishFileMetadata();
// parseResultToTree(this.result);

//navigate to log viewer
publish('appChannel', { activeApp: 'Log Viewer' });
console.log('Total stdExps: ', this.stdExpCount);
console.log('Total exeAnonys: ', this.execAnonyCount);
console.log('Total CodeUnits Count: ', this.codeUnitsCount);
Expand Down
2 changes: 2 additions & 0 deletions src/modules/my/appHome/appHome.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@
<ui-paste-log></ui-paste-log>
</div>
</div>

<!-- <ui-table></ui-table> -->
</div>
</template>
2 changes: 1 addition & 1 deletion src/modules/my/appNavigation/appNavigation.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<a
class="slds-context-bar__label-action"
onclick={handleNavigationItemClick}
data-navitem={itemidx}
data-navitem={item.id}
title={item.label}
tabindex="0"
draggable="false"
Expand Down
45 changes: 36 additions & 9 deletions src/modules/my/appNavigation/appNavigation.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { LightningElement, track } from 'lwc';
import { publish } from 'services/pubsub';
import { publish, subscribe } from 'services/pubsub';
// import { publish, MessageContext } from 'lightning/messageService';
// import STATE from '@salesforce/messageChannel/App_Service__c';

Expand All @@ -18,35 +18,62 @@ export default class AppNavigation extends LightningElement {
// activeApp: this.activeApp
// };
// publish(this.messageContext, STATE, payload);
subscribe('appChannel', (data) => {
this.activeApp = data.activeApp;
this.navItems.map((item) => {
if (item.label === this.activeApp) {
item.classCombination = this.classCombinationActive;
} else {
item.classCombination = this.classCombinationInactive;
}
return item;
});
});
}
@track navItems = [
{
label: 'Home',
id: 'home',
classCombination:
'navItem slds-context-bar__item slds-shrink-none slds-is-active'
},
{
label: 'Log Viewer',
id: 'logViewer',
classCombination: 'navItem slds-context-bar__item slds-shrink-none'
}
];

handleNavigationItemClick(event) {
event.preventDefault();
// console.log(event.currentTarget.dataset.navitem);
const selectedIdx = event.currentTarget.dataset.navitem;
for (let i = 0; i < this.navItems.length; i++) {
if (i === parseInt(selectedIdx, 10)) {
const selectedNav = event.currentTarget.dataset.navitem;
// for (let i = 0; i < this.navItems.length; i++) {
// if (i === parseInt(selectedIdx, 10)) {
// const payload = {
// activeApp: this.navItems[i].label
// };
// publish('appChannel', payload);
// this.navItems[i].classCombination = this.classCombinationActive;
// } else {
// this.navItems[i].classCombination =
// this.classCombinationInactive;
// }
// }

this.navItems.map((item) => {
if (item.id === selectedNav) {
item.classCombination = this.classCombinationActive;
const payload = {
activeApp: this.navItems[i].label
activeApp: item.label
};
publish('appChannel', payload);
this.navItems[i].classCombination = this.classCombinationActive;
} else {
this.navItems[i].classCombination =
this.classCombinationInactive;
item.classCombination = this.classCombinationInactive;
}
}
return item;
});

// console.log(JSON.stringify(this.navItems));
}
}
4 changes: 4 additions & 0 deletions src/modules/ui/pasteLog/pasteLog.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ <h2 class="slds-card__header-title">
<textarea
placeholder="Paste log here..."
class="slds-textarea"
spellcheck="false"
autocapitalize="off"
autocomplete="off"
autocorrect="off"
onchange={handleLogChange}
></textarea>
</div>
Expand Down
5 changes: 5 additions & 0 deletions src/modules/ui/pasteLog/pasteLog.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ export default class PasteLog extends LightningElement {
const logData = this.logText.split(/\r\n|\n/);
console.log('paste data length: ', logData.length);
publish('logtext', logData);

this.logText = '';
this.template.querySelector('textarea').value = '';
} else if (this.logText === '') {
publish('logtext', []);
}
}
}
7 changes: 6 additions & 1 deletion src/modules/ui/utilityPanel/utilityPanel.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
left: 0.5rem;
right: 0.5rem;
bottom: 2.5rem;
height: 50%;
}

.tableScroll {
overflow: auto;
overflow-y: hidden;
}

.line-length {
Expand All @@ -27,7 +33,6 @@ td {
.slds-th__action {
padding-top: 0.1rem;
padding-bottom: 0.1rem;
height: 1.5rem;
}

th {
Expand Down
Loading

0 comments on commit 977863d

Please sign in to comment.