Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
- Updated source to API v60.0
- Updated Cage Card Viewer to use https://bwipjs-api.metafloor.com instead for QR Code generation
- Updated Platform Event to be named more specifically to Animal Shelter
- Updated Badge Indicator component to use standard badges and Salesforce colour palette
- Updated Alerts component with icons and also self sorts by severity with High at the top also added platform events to this component.
- Image component on page has had CSS fixes applied.
- Added delete flow for platform events linked to Alerts
  • Loading branch information
GeekStewie committed Apr 5, 2024
1 parent 58f7771 commit a71f105
Show file tree
Hide file tree
Showing 92 changed files with 1,353 additions and 1,221 deletions.
2 changes: 1 addition & 1 deletion force-app/main/default/classes/AlertBannerController.cls
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public with sharing class AlertBannerController {

if(Schema.SObjectType.animalshelters__Animal_Alert__c.isAccessible() && Schema.SObjectType.animalshelters__Animal_Alert__c.fields.animalshelters__Alert_Message__c.isAccessible() && Schema.SObjectType.animalshelters__Animal_Alert__c.fields.animalshelters__Start_Date_Time__c.isAccessible() && Schema.SObjectType.animalshelters__Animal_Alert__c.fields.animalshelters__End_Date_Time__c.isAccessible()){

List<animalshelters__Animal_Alert__c> AlertList = [SELECT Id, animalshelters__Alert_Message__c,animalshelters__Start_Date_Time__c FROM animalshelters__Animal_Alert__c WHERE animalshelters__Animal__c = :parentId AND animalshelters__Start_Date_Time__c <= TODAY AND (animalshelters__End_Date_Time__c >= TODAY OR animalshelters__End_Date_Time__c = NULL) WITH SECURITY_ENFORCED LIMIT 20];
List<animalshelters__Animal_Alert__c> AlertList = [SELECT Id, animalshelters__Alert_Message__c,animalshelters__Start_Date_Time__c,animalshelters__End_Date_Time__c,animalshelters__Severity_Level__c,animalshelters__Type__c FROM animalshelters__Animal_Alert__c WHERE animalshelters__Animal__c = :parentId AND animalshelters__Start_Date_Time__c <= TODAY AND (animalshelters__End_Date_Time__c >= TODAY OR animalshelters__End_Date_Time__c = NULL) WITH SECURITY_ENFORCED LIMIT 20];
return AlertList;

}
Expand Down
16 changes: 8 additions & 8 deletions force-app/main/default/classes/AnimalBadgeController.cls
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
**/
public with sharing class AnimalBadgeController {

@AuraEnabled(cacheable=true)
@AuraEnabled(Cacheable=true)
public static Map<String, Boolean> getRelatedBadges(Id animalId) {
Map<String, Boolean> badges = new Map<String, Boolean>{
'Alert' => false,
Expand All @@ -22,24 +22,24 @@ public with sharing class AnimalBadgeController {
};

// Check for Alerts with no end date
if(Schema.sObjectType.animalshelters__Animal_Alert__c.isAccessible() && Schema.sObjectType.animalshelters__Animal_Alert__c.fields.Animalshelters__End_Date_Time__c.isAccessible()) {
if(Schema.SObjectType.animalshelters__Animal_Alert__c.isAccessible() && Schema.SObjectType.animalshelters__Animal_Alert__c.fields.Animalshelters__End_Date_Time__c.isAccessible()) {
List<animalshelters__Animal_Alert__c> alerts = [SELECT Id
FROM animalshelters__Animal_Alert__c
WHERE animalshelters__Animal__c = :animalId
AND animalshelters__End_Date_Time__c = null
AND animalshelters__End_Date_Time__c = NULL
WITH SECURITY_ENFORCED];
// System.debug(alerts);
if(!alerts.isEmpty()) {
badges.put('Alert', true);
}
}

// Check for Condiitons that have no end date
if(Schema.sObjectType.animalshelters__Condition__c.isAccessible() && Schema.sObjectType.animalshelters__Condition__c.fields.Animalshelters__End_Date_Time__c.isAccessible()) {
// Check for Conditions that have no end date
if(Schema.SObjectType.animalshelters__Condition__c.isAccessible() && Schema.SObjectType.animalshelters__Condition__c.fields.Animalshelters__End_Date_Time__c.isAccessible()) {
List<animalshelters__Condition__c> conditions = [SELECT Id
FROM animalshelters__Condition__c
WHERE animalshelters__Animal__c = :animalId
AND animalshelters__End_Date_Time__c = null
AND animalshelters__End_Date_Time__c = NULL
WITH SECURITY_ENFORCED];
// System.debug(conditions);
if(!conditions.isEmpty()) {
Expand All @@ -48,11 +48,11 @@ public with sharing class AnimalBadgeController {
}

// Check for Action Records and RecordTypes
if(Schema.sObjectType.animalshelters__Animal_Action__c.isAccessible() && Schema.sObjectType.animalshelters__Animal_Action__c.fields.animalshelters__Treatment_Type__c.isAccessible() && Schema.sObjectType.animalshelters__Animal_Action__c.fields.animalshelters__Action_Completed__c.isAccessible()) {
if(Schema.SObjectType.animalshelters__Animal_Action__c.isAccessible() && Schema.SObjectType.animalshelters__Animal_Action__c.fields.animalshelters__Treatment_Type__c.isAccessible() && Schema.SObjectType.animalshelters__Animal_Action__c.fields.animalshelters__Action_Completed__c.isAccessible()) {
List<animalshelters__Animal_Action__c> actions = [SELECT Id, RecordType.Name, animalshelters__Treatment_Type__c
FROM animalshelters__Animal_Action__c
WHERE animalshelters__Animal__c = :animalId
AND animalshelters__Action_Completed__c = false
AND animalshelters__Action_Completed__c = FALSE
WITH SECURITY_ENFORCED];
// System.debug(actions);
for(animalshelters__Animal_Action__c action : actions) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ public with sharing class AnimalShelterGetCustomSettings {
throw new AuraHandledException('Error creating default settings: ' + errMsg);
}
}
}
}
2 changes: 1 addition & 1 deletion force-app/main/default/classes/LocationController.cls
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ public with sharing class LocationController {
@AuraEnabled
public String Longitude{get;set;}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<CspTrustedSite xmlns="http://soap.sforce.com/2006/04/metadata">
<canAccessCamera>false</canAccessCamera>
<canAccessMicrophone>false</canAccessMicrophone>
<context>All</context>
<endpointUrl>https://api.chipndoodle.com</endpointUrl>
<isActive>true</isActive>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</componentInstanceProperties>
<componentInstanceProperties>
<name>entityName</name>
<value>animalshelters__Animal__c</value>
<value>Animal__c</value>
</componentInstanceProperties>
<componentInstanceProperties>
<name>filterName</name>
Expand Down
2 changes: 1 addition & 1 deletion force-app/main/default/flows/Adopter_Profile.flow-meta.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<connector>
<targetReference>Call_Auto_match_Subflow</targetReference>
</connector>
<filterFormula>AND( {!$Setup.animalshelters__Animal_Shelter_Settings__c.animalshelters__Enable_Auto_Match__c}=TRUE, {!$Record.Active__c}=TRUE, ISPICKVAL({!$Record.Profile_Approval_Status__c},&apos;Approved&apos;))</filterFormula>
<filterFormula>AND( {!$Setup.Animal_Shelter_Settings__c.Enable_Auto_Match__c}=TRUE, {!$Record.Active__c}=TRUE, ISPICKVAL({!$Record.Profile_Approval_Status__c},&apos;Approved&apos;))</filterFormula>
<object>Adopter_Profile__c</object>
<recordTriggerType>Update</recordTriggerType>
<triggerType>RecordAfterSave</triggerType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,6 @@
<dataType>String</dataType>
<fieldText>Local Vet Details</fieldText>
<fieldType>DropdownBox</fieldType>
<inputsOnNextNavToAssocScrn>UseStoredValues</inputsOnNextNavToAssocScrn>
<isRequired>false</isRequired>
<visibilityRule>
<conditionLogic>and</conditionLogic>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>59.0</apiVersion>
<apiVersion>60.0</apiVersion>
<description>[Animal Shelter] Create adoption record Sub flow</description>
<environments>Default</environments>
<interviewLabel>Adoption - Create Adoption Record SubFlow {!$Flow.CurrentDateTime}</interviewLabel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@
<name>Automatch_On</name>
<conditionLogic>or</conditionLogic>
<conditions>
<leftValueReference>$Setup.animalshelters__Animal_Shelter_Settings__c.animalshelters__Enable_Auto_Match__c</leftValueReference>
<leftValueReference>$Setup.Animal_Shelter_Settings__c.Enable_Auto_Match__c</leftValueReference>
<operator>EqualTo</operator>
<rightValue>
<booleanValue>true</booleanValue>
Expand Down Expand Up @@ -932,7 +932,6 @@
<dataType>String</dataType>
<fieldText>Local Vet Details</fieldText>
<fieldType>DropdownBox</fieldType>
<inputsOnNextNavToAssocScrn>UseStoredValues</inputsOnNextNavToAssocScrn>
<isRequired>false</isRequired>
<visibilityRule>
<conditionLogic>and</conditionLogic>
Expand Down Expand Up @@ -1091,7 +1090,6 @@
<dataType>String</dataType>
<fieldText>Select a Contact</fieldText>
<fieldType>DropdownBox</fieldType>
<inputsOnNextNavToAssocScrn>UseStoredValues</inputsOnNextNavToAssocScrn>
<isRequired>false</isRequired>
</fields>
<showFooter>true</showFooter>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>59.0</apiVersion>
<apiVersion>60.0</apiVersion>
<assignments>
<name>Assign_Task_Status</name>
<label>Assign Task Status</label>
Expand Down Expand Up @@ -43,6 +43,7 @@
<description>[Animal Shelter] - On completion of Animal Action the associated Task is marked as complete, and Animal Action fields are updated</description>
<environments>Default</environments>
<interviewLabel>Animal Action - Close Associated Task {!$Flow.CurrentDateTime}</interviewLabel>
<isTemplate>true</isTemplate>
<label>Animal Action - Close Associated Task</label>
<processMetadataValues>
<name>BuilderType</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<description>[Animal Shelter Starter] - Creates a Platform Event for Badge Update on record create or update</description>
<environments>Default</environments>
<interviewLabel>Animal Action - Create Platform Event {!$Flow.CurrentDateTime}</interviewLabel>
<isTemplate>true</isTemplate>
<label>Animal Action - Create Platform Event</label>
<processMetadataValues>
<name>BuilderType</name>
Expand Down Expand Up @@ -41,7 +42,7 @@
<stringValue>Action</stringValue>
</value>
</inputAssignments>
<object>Badge_Update_Event__e</object>
<object>Animal_Update_Event__e</object>
<storeOutputAutomatically>true</storeOutputAutomatically>
</recordCreates>
<start>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
<targetReference>Create_Action_Task</targetReference>
</connector>
<filterFormula>
{!$Setup.animalshelters__Animal_Shelter_Settings__c.animalshelters__Enable_Animal_Action_Tasks__c}=TRUE</filterFormula>
{!$Setup.Animal_Shelter_Settings__c.Enable_Animal_Action_Tasks__c}=TRUE</filterFormula>
<object>Animal_Action__c</object>
<recordTriggerType>Create</recordTriggerType>
<triggerType>RecordAfterSave</triggerType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,6 @@
<fieldText>When is the first date and time of the action?</fieldText>
<fieldType>InputField</fieldType>
<helpText>&lt;p&gt;Date of first treatment&lt;/p&gt;</helpText>
<inputsOnNextNavToAssocScrn>UseStoredValues</inputsOnNextNavToAssocScrn>
<isRequired>true</isRequired>
</fields>
<inputParameters>
Expand All @@ -521,7 +520,6 @@
<defaultSelectedChoiceReference>Day_Choice</defaultSelectedChoiceReference>
<fieldText>How often will this action need to be completed?</fieldText>
<fieldType>DropdownBox</fieldType>
<inputsOnNextNavToAssocScrn>UseStoredValues</inputsOnNextNavToAssocScrn>
<isRequired>true</isRequired>
</fields>
<fields>
Expand All @@ -533,7 +531,6 @@
<fieldText>For how long?</fieldText>
<fieldType>InputField</fieldType>
<helpText>&lt;p&gt;Once you have set the recurrence (e.g. to Daily), how many days will the schedule run for (e.g. 6 would be 6 days)? &lt;/p&gt;</helpText>
<inputsOnNextNavToAssocScrn>UseStoredValues</inputsOnNextNavToAssocScrn>
<isRequired>true</isRequired>
<scale>0</scale>
</fields>
Expand Down Expand Up @@ -561,15 +558,13 @@
<dataType>String</dataType>
<fieldText>Select the type of action for the animal:</fieldText>
<fieldType>RadioButtons</fieldType>
<inputsOnNextNavToAssocScrn>UseStoredValues</inputsOnNextNavToAssocScrn>
<isRequired>true</isRequired>
</fields>
<fields>
<name>Action_Description</name>
<fieldText>Provide a description for this action:</fieldText>
<fieldType>LargeTextArea</fieldType>
<helpText>&lt;p&gt;Provide specifics for this action, so that other people know what to do in order to complete this action for the animal.&lt;/p&gt;</helpText>
<inputsOnNextNavToAssocScrn>UseStoredValues</inputsOnNextNavToAssocScrn>
<isRequired>true</isRequired>
</fields>
<showFooter>true</showFooter>
Expand Down Expand Up @@ -602,7 +597,6 @@
<dataType>String</dataType>
<fieldText>Treatment Type</fieldText>
<fieldType>DropdownBox</fieldType>
<inputsOnNextNavToAssocScrn>UseStoredValues</inputsOnNextNavToAssocScrn>
<isRequired>true</isRequired>
</fields>
<fields>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@
</defaultValue>
<fieldText>Type</fieldText>
<fieldType>InputField</fieldType>
<inputsOnNextNavToAssocScrn>UseStoredValues</inputsOnNextNavToAssocScrn>
<isRequired>false</isRequired>
</fields>
<fields>
Expand All @@ -235,7 +234,6 @@
</defaultValue>
<fieldText>Species</fieldText>
<fieldType>InputField</fieldType>
<inputsOnNextNavToAssocScrn>UseStoredValues</inputsOnNextNavToAssocScrn>
<isRequired>false</isRequired>
</fields>
<inputParameters>
Expand All @@ -257,7 +255,6 @@
</defaultValue>
<fieldText>Age Category</fieldText>
<fieldType>InputField</fieldType>
<inputsOnNextNavToAssocScrn>UseStoredValues</inputsOnNextNavToAssocScrn>
<isRequired>false</isRequired>
</fields>
<fields>
Expand Down Expand Up @@ -291,7 +288,6 @@
</defaultValue>
<fieldText>Safe Garden</fieldText>
<fieldType>InputField</fieldType>
<inputsOnNextNavToAssocScrn>UseStoredValues</inputsOnNextNavToAssocScrn>
<isRequired>true</isRequired>
</fields>
<fields>
Expand All @@ -302,7 +298,6 @@
</defaultValue>
<fieldText>No Children</fieldText>
<fieldType>InputField</fieldType>
<inputsOnNextNavToAssocScrn>UseStoredValues</inputsOnNextNavToAssocScrn>
<isRequired>true</isRequired>
</fields>
<fields>
Expand All @@ -313,7 +308,6 @@
</defaultValue>
<fieldText>Special Care Required</fieldText>
<fieldType>InputField</fieldType>
<inputsOnNextNavToAssocScrn>UseStoredValues</inputsOnNextNavToAssocScrn>
<isRequired>true</isRequired>
</fields>
<fields>
Expand All @@ -324,7 +318,6 @@
</defaultValue>
<fieldText>No animal of same species</fieldText>
<fieldType>InputField</fieldType>
<inputsOnNextNavToAssocScrn>UseStoredValues</inputsOnNextNavToAssocScrn>
<isRequired>true</isRequired>
</fields>
<fields>
Expand All @@ -335,7 +328,6 @@
</defaultValue>
<fieldText>No animal of different species</fieldText>
<fieldType>InputField</fieldType>
<inputsOnNextNavToAssocScrn>UseStoredValues</inputsOnNextNavToAssocScrn>
<isRequired>true</isRequired>
</fields>
<inputParameters>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>59.0</apiVersion>
<apiVersion>60.0</apiVersion>
<description>On Adoption Status = Adopted, Update Contact Flag, Clear current and create new Movement record, update Animal status</description>
<environments>Default</environments>
<interviewLabel>Animal - Adoption Update Automation</interviewLabel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<description>[Animal Shelters Starter] - Creates a Platform Event for Badge Update when Alert records are Created or Updated</description>
<environments>Default</environments>
<interviewLabel>Animal Alert - Create Platform Event {!$Flow.CurrentDateTime}</interviewLabel>
<isTemplate>true</isTemplate>
<label>Animal Alert - Create Platform Event</label>
<processMetadataValues>
<name>BuilderType</name>
Expand Down Expand Up @@ -41,7 +42,7 @@
<stringValue>Alert</stringValue>
</value>
</inputAssignments>
<object>Badge_Update_Event__e</object>
<object>Animal_Update_Event__e</object>
<storeOutputAutomatically>true</storeOutputAutomatically>
</recordCreates>
<start>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>59.0</apiVersion>
<apiVersion>60.0</apiVersion>
<description>[Animal Shelter] Trigger on Animal record to replace Process Builder</description>
<environments>Default</environments>
<interviewLabel>Animal - Animal Create/Update Trigger {!$Flow.CurrentDateTime}</interviewLabel>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>59.0</apiVersion>
<apiVersion>60.0</apiVersion>
<assignments>
<name>Update_w3w_field_for_current_record</name>
<label>Update w3w field for current record</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@
<dataType>String</dataType>
<fieldText>Choose an Animal to Release</fieldText>
<fieldType>DropdownBox</fieldType>
<inputsOnNextNavToAssocScrn>UseStoredValues</inputsOnNextNavToAssocScrn>
<isRequired>true</isRequired>
</fields>
<fields>
Expand Down
Loading

0 comments on commit a71f105

Please sign in to comment.