diff --git a/.gitignore b/.gitignore index 9e5f54b8..b3bbc688 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,4 @@ robot/animal_shelter_starter/results/ .DS_Store test_results.* +/IlluminatedCloud/ diff --git a/cumulusci.yml b/cumulusci.yml index ddf324c7..729f0921 100644 --- a/cumulusci.yml +++ b/cumulusci.yml @@ -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 diff --git a/force-app/main/default/aura/lightningPrintViewApp/lightningPrintViewApp.app b/force-app/main/default/aura/lightningPrintViewApp/lightningPrintViewApp.app index e1fafa56..e12cc405 100644 --- a/force-app/main/default/aura/lightningPrintViewApp/lightningPrintViewApp.app +++ b/force-app/main/default/aura/lightningPrintViewApp/lightningPrintViewApp.app @@ -13,4 +13,4 @@ - + \ No newline at end of file diff --git a/force-app/main/default/classes/AlertBannerController.cls b/force-app/main/default/classes/AlertBannerController.cls index 51531711..e8426c07 100644 --- a/force-app/main/default/classes/AlertBannerController.cls +++ b/force-app/main/default/classes/AlertBannerController.cls @@ -26,9 +26,9 @@ public with sharing class AlertBannerController { return null; } - 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()){ + 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 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 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; } diff --git a/force-app/main/default/classes/AlertBannerController.cls-meta.xml b/force-app/main/default/classes/AlertBannerController.cls-meta.xml index b1a915c9..f5e18fd1 100644 --- a/force-app/main/default/classes/AlertBannerController.cls-meta.xml +++ b/force-app/main/default/classes/AlertBannerController.cls-meta.xml @@ -1,5 +1,5 @@ - 59.0 + 60.0 Active diff --git a/force-app/main/default/classes/AlertBannerControllerTest.cls b/force-app/main/default/classes/AlertBannerControllerTest.cls index 15fdee7f..3f60234e 100644 --- a/force-app/main/default/classes/AlertBannerControllerTest.cls +++ b/force-app/main/default/classes/AlertBannerControllerTest.cls @@ -9,9 +9,10 @@ * Ver Date Author Modification * 1.0 4/30/2020 Stewart Anderson (Salesforce.org) Initial Version **/ -@isTest +@IsTest public class AlertBannerControllerTest { - static testMethod void testMethod1 () { + @IsTest + static void testMethod1 () { List AlertListTest = AlertBannerController.getRelatedAlertRecords('a003z00000rlhSbAAI'); List AlertListTest2 = AlertBannerController.getRelatedAlertRecords(null); } diff --git a/force-app/main/default/classes/AlertBannerControllerTest.cls-meta.xml b/force-app/main/default/classes/AlertBannerControllerTest.cls-meta.xml index b1a915c9..f5e18fd1 100644 --- a/force-app/main/default/classes/AlertBannerControllerTest.cls-meta.xml +++ b/force-app/main/default/classes/AlertBannerControllerTest.cls-meta.xml @@ -1,5 +1,5 @@ - 59.0 + 60.0 Active diff --git a/force-app/main/default/classes/AnimalActionRLClass2.cls b/force-app/main/default/classes/AnimalActionRLClass2.cls index 5c8bab8d..ec22c328 100644 --- a/force-app/main/default/classes/AnimalActionRLClass2.cls +++ b/force-app/main/default/classes/AnimalActionRLClass2.cls @@ -18,15 +18,15 @@ public with sharing class AnimalActionRLClass2 { // System.debug('recId = ' + recId); // System.debug('rTypeName = ' + rTypeName); - if(Schema.sObjectType.animalshelters__Animal_Action__c.isAccessible() && Schema.sObjectType.animalshelters__Animal_Action__c.fields.name.isAccessible() && Schema.sObjectType.animalshelters__Animal_Action__c.fields.animalshelters__Action_Completed__c.isAccessible() && Schema.sObjectType.animalshelters__Animal_Action__c.fields.animalshelters__Date_Time_of_Action__c.isAccessible() && Schema.sObjectType.animalshelters__Animal_Action__c.fields.animalshelters__Description__c.isAccessible() && Schema.sObjectType.animalshelters__Animal_Action__c.fields.RecordTypeId.isAccessible() && Schema.sObjectType.animalshelters__Animal__c.isAccessible()){ + if(Schema.SObjectType.animalshelters__Animal_Action__c.isAccessible() && Schema.SObjectType.animalshelters__Animal_Action__c.fields.Name.isAccessible() && Schema.SObjectType.animalshelters__Animal_Action__c.fields.animalshelters__Action_Completed__c.isAccessible() && Schema.SObjectType.animalshelters__Animal_Action__c.fields.animalshelters__Date_Time_of_Action__c.isAccessible() && Schema.SObjectType.animalshelters__Animal_Action__c.fields.animalshelters__Description__c.isAccessible() && Schema.SObjectType.animalshelters__Animal_Action__c.fields.RecordTypeId.isAccessible() && Schema.SObjectType.animalshelters__Animal__c.isAccessible()){ List animalActions= new List(); - boolean blnFirstTimeRound = false; - for(RecordType rec : [SELECT Id FROM RecordType WHERE sObjectType = 'animalshelters__Animal_Action__c' and Name =:rTypeName]) + Boolean blnFirstTimeRound = false; + for(RecordType rec : [SELECT Id FROM RecordType WHERE SobjectType = 'animalshelters__Animal_Action__c' AND Name =:rTypeName]) { if (!blnFirstTimeRound){ List y = [SELECT Id, Name, animalshelters__Action_Completed__c, animalshelters__Date_Time_of_Action__c, animalshelters__Description__c FROM animalshelters__Animal_Action__c - WHERE animalshelters__Animal__c= :recId and RecordTypeId= :rec.Id WITH SECURITY_ENFORCED ]; + WHERE animalshelters__Animal__c= :recId AND RecordTypeId= :rec.Id WITH SECURITY_ENFORCED ]; for(animalshelters__Animal_Action__c z : y) { animalActions.add(z); diff --git a/force-app/main/default/classes/AnimalActionRLClass2.cls-meta.xml b/force-app/main/default/classes/AnimalActionRLClass2.cls-meta.xml index b1a915c9..f5e18fd1 100644 --- a/force-app/main/default/classes/AnimalActionRLClass2.cls-meta.xml +++ b/force-app/main/default/classes/AnimalActionRLClass2.cls-meta.xml @@ -1,5 +1,5 @@ - 59.0 + 60.0 Active diff --git a/force-app/main/default/classes/AnimalActionRLClass2Test.cls b/force-app/main/default/classes/AnimalActionRLClass2Test.cls index 58f5f042..480775ea 100644 --- a/force-app/main/default/classes/AnimalActionRLClass2Test.cls +++ b/force-app/main/default/classes/AnimalActionRLClass2Test.cls @@ -9,7 +9,7 @@ * Ver Date Author Modification * 1.0 4/30/2020 Stewart Anderson (Salesforce.org) Initial Version **/ -@isTest +@IsTest public class AnimalActionRLClass2Test { @IsTest diff --git a/force-app/main/default/classes/AnimalActionRLClass2Test.cls-meta.xml b/force-app/main/default/classes/AnimalActionRLClass2Test.cls-meta.xml index b1a915c9..f5e18fd1 100644 --- a/force-app/main/default/classes/AnimalActionRLClass2Test.cls-meta.xml +++ b/force-app/main/default/classes/AnimalActionRLClass2Test.cls-meta.xml @@ -1,5 +1,5 @@ - 59.0 + 60.0 Active diff --git a/force-app/main/default/classes/AnimalBadgeController.cls b/force-app/main/default/classes/AnimalBadgeController.cls new file mode 100644 index 00000000..e2b687a0 --- /dev/null +++ b/force-app/main/default/classes/AnimalBadgeController.cls @@ -0,0 +1,73 @@ +/** + * @File Name : AnimalBadgeController.cls + * @Description : + * @Author : Chris Rolfe (Salesforce) + * @Last Modified By : + * @Last Modified On : + * @Modification Log : + * Ver Date Author Modification + * 1.0 01/04/2024 Chris Rolfe (Salesforce) Initial Version +**/ +public with sharing class AnimalBadgeController { + + @AuraEnabled(cacheable=true) + public static Map getRelatedBadges(Id animalId) { + Map badges = new Map{ + 'Alert' => false, + 'Condition' => false, + 'Nutrition' => false, + 'Exercise' => false, + 'Treatment' => false, + 'Vaccination' => false + }; + + // 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()) { + List alerts = [SELECT Id + FROM animalshelters__Animal_Alert__c + WHERE animalshelters__Animal__c = :animalId + 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()) { + List conditions = [SELECT Id + FROM animalshelters__Condition__c + WHERE animalshelters__Animal__c = :animalId + AND animalshelters__End_Date_Time__c = null + WITH SECURITY_ENFORCED]; + // System.debug(conditions); + if(!conditions.isEmpty()) { + badges.put('Condition', true); + } + } + + // 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()) { + List 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 + WITH SECURITY_ENFORCED]; + // System.debug(actions); + for(animalshelters__Animal_Action__c action : actions) { + if(action.RecordType.Name == 'Nutrition') { + badges.put('Nutrition', true); + } else if(action.RecordType.Name == 'Exercise'){ + badges.put('Exercise', true); + } else if(action.RecordType.Name == 'Treatment' && action.animalshelters__Treatment_Type__c == 'Vaccination'){ + badges.put('Vaccination', true); + } else if(action.RecordType.Name == 'Treatment' && action.animalshelters__Treatment_Type__c != 'Vaccination'){ + badges.put('Treatment', true); + } + } + //System.debug(badges); + } + return badges; + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/AnimalBadgeController.cls-meta.xml b/force-app/main/default/classes/AnimalBadgeController.cls-meta.xml new file mode 100644 index 00000000..b1a915c9 --- /dev/null +++ b/force-app/main/default/classes/AnimalBadgeController.cls-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + Active + diff --git a/force-app/main/default/classes/AnimalBadgeControllerTest.cls b/force-app/main/default/classes/AnimalBadgeControllerTest.cls new file mode 100644 index 00000000..ff300c96 --- /dev/null +++ b/force-app/main/default/classes/AnimalBadgeControllerTest.cls @@ -0,0 +1,51 @@ +@isTest +private class AnimalBadgeControllerTest { + + @IsTest static void testNoBadges() { + // Set Up Test Data + animalshelters__Animal__c testAnimal = new animalshelters__Animal__c(animalshelters__Animal_Name__c = 'Test Animal', animalshelters__Date_of_Arrival__c = Date.today()); + insert testAnimal; + + //Test with no badges + Test.startTest(); + Map badges = AnimalBadgeController.getRelatedBadges(testAnimal.Id); + Test.stopTest(); + + //Verify Results + System.assertEquals(false, badges.get('Alert'), 'Expected no alert'); + System.assertEquals(false, badges.get('Condition'), 'Expected no Condition'); + System.assertEquals(false, badges.get('Nutrition'), 'Expected no Nutrition'); + System.assertEquals(false, badges.get('Exercise'), 'Expected no Exercise'); + System.assertEquals(false, badges.get('Treatment'), 'Expected no Treatment'); + } + + @IsTest static void testWithBadges() { + // Set Up Test Data + animalshelters__Animal__c testAnimal = new animalshelters__Animal__c(animalshelters__Animal_Name__c = 'Test Animal', animalshelters__Date_of_Arrival__c = Date.today()); + insert testAnimal; + + animalshelters__Animal_Alert__c alert = new animalshelters__Animal_Alert__c(animalshelters__Animal__c = testAnimal.Id, animalshelters__Start_Date_Time__c = Date.today(), animalshelters__Type__c = 'General', animalshelters__Alert_Message__c = 'Test'); + animalshelters__Condition__c condition = new animalshelters__Condition__c(animalshelters__Animal__c = testAnimal.Id, animalshelters__Start_Date__c = Date.today()); + insert alert; + insert condition; + + //Create a dummy record type for Action + Id recordTypeId = Schema.SObjectType.animalshelters__Animal_Action__c.getRecordTypeInfosByName().get('Exercise').getRecordTypeId(); + animalshelters__Animal_Action__c action = new animalshelters__Animal_Action__c(animalshelters__Animal__c = testAnimal.Id, animalshelters__Date_Time_of_Action__c= Date.today(), animalshelters__Description__c = 'Test', RecordTypeId = recordTypeId); + insert action; + + //Test with Badges + Test.startTest(); + Map badges = AnimalBadgeController.getRelatedBadges(testAnimal.Id); + Test.stopTest(); + + //Verify Results + System.assertEquals(true, badges.get('Alert'), 'Expected an alert'); + System.assertEquals(true, badges.get('Condition'), 'Expected a Condition'); + System.assertEquals(false, badges.get('Nutrition'), 'Expected no Nutrition'); + System.assertEquals(true, badges.get('Exercise'), 'Expected an Exercise'); + System.assertEquals(false, badges.get('Treatment'), 'Expected no Treatment'); + + } + +} \ No newline at end of file diff --git a/force-app/main/default/classes/AnimalBadgeControllerTest.cls-meta.xml b/force-app/main/default/classes/AnimalBadgeControllerTest.cls-meta.xml new file mode 100644 index 00000000..f5e18fd1 --- /dev/null +++ b/force-app/main/default/classes/AnimalBadgeControllerTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 60.0 + Active + diff --git a/force-app/main/default/classes/AnimalShelterFieldsetController.cls b/force-app/main/default/classes/AnimalShelterFieldsetController.cls index 3143da47..b3b050cd 100644 --- a/force-app/main/default/classes/AnimalShelterFieldsetController.cls +++ b/force-app/main/default/classes/AnimalShelterFieldsetController.cls @@ -17,7 +17,7 @@ public with sharing class AnimalShelterFieldsetController { } } - @AuraEnabled(cacheable=true) + @AuraEnabled(Cacheable=true) public static List getFieldSet(String sObjectName, String fieldSetName) { List fieldSetMemberWrappers = new List(); @@ -48,7 +48,7 @@ public with sharing class AnimalShelterFieldsetController { return fieldSetMemberWrappers; } - @AuraEnabled(cacheable=true) + @AuraEnabled(Cacheable=true) public static Map> getBadgeFieldsData(String recordId, String sObjectName, List badgeFieldNames) { // Check Object and Field Security @@ -96,4 +96,4 @@ public with sharing class AnimalShelterFieldsetController { } return badgeFieldsData; } -} +} \ No newline at end of file diff --git a/force-app/main/default/classes/AnimalShelterFieldsetControllerTest.cls b/force-app/main/default/classes/AnimalShelterFieldsetControllerTest.cls index 7f39cd1a..f03aaa69 100644 --- a/force-app/main/default/classes/AnimalShelterFieldsetControllerTest.cls +++ b/force-app/main/default/classes/AnimalShelterFieldsetControllerTest.cls @@ -5,10 +5,10 @@ * @last modified on : 12-22-2023 * @last modified by : Stewart Anderson **/ -@isTest +@IsTest private class AnimalShelterFieldsetControllerTest { - @isTest static void testGetFieldSet() { + @IsTest static void testGetFieldSet() { // Setup test data // Since Schema and FieldSets cannot be created in test methods, // we'll assume there's an existing object and field set available. @@ -24,7 +24,7 @@ private class AnimalShelterFieldsetControllerTest { System.assertNotEquals(0, result.size(), 'The result should have elements'); } - @isTest static void testGetBadgeFieldsData() { + @IsTest static void testGetBadgeFieldsData() { // Setup test data // Create a record for the sObject you're testing against animalshelters__Animal__c testRecord = new animalshelters__Animal__c(animalshelters__Animal_Name__c='Test', animalshelters__Date_of_Arrival__c=Datetime.now()); @@ -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'); } -} +} \ No newline at end of file diff --git a/force-app/main/default/classes/AnimalShelterFieldsetControllerTest.cls-meta.xml b/force-app/main/default/classes/AnimalShelterFieldsetControllerTest.cls-meta.xml index b1a915c9..f5e18fd1 100644 --- a/force-app/main/default/classes/AnimalShelterFieldsetControllerTest.cls-meta.xml +++ b/force-app/main/default/classes/AnimalShelterFieldsetControllerTest.cls-meta.xml @@ -1,5 +1,5 @@ - 59.0 + 60.0 Active diff --git a/force-app/main/default/classes/AnimalShelterGetCustomSettings.cls b/force-app/main/default/classes/AnimalShelterGetCustomSettings.cls index be47b5d3..da9c130c 100644 --- a/force-app/main/default/classes/AnimalShelterGetCustomSettings.cls +++ b/force-app/main/default/classes/AnimalShelterGetCustomSettings.cls @@ -7,9 +7,9 @@ **/ public with sharing class AnimalShelterGetCustomSettings { - @AuraEnabled(cacheable=true) + @AuraEnabled(Cacheable=true) public static animalshelters__Animal_Shelter_Settings__c getCustomSettings(){ - if (Schema.sObjectType.animalshelters__Animal_Shelter_Settings__c.isAccessible()) { + if (Schema.SObjectType.animalshelters__Animal_Shelter_Settings__c.isAccessible()) { return animalshelters__Animal_Shelter_Settings__c.getOrgDefaults(); } else { throw new AuraHandledException('Access Issue: There was an attempt to access Animal Shelter Starter Settings by a user without access.'); @@ -19,7 +19,7 @@ public with sharing class AnimalShelterGetCustomSettings { @AuraEnabled public static void saveCustomSetting(animalshelters__Animal_Shelter_Settings__c customSetting) { - if (Schema.sObjectType.animalshelters__Animal_Shelter_Settings__c.isUpdateable()) { + if (Schema.SObjectType.animalshelters__Animal_Shelter_Settings__c.isUpdateable()) { update customSetting; } else { throw new AuraHandledException('Access Issue: There was an attempt to update Animal Shelter Starter Settings by a user without access.'); @@ -49,4 +49,4 @@ public with sharing class AnimalShelterGetCustomSettings { throw new AuraHandledException('Error creating default settings: ' + errMsg); } } -} +} \ No newline at end of file diff --git a/force-app/main/default/classes/AnimalShelterGetCustomSettings.cls-meta.xml b/force-app/main/default/classes/AnimalShelterGetCustomSettings.cls-meta.xml index b1a915c9..f5e18fd1 100644 --- a/force-app/main/default/classes/AnimalShelterGetCustomSettings.cls-meta.xml +++ b/force-app/main/default/classes/AnimalShelterGetCustomSettings.cls-meta.xml @@ -1,5 +1,5 @@ - 59.0 + 60.0 Active diff --git a/force-app/main/default/classes/AnimalShelterGetCustomSettingsTest.cls b/force-app/main/default/classes/AnimalShelterGetCustomSettingsTest.cls index c2c799d6..d4ed71ff 100644 --- a/force-app/main/default/classes/AnimalShelterGetCustomSettingsTest.cls +++ b/force-app/main/default/classes/AnimalShelterGetCustomSettingsTest.cls @@ -11,8 +11,8 @@ private class AnimalShelterGetCustomSettingsTest { @IsTest static void testGetCustomSetting() { // Create a new custom setting record animalshelters__Animal_Shelter_Settings__c setting = new animalshelters__Animal_Shelter_Settings__c(); - setting.animalshelters__Breeds_Migration_Complete__c = True; - setting.animalshelters__Default_Animal_Name__c = False; + setting.animalshelters__Breeds_Migration_Complete__c = true; + setting.animalshelters__Default_Animal_Name__c = false; setting.animalshelters__Default_Animal_Name_Prefix__c = 'pre'; setting.animalshelters__microchip_api_Token__c = 'TestValue'; insert setting; @@ -25,8 +25,8 @@ private class AnimalShelterGetCustomSettingsTest { @IsTest static void testSaveCustomSetting() { // Create a new custom setting record animalshelters__Animal_Shelter_Settings__c setting = new animalshelters__Animal_Shelter_Settings__c(); - setting.animalshelters__Breeds_Migration_Complete__c = True; - setting.animalshelters__Default_Animal_Name__c = False; + setting.animalshelters__Breeds_Migration_Complete__c = true; + setting.animalshelters__Default_Animal_Name__c = false; setting.animalshelters__Default_Animal_Name_Prefix__c = 'pre'; setting.animalshelters__microchip_api_Token__c = 'TestValueNew'; insert setting; diff --git a/force-app/main/default/classes/AnimalShelterGetCustomSettingsTest.cls-meta.xml b/force-app/main/default/classes/AnimalShelterGetCustomSettingsTest.cls-meta.xml index b1a915c9..f5e18fd1 100644 --- a/force-app/main/default/classes/AnimalShelterGetCustomSettingsTest.cls-meta.xml +++ b/force-app/main/default/classes/AnimalShelterGetCustomSettingsTest.cls-meta.xml @@ -1,5 +1,5 @@ - 59.0 + 60.0 Active diff --git a/force-app/main/default/classes/FSCAnimalCloneDatatableController.cls-meta.xml b/force-app/main/default/classes/FSCAnimalCloneDatatableController.cls-meta.xml index b1a915c9..f5e18fd1 100644 --- a/force-app/main/default/classes/FSCAnimalCloneDatatableController.cls-meta.xml +++ b/force-app/main/default/classes/FSCAnimalCloneDatatableController.cls-meta.xml @@ -1,5 +1,5 @@ - 59.0 + 60.0 Active diff --git a/force-app/main/default/classes/FSCAnimalCloneDatatableControllerTest.cls b/force-app/main/default/classes/FSCAnimalCloneDatatableControllerTest.cls index 53b5c332..2e3d30cc 100644 --- a/force-app/main/default/classes/FSCAnimalCloneDatatableControllerTest.cls +++ b/force-app/main/default/classes/FSCAnimalCloneDatatableControllerTest.cls @@ -1,14 +1,14 @@ -@isTest +@IsTest public class FSCAnimalCloneDatatableControllerTest { @TestSetup static void setupTestData(){ - animalshelters__Animal__c testAnimal = new animalshelters__Animal__c(animalshelters__Animal_Name__c = 'Tandy', animalshelters__Type__c = 'Rabbit', animalshelters__Date_of_Arrival__c = Date.today(), animalshelters__IsCloned__c = True); - Insert testAnimal; + animalshelters__Animal__c testAnimal = new animalshelters__Animal__c(animalshelters__Animal_Name__c = 'Tandy', animalshelters__Type__c = 'Rabbit', animalshelters__Date_of_Arrival__c = Date.today(), animalshelters__IsCloned__c = true); + insert testAnimal; } - @isTest static void testReadRecord(){ + @IsTest static void testReadRecord(){ List tstRecord = new List(); tstRecord = FSCAnimalCloneDatatableController.getClonedAnimals(); @@ -16,10 +16,10 @@ public class FSCAnimalCloneDatatableControllerTest { } - @isTest static void testUpdateRecord(){ + @IsTest static void testUpdateRecord(){ List tstUpdate = new List(); - List updateAnimal = [SELECT animalshelters__Animal_Name__c, animalshelters__Type__c, animalshelters__Date_of_Arrival__c FROM animalshelters__Animal__c WHERE animalshelters__IsCloned__c = True]; + List updateAnimal = [SELECT animalshelters__Animal_Name__c, animalshelters__Type__c, animalshelters__Date_of_Arrival__c FROM animalshelters__Animal__c WHERE animalshelters__IsCloned__c = TRUE]; updateAnimal.get(0).animalshelters__Animal_Name__c = 'Tommy'; tstUpdate = FSCAnimalCloneDatatableController.updateClonedRecords(updateAnimal); System.assertEquals(tstUpdate.get(0).animalshelters__Animal_Name__c, 'Tommy','Animal name !="Tommy"'); diff --git a/force-app/main/default/classes/FSCAnimalCloneDatatableControllerTest.cls-meta.xml b/force-app/main/default/classes/FSCAnimalCloneDatatableControllerTest.cls-meta.xml index b1a915c9..f5e18fd1 100644 --- a/force-app/main/default/classes/FSCAnimalCloneDatatableControllerTest.cls-meta.xml +++ b/force-app/main/default/classes/FSCAnimalCloneDatatableControllerTest.cls-meta.xml @@ -1,5 +1,5 @@ - 59.0 + 60.0 Active diff --git a/force-app/main/default/classes/FSC_FileUploadPreviewController.cls b/force-app/main/default/classes/FSC_FileUploadPreviewController.cls index 09424151..630eefb3 100644 --- a/force-app/main/default/classes/FSC_FileUploadPreviewController.cls +++ b/force-app/main/default/classes/FSC_FileUploadPreviewController.cls @@ -33,7 +33,7 @@ public with sharing class FSC_FileUploadPreviewController { @AuraEnabled public static void deleteFile(String contentDocumentId){ - if (ContentDocument.sObjectType.getDescribe().isDeletable()){ + if (ContentDocument.SObjectType.getDescribe().isDeletable()){ delete [SELECT Id FROM ContentDocument WHERE Id = :contentDocumentId diff --git a/force-app/main/default/classes/FSC_FileUploadPreviewController.cls-meta.xml b/force-app/main/default/classes/FSC_FileUploadPreviewController.cls-meta.xml index b1a915c9..f5e18fd1 100644 --- a/force-app/main/default/classes/FSC_FileUploadPreviewController.cls-meta.xml +++ b/force-app/main/default/classes/FSC_FileUploadPreviewController.cls-meta.xml @@ -1,5 +1,5 @@ - 59.0 + 60.0 Active diff --git a/force-app/main/default/classes/FSC_FileUploadPreviewControllerTest.cls b/force-app/main/default/classes/FSC_FileUploadPreviewControllerTest.cls index ff3c3b58..322f58bc 100644 --- a/force-app/main/default/classes/FSC_FileUploadPreviewControllerTest.cls +++ b/force-app/main/default/classes/FSC_FileUploadPreviewControllerTest.cls @@ -34,7 +34,7 @@ public class FSC_FileUploadPreviewControllerTest { } - @isTest static void testReadDocument(){ + @IsTest static void testReadDocument(){ List accList = [SELECT Id FROM Account WHERE Name = 'ASS Test Account' LIMIT 1]; for(Account acc : accList){ @@ -44,7 +44,7 @@ public class FSC_FileUploadPreviewControllerTest { } } - @isTest static void testDeleteDocument(){ + @IsTest static void testDeleteDocument(){ List cdList = [SELECT Id FROM ContentDocument WHERE Title = 'ASS Test File' LIMIT 1]; for(ContentDocument cd : cdList){ diff --git a/force-app/main/default/classes/FSC_FileUploadPreviewControllerTest.cls-meta.xml b/force-app/main/default/classes/FSC_FileUploadPreviewControllerTest.cls-meta.xml index b1a915c9..f5e18fd1 100644 --- a/force-app/main/default/classes/FSC_FileUploadPreviewControllerTest.cls-meta.xml +++ b/force-app/main/default/classes/FSC_FileUploadPreviewControllerTest.cls-meta.xml @@ -1,5 +1,5 @@ - 59.0 + 60.0 Active diff --git a/force-app/main/default/classes/GetRandomNumber.cls b/force-app/main/default/classes/GetRandomNumber.cls index e338acfa..4eb6b2c1 100644 --- a/force-app/main/default/classes/GetRandomNumber.cls +++ b/force-app/main/default/classes/GetRandomNumber.cls @@ -20,7 +20,7 @@ global with sharing class GetRandomNumber { Results curResult = new Results(); curResult.randomNumber = generateRandomFromRange(requests[0].startNumber, requests[0].endNumber); - List resultsList = new List(); + List resultsList = new List(); resultsList.add(curResult); return resultsList; } @@ -37,41 +37,44 @@ global with sharing class GetRandomNumber { global static Double generateRandomFromRange(Integer startNum, Integer endNum) { - if(startNum == 0 && endNum == 1) + if (startNum == 0 && endNum == 1) { return Math.random(); + } Integer returnValue; //Logic- first we will generate random boolean value which will decide if we want to //add the random number from startNum or will subtract random number from endNum - Integer randomNumber = Integer.valueof((math.random() * 10)); - boolean addSubFlag= math.mod(randomNumber,2) == 0 ? true : false; + Integer randomNumber = Integer.valueOf((Math.random() * 10)); + Boolean addSubFlag= Math.mod(randomNumber,2) == 0 ? true : false; - integer diffInRange = endNum-startNum; + Integer diffInRange = endNum-startNum; //Now find random number staring from 0 to diffInRange Integer randomNum = Math.mod(Math.round(Math.random()*diffInRange+1),diffInRange); //If addSubFlag is true, we will add random number generated between 0 and diffInRange from start number //else we will subtract random number from end number if(addSubFlag){ - if(diffInRange > 1) - returnValue =startNum + randomNum; - else - returnValue =startNum; + if (diffInRange > 1) { + returnValue = startNum + randomNum; + } else { + returnValue = startNum; + } }else{ - if(diffInRange > 1) - returnValue = endNum - randomNum; - else - returnValue =endNum; + if (diffInRange > 1) { + returnValue = endNum - randomNum; + } else { + returnValue = endNum; + } } return returnValue; } global class Requests { - @InvocableVariable(required=true) + @InvocableVariable(Required=true) global Integer startNumber; - @InvocableVariable(required=true) + @InvocableVariable(Required=true) global Integer endNumber; } diff --git a/force-app/main/default/classes/GetRandomNumber.cls-meta.xml b/force-app/main/default/classes/GetRandomNumber.cls-meta.xml index b1a915c9..f5e18fd1 100644 --- a/force-app/main/default/classes/GetRandomNumber.cls-meta.xml +++ b/force-app/main/default/classes/GetRandomNumber.cls-meta.xml @@ -1,5 +1,5 @@ - 59.0 + 60.0 Active diff --git a/force-app/main/default/classes/GetRandomNumberTest.cls b/force-app/main/default/classes/GetRandomNumberTest.cls index a1833fbc..4ac6e9a6 100644 --- a/force-app/main/default/classes/GetRandomNumberTest.cls +++ b/force-app/main/default/classes/GetRandomNumberTest.cls @@ -1,7 +1,7 @@ -@isTest +@IsTest global with sharing class GetRandomNumberTest { - @isTest + @IsTest public static void numberReturnedIsInRange() { Integer startNum = 0; Integer endNum =1; @@ -23,7 +23,7 @@ global with sharing class GetRandomNumberTest { System.assertEquals(true, resultNum <= endNum); } - @isTest + @IsTest public static void numberZeroToOneGeneratedIsInRange() { Integer startNum = 0; Integer endNum =1; @@ -36,7 +36,7 @@ global with sharing class GetRandomNumberTest { System.assertEquals(true, resultNum <= endNum); } - @isTest + @IsTest public static void numberAboveOneGeneratedIsInRange() { Integer startNum = 5; Integer endNum =7; diff --git a/force-app/main/default/classes/GetRandomNumberTest.cls-meta.xml b/force-app/main/default/classes/GetRandomNumberTest.cls-meta.xml index b1a915c9..f5e18fd1 100644 --- a/force-app/main/default/classes/GetRandomNumberTest.cls-meta.xml +++ b/force-app/main/default/classes/GetRandomNumberTest.cls-meta.xml @@ -1,5 +1,5 @@ - 59.0 + 60.0 Active diff --git a/force-app/main/default/classes/LocationController.cls b/force-app/main/default/classes/LocationController.cls index 20a9847f..ffd78fcb 100644 --- a/force-app/main/default/classes/LocationController.cls +++ b/force-app/main/default/classes/LocationController.cls @@ -42,12 +42,12 @@ public with sharing class LocationController { List loc = new List(); for(sObject locs :myData){ GeoLocation geoInfo = new GeoLocation(); - geoInfo.Latitude = String.ValueOf(locs.get(varLat)); - geoInfo.Longitude = String.ValueOf(locs.get(varLong)); + geoInfo.Latitude = String.valueOf(locs.get(varLat)); + geoInfo.Longitude = String.valueOf(locs.get(varLong)); Location locDetail = new Location(); locDetail.icon = 'utility:animal_and_nature'; - locDetail.title = String.ValueOf(locs.get(varName)); - locDetail.description = locs.get(varDescText) + ' - ' + fieldLabel + ': ' + String.ValueOf(locs.get(varDescDate)); + locDetail.title = String.valueOf(locs.get(varName)); + locDetail.description = locs.get(varDescText) + ' - ' + fieldLabel + ': ' + String.valueOf(locs.get(varDescDate)); locDetail.location = geoInfo; loc.add(locDetail); @@ -77,4 +77,4 @@ public with sharing class LocationController { @AuraEnabled public String Longitude{get;set;} } -} +} \ No newline at end of file diff --git a/force-app/main/default/classes/LocationController.cls-meta.xml b/force-app/main/default/classes/LocationController.cls-meta.xml index b1a915c9..f5e18fd1 100644 --- a/force-app/main/default/classes/LocationController.cls-meta.xml +++ b/force-app/main/default/classes/LocationController.cls-meta.xml @@ -1,5 +1,5 @@ - 59.0 + 60.0 Active diff --git a/force-app/main/default/classes/LocationControllerTest.cls b/force-app/main/default/classes/LocationControllerTest.cls index b67ad1e7..b696b7a5 100644 --- a/force-app/main/default/classes/LocationControllerTest.cls +++ b/force-app/main/default/classes/LocationControllerTest.cls @@ -1,13 +1,14 @@ -@isTest +@IsTest public class LocationControllerTest { @TestSetup static void setupTestData(){ - animalshelters__Animal__c testAnimal = new animalshelters__Animal__c(animalshelters__Animal_Name__c = 'Tandy', animalshelters__Geolocation__latitude__s = 50.826425, animalshelters__Geolocation__longitude__s = -0.403983, animalshelters__Type__c = 'Rabbit', animalshelters__Date_of_Arrival__c = Date.today()); - Insert testAnimal; + animalshelters__Animal__c testAnimal = new animalshelters__Animal__c(animalshelters__Animal_Name__c = 'Tandy', animalshelters__Geolocation__Latitude__s = 50.826425, animalshelters__Geolocation__Longitude__s = -0.403983, animalshelters__Type__c = 'Rabbit', animalshelters__Date_of_Arrival__c = Date.today()); + insert testAnimal; } - static testMethod void testLocation() { + @IsTest + static void testLocation() { String tstObj = 'animalshelters__Animal__c'; String tstName = 'animalshelters__Animal_Name__c'; @@ -16,12 +17,12 @@ public class LocationControllerTest { String tstText = 'animalshelters__Type__c'; String tstDate = 'animalshelters__Date_of_Arrival__c'; - List animal = [SELECT animalshelters__Animal_Name__c, animalshelters__Geolocation__latitude__s, animalshelters__Geolocation__longitude__s, animalshelters__Type__c, animalshelters__Date_of_Arrival__c FROM animalshelters__Animal__c]; + List animal = [SELECT animalshelters__Animal_Name__c, animalshelters__Geolocation__Latitude__s, animalshelters__Geolocation__Longitude__s, animalshelters__Type__c, animalshelters__Date_of_Arrival__c FROM animalshelters__Animal__c]; System.assertEquals(true,animal.size()>0,'Read Animal Record Failed'); List tstLoc = new List(); tstLoc = LocationController.getLocation(tstObj, tstLat, tstLong, tstName, tstText, tstDate); - System.assertEquals(true,String.ValueOf(tstLoc).contains('title=Tandy'),'Location Data Incorrect'); + System.assertEquals(true,String.valueOf(tstLoc).contains('title=Tandy'),'Location Data Incorrect'); } } \ No newline at end of file diff --git a/force-app/main/default/classes/LocationControllerTest.cls-meta.xml b/force-app/main/default/classes/LocationControllerTest.cls-meta.xml index b1a915c9..f5e18fd1 100644 --- a/force-app/main/default/classes/LocationControllerTest.cls-meta.xml +++ b/force-app/main/default/classes/LocationControllerTest.cls-meta.xml @@ -1,5 +1,5 @@ - 59.0 + 60.0 Active diff --git a/force-app/main/default/classes/MockW3WResponseGenerator.cls b/force-app/main/default/classes/MockW3WResponseGenerator.cls index 49dcbaa8..1ee37a3d 100644 --- a/force-app/main/default/classes/MockW3WResponseGenerator.cls +++ b/force-app/main/default/classes/MockW3WResponseGenerator.cls @@ -1,10 +1,10 @@ global class MockW3WResponseGenerator implements HttpCalloutMock { - global HTTPResponse respond(HTTPRequest req) { + global HttpResponse respond(HttpRequest req) { // Create a fake response HttpResponse res = new HttpResponse(); res.setHeader('Content-Type', 'application/json'); - string result = '{ "country": "GB", "square": { "southwest": { "lng": -0.403987, "lat": 50.826272 }, "northeast": { "lng": -0.403945, "lat": 50.826299 } }, "nearestPlace": "Goring-by-Sea, West Sussex", "coordinates": { "lng": -0.403966, "lat": 50.826286 }, "words": "whips.vanish.store", "language": "en", "map": "https://w3w.co/whips.vanish.store" }'; + String result = '{ "country": "GB", "square": { "southwest": { "lng": -0.403987, "lat": 50.826272 }, "northeast": { "lng": -0.403945, "lat": 50.826299 } }, "nearestPlace": "Goring-by-Sea, West Sussex", "coordinates": { "lng": -0.403966, "lat": 50.826286 }, "words": "whips.vanish.store", "language": "en", "map": "https://w3w.co/whips.vanish.store" }'; res.setBody(result); res.setStatusCode(200); return res; diff --git a/force-app/main/default/classes/MockW3WResponseGenerator.cls-meta.xml b/force-app/main/default/classes/MockW3WResponseGenerator.cls-meta.xml index b1a915c9..f5e18fd1 100644 --- a/force-app/main/default/classes/MockW3WResponseGenerator.cls-meta.xml +++ b/force-app/main/default/classes/MockW3WResponseGenerator.cls-meta.xml @@ -1,5 +1,5 @@ - 59.0 + 60.0 Active diff --git a/force-app/main/default/classes/MockW3WResponseGeneratorTest.cls b/force-app/main/default/classes/MockW3WResponseGeneratorTest.cls index 5965c786..8440a115 100644 --- a/force-app/main/default/classes/MockW3WResponseGeneratorTest.cls +++ b/force-app/main/default/classes/MockW3WResponseGeneratorTest.cls @@ -1,7 +1,7 @@ -@isTest +@IsTest private class MockW3WResponseGeneratorTest { - @isTest + @IsTest static void testRespond() { // Create a mock request HttpRequest req = new HttpRequest(); diff --git a/force-app/main/default/classes/MockW3WResponseGeneratorTest.cls-meta.xml b/force-app/main/default/classes/MockW3WResponseGeneratorTest.cls-meta.xml index b1a915c9..f5e18fd1 100644 --- a/force-app/main/default/classes/MockW3WResponseGeneratorTest.cls-meta.xml +++ b/force-app/main/default/classes/MockW3WResponseGeneratorTest.cls-meta.xml @@ -1,5 +1,5 @@ - 59.0 + 60.0 Active diff --git a/force-app/main/default/classes/ProfilePictureController.cls b/force-app/main/default/classes/ProfilePictureController.cls index f0f0533f..39327764 100644 --- a/force-app/main/default/classes/ProfilePictureController.cls +++ b/force-app/main/default/classes/ProfilePictureController.cls @@ -2,9 +2,9 @@ public with sharing class ProfilePictureController { @AuraEnabled public static Attachment getProfilePicture(Id parentId) { - if (Schema.sObjectType.Attachment.isAccessible()) { + if (Schema.SObjectType.Attachment.isAccessible()) { return [SELECT Id, Name, LastModifiedDate, ContentType FROM Attachment - WHERE parentid=:ParentId AND ContentType IN ('image/png', 'image/jpeg', 'image/gif') + WHERE ParentId=:parentId AND ContentType IN ('image/png', 'image/jpeg', 'image/gif') ORDER BY LastModifiedDate DESC LIMIT 1]; } System.debug('User does not have access to view Attachments. Please review access.'); @@ -13,14 +13,14 @@ public with sharing class ProfilePictureController { @AuraEnabled public static Id saveAttachment(Id parentId, String fileName, String base64Data, String contentType) { - if (Schema.sObjectType.Attachment.isCreateable() && Schema.sObjectType.Attachment.fields.parentId.isAccessible() && Schema.sObjectType.Attachment.fields.name.isAccessible() && Schema.sObjectType.Attachment.fields.contentType.isAccessible()) { + if (Schema.SObjectType.Attachment.isCreateable() && Schema.SObjectType.Attachment.fields.ParentId.isAccessible() && Schema.SObjectType.Attachment.fields.Name.isAccessible() && Schema.SObjectType.Attachment.fields.ContentType.isAccessible()) { Attachment attachment = new Attachment(); - attachment.parentId = parentId; - attachment.body = EncodingUtil.base64Decode(base64Data); - attachment.name = fileName; - attachment.contentType = contentType; + attachment.ParentId = parentId; + attachment.Body = EncodingUtil.base64Decode(base64Data); + attachment.Name = fileName; + attachment.ContentType = contentType; insert attachment; - return attachment.id; + return attachment.Id; } System.debug('User does not have access to create Attachments. Please review access.'); return null; diff --git a/force-app/main/default/classes/ProfilePictureController.cls-meta.xml b/force-app/main/default/classes/ProfilePictureController.cls-meta.xml index b1a915c9..f5e18fd1 100644 --- a/force-app/main/default/classes/ProfilePictureController.cls-meta.xml +++ b/force-app/main/default/classes/ProfilePictureController.cls-meta.xml @@ -1,5 +1,5 @@ - 59.0 + 60.0 Active diff --git a/force-app/main/default/classes/ProfilePictureControllerTest.cls b/force-app/main/default/classes/ProfilePictureControllerTest.cls index 2705be86..257b00fc 100644 --- a/force-app/main/default/classes/ProfilePictureControllerTest.cls +++ b/force-app/main/default/classes/ProfilePictureControllerTest.cls @@ -1,11 +1,12 @@ -@isTest +@IsTest public class ProfilePictureControllerTest { - static testMethod void testMethod1 () { - animalshelters__Animal__c TestAnimal = new animalshelters__Animal__c (animalshelters__Animal_Name__c='rex', animalshelters__Date_of_Arrival__c = date.today(), animalshelters__Type__c = 'Dog'); + @IsTest + static void testMethod1 () { + animalshelters__Animal__c TestAnimal = new animalshelters__Animal__c (animalshelters__Animal_Name__c='rex', animalshelters__Date_of_Arrival__c = Date.today(), animalshelters__Type__c = 'Dog'); insert TestAnimal; - ProfilePictureController.saveAttachment(TestAnimal.id, 'Test File', '', 'image/jpeg'); + ProfilePictureController.saveAttachment(TestAnimal.Id, 'Test File', '', 'image/jpeg'); - ProfilePictureController.getProfilePicture(TestAnimal.id); + ProfilePictureController.getProfilePicture(TestAnimal.Id); } } \ No newline at end of file diff --git a/force-app/main/default/classes/ProfilePictureControllerTest.cls-meta.xml b/force-app/main/default/classes/ProfilePictureControllerTest.cls-meta.xml index b1a915c9..f5e18fd1 100644 --- a/force-app/main/default/classes/ProfilePictureControllerTest.cls-meta.xml +++ b/force-app/main/default/classes/ProfilePictureControllerTest.cls-meta.xml @@ -1,5 +1,5 @@ - 59.0 + 60.0 Active diff --git a/force-app/main/default/classes/W3WInvocableCallout.cls b/force-app/main/default/classes/W3WInvocableCallout.cls index 99f0cbbc..d6ca43a2 100644 --- a/force-app/main/default/classes/W3WInvocableCallout.cls +++ b/force-app/main/default/classes/W3WInvocableCallout.cls @@ -11,7 +11,7 @@ **/ public with sharing class W3WInvocableCallout { - @InvocableMethod(label='Get W3W Coordinates' description='Returns the Latitude and Longitude of the W3W provided' category='Animal') + @InvocableMethod(Label='Get W3W Coordinates' Description='Returns the Latitude and Longitude of the W3W provided' Category='Animal') public static List getW3WCoordinates(List animals) { for (animalshelters__Animal__c theAnimal : animals) { @@ -20,14 +20,14 @@ public with sharing class W3WInvocableCallout { return null; } - @future(callout=true) + @Future(Callout=true) public static void updateAnimal(String theAnimalStr ) { animalshelters__Animal__c theAnimal = (animalshelters__Animal__c)JSON.deserialize(theAnimalStr, animalshelters__Animal__c.class); //Add key as a Custom setting animalshelters__Animal_Shelter_Settings__c apikey = animalshelters__Animal_Shelter_Settings__c.getOrgDefaults(); - string w3wkey = apikey.animalshelters__What3Words_API_Key__c; + String w3wkey = apikey.animalshelters__What3Words_API_Key__c; Http http = new Http(); HttpRequest request = new HttpRequest(); @@ -38,11 +38,11 @@ public with sharing class W3WInvocableCallout { request.setMethod('GET'); HttpResponse response = http.send(request); // If the request is successful, parse the JSON response. - if (response.getStatusCode() == 200 && Schema.sObjectType.animalshelters__Animal__c.isAccessible() && Schema.sObjectType.animalshelters__Animal__c.fields.animalshelters__Geolocation__c.isAccessible()){ + if (response.getStatusCode() == 200 && Schema.SObjectType.animalshelters__Animal__c.isAccessible() && Schema.SObjectType.animalshelters__Animal__c.fields.animalshelters__Geolocation__c.isAccessible()){ // Deserialize the JSON string into collections of primitive data types. What3Words theResult = What3Words.parse(response.getBody()); - theAnimal.animalshelters__Geolocation__latitude__s = theResult.coordinates.lat; - theAnimal.animalshelters__Geolocation__longitude__s = theResult.coordinates.lng; + theAnimal.animalshelters__Geolocation__Latitude__s = theResult.coordinates.lat; + theAnimal.animalshelters__Geolocation__Longitude__s = theResult.coordinates.lng; update theAnimal; } } diff --git a/force-app/main/default/classes/W3WInvocableCallout.cls-meta.xml b/force-app/main/default/classes/W3WInvocableCallout.cls-meta.xml index b1a915c9..f5e18fd1 100644 --- a/force-app/main/default/classes/W3WInvocableCallout.cls-meta.xml +++ b/force-app/main/default/classes/W3WInvocableCallout.cls-meta.xml @@ -1,5 +1,5 @@ - 59.0 + 60.0 Active diff --git a/force-app/main/default/classes/W3WInvocableCalloutTest.cls b/force-app/main/default/classes/W3WInvocableCalloutTest.cls index 7202def8..409eb0bb 100644 --- a/force-app/main/default/classes/W3WInvocableCalloutTest.cls +++ b/force-app/main/default/classes/W3WInvocableCalloutTest.cls @@ -5,20 +5,21 @@ * @last modified on : 10-17-2023 * @last modified by : Stewart Anderson **/ -@isTest +@IsTest private class W3WInvocableCalloutTest { - @isTest static void testCallout() { + @IsTest + static void testCallout() { Test.setMock(HttpCalloutMock.class, new MockW3WResponseGenerator()); - animalshelters__Animal__c theAnimal = new animalshelters__Animal__c(animalshelters__Date_of_Arrival__c = Date.Today(), animalshelters__what3words__c = 'whips.vanish.store'); + animalshelters__Animal__c theAnimal = new animalshelters__Animal__c(animalshelters__Date_of_Arrival__c = Date.today(), animalshelters__what3words__c = 'whips.vanish.store'); insert theAnimal; List animals = new List(); animals.add(theAnimal); - test.startTest(); + Test.startTest(); W3WInvocableCallout.getW3WCoordinates(animals); - test.stopTest(); + Test.stopTest(); } } \ No newline at end of file diff --git a/force-app/main/default/classes/W3WInvocableCalloutTest.cls-meta.xml b/force-app/main/default/classes/W3WInvocableCalloutTest.cls-meta.xml index b1a915c9..f5e18fd1 100644 --- a/force-app/main/default/classes/W3WInvocableCalloutTest.cls-meta.xml +++ b/force-app/main/default/classes/W3WInvocableCalloutTest.cls-meta.xml @@ -1,5 +1,5 @@ - 59.0 + 60.0 Active diff --git a/force-app/main/default/classes/What3Words.cls-meta.xml b/force-app/main/default/classes/What3Words.cls-meta.xml index b1a915c9..f5e18fd1 100644 --- a/force-app/main/default/classes/What3Words.cls-meta.xml +++ b/force-app/main/default/classes/What3Words.cls-meta.xml @@ -1,5 +1,5 @@ - 59.0 + 60.0 Active diff --git a/force-app/main/default/classes/What3WordsTest.cls b/force-app/main/default/classes/What3WordsTest.cls index 2eef9bab..b73eec72 100644 --- a/force-app/main/default/classes/What3WordsTest.cls +++ b/force-app/main/default/classes/What3WordsTest.cls @@ -5,10 +5,10 @@ * @last modified on : 10-17-2023 * @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc **/ -@isTest +@IsTest private class What3WordsTest { - @isTest + @IsTest static void testParse_ValidJson() { String json = '{"country":"United States","square":{"southwest":{"lng":-77.036604,"lat":38.897626},"northeast":{"lng":-77.036505,"lat":38.897725}},"nearestPlace":"White House, Washington D.C.","coordinates":{"lng":-77.036572,"lat":38.897675},"words":"filled.count.soap","language":"en","map":"https://w3w.co/filled.count.soap"}'; @@ -30,7 +30,7 @@ private class What3WordsTest { System.assertEquals(38.897675, coordinates.lat); } - @isTest + @IsTest static void testParse_NullValues() { String json = '{"country":null,"square":null,"nearestPlace":null,"coordinates":null,"words":null,"language":null,"map":null}'; @@ -45,7 +45,7 @@ private class What3WordsTest { System.assertEquals(null, w3w.coordinates); } - @isTest + @IsTest static void testConsumeObject_StartObject() { String json = '{ "obj": { "prop": "value" } }'; @@ -59,7 +59,7 @@ private class What3WordsTest { System.assertEquals(System.JSONToken.END_OBJECT, parser.getCurrentToken()); } - @isTest + @IsTest static void testConsumeObject_StartArray() { String json = '{ "arr": [ "value" ] }'; @@ -73,7 +73,7 @@ private class What3WordsTest { System.assertEquals(System.JSONToken.END_ARRAY, parser.getCurrentToken()); } - @isTest + @IsTest static void testConsumeObject_MultipleObjects() { String json = '{ "obj1": { "prop1": "value1" }, "obj2": { "prop2": "value2" } }'; @@ -90,7 +90,7 @@ private class What3WordsTest { System.assertEquals(System.JSONToken.END_OBJECT, parser.getCurrentToken()); } - @isTest + @IsTest static void testSquare_ValidJson() { String json = '{ "southwest": { "lng": -77.036604, "lat": 38.897626 }, "northeast": { "lng": -77.036505, "lat": 38.897725 } }'; @@ -102,7 +102,7 @@ private class What3WordsTest { System.assertEquals(38.897725, square.northeast.lat); } - @isTest + @IsTest static void testSouthwest_ValidJson() { String json = '{ "lng": -77.036572, "lat": 38.897675 }'; diff --git a/force-app/main/default/classes/What3WordsTest.cls-meta.xml b/force-app/main/default/classes/What3WordsTest.cls-meta.xml index b1a915c9..f5e18fd1 100644 --- a/force-app/main/default/classes/What3WordsTest.cls-meta.xml +++ b/force-app/main/default/classes/What3WordsTest.cls-meta.xml @@ -1,5 +1,5 @@ - 59.0 + 60.0 Active diff --git a/force-app/main/default/dashboards/AnimalShelterDashboards/dklAwhHHpHBzWUoGiQclJudQrVYlhU.dashboard-meta.xml b/force-app/main/default/dashboards/AnimalShelterDashboards/dklAwhHHpHBzWUoGiQclJudQrVYlhU.dashboard-meta.xml index 245ef423..e7ab74d4 100644 --- a/force-app/main/default/dashboards/AnimalShelterDashboards/dklAwhHHpHBzWUoGiQclJudQrVYlhU.dashboard-meta.xml +++ b/force-app/main/default/dashboards/AnimalShelterDashboards/dklAwhHHpHBzWUoGiQclJudQrVYlhU.dashboard-meta.xml @@ -174,8 +174,8 @@ SpecifiedUser Default Dashboard for Animal Shelter Starter true - test-tpvqkbctykbo@example.com - test-tpvqkbctykbo@example.com + test-hqdi7iuf2chk@example.com + test-hqdi7iuf2chk@example.com #000000 Animal Shelter Dashboard #000000 diff --git a/force-app/main/default/flexipages/Animal_Record_Page.flexipage-meta.xml b/force-app/main/default/flexipages/Animal_Record_Page.flexipage-meta.xml index 52358f43..871abb60 100644 --- a/force-app/main/default/flexipages/Animal_Record_Page.flexipage-meta.xml +++ b/force-app/main/default/flexipages/Animal_Record_Page.flexipage-meta.xml @@ -2317,6 +2317,12 @@ Facet + + + animalBadge + animalshelters_animalBadge + + diff --git a/force-app/main/default/flexipages/Shelter_UtilityBar.flexipage-meta.xml b/force-app/main/default/flexipages/Shelter_UtilityBar.flexipage-meta.xml index 59c40b40..7de9fc3a 100644 --- a/force-app/main/default/flexipages/Shelter_UtilityBar.flexipage-meta.xml +++ b/force-app/main/default/flexipages/Shelter_UtilityBar.flexipage-meta.xml @@ -20,7 +20,7 @@ entityName - animalshelters__Animal__c + Animal__c filterName diff --git a/force-app/main/default/flows/Adopter_Profile.flow-meta.xml b/force-app/main/default/flows/Adopter_Profile.flow-meta.xml index 58cc3556..f0510396 100644 --- a/force-app/main/default/flows/Adopter_Profile.flow-meta.xml +++ b/force-app/main/default/flows/Adopter_Profile.flow-meta.xml @@ -31,7 +31,7 @@ Call_Auto_match_Subflow - AND( {!$Setup.animalshelters__Animal_Shelter_Settings__c.animalshelters__Enable_Auto_Match__c}=TRUE, {!$Record.Active__c}=TRUE, ISPICKVAL({!$Record.Profile_Approval_Status__c},'Approved')) + AND( {!$Setup.Animal_Shelter_Settings__c.Enable_Auto_Match__c}=TRUE, {!$Record.Active__c}=TRUE, ISPICKVAL({!$Record.Profile_Approval_Status__c},'Approved')) Adopter_Profile__c Update RecordAfterSave diff --git a/force-app/main/default/flows/Adoption_Create_Adoption_Record_SubFlow.flow-meta.xml b/force-app/main/default/flows/Adoption_Create_Adoption_Record_SubFlow.flow-meta.xml index 4eaaa989..536940e7 100644 --- a/force-app/main/default/flows/Adoption_Create_Adoption_Record_SubFlow.flow-meta.xml +++ b/force-app/main/default/flows/Adoption_Create_Adoption_Record_SubFlow.flow-meta.xml @@ -1,6 +1,6 @@ - 59.0 + 60.0 [Animal Shelter] Create adoption record Sub flow Default Adoption - Create Adoption Record SubFlow {!$Flow.CurrentDateTime} diff --git a/force-app/main/default/flows/Adoption_Start_Adoption_Process.flow-meta.xml b/force-app/main/default/flows/Adoption_Start_Adoption_Process.flow-meta.xml index e981d701..626a017a 100644 --- a/force-app/main/default/flows/Adoption_Start_Adoption_Process.flow-meta.xml +++ b/force-app/main/default/flows/Adoption_Start_Adoption_Process.flow-meta.xml @@ -443,7 +443,7 @@ Automatch_On or - $Setup.animalshelters__Animal_Shelter_Settings__c.animalshelters__Enable_Auto_Match__c + $Setup.Animal_Shelter_Settings__c.Enable_Auto_Match__c EqualTo true diff --git a/force-app/main/default/flows/Animal_Action_Close_Associated_Task.flow-meta.xml b/force-app/main/default/flows/Animal_Action_Close_Associated_Task.flow-meta.xml index 7c5e7750..c4deb087 100644 --- a/force-app/main/default/flows/Animal_Action_Close_Associated_Task.flow-meta.xml +++ b/force-app/main/default/flows/Animal_Action_Close_Associated_Task.flow-meta.xml @@ -1,6 +1,6 @@ - 59.0 + 60.0 Assign_Task_Status @@ -43,6 +43,7 @@ [Animal Shelter] - On completion of Animal Action the associated Task is marked as complete, and Animal Action fields are updated Default Animal Action - Close Associated Task {!$Flow.CurrentDateTime} + true BuilderType diff --git a/force-app/main/default/flows/Animal_Action_Create_Platform_Event.flow-meta.xml b/force-app/main/default/flows/Animal_Action_Create_Platform_Event.flow-meta.xml new file mode 100644 index 00000000..f74ca2f4 --- /dev/null +++ b/force-app/main/default/flows/Animal_Action_Create_Platform_Event.flow-meta.xml @@ -0,0 +1,59 @@ + + + 60.0 + [Animal Shelter Starter] - Creates a Platform Event for Badge Update on record create or update + Default + Animal Action - Create Platform Event {!$Flow.CurrentDateTime} + true + + + BuilderType + + LightningFlowBuilder + + + + CanvasMode + + AUTO_LAYOUT_CANVAS + + + + OriginBuilderType + + LightningFlowBuilder + + + AutoLaunchedFlow + + Create_Platform_Event + + 176 + 323 + + Record_ID__c + + $Record.Animal__r.Id + + + + Update_Type__c + + Action + + + Animal_Update_Event__e + true + + + 50 + 0 + + Create_Platform_Event + + Animal_Action__c + CreateAndUpdate + RecordAfterSave + + Active + diff --git a/force-app/main/default/flows/Animal_Action_Create_Task_for_new_Actions.flow-meta.xml b/force-app/main/default/flows/Animal_Action_Create_Task_for_new_Actions.flow-meta.xml index 6a0f992a..91a218a0 100644 --- a/force-app/main/default/flows/Animal_Action_Create_Task_for_new_Actions.flow-meta.xml +++ b/force-app/main/default/flows/Animal_Action_Create_Task_for_new_Actions.flow-meta.xml @@ -1,6 +1,6 @@ - 59.0 + 60.0 If the Animal Action record is created as completed, then the task is marked as completed @@ -34,6 +34,7 @@ Default Animal Action - Create Task for new Actions {!$Flow.CurrentDateTime} + true BuilderType diff --git a/force-app/main/default/flows/Animal_Action_Deleted_Action_Platform_Event.flow-meta.xml b/force-app/main/default/flows/Animal_Action_Deleted_Action_Platform_Event.flow-meta.xml new file mode 100644 index 00000000..aa5ebdd5 --- /dev/null +++ b/force-app/main/default/flows/Animal_Action_Deleted_Action_Platform_Event.flow-meta.xml @@ -0,0 +1,59 @@ + + + 60.0 + Creates a platform event when an action is deleted. + Default + Animal Action - Deleted Action Platform Event {!$Flow.CurrentDateTime} + true + + + BuilderType + + LightningFlowBuilder + + + + CanvasMode + + AUTO_LAYOUT_CANVAS + + + + OriginBuilderType + + LightningFlowBuilder + + + AutoLaunchedFlow + + Create_Platform_Event + + 176 + 287 + + Record_ID__c + + $Record.Animal__r.Id + + + + Update_Type__c + + AnimalAlertDelete + + + Animal_Update_Event__e + true + + + 50 + 0 + + Create_Platform_Event + + Animal_Action__c + Delete + RecordBeforeDelete + + Active + diff --git a/force-app/main/default/flows/Animal_Adoption_Update_Automation.flow-meta.xml b/force-app/main/default/flows/Animal_Adoption_Update_Automation.flow-meta.xml index 42b8b2ff..f402db8c 100644 --- a/force-app/main/default/flows/Animal_Adoption_Update_Automation.flow-meta.xml +++ b/force-app/main/default/flows/Animal_Adoption_Update_Automation.flow-meta.xml @@ -1,6 +1,6 @@ - 59.0 + 60.0 On Adoption Status = Adopted, Update Contact Flag, Clear current and create new Movement record, update Animal status Default Animal - Adoption Update Automation diff --git a/force-app/main/default/flows/Animal_Alert_Alert_Deleted_Event.flow-meta.xml b/force-app/main/default/flows/Animal_Alert_Alert_Deleted_Event.flow-meta.xml new file mode 100644 index 00000000..9f59557d --- /dev/null +++ b/force-app/main/default/flows/Animal_Alert_Alert_Deleted_Event.flow-meta.xml @@ -0,0 +1,59 @@ + + + 60.0 + Create a platform event to show that an alert has been removed. + Default + Animal Alert - Alert Deleted Event {!$Flow.CurrentDateTime} + true + + + BuilderType + + LightningFlowBuilder + + + + CanvasMode + + AUTO_LAYOUT_CANVAS + + + + OriginBuilderType + + LightningFlowBuilder + + + AutoLaunchedFlow + + Animal_Platform_Event + + 176 + 287 + + Record_ID__c + + $Record.Animal__r.Id + + + + Update_Type__c + + AlertDeleted + + + Animal_Update_Event__e + true + + + 50 + 0 + + Animal_Platform_Event + + Animal_Alert__c + Delete + RecordBeforeDelete + + Active + diff --git a/force-app/main/default/flows/Animal_Alert_Create_Platform_Event.flow-meta.xml b/force-app/main/default/flows/Animal_Alert_Create_Platform_Event.flow-meta.xml new file mode 100644 index 00000000..0d3cd0ee --- /dev/null +++ b/force-app/main/default/flows/Animal_Alert_Create_Platform_Event.flow-meta.xml @@ -0,0 +1,59 @@ + + + 60.0 + [Animal Shelters Starter] - Creates a Platform Event for Badge Update when Alert records are Created or Updated + Default + Animal Alert - Create Platform Event {!$Flow.CurrentDateTime} + true + + + BuilderType + + LightningFlowBuilder + + + + CanvasMode + + AUTO_LAYOUT_CANVAS + + + + OriginBuilderType + + LightningFlowBuilder + + + AutoLaunchedFlow + + Create_Platform_Event + + 176 + 323 + + Record_ID__c + + $Record.Animal__r.Id + + + + Update_Type__c + + Alert + + + Animal_Update_Event__e + true + + + 50 + 0 + + Create_Platform_Event + + Animal_Alert__c + CreateAndUpdate + RecordAfterSave + + Active + diff --git a/force-app/main/default/flows/Animal_Animal_Create_Update_Trigger.flow-meta.xml b/force-app/main/default/flows/Animal_Animal_Create_Update_Trigger.flow-meta.xml index d3676429..af0db86a 100644 --- a/force-app/main/default/flows/Animal_Animal_Create_Update_Trigger.flow-meta.xml +++ b/force-app/main/default/flows/Animal_Animal_Create_Update_Trigger.flow-meta.xml @@ -1,6 +1,6 @@ - 59.0 + 60.0 [Animal Shelter] Trigger on Animal record to replace Process Builder Default Animal - Animal Create/Update Trigger {!$Flow.CurrentDateTime} diff --git a/force-app/main/default/flows/Animal_Animal_Location_Flow.flow-meta.xml b/force-app/main/default/flows/Animal_Animal_Location_Flow.flow-meta.xml index 16152202..e2b82c27 100644 --- a/force-app/main/default/flows/Animal_Animal_Location_Flow.flow-meta.xml +++ b/force-app/main/default/flows/Animal_Animal_Location_Flow.flow-meta.xml @@ -1,6 +1,6 @@ - 59.0 + 60.0 Update_w3w_field_for_current_record diff --git a/force-app/main/default/flows/Animal_Block_Capacity_Calculations.flow-meta.xml b/force-app/main/default/flows/Animal_Block_Capacity_Calculations.flow-meta.xml index 155c356a..085f0ab5 100644 --- a/force-app/main/default/flows/Animal_Block_Capacity_Calculations.flow-meta.xml +++ b/force-app/main/default/flows/Animal_Block_Capacity_Calculations.flow-meta.xml @@ -1,11 +1,11 @@ - 59.0 + 60.0 Available_Child_Record_Count - 1373 - 482 + 490 + 974 varAvailableCount AssignCount @@ -20,8 +20,8 @@ Total_Child_Record_Count - 807 - 58 + 314 + 350 varTotalCount AssignCount @@ -44,8 +44,8 @@ No_Records_Found - 821 - 484 + 226 + 758 Loop_Through_Child_Records_that_have_Available_Status @@ -74,8 +74,8 @@ Loop_Through_Child_Records - 528 - 50 + 226 + 242 varLocation varLocationChildRecords Asc @@ -89,8 +89,8 @@ Loop_Through_Child_Records_that_have_Available_Status - 1101 - 479 + 402 + 866 varLocation varLocationChildRecords Asc @@ -110,7 +110,7 @@ CanvasMode - FREE_FORM_CANVAS + AUTO_LAYOUT_CANVAS @@ -123,8 +123,8 @@ Get_Location_Child_Records_with_Available_Status - 531 - 483 + 226 + 650 true No_Records_Found @@ -152,8 +152,8 @@ Get all the Child records for the current Location Get_Locations_Child_Records - 269 - 50 + 226 + 134 false Loop_Through_Child_Records @@ -173,8 +173,8 @@ Set_Available_Capacity_to_Zero - 652 - 669 + 50 + 866 and Id @@ -195,8 +195,8 @@ Update the Available Capacity value on the current Location Update_Available_Capacity_Value - 1104 - 703 + 402 + 1166 and Id @@ -217,8 +217,8 @@ Update the Total Capacity value on the current Location Update_Total_Capacity_Value - 531 - 295 + 226 + 542 Get_Location_Child_Records_with_Available_Status @@ -239,8 +239,8 @@ Locations__c - 50 - 50 + 100 + 0 Get_Locations_Child_Records diff --git a/force-app/main/default/flows/Animal_Block_Status_Change.flow-meta.xml b/force-app/main/default/flows/Animal_Block_Status_Change.flow-meta.xml index 48271aaa..363aa897 100644 --- a/force-app/main/default/flows/Animal_Block_Status_Change.flow-meta.xml +++ b/force-app/main/default/flows/Animal_Block_Status_Change.flow-meta.xml @@ -1,6 +1,6 @@ - 59.0 + 60.0 Does the Collection Filter have any values Filtered_Record_Count @@ -430,7 +430,7 @@ Start_Screen - Draft + Active Get_Unit_RecordType_Id diff --git a/force-app/main/default/flows/Animal_Breeds_Migration_Flow.flow-meta.xml b/force-app/main/default/flows/Animal_Breeds_Migration_Flow.flow-meta.xml index c56c3915..ba58e92f 100644 --- a/force-app/main/default/flows/Animal_Breeds_Migration_Flow.flow-meta.xml +++ b/force-app/main/default/flows/Animal_Breeds_Migration_Flow.flow-meta.xml @@ -1,6 +1,6 @@ - 59.0 + 60.0 Build_List_of_Records_to_Update diff --git a/force-app/main/default/flows/Animal_Condition_Delete_Platform_Event.flow-meta.xml b/force-app/main/default/flows/Animal_Condition_Delete_Platform_Event.flow-meta.xml new file mode 100644 index 00000000..cc377816 --- /dev/null +++ b/force-app/main/default/flows/Animal_Condition_Delete_Platform_Event.flow-meta.xml @@ -0,0 +1,59 @@ + + + 60.0 + Creates a platform event when a condition is deleted. + Default + Animal Condition - Delete Platform Event {!$Flow.CurrentDateTime} + true + + + BuilderType + + LightningFlowBuilder + + + + CanvasMode + + AUTO_LAYOUT_CANVAS + + + + OriginBuilderType + + LightningFlowBuilder + + + AutoLaunchedFlow + + Create_Platform_event + + 176 + 287 + + Record_ID__c + + $Record.Animal__r.Id + + + + Update_Type__c + + ConditionDelete + + + Animal_Update_Event__e + true + + + 50 + 0 + + Create_Platform_event + + Condition__c + Delete + RecordBeforeDelete + + Active + diff --git a/force-app/main/default/flows/Animal_Create_Reciprocal_Animal_Relationship.flow-meta.xml b/force-app/main/default/flows/Animal_Create_Reciprocal_Animal_Relationship.flow-meta.xml index 681d70c0..d80e6f2b 100644 --- a/force-app/main/default/flows/Animal_Create_Reciprocal_Animal_Relationship.flow-meta.xml +++ b/force-app/main/default/flows/Animal_Create_Reciprocal_Animal_Relationship.flow-meta.xml @@ -1,6 +1,6 @@ - 59.0 + 60.0 [Animal Shelter] Creates a Reciprocal Relationship for an Animal Relationship when a new record is created. Default Animal - Create Reciprocal Animal Relationship diff --git a/force-app/main/default/flows/Animal_Deceased_Animal_Flow.flow-meta.xml b/force-app/main/default/flows/Animal_Deceased_Animal_Flow.flow-meta.xml index 1e60e85c..43d019ad 100644 --- a/force-app/main/default/flows/Animal_Deceased_Animal_Flow.flow-meta.xml +++ b/force-app/main/default/flows/Animal_Deceased_Animal_Flow.flow-meta.xml @@ -1,6 +1,6 @@ - 59.0 + 60.0 Create_Animal_record_for_Update diff --git a/force-app/main/default/flows/Animal_Exercise_Action_Completion.flow-meta.xml b/force-app/main/default/flows/Animal_Exercise_Action_Completion.flow-meta.xml index 5a08c0ad..57c5bf14 100644 --- a/force-app/main/default/flows/Animal_Exercise_Action_Completion.flow-meta.xml +++ b/force-app/main/default/flows/Animal_Exercise_Action_Completion.flow-meta.xml @@ -1,6 +1,6 @@ - 59.0 + 60.0 AnimalActionExerciseRecordChoice String diff --git a/force-app/main/default/flows/Animal_Find_Adoption_Match.flow-meta.xml b/force-app/main/default/flows/Animal_Find_Adoption_Match.flow-meta.xml index 3569f10f..9b55b646 100644 --- a/force-app/main/default/flows/Animal_Find_Adoption_Match.flow-meta.xml +++ b/force-app/main/default/flows/Animal_Find_Adoption_Match.flow-meta.xml @@ -138,7 +138,7 @@ Call_Auto_Match_Subflow true - AND( {!$Setup.animalshelters__Animal_Shelter_Settings__c.animalshelters__Enable_Auto_Match__c}=TRUE, ISPICKVAL({!$Record.Animal_Status__c},'Available for Adoption')) + AND( {!$Setup.Animal_Shelter_Settings__c.Enable_Auto_Match__c}=TRUE, ISPICKVAL({!$Record.Animal_Status__c},'Available for Adoption')) Animal__c Update RecordAfterSave diff --git a/force-app/main/default/flows/Animal_Generate_Animal_Name_on_Record_Create.flow-meta.xml b/force-app/main/default/flows/Animal_Generate_Animal_Name_on_Record_Create.flow-meta.xml index 8e9046f9..74b8b981 100644 --- a/force-app/main/default/flows/Animal_Generate_Animal_Name_on_Record_Create.flow-meta.xml +++ b/force-app/main/default/flows/Animal_Generate_Animal_Name_on_Record_Create.flow-meta.xml @@ -51,7 +51,7 @@ Set_Animal_Name - AND({!$Setup.animalshelters__Animal_Shelter_Settings__c.animalshelters__Default_Animal_Name__c},ISNULL({!$Record.Animal_Name__c})) + AND({!$Setup.Animal_Shelter_Settings__c.Default_Animal_Name__c},ISNULL({!$Record.Animal_Name__c})) Animal__c Create RecordAfterSave diff --git a/force-app/main/default/flows/Animal_Generate_Tasks_Subflow.flow-meta.xml b/force-app/main/default/flows/Animal_Generate_Tasks_Subflow.flow-meta.xml index 0e1c8632..0d384b49 100644 --- a/force-app/main/default/flows/Animal_Generate_Tasks_Subflow.flow-meta.xml +++ b/force-app/main/default/flows/Animal_Generate_Tasks_Subflow.flow-meta.xml @@ -1,6 +1,6 @@ - 59.0 + 60.0 Assign_Queue_as_Owner @@ -294,8 +294,8 @@ taskSubjectFormula String - IF( - {!Movement}, {!Get_Animal_Details.Animal_Name__c} + " needs to be moved to " + {!Get_Current_Movement_Record.Location_Name__c}, {!Get_Animal_Action_Record.Action_Type__c} + " action for " + {!Get_Animal_Details.Animal_Name__c}) + IF({!Movement}, +{!Get_Animal_Details.Animal_Name__c} + " needs to be moved to " +{!Get_Current_Movement_Record.Location_Name__c}, {!Get_Animal_Action_Record.Action_Type__c} + " action for " + {!Get_Animal_Details.Animal_Name__c}) Animal - Generate Tasks Subflow true @@ -441,6 +441,7 @@ Group true + SystemModeWithoutSharing 320 0 diff --git a/force-app/main/default/flows/Animal_Get_What3Words_Coordinates.flow-meta.xml b/force-app/main/default/flows/Animal_Get_What3Words_Coordinates.flow-meta.xml index 7b3691c2..f558bb85 100644 --- a/force-app/main/default/flows/Animal_Get_What3Words_Coordinates.flow-meta.xml +++ b/force-app/main/default/flows/Animal_Get_What3Words_Coordinates.flow-meta.xml @@ -49,7 +49,7 @@ Get_What3Words_Coordinates - AND(NOT(ISBLANK({!$Record.what3words__c})),ISCHANGED({!$Record.what3words__c}),NOT(ISBLANK({!$Setup.animalshelters__Animal_Shelter_Settings__c.animalshelters__What3Words_API_Key__c}))) + AND(NOT(ISBLANK({!$Record.what3words__c})),ISCHANGED({!$Record.what3words__c}),NOT(ISBLANK({!$Setup.Animal_Shelter_Settings__c.What3Words_API_Key__c}))) Animal__c CreateAndUpdate RecordAfterSave diff --git a/force-app/main/default/flows/Animal_Movement_SubFlow.flow-meta.xml b/force-app/main/default/flows/Animal_Movement_SubFlow.flow-meta.xml index 1b6aa0b7..e367cb3a 100644 --- a/force-app/main/default/flows/Animal_Movement_SubFlow.flow-meta.xml +++ b/force-app/main/default/flows/Animal_Movement_SubFlow.flow-meta.xml @@ -153,7 +153,7 @@ Yes and - $Setup.animalshelters__Animal_Shelter_Settings__c.animalshelters__Enable_Movement_Tasks__c + $Setup.Animal_Shelter_Settings__c.Enable_Movement_Tasks__c EqualTo true diff --git a/force-app/main/default/flows/Animal_RecordType_Subflow.flow-meta.xml b/force-app/main/default/flows/Animal_RecordType_Subflow.flow-meta.xml index 643f09d8..9bf42b87 100644 --- a/force-app/main/default/flows/Animal_RecordType_Subflow.flow-meta.xml +++ b/force-app/main/default/flows/Animal_RecordType_Subflow.flow-meta.xml @@ -1,6 +1,6 @@ - 59.0 + 60.0 Return_RecordTypeId @@ -48,6 +48,7 @@ [Animal Shelter] Generic Subflow to return the Record Type Id for a given sObject and DeveloperName Default Animal - RecordType Subflow {!$Flow.CurrentDateTime} + true Loop_through_Matching_RecordTypes diff --git a/force-app/main/default/flows/Assessment_Update_Behaviours_on_Animal.flow-meta.xml b/force-app/main/default/flows/Assessment_Update_Behaviours_on_Animal.flow-meta.xml index ac62bc08..d61506fe 100644 --- a/force-app/main/default/flows/Assessment_Update_Behaviours_on_Animal.flow-meta.xml +++ b/force-app/main/default/flows/Assessment_Update_Behaviours_on_Animal.flow-meta.xml @@ -74,7 +74,7 @@ Get_Animal_Record - {!$Setup.animalshelters__Animal_Shelter_Settings__c.animalshelters__Disable_Behaviour_Update__c}= FALSE + {!$Setup.Animal_Shelter_Settings__c.Disable_Behaviour_Update__c}= FALSE Assessment__c Create RecordAfterSave diff --git a/force-app/main/default/flows/Condition_Create_Platform_Event.flow-meta.xml b/force-app/main/default/flows/Condition_Create_Platform_Event.flow-meta.xml new file mode 100644 index 00000000..8a4094e6 --- /dev/null +++ b/force-app/main/default/flows/Condition_Create_Platform_Event.flow-meta.xml @@ -0,0 +1,59 @@ + + + 60.0 + [Animal Shelter Starter] - Creates a Platform Event for Badge Update on record create or update + Default + Condition - Create Platform Event {!$Flow.CurrentDateTime} + true + + + BuilderType + + LightningFlowBuilder + + + + CanvasMode + + AUTO_LAYOUT_CANVAS + + + + OriginBuilderType + + LightningFlowBuilder + + + AutoLaunchedFlow + + Create_Platform_Event + + 176 + 323 + + Record_ID__c + + $Record.Animal__r.Id + + + + Update_Type__c + + Condition + + + Animal_Update_Event__e + true + + + 50 + 0 + + Create_Platform_Event + + Condition__c + CreateAndUpdate + RecordAfterSave + + Active + diff --git a/force-app/main/default/flows/Task_Close_associated_Animal_Action.flow-meta.xml b/force-app/main/default/flows/Task_Close_associated_Animal_Action.flow-meta.xml index f50cb0e2..f231c23e 100644 --- a/force-app/main/default/flows/Task_Close_associated_Animal_Action.flow-meta.xml +++ b/force-app/main/default/flows/Task_Close_associated_Animal_Action.flow-meta.xml @@ -1,9 +1,10 @@ - 59.0 + 60.0 [Animal Shelter] - When a Task is marked as complete the associated Animal Action Record is marked as completed Default Task - Close associated Animal Action {!$Flow.CurrentDateTime} + true BuilderType @@ -105,5 +106,5 @@ CreateAndUpdate RecordAfterSave - Active + Draft diff --git a/force-app/main/default/globalValueSets/Animal_Type.globalValueSet-meta.xml b/force-app/main/default/globalValueSets/Animal_Type.globalValueSet-meta.xml index 9689050e..a64c0d63 100644 --- a/force-app/main/default/globalValueSets/Animal_Type.globalValueSet-meta.xml +++ b/force-app/main/default/globalValueSets/Animal_Type.globalValueSet-meta.xml @@ -81,16 +81,16 @@ - Reptile + Fish false false - + - Fish + Reptile false false - + [Animal Shelter] Types of Animals Animal Type diff --git a/force-app/main/default/layouts/Contact-Animal Shelter Contact Page Layout.layout-meta.xml b/force-app/main/default/layouts/Contact-Animal Shelter Contact Page Layout.layout-meta.xml index 6f692e40..bb31dc53 100644 --- a/force-app/main/default/layouts/Contact-Animal Shelter Contact Page Layout.layout-meta.xml +++ b/force-app/main/default/layouts/Contact-Animal Shelter Contact Page Layout.layout-meta.xml @@ -171,6 +171,41 @@ Record + + NewCase + QuickAction + 3 + + + NewEvent + QuickAction + 4 + + + SendEmail + QuickAction + 5 + + + PrintableView + StandardButton + 6 + + + ChangeOwnerOne + StandardButton + 7 + + + Edit + StandardButton + 8 + + + CreateSurveyInvitation + StandardButton + 9 + Clone StandardButton @@ -246,41 +281,6 @@ QuickAction 2 - - NewCase - QuickAction - 3 - - - NewEvent - QuickAction - 4 - - - SendEmail - QuickAction - 5 - - - PrintableView - StandardButton - 6 - - - ChangeOwnerOne - StandardButton - 7 - - - Edit - StandardButton - 8 - - - CreateSurveyInvitation - StandardButton - 9 - diff --git a/force-app/main/default/lwc/animalBadge/__tests__/animalBadge.test.js b/force-app/main/default/lwc/animalBadge/__tests__/animalBadge.test.js new file mode 100644 index 00000000..475f66c7 --- /dev/null +++ b/force-app/main/default/lwc/animalBadge/__tests__/animalBadge.test.js @@ -0,0 +1,25 @@ +import { createElement } from 'lwc'; +import AnimalBadge from 'c/animalBadge'; + +describe('c-animal-badge', () => { + afterEach(() => { + // The jsdom instance is shared across test cases in a single file so reset the DOM + while (document.body.firstChild) { + document.body.removeChild(document.body.firstChild); + } + }); + + it('TODO: test case generated by CLI command, please fill in test logic', () => { + // Arrange + const element = createElement('c-animal-badge', { + is: AnimalBadge + }); + + // Act + document.body.appendChild(element); + + // Assert + // const div = element.shadowRoot.querySelector('div'); + expect(1).toBe(1); + }); +}); \ No newline at end of file diff --git a/force-app/main/default/lwc/animalBadge/animalBadge.css b/force-app/main/default/lwc/animalBadge/animalBadge.css new file mode 100644 index 00000000..0f7d8964 --- /dev/null +++ b/force-app/main/default/lwc/animalBadge/animalBadge.css @@ -0,0 +1,20 @@ +/** + * Created by stewart.anderson on 05/04/2024. + */ +.exercise{ + --slds-c-badge-text-color: white; + --slds-c-badge-color-background: #9050e9; +} + +.treatment{ + --slds-c-badge-color-background: #fb538a; +} + +.vaccination{ + --slds-c-badge-text-color: white; + --slds-c-badge-color-background: #2796ff; +} + +.condition { + --slds-c-badge-color-background: #fb5d2e; +} \ No newline at end of file diff --git a/force-app/main/default/lwc/animalBadge/animalBadge.html b/force-app/main/default/lwc/animalBadge/animalBadge.html new file mode 100644 index 00000000..1b918f5c --- /dev/null +++ b/force-app/main/default/lwc/animalBadge/animalBadge.html @@ -0,0 +1,24 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/animalBadge/animalBadge.js b/force-app/main/default/lwc/animalBadge/animalBadge.js new file mode 100644 index 00000000..2f4246c8 --- /dev/null +++ b/force-app/main/default/lwc/animalBadge/animalBadge.js @@ -0,0 +1,68 @@ +/** + * @description : Animal Badges - Displays badges for various Animal Statuses + * @author : Chris Rolfe + * @group : + * @last modified on : 01-04-2024 + * @last modified by : Chris Rolfe +**/ +import { LightningElement, api, wire } from 'lwc'; +import { subscribe, unsubscribe, onError } from 'lightning/empApi'; +import { refreshApex } from '@salesforce/apex'; +import getRelatedBadges from '@salesforce/apex/AnimalBadgeController.getRelatedBadges'; + +export default class AnimalBadge extends LightningElement { + @api recordId; + badges = {}; + channelName = '/event/animalshelters__Animal_Update_Event__e'; + subscription = {}; + wiredBadgesResult; + + //Get initial statuses of Badges for current Animal + @wire(getRelatedBadges, {animalId: '$recordId'}) + wiredBadges(response) { + this.wiredBadgesResult = response; + const { data, error } = response; + if (data) { + this.badges = data; + console.log('Badges: ', data); + } else if (error) { + console.error(error); + } + } + + // Initial Component Setup + connectedCallback() { + this.registerErrorListener(); + this.subscribeToPE(); + } + + disconnectedCallback() { + // Invoke unsubscribe + unsubscribe(this.subscription, response => { + console.log('Unsubscribed from: ', response.channel); + }); + } + + // Subscribe to Platform Event + subscribeToPE() { + const messageCallback = (response) => { + console.log('New message received: ', JSON.stringify(response)); + // Check if the event is for the current Animal + if (response.data.payload.animalshelters__Record_ID__c === this.recordId){ + refreshApex(this.wiredBadgesResult); + } + }; + subscribe(this.channelName, -1, messageCallback).then(response => { + console.log('Subscription request sent to: ', JSON.stringify(response.channel)); + this.subscription = response; + }); + } + + registerErrorListener() { + // Invoke onError empApi method + onError((error) => { + console.log('Received error from server: ', JSON.stringify(error)); + // Error contains the server-side error + }); + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/animalBadge/animalBadge.js-meta.xml b/force-app/main/default/lwc/animalBadge/animalBadge.js-meta.xml new file mode 100644 index 00000000..1ebc3cce --- /dev/null +++ b/force-app/main/default/lwc/animalBadge/animalBadge.js-meta.xml @@ -0,0 +1,21 @@ + + + 60.0 + true +Animal Badges +Displays badges for various Animal Statuses + + lightning__RecordPage + + + + + animalshelters__Animal__c + + + + + + + + \ No newline at end of file diff --git a/force-app/main/default/lwc/animalShelterSettingsEditor/animalShelterSettingsEditor.html b/force-app/main/default/lwc/animalShelterSettingsEditor/animalShelterSettingsEditor.html index bd31cc4f..947127ae 100644 --- a/force-app/main/default/lwc/animalShelterSettingsEditor/animalShelterSettingsEditor.html +++ b/force-app/main/default/lwc/animalShelterSettingsEditor/animalShelterSettingsEditor.html @@ -185,4 +185,4 @@ - + \ No newline at end of file diff --git a/force-app/main/default/lwc/animalShelterSettingsEditor/animalShelterSettingsEditor.js b/force-app/main/default/lwc/animalShelterSettingsEditor/animalShelterSettingsEditor.js index 9e6ccbf3..05baf92b 100644 --- a/force-app/main/default/lwc/animalShelterSettingsEditor/animalShelterSettingsEditor.js +++ b/force-app/main/default/lwc/animalShelterSettingsEditor/animalShelterSettingsEditor.js @@ -1,5 +1,5 @@ import { LightningElement, wire, track } from 'lwc'; -import { getRecord, updateRecord } from 'lightning/uiRecordApi'; +import { updateRecord } from 'lightning/uiRecordApi'; import getCustomSetting from '@salesforce/apex/AnimalShelterGetCustomSettings.getCustomSettings'; import createDefaultSettings from '@salesforce/apex/AnimalShelterGetCustomSettings.createDefaultSettings'; diff --git a/force-app/main/default/lwc/animalShelterSettingsEditor/animalShelterSettingsEditor.js-meta.xml b/force-app/main/default/lwc/animalShelterSettingsEditor/animalShelterSettingsEditor.js-meta.xml index 1b08a41a..06fd883d 100644 --- a/force-app/main/default/lwc/animalShelterSettingsEditor/animalShelterSettingsEditor.js-meta.xml +++ b/force-app/main/default/lwc/animalShelterSettingsEditor/animalShelterSettingsEditor.js-meta.xml @@ -1,10 +1,10 @@ - 59.0 + 60.0 true Animal Shelter Settings Editor Allows the user to easily change custom settings for Animal Shelter Starter lightning__AppPage - + \ No newline at end of file diff --git a/force-app/main/default/lwc/flowHLine/flowHLine.js b/force-app/main/default/lwc/flowHLine/flowHLine.js index 5bcfe4a2..0f958972 100644 --- a/force-app/main/default/lwc/flowHLine/flowHLine.js +++ b/force-app/main/default/lwc/flowHLine/flowHLine.js @@ -33,6 +33,6 @@ export default class FlowHLine extends LightningElement { } get displayVCard(){ - return (this.vCard === true) ? true : false; + return (this.vCard === true); } } \ No newline at end of file diff --git a/force-app/main/default/lwc/flowHLine/flowHLine.js-meta.xml b/force-app/main/default/lwc/flowHLine/flowHLine.js-meta.xml index 833eab7b..5f4084ae 100644 --- a/force-app/main/default/lwc/flowHLine/flowHLine.js-meta.xml +++ b/force-app/main/default/lwc/flowHLine/flowHLine.js-meta.xml @@ -15,4 +15,4 @@ - + \ No newline at end of file diff --git a/force-app/main/default/lwc/lightningPrintView/lightningPrintView.js b/force-app/main/default/lwc/lightningPrintView/lightningPrintView.js index 5ed6de6c..7f860852 100644 --- a/force-app/main/default/lwc/lightningPrintView/lightningPrintView.js +++ b/force-app/main/default/lwc/lightningPrintView/lightningPrintView.js @@ -32,7 +32,7 @@ export default class LightningPrintPreview extends LightningElement { get qrCodeUrl() { const baseUrl = 'https://' + window.location.hostname; - const qrCodeBaseUrl = 'https://chart.googleapis.com/chart?chs=200x200&cht=qr&chl='; + const qrCodeBaseUrl = 'https://bwipjs-api.metafloor.com/?bcid=qrcode&scale=3&text='; const recordUrl = baseUrl + '/' + this.recordId; return qrCodeBaseUrl + encodeURIComponent(recordUrl); diff --git a/force-app/main/default/lwc/lightningPrintView/lightningPrintView.js-meta.xml b/force-app/main/default/lwc/lightningPrintView/lightningPrintView.js-meta.xml index bd0e881f..53fece2b 100644 --- a/force-app/main/default/lwc/lightningPrintView/lightningPrintView.js-meta.xml +++ b/force-app/main/default/lwc/lightningPrintView/lightningPrintView.js-meta.xml @@ -1,7 +1,7 @@ - 59.0 + 60.0 true Lightning Print View Reusable Print View Component which uses related field sets to print fields. - + \ No newline at end of file diff --git a/force-app/main/default/lwc/lightningVisualPicker/lightningVisualPicker.js b/force-app/main/default/lwc/lightningVisualPicker/lightningVisualPicker.js index 928af324..8c84b00f 100644 --- a/force-app/main/default/lwc/lightningVisualPicker/lightningVisualPicker.js +++ b/force-app/main/default/lwc/lightningVisualPicker/lightningVisualPicker.js @@ -61,7 +61,7 @@ export default class LightningVisualPicker extends LightningElement { } if (this.options.length > 0 - && this.options.length != this.items.length) { + && this.options.length !== this.items.length) { let iterator = 0; let items = []; this.options.forEach(option => { diff --git a/force-app/main/default/lwc/microchipLookup/microchipLookup.html b/force-app/main/default/lwc/microchipLookup/microchipLookup.html index 787f77c3..70b1bb61 100644 --- a/force-app/main/default/lwc/microchipLookup/microchipLookup.html +++ b/force-app/main/default/lwc/microchipLookup/microchipLookup.html @@ -1,10 +1,6 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/microchipLookup/microchipLookup.js b/force-app/main/default/lwc/microchipLookup/microchipLookup.js index 4fd2d319..1f7e2fa4 100644 --- a/force-app/main/default/lwc/microchipLookup/microchipLookup.js +++ b/force-app/main/default/lwc/microchipLookup/microchipLookup.js @@ -127,7 +127,7 @@ export default class MicrochipLookup extends LightningElement { // Ensure there is a MicroChip Number - if (!this.mc_num || this.mc_num == "No MicroChip Number Found. Please Update the record.") { + if (!this.mc_num || this.mc_num === "No MicroChip Number Found. Please Update the record.") { this.errorMessage = "No MicroChip Number Found. Please Update the record." this.handleErrorMessage(this.errorMessage); return; @@ -173,7 +173,7 @@ export default class MicrochipLookup extends LightningElement { variant: 'error', }), ); - return; + } }).then(recDetails => { @@ -197,9 +197,9 @@ export default class MicrochipLookup extends LightningElement { }).catch(error => { this.errorMessage = error this.handleErrorMessage(this.errorMessage); - return + }); } -} +} \ No newline at end of file diff --git a/force-app/main/default/lwc/microchipLookup/microchipLookup.js-meta.xml b/force-app/main/default/lwc/microchipLookup/microchipLookup.js-meta.xml index 9f444c37..aa1eb118 100644 --- a/force-app/main/default/lwc/microchipLookup/microchipLookup.js-meta.xml +++ b/force-app/main/default/lwc/microchipLookup/microchipLookup.js-meta.xml @@ -1,6 +1,6 @@ - 59.0 + 60.0 true MicroChip Details Lookup Checks external database(s) for results from microchip number on animal record @@ -18,4 +18,4 @@ - + \ No newline at end of file diff --git a/force-app/main/default/lwc/recordAlerts/recordAlerts.html b/force-app/main/default/lwc/recordAlerts/recordAlerts.html index e3e07040..6d6062f1 100644 --- a/force-app/main/default/lwc/recordAlerts/recordAlerts.html +++ b/force-app/main/default/lwc/recordAlerts/recordAlerts.html @@ -1,38 +1,29 @@ -