Skip to content

Commit

Permalink
Merge pull request #1974 from SalesforceFoundation/feature/242
Browse files Browse the repository at this point in the history
Release 242
  • Loading branch information
jcschultz committed Dec 5, 2022
2 parents 6de46c8 + 6278eb4 commit 7238a0a
Show file tree
Hide file tree
Showing 41 changed files with 154 additions and 302 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The EDA framework, supported by the Salesforce Platform, can serve as the founda

## Get EDA

The easiest way to get started with EDA is to sign up for a <a href="https://www.salesforce.org/trial/eda/" target="_blank">trial</a>. If you need to install EDA in an existing Salesforce org, use the <a href="https://install.salesforce.org/products/eda" target="_blank">EDA Installer</a>. See <a href="https://powerofus.force.com/s/article/EDA-Install-and-Configure" target="_blank">Install EDA</a> for more information.
The easiest way to get started with EDA is to sign up for a <a href="https://www.salesforce.org/trial/eda/" target="_blank">trial</a>. If you need to install EDA in an existing Salesforce org, use the <a href="https://install.salesforce.org/products/eda" target="_blank">EDA Installer</a>.

## Contribute to EDA

Expand Down Expand Up @@ -42,12 +42,12 @@ Make sure `yarn` is installed on your local machine. For more information, check

* <a href="https://trailhead.salesforce.com/trailblazer-community/groups/0F94S000000kHi4SAE" target="_blank">Ask questions or get help</a>
* <a href="https://ideas.salesforce.com/s/search?filter=Education#t=All&sort=relevancy&f:@sfcategoryfull=[Education%7CEducation%20Data%20Architecture]" target="_blank">Feature Request</a>
* <a href="https://powerofus.force.com/EDA-Documentation" target="_blank">User Documentation</a>
* Check out existing <a href="https://github.com/SalesforceFoundation/EDA/labels/bug" target="_blank">bugs</a> and <a href="https://trailblazer.salesforce.com/ideaSearch?filter=Education+%3E+Education+Data+Architecture" target="_blank">feature and enhancement requests</a>
* <a href="https://github.com/SalesforceFoundation/EDA/releases" target="_blank">Release Notes and Beta Releases</a>
* Learn about EDA objects and fields, see <a href="https://powerofus.force.com/EDA_Data_Dictionary" target="_blank">EDA Data Dictionary</a>.

## Meta

The Education Data Architecture technology (“EDA”) is an open-source package licensed by Salesforce.org (“SFDO”) under the BSD-3 Clause License, found at https://opensource.org/licenses/BSD-3-Clause. ANY MASTER SUBSCRIPTION AGREEMENT YOU OR YOUR ENTITY MAY HAVE WITH SFDO DOES NOT APPLY TO YOUR USE OF EDA. EDA IS PROVIDED “AS IS” AND AS AVAILABLE, AND SFDO MAKES NO WARRANTY OF ANY KIND REGARDING EDA, WHETHER EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, FREEDOM FROM DEFECTS OR NON-INFRINGEMENT, TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW.
SFDO WILL HAVE NO LIABILITY ARISING OUT OF OR RELATED TO YOUR USE OF EDA 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. SFDO DISCLAIMS ALL LIABILITY AND INDEMNIFICATION OBLIGATIONS FOR ANY HARM OR DAMAGES CAUSED BY ANY THIRD-PARTY HOSTING PROVIDERS.
SFDO WILL HAVE NO LIABILITY ARISING OUT OF OR RELATED TO YOUR USE OF EDA 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. SFDO DISCLAIMS ALL LIABILITY AND INDEMNIFICATION OBLIGATIONS FOR ANY HARM OR DAMAGES CAUSED BY ANY THIRD-PARTY HOSTING PROVIDERS.

(Release 242)
6 changes: 0 additions & 6 deletions force-app/main/default/aura/STG_CMP_Affl/STG_CMP_Affl.cmp
Original file line number Diff line number Diff line change
Expand Up @@ -361,12 +361,6 @@
<div aura:id="mappingsTabContent" class="slds-tabs__content" role="tabpanel">
<div class="slds-col slds-size--1-of-1 slds-m-bottom--medium">
<ui:outputText value="{!$Label.c.AfflMappingsDescription + ' '}" class="slds-text-body--small" />
<ui:outputURL
value="https://powerofus.force.com/EDA-Create-Accounts-and-Affiliations"
class="slds-text-body--small slds-type-focus"
label="EDA documentation."
target="_blank"
/>
</div>
<div class="slds-grid slds-wrap">
<div class="slds-col slds-size--1-of-6">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
createDescription: function (event, component) {
var description = $A.get("$Label.c.stgEDASettingsHasMovedDesc");
var tellMeMore = $A.get("$Label.c.stgTellMeMoreLink");
const edaDocumentation = '<a href="https://powerofus.force.com/EDA-Education-Cloud-Settings">';

component.set("v.settingsMovedDesc", description + " " + edaDocumentation + tellMeMore + "</a>");
component.set("v.settingsMovedDesc", description + "</a>");
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ public class ACCT_IndividualAccounts_TDTM extends TDTM_Runnable {
private void handleInsertProcessing(HandleInsertWrapperLogic insertWrapper, List<Contact> contactsNeedAccounts) {
DmlWrapper dmlWrapper = new DmlWrapper();

if (triggerAction == TDTM_Runnable.Action.AfterInsert) {
if (triggerAction == TDTM_Runnable.Action.AfterInsert && insertWrapper != null) {
//Creates new Account
if (contactsNeedAccounts.size() > 0) {
UTIL_Debug.debug('****Number of Contacts that need Accounts created: ' + contactsNeedAccounts.size());
Expand Down Expand Up @@ -497,7 +497,7 @@ public class ACCT_IndividualAccounts_TDTM extends TDTM_Runnable {
Map<Id, sObject> idToSObjectTobeUpdated = new Map<Id, sObject>();
List<sObject> duplicateOccurence = new List<sObject>();

if (triggerAction == TDTM_Runnable.Action.AfterUpdate) {
if (triggerAction == TDTM_Runnable.Action.AfterUpdate && updateWrapper != null) {
//Creates new Account
if (contactsNeedAccounts.size() > 0) {
UTIL_Debug.debug('****Number of Contacts that need Accounts created: ' + contactsNeedAccounts.size());
Expand Down
47 changes: 47 additions & 0 deletions force-app/main/default/classes/ACCT_IndividualAccounts_TEST.cls
Original file line number Diff line number Diff line change
Expand Up @@ -3133,4 +3133,51 @@ private class ACCT_IndividualAccounts_TEST {

System.assertEquals('test 0 Administrative Account', accAfterUpdate.Name);
}

@isTest
public static void filterInsertWithNoRecords() {
List<TDTM_Global_API.TdtmToken> tokens = TDTM_Global_API.getTdtmConfig();
TDTM_Global_API.setTdtmConfig(tokens);

//Creating filter condition
Trigger_Handler__c handler = [select Filter_Field__c from Trigger_Handler__c where Class__c = 'ACCT_IndividualAccounts_TDTM'];
handler.Filter_Field__c = 'Deceased__c';
handler.Filter_Value__c = 'true';
update handler;

Test.startTest();

Contact deceasedContact = new Contact(LastName='Deceased', Deceased__c = true);
insert deceasedContact;
Contact theContact = [select Deceased__c from Contact where id = :deceasedContact.Id];
System.assertEquals(theContact.Deceased__c, true);

Test.stopTest();

}

@isTest
public static void filterUpdateWithNoRecords() {
List<TDTM_Global_API.TdtmToken> tokens = TDTM_Global_API.getTdtmConfig();
TDTM_Global_API.setTdtmConfig(tokens);

Contact deceasedContact = new Contact(LastName='Deceased', Deceased__c = false);
insert deceasedContact;

//Creating filter condition
Trigger_Handler__c handler = [select Filter_Field__c from Trigger_Handler__c where Class__c = 'ACCT_IndividualAccounts_TDTM'];
handler.Filter_Field__c = 'Deceased__c';
handler.Filter_Value__c = 'true';
update handler;

Test.startTest();

deceasedContact.Deceased__c = true;
update deceasedContact;
Contact theContact = [select Deceased__c from Contact where id = :deceasedContact.Id];
System.assertEquals(theContact.Deceased__c, true);

Test.stopTest();

}
}
33 changes: 32 additions & 1 deletion force-app/main/default/classes/AFFL_MultiRecordTypeMapper.cls
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ public virtual with sharing class AFFL_MultiRecordTypeMapper {
********************************************************************************************************/
public Map<String, String> accRecTypeLabelToAPI;

/*******************************************************************************************************
* @description Map of Account Record Type Labels in English to User Language Label
********************************************************************************************************/
private Map<String, String> accRecTypeEnglishToTranslation;

/*******************************************************************************************************
* @description Constructor that initializes class properties.
********************************************************************************************************/
Expand All @@ -99,6 +104,9 @@ public virtual with sharing class AFFL_MultiRecordTypeMapper {
//NOTE: Consider a refactor relative to case sensitivity
this.accRecTypeLabelToAPI = this.getAccRecTypeLabelToAPIMap();

// Map of Account RecordType English label to Translated Label
this.accRecTypeEnglishToTranslation = this.getAccRecTypeEnglishLabelToTranslation();

//Note: Given the supportable number of records for affiliation mappings, having multiple small loops
//is an acceptable and negligible performance hit so we can apply a separation of concerns for future refactoring.

Expand Down Expand Up @@ -163,6 +171,23 @@ public virtual with sharing class AFFL_MultiRecordTypeMapper {
return labelsnames;
}

/**
* @description Returns a map of the English label to the current running user's language
*/
@TestVisible
private Map<String, String> getAccRecTypeEnglishLabelToTranslation() {
Map<String, String> labels = new Map<String, String>();

for (String englishLabel : accRecTypeLabelToAPI.keySet()) {
labels.put(
englishLabel,
accountRecordTypeInfosByDeveloperName.get(accRecTypeLabelToAPI.get(englishLabel)).getName()
);
}

return labels;
}

/**
* @description Gets affiliation mappings that have a populated Account Record Type field and a populated Primary Affiliation Field
* @return The List of affiliation mappings that do not have a blank Account Record Type or a blank Primary Affiliation Field
Expand Down Expand Up @@ -329,8 +354,14 @@ public virtual with sharing class AFFL_MultiRecordTypeMapper {
return false;
}

// we need to use the "english to translation" map since Affiliation_Type__c is a formula field
// and formula fields aren't translated into the running user's language.
if (!accRecTypeEnglishToTranslation.containsKey(affiliation.Affiliation_Type__c)) {
return false;
}

Affl_Mappings__c affiliationMapping = primaryAffiliationMappingsByAccountRecordTypeName.get(
affiliation.Affiliation_Type__c
accRecTypeEnglishToTranslation.get(affiliation.Affiliation_Type__c)
);

if (affiliationMapping?.Auto_Program_Enrollment__c != true) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import stgHHAccountCustomNameHelp from "@salesforce/label/c.stgHHAccountCustomNa
import automaticHHNaming from "@salesforce/label/c.automaticHHNaming";
import automaticHHNamingHelpText from "@salesforce/label/c.automaticHHNamingHelpText";
import acctNamingOther from "@salesforce/label/c.acctNamingOther";
import stgTellMeMoreLink from "@salesforce/label/c.stgTellMeMoreLink";

const DELAY_INTERVAL = 500; // 0.5 second delay

Expand Down Expand Up @@ -88,14 +87,8 @@ export default class AccountModelSettings extends LightningElement {
hhAutomaticAccountNamingTitle: automaticHHNaming,
hhAutomaticAccountNamingDescription: automaticHHNamingHelpText,
accountNamingComboboxCustomOption: acctNamingOther,
tellMeMoreLink: stgTellMeMoreLink,
};

accNamingHyperLink =
'<a href="https://powerofus.force.com/EDA-Customize-Admin-and-HH-Acct-Names">' +
this.labelReference.tellMeMoreLink +
"</a>";

inputAttributeReference = {
defaultAccountModelComboboxId: "defaultAccountModel",
adminAccountModelComboboxId: "adminAccountModel",
Expand Down Expand Up @@ -375,10 +368,10 @@ export default class AccountModelSettings extends LightningElement {
}

get adminAccDesc() {
return this.labelReference.adminAccountNameFormatDescription + " " + this.accNamingHyperLink;
return this.labelReference.adminAccountNameFormatDescription;
}

get hhAccDesc() {
return this.labelReference.hhAccountNameFormatDescription + " " + this.accNamingHyperLink;
return this.labelReference.hhAccountNameFormatDescription;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,6 @@ export default class affiliationSettings extends LightningElement {
successToast: stgSuccess,
};

affiliationsHyperLink =
'<a href="https://powerofus.force.com/EDA-Configure-Affiliations-Settings">' +
this.labelReference.tellMeMoreLink +
"</a>";

inputAttributeReference = {
recordTypeValidation: "recordTypeValidation",
affiliationMappings: "affiliationMappings",
Expand Down Expand Up @@ -294,10 +289,6 @@ export default class affiliationSettings extends LightningElement {
}

get affiliationsDesc() {
return (
this.labelReference.primaryAffiliationMappingsTable.primaryAffiliationsDescription +
" " +
this.affiliationsHyperLink
);
return this.labelReference.primaryAffiliationMappingsTable.primaryAffiliationsDescription;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,10 @@ export default class autoEnrollmentMappingModalBody extends LightningElement {
autoProgramEnrollmentRole: "autoProgramEnrollmentRole",
};

connectedCallback(){
getAccountRecordTypeComboboxVModel({ accountRecordType: this.newAccountRecordType })
.then((result) => {
connectedCallback() {
getAccountRecordTypeComboboxVModel({ accountRecordType: this.newAccountRecordType }).then((result) => {
this.accountRecordTypeComboboxVModel = result;
})
});
}

@wire(getAutoEnrollmentMappingStatusComboboxVModel, {
Expand Down Expand Up @@ -141,10 +140,10 @@ export default class autoEnrollmentMappingModalBody extends LightningElement {
get autoEnrollmentMappingModalDesc() {
switch (this.actionName) {
case "edit":
return this.labelReference.modalBodyEdit + " " + this.autoEnrollmentHyperLink;
return this.labelReference.modalBodyEdit;

case "create":
return this.labelReference.modalBodyCreate + " " + this.autoEnrollmentHyperLink;
return this.labelReference.modalBodyCreate;

case "delete":
return this.labelReference.modalBodyDelete
Expand All @@ -162,14 +161,6 @@ export default class autoEnrollmentMappingModalBody extends LightningElement {
return this.actionName === "delete";
}

get autoEnrollmentHyperLink() {
return (
'<a href="https://powerofus.force.com/EDA-Configure-Affiliations-Settings">' +
this.labelReference.tellMeMoreLink +
"</a>"
);
}

get accountRecordTypeApiNameLabel() {
return this.labelReference.apiNameDisplay.replace("{0}", this.accountRecordTypeComboboxVModel.value);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ export default class PrimaryAffiliationsModalBody extends LightningElement {
modalBodyCreate: stgAffiliationsNewModalBody,
};

affiliationsHyperLink =
'<a href="https://powerofus.force.com/EDA-Configure-Affiliations-Settings">' +
this.labelReference.tellMeMoreLink +
"</a>";

inputAttributeReference = {
accountRecordType: "primaryAffiliationsAccountRecordType",
contactField: "primaryAffiliationsContactField",
Expand Down Expand Up @@ -128,10 +123,10 @@ export default class PrimaryAffiliationsModalBody extends LightningElement {
get affiliationsDesc() {
switch (this.affiliationsAction) {
case "edit":
return this.labelReference.modalBodyEditSave + " " + this.affiliationsHyperLink;
return this.labelReference.modalBodyEditSave;

case "create":
return this.labelReference.modalBodyCreate + " " + this.affiliationsHyperLink;
return this.labelReference.modalBodyCreate;
}
}

Expand Down
17 changes: 1 addition & 16 deletions force-app/main/default/lwc/programSettings/programSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ import stgErrorNewAutoEnrollment from "@salesforce/label/c.stgErrorNewAutoEnroll
import stgTellMeMoreLink from "@salesforce/label/c.stgTellMeMoreLink";
import stgSuccess from "@salesforce/label/c.stgSuccess";

const autoEnrollmentURL = "https://powerofus.force.com/EDA-Configure-Affiliations-Settings";
export default class programSettings extends LightningElement {
isEditMode = false;
affordancesDisabledToggle = false;
Expand Down Expand Up @@ -330,22 +329,8 @@ export default class programSettings extends LightningElement {
});
}

get autoEnrollmentHyperLink() {
return (
'<a href="' +
autoEnrollmentURL +
'">' +
this.labelReference.autoEnrollmentMappingsTable.tellMeMoreLink +
"</a>"
);
}

get autoEnrollmentMappingsDescriptionRichText() {
return (
this.labelReference.autoEnrollmentMappingsTable.autoEnrollmentMappingsDescription +
" " +
this.autoEnrollmentHyperLink
);
return this.labelReference.autoEnrollmentMappingsTable.autoEnrollmentMappingsDescription;
}

handleNewAutoEnrollmentMappingClick(event) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ import stgReciprocalRelNewSuccess from "@salesforce/label/c.stgReciprocalRelNewS
import stgReciprocalRelDeleteSuccess from "@salesforce/label/c.stgReciprocalRelDeleteSuccess";
import stgSuccess from "@salesforce/label/c.stgSuccess";

// Articles
const relationshipsArticle = '<a href="https://powerofus.force.com/EDA-Config-Relationships-Settings">';
export default class relationshipSettings extends LightningElement {
isEditMode = false;
affordancesDisabledToggle = false;
Expand Down Expand Up @@ -78,16 +76,12 @@ export default class relationshipSettings extends LightningElement {
allowAutoCreatedDuplicatesId: "allowAutoCreatedDuplicates",
};

get relationshipSettingsHyperLink() {
return relationshipsArticle + this.labelReference.tellMeMore + "</a>";
}

get relationshipSettingsDesc() {
return this.labelReference.reciprocalMethodSettingsDesc + " " + this.relationshipSettingsHyperLink;
return this.labelReference.reciprocalMethodSettingsDesc;
}

get duplicateRelationshipDesc() {
return this.labelReference.duplicateRelationshipDesc + " " + this.relationshipSettingsHyperLink;
return this.labelReference.duplicateRelationshipDesc;
}

get affordancesDisabled() {
Expand Down

0 comments on commit 7238a0a

Please sign in to comment.