Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge feature/242 into feature/242__bsdt-load-improv #655

Open
wants to merge 125 commits into
base: feature/242__bsdt-load-improv
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
fb2d16e
added robot test for creating custom metadata bucketed values
rmonica08 Aug 3, 2022
a669aee
updated custom metadata test for bsdt
rmonica08 Aug 4, 2022
523d8c7
updated keyword documentation
rmonica08 Aug 5, 2022
99c24c3
fixed lint errors
rmonica08 Aug 5, 2022
42cc641
updated custom metadata keyword
rmonica08 Aug 5, 2022
1cfe572
Merge e6ee6dae3e5fc22851f860dc6959750f9e13cc06 into feature/robot_q3_…
salesforce-org-metaci[bot] Aug 8, 2022
257231c
Merge 955d189d074fa8d67218704d4080599ce93275d9 into feature/robot_q3_…
salesforce-org-metaci[bot] Aug 11, 2022
b0b63ed
WIP
AndersonTarren Sep 13, 2022
2e5fe5f
Merge 904665544ee410b38229430f988f6e330c7efbf4 into feature/robot_q3_…
salesforce-org-metaci[bot] Sep 15, 2022
c1fedff
wip
AndersonTarren Sep 15, 2022
324ffe1
wip
AndersonTarren Sep 16, 2022
542bca5
wip
AndersonTarren Sep 16, 2022
787a5c0
Too many results message
AndersonTarren Sep 19, 2022
276d968
Log cleanup
AndersonTarren Sep 19, 2022
9d667f4
Test Updates
AndersonTarren Sep 19, 2022
5623229
HandleCohort adjustment
AndersonTarren Sep 20, 2022
92c616a
Cleanup
AndersonTarren Sep 20, 2022
4f7e4eb
Query update
AndersonTarren Sep 20, 2022
ec9ea0a
Conversion to scoped notification
AndersonTarren Sep 20, 2022
1c30bb0
Review feedback
AndersonTarren Sep 21, 2022
7fc1fe1
Merge a80fc1821818257014fa98a6ff5284010196962b into feature/242__part…
salesforce-org-metaci[bot] Sep 22, 2022
0e18a7d
Fixes issue with search lag
AndersonTarren Sep 22, 2022
3c93767
Merge branch 'feature/242__part-load-perf' of github.com:SalesforceFo…
AndersonTarren Sep 22, 2022
b51815c
Query adjustments
AndersonTarren Sep 30, 2022
f9dcabf
Fix for empty result spinner
AndersonTarren Oct 3, 2022
7477d3b
Improve deselect result
AndersonTarren Oct 3, 2022
84264c0
Merge pull request #654 from SalesforceFoundation/feature/242__part-l…
jjbennett Oct 4, 2022
7acc58b
Participant Stage Filter
AndersonTarren Oct 14, 2022
cd478b1
Label adjustments
AndersonTarren Oct 17, 2022
5c7eb82
Review feedback round 1
AndersonTarren Oct 17, 2022
6e4b913
Review feedback and tests
AndersonTarren Oct 18, 2022
4ac1368
Merge pull request #656 from SalesforceFoundation/feature/242__stage-…
jjbennett Oct 18, 2022
b0383e7
wip
AndersonTarren Nov 3, 2022
e4df32b
Navigation Implemented
AndersonTarren Nov 3, 2022
20445a9
Cleanup
AndersonTarren Nov 4, 2022
87b0dde
labels and cleanup
AndersonTarren Nov 8, 2022
82fdb1a
Jest
AndersonTarren Nov 9, 2022
92f421b
Jest
AndersonTarren Nov 9, 2022
80154e6
Jest
AndersonTarren Nov 9, 2022
777aa54
Removed commented test
AndersonTarren Nov 9, 2022
6af4d36
Review Feedback, round 1
AndersonTarren Nov 10, 2022
ce11a3e
api modal vals
AndersonTarren Nov 11, 2022
311b884
Null check when setting defaults
AndersonTarren Nov 11, 2022
9410fbe
Updated time caulcation for delivery date
AndersonTarren Nov 14, 2022
e0a7c0a
Merge pull request #658 from SalesforceFoundation/feature/242__sd-dates
bmuniswamy Nov 14, 2022
88f07f3
Merge e0a7c0a0f9cb283cfc853257adda46e6230af537 into feature/242__a11y…
salesforce-org-metaci[bot] Nov 14, 2022
aa15638
Merge pull request #643 from SalesforceFoundation/feature/robot_q3_24…
rmonica08 Nov 16, 2022
949cb04
Merge aa156389effc0e4a3861003f3a6af8fe4452fd41 into feature/242__a11y…
salesforce-org-metaci[bot] Nov 16, 2022
c77f685
Merge pull request #657 from SalesforceFoundation/feature/242__a11y-m…
bmuniswamy Nov 16, 2022
dcacf09
Merge pull request #648 from SalesforceFoundation/feature/242
AndersonTarren Nov 28, 2022
26e1c6f
Merge dcacf0914caa74923f917b1e5939d5228d66d7b4 into feature/240
salesforce-org-metaci[bot] Nov 28, 2022
23dac45
242 PMM localized labels
dmkud Nov 29, 2022
f5492b8
Merge pull request #659 from SalesforceFoundation/translation/242.loc
AndersonTarren Nov 29, 2022
b3cf650
CSS Adjustments for mobile sizing
AndersonTarren Dec 6, 2022
7c4c1d7
Merge branch 'main' into feature/modal-scroll-issue
AndersonTarren Dec 6, 2022
348603b
Merge pull request #660 from SalesforceFoundation/feature/modal-scrol…
jjbennett Dec 6, 2022
bf65c22
Merge 348603b28769fcd596d2875d9eac207e3a535f8f into feature/240
salesforce-org-metaci[bot] Dec 6, 2022
f7cf780
Merge bf65c22324cf7ddf8a2374acd9865058b30b88a4 into feature/242
salesforce-org-metaci[bot] Dec 6, 2022
893b9bd
Merge branch 'main' into feature/translation-242
AndersonTarren Dec 12, 2022
61405b3
Merge pull request #662 from SalesforceFoundation/feature/translation…
AndersonTarren Dec 13, 2022
1c7cfac
Merge 61405b3cee3f12ca4eb62542ac9247927eed99f9 into feature/240
salesforce-org-metaci[bot] Dec 13, 2022
7de7d70
Merge 1c7cfacb8298d8affd21597919bad72763e87c2c into feature/242
salesforce-org-metaci[bot] Dec 13, 2022
5c0994b
Arbitrary change for 244 placeholder
AndersonTarren Jan 12, 2023
579f255
Sort order for BSDT Combobox
AndersonTarren Jan 12, 2023
d385794
Using sort vs order by for Shield
AndersonTarren Jan 13, 2023
3fa4673
Merge pull request #664 from SalesforceFoundation/feature/244_bsdt-pi…
voduyemi Jan 17, 2023
b48d852
Merge 3fa4673f24efd4caa1011d8df4a30c4edc9b015a into feature/244__plac…
salesforce-org-metaci[bot] Jan 17, 2023
3bc2a4b
BSDT Active Services Filter
AndersonTarren Feb 21, 2023
cb435bb
Program Engagement Stage filter
AndersonTarren Feb 21, 2023
9e224e4
Review Feedback
AndersonTarren Feb 23, 2023
85f9227
Adding feature gate for Active filter
AndersonTarren Feb 24, 2023
49bd255
Review Feedback 2
AndersonTarren Feb 24, 2023
d0e16ea
Streamline feature checks and bucket values
AndersonTarren Feb 24, 2023
cb93348
Using activeStatuses getter
AndersonTarren Feb 24, 2023
8906cec
Merge pull request #665 from SalesforceFoundation/feature/244__servic…
jjbennett Feb 24, 2023
569523d
Merge 8906cec7feb57829fa1e72616d6a6a13123f2980 into feature/244__plac…
salesforce-org-metaci[bot] Feb 24, 2023
d7ec4ef
updated q3 bsdt tests
rmonica08 Mar 14, 2023
f9036d3
Merge pull request #668 from SalesforceFoundation/feature/robot_q3_up…
rmonica08 Mar 14, 2023
1ef52df
Merge f9036d336232028f5f8202473cb041c5eae30360 into feature/244__plac…
salesforce-org-metaci[bot] Mar 14, 2023
d7c9505
Update cumulusci.yml for static release notes
sella24 Mar 16, 2023
615d0f3
Merge pull request #669 from SalesforceFoundation/feature/update-cumu…
sella24 Mar 17, 2023
9a0ec76
Merge 615d0f3df4a6428e0df12b229a11e8273c3ec833 into feature/240
salesforce-org-metaci[bot] Mar 17, 2023
7c72321
Merge 9a0ec76d6705986964db584b20172645a68d34aa into feature/242
salesforce-org-metaci[bot] Mar 17, 2023
ef94d1d
Merge 9a0ec76d6705986964db584b20172645a68d34aa into feature/244
salesforce-org-metaci[bot] Mar 17, 2023
bc7f680
Merge ef94d1dd5dbda7ddb5c4b4edacc0112fa29cf494 into feature/244__plac…
salesforce-org-metaci[bot] Mar 17, 2023
6639f6e
Merge pull request #663 from SalesforceFoundation/feature/244__placeh…
AndersonTarren Apr 18, 2023
f620058
Merge 6639f6e43c6f570dddfa8514bbd074b7ec122d6a into feature/240
salesforce-org-metaci[bot] Apr 18, 2023
6ec9f11
Add .sf to gitignore and create feature branch.
jjbennett Aug 14, 2023
e5d0372
WIP Debounce
AndersonTarren Sep 20, 2023
ab2756e
Adjust Save Checks
AndersonTarren Sep 28, 2023
c07c71e
Merge pull request #673 from SalesforceFoundation/feature/248__bsdt-d…
AndersonTarren Sep 29, 2023
eba6169
Limit close event to non-navigation clause
AndersonTarren Nov 7, 2023
9f5888a
Merge pull request #674 from SalesforceFoundation/feature/248__sched-…
jjbennett Nov 8, 2023
b2c79ee
Merge pull request #672 from SalesforceFoundation/feature/248
jjbennett Nov 17, 2023
5f0803b
Merge b2c79ee0eab9704e274262fcc2f2899c9632b695 into feature/240
salesforce-org-metaci[bot] Nov 17, 2023
bb5a983
Merge 5f0803bafcda106d7c85a64f98ee93b289e6d6a2 into feature/242
salesforce-org-metaci[bot] Nov 17, 2023
3d36683
Make CODEOWNERS GUS-Aware
jjbennett Jan 19, 2024
3f9cacb
Merge pull request #675 from SalesforceFoundation/feature/codeowners
jjbennett Jan 24, 2024
a7d713b
Update cumulusci.yml for release notes statement
melissabarber Jan 24, 2024
df48add
Merge pull request #676 from SalesforceFoundation/feature/release_not…
jstvz Mar 11, 2024
3ac5ada
Merge df48addda163e4832969a36df43b87b7adf39964 into feature/240
salesforce-org-metaci[bot] Mar 11, 2024
89aea4c
Merge 3ac5adaa751ff68d2cf72bf35944ead74c0a993c into feature/242
salesforce-org-metaci[bot] Mar 11, 2024
67d3fb5
Small change to readme to create the feature branch
jjbennett Jul 26, 2024
2022022
Switch install security to admin only
jjbennett Jul 26, 2024
832029a
Merge pull request #678 from SalesforceFoundation/feature/254__defaul…
jjbennett Jul 30, 2024
28d2e6f
Update installer security to admin only
jjbennett Aug 7, 2024
bb9db07
Merge pull request #679 from SalesforceFoundation/feature/update-inst…
bmuniswamy Aug 9, 2024
7914d51
Merge bb9db07e3675b56aaa25b245cb967548e3a21b5a into feature/240
salesforce-org-metaci[bot] Aug 12, 2024
79a523c
Merge 7914d51aff79dd16907a554659a2962f3ec5ac65 into feature/242
salesforce-org-metaci[bot] Aug 12, 2024
7b34afe
Merge 7914d51aff79dd16907a554659a2962f3ec5ac65 into feature/254
salesforce-org-metaci[bot] Aug 12, 2024
79a667f
Remove order by and filter by Contact name.
Aug 27, 2024
decb704
Prettify changes.
Aug 27, 2024
6dde17b
Merge pull request #680 from SalesforceFoundation/feature/254__shield…
jjbennett Aug 29, 2024
03bb97c
Move to bulk save.
Sep 17, 2024
c94b006
Remove console log and fix method name.
Sep 17, 2024
ce9ee2f
Fix combobox error reporting.
Sep 18, 2024
e2f0f79
Fixes from code review.
Sep 19, 2024
22fab38
Fixes from code review.
Sep 19, 2024
da921a4
Fixes from code review.
Sep 19, 2024
9f0e7d3
Fixes from code review.
Sep 19, 2024
353cb15
Fixes from code review and cleanup of unused methods.
Sep 19, 2024
3819b42
Merge pull request #681 from SalesforceFoundation/feature/254__fix-bu…
mldyang Sep 19, 2024
b67c6f8
Merge pull request #677 from SalesforceFoundation/feature/254
AndersonTarren Nov 22, 2024
85930b2
Merge b67c6f86223805909cdd176be2ffedcb6f057356 into feature/240
salesforce-org-metaci[bot] Nov 22, 2024
cf7604c
Merge 85930b271e453aaf416acc31afab9b1161463b17 into feature/242
salesforce-org-metaci[bot] Nov 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#GUSINFO:NPC Asteroids, SFDO Program Management Module

# Python
*.py @SalesforceFoundation/release-engineering-reviewers

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Salesforce / SFDX / CCI
.cci
.sfdx
.sf
/src.orig
/src

Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,4 @@ PMM AND SFDO BASE ARE NON-SFDC APPLICATIONS OR THIRD-PARTY APPLICATIONS, AND NOT

SFDC WILL NOT HAVE ANY LIABILITY ARISING OUT OF OR RELATED TO YOUR USE OF PMM OR SFDO BASE FOR ANY DIRECT DAMAGES OR FOR ANY LOST PROFITS, REVENUES, GOODWILL OR INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL, EXEMPLARY, COVER, BUSINESS INTERRUPTION OR PUNITIVE DAMAGES, WHETHER AN ACTION IS IN CONTRACT OR TORT AND REGARDLESS OF THE THEORY OF LIABILITY, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES OR IF A REMEDY OTHERWISE FAILS OF ITS ESSENTIAL PURPOSE. THE FOREGOING DISCLAIMER WILL NOT APPLY TO THE EXTENT PROHIBITED BY LAW. SFDC DISCLAIMS ALL LIABILITY AND INDEMNIFICATION OBLIGATIONS FOR ANY HARM OR DAMAGES CAUSED BY ANY THIRD-PARTY HOSTING PROVIDERS.

THIS AGREEMENT SHALL BE GOVERNED EXCLUSIVELY BY, AND CONSTRUED EXCLUSIVELY IN ACCORDANCE WITH, THE LAWS OF THE UNITED STATES AND THE STATE OF CALIFORNIA, WITHOUT REGARD TO ITS CONFLICT OF LAWS PROVISIONS. THE STATE AND FEDERAL COURTS LOCATED IN SAN FRANCISCO, CALIFORNIA SHALL HAVE EXCLUSIVE JURISDICTION TO ADJUDICATE ANY DISPUTE ARISING OUT OF OR RELATING TO THIS AGREEMENT. EACH PARTY HEREBY CONSENTS TO THE JURISDICTION OF SUCH COURTS AND WAIVES ANY RIGHT IT MAY OTHERWISE HAVE TO CHALLENGE THE APPROPRIATENESS OF SUCH FORUMS.

THIS AGREEMENT SHALL BE GOVERNED EXCLUSIVELY BY, AND CONSTRUED EXCLUSIVELY IN ACCORDANCE WITH, THE LAWS OF THE UNITED STATES AND THE STATE OF CALIFORNIA, WITHOUT REGARD TO ITS CONFLICT OF LAWS PROVISIONS. THE STATE AND FEDERAL COURTS LOCATED IN SAN FRANCISCO, CALIFORNIA SHALL HAVE EXCLUSIVE JURISDICTION TO ADJUDICATE ANY DISPUTE ARISING OUT OF OR RELATING TO THIS AGREEMENT. EACH PARTY HEREBY CONSENTS TO THE JURISDICTION OF SUCH COURTS AND WAIVES ANY RIGHT IT MAY OTHERWISE HAVE TO CHALLENGE THE APPROPRIATENESS OF SUCH FORUMS.
14 changes: 13 additions & 1 deletion cumulusci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
minimum_cumulusci_version: "3.36.0"
minimum_cumulusci_version: 3.74.0
project:
name: PMM
package:
Expand Down Expand Up @@ -220,6 +220,11 @@ tasks:
options:
path: unpackaged/config/customer_profiles

github_release:
options:
release_content: |
Check out the [Salesforce Release Notes](https://sfdc.co/bnL4Cb) or [Known Issues](https://issues.salesforce.com/) for details.

flows:
make_community:
steps:
Expand Down Expand Up @@ -429,6 +434,8 @@ flows:
task: update_dependencies
2:
task: install_managed
options:
security_type: NONE
3:
task: deploy_customer_profiles
ui_options:
Expand All @@ -439,6 +446,11 @@ flows:
reports:
name: "Deploy Folder of Unmanaged Reports"

release_production:
steps:
3:
task: None

plans:
install:
slug: install
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
<c:participantAdder onclose="{!c.handleClose}" recordId="{!v.recordId}" />
<aura:html tag="style">
.cuf-content { padding: 0 0rem !important; } .slds-p-around--medium { padding:
0rem !important; } .slds-modal__content{ height:unset !important; max-height:unset
!important; } .slds-modal__container{ width: 80% !important; max-width: 80% !important; }
0rem !important; } .quick-actions-panel .slds-modal__content{ height:unset
!important; max-height:unset !important; } .slds-modal__container{ width: 80%
!important; max-width: 80% !important; }
</aura:html>
</aura:component>
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
</div>
<aura:html tag="style">
.cuf-content { padding: 0 0rem !important; } .slds-p-around--medium { padding:
0rem !important; } .slds-modal__content{ height:unset !important; max-height:unset
!important; } .slds-modal__container{ width: 80% !important; max-width: 80%
!important; }
0rem !important; } .quick-actions-panel .slds-modal__content{ height:unset
!important; max-height:unset !important; } .slds-modal__container{ width: 80%
!important; max-width: 80% !important; }
</aura:html>
</aura:component>
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
.slds-accordion__list-item { border-top: none; }
.slds-table_header-fixed_container { overflow-x: hidden; } .cuf-content { padding:
0 0rem !important; } .slds-p-around--medium { padding: 0rem !important; }
.slds-modal__content{ height:unset !important; max-height:unset !important; }
.slds-modal__container{ width: 80% !important; max-width: 80% !important; }
</aura:html>
<c:serviceScheduleCreatorWrapper
serviceId="{!v.serviceId}"
Expand Down
140 changes: 131 additions & 9 deletions force-app/main/default/classes/ProgramEngagementSelector.cls
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,49 @@
return new List<ProgramEngagement__c>();
}

List<ProgramEngagement__c> queriedEngagements = [
SELECT Id, Name, Program__c, Program__r.Name
SELECT Id, Name, Program__c, Program__r.Name, Stage__c
FROM ProgramEngagement__c
WHERE Contact__c = :contactId
];

Check warning on line 28 in force-app/main/default/classes/ProgramEngagementSelector.cls

View check run for this annotation

AST-SCANNER-APP / FastSAST

Vulnerability found with Rule : base.apex.authorization.soql-missing-security-check .

Description : SOQL SELECT query is missing a user security directive. Apex generally runs in system context. This means that the current users permissions and field-level security are not taken into account during code execution. This may grant the caller unauthorized access to entity data. Use the WITH USER_MODE clause to enable field- and object-level security permissions when running SOQL SELECT queries in Apex code. Suggested Remediation : Add a WITH USER_MODE directive to all SOQL SELECT queries in Apex. Triage Id : "force-app/main/default/classes/ProgramEngagementSelector.cls:3013aa22966ec4f2f5389d25c252f66cda5481d51c9f7bd9176641618b7ae38c"
Raw output
false_positive:
  - id: force-app/main/default/classes/ProgramEngagementSelector.cls:3013aa22966ec4f2f5389d25c252f66cda5481d51c9f7bd9176641618b7ae38c
    justification: <Enter your justification for false positive here>
not_exploitable: []

queriedEngagements.sort();
return Security.stripInaccessible(AccessType.READABLE, queriedEngagements)
.getRecords();
}

public ProgramEngagement__c getProgramEngagementById(Id peId) {
if (
!(Schema.SObjectType.ProgramEngagement__c.isAccessible() &&
PermissionValidator.getInstance()
.hasFieldReadAccess(ProgramEngagement__c.Contact__c.getDescribe()) &&
PermissionValidator.getInstance()
.hasFieldReadAccess(ProgramEngagement__c.Program__c.getDescribe()))
) {
return null;
}

List<ProgramEngagement__c> queriedEngagements = [
SELECT
Id,
Name,
Program__c,
Program__r.Name,
ProgramCohort__c,
Stage__c,
Contact__c,
Contact__r.Name,
Contact__r.Email
FROM ProgramEngagement__c
WHERE Id = :peId
];

Check warning on line 58 in force-app/main/default/classes/ProgramEngagementSelector.cls

View check run for this annotation

AST-SCANNER-APP / FastSAST

Vulnerability found with Rule : base.apex.authorization.soql-missing-security-check .

Description : SOQL SELECT query is missing a user security directive. Apex generally runs in system context. This means that the current users permissions and field-level security are not taken into account during code execution. This may grant the caller unauthorized access to entity data. Use the WITH USER_MODE clause to enable field- and object-level security permissions when running SOQL SELECT queries in Apex code. Suggested Remediation : Add a WITH USER_MODE directive to all SOQL SELECT queries in Apex. Triage Id : "force-app/main/default/classes/ProgramEngagementSelector.cls:1ba0ddfc96ade77de852b91514599cd8be17eea388d37cf9dcb6b085543d825d"
Raw output
false_positive:
  - id: force-app/main/default/classes/ProgramEngagementSelector.cls:1ba0ddfc96ade77de852b91514599cd8be17eea388d37cf9dcb6b085543d825d
    justification: <Enter your justification for false positive here>
not_exploitable: []
List<ProgramEngagement__c> securityResult = Security.stripInaccessible(
AccessType.READABLE,
queriedEngagements
)
.getRecords();
return securityResult.isEmpty() ? null : securityResult[0];
}

// Using strip inaccessible and performing access checks for
// all fields involved in the query. Id, Name must be true if object
// access is true.
Expand All @@ -55,11 +88,11 @@

List<Program__c> programs = Security.stripInaccessible(
AccessType.READABLE,
[
SELECT Id, Name
FROM Program__c
WHERE Id IN (SELECT Program__c FROM Service__c WHERE Id = :serviceId)
]

Check warning on line 95 in force-app/main/default/classes/ProgramEngagementSelector.cls

View check run for this annotation

AST-SCANNER-APP / FastSAST

Vulnerability found with Rule : base.apex.authorization.soql-missing-security-check .

Description : SOQL SELECT query is missing a user security directive. Apex generally runs in system context. This means that the current users permissions and field-level security are not taken into account during code execution. This may grant the caller unauthorized access to entity data. Use the WITH USER_MODE clause to enable field- and object-level security permissions when running SOQL SELECT queries in Apex code. Suggested Remediation : Add a WITH USER_MODE directive to all SOQL SELECT queries in Apex. Triage Id : "force-app/main/default/classes/ProgramEngagementSelector.cls:9576dbefdd41e65fa1e8baff2bd73590fee96a813bdba83042fe436953aa5c75"
Raw output
false_positive:
  - id: force-app/main/default/classes/ProgramEngagementSelector.cls:9576dbefdd41e65fa1e8baff2bd73590fee96a813bdba83042fe436953aa5c75
    justification: <Enter your justification for false positive here>
not_exploitable: []
)
.getRecords();

Expand All @@ -72,8 +105,12 @@
public List<ProgramEngagement__c> getProgramEngagementsByProgramId(
Id programId,
Set<String> fields,
Set<String> stages
Set<String> stages,
String searchText,
Id cohortId
) {
final Integer LIMIT_TO = 1000;

if (
!(Schema.SObjectType.ProgramEngagement__c.isAccessible() &&
PermissionValidator.getInstance()
Expand All @@ -84,8 +121,9 @@
return new List<ProgramEngagement__c>();
}

Integer limitTo =
System.Limits.getLimitQueryRows() - System.Limits.getQueryRows();
String programEngagementName = Schema.SObjectType.ProgramEngagement__c.getName();
List<ProgramEngagement__c> programEngagements;
Set<Id> targetIds;

queryBuilder
.reset()
Expand All @@ -95,13 +133,97 @@
String.valueOf(ProgramEngagement__c.Program__c) + ' = :programId'
)
.addCondition(String.valueOf(ProgramEngagement__c.Stage__c) + ' IN :stages')
.withLimit(limitTo);
.withLimit(LIMIT_TO);
if (cohortId != null) {
queryBuilder.addCondition(
String.valueOf(ProgramEngagement__c.ProgramCohort__c) + ' = :cohortId'
);
}
if (!String.isBlank(searchText)) {
targetIds = getEngagementIdsBySearchTerm(
searchText,
fields,
programId,
stages,
cohortId
);
queryBuilder.addCondition(
String.valueOf(ProgramEngagement__c.Id) + ' IN :targetIds'
);
}

List<ProgramEngagement__c> programEngagements = Database.query(
queryBuilder.buildSoqlQuery()
);
programEngagements = Database.query(queryBuilder.buildSoqlQuery());

return Security.stripInaccessible(AccessType.READABLE, programEngagements)
.getRecords();
}

private Set<Id> getEngagementIdsBySearchTerm(
String searchText,
Set<String> fields,
Id programId,
Set<String> stages,
Id cohortId
) {
final Integer SEARCH_LIMIT = 1000;
searchText = String.escapeSingleQuotes(searchText);

String peSearchString = 'FIND :searchText IN ALL FIELDS RETURNING {0}({1} {2} LIMIT :SEARCH_LIMIT)';
String whereClause =
' WHERE ' +
String.valueOf(ProgramEngagement__c.Program__c) +
' = :programId' +
' AND ' +
String.valueOf(ProgramEngagement__c.Stage__c) +
' IN :stages ';
if (cohortId != null) {
whereClause +=
' AND ' +
String.valueOf(ProgramEngagement__c.ProgramCohort__c) +
' =: cohortId ';
}

String queryString = String.format(
peSearchString,
new List<String>{
Schema.SObjectType.ProgramEngagement__c.getName(),
String.join(new List<String>(fields), ', '),
whereClause
}
);

List<List<SObject>> engagementResult = Search.query(queryString);
List<List<SObject>> contactResult = [
FIND :searchText
IN ALL FIELDS
RETURNING Contact(FirstName, LastName, Email LIMIT :SEARCH_LIMIT)
];

return getEngagementIdsFromSOSLResult(
programId,
engagementResult[0],
contactResult[0]
);
}

private Set<Id> getEngagementIdsFromSOSLResult(
Id programId,
List<ProgramEngagement__c> engagements,
List<Contact> contacts
) {
Set<Id> resultIds = new Set<Id>();
resultIds.addAll((new Map<Id, SObject>(engagements)).keySet());

Set<Id> contactIds = (new Map<Id, SObject>(contacts)).keySet();

for (ProgramEngagement__c engagement : [
SELECT Id
FROM ProgramEngagement__c
WHERE Contact__c IN :contactIds AND Program__c = :programId
]) {
resultIds.add(engagement.Id);
}

return resultIds;
}
}
Loading
Loading