Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
GeekStewie committed Apr 5, 2024
1 parent a71f105 commit ad0274b
Show file tree
Hide file tree
Showing 30 changed files with 185 additions and 22 deletions.
2 changes: 1 addition & 1 deletion cumulusci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ project:
package:
name: Animal Shelter Starter
namespace: animalshelters
api_version: "59.0"
api_version: "60.0"
source_format: sfdx
git:
default_branch: master
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
<c:lightningPrintView recordId="{!v.recordid}" fieldSetName="{!v.fieldSetName}" sObjectTypeName="{!v.sObjectTypeName}"
badgefields="{!v.badgefields}" />

</aura:application>
</aura:application>
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 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()) {
// 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()) {
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 @@ -2,4 +2,4 @@
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>59.0</apiVersion>
<status>Active</status>
</ApexClass>
</ApexClass>
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,4 @@ public with sharing class AnimalShelterFieldsetController {
}
return badgeFieldsData;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ private class AnimalShelterFieldsetControllerTest {
System.assertEquals('Anxious', badgeData.get('animalshelters__Behaviours__c')[0], 'The first value should be Anxious');
System.assertEquals('Bad Recall', badgeData.get('animalshelters__Behaviours__c')[1], 'The second value should be Bad Recall');
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?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 @@ -174,8 +174,8 @@
<dashboardType>SpecifiedUser</dashboardType>
<description>Default Dashboard for Animal Shelter Starter</description>
<isGridLayout>true</isGridLayout>
<owner>test-tpvqkbctykbo@example.com</owner>
<runningUser>test-tpvqkbctykbo@example.com</runningUser>
<owner>test-hqdi7iuf2chk@example.com</owner>
<runningUser>test-hqdi7iuf2chk@example.com</runningUser>
<textColor>#000000</textColor>
<title>Animal Shelter Dashboard</title>
<titleColor>#000000</titleColor>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,7 @@
<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
Expand Up @@ -932,6 +932,7 @@
<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 @@ -1090,6 +1091,7 @@
<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
Expand Up @@ -497,6 +497,7 @@
<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 @@ -520,6 +521,7 @@
<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 @@ -531,6 +533,7 @@
<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 @@ -558,13 +561,15 @@
<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 @@ -597,6 +602,7 @@
<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,6 +224,7 @@
</defaultValue>
<fieldText>Type</fieldText>
<fieldType>InputField</fieldType>
<inputsOnNextNavToAssocScrn>UseStoredValues</inputsOnNextNavToAssocScrn>
<isRequired>false</isRequired>
</fields>
<fields>
Expand All @@ -234,6 +235,7 @@
</defaultValue>
<fieldText>Species</fieldText>
<fieldType>InputField</fieldType>
<inputsOnNextNavToAssocScrn>UseStoredValues</inputsOnNextNavToAssocScrn>
<isRequired>false</isRequired>
</fields>
<inputParameters>
Expand All @@ -255,6 +257,7 @@
</defaultValue>
<fieldText>Age Category</fieldText>
<fieldType>InputField</fieldType>
<inputsOnNextNavToAssocScrn>UseStoredValues</inputsOnNextNavToAssocScrn>
<isRequired>false</isRequired>
</fields>
<fields>
Expand Down Expand Up @@ -288,6 +291,7 @@
</defaultValue>
<fieldText>Safe Garden</fieldText>
<fieldType>InputField</fieldType>
<inputsOnNextNavToAssocScrn>UseStoredValues</inputsOnNextNavToAssocScrn>
<isRequired>true</isRequired>
</fields>
<fields>
Expand All @@ -298,6 +302,7 @@
</defaultValue>
<fieldText>No Children</fieldText>
<fieldType>InputField</fieldType>
<inputsOnNextNavToAssocScrn>UseStoredValues</inputsOnNextNavToAssocScrn>
<isRequired>true</isRequired>
</fields>
<fields>
Expand All @@ -308,6 +313,7 @@
</defaultValue>
<fieldText>Special Care Required</fieldText>
<fieldType>InputField</fieldType>
<inputsOnNextNavToAssocScrn>UseStoredValues</inputsOnNextNavToAssocScrn>
<isRequired>true</isRequired>
</fields>
<fields>
Expand All @@ -318,6 +324,7 @@
</defaultValue>
<fieldText>No animal of same species</fieldText>
<fieldType>InputField</fieldType>
<inputsOnNextNavToAssocScrn>UseStoredValues</inputsOnNextNavToAssocScrn>
<isRequired>true</isRequired>
</fields>
<fields>
Expand All @@ -328,6 +335,7 @@
</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
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>60.0</apiVersion>
<description>Create a platform event to show that an alert has been removed.</description>
<environments>Default</environments>
<interviewLabel>Animal Alert - Alert Deleted Event {!$Flow.CurrentDateTime}</interviewLabel>
<isTemplate>true</isTemplate>
<label>Animal Alert - Alert Deleted Event</label>
<processMetadataValues>
<name>BuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>CanvasMode</name>
<value>
<stringValue>AUTO_LAYOUT_CANVAS</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>OriginBuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processType>AutoLaunchedFlow</processType>
<recordCreates>
<name>Animal_Platform_Event</name>
<label>Animal Platform Event</label>
<locationX>176</locationX>
<locationY>287</locationY>
<inputAssignments>
<field>Record_ID__c</field>
<value>
<elementReference>$Record.Animal__r.Id</elementReference>
</value>
</inputAssignments>
<inputAssignments>
<field>Update_Type__c</field>
<value>
<stringValue>AlertDeleted</stringValue>
</value>
</inputAssignments>
<object>Animal_Update_Event__e</object>
<storeOutputAutomatically>true</storeOutputAutomatically>
</recordCreates>
<start>
<locationX>50</locationX>
<locationY>0</locationY>
<connector>
<targetReference>Animal_Platform_Event</targetReference>
</connector>
<object>Animal_Alert__c</object>
<recordTriggerType>Delete</recordTriggerType>
<triggerType>RecordBeforeDelete</triggerType>
</start>
<status>Active</status>
</Flow>
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@
<dataType>String</dataType>
<fieldText>Choose an Animal to Release</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 @@ -428,6 +428,7 @@
</defaultValue>
<fieldText>No. of Clones</fieldText>
<fieldType>InputField</fieldType>
<inputsOnNextNavToAssocScrn>UseStoredValues</inputsOnNextNavToAssocScrn>
<isRequired>true</isRequired>
<scale>0</scale>
<validationRule>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,7 @@
<dataType>String</dataType>
<fieldText>Do you wish to continue?</fieldText>
<fieldType>RadioButtons</fieldType>
<inputsOnNextNavToAssocScrn>UseStoredValues</inputsOnNextNavToAssocScrn>
<isRequired>false</isRequired>
</fields>
<inputParameters>
Expand Down Expand Up @@ -789,6 +790,7 @@
<dataType>String</dataType>
<fieldText>Boarder Selection</fieldText>
<fieldType>DropdownBox</fieldType>
<inputsOnNextNavToAssocScrn>UseStoredValues</inputsOnNextNavToAssocScrn>
<isRequired>true</isRequired>
</fields>
<showFooter>true</showFooter>
Expand Down Expand Up @@ -848,6 +850,7 @@
<dataType>String</dataType>
<fieldText>Foster Selection</fieldText>
<fieldType>DropdownBox</fieldType>
<inputsOnNextNavToAssocScrn>UseStoredValues</inputsOnNextNavToAssocScrn>
<isRequired>true</isRequired>
</fields>
<showFooter>true</showFooter>
Expand Down Expand Up @@ -885,6 +888,7 @@
<dataType>String</dataType>
<fieldText>Choose a Movement</fieldText>
<fieldType>DropdownBox</fieldType>
<inputsOnNextNavToAssocScrn>UseStoredValues</inputsOnNextNavToAssocScrn>
<isRequired>true</isRequired>
</fields>
<inputParameters>
Expand All @@ -911,6 +915,7 @@
</defaultValue>
<fieldText>Movement Date</fieldText>
<fieldType>InputField</fieldType>
<inputsOnNextNavToAssocScrn>UseStoredValues</inputsOnNextNavToAssocScrn>
<isRequired>false</isRequired>
</fields>
<inputParameters>
Expand Down Expand Up @@ -970,6 +975,7 @@
<dataType>String</dataType>
<fieldText>Organisation Selection</fieldText>
<fieldType>DropdownBox</fieldType>
<inputsOnNextNavToAssocScrn>UseStoredValues</inputsOnNextNavToAssocScrn>
<isRequired>true</isRequired>
</fields>
<showFooter>true</showFooter>
Expand Down Expand Up @@ -997,6 +1003,7 @@
<dataType>String</dataType>
<fieldText>Unit Selection</fieldText>
<fieldType>DropdownBox</fieldType>
<inputsOnNextNavToAssocScrn>UseStoredValues</inputsOnNextNavToAssocScrn>
<isRequired>true</isRequired>
</fields>
<showFooter>true</showFooter>
Expand Down
Loading

0 comments on commit ad0274b

Please sign in to comment.