Skip to content

Commit

Permalink
Additional Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
GeekStewie committed Oct 24, 2023
1 parent cba0f87 commit 33d4363
Show file tree
Hide file tree
Showing 10 changed files with 96 additions and 70 deletions.
44 changes: 22 additions & 22 deletions force-app/main/default/aura/AlertBanner/AlertBannerController.js
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
/**
* @File Name : AlertBannerController.js
* @Description :
* @Description :
* @Author : Stewart Anderson (Salesforce.org)
* @Group :
* @Last Modified By : Stewart Anderson (Salesforce.org)
* @Last Modified On : 4/7/2020, 8:57:28 AM
* @Modification Log :
* @Group :
* @Last Modified By : Stewart Anderson
* @Last Modified On : 10-23-2023
* @Modification Log :
* Ver Date Author Modification
* 1.0 4/7/2020 Stewart Anderson (Salesforce.org) Initial Version
**/
({
doInit: function(component, event, helper) {
doInit: function (component, event, helper) {

//Get Animal Alert Records
var action = component.get("c.getRelatedAlertRecords");
action.setParams({
parentId: component.get("v.recordId"),
});
action.setCallback(this, function(response) {

action.setCallback(this, function (response) {

//Handle Response
if (response.getState() === "SUCCESS") {

var AnimalBoxDiv = component.find("AlertBox");
var AnimalAlertList = response.getReturnValue();
component.set("v.intAnimalAlertsSize",AnimalAlertList.length);
if(AnimalAlertList.length > 0){
component.set("v.lstAnimalAlerts",response.getReturnValue());
var AnimalAlertList = response.getReturnValue();
component.set("v.intAnimalAlertsSize", AnimalAlertList.length);

if (AnimalAlertList.length > 0) {
component.set("v.lstAnimalAlerts", response.getReturnValue());
$A.util.removeClass(component.find("AlertBox"), "slds-hide");
$A.util.addClass(component.find("AlertBox"), "AnimalAlertClass");
}
}

}
else if (state == "ERROR") {

//Handle Error
var toastEvent = $A.get("e.force:showToast");
toastEvent.setParams({
"title": "Error!",
"message": "Please contact your administrator, there was an error retrieving animal alerts related to this record."
});
toastEvent.fire();
}
}
});

$A.enqueueAction(action);
}
})
})
Original file line number Diff line number Diff line change
@@ -1,25 +1,32 @@
/**
* @description :
* @author : Stewart Anderson
* @group :
* @last modified on : 10-23-2023
* @last modified by : Stewart Anderson
**/
({
getData : function(cmp) {
getData: function (cmp) {
var action = cmp.get('c.getAnimalActions');
action.setParams({
recId: cmp.get("v.recordId"),
rTypeName: cmp.get("v.recordTypeName")
});
action.setCallback(this, $A.getCallback(function (response){
action.setCallback(this, $A.getCallback(function (response) {
var state = response.getState();
if (state === "SUCCESS") {
//cmp.set("v.mydata", response.getReturnValue());
var records =response.getReturnValue();
records.forEach(function(record){
record.linkName = '/'+record.Id;
if(record.%%%NAMESPACED_ORG%%%Action_Completed__c){
record.showClass = (record.%%%NAMESPACED_ORG%%%Action_Completed__c === true ? 'redcolor' : 'blackcolor');
record.displayIconName = 'utility:check';
}
else{
record.showClass = (record.%%%NAMESPACED_ORG%%%Action_Completed__c === false ? 'blackcolor' : 'redcolor');
record.displayIconName = 'utility:close';
}
var records = response.getReturnValue();
records.forEach(function (record) {
record.linkName = '/' + record.Id;
if (record.%%%NAMESPACED_ORG%%%Action_Completed__c) {
record.showClass = (record.%%%NAMESPACED_ORG%%%Action_Completed__c === true ? 'redcolor' : 'blackcolor');
record.displayIconName = 'utility:check';
}
else {
record.showClass = (record.%%%NAMESPACED_ORG%%%Action_Completed__c === false ? 'blackcolor' : 'redcolor');
record.displayIconName = 'utility:close';
}
});
cmp.set("v.mydata", records);
cmp.set("v.mydataLength", response.getReturnValue().length);
Expand All @@ -29,6 +36,6 @@
}
}));
$A.enqueueAction(action);
}

}
})
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,7 @@
<componentInstance>
<componentInstanceProperties>
<name>lookupFieldName</name>
<value>Animal__c</value>
<value>%%%NAMESPACED_ORG%%%Animal__c</value>
</componentInstanceProperties>
<componentInstanceProperties>
<name>updateQuickActionName</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,14 @@
<componentInstance>
<componentInstanceProperties>
<name>lookupFieldName</name>
<value>Animal_Action__c.Animal__c</value>
<value>%%%NAMESPACED_ORG%%%Animal_Action__c.%%%NAMESPACED_ORG%%%Animal__c</value>
</componentInstanceProperties>
<componentInstanceProperties>
<name>titleFieldName</name>
</componentInstanceProperties>
<componentInstanceProperties>
<name>updateQuickActionName</name>
<value>animalshelters__Animal__c.animalshelters__Update_Animal</value>
<value>Animal__c.Update_Animal</value>
</componentInstanceProperties>
<componentName>console:relatedRecord</componentName>
<identifier>console_relatedRecord</identifier>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,25 @@
<name>actionNames</name>
<valueList>
<valueListItems>
<value>animalshelters__Animal__c.Add_Scheduled_Action</value>
<value>Animal__c.Add_Scheduled_Action</value>
</valueListItems>
<valueListItems>
<value>animalshelters__Animal__c.Complete_Exercise_Action</value>
<value>Animal__c.Complete_Exercise_Action</value>
</valueListItems>
<valueListItems>
<value>animalshelters__Animal__c.Add_Treatment_Action</value>
<value>Animal__c.Add_Treatment_Action</value>
</valueListItems>
<valueListItems>
<value>animalshelters__Animal__c.Add_Condition</value>
<value>Animal__c.Add_Condition</value>
</valueListItems>
<valueListItems>
<value>animalshelters__Animal__c.New_Alert</value>
<value>Animal__c.New_Alert</value>
</valueListItems>
<valueListItems>
<value>animalshelters__Animal__c.Cage_Card</value>
<value>Animal__c.Cage_Card</value>
</valueListItems>
<valueListItems>
<value>animalshelters__Animal__c.Mark_as_Deceased</value>
<value>Animal__c.Mark_as_Deceased</value>
<visibilityRule>
<criteria>
<leftValue>{!Record.Animal_Status__c}</leftValue>
Expand All @@ -35,7 +35,7 @@
</visibilityRule>
</valueListItems>
<valueListItems>
<value>animalshelters__Animal__c.Start_Adoption_Process</value>
<value>Animal__c.Start_Adoption_Process</value>
<visibilityRule>
<criteria>
<leftValue>{!Record.Animal_Status__c}</leftValue>
Expand All @@ -45,7 +45,7 @@
</visibilityRule>
</valueListItems>
<valueListItems>
<value>animalshelters__Animal__c.Create_New_Assessment</value>
<value>Animal__c.Create_New_Assessment</value>
<visibilityRule>
<criteria>
<leftValue>{!Record.Animal_Status__c}</leftValue>
Expand All @@ -55,7 +55,7 @@
</visibilityRule>
</valueListItems>
<valueListItems>
<value>animalshelters__Animal__c.Find_Adoption_Matches</value>
<value>Animal__c.Find_Adoption_Matches</value>
<visibilityRule>
<criteria>
<leftValue>{!Record.Animal_Status__c}</leftValue>
Expand All @@ -65,10 +65,10 @@
</visibilityRule>
</valueListItems>
<valueListItems>
<value>animalshelters__Animal__c.Update_Animal_Location</value>
<value>Animal__c.Update_Animal_Location</value>
</valueListItems>
<valueListItems>
<value>animalshelters__Animal__c.Multi_Animal_Clone</value>
<value>Animal__c.Multi_Animal_Clone</value>
</valueListItems>
<valueListItems>
<value>Global.NewEvent</value>
Expand Down Expand Up @@ -1689,7 +1689,12 @@
</componentInstanceProperties>
<componentInstanceProperties>
<name>richTextValue</name>
<value>&lt;p style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-size: 11px;&quot;&gt;Note: To add actions, use the &lt;/span&gt;&lt;b style=&quot;font-size: 11px;&quot;&gt;Add Scheduled Actions&lt;/b&gt;&lt;span style=&quot;font-size: 11px;&quot;&gt; button above and follow the steps to add Treatments, Exercise Schedules and Nutrition/Diet Plans.&lt;/span&gt;&lt;/p&gt;</value>
<value>&lt;p style=&quot;text-align: center;&quot;&gt;&lt;span
style=&quot;font-size: 11px;&quot;&gt;Note: To add actions, use the
&lt;/span&gt;&lt;b style=&quot;font-size: 11px;&quot;&gt;Add Scheduled
Actions&lt;/b&gt;&lt;span style=&quot;font-size: 11px;&quot;&gt; button
above and follow the steps to add Treatments, Exercise Schedules and
Nutrition/Diet Plans.&lt;/span&gt;&lt;/p&gt;</value>
</componentInstanceProperties>
<componentName>flexipage:richText</componentName>
<identifier>flexipage_richText</identifier>
Expand Down Expand Up @@ -1833,7 +1838,8 @@
<componentInstance>
<componentInstanceProperties>
<name>flowArguments</name>
<value>[{&quot;label&quot;:&quot;recordId&quot;,&quot;dataType&quot;:&quot;SObject&quot;,&quot;supportsRecordId&quot;:true,&quot;value&quot;:&quot;{!Record.Id}&quot;}]</value>
<value>
[{&quot;label&quot;:&quot;recordId&quot;,&quot;dataType&quot;:&quot;SObject&quot;,&quot;supportsRecordId&quot;:true,&quot;value&quot;:&quot;{!Record.Id}&quot;}]</value>
</componentInstanceProperties>
<componentInstanceProperties>
<name>flowLayout</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@
</componentInstanceProperties>
<componentInstanceProperties>
<name>lookupFieldName</name>
<value>Organisation__c</value>
<value>%%%NAMESPACED_ORG%%%Organisation__c</value>
</componentInstanceProperties>
<componentInstanceProperties>
<name>updateQuickActionName</name>
Expand All @@ -210,7 +210,7 @@
</componentInstanceProperties>
<componentInstanceProperties>
<name>lookupFieldName</name>
<value>Foster_Contact__c</value>
<value>%%%NAMESPACED_ORG%%%Foster_Contact__c</value>
</componentInstanceProperties>
<componentInstanceProperties>
<name>titleFieldName</name>
Expand All @@ -235,7 +235,8 @@
<componentInstance>
<componentInstanceProperties>
<name>flowArguments</name>
<value>[{&quot;label&quot;:&quot;LocationId&quot;,&quot;dataType&quot;:&quot;String&quot;,&quot;supportsRecordId&quot;:true,&quot;value&quot;:&quot;{!Record.Id}&quot;}]</value>
<value>
[{&quot;label&quot;:&quot;LocationId&quot;,&quot;dataType&quot;:&quot;String&quot;,&quot;supportsRecordId&quot;:true,&quot;value&quot;:&quot;{!Record.Id}&quot;}]</value>
</componentInstanceProperties>
<componentInstanceProperties>
<name>flowLayout</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
<componentInstance>
<componentInstanceProperties>
<name>flowArguments</name>
<value>[{&quot;label&quot;:&quot;LocationId&quot;,&quot;dataType&quot;:&quot;String&quot;,&quot;supportsRecordId&quot;:true,&quot;value&quot;:&quot;{!Record.Id}&quot;}]</value>
<value>
[{&quot;label&quot;:&quot;LocationId&quot;,&quot;dataType&quot;:&quot;String&quot;,&quot;supportsRecordId&quot;:true,&quot;value&quot;:&quot;{!Record.Id}&quot;}]</value>
</componentInstanceProperties>
<componentInstanceProperties>
<name>flowLayout</name>
Expand Down Expand Up @@ -58,7 +59,7 @@
</componentInstanceProperties>
<componentInstanceProperties>
<name>lookupFieldName</name>
<value>Organisation__c</value>
<value>%%%NAMESPACED_ORG%%%Organisation__c</value>
</componentInstanceProperties>
<componentInstanceProperties>
<name>updateQuickActionName</name>
Expand All @@ -83,7 +84,7 @@
</componentInstanceProperties>
<componentInstanceProperties>
<name>lookupFieldName</name>
<value>Foster_Contact__c</value>
<value>%%%NAMESPACED_ORG%%%Foster_Contact__c</value>
</componentInstanceProperties>
<componentInstanceProperties>
<name>titleFieldName</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
<componentInstance>
<componentInstanceProperties>
<name>lookupFieldName</name>
<value>Animal__c</value>
<value>%%%NAMESPACED_ORG%%%Animal__c</value>
</componentInstanceProperties>
<componentInstanceProperties>
<name>updateQuickActionName</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>58.0</apiVersion>
<decisions>
<description>If the Animal Action record is created as completed, then the task is marked as completed</description>
<description>If the Animal Action record is created as completed, then the task is marked as
completed</description>
<name>Has_Action_Been_Completed</name>
<label>Has Action Been Completed?</label>
<locationX>182</locationX>
Expand All @@ -12,14 +13,14 @@
<name>Action_Completed</name>
<conditionLogic>or</conditionLogic>
<conditions>
<leftValueReference>$Record.%%%NAMESPACED_ORG%%%animalshelters__Action_Completed__c</leftValueReference>
<leftValueReference>$Record.%%%NAMESPACED_ORG%%%Action_Completed__c</leftValueReference>
<operator>EqualTo</operator>
<rightValue>
<booleanValue>true</booleanValue>
</rightValue>
</conditions>
<conditions>
<leftValueReference>$Record.%%%NAMESPACED_ORG%%%animalshelters__Action_Status__c</leftValueReference>
<leftValueReference>$Record.%%%NAMESPACED_ORG%%%Action_Status__c</leftValueReference>
<operator>EqualTo</operator>
<rightValue>
<stringValue>Given</stringValue>
Expand Down Expand Up @@ -108,7 +109,8 @@
<connector>
<targetReference>Create_Action_Task</targetReference>
</connector>
<filterFormula>{!$Setup.%%%NAMESPACED_ORG%%%animalshelters__Animal_Shelter_Settings__c.%%%NAMESPACED_ORG%%%animalshelters__Enable_Animal_Action_Tasks__c}=TRUE</filterFormula>
<filterFormula>
{!$Setup.%%%NAMESPACED_ORG%%%Animal_Shelter_Settings__c.%%%NAMESPACED_ORG%%%Enable_Animal_Action_Tasks__c}=TRUE</filterFormula>
<object>%%%NAMESPACED_ORG%%%Animal_Action__c</object>
<recordTriggerType>Create</recordTriggerType>
<triggerType>RecordAfterSave</triggerType>
Expand Down
Loading

0 comments on commit 33d4363

Please sign in to comment.