Skip to content

Commit 88c630b

Browse files
Added relatedLogEntries refresh button + spinner (#703)
* Added refresh button and spinner to relatedLogEntries LWC * Added sample Account flexipage w/ relatedLogEntries LWC to make it easy to test in a scratch org
1 parent 4d56ecb commit 88c630b

9 files changed

Lines changed: 339 additions & 24 deletions

File tree

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55

66
The most robust logger for Salesforce. Works with Apex, Lightning Components, Flow, Process Builder & Integrations. Designed for Salesforce admins, developers & architects.
77

8-
## Unlocked Package - v4.13.11
8+
## Unlocked Package - v4.13.12
99

10-
[![Install Unlocked Package in a Sandbox](./images/btn-install-unlocked-package-sandbox.png)](https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000027L98QAE)
11-
[![Install Unlocked Package in Production](./images/btn-install-unlocked-package-production.png)](https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000027L98QAE)
10+
[![Install Unlocked Package in a Sandbox](./images/btn-install-unlocked-package-sandbox.png)](https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015oCkQAI)
11+
[![Install Unlocked Package in Production](./images/btn-install-unlocked-package-production.png)](https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015oCkQAI)
1212
[![View Documentation](./images/btn-view-documentation.png)](https://jongpie.github.io/NebulaLogger/)
1313

14-
`sf package install --wait 20 --security-type AdminsOnly --package 04t5Y0000027L98QAE`
14+
`sf package install --wait 20 --security-type AdminsOnly --package 04t5Y0000015oCkQAI`
1515

16-
`sfdx force:package:install --wait 20 --securitytype AdminsOnly --package 04t5Y0000027L98QAE`
16+
`sfdx force:package:install --wait 20 --securitytype AdminsOnly --package 04t5Y0000015oCkQAI`
1717

1818
---
1919

nebula-logger/core/main/log-management/lwc/relatedLogEntries/relatedLogEntries.html

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,31 @@
66
<template>
77
<template if:true={showComponent}>
88
<lightning-card title={title} icon-name="custom:custom83" class="log-entry-card">
9-
<div slot="actions">
10-
<lightning-input data-id="enter-search" placeholder="Search" type="search" value={search} onchange={handleSearchChange}></lightning-input>
9+
<div class="slds-grid" slot="actions">
10+
<lightning-input
11+
class="slds-m-right_xx-small"
12+
data-id="enter-search"
13+
placeholder="Search"
14+
type="search"
15+
value={search}
16+
onchange={handleSearchChange}
17+
variant="label-hidden"
18+
></lightning-input>
19+
<lightning-button-icon icon-name="utility:refresh" onclick={refresh}></lightning-button-icon>
20+
</div>
21+
<div class="slds-is-relative">
22+
<lightning-datatable
23+
key-field="id"
24+
show-row-number-column="true"
25+
data={queryResult.records}
26+
columns={queryResult.fieldSet.fields}
27+
onsort={handleSort}
28+
sorted-by={sortBy}
29+
sorted-direction={sortDirection}
30+
default-sort-direction={sortDirection}
31+
></lightning-datatable>
32+
<lightning-spinner if:true={isLoading} size="small"></lightning-spinner>
1133
</div>
12-
<lightning-datatable
13-
key-field="id"
14-
show-row-number-column="true"
15-
data={queryResult.records}
16-
columns={queryResult.fieldSet.fields}
17-
onsort={handleSort}
18-
sorted-by={sortBy}
19-
sorted-direction={sortDirection}
20-
default-sort-direction={sortDirection}
21-
></lightning-datatable>
2234
</lightning-card>
2335
</template>
2436
</template>

nebula-logger/core/main/log-management/lwc/relatedLogEntries/relatedLogEntries.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
************************************************************************************************/
55

66
import { LightningElement, api, track, wire } from 'lwc';
7+
import { refreshApex } from '@salesforce/apex';
8+
79
import getQueryResult from '@salesforce/apex/RelatedLogEntriesController.getQueryResult';
810
export default class RelatedLogEntries extends LightningElement {
911
/* eslint-disable @lwc/lwc/no-api-reassignments */
@@ -13,10 +15,12 @@ export default class RelatedLogEntries extends LightningElement {
1315
@api sortDirection = '';
1416
@api rowLimit;
1517
@api search = '';
18+
@api queryResult;
1619

1720
@track showComponent = false;
1821
@track title;
19-
@api queryResult;
22+
@track wiredResult;
23+
@track isLoading = true;
2024

2125
@api
2226
handleSort(event) {
@@ -26,6 +30,7 @@ export default class RelatedLogEntries extends LightningElement {
2630

2731
@api
2832
handleSearchChange(event) {
33+
this.isLoading = true;
2934
this.search = event.target.value;
3035
}
3136

@@ -38,6 +43,7 @@ export default class RelatedLogEntries extends LightningElement {
3843
search: '$search'
3944
})
4045
wiredLogEntries(result) {
46+
this.wiredResult = result;
4147
if (result.data) {
4248
let queryResult = this.processResult(result.data);
4349
this.queryResult = queryResult;
@@ -49,6 +55,13 @@ export default class RelatedLogEntries extends LightningElement {
4955
/* eslint-disable-next-line no-console */
5056
console.log(result.error);
5157
}
58+
this.isLoading = false;
59+
}
60+
61+
async refresh() {
62+
this.isLoading = true;
63+
await refreshApex(this.wiredResult);
64+
this.isLoading = false;
5265
}
5366

5467
// Parse the Apex results & add any UI-specific attributes based on field metadata

nebula-logger/core/main/logger-engine/classes/Logger.cls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
global with sharing class Logger {
1616
// There's no reliable way to get the version number dynamically in Apex
1717
@TestVisible
18-
private static final String CURRENT_VERSION_NUMBER = 'v4.13.11';
18+
private static final String CURRENT_VERSION_NUMBER = 'v4.13.12';
1919
private static final System.LoggingLevel FALLBACK_LOGGING_LEVEL = System.LoggingLevel.DEBUG;
2020
private static final List<LogEntryEventBuilder> LOG_ENTRIES_BUFFER = new List<LogEntryEventBuilder>();
2121
private static final String MISSING_SCENARIO_ERROR_MESSAGE = 'No logger scenario specified. A scenario is required for logging in this org.';

nebula-logger/core/main/logger-engine/lwc/logger/logEntryBuilder.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//------------------------------------------------------------------------------------------------//
55
import FORM_FACTOR from '@salesforce/client/formFactor';
66

7-
const CURRENT_VERSION_NUMBER = 'v4.13.11';
7+
const CURRENT_VERSION_NUMBER = 'v4.13.12';
88

99
// JavaScript equivalent to the Apex class ComponentLogger.ComponentLogEntry
1010
const ComponentLogEntry = class {

0 commit comments

Comments
 (0)