Skip to content

Commit

Permalink
Merge 3c532e3 into feature/npc-anchor-sku-trial-org-metadata-tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
salesforce-org-metaci[bot] authored Jul 6, 2023
2 parents d09735f + 3c532e3 commit 0437035
Show file tree
Hide file tree
Showing 17 changed files with 90 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ public class BDI_ManageAdvancedMappingCtrl {
*/
@AuraEnabled
public static AdvancedMappingObjectData getAdvancedMappingObjectData () {
if (!isAdminUser(UserInfo.getUserId())) {
throw new AuraHandledException(Label.commonInsufficientPermissions);
}

return new AdvancedMappingObjectData(getObjectMappings(), getObjectOptions());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,8 @@ public with sharing class BGE_DataImportBatchEntry_CTRL {
@AuraEnabled
public static String runBatchDryRun(Id batchId, Integer numberOfRowsToReturn) {
try {
checkFieldPermissions();

Data_Import_Settings__c dataImportSettings = BDI_DataImportService.loadSettings(batchId);

List<DataImport__c> allRawDataImports = getAllDataImportRecordsForDryRunByBatchId(batchId);
Expand Down
9 changes: 9 additions & 0 deletions force-app/main/default/classes/GE_GiftEntryController.cls
Original file line number Diff line number Diff line change
Expand Up @@ -1335,6 +1335,15 @@ public with sharing class GE_GiftEntryController {
}
}

@AuraEnabled
public static Data_Import_Settings__c getDataImportSettings() {
if (!UTIL_Permissions.canRead(UTIL_Namespace.StrTokenNSPrefix('Data_Import_Settings__c'), false)) {
return null;
}

return UTIL_CustomSettingsFacade.getDataImportSettings();
}

private static String retrieveBatchCurrencyIsoCode (Id batchId) {
String query = new UTIL_Query()
.withSelectFields(new Set<String>{UTIL_Currency.CURRENCY_ISO_CODE_FIELD})
Expand Down
6 changes: 5 additions & 1 deletion force-app/main/default/classes/PMT_ValidationService.cls
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,11 @@ public inherited sharing class PMT_ValidationService {
}

private void validateElevatePayments(npe01__OppPayment__c payment, npe01__OppPayment__c oldPayment) {
if (String.isBlank(payment.Elevate_Payment_ID__c) || !config.isIntegrationEnabled() || config.hasIntegrationPermissions()) {
if (String.isBlank(payment.Elevate_Payment_ID__c)
|| String.isBlank(oldPayment.Elevate_Payment_ID__c)
|| !config.isIntegrationEnabled()
|| config.hasIntegrationPermissions()
) {
return;
}

Expand Down
35 changes: 35 additions & 0 deletions force-app/main/default/classes/PMT_ValidationService_TEST.cls
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,41 @@ public with sharing class PMT_ValidationService_TEST {
'Cannot update Elevate payment without integrationPermission');
}

@IsTest
private static void verifyAddingPaymentToElevateWillNotRunValidation() {
npe01__OppPayment__c originalPayment = new npe01__OppPayment__c(
Id = UTIL_UnitTestData_TEST.mockId(npe01__OppPayment__c.SObjectType),
npe01__Payment_Amount__c = 10,
npe01__Paid__c = true
);

npe01__OppPayment__c updatedPayment = originalPayment.clone(true);
updatedPayment.Elevate_Payment_ID__c = 'Random';

PMT_ValidationService validationService = new PMT_ValidationService(
new List<npe01__OppPayment__c>{updatedPayment},
new List<npe01__OppPayment__c>{originalPayment},
TDTM_Runnable.Action.BeforeUpdate
);

validationService.isEnforceAccountingDataConsistency = false;
PS_IntegrationServiceConfig_TEST.Stub configStub = new PS_IntegrationServiceConfig_TEST.Stub()
.withIsIntegrationEnabled(true)
.withHasIntegrationPermissions(false);

PMT_ValidationService.config = (PS_IntegrationServiceConfig) Test.createStub(
PS_IntegrationServiceConfig.class,
configStub
);

Test.startTest();
List<ErrorRecord> errorRecords = validationService.validate().getErrors();
Test.stopTest();

System.assertEquals(0, errorRecords.size(),
'Expecting Elevate validation should not run against newly added Elevate payment.');
}

@IsTest
private static void verifyElevateRefundWillNotBeValidate() {
npe01__OppPayment__c originalPayment = new npe01__OppPayment__c(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,6 @@ public without sharing class UTIL_CustomSettingsFacade {
* settings are defined. The ID field should be checked to determine if the returned record already exists or doesn't exist
* in the database.
*/
@AuraEnabled
public static Data_Import_Settings__c getDataImportSettings() {
if(Test.isRunningTest() && dataImportSettings == null) {
dataImportSettings = new Data_Import_Settings__c();
Expand Down
3 changes: 2 additions & 1 deletion force-app/main/default/classes/UTIL_HtmlOutput_CTRL.cls
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ public with sharing class UTIL_HtmlOutput_CTRL {
'<p' => '|para|',
'<h1' => '|head1|',
'<h2' => '|head2|',
'<h3' => '|head3|'
'<h3' => '|head3|',
'&nbsp;' => '|nonBreakingSpace|'
};

/** @description The map of allowed urls and their temporary substitution values */
Expand Down
11 changes: 10 additions & 1 deletion force-app/main/default/classes/UTIL_SoqlListView_CTRL.cls
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

public with sharing class UTIL_SoqlListView_CTRL {

public UTIL_iSoqlListViewConsumer pageController {
public UTIL_iSoqlListViewConsumer pageController {
get;
set {
if (value != null) {
Expand All @@ -47,6 +47,15 @@ public with sharing class UTIL_SoqlListView_CTRL {
}
}

public String getListViewPageInfo () {
String listViewPageInfo = System.Label.labelListViewPageInfo;
return String.format(listViewPageInfo, new List<Integer>{
setCon.getPageNumber(),
NumberOfPages,
NumberOfItems
});
}

// the set controller allows us to do paging in our pageTable
public ApexPages.StandardSetController setCon {
get {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,12 @@
</g>
</svg>
<div class="slds-text-longform">
<h3 class="slds-text-heading_medium">{!$Label.commonAdminPermissionErrorTitle}</h3>
<p class="slds-text-body_regular">{!$Label.commonPermissionErrorMessage}</p>
<h3 class="slds-text-heading_medium">
<c:UTIL_HtmlOutput html="{!$Label.commonAdminPermissionErrorTitle}" />
</h3>
<p class="slds-text-body_regular">
<c:UTIL_HtmlOutput html="{!$Label.commonPermissionErrorMessage}" />
</p>
</div>
</div>
</apex:component>
4 changes: 2 additions & 2 deletions force-app/main/default/components/UTIL_InputField.component
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
var lkLink = lkSpan.querySelector("a");
lkLink.style.visibility = "";
lkLink.className = "";
lkLink.setAttribute("aria-label", "{!$Label.UTIL_InputFormFormFieldAltLabelLookup} {!$ObjectType[sObjType].fields[field].label}");
lkLink.setAttribute("aria-label", "{!JSENCODE($Label.UTIL_InputFormFormFieldAltLabelLookup)} {!$ObjectType[sObjType].fields[field].label}");
lkLink.innerHTML = "<svg " +
" aria-hidden=\"true\" class=\"slds-icon slds-input__icon slds-icon_x-small slds-icon-text-default\"" +
" viewBox=\"0 0 24 24\">" +
Expand All @@ -58,7 +58,7 @@
var lkLink = lkSpan.querySelector("a");
lkLink.style.visibility = "";
lkLink.className = "";
lkLink.setAttribute("aria-label","{!$Label.UTIL_InputFormFormFieldAltLabelDate} {!$ObjectType[sObjType].fields[field].label}");
lkLink.setAttribute("aria-label", "{!JSENCODE($Label.UTIL_InputFormFormFieldAltLabelDate)} {!$ObjectType[sObjType].fields[field].label}");
lkLink.innerHTML = "<svg " +
" aria-hidden=\"true\" class=\"slds-icon slds-input__icon slds-icon_x-small slds-icon-text-default\" " +
" width=\"52\" height=\"52\" viewBox=\"0 0 52 52\">" +
Expand Down
14 changes: 3 additions & 11 deletions force-app/main/default/components/UTIL_SoqlListView.component
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,8 @@
<apex:outputText rendered="{!setCon.HasNext}" value=" | " />
<apex:commandLink action="{!setCon.last}" rerender="panelData" status="statusLoad" >{!$Label.labelListViewLast}</apex:commandlink>
<apex:outputText value="" />
<apex:outputText value="{!$Label.labelListViewPageInfo}" escape="false" >
<apex:param value="{!setCon.PageNumber}" />
<apex:param value="{!NumberOfPages}" />
<apex:param value="{!NumberOfItems}" />
</apex:outputText>
</apex:panelGrid>
<c:UTIL_HtmlOutput html="{!listViewPageInfo}" />
</apex:panelGrid>
</td>
<td style="vertical-align:middle; text-align:right;" >
<apex:repeat value="{!listAlphaFilters}" var="a" >
Expand Down Expand Up @@ -138,11 +134,7 @@
<apex:outputText rendered="{!setCon.HasNext}" value=" | " />
<apex:commandLink action="{!setCon.last}" rerender="panelData" status="statusLoad" >{!$Label.labelListViewLast}</apex:commandlink>
<apex:outputText value="" />
<apex:outputText value="{!$Label.labelListViewPageInfo}" escape="false" >
<apex:param value="{!setCon.PageNumber}" />
<apex:param value="{!NumberOfPages}" />
<apex:param value="{!NumberOfItems}" />
</apex:outputText>
<c:UTIL_HtmlOutput html="{!listViewPageInfo}" />
<apex:outputText value="" />
<apex:commandLink action="{!showMoreRecordsPerPage}" rerender="panelData" status="statusLoad" >{!$Label.labelShowMore}</apex:commandlink>
</apex:panelGrid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default class GsApplicationStatus extends LightningElement {
@track isApplicationSubmitted = false;
@track isLoading = false;
@track img = "";
@track isActiveInstance = false;
@track isActiveInstance = true;
applyForFreeLicensesImg = Resources + '/gsResources/Accept_Tasks_Apply_Card.png';
checkForStatusImg = Resources + '/gsResources/gift_illustration_2.svg';
Expand Down Expand Up @@ -55,7 +55,8 @@ export default class GsApplicationStatus extends LightningElement {
this.diffInDays = this.calculateTrialRemainingDays(result);
this.isApplicationSubmitted = this.checkApplicationSubmitted(result);
this.img = this.isApplicationSubmitted ? this.checkForStatusImg : this.applyForFreeLicensesImg;
this.isActiveInstance = result.trialExpirationDate == null;
// Disabling this component since it is causing confusion in new Trials and orgs that were converted from Trials
// this.isActiveInstance = result.trialExpirationDate == null;
this.hideSpinner();
this.learnMoreAriaLabel = `${this.labels.gsLearnMore} ${this.labels.opensInNewLink}`;
this.applyForFreeLicensesAriaLabel = `${this.labels.gsApplyForFreeLicenses} ${this.labels.opensInNewLink}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ import ACCOUNT_NAME_INFO from '@salesforce/schema/Account.Name';
import commonError from '@salesforce/label/c.commonError';
import commonUnknownError from '@salesforce/label/c.commonUnknownError';

import getDataImportSettings from '@salesforce/apex/UTIL_CustomSettingsFacade.getDataImportSettings';
import getDataImportSettings from '@salesforce/apex/GE_GiftEntryController.getDataImportSettings';
import getGiftEntrySettings from
'@salesforce/apex/GE_GiftEntryController.getGiftEntrySettings';

Expand Down Expand Up @@ -504,7 +504,7 @@ const setRecordValuesOnTemplate = (templateSections, fieldMappings, record) => {
const getPageAccess = async () => {
const dataImportSettings = await getDataImportSettings();
const giftEntryGateSettings = await getGiftEntrySettings();
const isAdvancedMappingOn =
const isAdvancedMappingOn = dataImportSettings &&
dataImportSettings[FIELD_MAPPING_METHOD_FIELD_INFO.fieldApiName] === ADVANCED_MAPPING;
const isGiftEntryEnabled = giftEntryGateSettings[GIFT_ENTRY_FEATURE_GATE_INFO.fieldApiName];
return isAdvancedMappingOn && isGiftEntryEnabled;
Expand Down
6 changes: 3 additions & 3 deletions force-app/main/default/pages/ALLO_ManageAllocations.page
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@
$Lightning.use("{!namespace}" + ":RD2_EnablementApp", function() {
$Lightning.createComponent("{!namespace}" + ":utilIllustration",
{
title : "{!$Label.commonAdminPermissionErrorTitle}",
message : "{!$Label.commonPermissionErrorMessage}",
title : "{!JSENCODE($Label.commonAdminPermissionErrorTitle)}",
message : "{!JSENCODE($Label.commonPermissionErrorMessage)}",
size: 'small',
variant: 'no-access',
illustrationClass: "slds-p-top_x-large slds-m-top_x-large"
Expand Down Expand Up @@ -194,7 +194,7 @@
<apex:outputPanel rendered="{!isLoading}" >
<div class="spinner slds-spinner_container slds-is-relative slds-m-around_xx-large slds-align_absolute-center" >
<div role="status" class="slds-spinner slds-spinner_medium">
<span class="slds-assistive-text">{!$Label.labelMessageLoading}</span>
<span class="slds-assistive-text">{!JSENCODE($Label.labelMessageLoading)}</span>
<div class="slds-spinner__dot-a"></div>
<div class="slds-spinner__dot-b"></div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion force-app/main/default/pages/CON_ContactMerge.page
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<div class="slds-m-top_medium slds-m-bottom_large slds-p-horizontal_large">
<div class="slds-grid">
<div class="slds-col slds-size_1-of-4">
<apex:outputText escape="false" value="{!$Label.conMergeSearchConText}"/>
<c:UTIL_HtmlOutput html="{!$Label.conMergeSearchConText}"/>
</div>
<div class="slds-col">
<apex:commandButton id="srchByConBtn"
Expand Down
4 changes: 2 additions & 2 deletions force-app/main/default/pages/PMT_PaymentWizard.page
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
$Lightning.use("{!namespace}" + ":RD2_EnablementApp", function() {
$Lightning.createComponent("{!namespace}" + ":utilIllustration",
{
title : "{!$Label.commonAdminPermissionErrorTitle}",
message : "{!$Label.commonPermissionErrorMessage}",
title : "{!JSENCODE($Label.commonAdminPermissionErrorTitle)}",
message : "{!JSENCODE($Label.commonPermissionErrorMessage)}",
size: 'small',
variant: 'no-access',
illustrationClass: "slds-p-top_x-large slds-m-top_x-large"
Expand Down
2 changes: 1 addition & 1 deletion force-app/main/default/pages/STG_PanelRDBatch.page
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<apex:outputPanel>
<div class="slds-text-body_small slds-m-around_medium">
<apex:outputText value="{!pageDescription}" escape="false" />
<c:UTIL_HtmlOutput html="{!pageDescription}" />
</div>
<c:UTIL_PageMessages />
<apex:outputPanel rendered="{!and(isReadOnlyMode, not(isRunningBatch))}">
Expand Down

0 comments on commit 0437035

Please sign in to comment.