Skip to content

Commit

Permalink
Winter '23 release - v4.9.0 (#403)
Browse files Browse the repository at this point in the history
* Updated all metadata from API v55.0 (Summer '22 release) to v56.0 (Winter '23 release)

* Updated LogBatchPurgeScheduler and LogBatchPurger to increase the default batch size from 200 to 2,000, and to handle null batch sizes

* Cleaned up some more code in LogBatchPurger & LogBatchPurgeScheduler to centralize the default batch size value to be in just LogBatchPurger (instead of having it hardcoded in both classes)

* Changed visibility of some methods in Logger & LogEntryEventBuilder from public to global so they're available in the managed package

* Updated the LogEntry__c fields shown on the LoggerScenario__c page's related list

* Removed picklist value 'v55.0' in some picklist value fields

* Added Description__c text to several new LoggerParameter__mdt records that were released in v4.8.4 and added a pipeline script to ensure this isn't missed in the future

* Updated some references to System classes Limits, Network, Security, and Type  to include the System namespace - also added placeholder classes in extra-tests to ensure all new references include the System namespace

* Added default Apex classes generated when creating/deploying an Experience Site to help with automated testing

* Moved LogBatchPurgeController_Tests to the correct test class folder

* Added unpackagedMetadata info in sfdx-project.json

* Updated package.json & package-lock.json to resolve some dependabot alerts
  • Loading branch information
jongpie authored Nov 21, 2022
1 parent e39835b commit bfb2da9
Show file tree
Hide file tree
Showing 271 changed files with 24,720 additions and 20,684 deletions.
2 changes: 1 addition & 1 deletion .forceignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# More information: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_exclude_source.htm
#

nebula-logger/**/main/default/
# nebula-logger/**/main/default/
nebula-logger/managed-package/sfdx-project.json
nebula-logger/managed-package/**/*.testSuite-meta.xml
/**/Admin.profile-meta.xml
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ jobs:
- name: 'Assign Logger Admin Permission Set'
run: npm run permset:assign:admin

- name: 'Validate Custom Metadata Records'
run: npx sfdx force:apex:execute --apexcodefile ./scripts/build/validate-custom-metadata-records.apex

# Nebula Logger has functionality that queries the AuthSession object when the current user has an active session.
# The code should work with or without an active session, so the pipeline runs the tests twice - asynchronously and synchronously.
# This is done because, based on how you execute Apex tests, the running user may have an active session (synchrously) or not (asynchronously).
Expand Down Expand Up @@ -227,6 +230,9 @@ jobs:
- name: 'Assign Logger Admin Permission Set'
run: npm run permset:assign:admin

- name: 'Validate Custom Metadata Records'
run: npx sfdx force:apex:execute --apexcodefile ./scripts/build/validate-custom-metadata-records.apex

# Nebula Logger has functionality that queries the AuthSession object when the current user has an active session.
# The code should work with or without an active session, so the pipeline runs the tests twice - asynchronously and synchronously.
# This is done because, based on how you execute Apex tests, the running user may have an active session (synchrously) or not (asynchronously).
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@
.sfdx/
.vscode/
# nebula-logger/**/main/default/
tests/
# tests/
test-coverage/
temp/

# Additional folders that are temporarily copied when creating a version of the managed package
nebula-logger/managed-package/core/main/configuration/
nebula-logger/managed-package/core/main/log-management/
nebula-logger/managed-package/core/main/logger-engine/
nebula-logger/managed-package/core/main/plugin-framework/
nebula-logger/managed-package/core/tests/

# NPM
Expand Down
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
.sf/
.sfdx/
.vscode/
scripts/
test-coverage/

# NPM
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@

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

## Unlocked Package - v4.8.4
## Unlocked Package - v4.9.0

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

## Managed Package - v4.8.0
## Managed Package - v4.9.0

[![Install Managed Package in a Sandbox](./images/btn-install-managed-package-sandbox.png)](https://test.salesforce.com/packaging/installPackage.apexp?mgd=true&p0=04t5Y0000015lsgQAA)
[![Install Managed Package in Production](./images/btn-install-managed-package-production.png)](https://login.salesforce.com/packaging/installPackage.apexp?mgd=true&p0=04t5Y0000015lsgQAA)
[![View Milestone](./images/btn-view-managed-package-milestone.png)](https://github.com/jongpie/NebulaLogger/milestone/8?closed=1)
[![View Milestone](./images/btn-view-managed-package-milestone.png)](https://github.com/jongpie/NebulaLogger/milestone/9?closed=1)

---

Expand Down
15 changes: 15 additions & 0 deletions config/experience-cloud/classes/ChangePasswordController.cls
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* An apex page controller that exposes the change password functionality
*/
public with sharing class ChangePasswordController {
public String oldPassword { get; set; }
public String newPassword { get; set; }
public String verifyNewPassword { get; set; }

public PageReference changePassword() {
return Site.changePassword(newPassword, verifyNewPassword, oldpassword);
}

public ChangePasswordController() {
}
}
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>56.0</apiVersion>
<status>Active</status>
</ApexClass>
16 changes: 16 additions & 0 deletions config/experience-cloud/classes/ChangePasswordControllerTest.cls
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/**
* An apex page controller that exposes the change password functionality
*/
@IsTest
public with sharing class ChangePasswordControllerTest {
@IsTest(SeeAllData=true)
public static void testChangePasswordController() {
// Instantiate a new controller with all parameters in the page
ChangePasswordController controller = new ChangePasswordController();
controller.oldPassword = '123456';
controller.newPassword = 'qwerty1';
controller.verifyNewPassword = 'qwerty1';

System.assertEquals(controller.changePassword(), null);
}
}
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>56.0</apiVersion>
<status>Active</status>
</ApexClass>
20 changes: 20 additions & 0 deletions config/experience-cloud/classes/ForgotPasswordController.cls
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* An apex page controller that exposes the site forgot password functionality
*/
public with sharing class ForgotPasswordController {
public String username { get; set; }

public ForgotPasswordController() {
}

public PageReference forgotPassword() {
boolean success = Site.forgotPassword(username);
PageReference pr = Page.ForgotPasswordConfirm;
pr.setRedirect(true);

if (success) {
return pr;
}
return null;
}
}
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>56.0</apiVersion>
<status>Active</status>
</ApexClass>
14 changes: 14 additions & 0 deletions config/experience-cloud/classes/ForgotPasswordControllerTest.cls
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* An apex page controller that exposes the site forgot password functionality
*/
@IsTest
public with sharing class ForgotPasswordControllerTest {
@IsTest(SeeAllData=true)
public static void testForgotPasswordController() {
// Instantiate a new controller with all parameters in the page
ForgotPasswordController controller = new ForgotPasswordController();
controller.username = 'test@salesforce.com';

System.assertEquals(controller.forgotPassword(), null);
}
}
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>56.0</apiVersion>
<status>Active</status>
</ApexClass>
62 changes: 62 additions & 0 deletions config/experience-cloud/classes/MicrobatchSelfRegController.cls
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
public class MicrobatchSelfRegController {
public String firstName { get; set; }
public String lastName { get; set; }
public String email { get; set; }
public String communityNickname {
get;
set {
communityNickname = value == null ? value : value.trim();
}
}

public MicrobatchSelfRegController() {
String expid = ApexPages.currentPage().getParameters().get('expid');
if (expId != null) {
Site.setExperienceId(expId);
}
}

public PageReference registerUser() {
String userName = email;
String accountName; // to be filled by customer
String contactName; //to be filled by customer
String profileId = null; //to be filled by customer
String UUID;

User u = new User();
u.Username = userName;
u.Email = email;
u.FirstName = firstName;
u.LastName = lastName;
u.CommunityNickname = communityNickname;
u.ProfileId = profileId;
u.LocaleSidKey = 'en_US';
u.TimeZoneSidKey = 'GMT';
u.LanguageLocaleKey = 'en_US';
u.EmailEncodingKey = 'UTF-8';

Account acc = new Account();
acc.Name = 'Account for ' + lastName;
Contact c = new Contact();
c.lastName = lastName;

try {
UUID = System.Network.createExternalUserAsync(u, c, acc);
} catch (Site.ExternalUserCreateException ex) {
List<String> errors = ex.getDisplayMessages();
for (String error : errors) {
ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, error));
}

// This message is used for debugging. Do not display this in the UI to the end user.
// It has the information around why the user creation failed.
System.debug(ex.getMessage());
}
if (UUID != null) {
PageReference page = System.Page.CommunitiesSelfRegConfirm;
page.setRedirect(true);
return page;
}
return null;
}
}
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>56.0</apiVersion>
<status>Active</status>
</ApexClass>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@IsTest
public with sharing class MicrobatchSelfRegControllerTest {
@IsTest(SeeAllData=true)
public static void testMicrobatchSelfRegController() {
MicrobatchSelfRegController controller = new MicrobatchSelfRegController();
controller.firstName = 'FirstName';
controller.lastName = 'LastName';
controller.email = 'test@force.com';
controller.communityNickname = 'test';

// registerUser will always return null when the page isn't accessed as a guest user
System.assert(controller.registerUser() == null);
}
}
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>56.0</apiVersion>
<status>Active</status>
</ApexClass>
95 changes: 95 additions & 0 deletions config/experience-cloud/classes/MyProfilePageController.cls
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
/**
* An apex class that updates portal user details.
Guest users are never able to access this page.
*/
public with sharing class MyProfilePageController {
private User user;
private boolean isEdit = false;

public User getUser() {
return user;
}

public MyProfilePageController() {
user = [
SELECT
id,
email,
username,
usertype,
communitynickname,
timezonesidkey,
languagelocalekey,
firstname,
lastname,
phone,
title,
street,
city,
country,
postalcode,
state,
localesidkey,
mobilephone,
extension,
fax,
contact.email
FROM User
WHERE id = :UserInfo.getUserId()
];
// guest users should never be able to access this page
if (user.usertype == 'GUEST') {
throw new NoAccessException();
}
}

public Boolean getIsEdit() {
return isEdit;
}

public void edit() {
isEdit = true;
}

public void save() {
try {
update user;
isEdit = false;
} catch (DmlException e) {
ApexPages.addMessages(e);
}
}

public PageReference changePassword() {
return Page.ChangePassword;
}

public void cancel() {
isEdit = false;
user = [
SELECT
id,
email,
username,
communitynickname,
timezonesidkey,
languagelocalekey,
firstname,
lastname,
phone,
title,
street,
city,
country,
postalcode,
state,
localesidkey,
mobilephone,
extension,
fax,
contact.email
FROM User
WHERE id = :UserInfo.getUserId()
];
}
}
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>56.0</apiVersion>
<status>Active</status>
</ApexClass>
Loading

0 comments on commit bfb2da9

Please sign in to comment.