Skip to content

Commit

Permalink
Added data classification metadata to all 560+ custom fields (#329)
Browse files Browse the repository at this point in the history
* Add data compliance information to all fields

* Updates to several metadata files from retrieving the XML from a scratch org

* Added a supplemental-metadata folder to store metadata for other packages that help with dev of Nebula Logger

* added npm scripts to run tests without code coverage

* Fixed some namespacing issues for the managed package in LogBatchPurgeController and LogBatchPurgeController_Tests

* Switched to displaying logBatchPurge LWC as a tab in Logger Console, instead of using a weblink on Log__c
  • Loading branch information
jongpie authored Jun 14, 2022
1 parent 31e510a commit dbbe32c
Show file tree
Hide file tree
Showing 599 changed files with 2,394 additions and 193 deletions.
14 changes: 1 addition & 13 deletions .forceignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,4 @@ nebula-logger/managed-package/**/*.testSuite-meta.xml

# LWC Jest
**/__tests__/**
**/jest-mocks/**

# Temporarily ignoring of some files - will remove in a future release
nebula-logger/extra-tests/classes/FieldSet.cls
nebula-logger/extra-tests/classes/FieldSet.cls-meta.xml
nebula-logger/extra-tests/classes/FieldSetMember.cls
nebula-logger/extra-tests/classes/FieldSetMember.cls-meta.xml
nebula-logger/extra-tests/classes/SObjectField.cls
nebula-logger/extra-tests/classes/SObjectField.cls-meta.xml
nebula-logger/extra-tests/classes/SObjectType.cls
nebula-logger/extra-tests/classes/SObjectType.cls-meta.xml
nebula-logger/extra-tests/classes/Test.cls
nebula-logger/extra-tests/classes/Test.cls-meta.xml
**/jest-mocks/**
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ jobs:
run: npx pwsh ./scripts/build/create-and-install-package-version.ps1 -targetpackagealias '"Nebula Logger - Core"' -targetreadme ./README.md -targetusername nebula-logger-package-demo

- name: 'Run Apex Tests'
run: npm run test:apex:without-coverage -- --targetusername nebula-logger-package-demo
run: npm run test:apex:nocoverage -- --targetusername nebula-logger-package-demo

- name: 'Commit New Package Version'
run: |
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ Designed for Salesforce admins, developers & architects. A robust logger for Ape

## Unlocked Package - v4.7.8

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

## Managed Package - v4.7.0
Expand Down
105 changes: 105 additions & 0 deletions docs/apex/Log-Management/LogBatchPurgeController.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
---
layout: default
---

## LogBatchPurgeController class

Controller class for lwc `logBatchPurge`, used to provide metrics of `Log__c`, `LogEntry__c`, `LogEntryTag__c` records to purge and allow user to manually run `LogBatchPurger` from the UI.

---

### Methods

#### `canUserRunLogBatchPurger()``boolean`

Returns true if the current user has delete permission on the Log\_\_c object or

##### Return

**Type**

boolean

**Description**

true if the current user has delete permission on the Log\_\_c object.

#### `getMetrics(String dateFilterOption)``Map<String, Object>`

return a `Map&lt;String,Object&gt;` contains metrics for number of `Log__c`, `LogEntry__c`, `LogEntryTag__c` records to purge, for the given timeframe TODAY/ THIS_WEEK/ THIS_MONTH. The metrics is grouped by `Log__c.LogPurgeAction__c`.

##### Parameters

| Param | Description |
| ------------------ | ------------------------------------------------------------------------------------------- |
| `dateFilterOption` | a Date Literal used to filter log records. Possible values are TODAY, THIS_WEEK, THIS_MONTH |

##### Return

**Type**

Map&lt;String, Object&gt;

**Description**

The instance of `Map&lt;String,Object&gt;`,contains keys as `Log__c`, `LogEntry__c`, `LogEntryTag__c` and value as metrics for the corresponding object records to purge

#### `getPurgeActionOptions()``List<PicklistOption>`

Returns all of the PurgeAction options to display the log metrics in UI

##### Return

**Type**

List&lt;PicklistOption&gt;

**Description**

The instance of `List&lt;PicklistOption&gt;`, containing all picklist options for purge Action.

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

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

##### Return

**Type**

List&lt;AsyncApexJob&gt;

**Description**

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

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

execute the logBatchPurger batch with batch size 2000

##### Return

**Type**

String

**Description**

Returns the ID of the AsyncApexJob object associated with the LogBatchPurger job as a string

---

### Inner Classes

#### LogBatchPurgeController.PicklistOption class

Inner class for returning all custom `List&lt;PicklistOption&gt;` in a single Apex method call

---

##### Properties

###### `label``String`

###### `value``String`

---
4 changes: 4 additions & 0 deletions docs/apex/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ Class used by the logging system for trigger contextual details

## Log Management

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

Controller class for lwc `logBatchPurge`, used to provide metrics of `Log__c`, `LogEntry__c`, `LogEntryTag__c` records to purge and allow user to manually run `LogBatchPurger` from the UI.

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

Schedulable class used to schedule the batch job `LogBatchPurger`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
<field>SObjectHandlerApexClass__c</field>
<value xsi:type="xsd:string">LogEntryEventHandler</value>
</values>
<values>
<field>SObjectTypeOverride__c</field>
<value xsi:nil="true" />
</values>
<values>
<field>SObjectType__c</field>
<value xsi:type="xsd:string">LogEntryEvent__e</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
<field>SObjectHandlerApexClass__c</field>
<value xsi:type="xsd:string">LogEntryHandler</value>
</values>
<values>
<field>SObjectTypeOverride__c</field>
<value xsi:nil="true" />
</values>
<values>
<field>SObjectType__c</field>
<value xsi:type="xsd:string">LogEntry__c</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
<field>SObjectHandlerApexClass__c</field>
<value xsi:type="xsd:string">LogEntryTagHandler</value>
</values>
<values>
<field>SObjectTypeOverride__c</field>
<value xsi:nil="true" />
</values>
<values>
<field>SObjectType__c</field>
<value xsi:type="xsd:string">LogEntryTag__c</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
<field>SObjectHandlerApexClass__c</field>
<value xsi:type="xsd:string">LogHandler</value>
</values>
<values>
<field>SObjectTypeOverride__c</field>
<value xsi:nil="true" />
</values>
<values>
<field>SObjectType__c</field>
<value xsi:type="xsd:string">Log__c</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
<field>SObjectHandlerApexClass__c</field>
<value xsi:type="xsd:string">LoggerTagHandler</value>
</values>
<values>
<field>SObjectTypeOverride__c</field>
<value xsi:nil="true" />
</values>
<values>
<field>SObjectType__c</field>
<value xsi:type="xsd:string">LoggerTag__c</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
<fullName>ApplyToMessage__c</fullName>
<businessStatus>DeprecateCandidate</businessStatus>
<complianceGroup>None</complianceGroup>
<defaultValue>true</defaultValue>
<externalId>false</externalId>
<fieldManageability>DeveloperControlled</fieldManageability>
<inlineHelpText
>When checked, the data mask rule is applied to log entry messages (stored in LogEntryEvent__e.Message__c and LogEntry__c.Message__c)</inlineHelpText>
<label>DEPRECATED: Apply to Message</label>
<securityClassification>Confidential</securityClassification>
<type>Checkbox</type>
</CustomField>
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
<fullName>ApplyToRecordJson__c</fullName>
<businessStatus>DeprecateCandidate</businessStatus>
<complianceGroup>None</complianceGroup>
<defaultValue>true</defaultValue>
<externalId>false</externalId>
<fieldManageability>DeveloperControlled</fieldManageability>
<inlineHelpText
>When checked, the data mask rule is applied to log entry messages (stored in LogEntryEvent__e.RecordJson__c and LogEntry__c.RecordJson__c)</inlineHelpText>
<label>Apply to Record JSON</label>
<securityClassification>Confidential</securityClassification>
<type>Checkbox</type>
</CustomField>
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
<fullName>IsEnabled__c</fullName>
<businessStatus>Active</businessStatus>
<complianceGroup>None</complianceGroup>
<defaultValue>true</defaultValue>
<externalId>false</externalId>
<fieldManageability>SubscriberControlled</fieldManageability>
<label>Is Enabled</label>
<securityClassification>Confidential</securityClassification>
<type>Checkbox</type>
</CustomField>
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
<?xml version="1.0" encoding="UTF-8" ?>
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
<fullName>ReplacementRegEx__c</fullName>
<businessStatus>Active</businessStatus>
<complianceGroup>None</complianceGroup>
<externalId>false</externalId>
<fieldManageability>DeveloperControlled</fieldManageability>
<label>Replacement RegEx</label>
<length>255</length>
<required>true</required>
<securityClassification>Confidential</securityClassification>
<type>Text</type>
<unique>false</unique>
</CustomField>
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
<?xml version="1.0" encoding="UTF-8" ?>
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
<fullName>SensitiveDataRegEx__c</fullName>
<businessStatus>Active</businessStatus>
<complianceGroup>None</complianceGroup>
<externalId>false</externalId>
<fieldManageability>DeveloperControlled</fieldManageability>
<label>Sensitive Data RegEx</label>
<length>255</length>
<required>true</required>
<securityClassification>Confidential</securityClassification>
<type>Text</type>
<unique>false</unique>
</CustomField>
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
<fullName>ComparisonType__c</fullName>
<businessStatus>Active</businessStatus>
<complianceGroup>None</complianceGroup>
<externalId>false</externalId>
<fieldManageability>SubscriberControlled</fieldManageability>
<label>Comparison Type</label>
<required>true</required>
<securityClassification>Confidential</securityClassification>
<type>Picklist</type>
<valueSet>
<restricted>true</restricted>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
<fullName>ComparisonValue__c</fullName>
<businessStatus>Active</businessStatus>
<complianceGroup>None</complianceGroup>
<externalId>false</externalId>
<fieldManageability>SubscriberControlled</fieldManageability>
<label>Comparison Value</label>
<length>32768</length>
<securityClassification>Confidential</securityClassification>
<type>LongTextArea</type>
<visibleLines>3</visibleLines>
</CustomField>
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
<fullName>IsEnabled__c</fullName>
<businessStatus>Active</businessStatus>
<complianceGroup>None</complianceGroup>
<defaultValue>true</defaultValue>
<externalId>false</externalId>
<fieldManageability>DeveloperControlled</fieldManageability>
<label>Is Enabled</label>
<securityClassification>Confidential</securityClassification>
<type>Checkbox</type>
</CustomField>
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?xml version="1.0" encoding="UTF-8" ?>
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
<fullName>SObjectField__c</fullName>
<businessStatus>Active</businessStatus>
<complianceGroup>None</complianceGroup>
<externalId>false</externalId>
<fieldManageability>SubscriberControlled</fieldManageability>
<label>Field</label>
Expand All @@ -9,6 +11,7 @@
<relationshipLabel>Log Entry Tag Rules</relationshipLabel>
<relationshipName>LogEntryTagRules</relationshipName>
<required>true</required>
<securityClassification>Confidential</securityClassification>
<type>MetadataRelationship</type>
<unique>false</unique>
</CustomField>
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
<?xml version="1.0" encoding="UTF-8" ?>
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
<fullName>SObjectType__c</fullName>
<businessStatus>Active</businessStatus>
<complianceGroup>None</complianceGroup>
<externalId>false</externalId>
<fieldManageability>SubscriberControlled</fieldManageability>
<label>Logger SObject</label>
<referenceTo>EntityDefinition</referenceTo>
<relationshipLabel>Log Entry Tag Rules</relationshipLabel>
<relationshipName>LogEntryTagRules</relationshipName>
<required>true</required>
<securityClassification>Confidential</securityClassification>
<type>MetadataRelationship</type>
<unique>false</unique>
</CustomField>
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
<?xml version="1.0" encoding="UTF-8" ?>
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
<fullName>Tags__c</fullName>
<businessStatus>Active</businessStatus>
<complianceGroup>None</complianceGroup>
<description>1 or more tags to assign - each tag should be listed on a separate line</description>
<externalId>false</externalId>
<fieldManageability>SubscriberControlled</fieldManageability>
<inlineHelpText>1 or more tags to assign - each tag should be listed on a separate line</inlineHelpText>
<label>Tag(s) to Apply</label>
<length>32768</length>
<securityClassification>Confidential</securityClassification>
<type>LongTextArea</type>
<visibleLines>5</visibleLines>
</CustomField>
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
<fullName>IsEnabled__c</fullName>
<businessStatus>Active</businessStatus>
<complianceGroup>None</complianceGroup>
<defaultValue>true</defaultValue>
<externalId>false</externalId>
<fieldManageability>SubscriberControlled</fieldManageability>
<label>Is Enabled</label>
<securityClassification>Confidential</securityClassification>
<type>Checkbox</type>
</CustomField>
Loading

0 comments on commit dbbe32c

Please sign in to comment.