Skip to content

Commit

Permalink
Added home page & dashboard to console app (#498)
Browse files Browse the repository at this point in the history
* Moved Admin Dashboard plugin's metadata into core, deprecated Logger Admin Dashboard plugin

* Added new flexipage LoggerHomePage that displays admin dashboard, loggerSettings lwc, logEntryEventStream lwc, and logBatchPurge lwc

* Added new loggerHomeHeader lwc to LoggerHomePage.flexipage

* Updated existing LWCs logBatchPurge, logEntryEventStream, and loggerSettings to have isExposed=true and target lightning__HomePage to support displaying these components on the new home page

* Added LightningConfirm in logBatchPurge to verify job execution, and cleaned up some code bits

* Renamed some LWC functions and Apex methods in LWC logBatchPurge to have a more consistent naming convention--no-verify

* Cleaned up some CSS formatting in logEntryEventStream

* Bugfix: Added LIMIT 50 to the method LogManagementDataSelector.getUsersByNameSearch(), downgraded sfdx CLI to try to resolve a packaging error for the managed package

* Bugfix: Fixed LogEntryEventBuilder.setExceptionDetails() so it handles null exceptions

* Added public method Logger.callStatusApi() to provide a reusable method for getting info from Salesforce's status API

* Updated some dependencies in package.json
  • Loading branch information
jongpie authored May 31, 2023
1 parent 0ba55c3 commit da3bbaa
Show file tree
Hide file tree
Showing 55 changed files with 8,241 additions and 7,159 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

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

## Unlocked Package - v4.10.3
## Unlocked Package - v4.10.4

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

`sfdx package install --wait 20 --security-type AdminsOnly --package 04t5Y0000023SAfQAM`
`sfdx package install --wait 20 --security-type AdminsOnly --package 04t5Y0000023SC7QAM`

## Managed Package - v4.10.0

Expand Down
28 changes: 28 additions & 0 deletions config/jest/mocks/lightning/navigation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
export const CurrentPageReference = jest.fn();

const Navigate = Symbol('Navigate');
const GenerateUrl = Symbol('GenerateUrl');

export const NavigationMixin = Base => {
return class extends Base {
[Navigate](pageReference, replace) {
const detailObj = {
detail: {
pageReference,
replace
}
};
this.dispatchEvent(new CustomEvent('navigate', detailObj));
}
[GenerateUrl](pageReference) {
const detailObj = {
detail: {
pageReference
}
};
this.dispatchEvent(new CustomEvent('generate', detailObj));
}
};
};
NavigationMixin.Navigate = Navigate;
NavigationMixin.GenerateUrl = GenerateUrl;
2 changes: 1 addition & 1 deletion config/linters/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
}
},
"ignorePatterns": ["**/*.html", "**/*.cmp", "**/*.cmp-meta.xml", "**/*.css", "**/*.test.js", "**/*js-meta.xml", "**/*.json"],
"plugins": ["@lwc/eslint-plugin-lwc", "@salesforce/eslint-plugin-aura"],
"plugins": ["@lwc/eslint-plugin-lwc"],
"extends": ["@salesforce/eslint-config-lwc/recommended"],
"rules": {
"@lwc/lwc/consistent-component-name": "error",
Expand Down
4 changes: 2 additions & 2 deletions docs/apex/Log-Management/LogBatchPurgeController.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ List<PicklistOption>

The instance of `List<PicklistOption>`, containing all picklist options for purge Action.

#### `getPurgeBatchJobRecords()``List<AsyncApexJob>`
#### `getBatchPurgeJobRecords()``List<AsyncApexJob>`

Returns `List&lt;AsyncApexJob&gt;` to display logBatchPurger jobs details in a Datatable.

Expand All @@ -72,7 +72,7 @@ List&lt;AsyncApexJob&gt;

The instance of `List&lt;AsyncApexJob&gt;`, containing list of logBatchPurge jobs.

#### `runPurgeBatch()``String`
#### `runBatchPurge()``String`

execute the logBatchPurger batch with batch size 2000

Expand Down
12 changes: 0 additions & 12 deletions docs/apex/Log-Management/LogEntryEventHandler.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,6 @@ Processes `LogEntryEvent__e` platform events and normalizes the data into `Log__

## Default constructor, used by the trigger `LogEntryEvent.trigger`

### Properties

#### `releaseNumber``String`

String containing the release number.

#### `releaseVersion``String`

String containing the release version.

---

### Methods

#### `StatusApiCalloutQueueable(List<Log__c> logsToUpdate)``public`
Expand Down
71 changes: 71 additions & 0 deletions docs/apex/Log-Management/LoggerHomeHeaderController.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
layout: default
---

## LoggerHomeHeaderController class

Controller class for the LWC `loggerHomeHeader`

---

### Methods

#### `getEnvironmentDetails()``Environment`

Returns the current version number of Nebula Logger

##### Return

**Type**

Environment

**Description**

An instance of `LoggerHomeHeaderController.Environment`

---

### Inner Classes

#### LoggerHomeHeaderController.Environment class

---

##### Properties

###### `loggerNamespacePrefix``String`

###### `loggerVersionNumber``String`

###### `organizationApiVersion``String`

###### `organizationCreatedByUsername``String`

###### `organizationDomainUrl``String`

###### `organizationEnvironment``String`

###### `organizationFormattedCreatedDate``String`

###### `organizationId``String`

###### `organizationInstanceLocation``String`

###### `organizationInstanceName``String`

###### `organizationInstanceProducts``String`

###### `organizationMaintenanceWindow``String`

###### `organizationName``String`

###### `organizationReleaseNumber``String`

###### `organizationReleaseVersion``String`

###### `organizationStatus``String`

###### `organizationType``String`

---
124 changes: 95 additions & 29 deletions docs/apex/Logger-Engine/Logger.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,25 @@ Enum used to control how LogEntryEvent\_\_e records are inserted

---

### Properties

#### `allOrNone``Boolean`
### Methods

Boolean used when saving records. If true, all records must save correctly or an exception is thrown. If false, partial processing is enabled, and if an indidividual record fails, successful records are still saved without exception.
#### `callStatusApi()``StatusApiResponse`

#### `records``List<SObject>`
**This is only intended to be used internally by Nebula Logger, and is subject to change.** Calls Salesforce&apos;s API endpoint https://api.status.salesforce.com/v1/instances/ to get more details about the current org, including the org&apos;s release number and release version

List of records to save.
##### Return

---
**Type**

### Methods
StatusApiResponse

#### `Uuid()``public`
**Description**

Default constructor
Instance of `Logger.StatusApiResponse`, a data transfer object (DTO) that maps to the JSON returned

#### `createSettings()``LoggerSettings__c`

Creates a new, unsaved `LoggerSettings__c` record
**This is only intended to be used internally by Nebula Logger, and is subject to change.** Creates a new, unsaved `LoggerSettings__c` record

##### Return

Expand Down Expand Up @@ -3432,7 +3430,7 @@ The matching instance of System.LoggingLevel (or a default value if a match is n

#### `getNamespacePrefix()``String`

Returns the current namespace of Nebula Logger
**This is only intended to be used internally by Nebula Logger, and is subject to change.** Returns the current namespace of Nebula Logger

##### Return

Expand All @@ -3444,6 +3442,20 @@ String

The current namespace prefix, or an empty string when no namespace is being used

#### `getOrganizationApiVersion()``String`

**This is only intended to be used internally by Nebula Logger, and is subject to change.** Returns the current Salesforce API version number of the org

##### Return

**Type**

String

**Description**

The current API version, in the format `v00.0`

#### `getParentLogTransactionId()``String`

Returns the transaction ID value that will be used to relate the current transaction&apos;s log to a parent log
Expand Down Expand Up @@ -3516,7 +3528,7 @@ System.LoggingLevel - The matching instance of LoggingLevel

#### `getUserSettings()``LoggerSettings__c`

Returns the current user&apos;s instance of `LoggerSettings__c`
**This is only intended to be used internally by Nebula Logger, and is subject to change.** Returns the current user&apos;s instance of `LoggerSettings__c`

##### Return

Expand All @@ -3530,7 +3542,7 @@ LoggerSettings\_\_c - The current user&apos;s instance of the custom settings

#### `getUserSettings(User loggingUser)``LoggerSettings__c`

Returns the specified user&apos;s instance of `LoggerSettings__c`
**This is only intended to be used internally by Nebula Logger, and is subject to change.** Returns the specified user&apos;s instance of `LoggerSettings__c`

##### Parameters

Expand All @@ -3548,20 +3560,6 @@ LoggerSettings\_\_c

LoggerSettings\_\_c - The specified user&apos;s instance of the custom settings

#### `getValue()``String`

Getter returning the uuid value

##### Return

**Type**

String

**Description**

A string containing the UUID value.

#### `getVersionNumber()``String`

Returns the current version number of Nebula Logger
Expand Down Expand Up @@ -4750,7 +4748,7 @@ Saves any entries in Logger&apos;s buffer, using the specified save method for o

#### `saveLog(String saveMethodName)``void`

Saves any entries in Logger&apos;s buffer, using the specified save method for only this call. All subsequent calls to saveLog() will use the transaction save method.
**This is only intended to be used internally by Nebula Logger, and is subject to change.** Saves any entries in Logger&apos;s buffer, using the specified save method for only this call. All subsequent calls to saveLog() will use the transaction save method.

##### Parameters

Expand Down Expand Up @@ -5616,6 +5614,74 @@ Asynchronoulsy publishes the list of `LogEntryEvent__e` records
| ------------------ | ---------------------------------------------------------- |
| `queueableContext` | The context of the current queue, provided by the platform |

---

#### Logger.StatusApiResponse class

---

##### Properties

###### `Products``List<StatusApiResponseProduct>`

###### `allOrNone``Boolean`

Boolean used when saving records. If true, all records must save correctly or an exception is thrown. If false, partial processing is enabled, and if an indidividual record fails, successful records are still saved without exception.

###### `environment``String`

###### `location``String`

###### `maintenanceWindow``String`

###### `records``List<SObject>`

List of records to save.

###### `releaseNumber``String`

###### `releaseVersion``String`

###### `status``String`

---

##### Methods

###### `Uuid()``public`

Default constructor

###### `getValue()``String`

Getter returning the uuid value

####### Return

**Type**

String

**Description**

A string containing the UUID value.

---

#### Logger.StatusApiResponseProduct class

---

##### Properties

###### `key``String`

###### `name``String`

---

##### Methods

###### `insertRecords(List<SObject> records)``void`

Inserts records via the REST api.
Expand Down
4 changes: 4 additions & 0 deletions docs/apex/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ Controller class for the LWC `logViewer`, used to provided different views on a

Builds and sends email notifications when internal exceptions occur within the logging system

### [LoggerHomeHeaderController](Log-Management/LoggerHomeHeaderController)

Controller class for the LWC `loggerHomeHeader`

### [LoggerSObjectMetadata](Log-Management/LoggerSObjectMetadata)

Provides details to LWCs about Logger&apos;s `SObjects`, using `@AuraEnabled` properties
Expand Down
3 changes: 2 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ module.exports = {
...jestConfig,
coverageDirectory: './test-coverage/lwc',
moduleNameMapper: {
'^lightning/empApi$': '<rootDir>/config/jest/mocks/lightning/empApi'
'^lightning/empApi$': '<rootDir>/config/jest/mocks/lightning/empApi',
'^lightning/navigation$': '<rootDir>/config/jest/mocks/lightning/navigation'
},
modulePathIgnorePatterns: ['recipes']
};
Loading

0 comments on commit da3bbaa

Please sign in to comment.