From 6eeadae5ec23a07cafe6f683c89afb514aa7b244 Mon Sep 17 00:00:00 2001 From: Jim Bartek Date: Wed, 29 Mar 2023 14:13:20 -0400 Subject: [PATCH 001/130] init rollupEditor LWC --- .../__tests__/rollupEditor.test.js | 25 +++++++++++++++++++ dlrs/main/lwc/rollupEditor/rollupEditor.html | 3 +++ dlrs/main/lwc/rollupEditor/rollupEditor.js | 3 +++ .../lwc/rollupEditor/rollupEditor.js-meta.xml | 5 ++++ 4 files changed, 36 insertions(+) create mode 100644 dlrs/main/lwc/rollupEditor/__tests__/rollupEditor.test.js create mode 100644 dlrs/main/lwc/rollupEditor/rollupEditor.html create mode 100644 dlrs/main/lwc/rollupEditor/rollupEditor.js create mode 100644 dlrs/main/lwc/rollupEditor/rollupEditor.js-meta.xml diff --git a/dlrs/main/lwc/rollupEditor/__tests__/rollupEditor.test.js b/dlrs/main/lwc/rollupEditor/__tests__/rollupEditor.test.js new file mode 100644 index 00000000..ceeebffe --- /dev/null +++ b/dlrs/main/lwc/rollupEditor/__tests__/rollupEditor.test.js @@ -0,0 +1,25 @@ +import { createElement } from 'lwc'; +import RollupEditor from 'c/rollupEditor'; + +describe('c-rollup-editor', () => { + 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-rollup-editor', { + is: RollupEditor + }); + + // 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/dlrs/main/lwc/rollupEditor/rollupEditor.html b/dlrs/main/lwc/rollupEditor/rollupEditor.html new file mode 100644 index 00000000..27e0f695 --- /dev/null +++ b/dlrs/main/lwc/rollupEditor/rollupEditor.html @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/dlrs/main/lwc/rollupEditor/rollupEditor.js b/dlrs/main/lwc/rollupEditor/rollupEditor.js new file mode 100644 index 00000000..9fbaaacb --- /dev/null +++ b/dlrs/main/lwc/rollupEditor/rollupEditor.js @@ -0,0 +1,3 @@ +import { LightningElement } from 'lwc'; + +export default class RollupEditor extends LightningElement {} \ No newline at end of file diff --git a/dlrs/main/lwc/rollupEditor/rollupEditor.js-meta.xml b/dlrs/main/lwc/rollupEditor/rollupEditor.js-meta.xml new file mode 100644 index 00000000..f8c5cb4a --- /dev/null +++ b/dlrs/main/lwc/rollupEditor/rollupEditor.js-meta.xml @@ -0,0 +1,5 @@ + + + 56.0 + false + \ No newline at end of file From 0a2d244c6e6fea20401c2ca231ba7d34350eee1b Mon Sep 17 00:00:00 2001 From: Jim Bartek Date: Wed, 29 Mar 2023 17:03:20 -0400 Subject: [PATCH 002/130] basic structure and initial sections --- dlrs/main/lwc/rollupEditor/rollupEditor.html | 98 ++++++++++++++++++- dlrs/main/lwc/rollupEditor/rollupEditor.js | 13 ++- .../lwc/rollupEditor/rollupEditor.js-meta.xml | 6 +- 3 files changed, 113 insertions(+), 4 deletions(-) diff --git a/dlrs/main/lwc/rollupEditor/rollupEditor.html b/dlrs/main/lwc/rollupEditor/rollupEditor.html index 27e0f695..35b6825f 100644 --- a/dlrs/main/lwc/rollupEditor/rollupEditor.html +++ b/dlrs/main/lwc/rollupEditor/rollupEditor.html @@ -1,3 +1,99 @@ \ No newline at end of file diff --git a/dlrs/main/lwc/rollupEditor/rollupEditor.js b/dlrs/main/lwc/rollupEditor/rollupEditor.js index 9fbaaacb..419f0aa1 100644 --- a/dlrs/main/lwc/rollupEditor/rollupEditor.js +++ b/dlrs/main/lwc/rollupEditor/rollupEditor.js @@ -1,3 +1,12 @@ -import { LightningElement } from 'lwc'; +import { LightningElement, track } from 'lwc'; -export default class RollupEditor extends LightningElement {} \ No newline at end of file +export default class RollupEditor extends LightningElement { + + @track rollup = { + name: '', + label: '', + relationshipField: '', + relationshipCriteria: '', + relationshipCriteriaFields: '' + }; +} \ No newline at end of file diff --git a/dlrs/main/lwc/rollupEditor/rollupEditor.js-meta.xml b/dlrs/main/lwc/rollupEditor/rollupEditor.js-meta.xml index f8c5cb4a..599be582 100644 --- a/dlrs/main/lwc/rollupEditor/rollupEditor.js-meta.xml +++ b/dlrs/main/lwc/rollupEditor/rollupEditor.js-meta.xml @@ -1,5 +1,9 @@ 56.0 - false + true + + lightning__AppPage + lightning__HomePage + \ No newline at end of file From 176188f7b57902400c74a39b63cd731b3a5fa698 Mon Sep 17 00:00:00 2001 From: Scott Fenton Date: Thu, 30 Mar 2023 12:48:12 -0400 Subject: [PATCH 003/130] Status check lwc and apex controller --- .../LookupRollupStatusCheckController.cls | 195 ++++++++++++++++++ ...upRollupStatusCheckController.cls-meta.xml | 5 + .../rollupStatusCheck/RollupStatusCheck.js | 155 ++++++++++++++ .../rollupStatusCheck/rollupStatusCheck.html | 16 ++ .../rollupStatusCheck.js-meta.xml | 23 +++ 5 files changed, 394 insertions(+) create mode 100644 dlrs/main/classes/LookupRollupStatusCheckController.cls create mode 100644 dlrs/main/classes/LookupRollupStatusCheckController.cls-meta.xml create mode 100644 dlrs/main/lwc/rollupStatusCheck/RollupStatusCheck.js create mode 100644 dlrs/main/lwc/rollupStatusCheck/rollupStatusCheck.html create mode 100644 dlrs/main/lwc/rollupStatusCheck/rollupStatusCheck.js-meta.xml diff --git a/dlrs/main/classes/LookupRollupStatusCheckController.cls b/dlrs/main/classes/LookupRollupStatusCheckController.cls new file mode 100644 index 00000000..eec73fbd --- /dev/null +++ b/dlrs/main/classes/LookupRollupStatusCheckController.cls @@ -0,0 +1,195 @@ +public with sharing class LookupRollupStatusCheckController { + // Global variables + public static LookupRollupSummary2__mdt LookupRollupSummary; + public static List rollups; + public static Map mapRollups; + public static String test = 'test123'; + + /** + * Check if the rollup has any error logs + */ + @AuraEnabled(Cacheable=true) + public static Integer getAssociatedErrorLogs(String lookupID) { + Integer count = [ + SELECT COUNT() + FROM LookupRollupSummaryLog__c + WHERE ParentId__c = :lookupID + ]; + + return count; + } + + /** + * Check if the rollup has a failed calculate rollup jobs + */ + @AuraEnabled(Cacheable=true) + public static String getCalculateJobs(String lookupID) { + Integer count = [ + SELECT COUNT() + FROM LookupRollupCalculateJob__c + WHERE LookupRollupSummaryId__c = :lookupID + ]; + + if (count == 0) { + return 'No Calculate Jobs'; + } + + if (count > 0) { + return 'Calculate Jobs'; + } + + return 'No Calculate Jobs'; + } + + /** + * Check if the rollup has any schedule items + */ + @AuraEnabled(Cacheable=true) + public static Integer getSpecificScheduledItems(String lookupID) { + Integer count = [ + SELECT COUNT() + FROM LookupRollupSummaryScheduleItems__c + WHERE LookupRollupSummary2__c = :lookupID + ]; + + return count; + } + + /** + * Check if the rollup has a Full Calculate schedule + */ + @AuraEnabled(Cacheable=true) + public static String getScheduledFullCalculates(String lookupID) { + try{ + LookupRollupSummary = (LookupRollupSummary2__mdt) new RollupSummariesSelector.CustomMetadataSelector( + false, + true + ) + .selectById(new Set{ lookupID })[0] + .Record; + + if (LookupRollupSummary == null) { + return 'No Schedule for Rollup'; + } + + String id = (LookupRollupSummary.id).to15(); + List ct = new CronTriggersSelector() + .selectScheduledApexById(id); + + if (ct.isEmpty()) { + return 'No Schedule for Rollup'; + } else { + return ct[0].NextFireTime.format(); + } + }catch (Exception e){ + return 'No Schedule for Rollup'; + } + } + + /** + * Check if the rollup has a child/parent trigger + */ + @AuraEnabled(Cacheable=true) + public static String hasChildTriggerDeployed(String lookupID) { + try{ + LookupRollupSummary = (LookupRollupSummary2__mdt) new RollupSummariesSelector.CustomMetadataSelector( + false, + true + ) + .selectById(new Set{ lookupID })[0] + .Record; + + if (LookupRollupSummary == null) { + return 'Not Deployed'; + } + + RollupSummary rs = new RollupSummary(LookupRollupSummary); + String childTrigger = RollupSummaries.makeTriggerName(rs); + ApexTriggersSelector selector = new ApexTriggersSelector(); + Map loadTriggers = selector.selectByName( + new Set{ ChildTrigger } + ); + + if (loadTriggers.size() == 0) { + return 'Not Deployed'; + } + + return 'Deployed'; + } catch (Exception e){ + return 'Not Deployed'; + } +} + + @AuraEnabled(Cacheable=true) + public static String hasParentTriggerDeployed(String lookupID) { + try{ + LookupRollupSummary = (LookupRollupSummary2__mdt) new RollupSummariesSelector.CustomMetadataSelector( + false, + true + ) + .selectById(new Set{ lookupID })[0] + .Record; + + if (LookupRollupSummary == null) { + return 'Not Deployed'; + } + + RollupSummary rs = new RollupSummary(LookupRollupSummary); + String parentTrigger = RollupSummaries.makeParentTriggerName(rs); + ApexTriggersSelector selector = new ApexTriggersSelector(); + Map loadTriggers = selector.selectByName( + new Set{ ParentTrigger } + ); + + if (loadTriggers.size() == 0) { + return 'Not Deployed'; + } + + return 'Deployed'; + } catch (Exception e){ + return 'Not Deployed'; + } +} + + /* + * Rollup - General Status Information + * + */ + + /** + * Check if there are any schedule items in the system + */ + @AuraEnabled(Cacheable=true) + public static Integer getAllScheduledItems() { + Integer count = [SELECT COUNT() FROM LookupRollupSummaryScheduleItems__c]; + + return count; + } + + /** + * Check if cron job is running for DLRS + */ + @AuraEnabled(Cacheable=true) + public static String getScheduledJobs() { + // Check if RollupJob is scheduled + Integer countScheduled = [ + SELECT COUNT() + FROM AsyncApexJob + WHERE + JobType = 'ScheduledApex' + AND status = 'Queued' + AND ApexClass.name LIKE '%RollupJob%' + ]; + + if(countScheduled == 0) { + return 'RollupJob is not scheduled'; + } + + //No need to warn user if scheduled items are going to be processed + if (countScheduled > 0) { + return 'RollupJob is scheduled'; + } + + return 'RollupJob is not scheduled'; + } +} diff --git a/dlrs/main/classes/LookupRollupStatusCheckController.cls-meta.xml b/dlrs/main/classes/LookupRollupStatusCheckController.cls-meta.xml new file mode 100644 index 00000000..9bbf7b4e --- /dev/null +++ b/dlrs/main/classes/LookupRollupStatusCheckController.cls-meta.xml @@ -0,0 +1,5 @@ + + + 56.0 + Active + \ No newline at end of file diff --git a/dlrs/main/lwc/rollupStatusCheck/RollupStatusCheck.js b/dlrs/main/lwc/rollupStatusCheck/RollupStatusCheck.js new file mode 100644 index 00000000..1880890a --- /dev/null +++ b/dlrs/main/lwc/rollupStatusCheck/RollupStatusCheck.js @@ -0,0 +1,155 @@ +import { LightningElement, api } from 'lwc'; +import getAllScheduledItems from '@salesforce/apex/LookupRollupStatusCheckController.getAllScheduledItems'; +import getSpecificScheduledItems from '@salesforce/apex/LookupRollupStatusCheckController.getSpecificScheduledItems'; +import hasChildTriggerDeployed from '@salesforce/apex/LookupRollupStatusCheckController.hasChildTriggerDeployed'; +import hasParentTriggerDeployed from '@salesforce/apex/LookupRollupStatusCheckController.hasParentTriggerDeployed'; +import getScheduledFullCalculates from '@salesforce/apex/LookupRollupStatusCheckController.getScheduledFullCalculates'; +import getCalculateJobs from '@salesforce/apex/LookupRollupStatusCheckController.getCalculateJobs'; +import getScheduledJobs from '@salesforce/apex/LookupRollupStatusCheckController.getScheduledJobs'; + +export default class rollupStatusCheck extends LightningElement { + + // Get record lookup from parent component + _name; + lookupID; + + // General status check variables + scheduledCronJobs = 'No Rollup Jobs Found'; + recordCountAll = '0'; + + // Rollup Specific Status Check Variables + recordCount = '0'; + nextFullCalculateDate = 'NA'; + triggerCount = '0'; + parentTrigger = 'NA'; + childTrigger = 'NA'; + calculateJobError = 'No Errors Found'; + + // Error Handling + error = []; + + connectedCallback() { + console.log('connectedCallback'); + console.log('my lookup id is :' + this._name ); + + if(this._name == null){ + // General Status Checks + this.allScheduleItems(); + this.scheduleJobs(); + } else { + + // General Status Checks + this.allScheduleItems(); + this.scheduleJobs(); + + // Rollup Specific Status Checks + this.specificScheduleItems(); + this.childTriggers(); + this.parentTriggers(); + this.scheduledFullCalculate(); + this.calculateJobs(); + } + } + + @api + get name(){ + return this._name; + } + + set name(value){ + // Rollup Specific Status Checks + this._name = value; + this.specificScheduleItems(); + this.childTriggers(); + this.parentTriggers(); + this.scheduledFullCalculate(); + this.calculateJobs(); + + } + + // Method to check if there are any failed calculate jobs for the specific rollup + calculateJobs(){ + console.log('calculateJobs'); + getCalculateJobs({ lookupID : this._name }).then(result => { + this.calculateJobError = result; + }).catch(error => { + this.error.push(error); + console.log(error); + }); + } + + // Method to check if there are any scheduled full calculates for the specific rollup + scheduledFullCalculate(){ + console.log('scheduledFullCalculate'); + getScheduledFullCalculates({ lookupID : this._name }).then(result => { + this.nextFullCalculateDate = result; + }).catch(error => { + this.error.push(error); + console.log(error); + }); + } + + // Method to check if there are any scheduled items for the specific rollup + specificScheduleItems(){ + console.log('specificScheduleItems'); + getSpecificScheduledItems({ lookupID : this._name }) + .then(result => { + this.recordCount = result; + }) + .catch(error => { + this.error.push(error); + console.log(error); + }); + } + + // Method to check if child triggers are present + childTriggers(){ + console.log('childTriggers'); + hasChildTriggerDeployed({ lookupID : this._name }) + .then(result => { + this.childTrigger = result; + }) + .catch(error => { + this.error.push(error); + console.log(error); + }); + } + + // Method to check if child triggers are present + parentTriggers(){ + console.log('childTriggers'); + hasParentTriggerDeployed({ lookupID : this._name }) + .then(result => { + this.parentTrigger = result; + }) + .catch(error => { + this.error.push(error); + console.log(error); + }); + } + + // General status method to grab all scheduled items regardless of rollup + allScheduleItems(){ + console.log('allScheduleItems'); + getAllScheduledItems() + .then(result => { + this.recordCountAll = result; + }) + .catch(error => { + this.error.push(error); + console.log(error); + }); + } + + scheduleJobs(){ + console.log('All Scheduled Cron Jobs'); + getScheduledJobs() + .then(result => { + this.scheduledCronJobs = result; + }) + .catch(error => { + this.error.push(error); + console.log(error); + }); + } +} \ No newline at end of file diff --git a/dlrs/main/lwc/rollupStatusCheck/rollupStatusCheck.html b/dlrs/main/lwc/rollupStatusCheck/rollupStatusCheck.html new file mode 100644 index 00000000..ccef2059 --- /dev/null +++ b/dlrs/main/lwc/rollupStatusCheck/rollupStatusCheck.html @@ -0,0 +1,16 @@ + \ No newline at end of file diff --git a/dlrs/main/lwc/rollupStatusCheck/rollupStatusCheck.js-meta.xml b/dlrs/main/lwc/rollupStatusCheck/rollupStatusCheck.js-meta.xml new file mode 100644 index 00000000..c053af01 --- /dev/null +++ b/dlrs/main/lwc/rollupStatusCheck/rollupStatusCheck.js-meta.xml @@ -0,0 +1,23 @@ + + + 56.0 + true + + lightning__RecordPage + lightning__AppPage + lightning__HomePage + + + + + + + + + + + + + + + \ No newline at end of file From 19806bc753dabeb7ea91fd5c7a8b3a77600f1f5e Mon Sep 17 00:00:00 2001 From: Anthony Heber Date: Thu, 30 Mar 2023 11:47:55 -0600 Subject: [PATCH 004/130] Add container application and associated MDT fix Javascript filename --- .../ManageLookupRollupSummariesController.cls | 4 +- dlrs/main/classes/RollupEditorController.cls | 90 ++++++++++ .../RollupEditorController.cls-meta.xml | 5 + ...geLookupRollupSummaries.flexipage-meta.xml | 18 ++ .../main/lwc/manageRollups/manageRollups.html | 28 ++++ dlrs/main/lwc/manageRollups/manageRollups.js | 132 +++++++++++++++ .../manageRollups/manageRollups.js-meta.xml | 11 ++ dlrs/main/lwc/rollupEditor/rollupEditor.js | 81 ++++++++- .../lwc/rollupEditor/rollupEditor.js-meta.xml | 6 +- .../rollupStatusCheck/RollupStatusCheck.js | 155 ----------------- .../rollupStatusCheck/rollupStatusCheck.js | 156 ++++++++++++++++++ .../UserNotification__e.object-meta.xml | 9 + .../fields/Payload__c.field-meta.xml | 13 ++ .../fields/Recipient__c.field-meta.xml | 15 ++ .../fields/Type__c.field-meta.xml | 15 ++ ...RollupSummariesFull.permissionset-meta.xml | 17 ++ .../ManageLookupRollupSummaries.tab-meta.xml | 2 +- .../ManageLookupRollupSummaries2.tab-meta.xml | 7 + 18 files changed, 593 insertions(+), 171 deletions(-) create mode 100644 dlrs/main/classes/RollupEditorController.cls create mode 100644 dlrs/main/classes/RollupEditorController.cls-meta.xml create mode 100644 dlrs/main/flexipages/ManageLookupRollupSummaries.flexipage-meta.xml create mode 100644 dlrs/main/lwc/manageRollups/manageRollups.html create mode 100644 dlrs/main/lwc/manageRollups/manageRollups.js create mode 100644 dlrs/main/lwc/manageRollups/manageRollups.js-meta.xml delete mode 100644 dlrs/main/lwc/rollupStatusCheck/RollupStatusCheck.js create mode 100644 dlrs/main/lwc/rollupStatusCheck/rollupStatusCheck.js create mode 100644 dlrs/main/objects/UserNotification__e/UserNotification__e.object-meta.xml create mode 100644 dlrs/main/objects/UserNotification__e/fields/Payload__c.field-meta.xml create mode 100644 dlrs/main/objects/UserNotification__e/fields/Recipient__c.field-meta.xml create mode 100644 dlrs/main/objects/UserNotification__e/fields/Type__c.field-meta.xml create mode 100644 dlrs/main/tabs/ManageLookupRollupSummaries2.tab-meta.xml diff --git a/dlrs/main/classes/ManageLookupRollupSummariesController.cls b/dlrs/main/classes/ManageLookupRollupSummariesController.cls index cc174f1b..684a536c 100644 --- a/dlrs/main/classes/ManageLookupRollupSummariesController.cls +++ b/dlrs/main/classes/ManageLookupRollupSummariesController.cls @@ -334,7 +334,9 @@ public with sharing class ManageLookupRollupSummariesController { public PageReference newWizard() { try { - PageReference newPage = Page.managelookuprollupsummaries_New; + PageReference newPage = new PageReference( + '/lightning/n/ManageLookupRollupSummaries2' + ); newPage.setRedirect(true); return newPage; } catch (Exception e) { diff --git a/dlrs/main/classes/RollupEditorController.cls b/dlrs/main/classes/RollupEditorController.cls new file mode 100644 index 00000000..9871db66 --- /dev/null +++ b/dlrs/main/classes/RollupEditorController.cls @@ -0,0 +1,90 @@ +public with sharing class RollupEditorController { + @AuraEnabled + public static Map getAllRollupConfigs() { + return LookupRollupSummary2__mdt.getAll(); + } + + @AuraEnabled + public static LookupRollupSummary2__mdt getRollupConfig(String rollupName) { + return (LookupRollupSummary2__mdt) new RollupSummariesSelector.CustomMetadataSelector( + false, + true // retrieve for Edit + ) + .selectByDeveloperName(new Set{ rollupName })[0] + .Record; + } + + @AuraEnabled + public static Map> validateRollupConfig(String rollup) { + // do things like validate that the Rollup Criteria can be used in a SOQL query + LookupRollupSummary2__mdt lookupConfig = (LookupRollupSummary2__mdt) JSON.deserialize( + rollup, + LookupRollupSummary2__mdt.class + ); + // map of errors by "location" such as "record" or "[fieldname]" to enable displaying the error against a specific field/aread of + Map> errorMap = new Map>{}; + // 'record' => new List() + + // TODO: execute validations and check configs + return errorMap; + } + + @AuraEnabled + public static Id saveRollupConfig(String rollup) { + LookupRollupSummary2__mdt lookupConfig = (LookupRollupSummary2__mdt) JSON.deserialize( + rollup, + LookupRollupSummary2__mdt.class + ); + return saveRollup(lookupConfig); + } + + // TODO: move somewhere else + public static Id saveRollup(LookupRollupSummary2__mdt rollup) { + // Setup custom metadata to be created in the subscriber org. + Metadata.CustomMetadata customMetadata = new Metadata.CustomMetadata(); + // TODO: does this get weird if we're in a namespaced context?? + // Developer name and Label are applied here + customMetadata.fullName = + 'LookupRollupSummary2__mdt.' + rollup.DeveloperName; + customMetadata.label = rollup.Label; + Metadata.CustomMetadata mdt = new Metadata.CustomMetadata(); + Map populatedFields = rollup.getPopulatedFieldsAsMap(); + // We don't want these in values + List ignoredKeys = new List{ + 'Id', + 'DeveloperName', + 'Label' + }; + for (String key : populatedFields.keySet()) { + if (ignoredKeys.contains(key)) { + continue; + } + Metadata.CustomMetadataValue customField = new Metadata.CustomMetadataValue(); + customField.field = key; + customField.value = populatedFields.get(key); + customMetadata.values.add(customField); + } + + Metadata.DeployContainer mdContainer = new Metadata.DeployContainer(); + mdContainer.addMetadata(customMetadata); + + DeployCallback cb = new DeployCallback(); + // Enqueue custom metadata deployment + Id jobId = Metadata.Operations.enqueueDeployment(mdContainer, cb); + return jobId; + } + + // TODO: move somewhere else + class DeployCallback implements Metadata.DeployCallback { + public void handleResult( + Metadata.DeployResult result, + Metadata.DeployCallbackContext context + ) { + UserNotification__e updateEvent = new UserNotification__e( + Type__c = 'DeploymentResult', + Payload__c = JSON.serialize(result) + ); + EventBus.publish(updateEvent); + } + } +} diff --git a/dlrs/main/classes/RollupEditorController.cls-meta.xml b/dlrs/main/classes/RollupEditorController.cls-meta.xml new file mode 100644 index 00000000..754ecb15 --- /dev/null +++ b/dlrs/main/classes/RollupEditorController.cls-meta.xml @@ -0,0 +1,5 @@ + + + 57.0 + Active + diff --git a/dlrs/main/flexipages/ManageLookupRollupSummaries.flexipage-meta.xml b/dlrs/main/flexipages/ManageLookupRollupSummaries.flexipage-meta.xml new file mode 100644 index 00000000..f9e86798 --- /dev/null +++ b/dlrs/main/flexipages/ManageLookupRollupSummaries.flexipage-meta.xml @@ -0,0 +1,18 @@ + + + + + + manageRollups + c_manageRollups + + + main + Region + + Manage Lookup Rollup Summaries (New) + + AppPage + diff --git a/dlrs/main/lwc/manageRollups/manageRollups.html b/dlrs/main/lwc/manageRollups/manageRollups.html new file mode 100644 index 00000000..f2ee0630 --- /dev/null +++ b/dlrs/main/lwc/manageRollups/manageRollups.html @@ -0,0 +1,28 @@ + diff --git a/dlrs/main/lwc/manageRollups/manageRollups.js b/dlrs/main/lwc/manageRollups/manageRollups.js new file mode 100644 index 00000000..4ed5d491 --- /dev/null +++ b/dlrs/main/lwc/manageRollups/manageRollups.js @@ -0,0 +1,132 @@ +import { LightningElement } from "lwc"; +import { ShowToastEvent } from "lightning/platformShowToastEvent"; +import getAllRollupConfigs from "@salesforce/apex/RollupEditorController.getAllRollupConfigs"; +import USER_ID from "@salesforce/user/Id"; + +import { + subscribe, + unsubscribe, + onError, + isEmpEnabled +} from "lightning/empApi"; + +export default class ManageRollups extends LightningElement { + // We only want events for which we've been assigned as the recipient + channelName = `/event/UserNotification__e?Recipient__c='${USER_ID.substring( + 1, + 15 + )}'`; + subscription = {}; + + rollups = {}; + selectedRollup = undefined; + + async connectedCallback() { + this.rollups = await getAllRollupConfigs(); + // Register error listener + this.registerErrorListener(); + this.handleSubscribe(); + } + + rollupSelectHandler(event) { + this.selectedRollup = event.currentTarget.dataset.apiName; + } + + get rollupList() { + if (!this.rollups) { + return []; + } + return Object.values(this.rollups); + } + + //////////////////// + // Tracks changes to channelName text field + handleChannelName(event) { + this.channelName = event.target.value; + } + + disconnectedCallback() { + this.handleUnsubscribe(); + } + + // Handles subscribe button click + handleSubscribe() { + if (!isEmpEnabled) { + console.error("Emp API Is not currently enabled"); + return; + } + // Callback invoked whenever a new event message is received + const messageCallback = (response) => { + console.log("New message received: ", JSON.stringify(response)); + if (!USER_ID.startsWith(response.data.payload.Recipient__c)) { + // This message isn't for us, don't do anything + return; + } + // TODO: handle this way better + + let title, message, messageData, variant, mode; + const deploymentData = JSON.parse(response.data.payload.Payload__c); + if (deploymentData.status === "Succeeded") { + title = "Deployment Completed!"; + message = "Metadata saved successfully"; + variant = "success"; + mode = "dismissible"; + } else { + title = "Deployment Failed!"; + message = + "Status of " + + deploymentData.status + + ", errors [" + + deploymentData.details.componentFailures + .map((failure) => `${failure.fullName}: ${failure.problem}`) + .join("\n") + + "], \n{0}"; + // if you know a better way to build this URL please replace this + messageData = [ + { + label: "Click to view Deployment", + url: `/lightning/setup/DeployStatus/page?address=%2Fchangemgmt%2FmonitorDeploymentsDetails.apexp%3FasyncId%3D${deploymentData.id}` + } + ]; + variant = "error"; + mode = "sticky"; + } + + const evt = new ShowToastEvent({ + title, + message, + messageData, + variant, + mode + }); + this.dispatchEvent(evt); + // Response contains the payload of the new message received + }; + + // Invoke subscribe method of empApi. Pass reference to messageCallback + subscribe(this.channelName, -1, messageCallback).then((response) => { + // Response contains the subscription information on subscribe call + this.subscription = response; + this.toggleSubscribeButton(true); + }); + } + + // Handles unsubscribe button click + handleUnsubscribe() { + this.toggleSubscribeButton(false); + + // Invoke unsubscribe method of empApi + unsubscribe(this.subscription, (response) => { + console.log("unsubscribe() response: ", JSON.stringify(response)); + // Response is true for successful unsubscribe + }); + } + + registerErrorListener() { + // Invoke onError empApi method + onError((error) => { + console.error("Received error from server: ", JSON.stringify(error)); + // Error contains the server-side error + }); + } +} diff --git a/dlrs/main/lwc/manageRollups/manageRollups.js-meta.xml b/dlrs/main/lwc/manageRollups/manageRollups.js-meta.xml new file mode 100644 index 00000000..62b9995d --- /dev/null +++ b/dlrs/main/lwc/manageRollups/manageRollups.js-meta.xml @@ -0,0 +1,11 @@ + + + 57.0 + true + Manage Rollups + Create and modify rollup configurations + + lightning__Tab + lightning__AppPage + + \ No newline at end of file diff --git a/dlrs/main/lwc/rollupEditor/rollupEditor.js b/dlrs/main/lwc/rollupEditor/rollupEditor.js index 419f0aa1..ef05353a 100644 --- a/dlrs/main/lwc/rollupEditor/rollupEditor.js +++ b/dlrs/main/lwc/rollupEditor/rollupEditor.js @@ -1,12 +1,75 @@ -import { LightningElement, track } from 'lwc'; +import { api, LightningElement } from "lwc"; +import { ShowToastEvent } from "lightning/platformShowToastEvent"; +import getRollupConfig from "@salesforce/apex/RollupEditorController.getRollupConfig"; +import validateRollupConfig from "@salesforce/apex/RollupEditorController.validateRollupConfig"; +import saveRollupConfig from "@salesforce/apex/RollupEditorController.saveRollupConfig"; export default class RollupEditor extends LightningElement { + errors = {}; + _rollupName; + rollup = {}; - @track rollup = { - name: '', - label: '', - relationshipField: '', - relationshipCriteria: '', - relationshipCriteriaFields: '' - }; -} \ No newline at end of file + connectedCallback() { + this.getRollup(); + } + + async getRollup() { + if (!this.rollupName) { + this.rollup = {}; + return; + } + try { + this.rollup = await getRollupConfig({ + rollupName: this.rollupName + }); + } catch (error) { + this.errors.record = [error.message]; + } + } + + async runValidate() { + this.errors = await validateRollupConfig({ + rollup: JSON.stringify(this.rollup) + }); + } + + async runSave() { + const jobId = await saveRollupConfig({ + rollup: JSON.stringify(this.rollup) + }); + const evt = new ShowToastEvent({ + title: "Deployment Started", + message: "Started Metadata Record Upates in Deployment " + jobId, + variant: "info" + }); + this.dispatchEvent(evt); + } + + updateRollup() { + try { + this.rollup = JSON.parse( + this.template.querySelector("lightning-textarea").value + ); + } catch (error) { + console.error(error); + } + } + + @api + get rollupName() { + return this._rollupName; + } + set rollupName(val) { + this._rollupName = val; + + this.getRollup(); + } + + get rollupAsString() { + return JSON.stringify(this.rollup, null, 2); + } + + get errorsAsString() { + return JSON.stringify(this.errors); + } +} diff --git a/dlrs/main/lwc/rollupEditor/rollupEditor.js-meta.xml b/dlrs/main/lwc/rollupEditor/rollupEditor.js-meta.xml index 599be582..f8c5cb4a 100644 --- a/dlrs/main/lwc/rollupEditor/rollupEditor.js-meta.xml +++ b/dlrs/main/lwc/rollupEditor/rollupEditor.js-meta.xml @@ -1,9 +1,5 @@ 56.0 - true - - lightning__AppPage - lightning__HomePage - + false \ No newline at end of file diff --git a/dlrs/main/lwc/rollupStatusCheck/RollupStatusCheck.js b/dlrs/main/lwc/rollupStatusCheck/RollupStatusCheck.js deleted file mode 100644 index 1880890a..00000000 --- a/dlrs/main/lwc/rollupStatusCheck/RollupStatusCheck.js +++ /dev/null @@ -1,155 +0,0 @@ -import { LightningElement, api } from 'lwc'; -import getAllScheduledItems from '@salesforce/apex/LookupRollupStatusCheckController.getAllScheduledItems'; -import getSpecificScheduledItems from '@salesforce/apex/LookupRollupStatusCheckController.getSpecificScheduledItems'; -import hasChildTriggerDeployed from '@salesforce/apex/LookupRollupStatusCheckController.hasChildTriggerDeployed'; -import hasParentTriggerDeployed from '@salesforce/apex/LookupRollupStatusCheckController.hasParentTriggerDeployed'; -import getScheduledFullCalculates from '@salesforce/apex/LookupRollupStatusCheckController.getScheduledFullCalculates'; -import getCalculateJobs from '@salesforce/apex/LookupRollupStatusCheckController.getCalculateJobs'; -import getScheduledJobs from '@salesforce/apex/LookupRollupStatusCheckController.getScheduledJobs'; - -export default class rollupStatusCheck extends LightningElement { - - // Get record lookup from parent component - _name; - lookupID; - - // General status check variables - scheduledCronJobs = 'No Rollup Jobs Found'; - recordCountAll = '0'; - - // Rollup Specific Status Check Variables - recordCount = '0'; - nextFullCalculateDate = 'NA'; - triggerCount = '0'; - parentTrigger = 'NA'; - childTrigger = 'NA'; - calculateJobError = 'No Errors Found'; - - // Error Handling - error = []; - - connectedCallback() { - console.log('connectedCallback'); - console.log('my lookup id is :' + this._name ); - - if(this._name == null){ - // General Status Checks - this.allScheduleItems(); - this.scheduleJobs(); - } else { - - // General Status Checks - this.allScheduleItems(); - this.scheduleJobs(); - - // Rollup Specific Status Checks - this.specificScheduleItems(); - this.childTriggers(); - this.parentTriggers(); - this.scheduledFullCalculate(); - this.calculateJobs(); - } - } - - @api - get name(){ - return this._name; - } - - set name(value){ - // Rollup Specific Status Checks - this._name = value; - this.specificScheduleItems(); - this.childTriggers(); - this.parentTriggers(); - this.scheduledFullCalculate(); - this.calculateJobs(); - - } - - // Method to check if there are any failed calculate jobs for the specific rollup - calculateJobs(){ - console.log('calculateJobs'); - getCalculateJobs({ lookupID : this._name }).then(result => { - this.calculateJobError = result; - }).catch(error => { - this.error.push(error); - console.log(error); - }); - } - - // Method to check if there are any scheduled full calculates for the specific rollup - scheduledFullCalculate(){ - console.log('scheduledFullCalculate'); - getScheduledFullCalculates({ lookupID : this._name }).then(result => { - this.nextFullCalculateDate = result; - }).catch(error => { - this.error.push(error); - console.log(error); - }); - } - - // Method to check if there are any scheduled items for the specific rollup - specificScheduleItems(){ - console.log('specificScheduleItems'); - getSpecificScheduledItems({ lookupID : this._name }) - .then(result => { - this.recordCount = result; - }) - .catch(error => { - this.error.push(error); - console.log(error); - }); - } - - // Method to check if child triggers are present - childTriggers(){ - console.log('childTriggers'); - hasChildTriggerDeployed({ lookupID : this._name }) - .then(result => { - this.childTrigger = result; - }) - .catch(error => { - this.error.push(error); - console.log(error); - }); - } - - // Method to check if child triggers are present - parentTriggers(){ - console.log('childTriggers'); - hasParentTriggerDeployed({ lookupID : this._name }) - .then(result => { - this.parentTrigger = result; - }) - .catch(error => { - this.error.push(error); - console.log(error); - }); - } - - // General status method to grab all scheduled items regardless of rollup - allScheduleItems(){ - console.log('allScheduleItems'); - getAllScheduledItems() - .then(result => { - this.recordCountAll = result; - }) - .catch(error => { - this.error.push(error); - console.log(error); - }); - } - - scheduleJobs(){ - console.log('All Scheduled Cron Jobs'); - getScheduledJobs() - .then(result => { - this.scheduledCronJobs = result; - }) - .catch(error => { - this.error.push(error); - console.log(error); - }); - } -} \ No newline at end of file diff --git a/dlrs/main/lwc/rollupStatusCheck/rollupStatusCheck.js b/dlrs/main/lwc/rollupStatusCheck/rollupStatusCheck.js new file mode 100644 index 00000000..d16095ec --- /dev/null +++ b/dlrs/main/lwc/rollupStatusCheck/rollupStatusCheck.js @@ -0,0 +1,156 @@ +import { LightningElement, api } from "lwc"; +import getAllScheduledItems from "@salesforce/apex/LookupRollupStatusCheckController.getAllScheduledItems"; +import getSpecificScheduledItems from "@salesforce/apex/LookupRollupStatusCheckController.getSpecificScheduledItems"; +import hasChildTriggerDeployed from "@salesforce/apex/LookupRollupStatusCheckController.hasChildTriggerDeployed"; +import hasParentTriggerDeployed from "@salesforce/apex/LookupRollupStatusCheckController.hasParentTriggerDeployed"; +import getScheduledFullCalculates from "@salesforce/apex/LookupRollupStatusCheckController.getScheduledFullCalculates"; +import getCalculateJobs from "@salesforce/apex/LookupRollupStatusCheckController.getCalculateJobs"; +import getScheduledJobs from "@salesforce/apex/LookupRollupStatusCheckController.getScheduledJobs"; + +export default class rollupStatusCheck extends LightningElement { + // Get record lookup from parent component + _name; + lookupID; + + // General status check variables + scheduledCronJobs = "No Rollup Jobs Found"; + recordCountAll = "0"; + + // Rollup Specific Status Check Variables + recordCount = "0"; + nextFullCalculateDate = "NA"; + triggerCount = "0"; + parentTrigger = "NA"; + childTrigger = "NA"; + calculateJobError = "No Errors Found"; + + // Error Handling + error = []; + + connectedCallback() { + console.log("connectedCallback"); + console.log("my lookup id is :" + this._name); + + if (this._name == null) { + // General Status Checks + this.allScheduleItems(); + this.scheduleJobs(); + } else { + // General Status Checks + this.allScheduleItems(); + this.scheduleJobs(); + + // Rollup Specific Status Checks + this.specificScheduleItems(); + this.childTriggers(); + this.parentTriggers(); + this.scheduledFullCalculate(); + this.calculateJobs(); + } + } + + @api + get name() { + return this._name; + } + + set name(value) { + // Rollup Specific Status Checks + this._name = value; + this.specificScheduleItems(); + this.childTriggers(); + this.parentTriggers(); + this.scheduledFullCalculate(); + this.calculateJobs(); + } + + // Method to check if there are any failed calculate jobs for the specific rollup + calculateJobs() { + console.log("calculateJobs"); + getCalculateJobs({ lookupID: this._name }) + .then((result) => { + this.calculateJobError = result; + }) + .catch((error) => { + this.error.push(error); + console.log(error); + }); + } + + // Method to check if there are any scheduled full calculates for the specific rollup + scheduledFullCalculate() { + console.log("scheduledFullCalculate"); + getScheduledFullCalculates({ lookupID: this._name }) + .then((result) => { + this.nextFullCalculateDate = result; + }) + .catch((error) => { + this.error.push(error); + console.log(error); + }); + } + + // Method to check if there are any scheduled items for the specific rollup + specificScheduleItems() { + console.log("specificScheduleItems"); + getSpecificScheduledItems({ lookupID: this._name }) + .then((result) => { + this.recordCount = result; + }) + .catch((error) => { + this.error.push(error); + console.log(error); + }); + } + + // Method to check if child triggers are present + childTriggers() { + console.log("childTriggers"); + hasChildTriggerDeployed({ lookupID: this._name }) + .then((result) => { + this.childTrigger = result; + }) + .catch((error) => { + this.error.push(error); + console.log(error); + }); + } + + // Method to check if child triggers are present + parentTriggers() { + console.log("childTriggers"); + hasParentTriggerDeployed({ lookupID: this._name }) + .then((result) => { + this.parentTrigger = result; + }) + .catch((error) => { + this.error.push(error); + console.log(error); + }); + } + + // General status method to grab all scheduled items regardless of rollup + allScheduleItems() { + console.log("allScheduleItems"); + getAllScheduledItems() + .then((result) => { + this.recordCountAll = result; + }) + .catch((error) => { + this.error.push(error); + console.log(error); + }); + } + + scheduleJobs() { + console.log("All Scheduled Cron Jobs"); + getScheduledJobs() + .then((result) => { + this.scheduledCronJobs = result; + }) + .catch((error) => { + this.error.push(error); + console.log(error); + }); + } +} diff --git a/dlrs/main/objects/UserNotification__e/UserNotification__e.object-meta.xml b/dlrs/main/objects/UserNotification__e/UserNotification__e.object-meta.xml new file mode 100644 index 00000000..683b901b --- /dev/null +++ b/dlrs/main/objects/UserNotification__e/UserNotification__e.object-meta.xml @@ -0,0 +1,9 @@ + + + Deployed + Channel to send updates to users from async actions + HighVolume + + User Notifications + PublishAfterCommit + diff --git a/dlrs/main/objects/UserNotification__e/fields/Payload__c.field-meta.xml b/dlrs/main/objects/UserNotification__e/fields/Payload__c.field-meta.xml new file mode 100644 index 00000000..f22df04d --- /dev/null +++ b/dlrs/main/objects/UserNotification__e/fields/Payload__c.field-meta.xml @@ -0,0 +1,13 @@ + + + Payload__c + JSON Payload Body + false + false + false + false + + 32768 + LongTextArea + 3 + diff --git a/dlrs/main/objects/UserNotification__e/fields/Recipient__c.field-meta.xml b/dlrs/main/objects/UserNotification__e/fields/Recipient__c.field-meta.xml new file mode 100644 index 00000000..f0152e1a --- /dev/null +++ b/dlrs/main/objects/UserNotification__e/fields/Recipient__c.field-meta.xml @@ -0,0 +1,15 @@ + + + Recipient__c + $User.Id + Target User this event is intended to be received by + false + false + false + false + + 255 + true + Text + false + diff --git a/dlrs/main/objects/UserNotification__e/fields/Type__c.field-meta.xml b/dlrs/main/objects/UserNotification__e/fields/Type__c.field-meta.xml new file mode 100644 index 00000000..00d8fc4f --- /dev/null +++ b/dlrs/main/objects/UserNotification__e/fields/Type__c.field-meta.xml @@ -0,0 +1,15 @@ + + + Type__c + Categorical type, one of the following +DeploymentResult + false + false + false + false + + 255 + true + Text + false + diff --git a/dlrs/main/permissionsets/LookupRollupSummariesFull.permissionset-meta.xml b/dlrs/main/permissionsets/LookupRollupSummariesFull.permissionset-meta.xml index d7072469..d9584779 100644 --- a/dlrs/main/permissionsets/LookupRollupSummariesFull.permissionset-meta.xml +++ b/dlrs/main/permissionsets/LookupRollupSummariesFull.permissionset-meta.xml @@ -16,6 +16,10 @@ OptimizerComponentController true + + RollupEditorController + true + RollupService true @@ -186,6 +190,15 @@ LookupRollupSummary__c false + + true + false + false + true + false + UserNotification__e + false + managelookuprollupsummaries true @@ -258,6 +271,10 @@ ManageLookupRollupSummaries Visible + + ManageLookupRollupSummaries2 + Visible + Welcome Visible diff --git a/dlrs/main/tabs/ManageLookupRollupSummaries.tab-meta.xml b/dlrs/main/tabs/ManageLookupRollupSummaries.tab-meta.xml index 400815a7..b970d6f9 100644 --- a/dlrs/main/tabs/ManageLookupRollupSummaries.tab-meta.xml +++ b/dlrs/main/tabs/ManageLookupRollupSummaries.tab-meta.xml @@ -1,4 +1,4 @@ - + Custom9: Lightning diff --git a/dlrs/main/tabs/ManageLookupRollupSummaries2.tab-meta.xml b/dlrs/main/tabs/ManageLookupRollupSummaries2.tab-meta.xml new file mode 100644 index 00000000..57759e07 --- /dev/null +++ b/dlrs/main/tabs/ManageLookupRollupSummaries2.tab-meta.xml @@ -0,0 +1,7 @@ + + + Manage Lookup Rollup Configs + ManageLookupRollupSummaries + + Custom67: Gears + From 6c31b4d9032fc59d4c9bbaf6f6cc8bc7808c897c Mon Sep 17 00:00:00 2001 From: Anthony Heber Date: Thu, 30 Mar 2023 12:24:23 -0600 Subject: [PATCH 005/130] Switch to DataTable for Rollups --- .../main/lwc/manageRollups/manageRollups.html | 20 ++---- dlrs/main/lwc/manageRollups/manageRollups.js | 67 ++++++++++++++++++- 2 files changed, 71 insertions(+), 16 deletions(-) diff --git a/dlrs/main/lwc/manageRollups/manageRollups.html b/dlrs/main/lwc/manageRollups/manageRollups.html index f2ee0630..fab5696a 100644 --- a/dlrs/main/lwc/manageRollups/manageRollups.html +++ b/dlrs/main/lwc/manageRollups/manageRollups.html @@ -3,20 +3,14 @@ - - - + diff --git a/dlrs/main/lwc/manageRollups/manageRollups.js b/dlrs/main/lwc/manageRollups/manageRollups.js index 4ed5d491..fb814141 100644 --- a/dlrs/main/lwc/manageRollups/manageRollups.js +++ b/dlrs/main/lwc/manageRollups/manageRollups.js @@ -11,6 +11,50 @@ import { } from "lightning/empApi"; export default class ManageRollups extends LightningElement { + dtColumns = [ + { + label: "Name", + fieldName: "Label" + }, + { + label: "Parent", + fieldName: "ParentObject__c" + }, + { + label: "Field To Aggregate", + fieldName: "FieldToAggregate__c" + }, + { + label: "Child", + fieldName: "ChildObject__c" + }, + { + label: "Relationship Field", + fieldName: "RelationshipField__c" + }, + { + label: "Operation", + fieldName: "AggregateOperation__c" + }, + { + label: "Mode", + fieldName: "CalculationMode__c" + }, + { + label: "Active", + fieldName: "Active__c" + }, + { + type: "action", + typeAttributes: { + rowActions: [ + { label: "Edit", name: "rollup_select" }, + { label: "Delete(TBD)", name: "rollup_delete" } + ] + } + } + ]; + // We only want events for which we've been assigned as the recipient channelName = `/event/UserNotification__e?Recipient__c='${USER_ID.substring( 1, @@ -21,15 +65,30 @@ export default class ManageRollups extends LightningElement { rollups = {}; selectedRollup = undefined; - async connectedCallback() { - this.rollups = await getAllRollupConfigs(); + connectedCallback() { + this.refreshRollups(); // Register error listener this.registerErrorListener(); this.handleSubscribe(); } + async refreshRollups() { + this.rollups = await getAllRollupConfigs(); + } + rollupSelectHandler(event) { - this.selectedRollup = event.currentTarget.dataset.apiName; + const action = event.detail.action; + const row = event.detail.row; + switch (action.name) { + case "rollup_select": + this.selectedRollup = row.DeveloperName; + break; + case "rollup_delete": + // TODO: + break; + default: + // do nothin + } } get rollupList() { @@ -58,6 +117,8 @@ export default class ManageRollups extends LightningElement { // Callback invoked whenever a new event message is received const messageCallback = (response) => { console.log("New message received: ", JSON.stringify(response)); + // deployment probably changed the rollup definitions, should refresh + this.refreshRollups(); if (!USER_ID.startsWith(response.data.payload.Recipient__c)) { // This message isn't for us, don't do anything return; From 541d573917c6961a300950945905d06059075f77 Mon Sep 17 00:00:00 2001 From: Scott Fenton Date: Thu, 30 Mar 2023 14:46:47 -0400 Subject: [PATCH 006/130] Update editor layout with Health check lwc --- dlrs/main/lwc/rollupEditor/rollupEditor.html | 68 +++++++++----------- 1 file changed, 30 insertions(+), 38 deletions(-) diff --git a/dlrs/main/lwc/rollupEditor/rollupEditor.html b/dlrs/main/lwc/rollupEditor/rollupEditor.html index 35b6825f..d73bf660 100644 --- a/dlrs/main/lwc/rollupEditor/rollupEditor.html +++ b/dlrs/main/lwc/rollupEditor/rollupEditor.html @@ -2,7 +2,7 @@
- +
@@ -20,29 +20,21 @@ - + - +
-
Pick the Parent object you want to roll up to, and then the Child object that you want to roll up from
+
Pick the Parent object you want to roll up to, + and then the Child object that you want to roll up from
@@ -62,32 +54,32 @@ - + - + - + + + +
+
+ + +
Health Check
+
+
+ + +
From f73469d7af8aaec8964e4624c203d89d101bb4ff Mon Sep 17 00:00:00 2001 From: Jim Bartek Date: Thu, 30 Mar 2023 15:27:08 -0400 Subject: [PATCH 007/130] integrate rollups and status check --- .../main/lwc/manageRollups/manageRollups.html | 2 - dlrs/main/lwc/rollupEditor/rollupEditor.html | 224 +++++++++++------- dlrs/main/lwc/rollupEditor/rollupEditor.js | 8 + 3 files changed, 143 insertions(+), 91 deletions(-) diff --git a/dlrs/main/lwc/manageRollups/manageRollups.html b/dlrs/main/lwc/manageRollups/manageRollups.html index fab5696a..c8df4003 100644 --- a/dlrs/main/lwc/manageRollups/manageRollups.html +++ b/dlrs/main/lwc/manageRollups/manageRollups.html @@ -14,9 +14,7 @@
- -
diff --git a/dlrs/main/lwc/rollupEditor/rollupEditor.html b/dlrs/main/lwc/rollupEditor/rollupEditor.html index d73bf660..1cf27664 100644 --- a/dlrs/main/lwc/rollupEditor/rollupEditor.html +++ b/dlrs/main/lwc/rollupEditor/rollupEditor.html @@ -1,91 +1,137 @@ \ No newline at end of file diff --git a/dlrs/main/lwc/rollupEditor/rollupEditor.js b/dlrs/main/lwc/rollupEditor/rollupEditor.js index ef05353a..3f69e2f4 100644 --- a/dlrs/main/lwc/rollupEditor/rollupEditor.js +++ b/dlrs/main/lwc/rollupEditor/rollupEditor.js @@ -72,4 +72,12 @@ export default class RollupEditor extends LightningElement { get errorsAsString() { return JSON.stringify(this.errors); } + + get aggregateOptions() { + return [ + { label: 'New', value: 'new' }, + { label: 'In Progress', value: 'inProgress' }, + { label: 'Finished', value: 'finished' }, + ]; + } } From 4fc3abe75283be162f113e30eae7856751cbc38f Mon Sep 17 00:00:00 2001 From: Khang Ly Date: Tue, 4 Apr 2023 23:26:59 +0700 Subject: [PATCH 008/130] update RollupStatusCheck component UI --- .../rollupStatusCheck/rollupStatusCheck.html | 137 +++++++++++++-- .../rollupStatusCheck/rollupStatusCheck.js | 156 ++++++------------ 2 files changed, 173 insertions(+), 120 deletions(-) diff --git a/dlrs/main/lwc/rollupStatusCheck/rollupStatusCheck.html b/dlrs/main/lwc/rollupStatusCheck/rollupStatusCheck.html index ccef2059..03e38560 100644 --- a/dlrs/main/lwc/rollupStatusCheck/rollupStatusCheck.html +++ b/dlrs/main/lwc/rollupStatusCheck/rollupStatusCheck.html @@ -1,16 +1,127 @@ \ No newline at end of file diff --git a/dlrs/main/lwc/rollupStatusCheck/rollupStatusCheck.js b/dlrs/main/lwc/rollupStatusCheck/rollupStatusCheck.js index d16095ec..0d4d3760 100644 --- a/dlrs/main/lwc/rollupStatusCheck/rollupStatusCheck.js +++ b/dlrs/main/lwc/rollupStatusCheck/rollupStatusCheck.js @@ -1,4 +1,5 @@ -import { LightningElement, api } from "lwc"; +import { LightningElement, api, wire, track } from "lwc"; + import getAllScheduledItems from "@salesforce/apex/LookupRollupStatusCheckController.getAllScheduledItems"; import getSpecificScheduledItems from "@salesforce/apex/LookupRollupStatusCheckController.getSpecificScheduledItems"; import hasChildTriggerDeployed from "@salesforce/apex/LookupRollupStatusCheckController.hasChildTriggerDeployed"; @@ -7,9 +8,13 @@ import getScheduledFullCalculates from "@salesforce/apex/LookupRollupStatusCheck import getCalculateJobs from "@salesforce/apex/LookupRollupStatusCheckController.getCalculateJobs"; import getScheduledJobs from "@salesforce/apex/LookupRollupStatusCheckController.getScheduledJobs"; +const mockLookupRollupSummary2 = ''; + export default class rollupStatusCheck extends LightningElement { - // Get record lookup from parent component - _name; + + // Khang Ly contribute + header = 'Status Check'; + lookupID; // General status check variables @@ -23,134 +28,71 @@ export default class rollupStatusCheck extends LightningElement { parentTrigger = "NA"; childTrigger = "NA"; calculateJobError = "No Errors Found"; - + // Error Handling error = []; connectedCallback() { console.log("connectedCallback"); console.log("my lookup id is :" + this._name); + this.allScheduleItems(); + this.scheduleJobs(); + } - if (this._name == null) { - // General Status Checks - this.allScheduleItems(); - this.scheduleJobs(); - } else { - // General Status Checks - this.allScheduleItems(); - this.scheduleJobs(); - - // Rollup Specific Status Checks - this.specificScheduleItems(); - this.childTriggers(); - this.parentTriggers(); - this.scheduledFullCalculate(); - this.calculateJobs(); - } - } + // Get record lookup from parent component + @track _name = mockLookupRollupSummary2; @api - get name() { - return this._name; + get name() { + return this._name; } - - set name(value) { - // Rollup Specific Status Checks - this._name = value; - this.specificScheduleItems(); - this.childTriggers(); - this.parentTriggers(); - this.scheduledFullCalculate(); - this.calculateJobs(); + set name(value) { + this._name = value; } // Method to check if there are any failed calculate jobs for the specific rollup - calculateJobs() { - console.log("calculateJobs"); - getCalculateJobs({ lookupID: this._name }) - .then((result) => { - this.calculateJobError = result; - }) - .catch((error) => { - this.error.push(error); - console.log(error); - }); - } + @wire(getCalculateJobs, { lookupID : '$_name'}) + wiredGetCalculateJobs({error, data}){ this.handleApexResponse(data, error, 'calculateJobError'); } // Method to check if there are any scheduled full calculates for the specific rollup - scheduledFullCalculate() { - console.log("scheduledFullCalculate"); - getScheduledFullCalculates({ lookupID: this._name }) - .then((result) => { - this.nextFullCalculateDate = result; - }) - .catch((error) => { - this.error.push(error); - console.log(error); - }); - } + @wire(getScheduledFullCalculates, { lookupID : '$_name'}) + wiredGetScheduledFullCalculates({error, data}){ this.handleApexResponse(data, error, 'nextFullCalculateDate'); } // Method to check if there are any scheduled items for the specific rollup - specificScheduleItems() { - console.log("specificScheduleItems"); - getSpecificScheduledItems({ lookupID: this._name }) - .then((result) => { - this.recordCount = result; - }) - .catch((error) => { - this.error.push(error); - console.log(error); - }); - } + @wire(getSpecificScheduledItems, { lookupID : '$_name'}) + wiredGetSpecificScheduledItems({error, data}){ this.handleApexResponse(data, error, 'recordCount'); } // Method to check if child triggers are present - childTriggers() { - console.log("childTriggers"); - hasChildTriggerDeployed({ lookupID: this._name }) - .then((result) => { - this.childTrigger = result; - }) - .catch((error) => { - this.error.push(error); - console.log(error); - }); - } + @wire(hasChildTriggerDeployed, { lookupID : '$_name'}) + wiredHasChildTriggerDeployed({error, data}){ this.handleApexResponse(data, error, 'childTrigger'); } // Method to check if child triggers are present - parentTriggers() { - console.log("childTriggers"); - hasParentTriggerDeployed({ lookupID: this._name }) - .then((result) => { - this.parentTrigger = result; - }) - .catch((error) => { - this.error.push(error); - console.log(error); - }); - } + @wire(hasParentTriggerDeployed, { lookupID : '$_name' }) + wiredHasParentTriggerDeployed({ error, data }){ this.handleApexResponse(data, error, 'parentTrigger'); } // General status method to grab all scheduled items regardless of rollup - allScheduleItems() { - console.log("allScheduleItems"); - getAllScheduledItems() - .then((result) => { - this.recordCountAll = result; - }) - .catch((error) => { - this.error.push(error); - console.log(error); - }); + async allScheduleItems() { + let data, error; + try{ data = await getAllScheduledItems(); } + catch(err){ error = err } + this.handleApexResponse(data, error, 'recordCountAll'); + } + + async scheduleJobs() { + let data, error; + try{ data = await getScheduledJobs(); } + catch(err){ error = err } + this.handleApexResponse(data, error, 'scheduledCronJobs'); } - scheduleJobs() { - console.log("All Scheduled Cron Jobs"); - getScheduledJobs() - .then((result) => { - this.scheduledCronJobs = result; - }) - .catch((error) => { - this.error.push(error); - console.log(error); - }); +// *** Utility *** + handleApexResponse(data, error, propertyName){ + if(data){ + console.log(propertyName + '- data: ' + data); + this[propertyName] = data; + } else if(error){ + console.log(propertyName + '- error: ' + error); + this.error.push(error); + } } } From 0cee4d088b5a46078e12922c92e52f37e9ec2a9d Mon Sep 17 00:00:00 2001 From: AishwaryaBadri <66730581+AishwaryaBadri@users.noreply.github.com> Date: Thu, 6 Apr 2023 21:38:42 +0100 Subject: [PATCH 009/130] Create objectSelector.js --- .../main/lwc/objectSelector/objectSelector.js | 119 ++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 dlrs/main/lwc/objectSelector/objectSelector.js diff --git a/dlrs/main/lwc/objectSelector/objectSelector.js b/dlrs/main/lwc/objectSelector/objectSelector.js new file mode 100644 index 00000000..8fee4942 --- /dev/null +++ b/dlrs/main/lwc/objectSelector/objectSelector.js @@ -0,0 +1,119 @@ +import { LightningElement,api,wire } from 'lwc'; + +import getAllObjects from '@salesforce/apex/ObjectSelectorController.getParentObjList'; + +const DELAY = 300; // delay apex callout timing in miliseconds +export default class ObjectSelector extends LightningElement { + // public properties with initial default values + @api label = 'Object'; + @api placeholder = 'Search...'; + @api iconName = 'standard:account'; +@api currentSelection; + // private properties + lstResult = []; // to store list of returned records + hasRecords = true; + searchKey=''; // to store input field value + isSearchLoading = false; // to control loading spinner + delayTimeout; + selectedRecord = {}; // to store selected lookup record in object formate + mapData = []; + connectedCallback(){ + + //GET LIST OF ALL OBJECTS + getAllObjects() + .then((result) => { + if(result != null){ + this.mapData=JSON.parse(JSON.stringify(result)); + } + }) + .catch((error) => { + this.error = error; + this.mapData = {}; + }); + } + + + // update searchKey property on input field change + handleKeyChange(event) { + // Debouncing this method: Do not update the reactive property as long as this function is + // being called within a delay of DELAY. This is to avoid a very large number of Apex method calls. + + + var matchedRecords=[]; + this.isSearchLoading = true; + window.clearTimeout(this.delayTimeout); + const searchKey = event.target.value; + this.delayTimeout = setTimeout(() => { + matchedRecords = this.mapData.filter(function(link){ + return link.toLowerCase().includes(searchKey.toLowerCase()) + }); + + this.hasRecords = matchedRecords.length == 0 ? false : true; + this.lstResult = JSON.parse(JSON.stringify(matchedRecords)); + }, DELAY); + +} + + // method to toggle lookup result section on UI + toggleResult(event){ + const lookupInputContainer = this.template.querySelector('.lookupInputContainer'); + const clsList = lookupInputContainer.classList; + const whichEvent = event.target.getAttribute('data-source'); + switch(whichEvent) { + case 'searchInputField': + clsList.add('slds-is-open'); + break; + case 'lookupContainer': + clsList.remove('slds-is-open'); + break; + } +} + + // method to clear selected lookup record + handleRemove(){ + this.searchKey = ''; + this.selectedRecord = {}; + this.lookupUpdatehandler(undefined); // update value on parent component as well from helper function + + // remove selected pill and display input field again + const searchBoxWrapper = this.template.querySelector('.searchBoxWrapper'); + searchBoxWrapper.classList.remove('slds-hide'); + searchBoxWrapper.classList.add('slds-show'); + const pillDiv = this.template.querySelector('.pillDiv'); + pillDiv.classList.remove('slds-show'); + pillDiv.classList.add('slds-hide'); + } + // method to update selected record from search result +handelSelectedRecord(event){ + var objId = event.target.getAttribute('data-recid'); // get selected record Id + this.selectedRecord = this.lstResult.find(data => data === objId); // find selected record from list + this.lookupUpdatehandler(this.selectedRecord); // update value on parent component as well from helper function + this.handelSelectRecordHelper(); // helper function to show/hide lookup result container on UI +} +/*COMMON HELPER METHOD STARTED*/ +handelSelectRecordHelper(){ + this.template.querySelector('.lookupInputContainer').classList.remove('slds-is-open'); + const searchBoxWrapper = this.template.querySelector('.searchBoxWrapper'); + searchBoxWrapper.classList.remove('slds-show'); + searchBoxWrapper.classList.add('slds-hide'); + const pillDiv = this.template.querySelector('.pillDiv'); + pillDiv.classList.remove('slds-hide'); + pillDiv.classList.add('slds-show'); +} +// send selected lookup record to parent component using custom event +lookupUpdatehandler(value){ + //Send only the API Name in the event + var regExp = /\(([^)]+)\)/; + var retVal = regExp.exec(JSON.stringify(value)); + const oEvent = new CustomEvent('lookupupdate', + { + 'detail': {selectedRecord: retVal[1]} + } + ); + this.dispatchEvent(oEvent); +} + + + + +} From 17fbec495fe457571e254d2d23a67c3e68d26629 Mon Sep 17 00:00:00 2001 From: AishwaryaBadri <66730581+AishwaryaBadri@users.noreply.github.com> Date: Thu, 6 Apr 2023 21:39:08 +0100 Subject: [PATCH 010/130] Add files via upload --- .../lwc/objectSelector/objectSelector.html | 69 +++++++++++++++++++ .../objectSelector/objectSelector.js-meta.xml | 9 +++ 2 files changed, 78 insertions(+) create mode 100644 dlrs/main/lwc/objectSelector/objectSelector.html create mode 100644 dlrs/main/lwc/objectSelector/objectSelector.js-meta.xml diff --git a/dlrs/main/lwc/objectSelector/objectSelector.html b/dlrs/main/lwc/objectSelector/objectSelector.html new file mode 100644 index 00000000..6eb4d37e --- /dev/null +++ b/dlrs/main/lwc/objectSelector/objectSelector.html @@ -0,0 +1,69 @@ + + \ No newline at end of file diff --git a/dlrs/main/lwc/objectSelector/objectSelector.js-meta.xml b/dlrs/main/lwc/objectSelector/objectSelector.js-meta.xml new file mode 100644 index 00000000..e7247af4 --- /dev/null +++ b/dlrs/main/lwc/objectSelector/objectSelector.js-meta.xml @@ -0,0 +1,9 @@ + + + 56.0 + true + + lightning__AppPage + lightning__HomePage + + \ No newline at end of file From 11b07285302d456b93d6a9e1fea266f5e9516485 Mon Sep 17 00:00:00 2001 From: AishwaryaBadri <66730581+AishwaryaBadri@users.noreply.github.com> Date: Thu, 6 Apr 2023 21:39:59 +0100 Subject: [PATCH 011/130] Add files via upload --- .../main/classes/ObjectSelectorController.cls | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 dlrs/main/classes/ObjectSelectorController.cls diff --git a/dlrs/main/classes/ObjectSelectorController.cls b/dlrs/main/classes/ObjectSelectorController.cls new file mode 100644 index 00000000..75d2685b --- /dev/null +++ b/dlrs/main/classes/ObjectSelectorController.cls @@ -0,0 +1,59 @@ +public with sharing class ObjectSelectorController { + public ObjectSelectorController() { + + + } + + @AuraEnabled(cacheable=true) + public static List getParentObjList() { + System.debug('getParentObjList entry'); + Map objectDescription = Schema.getGlobalDescribe(); + List parentObjList = objectDescription.values(); + List lstObjects= new List(); + Set res=queryRollupableSObjectsNames(); + for (Schema.SObjectType obj : parentObjList) { + Schema.DescribeSObjectResult description = obj.getDescribe( + SObjectDescribeOptions.DEFERRED + ); + + //Filter out sObjects that can't be rolled up to avoid >1000 collection limit + + /* if(!res.contains(description.getName())) { + continue; + }*/ + + String prefix = description.getKeyPrefix(); + + if (!String.isEmpty(prefix)) { + lstObjects.add(obj.getDescribe().getLabel()+'('+obj.getDescribe().getName()+')'); + // mapLabelToValues.put(obj.getDescribe().getName(), obj.getDescribe().getLabel()); + + + } + + } + System.debug('lstObjects'+lstObjects); + System.debug('lstObjects size'+lstObjects.size()); + return lstObjects; + } + + + public static Set queryRollupableSObjectsNames() { + Set rollupableSObjectsNames = new Set(); + List entityDefinitions = [ + SELECT QualifiedApiName FROM EntityDefinition + WHERE IsCustomSetting = false + AND IsCustomizable = true + AND isApexTriggerable = true + WITH SECURITY_ENFORCED + ]; + + for(EntityDefinition entDef : entityDefinitions) { + rollupableSObjectsNames.add(entDef.QualifiedApiName); + } + System.debug('rollupableSObjectsNames->'+rollupableSObjectsNames); + + return rollupableSObjectsNames; + } + +} \ No newline at end of file From 404817544b3f0bdf5b23288bcea1420d1d26c97e Mon Sep 17 00:00:00 2001 From: Anthony Heber Date: Thu, 6 Apr 2023 21:55:27 -0600 Subject: [PATCH 012/130] pull it together and refactor code locations --- dlrs/main/classes/CustomMetadataService.cls | 111 ++++++ .../ObjectSelectorController.cls-meta.xml | 5 + dlrs/main/classes/RollupEditorController.cls | 60 +-- .../main/lwc/manageRollups/manageRollups.html | 29 +- dlrs/main/lwc/manageRollups/manageRollups.js | 140 +++++-- .../main/lwc/objectSelector/objectSelector.js | 176 +++++---- dlrs/main/lwc/rollupEditor/rollupEditor.html | 345 +++++++++++------- dlrs/main/lwc/rollupEditor/rollupEditor.js | 106 ++++-- ...RollupSummariesFull.permissionset-meta.xml | 4 + .../ManageLookupRollupSummaries2.tab-meta.xml | 2 +- 10 files changed, 635 insertions(+), 343 deletions(-) create mode 100644 dlrs/main/classes/ObjectSelectorController.cls-meta.xml diff --git a/dlrs/main/classes/CustomMetadataService.cls b/dlrs/main/classes/CustomMetadataService.cls index 070b5bcf..1aa1ed97 100644 --- a/dlrs/main/classes/CustomMetadataService.cls +++ b/dlrs/main/classes/CustomMetadataService.cls @@ -39,6 +39,46 @@ public class CustomMetadataService { ) { } + /** + * Starts async metadata save using Apex Metadata API + */ + public static Id initiateMetadataSave(List records) { + Metadata.DeployContainer mdContainer = new Metadata.DeployContainer(); + for (SObject r : records) { + // Setup custom metadata to be created in the subscriber org. + Metadata.CustomMetadata customMetadata = new Metadata.CustomMetadata(); + // Developer name and Label are applied here + customMetadata.fullName = + r.getSObjectType().getDescribe().getName() + + '.' + + (String) r.get('DeveloperName'); + customMetadata.label = (String) r.get('Label'); + Metadata.CustomMetadata mdt = new Metadata.CustomMetadata(); + Map populatedFields = r.getPopulatedFieldsAsMap(); + // We don't want these in values + List ignoredKeys = new List{ + 'Id', + 'DeveloperName', + 'Label' + }; + for (String key : populatedFields.keySet()) { + if (ignoredKeys.contains(key)) { + continue; + } + Metadata.CustomMetadataValue customField = new Metadata.CustomMetadataValue(); + customField.field = key; + customField.value = populatedFields.get(key); + customMetadata.values.add(customField); + } + + mdContainer.addMetadata(customMetadata); + } + + ApexMdApiDeployCallback cb = new ApexMdApiDeployCallback(); + // Enqueue custom metadata deployment + return Metadata.Operations.enqueueDeployment(mdContainer, cb); + } + /** * Insert the given Custom Metadata records into the orgs config **/ @@ -85,6 +125,21 @@ public class CustomMetadataService { handleDeleteResults(results[0]); } + /** + * Delete the given Custom Metadata records from the org using Async action + **/ + public static Id deleteMetadataAsync( + SObjectType qualifiedMetadataType, + List customMetadataFullNames + ) { + return System.enqueueJob( + new DeleteMetadataQueueable( + qualifiedMetadataType, + customMetadataFullNames + ) + ); + } + public class CustomMetadataServiceException extends Exception { } @@ -217,4 +272,60 @@ public class CustomMetadataService { 'Request failed with no specified error.' ); } + + class ApexMdApiDeployCallback implements Metadata.DeployCallback { + public void handleResult( + Metadata.DeployResult result, + Metadata.DeployCallbackContext context + ) { + UserNotification__e updateEvent = new UserNotification__e( + Type__c = 'DeploymentResult', + Payload__c = JSON.serialize(result) + ); + EventBus.publish(updateEvent); + } + } + + class DeleteMetadataQueueable implements Queueable, Database.AllowsCallouts { + SObjectType qualifiedMetadataType; + List customMetadataFullNames; + public DeleteMetadataQueueable( + SObjectType qualifiedMetadataType, + List customMetadataFullNames + ) { + this.qualifiedMetadataType = qualifiedMetadataType; + this.customMetadataFullNames = customMetadataFullNames; + } + + public void execute(QueueableContext ctx) { + try { + CustomMetadataService.deleteMetadata( + qualifiedMetadataType, + customMetadataFullNames + ); + UserNotification__e updateEvent = new UserNotification__e( + Type__c = 'DeleteRequestResult', + Payload__c = JSON.serialize( + new Map{ + 'success' => true, + 'metadataNames' => customMetadataFullNames + } + ) + ); + EventBus.publish(updateEvent); + } catch (CustomMetadataService.CustomMetadataServiceException e) { + UserNotification__e updateEvent = new UserNotification__e( + Type__c = 'DeleteRequestResult', + Payload__c = JSON.serialize( + new Map{ + 'success' => false, + 'metadataNames' => customMetadataFullNames, + 'error' => e.getMessage() + } + ) + ); + EventBus.publish(updateEvent); + } + } + } } diff --git a/dlrs/main/classes/ObjectSelectorController.cls-meta.xml b/dlrs/main/classes/ObjectSelectorController.cls-meta.xml new file mode 100644 index 00000000..ab9a6e69 --- /dev/null +++ b/dlrs/main/classes/ObjectSelectorController.cls-meta.xml @@ -0,0 +1,5 @@ + + + 57.0 + Active + diff --git a/dlrs/main/classes/RollupEditorController.cls b/dlrs/main/classes/RollupEditorController.cls index 9871db66..eebf7329 100644 --- a/dlrs/main/classes/RollupEditorController.cls +++ b/dlrs/main/classes/RollupEditorController.cls @@ -23,7 +23,7 @@ public with sharing class RollupEditorController { ); // map of errors by "location" such as "record" or "[fieldname]" to enable displaying the error against a specific field/aread of Map> errorMap = new Map>{}; - // 'record' => new List() + // 'record' => new List() // TODO: execute validations and check configs return errorMap; @@ -35,56 +35,20 @@ public with sharing class RollupEditorController { rollup, LookupRollupSummary2__mdt.class ); - return saveRollup(lookupConfig); - } - - // TODO: move somewhere else - public static Id saveRollup(LookupRollupSummary2__mdt rollup) { - // Setup custom metadata to be created in the subscriber org. - Metadata.CustomMetadata customMetadata = new Metadata.CustomMetadata(); - // TODO: does this get weird if we're in a namespaced context?? - // Developer name and Label are applied here - customMetadata.fullName = - 'LookupRollupSummary2__mdt.' + rollup.DeveloperName; - customMetadata.label = rollup.Label; - Metadata.CustomMetadata mdt = new Metadata.CustomMetadata(); - Map populatedFields = rollup.getPopulatedFieldsAsMap(); - // We don't want these in values - List ignoredKeys = new List{ - 'Id', - 'DeveloperName', - 'Label' - }; - for (String key : populatedFields.keySet()) { - if (ignoredKeys.contains(key)) { - continue; - } - Metadata.CustomMetadataValue customField = new Metadata.CustomMetadataValue(); - customField.field = key; - customField.value = populatedFields.get(key); - customMetadata.values.add(customField); - } - - Metadata.DeployContainer mdContainer = new Metadata.DeployContainer(); - mdContainer.addMetadata(customMetadata); - - DeployCallback cb = new DeployCallback(); - // Enqueue custom metadata deployment - Id jobId = Metadata.Operations.enqueueDeployment(mdContainer, cb); - return jobId; + return CustomMetadataService.initiateMetadataSave( + new List{ lookupConfig } + ); } - // TODO: move somewhere else - class DeployCallback implements Metadata.DeployCallback { - public void handleResult( - Metadata.DeployResult result, - Metadata.DeployCallbackContext context - ) { - UserNotification__e updateEvent = new UserNotification__e( - Type__c = 'DeploymentResult', - Payload__c = JSON.serialize(result) + @AuraEnabled + public static Id deleteRollupConfig(String rollupName) { + try { + return CustomMetadataService.deleteMetadataAsync( + LookupRollupSummary2__mdt.getSObjectType(), + new List{ rollupName } ); - EventBus.publish(updateEvent); + } catch (Exception e) { + throw new AuraHandledException(e.getMessage()); } } } diff --git a/dlrs/main/lwc/manageRollups/manageRollups.html b/dlrs/main/lwc/manageRollups/manageRollups.html index c8df4003..0ae25618 100644 --- a/dlrs/main/lwc/manageRollups/manageRollups.html +++ b/dlrs/main/lwc/manageRollups/manageRollups.html @@ -2,19 +2,28 @@ - - - +
+
+ +
+ + +
- +
diff --git a/dlrs/main/lwc/manageRollups/manageRollups.js b/dlrs/main/lwc/manageRollups/manageRollups.js index fb814141..7eb83050 100644 --- a/dlrs/main/lwc/manageRollups/manageRollups.js +++ b/dlrs/main/lwc/manageRollups/manageRollups.js @@ -1,6 +1,8 @@ import { LightningElement } from "lwc"; import { ShowToastEvent } from "lightning/platformShowToastEvent"; +import LightningConfirm from "lightning/confirm"; import getAllRollupConfigs from "@salesforce/apex/RollupEditorController.getAllRollupConfigs"; +import deleteRollupConfig from "@salesforce/apex/RollupEditorController.deleteRollupConfig"; import USER_ID from "@salesforce/user/Id"; import { @@ -49,7 +51,7 @@ export default class ManageRollups extends LightningElement { typeAttributes: { rowActions: [ { label: "Edit", name: "rollup_select" }, - { label: "Delete(TBD)", name: "rollup_delete" } + { label: "Delete", name: "rollup_delete" } ] } } @@ -63,6 +65,8 @@ export default class ManageRollups extends LightningElement { subscription = {}; rollups = {}; + rollupList = []; + searchFilter = ""; selectedRollup = undefined; connectedCallback() { @@ -74,6 +78,25 @@ export default class ManageRollups extends LightningElement { async refreshRollups() { this.rollups = await getAllRollupConfigs(); + this.calcRollupList(); + } + + calcRollupList() { + this.rollupList = Object.values(this.rollups).filter((r) => { + if (this.searchFilter.trim().length === 0) { + return true; + } + for (const c of this.dtColumns) { + if ( + r[c.fieldName] && + "" + r[c.fieldName].toLowerCase().indexOf(this.searchFilter) >= 0 + ) { + return true; + } + } + // didn't match any of the displayed fields + return false; + }); } rollupSelectHandler(event) { @@ -81,21 +104,45 @@ export default class ManageRollups extends LightningElement { const row = event.detail.row; switch (action.name) { case "rollup_select": - this.selectedRollup = row.DeveloperName; + this.template + .querySelector("c-rollup-editor") + .loadRollup(row.DeveloperName); break; case "rollup_delete": - // TODO: + this.requestDelete(row.DeveloperName); break; default: - // do nothin + throw new Error("unexpected action on rollupSelectHandler"); } } - get rollupList() { - if (!this.rollups) { - return []; + async requestDelete(rollupName) { + const confirmed = await LightningConfirm.open({ + message: `Are you sure you want to delete the rollup named: ${rollupName}`, + label: "Delete Rollup Configuration", + theme: "warning" + }); + if (confirmed) { + this.dispatchEvent( + new ShowToastEvent({ + title: "Delete Started", + message: `Started request to delete ${rollupName}`, + variant: "info" + }) + ); + deleteRollupConfig({ rollupName: rollupName }); } - return Object.values(this.rollups); + } + + handleInputChange() { + this.searchFilter = this.template + .querySelector("lightning-input") + .value.toLowerCase(); + this.calcRollupList(); + } + + handleRequestDelete(event) { + this.requestDelete(event.detail.rollupName); } //////////////////// @@ -116,41 +163,59 @@ export default class ManageRollups extends LightningElement { } // Callback invoked whenever a new event message is received const messageCallback = (response) => { - console.log("New message received: ", JSON.stringify(response)); + // console.log("New message received: ", JSON.stringify(response)); // deployment probably changed the rollup definitions, should refresh this.refreshRollups(); if (!USER_ID.startsWith(response.data.payload.Recipient__c)) { // This message isn't for us, don't do anything return; } - // TODO: handle this way better - let title, message, messageData, variant, mode; const deploymentData = JSON.parse(response.data.payload.Payload__c); - if (deploymentData.status === "Succeeded") { - title = "Deployment Completed!"; - message = "Metadata saved successfully"; - variant = "success"; - mode = "dismissible"; - } else { - title = "Deployment Failed!"; - message = - "Status of " + - deploymentData.status + - ", errors [" + - deploymentData.details.componentFailures - .map((failure) => `${failure.fullName}: ${failure.problem}`) - .join("\n") + - "], \n{0}"; - // if you know a better way to build this URL please replace this - messageData = [ - { - label: "Click to view Deployment", - url: `/lightning/setup/DeployStatus/page?address=%2Fchangemgmt%2FmonitorDeploymentsDetails.apexp%3FasyncId%3D${deploymentData.id}` + + switch (response.data.payload.Type__c) { + case "DeleteRequestResult": + if (deploymentData.success) { + title = "Delete Completed!"; + message = `${deploymentData.metadataNames} deleted successfully`; + variant = "success"; + mode = "dismissible"; + } else { + title = "Delete Failed!"; + message = `Attempt to delete ${deploymentData.metadataNames} returned with errors [${deploymentData.error}]`; + variant = "error"; + mode = "sticky"; + } + break; + case "DeploymentResult": + if (deploymentData.status === "Succeeded") { + title = "Deployment Completed!"; + message = "Metadata saved successfully"; + variant = "success"; + mode = "dismissible"; + } else { + title = "Deployment Failed!"; + message = + "Status of " + + deploymentData.status + + ", errors [" + + deploymentData.details.componentFailures + .map((failure) => `${failure.fullName}: ${failure.problem}`) + .join("\n") + + "], \n{0}"; + // if you know a better way to build this URL please replace this + messageData = [ + { + label: "Click to view Deployment", + url: `/lightning/setup/DeployStatus/page?address=%2Fchangemgmt%2FmonitorDeploymentsDetails.apexp%3FasyncId%3D${deploymentData.id}` + } + ]; + variant = "error"; + mode = "sticky"; } - ]; - variant = "error"; - mode = "sticky"; + break; + default: + break; } const evt = new ShowToastEvent({ @@ -168,17 +233,14 @@ export default class ManageRollups extends LightningElement { subscribe(this.channelName, -1, messageCallback).then((response) => { // Response contains the subscription information on subscribe call this.subscription = response; - this.toggleSubscribeButton(true); }); } // Handles unsubscribe button click handleUnsubscribe() { - this.toggleSubscribeButton(false); - // Invoke unsubscribe method of empApi - unsubscribe(this.subscription, (response) => { - console.log("unsubscribe() response: ", JSON.stringify(response)); + unsubscribe(this.subscription, (/*response*/) => { + // console.log("unsubscribe() response: ", JSON.stringify(response)); // Response is true for successful unsubscribe }); } diff --git a/dlrs/main/lwc/objectSelector/objectSelector.js b/dlrs/main/lwc/objectSelector/objectSelector.js index 8fee4942..18fd21f3 100644 --- a/dlrs/main/lwc/objectSelector/objectSelector.js +++ b/dlrs/main/lwc/objectSelector/objectSelector.js @@ -1,119 +1,113 @@ -import { LightningElement,api,wire } from 'lwc'; +import { LightningElement, api } from "lwc"; -import getAllObjects from '@salesforce/apex/ObjectSelectorController.getParentObjList'; +import getAllObjects from "@salesforce/apex/ObjectSelectorController.getParentObjList"; -const DELAY = 300; // delay apex callout timing in miliseconds +const DELAY = 300; // delay apex callout timing in miliseconds export default class ObjectSelector extends LightningElement { - // public properties with initial default values - @api label = 'Object'; - @api placeholder = 'Search...'; - @api iconName = 'standard:account'; -@api currentSelection; - // private properties - lstResult = []; // to store list of returned records - hasRecords = true; - searchKey=''; // to store input field value - isSearchLoading = false; // to control loading spinner + // public properties with initial default values + @api label = "Object"; + @api placeholder = "Search..."; + @api iconName = "standard:account"; + @api currentSelection; + // private properties + lstResult = []; // to store list of returned records + hasRecords = true; + searchKey = ""; // to store input field value + isSearchLoading = false; // to control loading spinner delayTimeout; - selectedRecord = {}; // to store selected lookup record in object formate - mapData = []; - connectedCallback(){ - + selectedRecord = {}; // to store selected lookup record in object formate + mapData = []; + connectedCallback() { //GET LIST OF ALL OBJECTS getAllObjects() - .then((result) => { - if(result != null){ - this.mapData=JSON.parse(JSON.stringify(result)); + .then((result) => { + if (result != null) { + this.mapData = JSON.parse(JSON.stringify(result)); } - }) - .catch((error) => { + }) + .catch((error) => { this.error = error; this.mapData = {}; - }); - } - + }); + } - // update searchKey property on input field change - handleKeyChange(event) { + // update searchKey property on input field change + handleKeyChange(event) { // Debouncing this method: Do not update the reactive property as long as this function is // being called within a delay of DELAY. This is to avoid a very large number of Apex method calls. - - - var matchedRecords=[]; + + var matchedRecords = []; this.isSearchLoading = true; window.clearTimeout(this.delayTimeout); const searchKey = event.target.value; this.delayTimeout = setTimeout(() => { - matchedRecords = this.mapData.filter(function(link){ - return link.toLowerCase().includes(searchKey.toLowerCase()) + matchedRecords = this.mapData.filter(function (link) { + return link.toLowerCase().includes(searchKey.toLowerCase()); }); - this.hasRecords = matchedRecords.length == 0 ? false : true; - this.lstResult = JSON.parse(JSON.stringify(matchedRecords)); + this.hasRecords = matchedRecords.length == 0 ? false : true; + this.lstResult = JSON.parse(JSON.stringify(matchedRecords)); }, DELAY); - -} + } - // method to toggle lookup result section on UI - toggleResult(event){ - const lookupInputContainer = this.template.querySelector('.lookupInputContainer'); + // method to toggle lookup result section on UI + toggleResult(event) { + const lookupInputContainer = this.template.querySelector( + ".lookupInputContainer" + ); const clsList = lookupInputContainer.classList; - const whichEvent = event.target.getAttribute('data-source'); - switch(whichEvent) { - case 'searchInputField': - clsList.add('slds-is-open'); - break; - case 'lookupContainer': - clsList.remove('slds-is-open'); - break; - } -} + const whichEvent = event.target.getAttribute("data-source"); + switch (whichEvent) { + case "searchInputField": + clsList.add("slds-is-open"); + break; + case "lookupContainer": + clsList.remove("slds-is-open"); + break; + } + } - // method to clear selected lookup record - handleRemove(){ - this.searchKey = ''; + // method to clear selected lookup record + handleRemove() { + this.searchKey = ""; this.selectedRecord = {}; - this.lookupUpdatehandler(undefined); // update value on parent component as well from helper function - - // remove selected pill and display input field again - const searchBoxWrapper = this.template.querySelector('.searchBoxWrapper'); - searchBoxWrapper.classList.remove('slds-hide'); - searchBoxWrapper.classList.add('slds-show'); - const pillDiv = this.template.querySelector('.pillDiv'); - pillDiv.classList.remove('slds-show'); - pillDiv.classList.add('slds-hide'); + this.lookupUpdatehandler(undefined); // update value on parent component as well from helper function + + // remove selected pill and display input field again + const searchBoxWrapper = this.template.querySelector(".searchBoxWrapper"); + searchBoxWrapper.classList.remove("slds-hide"); + searchBoxWrapper.classList.add("slds-show"); + const pillDiv = this.template.querySelector(".pillDiv"); + pillDiv.classList.remove("slds-show"); + pillDiv.classList.add("slds-hide"); } - // method to update selected record from search result -handelSelectedRecord(event){ - var objId = event.target.getAttribute('data-recid'); // get selected record Id - this.selectedRecord = this.lstResult.find(data => data === objId); // find selected record from list - this.lookupUpdatehandler(this.selectedRecord); // update value on parent component as well from helper function - this.handelSelectRecordHelper(); // helper function to show/hide lookup result container on UI -} -/*COMMON HELPER METHOD STARTED*/ -handelSelectRecordHelper(){ - this.template.querySelector('.lookupInputContainer').classList.remove('slds-is-open'); - const searchBoxWrapper = this.template.querySelector('.searchBoxWrapper'); - searchBoxWrapper.classList.remove('slds-show'); - searchBoxWrapper.classList.add('slds-hide'); - const pillDiv = this.template.querySelector('.pillDiv'); - pillDiv.classList.remove('slds-hide'); - pillDiv.classList.add('slds-show'); -} -// send selected lookup record to parent component using custom event -lookupUpdatehandler(value){ + // method to update selected record from search result + handelSelectedRecord(event) { + var objId = event.target.getAttribute("data-recid"); // get selected record Id + this.selectedRecord = this.lstResult.find((data) => data === objId); // find selected record from list + this.lookupUpdatehandler(this.selectedRecord); // update value on parent component as well from helper function + this.handelSelectRecordHelper(); // helper function to show/hide lookup result container on UI + } + /*COMMON HELPER METHOD STARTED*/ + handelSelectRecordHelper() { + this.template + .querySelector(".lookupInputContainer") + .classList.remove("slds-is-open"); + const searchBoxWrapper = this.template.querySelector(".searchBoxWrapper"); + searchBoxWrapper.classList.remove("slds-show"); + searchBoxWrapper.classList.add("slds-hide"); + const pillDiv = this.template.querySelector(".pillDiv"); + pillDiv.classList.remove("slds-hide"); + pillDiv.classList.add("slds-show"); + } + // send selected lookup record to parent component using custom event + lookupUpdatehandler(value) { //Send only the API Name in the event var regExp = /\(([^)]+)\)/; var retVal = regExp.exec(JSON.stringify(value)); - const oEvent = new CustomEvent('lookupupdate', - { - 'detail': {selectedRecord: retVal[1]} - } - ); - this.dispatchEvent(oEvent); -} - - - - + const oEvent = new CustomEvent("lookupupdate", { + detail: { selectedRecord: retVal[1] } + }); + this.dispatchEvent(oEvent); + } } diff --git a/dlrs/main/lwc/rollupEditor/rollupEditor.html b/dlrs/main/lwc/rollupEditor/rollupEditor.html index 1cf27664..e6d485aa 100644 --- a/dlrs/main/lwc/rollupEditor/rollupEditor.html +++ b/dlrs/main/lwc/rollupEditor/rollupEditor.html @@ -1,137 +1,218 @@ \ No newline at end of file +

+ Select what field you want to rollup, the type of rollup, and what + field on the Parent object to store the result. +

+ + + + + + + + + + + + + + + +

Aggregate All Rows

+ +
+ + + + + + +
+ + + + + +
+
+ +
+ + + diff --git a/dlrs/main/lwc/rollupEditor/rollupEditor.js b/dlrs/main/lwc/rollupEditor/rollupEditor.js index 3f69e2f4..eb0b6420 100644 --- a/dlrs/main/lwc/rollupEditor/rollupEditor.js +++ b/dlrs/main/lwc/rollupEditor/rollupEditor.js @@ -1,13 +1,28 @@ -import { api, LightningElement } from "lwc"; +import { api, LightningElement, track } from "lwc"; import { ShowToastEvent } from "lightning/platformShowToastEvent"; import getRollupConfig from "@salesforce/apex/RollupEditorController.getRollupConfig"; import validateRollupConfig from "@salesforce/apex/RollupEditorController.validateRollupConfig"; import saveRollupConfig from "@salesforce/apex/RollupEditorController.saveRollupConfig"; export default class RollupEditor extends LightningElement { + @track + rollup = {}; errors = {}; + _rollupName; - rollup = {}; + @api + async loadRollup(rollupName) { + this.rollupName = rollupName; + } + + get rollupName() { + return this._rollupName; + } + set rollupName(val) { + this._rollupName = val; + + this.getRollup(); + } connectedCallback() { this.getRollup(); @@ -33,7 +48,25 @@ export default class RollupEditor extends LightningElement { }); } + cancelClickHandler() { + this.rollupName = undefined; + } + + cloneClickHandler() { + this.rollup.DeveloperName = undefined; + this.rollup.Id = undefined; + } + + deleteClickHandler() { + const evt = new CustomEvent("requestdelete", { + detail: { rollupName: this.rollup.DeveloperName } + }); + this.dispatchEvent(evt); + this.rollupName = undefined; + } + async runSave() { + this.assembleRollupFromForm(); const jobId = await saveRollupConfig({ rollup: JSON.stringify(this.rollup) }); @@ -45,24 +78,46 @@ export default class RollupEditor extends LightningElement { this.dispatchEvent(evt); } - updateRollup() { - try { - this.rollup = JSON.parse( - this.template.querySelector("lightning-textarea").value - ); - } catch (error) { - console.error(error); - } + assembleRollupFromForm() { + this.rollup.Label = this.template.querySelector( + '[data-name="rollup_label"]' + ).value; + this.rollup.DeveloperName = this.template.querySelector( + '[data-name="rollup_DeveloperName"]' + ).value; + this.rollup.RelationshipField__c = this.template.querySelector( + '[data-name="rollup_relationship_field"]' + ).value; + this.rollup.RelationshipCriteria__c = this.template.querySelector( + '[data-name="rollup_relationship_criteria"]' + ).value; + this.rollup.RelationshipCriteriaFields__c = this.template.querySelector( + '[data-name="rollup_relationship_criteria_fields"]' + ).value; + this.rollup.FieldToAggregate__c = this.template.querySelector( + '[data-name="rollup_FieldToAggregate__c"]' + ).value; + this.rollup.AggregateOperation__c = this.template.querySelector( + '[data-name="rollup_AggregateOperation__c"]' + ).value; + this.rollup.AggregateResultField__c = this.template.querySelector( + '[data-name="rollup_AggregateResultField__c"]' + ).value; + this.rollup.AggregateAllRows__c = this.template.querySelector( + '[data-name="rollup_AggregateAllRows__c"]' + ).value; + this.rollup.RowLimit__c = this.template.querySelector( + '[data-name="rollup_RowLimit__c"]' + ).value; + this.rollup.ConcatenateDelimiter__c = this.template.querySelector( + '[data-name="rollup_ConcatenateDelimiter__c"]' + ).value; } - - @api - get rollupName() { - return this._rollupName; + childObjectSelected(event) { + this.rollup.ChildObject__c = event.detail.selectedRecord; } - set rollupName(val) { - this._rollupName = val; - - this.getRollup(); + parentObjectSelected(event) { + this.rollup.ParentObject__c = event.detail.selectedRecord; } get rollupAsString() { @@ -72,12 +127,19 @@ export default class RollupEditor extends LightningElement { get errorsAsString() { return JSON.stringify(this.errors); } - + get aggregateOptions() { return [ - { label: 'New', value: 'new' }, - { label: 'In Progress', value: 'inProgress' }, - { label: 'Finished', value: 'finished' }, + { label: "Sum", value: "Sum" }, + { label: "Max", value: "Max" }, + { label: "Min", value: "Min" }, + { label: "Avg", value: "Avg" }, + { label: "Count", value: "Count" }, + { label: "Count Distinct", value: "Count Distinct" }, + { label: "Concatenate", value: "Concatenate" }, + { label: "Concatenate Distinct", value: " Concatenate Distinct" }, + { label: "First", value: "First" }, + { label: "Last", value: "Last" } ]; } } diff --git a/dlrs/main/permissionsets/LookupRollupSummariesFull.permissionset-meta.xml b/dlrs/main/permissionsets/LookupRollupSummariesFull.permissionset-meta.xml index d9584779..c1158826 100644 --- a/dlrs/main/permissionsets/LookupRollupSummariesFull.permissionset-meta.xml +++ b/dlrs/main/permissionsets/LookupRollupSummariesFull.permissionset-meta.xml @@ -12,6 +12,10 @@ ManageLookupRollupSummariesController true
+ + ObjectSelectorController + true + OptimizerComponentController true diff --git a/dlrs/main/tabs/ManageLookupRollupSummaries2.tab-meta.xml b/dlrs/main/tabs/ManageLookupRollupSummaries2.tab-meta.xml index 57759e07..9331d4f0 100644 --- a/dlrs/main/tabs/ManageLookupRollupSummaries2.tab-meta.xml +++ b/dlrs/main/tabs/ManageLookupRollupSummaries2.tab-meta.xml @@ -2,6 +2,6 @@ Manage Lookup Rollup Configs ManageLookupRollupSummaries - + Custom67: Gears From 4544f6f1eaefcec79f5ef2b743fe28a09d7ecb78 Mon Sep 17 00:00:00 2001 From: Anthony Heber Date: Sun, 9 Apr 2023 15:23:56 -0600 Subject: [PATCH 013/130] Add validation and (de)activation --- dlrs/main/classes/RollupEditorController.cls | 122 +++++++++++++++++- dlrs/main/classes/RollupSummary.cls | 3 + dlrs/main/lwc/rollupEditor/rollupEditor.html | 51 ++++++++ dlrs/main/lwc/rollupEditor/rollupEditor.js | 28 +++- .../__tests__/rollupEditorError.test.js | 25 ++++ .../rollupEditorError/rollupEditorError.html | 11 ++ .../rollupEditorError/rollupEditorError.js | 6 + .../rollupEditorError.js-meta.xml | 5 + 8 files changed, 245 insertions(+), 6 deletions(-) create mode 100644 dlrs/main/lwc/rollupEditorError/__tests__/rollupEditorError.test.js create mode 100644 dlrs/main/lwc/rollupEditorError/rollupEditorError.html create mode 100644 dlrs/main/lwc/rollupEditorError/rollupEditorError.js create mode 100644 dlrs/main/lwc/rollupEditorError/rollupEditorError.js-meta.xml diff --git a/dlrs/main/classes/RollupEditorController.cls b/dlrs/main/classes/RollupEditorController.cls index eebf7329..c97d569c 100644 --- a/dlrs/main/classes/RollupEditorController.cls +++ b/dlrs/main/classes/RollupEditorController.cls @@ -14,6 +14,10 @@ public with sharing class RollupEditorController { .Record; } + /** + * returns a map of fieldname => list to use in displaying error in the UI + * general errors are applied to the 'record' field name + */ @AuraEnabled public static Map> validateRollupConfig(String rollup) { // do things like validate that the Rollup Criteria can be used in a SOQL query @@ -21,11 +25,19 @@ public with sharing class RollupEditorController { rollup, LookupRollupSummary2__mdt.class ); - // map of errors by "location" such as "record" or "[fieldname]" to enable displaying the error against a specific field/aread of - Map> errorMap = new Map>{}; - // 'record' => new List() - // TODO: execute validations and check configs + // Process only Custom Metadata records here + List mdtRecords = new List(); + mdtRecords.add(lookupConfig); + + // Validate via Domain class and throw appropirte exception + RollupSummaries rollupSummaries = new RollupSummaries(mdtRecords); + rollupSummaries.onValidate(); + Map> errorMap; + for (RollupSummary rollupSummaryRecord : rollupSummaries.Records) { + errorMap = collectErrors(rollupSummaryRecord); + } + return errorMap; } @@ -51,4 +63,106 @@ public with sharing class RollupEditorController { throw new AuraHandledException(e.getMessage()); } } + + private static Map> collectErrors(RollupSummary rollup) { + Map> errorMap = new Map>(); + if (rollup.Error != null) { + buildErrorIfNeeded(errorMap, 'record', new List{ rollup.Error }); + } + buildErrorIfNeeded( + errorMap, + LookupRollupSummary2__mdt.fields.Active__c.getDescribe().getName(), + rollup.Fields.Active.errors + ); + buildErrorIfNeeded( + errorMap, + LookupRollupSummary2__mdt.fields.AggregateOperation__c.getDescribe() + .getName(), + rollup.Fields.AggregateOperation.errors + ); + buildErrorIfNeeded( + errorMap, + LookupRollupSummary2__mdt.fields.AggregateResultField__c.getDescribe() + .getName(), + rollup.Fields.AggregateResultField.errors + ); + buildErrorIfNeeded( + errorMap, + LookupRollupSummary2__mdt.fields.CalculationMode__c.getDescribe() + .getName(), + rollup.Fields.CalculationMode.errors + ); + buildErrorIfNeeded( + errorMap, + LookupRollupSummary2__mdt.fields.CalculationSharingMode__c.getDescribe() + .getName(), + rollup.Fields.CalculationSharingMode.errors + ); + buildErrorIfNeeded( + errorMap, + LookupRollupSummary2__mdt.fields.ChildObject__c.getDescribe().getName(), + rollup.Fields.ChildObject.errors + ); + buildErrorIfNeeded( + errorMap, + LookupRollupSummary2__mdt.fields.Description__c.getDescribe().getName(), + rollup.Fields.Description.errors + ); + buildErrorIfNeeded( + errorMap, + LookupRollupSummary2__mdt.fields.FieldToAggregate__c.getDescribe() + .getName(), + rollup.Fields.FieldToAggregate.errors + ); + buildErrorIfNeeded( + errorMap, + LookupRollupSummary2__mdt.fields.DeveloperName.getDescribe().getName(), + rollup.Fields.UniqueName.errors + ); + buildErrorIfNeeded( + errorMap, + LookupRollupSummary2__mdt.fields.ParentObject__c.getDescribe().getName(), + rollup.Fields.ParentObject.errors + ); + buildErrorIfNeeded( + errorMap, + LookupRollupSummary2__mdt.fields.RelationshipCriteria__c.getDescribe() + .getName(), + rollup.Fields.RelationshipCriteria.errors + ); + buildErrorIfNeeded( + errorMap, + LookupRollupSummary2__mdt.fields.RelationshipCriteriaFields__c.getDescribe() + .getName(), + rollup.Fields.RelationshipCriteriaFields.errors + ); + buildErrorIfNeeded( + errorMap, + LookupRollupSummary2__mdt.fields.RelationshipField__c.getDescribe() + .getName(), + rollup.Fields.RelationshipField.errors + ); + buildErrorIfNeeded( + errorMap, + LookupRollupSummary2__mdt.fields.TestCode2__c.getDescribe().getName(), + rollup.Fields.TestCode.errors + ); + buildErrorIfNeeded( + errorMap, + LookupRollupSummary2__mdt.fields.RowLimit__c.getDescribe().getName(), + rollup.Fields.RowLimit.errors + ); + return errorMap; + } + + private static void buildErrorIfNeeded( + Map> errorMap, + String fieldName, + List errors + ) { + if (errors.isEmpty()) { + return; + } + errorMap.put(fieldName, errors); + } } diff --git a/dlrs/main/classes/RollupSummary.cls b/dlrs/main/classes/RollupSummary.cls index 05e47c00..4aaf8fed 100644 --- a/dlrs/main/classes/RollupSummary.cls +++ b/dlrs/main/classes/RollupSummary.cls @@ -335,12 +335,15 @@ public class RollupSummary { **/ public class FieldData { public RecordMetadata RecordMetadata { get; private set; } + public List errors { get; private set; } public FieldData(RecordMetadata recordMetadata) { this.RecordMetadata = recordMetadata; + this.errors = new List(); } public void addError(String errorMessage) { + this.errors.add(errorMessage); // Field in error? String fieldLabelInError; if (this === RecordMetadata.Active) { diff --git a/dlrs/main/lwc/rollupEditor/rollupEditor.html b/dlrs/main/lwc/rollupEditor/rollupEditor.html index e6d485aa..9978f20f 100644 --- a/dlrs/main/lwc/rollupEditor/rollupEditor.html +++ b/dlrs/main/lwc/rollupEditor/rollupEditor.html @@ -7,6 +7,16 @@ label="Cancel" onclick={cancelClickHandler} > + +
+
@@ -40,6 +51,10 @@ placeholder="My Rollup Name" value={rollup.Label} > + + +
@@ -71,6 +89,9 @@ current-selection={rollup.ParentObject__c} onlookupupdate={parentObjectSelected} > + +
@@ -100,6 +124,9 @@ placeholder="lookup__c" value={rollup.RelationshipField__c} > + + + @@ -147,6 +180,9 @@ placeholder="Days__c" value={rollup.FieldToAggregate__c} > + + + @@ -179,6 +221,9 @@

Aggregate All Rows

label="Include Deleted" value={rollup.AggregateAllRows__c} > + Aggregate All Rows placeholder="0" value={rollup.RowLimit__c} > + Aggregate All Rows label="Concatenate Delimiter" value={rollup.ConcatenateDelimiter__c} > +
diff --git a/dlrs/main/lwc/rollupEditor/rollupEditor.js b/dlrs/main/lwc/rollupEditor/rollupEditor.js index eb0b6420..60fc5fd1 100644 --- a/dlrs/main/lwc/rollupEditor/rollupEditor.js +++ b/dlrs/main/lwc/rollupEditor/rollupEditor.js @@ -5,8 +5,9 @@ import validateRollupConfig from "@salesforce/apex/RollupEditorController.valida import saveRollupConfig from "@salesforce/apex/RollupEditorController.saveRollupConfig"; export default class RollupEditor extends LightningElement { + DEFAULT_ROLLUP_VALUES = { Active__c: false }; @track - rollup = {}; + rollup = this.DEFAULT_ROLLUP_VALUES; errors = {}; _rollupName; @@ -28,9 +29,17 @@ export default class RollupEditor extends LightningElement { this.getRollup(); } + get rollupCanBeActivated() { + return this.rollup.Id && !this.rollup.Active__c; + } + + get rollupCanBeDeactivated() { + return this.rollup.Id && this.rollup.Active__c; + } + async getRollup() { if (!this.rollupName) { - this.rollup = {}; + this.rollup = this.DEFAULT_ROLLUP_VALUES; return; } try { @@ -65,8 +74,23 @@ export default class RollupEditor extends LightningElement { this.rollupName = undefined; } + activateClickHandler() { + this.rollup.Active__c = true; + this.runSave(); + } + + deactivateClickHandler() { + this.rollup.Active__c = false; + this.runSave(); + } + async runSave() { this.assembleRollupFromForm(); + await this.runValidate(); + if (Object.keys(this.errors).length > 0) { + console.error("Record has errors", this.errors); + return; + } const jobId = await saveRollupConfig({ rollup: JSON.stringify(this.rollup) }); diff --git a/dlrs/main/lwc/rollupEditorError/__tests__/rollupEditorError.test.js b/dlrs/main/lwc/rollupEditorError/__tests__/rollupEditorError.test.js new file mode 100644 index 00000000..77b7e120 --- /dev/null +++ b/dlrs/main/lwc/rollupEditorError/__tests__/rollupEditorError.test.js @@ -0,0 +1,25 @@ +import { createElement } from 'lwc'; +import RollupEditorError from 'c/rollupEditorError'; + +describe('c-rollup-editor-error', () => { + 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-rollup-editor-error', { + is: RollupEditorError + }); + + // 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/dlrs/main/lwc/rollupEditorError/rollupEditorError.html b/dlrs/main/lwc/rollupEditorError/rollupEditorError.html new file mode 100644 index 00000000..17dee7d0 --- /dev/null +++ b/dlrs/main/lwc/rollupEditorError/rollupEditorError.html @@ -0,0 +1,11 @@ + diff --git a/dlrs/main/lwc/rollupEditorError/rollupEditorError.js b/dlrs/main/lwc/rollupEditorError/rollupEditorError.js new file mode 100644 index 00000000..7d55e5e0 --- /dev/null +++ b/dlrs/main/lwc/rollupEditorError/rollupEditorError.js @@ -0,0 +1,6 @@ +import { LightningElement, api } from "lwc"; + +export default class RollupEditorError extends LightningElement { + @api + errors; +} diff --git a/dlrs/main/lwc/rollupEditorError/rollupEditorError.js-meta.xml b/dlrs/main/lwc/rollupEditorError/rollupEditorError.js-meta.xml new file mode 100644 index 00000000..f8c5cb4a --- /dev/null +++ b/dlrs/main/lwc/rollupEditorError/rollupEditorError.js-meta.xml @@ -0,0 +1,5 @@ + + + 56.0 + false + \ No newline at end of file From 4d2d965fbd8f7d96a7cc8f7521a2c54d6e257bac Mon Sep 17 00:00:00 2001 From: Khang Ly Date: Wed, 12 Apr 2023 17:53:13 +0700 Subject: [PATCH 014/130] feature: the MVP UI of RollupEditor component --- dlrs/main/lwc/rollupEditor/rollupEditor.html | 797 +++++++++++++------ dlrs/main/lwc/rollupEditor/rollupEditor.js | 90 ++- 2 files changed, 592 insertions(+), 295 deletions(-) diff --git a/dlrs/main/lwc/rollupEditor/rollupEditor.html b/dlrs/main/lwc/rollupEditor/rollupEditor.html index 9978f20f..44103d80 100644 --- a/dlrs/main/lwc/rollupEditor/rollupEditor.html +++ b/dlrs/main/lwc/rollupEditor/rollupEditor.html @@ -1,269 +1,542 @@ diff --git a/dlrs/main/lwc/rollupEditor/rollupEditor.js b/dlrs/main/lwc/rollupEditor/rollupEditor.js index 60fc5fd1..09a372d9 100644 --- a/dlrs/main/lwc/rollupEditor/rollupEditor.js +++ b/dlrs/main/lwc/rollupEditor/rollupEditor.js @@ -103,39 +103,35 @@ export default class RollupEditor extends LightningElement { } assembleRollupFromForm() { - this.rollup.Label = this.template.querySelector( - '[data-name="rollup_label"]' - ).value; - this.rollup.DeveloperName = this.template.querySelector( - '[data-name="rollup_DeveloperName"]' - ).value; - this.rollup.RelationshipField__c = this.template.querySelector( - '[data-name="rollup_relationship_field"]' - ).value; - this.rollup.RelationshipCriteria__c = this.template.querySelector( - '[data-name="rollup_relationship_criteria"]' - ).value; - this.rollup.RelationshipCriteriaFields__c = this.template.querySelector( - '[data-name="rollup_relationship_criteria_fields"]' - ).value; - this.rollup.FieldToAggregate__c = this.template.querySelector( - '[data-name="rollup_FieldToAggregate__c"]' - ).value; - this.rollup.AggregateOperation__c = this.template.querySelector( - '[data-name="rollup_AggregateOperation__c"]' - ).value; - this.rollup.AggregateResultField__c = this.template.querySelector( - '[data-name="rollup_AggregateResultField__c"]' - ).value; - this.rollup.AggregateAllRows__c = this.template.querySelector( - '[data-name="rollup_AggregateAllRows__c"]' - ).value; - this.rollup.RowLimit__c = this.template.querySelector( - '[data-name="rollup_RowLimit__c"]' - ).value; - this.rollup.ConcatenateDelimiter__c = this.template.querySelector( - '[data-name="rollup_ConcatenateDelimiter__c"]' - ).value; + const fieldNames = [ + 'Label', + 'DeveloperName', + 'RelationshipField__c', + 'RelationshipCriteria__c', + 'RelationshipCriteriaFields__c', + 'FieldToAggregate__c', + 'FieldToOrderBy__c', + 'AggregateOperation__c', + 'AggregateResultField__c', + 'AggregateAllRows__c', + 'RowLimit__c', + 'Active__c', + 'CalculationMode__c', + 'CalculationSharingMode__c', + 'ConcatenateDelimiter__c', + 'Description__c', + 'TestCode2__c', + 'TestCodeParent__c', + 'TestCodeSeeAllData__c' + ]; + + const checkboxFields = ['Active__c', 'AggregateAllRows__c', 'TestCodeSeeAllData__c']; + + fieldNames.forEach(fieldName => { + const inputElement = this.template.querySelector(`[data-name="rollup_${fieldName}"]`); + const attribute = checkboxFields.includes(fieldName) ? 'checked' : 'value'; + this.rollup[fieldName] = inputElement[attribute]; + }) } childObjectSelected(event) { this.rollup.ChildObject__c = event.detail.selectedRecord; @@ -166,4 +162,32 @@ export default class RollupEditor extends LightningElement { { label: "Last", value: "Last" } ]; } + + get calculationModes(){ + return [ + { label: "Realtime", value: "Realtime" }, + { label: "Scheduled", value: "Scheduled" }, + { label: "Developer", value: "Developer" }, + { label: "Process Builder", value: "Process Builder" }, + ]; + } + + get calculationSharingModes(){ + return [ + { label: "User", value: "User" }, + { label: "System", value: "System" } + ]; + } + + onToggleSection(event){ + const sectionName = event.currentTarget.getAttribute('data-section-button'); + const element = this.template.querySelector(`[data-section-name="${sectionName}"]`); + const expandClass = 'slds-is-open'; + if(element.className.includes(expandClass)){ + element.className = element.className.replace(expandClass, ''); + } else { + element.className += ' ' + expandClass; + } + } + } From c047b37e0f1a284541be2e1d49c66d61f3a3b6a3 Mon Sep 17 00:00:00 2001 From: Khang Ly Date: Fri, 14 Apr 2023 00:10:32 +0700 Subject: [PATCH 015/130] fix: improve the layout of RollupEditor component --- dlrs/main/lwc/rollupEditor/rollupEditor.html | 281 +++++++++---------- dlrs/main/lwc/rollupEditor/rollupEditor.js | 22 +- 2 files changed, 158 insertions(+), 145 deletions(-) diff --git a/dlrs/main/lwc/rollupEditor/rollupEditor.html b/dlrs/main/lwc/rollupEditor/rollupEditor.html index 44103d80..ad77649e 100644 --- a/dlrs/main/lwc/rollupEditor/rollupEditor.html +++ b/dlrs/main/lwc/rollupEditor/rollupEditor.html @@ -14,35 +14,82 @@

+ +
+
+ + + + +
+ + +
+ +
+
+
+
- - - - - - - - + +
+
+ +
+ + +
+
+
@@ -98,6 +145,20 @@

> + +
+ + +
+ @@ -226,7 +287,7 @@

-
+

- +
+ +
+ +
@@ -328,27 +390,46 @@

errors={errors.RowLimit__c} >

+ + +
+ + +
+ + + -
- -
- - -
- -
+ +
+
+

+ +

+
+ +
+ + +
>
- -
+ +
>
-
- -
-
-
- - -
-
-

- -

-
- -
- -
- - -
-
-
-
-
- - -
-
-

- -

-
-
- -
- - -
@@ -519,24 +536,6 @@

- - - - - - - - - - - - - - - - - - diff --git a/dlrs/main/lwc/rollupEditor/rollupEditor.js b/dlrs/main/lwc/rollupEditor/rollupEditor.js index 09a372d9..c9b1cb01 100644 --- a/dlrs/main/lwc/rollupEditor/rollupEditor.js +++ b/dlrs/main/lwc/rollupEditor/rollupEditor.js @@ -106,6 +106,7 @@ export default class RollupEditor extends LightningElement { const fieldNames = [ 'Label', 'DeveloperName', + 'Description__c', 'RelationshipField__c', 'RelationshipCriteria__c', 'RelationshipCriteriaFields__c', @@ -115,11 +116,10 @@ export default class RollupEditor extends LightningElement { 'AggregateResultField__c', 'AggregateAllRows__c', 'RowLimit__c', - 'Active__c', + 'Active__c', // No Input Element for this field 'CalculationMode__c', 'CalculationSharingMode__c', 'ConcatenateDelimiter__c', - 'Description__c', 'TestCode2__c', 'TestCodeParent__c', 'TestCodeSeeAllData__c' @@ -129,8 +129,10 @@ export default class RollupEditor extends LightningElement { fieldNames.forEach(fieldName => { const inputElement = this.template.querySelector(`[data-name="rollup_${fieldName}"]`); - const attribute = checkboxFields.includes(fieldName) ? 'checked' : 'value'; - this.rollup[fieldName] = inputElement[attribute]; + if(inputElement){ + const attribute = checkboxFields.includes(fieldName) ? 'checked' : 'value'; + this.rollup[fieldName] = inputElement[attribute]; + } }) } childObjectSelected(event) { @@ -190,4 +192,16 @@ export default class RollupEditor extends LightningElement { } } + onToggleButtonGroupList(){ + const elementName = 'expandable-button-list'; + const element = this.template.querySelector(`[data-name="${elementName}"]`); + const expandClass = 'slds-is-open'; + if(element.className.includes(expandClass)){ + element.className = element.className.replace(expandClass, ''); + } else { + element.className += ' ' + expandClass; + } + } + + } From 2cfa0c575cd0dd6124c5795597afa7cc16392912 Mon Sep 17 00:00:00 2001 From: Khang Ly Date: Mon, 17 Apr 2023 00:58:36 +0700 Subject: [PATCH 016/130] feature: autocomplete combobox --- dlrs/main/classes/RollupEditorController.cls | 48 +++++ .../__tests__/autocompleteCombobox.test.js | 25 +++ .../autocompleteCombobox.css | 11 ++ .../autocompleteCombobox.html | 92 ++++++++++ .../autocompleteCombobox.js | 165 ++++++++++++++++++ .../autocompleteCombobox.js-meta.xml | 5 + dlrs/main/lwc/rollupEditor/rollupEditor.html | 26 ++- dlrs/main/lwc/rollupEditor/rollupEditor.js | 23 ++- 8 files changed, 379 insertions(+), 16 deletions(-) create mode 100644 dlrs/main/lwc/autocompleteCombobox/__tests__/autocompleteCombobox.test.js create mode 100644 dlrs/main/lwc/autocompleteCombobox/autocompleteCombobox.css create mode 100644 dlrs/main/lwc/autocompleteCombobox/autocompleteCombobox.html create mode 100644 dlrs/main/lwc/autocompleteCombobox/autocompleteCombobox.js create mode 100644 dlrs/main/lwc/autocompleteCombobox/autocompleteCombobox.js-meta.xml diff --git a/dlrs/main/classes/RollupEditorController.cls b/dlrs/main/classes/RollupEditorController.cls index c97d569c..388a0956 100644 --- a/dlrs/main/classes/RollupEditorController.cls +++ b/dlrs/main/classes/RollupEditorController.cls @@ -14,6 +14,54 @@ public with sharing class RollupEditorController { .Record; } + + public class SelectOption { + + @AuraEnabled + public String value; + + @AuraEnabled + public String label; + + @AuraEnabled + public String icon; + + @AuraEnabled + public String type; + + public SelectOption(String value, String label){ + this.value = value; + this.label = label; + } + + } + + @AuraEnabled + public static List getFieldRelationships(String objectName){ + Map mapOfFields = Schema.getGlobalDescribe() + .get(objectName) + .getDescribe() + .fields.getMap(); + + SelectOption emptyOption = new SelectOption('', '-- Select --'); + + List options = new List(); + options.add(emptyOption); + + for (Schema.SObjectField field : mapOfFields.values()) { + Schema.DescribeFieldResult fr = field.getDescribe(); + String fieldName = fr.getName(); + String label = fr.getLabel(); + + SelectOption option = new SelectOption(fieldName, label); + option.type = String.valueof(fr.getType()); + options.add(option); + } + + return options; + } + + /** * returns a map of fieldname => list to use in displaying error in the UI * general errors are applied to the 'record' field name diff --git a/dlrs/main/lwc/autocompleteCombobox/__tests__/autocompleteCombobox.test.js b/dlrs/main/lwc/autocompleteCombobox/__tests__/autocompleteCombobox.test.js new file mode 100644 index 00000000..6c730335 --- /dev/null +++ b/dlrs/main/lwc/autocompleteCombobox/__tests__/autocompleteCombobox.test.js @@ -0,0 +1,25 @@ +import { createElement } from 'lwc'; +import AutocompleteCombobox from 'c/autocompleteCombobox'; + +describe('c-autocomplete-combobox', () => { + 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-autocomplete-combobox', { + is: AutocompleteCombobox + }); + + // 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/dlrs/main/lwc/autocompleteCombobox/autocompleteCombobox.css b/dlrs/main/lwc/autocompleteCombobox/autocompleteCombobox.css new file mode 100644 index 00000000..40f9dea8 --- /dev/null +++ b/dlrs/main/lwc/autocompleteCombobox/autocompleteCombobox.css @@ -0,0 +1,11 @@ +.my-popover{ + pointer-events: none; + opacity: 0; + transition: all 100ms linear; +} + +.my-helper-text-icon:hover .my-popover { + opacity: 1; +} + + diff --git a/dlrs/main/lwc/autocompleteCombobox/autocompleteCombobox.html b/dlrs/main/lwc/autocompleteCombobox/autocompleteCombobox.html new file mode 100644 index 00000000..0d0f939c --- /dev/null +++ b/dlrs/main/lwc/autocompleteCombobox/autocompleteCombobox.html @@ -0,0 +1,92 @@ + \ No newline at end of file diff --git a/dlrs/main/lwc/autocompleteCombobox/autocompleteCombobox.js b/dlrs/main/lwc/autocompleteCombobox/autocompleteCombobox.js new file mode 100644 index 00000000..7910a4a0 --- /dev/null +++ b/dlrs/main/lwc/autocompleteCombobox/autocompleteCombobox.js @@ -0,0 +1,165 @@ +import { LightningElement, api, track } from "lwc"; + +const DELAY = 300; // timing in miliseconds + +export default class AutocompleteCombobox extends LightningElement { + +// *** PROPERTIES *** + + @api label; + @api placeholder; + @api helperText; + + @track selectedOption = {}; + @api + get value(){ return this.selectedOption.value; } + set value(selectedValue){ + if(!selectedValue) return; + console.log('selectedValue: ' + selectedValue); + this.searchKey = selectedValue; + this.selectOptionBySearchKey(); + this.showSelectionInput(); + } + + @track filteredOptions = []; + _firstTimeSetOptions = true; // handle when "Set Value" is executed before "Set Options" + _options = []; + @api + get options(){ return this._options; } + set options(val){ + if(!val || val.length === 0) return; + this._options = val; + this.filterOptionsBySearchKey(); + if(this._firstTimeSetOptions){ + this.selectOptionBySearchKey(); + this.showSelectionInput(); + this._firstTimeSetOptions = false + } + } + + @track isLoading = false; + @track searchKey = ""; + + get styleClassCombobox(){ + let styleClass = "slds-combobox__form-element slds-input-has-icon slds-input-has-icon_left-right"; + if(this.selectedOption && !this.selectedOption.icon){ + styleClass = styleClass.replace('slds-input-has-icon_left-right' , 'slds-input-has-icon_right'); + } + return styleClass; + } + +// *** EVENT METHODS *** + + onToggleDropdown(event){ + const targetDataSource = event.target.getAttribute("data-source"); + const lookupInputContainer = this.template.querySelector( + ".lookupInputContainer" + ); + const clsList = lookupInputContainer.classList; + const whichEvent = targetDataSource; + switch (whichEvent) { + case "searchInputField": + clsList.add("slds-is-open"); + break; + case "lookupContainer": + clsList.remove("slds-is-open"); + break; + default: break; + } + } + + onChangeSearchKey(event) { + // Debouncing this method: Do not update the reactive property as long as this function is + // being called within a delay of DELAY. This is to avoid a very large number of Apex method calls. + this.isLoading = true; + window.clearTimeout(this.delayTimeout); + this.searchKey = event.target.value; + this.delayTimeout = setTimeout(() => { // eslint-disable-line + this.filterOptionsBySearchKey(); + this.isLoading = false; + }, DELAY); + } + + onSelectOption(event) { + this.searchKey = event.target.getAttribute("data-name"); + this.selectOptionBySearchKey(); + this.showSelectionInput(); + this.dispatchSelectionEvent() + } + + // method to clear selected lookup record + onRemoveSelection() { + this.searchKey = ""; + this.selectedOption = {}; + this.filterOptionsBySearchKey(); + this.showSearchInput(); + this.dispatchSelectionEvent(); + } + + +// *** CONTROLLER + + filterOptionsBySearchKey() { + try { + const lowerCaseSearchKey = this.searchKey.toLowerCase(); + this.filteredOptions = this._options.filter(({value, label}) => { + return value.toLowerCase().includes(lowerCaseSearchKey) + || label.toLowerCase().includes(lowerCaseSearchKey); + }) + } catch(error){ + this.filteredOptions = this._options; + } + } + + selectOptionBySearchKey(){ + try{ + const lowerCaseValue = this.searchKey.toLowerCase(); + this.selectedOption = this._options.find(option => { + return option.value.toLowerCase().includes(lowerCaseValue) + }) + if(!this.selectedOption) this.selectedOption = {}; + }catch(error){ + this.selectedOption = {}; + } + } + + dispatchSelectionEvent(){ + const _event = new CustomEvent("changeselection", { + detail: { selectedOption: this.selectedOption } + }); + this.dispatchEvent(_event); + } + +// *** UI HELPER *** + + showSelectionInput() { + if(!this.selectedOption) return; + try { + const inputElement = this.template.querySelector(".lookupInputContainer"); + inputElement.classList.remove('slds-is-open'); + + const searchBoxWrapper = this.template.querySelector(".searchBoxWrapper"); + searchBoxWrapper.classList.remove("slds-show"); + searchBoxWrapper.classList.add("slds-hide"); + + const pillDiv = this.template.querySelector(".pillDiv"); + pillDiv.classList.remove("slds-hide"); + pillDiv.classList.add("slds-show"); + } catch(err){ + console.log(err); + } + } + + showSearchInput(){ + // remove selected pill and display input field again + const searchBoxWrapper = this.template.querySelector(".searchBoxWrapper"); + searchBoxWrapper.classList.remove("slds-hide"); + searchBoxWrapper.classList.add("slds-show"); + + const pillDiv = this.template.querySelector(".pillDiv"); + pillDiv.classList.remove("slds-show"); + pillDiv.classList.add("slds-hide"); + } + + +} \ No newline at end of file diff --git a/dlrs/main/lwc/autocompleteCombobox/autocompleteCombobox.js-meta.xml b/dlrs/main/lwc/autocompleteCombobox/autocompleteCombobox.js-meta.xml new file mode 100644 index 00000000..f8c5cb4a --- /dev/null +++ b/dlrs/main/lwc/autocompleteCombobox/autocompleteCombobox.js-meta.xml @@ -0,0 +1,5 @@ + + + 56.0 + false + \ No newline at end of file diff --git a/dlrs/main/lwc/rollupEditor/rollupEditor.html b/dlrs/main/lwc/rollupEditor/rollupEditor.html index ad77649e..ff4d93cd 100644 --- a/dlrs/main/lwc/rollupEditor/rollupEditor.html +++ b/dlrs/main/lwc/rollupEditor/rollupEditor.html @@ -236,14 +236,14 @@

- + options={childRFieldOptions} + placeholder="Lookup__c" + helper-text="All fields are listed. But, relationship fields are recommended." + > @@ -300,16 +300,15 @@

+
- + options={childRFieldOptions} + > @@ -347,13 +346,12 @@

- + > diff --git a/dlrs/main/lwc/rollupEditor/rollupEditor.js b/dlrs/main/lwc/rollupEditor/rollupEditor.js index c9b1cb01..3c6dce9d 100644 --- a/dlrs/main/lwc/rollupEditor/rollupEditor.js +++ b/dlrs/main/lwc/rollupEditor/rollupEditor.js @@ -3,6 +3,7 @@ import { ShowToastEvent } from "lightning/platformShowToastEvent"; import getRollupConfig from "@salesforce/apex/RollupEditorController.getRollupConfig"; import validateRollupConfig from "@salesforce/apex/RollupEditorController.validateRollupConfig"; import saveRollupConfig from "@salesforce/apex/RollupEditorController.saveRollupConfig"; +import getFieldRelationships from "@salesforce/apex/RollupEditorController.getFieldRelationships"; export default class RollupEditor extends LightningElement { DEFAULT_ROLLUP_VALUES = { Active__c: false }; @@ -10,6 +11,11 @@ export default class RollupEditor extends LightningElement { rollup = this.DEFAULT_ROLLUP_VALUES; errors = {}; + @track + parentRFieldOptions = []; + @track + childRFieldOptions = []; + _rollupName; @api async loadRollup(rollupName) { @@ -25,8 +31,9 @@ export default class RollupEditor extends LightningElement { this.getRollup(); } - connectedCallback() { - this.getRollup(); + async connectedCallback() { + await this.getRollup(); + await this.getRelationshipFieldOptions(); } get rollupCanBeActivated() { @@ -51,6 +58,16 @@ export default class RollupEditor extends LightningElement { } } + async getRelationshipFieldOptions(){ + if(this.rollup.ParentObject__c){ + this.parentRFieldOptions = await getFieldRelationships({ 'objectName': this.rollup.ParentObject__c }); + } + if(this.rollup.ChildObject__c){ + this.childRFieldOptions = await getFieldRelationships({ 'objectName': this.rollup.ChildObject__c }); + } + } + + async runValidate() { this.errors = await validateRollupConfig({ rollup: JSON.stringify(this.rollup) @@ -132,6 +149,7 @@ export default class RollupEditor extends LightningElement { if(inputElement){ const attribute = checkboxFields.includes(fieldName) ? 'checked' : 'value'; this.rollup[fieldName] = inputElement[attribute]; + console.log(`fieldName (${fieldName}) : ${inputElement[attribute]}`); } }) } @@ -142,6 +160,7 @@ export default class RollupEditor extends LightningElement { this.rollup.ParentObject__c = event.detail.selectedRecord; } + get rollupAsString() { return JSON.stringify(this.rollup, null, 2); } From 6ca1d5073d9306e5f8ce8ddd4fe58ab86c42cca3 Mon Sep 17 00:00:00 2001 From: Khang Ly Date: Mon, 17 Apr 2023 11:12:50 +0700 Subject: [PATCH 017/130] chore: rename method in RollupEditorController --- dlrs/main/classes/RollupEditorController.cls | 2 +- dlrs/main/lwc/rollupEditor/rollupEditor.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dlrs/main/classes/RollupEditorController.cls b/dlrs/main/classes/RollupEditorController.cls index 388a0956..a7ef81eb 100644 --- a/dlrs/main/classes/RollupEditorController.cls +++ b/dlrs/main/classes/RollupEditorController.cls @@ -37,7 +37,7 @@ public with sharing class RollupEditorController { } @AuraEnabled - public static List getFieldRelationships(String objectName){ + public static List getFieldOptions(String objectName){ Map mapOfFields = Schema.getGlobalDescribe() .get(objectName) .getDescribe() diff --git a/dlrs/main/lwc/rollupEditor/rollupEditor.js b/dlrs/main/lwc/rollupEditor/rollupEditor.js index 3c6dce9d..e85d76b6 100644 --- a/dlrs/main/lwc/rollupEditor/rollupEditor.js +++ b/dlrs/main/lwc/rollupEditor/rollupEditor.js @@ -3,7 +3,7 @@ import { ShowToastEvent } from "lightning/platformShowToastEvent"; import getRollupConfig from "@salesforce/apex/RollupEditorController.getRollupConfig"; import validateRollupConfig from "@salesforce/apex/RollupEditorController.validateRollupConfig"; import saveRollupConfig from "@salesforce/apex/RollupEditorController.saveRollupConfig"; -import getFieldRelationships from "@salesforce/apex/RollupEditorController.getFieldRelationships"; +import getFieldOptions from "@salesforce/apex/RollupEditorController.getFieldOptions"; export default class RollupEditor extends LightningElement { DEFAULT_ROLLUP_VALUES = { Active__c: false }; @@ -60,10 +60,10 @@ export default class RollupEditor extends LightningElement { async getRelationshipFieldOptions(){ if(this.rollup.ParentObject__c){ - this.parentRFieldOptions = await getFieldRelationships({ 'objectName': this.rollup.ParentObject__c }); + this.parentRFieldOptions = await getFieldOptions({ 'objectName': this.rollup.ParentObject__c }); } if(this.rollup.ChildObject__c){ - this.childRFieldOptions = await getFieldRelationships({ 'objectName': this.rollup.ChildObject__c }); + this.childRFieldOptions = await getFieldOptions({ 'objectName': this.rollup.ChildObject__c }); } } From 89ac28837d932e26ebaf44c1f08937aa26db6225 Mon Sep 17 00:00:00 2001 From: Khang Ly Date: Mon, 17 Apr 2023 23:27:02 +0700 Subject: [PATCH 018/130] fix: "value" property setter --- .../autocompleteCombobox.js | 79 +++++++++++-------- 1 file changed, 45 insertions(+), 34 deletions(-) diff --git a/dlrs/main/lwc/autocompleteCombobox/autocompleteCombobox.js b/dlrs/main/lwc/autocompleteCombobox/autocompleteCombobox.js index 7910a4a0..4f52b9a7 100644 --- a/dlrs/main/lwc/autocompleteCombobox/autocompleteCombobox.js +++ b/dlrs/main/lwc/autocompleteCombobox/autocompleteCombobox.js @@ -1,6 +1,6 @@ import { LightningElement, api, track } from "lwc"; -const DELAY = 300; // timing in miliseconds +const DELAY = 100; // timing in miliseconds export default class AutocompleteCombobox extends LightningElement { @@ -11,31 +11,36 @@ export default class AutocompleteCombobox extends LightningElement { @api helperText; @track selectedOption = {}; + @track _value = '' @api - get value(){ return this.selectedOption.value; } - set value(selectedValue){ - if(!selectedValue) return; - console.log('selectedValue: ' + selectedValue); - this.searchKey = selectedValue; - this.selectOptionBySearchKey(); - this.showSelectionInput(); + get value(){ return this._value; } + set value(val){ + this._value = val; + this.selectOptionByValue(); + if(this._value){ + this.showSelectionInput(); + } else { + this.showSearchInput(); + } } + _firstTimeSetOptions = true; @track filteredOptions = []; - _firstTimeSetOptions = true; // handle when "Set Value" is executed before "Set Options" _options = []; @api get options(){ return this._options; } set options(val){ - if(!val || val.length === 0) return; - this._options = val; - this.filterOptionsBySearchKey(); - if(this._firstTimeSetOptions){ - this.selectOptionBySearchKey(); + this._options = val ? val : []; + this.filteredOptions = this._options; + this.searchKey = ''; + this.selectedOption = {}; + if(this._value){ + this.selectOptionByValue(); this.showSelectionInput(); - this._firstTimeSetOptions = false + }else { + this.showSearchInput(); } - } + } @track isLoading = false; @track searchKey = ""; @@ -75,23 +80,24 @@ export default class AutocompleteCombobox extends LightningElement { window.clearTimeout(this.delayTimeout); this.searchKey = event.target.value; this.delayTimeout = setTimeout(() => { // eslint-disable-line - this.filterOptionsBySearchKey(); + this.filterOptions(this.searchKey); this.isLoading = false; }, DELAY); } onSelectOption(event) { - this.searchKey = event.target.getAttribute("data-name"); - this.selectOptionBySearchKey(); + this._value = event.target.getAttribute("data-name"); + this.selectOptionByValue(); this.showSelectionInput(); this.dispatchSelectionEvent() } // method to clear selected lookup record onRemoveSelection() { + this._value = ""; this.searchKey = ""; this.selectedOption = {}; - this.filterOptionsBySearchKey(); + this.filteredOptions = this._options; this.showSearchInput(); this.dispatchSelectionEvent(); } @@ -99,9 +105,9 @@ export default class AutocompleteCombobox extends LightningElement { // *** CONTROLLER - filterOptionsBySearchKey() { + filterOptions(searchKey) { try { - const lowerCaseSearchKey = this.searchKey.toLowerCase(); + const lowerCaseSearchKey = searchKey.toLowerCase(); this.filteredOptions = this._options.filter(({value, label}) => { return value.toLowerCase().includes(lowerCaseSearchKey) || label.toLowerCase().includes(lowerCaseSearchKey); @@ -111,15 +117,16 @@ export default class AutocompleteCombobox extends LightningElement { } } - selectOptionBySearchKey(){ + selectOptionByValue(){ try{ - const lowerCaseValue = this.searchKey.toLowerCase(); + const lowerCaseValue = this._value.toLowerCase(); this.selectedOption = this._options.find(option => { return option.value.toLowerCase().includes(lowerCaseValue) }) - if(!this.selectedOption) this.selectedOption = {}; + this.searchKey = this.selectedOption.label; }catch(error){ this.selectedOption = {}; + this.searchKey = ''; } } @@ -133,8 +140,8 @@ export default class AutocompleteCombobox extends LightningElement { // *** UI HELPER *** showSelectionInput() { - if(!this.selectedOption) return; try { + if(!this.selectedOption.value) return; const inputElement = this.template.querySelector(".lookupInputContainer"); inputElement.classList.remove('slds-is-open'); @@ -151,14 +158,18 @@ export default class AutocompleteCombobox extends LightningElement { } showSearchInput(){ - // remove selected pill and display input field again - const searchBoxWrapper = this.template.querySelector(".searchBoxWrapper"); - searchBoxWrapper.classList.remove("slds-hide"); - searchBoxWrapper.classList.add("slds-show"); - - const pillDiv = this.template.querySelector(".pillDiv"); - pillDiv.classList.remove("slds-show"); - pillDiv.classList.add("slds-hide"); + try { + // remove selected pill and display input field again + const searchBoxWrapper = this.template.querySelector(".searchBoxWrapper"); + searchBoxWrapper.classList.remove("slds-hide"); + searchBoxWrapper.classList.add("slds-show"); + + const pillDiv = this.template.querySelector(".pillDiv"); + pillDiv.classList.remove("slds-show"); + pillDiv.classList.add("slds-hide"); + } catch (error) { + console.log(error); + } } From c7d78203c4557a615793d4bfc0d21e371ae241db Mon Sep 17 00:00:00 2001 From: Khang Ly Date: Wed, 19 Apr 2023 23:54:28 +0700 Subject: [PATCH 019/130] chore: Prettier reformatting --- .../__tests__/autocompleteCombobox.test.js | 42 +-- .../autocompleteCombobox.js | 334 +++++++++--------- .../__tests__/rollupEditor.test.js | 42 +-- dlrs/main/lwc/rollupEditor/rollupEditor.js | 110 +++--- .../__tests__/rollupEditorError.test.js | 42 +-- .../rollupStatusCheck/rollupStatusCheck.js | 78 ++-- 6 files changed, 340 insertions(+), 308 deletions(-) diff --git a/dlrs/main/lwc/autocompleteCombobox/__tests__/autocompleteCombobox.test.js b/dlrs/main/lwc/autocompleteCombobox/__tests__/autocompleteCombobox.test.js index 6c730335..3768e99a 100644 --- a/dlrs/main/lwc/autocompleteCombobox/__tests__/autocompleteCombobox.test.js +++ b/dlrs/main/lwc/autocompleteCombobox/__tests__/autocompleteCombobox.test.js @@ -1,25 +1,25 @@ -import { createElement } from 'lwc'; -import AutocompleteCombobox from 'c/autocompleteCombobox'; +import { createElement } from "lwc"; +import AutocompleteCombobox from "c/autocompleteCombobox"; -describe('c-autocomplete-combobox', () => { - 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); - } - }); +describe("c-autocomplete-combobox", () => { + 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-autocomplete-combobox', { - is: AutocompleteCombobox - }); + it("TODO: test case generated by CLI command, please fill in test logic", () => { + // Arrange + const element = createElement("c-autocomplete-combobox", { + is: AutocompleteCombobox + }); - // Act - document.body.appendChild(element); + // Act + document.body.appendChild(element); - // Assert - // const div = element.shadowRoot.querySelector('div'); - expect(1).toBe(1); - }); -}); \ No newline at end of file + // Assert + // const div = element.shadowRoot.querySelector('div'); + expect(1).toBe(1); + }); +}); diff --git a/dlrs/main/lwc/autocompleteCombobox/autocompleteCombobox.js b/dlrs/main/lwc/autocompleteCombobox/autocompleteCombobox.js index 4f52b9a7..2d3b84c6 100644 --- a/dlrs/main/lwc/autocompleteCombobox/autocompleteCombobox.js +++ b/dlrs/main/lwc/autocompleteCombobox/autocompleteCombobox.js @@ -3,174 +3,182 @@ import { LightningElement, api, track } from "lwc"; const DELAY = 100; // timing in miliseconds export default class AutocompleteCombobox extends LightningElement { - -// *** PROPERTIES *** - - @api label; - @api placeholder; - @api helperText; - - @track selectedOption = {}; - @track _value = '' - @api - get value(){ return this._value; } - set value(val){ - this._value = val; - this.selectOptionByValue(); - if(this._value){ - this.showSelectionInput(); - } else { - this.showSearchInput(); - } - } - - _firstTimeSetOptions = true; - @track filteredOptions = []; - _options = []; - @api - get options(){ return this._options; } - set options(val){ - this._options = val ? val : []; - this.filteredOptions = this._options; - this.searchKey = ''; - this.selectedOption = {}; - if(this._value){ - this.selectOptionByValue(); - this.showSelectionInput(); - }else { - this.showSearchInput(); - } - } - - @track isLoading = false; - @track searchKey = ""; - - get styleClassCombobox(){ - let styleClass = "slds-combobox__form-element slds-input-has-icon slds-input-has-icon_left-right"; - if(this.selectedOption && !this.selectedOption.icon){ - styleClass = styleClass.replace('slds-input-has-icon_left-right' , 'slds-input-has-icon_right'); - } - return styleClass; - } - -// *** EVENT METHODS *** - - onToggleDropdown(event){ - const targetDataSource = event.target.getAttribute("data-source"); - const lookupInputContainer = this.template.querySelector( - ".lookupInputContainer" - ); - const clsList = lookupInputContainer.classList; - const whichEvent = targetDataSource; - switch (whichEvent) { - case "searchInputField": - clsList.add("slds-is-open"); - break; - case "lookupContainer": - clsList.remove("slds-is-open"); - break; - default: break; - } - } - - onChangeSearchKey(event) { - // Debouncing this method: Do not update the reactive property as long as this function is - // being called within a delay of DELAY. This is to avoid a very large number of Apex method calls. - this.isLoading = true; - window.clearTimeout(this.delayTimeout); - this.searchKey = event.target.value; - this.delayTimeout = setTimeout(() => { // eslint-disable-line - this.filterOptions(this.searchKey); - this.isLoading = false; - }, DELAY); + // *** PROPERTIES *** + + @api label; + @api placeholder; + @api helperText; + + @track selectedOption = {}; + @track _value = ""; + @api + get value() { + return this._value; + } + set value(val) { + this._value = val; + this.selectOptionByValue(); + if (this._value) { + this.showSelectionInput(); + } else { + this.showSearchInput(); } - - onSelectOption(event) { - this._value = event.target.getAttribute("data-name"); - this.selectOptionByValue(); - this.showSelectionInput(); - this.dispatchSelectionEvent() + } + + _firstTimeSetOptions = true; + @track filteredOptions = []; + _options = []; + @api + get options() { + return this._options; + } + set options(val) { + this._options = val ? val : []; + this.filteredOptions = this._options; + this.searchKey = ""; + this.selectedOption = {}; + if (this._value) { + this.selectOptionByValue(); + this.showSelectionInput(); + } else { + this.showSearchInput(); } - - // method to clear selected lookup record - onRemoveSelection() { - this._value = ""; - this.searchKey = ""; - this.selectedOption = {}; - this.filteredOptions = this._options; - this.showSearchInput(); - this.dispatchSelectionEvent(); + } + + @track isLoading = false; + @track searchKey = ""; + + get styleClassCombobox() { + let styleClass = + "slds-combobox__form-element slds-input-has-icon slds-input-has-icon_left-right"; + if (this.selectedOption && !this.selectedOption.icon) { + styleClass = styleClass.replace( + "slds-input-has-icon_left-right", + "slds-input-has-icon_right" + ); } - - -// *** CONTROLLER - - filterOptions(searchKey) { - try { - const lowerCaseSearchKey = searchKey.toLowerCase(); - this.filteredOptions = this._options.filter(({value, label}) => { - return value.toLowerCase().includes(lowerCaseSearchKey) - || label.toLowerCase().includes(lowerCaseSearchKey); - }) - } catch(error){ - this.filteredOptions = this._options; - } + return styleClass; + } + + // *** EVENT METHODS *** + + onToggleDropdown(event) { + const targetDataSource = event.target.getAttribute("data-source"); + const lookupInputContainer = this.template.querySelector( + ".lookupInputContainer" + ); + const clsList = lookupInputContainer.classList; + const whichEvent = targetDataSource; + switch (whichEvent) { + case "searchInputField": + clsList.add("slds-is-open"); + break; + case "lookupContainer": + clsList.remove("slds-is-open"); + break; + default: + break; } - - selectOptionByValue(){ - try{ - const lowerCaseValue = this._value.toLowerCase(); - this.selectedOption = this._options.find(option => { - return option.value.toLowerCase().includes(lowerCaseValue) - }) - this.searchKey = this.selectedOption.label; - }catch(error){ - this.selectedOption = {}; - this.searchKey = ''; - } + } + + onChangeSearchKey(event) { + // Debouncing this method: Do not update the reactive property as long as this function is + // being called within a delay of DELAY. This is to avoid a very large number of Apex method calls. + this.isLoading = true; + window.clearTimeout(this.delayTimeout); + this.searchKey = event.target.value; + this.delayTimeout = setTimeout(() => { + // eslint-disable-line + this.filterOptions(this.searchKey); + this.isLoading = false; + }, DELAY); + } + + onSelectOption(event) { + this._value = event.target.getAttribute("data-name"); + this.selectOptionByValue(); + this.showSelectionInput(); + this.dispatchSelectionEvent(); + } + + // method to clear selected lookup record + onRemoveSelection() { + this._value = ""; + this.searchKey = ""; + this.selectedOption = {}; + this.filteredOptions = this._options; + this.showSearchInput(); + this.dispatchSelectionEvent(); + } + + // *** CONTROLLER + + filterOptions(searchKey) { + try { + const lowerCaseSearchKey = searchKey.toLowerCase(); + this.filteredOptions = this._options.filter(({ value, label }) => { + return ( + value.toLowerCase().includes(lowerCaseSearchKey) || + label.toLowerCase().includes(lowerCaseSearchKey) + ); + }); + } catch (error) { + this.filteredOptions = this._options; } - - dispatchSelectionEvent(){ - const _event = new CustomEvent("changeselection", { - detail: { selectedOption: this.selectedOption } - }); - this.dispatchEvent(_event); + } + + selectOptionByValue() { + try { + const lowerCaseValue = this._value.toLowerCase(); + this.selectedOption = this._options.find((option) => { + return option.value.toLowerCase().includes(lowerCaseValue); + }); + this.searchKey = this.selectedOption.label; + } catch (error) { + this.selectedOption = {}; + this.searchKey = ""; } - -// *** UI HELPER *** - - showSelectionInput() { - try { - if(!this.selectedOption.value) return; - const inputElement = this.template.querySelector(".lookupInputContainer"); - inputElement.classList.remove('slds-is-open'); - - const searchBoxWrapper = this.template.querySelector(".searchBoxWrapper"); - searchBoxWrapper.classList.remove("slds-show"); - searchBoxWrapper.classList.add("slds-hide"); - - const pillDiv = this.template.querySelector(".pillDiv"); - pillDiv.classList.remove("slds-hide"); - pillDiv.classList.add("slds-show"); - } catch(err){ - console.log(err); - } + } + + dispatchSelectionEvent() { + const _event = new CustomEvent("changeselection", { + detail: { selectedOption: this.selectedOption } + }); + this.dispatchEvent(_event); + } + + // *** UI HELPER *** + + showSelectionInput() { + try { + if (!this.selectedOption.value) return; + const inputElement = this.template.querySelector(".lookupInputContainer"); + inputElement.classList.remove("slds-is-open"); + + const searchBoxWrapper = this.template.querySelector(".searchBoxWrapper"); + searchBoxWrapper.classList.remove("slds-show"); + searchBoxWrapper.classList.add("slds-hide"); + + const pillDiv = this.template.querySelector(".pillDiv"); + pillDiv.classList.remove("slds-hide"); + pillDiv.classList.add("slds-show"); + } catch (err) { + console.log(err); } - - showSearchInput(){ - try { - // remove selected pill and display input field again - const searchBoxWrapper = this.template.querySelector(".searchBoxWrapper"); - searchBoxWrapper.classList.remove("slds-hide"); - searchBoxWrapper.classList.add("slds-show"); - - const pillDiv = this.template.querySelector(".pillDiv"); - pillDiv.classList.remove("slds-show"); - pillDiv.classList.add("slds-hide"); - } catch (error) { - console.log(error); - } + } + + showSearchInput() { + try { + // remove selected pill and display input field again + const searchBoxWrapper = this.template.querySelector(".searchBoxWrapper"); + searchBoxWrapper.classList.remove("slds-hide"); + searchBoxWrapper.classList.add("slds-show"); + + const pillDiv = this.template.querySelector(".pillDiv"); + pillDiv.classList.remove("slds-show"); + pillDiv.classList.add("slds-hide"); + } catch (error) { + console.log(error); } - - -} \ No newline at end of file + } +} diff --git a/dlrs/main/lwc/rollupEditor/__tests__/rollupEditor.test.js b/dlrs/main/lwc/rollupEditor/__tests__/rollupEditor.test.js index ceeebffe..45cf7e8a 100644 --- a/dlrs/main/lwc/rollupEditor/__tests__/rollupEditor.test.js +++ b/dlrs/main/lwc/rollupEditor/__tests__/rollupEditor.test.js @@ -1,25 +1,25 @@ -import { createElement } from 'lwc'; -import RollupEditor from 'c/rollupEditor'; +import { createElement } from "lwc"; +import RollupEditor from "c/rollupEditor"; -describe('c-rollup-editor', () => { - 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); - } - }); +describe("c-rollup-editor", () => { + 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-rollup-editor', { - is: RollupEditor - }); + it("TODO: test case generated by CLI command, please fill in test logic", () => { + // Arrange + const element = createElement("c-rollup-editor", { + is: RollupEditor + }); - // Act - document.body.appendChild(element); + // Act + document.body.appendChild(element); - // Assert - // const div = element.shadowRoot.querySelector('div'); - expect(1).toBe(1); - }); -}); \ No newline at end of file + // Assert + // const div = element.shadowRoot.querySelector('div'); + expect(1).toBe(1); + }); +}); diff --git a/dlrs/main/lwc/rollupEditor/rollupEditor.js b/dlrs/main/lwc/rollupEditor/rollupEditor.js index e85d76b6..3fa593cc 100644 --- a/dlrs/main/lwc/rollupEditor/rollupEditor.js +++ b/dlrs/main/lwc/rollupEditor/rollupEditor.js @@ -58,16 +58,19 @@ export default class RollupEditor extends LightningElement { } } - async getRelationshipFieldOptions(){ - if(this.rollup.ParentObject__c){ - this.parentRFieldOptions = await getFieldOptions({ 'objectName': this.rollup.ParentObject__c }); + async getRelationshipFieldOptions() { + if (this.rollup.ParentObject__c) { + this.parentRFieldOptions = await getFieldOptions({ + objectName: this.rollup.ParentObject__c + }); } - if(this.rollup.ChildObject__c){ - this.childRFieldOptions = await getFieldOptions({ 'objectName': this.rollup.ChildObject__c }); + if (this.rollup.ChildObject__c) { + this.childRFieldOptions = await getFieldOptions({ + objectName: this.rollup.ChildObject__c + }); } } - async runValidate() { this.errors = await validateRollupConfig({ rollup: JSON.stringify(this.rollup) @@ -121,37 +124,45 @@ export default class RollupEditor extends LightningElement { assembleRollupFromForm() { const fieldNames = [ - 'Label', - 'DeveloperName', - 'Description__c', - 'RelationshipField__c', - 'RelationshipCriteria__c', - 'RelationshipCriteriaFields__c', - 'FieldToAggregate__c', - 'FieldToOrderBy__c', - 'AggregateOperation__c', - 'AggregateResultField__c', - 'AggregateAllRows__c', - 'RowLimit__c', - 'Active__c', // No Input Element for this field - 'CalculationMode__c', - 'CalculationSharingMode__c', - 'ConcatenateDelimiter__c', - 'TestCode2__c', - 'TestCodeParent__c', - 'TestCodeSeeAllData__c' + "Label", + "DeveloperName", + "Description__c", + "RelationshipField__c", + "RelationshipCriteria__c", + "RelationshipCriteriaFields__c", + "FieldToAggregate__c", + "FieldToOrderBy__c", + "AggregateOperation__c", + "AggregateResultField__c", + "AggregateAllRows__c", + "RowLimit__c", + "Active__c", // No Input Element for this field + "CalculationMode__c", + "CalculationSharingMode__c", + "ConcatenateDelimiter__c", + "TestCode2__c", + "TestCodeParent__c", + "TestCodeSeeAllData__c" ]; - const checkboxFields = ['Active__c', 'AggregateAllRows__c', 'TestCodeSeeAllData__c']; + const checkboxFields = [ + "Active__c", + "AggregateAllRows__c", + "TestCodeSeeAllData__c" + ]; - fieldNames.forEach(fieldName => { - const inputElement = this.template.querySelector(`[data-name="rollup_${fieldName}"]`); - if(inputElement){ - const attribute = checkboxFields.includes(fieldName) ? 'checked' : 'value'; + fieldNames.forEach((fieldName) => { + const inputElement = this.template.querySelector( + `[data-name="rollup_${fieldName}"]` + ); + if (inputElement) { + const attribute = checkboxFields.includes(fieldName) + ? "checked" + : "value"; this.rollup[fieldName] = inputElement[attribute]; console.log(`fieldName (${fieldName}) : ${inputElement[attribute]}`); } - }) + }); } childObjectSelected(event) { this.rollup.ChildObject__c = event.detail.selectedRecord; @@ -160,7 +171,6 @@ export default class RollupEditor extends LightningElement { this.rollup.ParentObject__c = event.detail.selectedRecord; } - get rollupAsString() { return JSON.stringify(this.rollup, null, 2); } @@ -184,43 +194,43 @@ export default class RollupEditor extends LightningElement { ]; } - get calculationModes(){ + get calculationModes() { return [ { label: "Realtime", value: "Realtime" }, { label: "Scheduled", value: "Scheduled" }, { label: "Developer", value: "Developer" }, - { label: "Process Builder", value: "Process Builder" }, + { label: "Process Builder", value: "Process Builder" } ]; } - get calculationSharingModes(){ + get calculationSharingModes() { return [ { label: "User", value: "User" }, { label: "System", value: "System" } ]; } - onToggleSection(event){ - const sectionName = event.currentTarget.getAttribute('data-section-button'); - const element = this.template.querySelector(`[data-section-name="${sectionName}"]`); - const expandClass = 'slds-is-open'; - if(element.className.includes(expandClass)){ - element.className = element.className.replace(expandClass, ''); + onToggleSection(event) { + const sectionName = event.currentTarget.getAttribute("data-section-button"); + const element = this.template.querySelector( + `[data-section-name="${sectionName}"]` + ); + const expandClass = "slds-is-open"; + if (element.className.includes(expandClass)) { + element.className = element.className.replace(expandClass, ""); } else { - element.className += ' ' + expandClass; + element.className += " " + expandClass; } } - onToggleButtonGroupList(){ - const elementName = 'expandable-button-list'; + onToggleButtonGroupList() { + const elementName = "expandable-button-list"; const element = this.template.querySelector(`[data-name="${elementName}"]`); - const expandClass = 'slds-is-open'; - if(element.className.includes(expandClass)){ - element.className = element.className.replace(expandClass, ''); + const expandClass = "slds-is-open"; + if (element.className.includes(expandClass)) { + element.className = element.className.replace(expandClass, ""); } else { - element.className += ' ' + expandClass; + element.className += " " + expandClass; } } - - } diff --git a/dlrs/main/lwc/rollupEditorError/__tests__/rollupEditorError.test.js b/dlrs/main/lwc/rollupEditorError/__tests__/rollupEditorError.test.js index 77b7e120..34cceaa6 100644 --- a/dlrs/main/lwc/rollupEditorError/__tests__/rollupEditorError.test.js +++ b/dlrs/main/lwc/rollupEditorError/__tests__/rollupEditorError.test.js @@ -1,25 +1,25 @@ -import { createElement } from 'lwc'; -import RollupEditorError from 'c/rollupEditorError'; +import { createElement } from "lwc"; +import RollupEditorError from "c/rollupEditorError"; -describe('c-rollup-editor-error', () => { - 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); - } - }); +describe("c-rollup-editor-error", () => { + 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-rollup-editor-error', { - is: RollupEditorError - }); + it("TODO: test case generated by CLI command, please fill in test logic", () => { + // Arrange + const element = createElement("c-rollup-editor-error", { + is: RollupEditorError + }); - // Act - document.body.appendChild(element); + // Act + document.body.appendChild(element); - // Assert - // const div = element.shadowRoot.querySelector('div'); - expect(1).toBe(1); - }); -}); \ No newline at end of file + // Assert + // const div = element.shadowRoot.querySelector('div'); + expect(1).toBe(1); + }); +}); diff --git a/dlrs/main/lwc/rollupStatusCheck/rollupStatusCheck.js b/dlrs/main/lwc/rollupStatusCheck/rollupStatusCheck.js index 0d4d3760..7a5bef70 100644 --- a/dlrs/main/lwc/rollupStatusCheck/rollupStatusCheck.js +++ b/dlrs/main/lwc/rollupStatusCheck/rollupStatusCheck.js @@ -8,12 +8,11 @@ import getScheduledFullCalculates from "@salesforce/apex/LookupRollupStatusCheck import getCalculateJobs from "@salesforce/apex/LookupRollupStatusCheckController.getCalculateJobs"; import getScheduledJobs from "@salesforce/apex/LookupRollupStatusCheckController.getScheduledJobs"; -const mockLookupRollupSummary2 = ''; +const mockLookupRollupSummary2 = ""; export default class rollupStatusCheck extends LightningElement { - // Khang Ly contribute - header = 'Status Check'; + header = "Status Check"; lookupID; @@ -28,7 +27,7 @@ export default class rollupStatusCheck extends LightningElement { parentTrigger = "NA"; childTrigger = "NA"; calculateJobError = "No Errors Found"; - + // Error Handling error = []; @@ -37,61 +36,76 @@ export default class rollupStatusCheck extends LightningElement { console.log("my lookup id is :" + this._name); this.allScheduleItems(); this.scheduleJobs(); - } - + } // Get record lookup from parent component @track _name = mockLookupRollupSummary2; @api - get name() { - return this._name; + get name() { + return this._name; } - set name(value) { - this._name = value; + set name(value) { + this._name = value; } // Method to check if there are any failed calculate jobs for the specific rollup - @wire(getCalculateJobs, { lookupID : '$_name'}) - wiredGetCalculateJobs({error, data}){ this.handleApexResponse(data, error, 'calculateJobError'); } + @wire(getCalculateJobs, { lookupID: "$_name" }) + wiredGetCalculateJobs({ error, data }) { + this.handleApexResponse(data, error, "calculateJobError"); + } // Method to check if there are any scheduled full calculates for the specific rollup - @wire(getScheduledFullCalculates, { lookupID : '$_name'}) - wiredGetScheduledFullCalculates({error, data}){ this.handleApexResponse(data, error, 'nextFullCalculateDate'); } + @wire(getScheduledFullCalculates, { lookupID: "$_name" }) + wiredGetScheduledFullCalculates({ error, data }) { + this.handleApexResponse(data, error, "nextFullCalculateDate"); + } // Method to check if there are any scheduled items for the specific rollup - @wire(getSpecificScheduledItems, { lookupID : '$_name'}) - wiredGetSpecificScheduledItems({error, data}){ this.handleApexResponse(data, error, 'recordCount'); } + @wire(getSpecificScheduledItems, { lookupID: "$_name" }) + wiredGetSpecificScheduledItems({ error, data }) { + this.handleApexResponse(data, error, "recordCount"); + } // Method to check if child triggers are present - @wire(hasChildTriggerDeployed, { lookupID : '$_name'}) - wiredHasChildTriggerDeployed({error, data}){ this.handleApexResponse(data, error, 'childTrigger'); } + @wire(hasChildTriggerDeployed, { lookupID: "$_name" }) + wiredHasChildTriggerDeployed({ error, data }) { + this.handleApexResponse(data, error, "childTrigger"); + } // Method to check if child triggers are present - @wire(hasParentTriggerDeployed, { lookupID : '$_name' }) - wiredHasParentTriggerDeployed({ error, data }){ this.handleApexResponse(data, error, 'parentTrigger'); } + @wire(hasParentTriggerDeployed, { lookupID: "$_name" }) + wiredHasParentTriggerDeployed({ error, data }) { + this.handleApexResponse(data, error, "parentTrigger"); + } // General status method to grab all scheduled items regardless of rollup async allScheduleItems() { let data, error; - try{ data = await getAllScheduledItems(); } - catch(err){ error = err } - this.handleApexResponse(data, error, 'recordCountAll'); + try { + data = await getAllScheduledItems(); + } catch (err) { + error = err; + } + this.handleApexResponse(data, error, "recordCountAll"); } async scheduleJobs() { let data, error; - try{ data = await getScheduledJobs(); } - catch(err){ error = err } - this.handleApexResponse(data, error, 'scheduledCronJobs'); + try { + data = await getScheduledJobs(); + } catch (err) { + error = err; + } + this.handleApexResponse(data, error, "scheduledCronJobs"); } -// *** Utility *** - handleApexResponse(data, error, propertyName){ - if(data){ - console.log(propertyName + '- data: ' + data); + // *** Utility *** + handleApexResponse(data, error, propertyName) { + if (data) { + console.log(propertyName + "- data: " + data); this[propertyName] = data; - } else if(error){ - console.log(propertyName + '- error: ' + error); + } else if (error) { + console.log(propertyName + "- error: " + error); this.error.push(error); } } From 7c77386e919a14c214621f855dfc6bb1735e04dc Mon Sep 17 00:00:00 2001 From: Anthony Heber Date: Wed, 19 Apr 2023 17:44:31 -0600 Subject: [PATCH 020/130] Improve Object Picker behaviors and add features Improve tab behavior and restructure data so it is easier to work with. Enable correct icon per object (delayed loading) Enable correct loading and clearing of values from parent Improve search perf and sorting --- .../main/classes/ObjectSelectorController.cls | 77 +- .../main/lwc/objectSelector/js-levenshtein.js | 100 +++ .../lwc/objectSelector/objectSelector.css | 6 + .../lwc/objectSelector/objectSelector.html | 186 +++-- .../main/lwc/objectSelector/objectSelector.js | 192 ++++- .../objectSelector/objectSelector.js-meta.xml | 2 +- dlrs/main/lwc/rollupEditor/rollupEditor.html | 743 +++++++++++------- dlrs/main/lwc/rollupEditor/rollupEditor.js | 1 + 8 files changed, 865 insertions(+), 442 deletions(-) create mode 100644 dlrs/main/lwc/objectSelector/js-levenshtein.js create mode 100644 dlrs/main/lwc/objectSelector/objectSelector.css diff --git a/dlrs/main/classes/ObjectSelectorController.cls b/dlrs/main/classes/ObjectSelectorController.cls index 75d2685b..a786ade9 100644 --- a/dlrs/main/classes/ObjectSelectorController.cls +++ b/dlrs/main/classes/ObjectSelectorController.cls @@ -1,59 +1,26 @@ public with sharing class ObjectSelectorController { - public ObjectSelectorController() { - - + @AuraEnabled(cacheable=true) + public static List getParentObjList() { + Map objectDescription = Schema.getGlobalDescribe(); + List objects = new List(); + for (Schema.SObjectType obj : objectDescription.values()) { + objects.add(new SObjectInfo(obj)); } + return objects; + } - @AuraEnabled(cacheable=true) - public static List getParentObjList() { - System.debug('getParentObjList entry'); - Map objectDescription = Schema.getGlobalDescribe(); - List parentObjList = objectDescription.values(); - List lstObjects= new List(); - Set res=queryRollupableSObjectsNames(); - for (Schema.SObjectType obj : parentObjList) { - Schema.DescribeSObjectResult description = obj.getDescribe( - SObjectDescribeOptions.DEFERRED - ); - - //Filter out sObjects that can't be rolled up to avoid >1000 collection limit - - /* if(!res.contains(description.getName())) { - continue; - }*/ - - String prefix = description.getKeyPrefix(); - - if (!String.isEmpty(prefix)) { - lstObjects.add(obj.getDescribe().getLabel()+'('+obj.getDescribe().getName()+')'); - // mapLabelToValues.put(obj.getDescribe().getName(), obj.getDescribe().getLabel()); - - - } + class SObjectInfo { + @AuraEnabled + public String fullName; + @AuraEnabled + public String label; - } - System.debug('lstObjects'+lstObjects); - System.debug('lstObjects size'+lstObjects.size()); - return lstObjects; - } - - - public static Set queryRollupableSObjectsNames() { - Set rollupableSObjectsNames = new Set(); - List entityDefinitions = [ - SELECT QualifiedApiName FROM EntityDefinition - WHERE IsCustomSetting = false - AND IsCustomizable = true - AND isApexTriggerable = true - WITH SECURITY_ENFORCED - ]; - - for(EntityDefinition entDef : entityDefinitions) { - rollupableSObjectsNames.add(entDef.QualifiedApiName); - } - System.debug('rollupableSObjectsNames->'+rollupableSObjectsNames); - - return rollupableSObjectsNames; - } - -} \ No newline at end of file + public SObjectInfo(Schema.SObjectType obj) { + Schema.DescribeSObjectResult description = obj.getDescribe( + SObjectDescribeOptions.DEFERRED + ); + this.fullName = description.getName(); + this.label = description.getLabel(); + } + } +} diff --git a/dlrs/main/lwc/objectSelector/js-levenshtein.js b/dlrs/main/lwc/objectSelector/js-levenshtein.js new file mode 100644 index 00000000..30571559 --- /dev/null +++ b/dlrs/main/lwc/objectSelector/js-levenshtein.js @@ -0,0 +1,100 @@ +// https://github.com/gustf/js-levenshtein/blob/master/index.js +// MIT License +function _min(d0, d1, d2, bx, ay) { + return d0 < d1 || d2 < d1 + ? d0 > d2 + ? d2 + 1 + : d0 + 1 + : bx === ay + ? d1 + : d1 + 1; +} + +export default function (a, b) { + if (a === b) { + return 0; + } + + if (a.length > b.length) { + let tmp = a; + a = b; + b = tmp; + } + + let la = a.length; + let lb = b.length; + + while (la > 0 && a.charCodeAt(la - 1) === b.charCodeAt(lb - 1)) { + la--; + lb--; + } + + let offset = 0; + + while (offset < la && a.charCodeAt(offset) === b.charCodeAt(offset)) { + offset++; + } + + la -= offset; + lb -= offset; + + if (la === 0 || lb < 3) { + return lb; + } + + let x = 0; + let y; + let d0; + let d1; + let d2; + let d3; + let dd; + let dy; + let ay; + let bx0; + let bx1; + let bx2; + let bx3; + + let vector = []; + + for (y = 0; y < la; y++) { + vector.push(y + 1); + vector.push(a.charCodeAt(offset + y)); + } + + let len = vector.length - 1; + + for (; x < lb - 3; ) { + bx0 = b.charCodeAt(offset + (d0 = x)); + bx1 = b.charCodeAt(offset + (d1 = x + 1)); + bx2 = b.charCodeAt(offset + (d2 = x + 2)); + bx3 = b.charCodeAt(offset + (d3 = x + 3)); + dd = x += 4; + for (y = 0; y < len; y += 2) { + dy = vector[y]; + ay = vector[y + 1]; + d0 = _min(dy, d0, d1, bx0, ay); + d1 = _min(d0, d1, d2, bx1, ay); + d2 = _min(d1, d2, d3, bx2, ay); + dd = _min(d2, d3, dd, bx3, ay); + vector[y] = dd; + d3 = d2; + d2 = d1; + d1 = d0; + d0 = dy; + } + } + + for (; x < lb; ) { + bx0 = b.charCodeAt(offset + (d0 = x)); + dd = ++x; + for (y = 0; y < len; y += 2) { + dy = vector[y]; + vector[y] = dd = _min(dy, d0, dd, bx0, vector[y + 1]); + d0 = dy; + } + } + + return dd; +} diff --git a/dlrs/main/lwc/objectSelector/objectSelector.css b/dlrs/main/lwc/objectSelector/objectSelector.css new file mode 100644 index 00000000..f320d96e --- /dev/null +++ b/dlrs/main/lwc/objectSelector/objectSelector.css @@ -0,0 +1,6 @@ +img { + border-radius: var( + --slds-c-icon-radius-border, + var(--sds-c-icon-radius-border, var(--lwc-borderRadiusMedium, 0.25rem)) + ); +} diff --git a/dlrs/main/lwc/objectSelector/objectSelector.html b/dlrs/main/lwc/objectSelector/objectSelector.html index 6eb4d37e..955be3da 100644 --- a/dlrs/main/lwc/objectSelector/objectSelector.html +++ b/dlrs/main/lwc/objectSelector/objectSelector.html @@ -1,69 +1,131 @@ \ No newline at end of file +
+

+ diff --git a/dlrs/main/lwc/objectSelector/objectSelector.js b/dlrs/main/lwc/objectSelector/objectSelector.js index 18fd21f3..6a11da3f 100644 --- a/dlrs/main/lwc/objectSelector/objectSelector.js +++ b/dlrs/main/lwc/objectSelector/objectSelector.js @@ -1,55 +1,155 @@ -import { LightningElement, api } from "lwc"; - +import { LightningElement, api, wire } from "lwc"; import getAllObjects from "@salesforce/apex/ObjectSelectorController.getParentObjList"; +import jsLevenshtein from "./js-levenshtein"; +import { getObjectInfos } from "lightning/uiObjectInfoApi"; -const DELAY = 300; // delay apex callout timing in miliseconds +const DELAY = 100; // delay apex callout timing in miliseconds +const MAX_RESULTS = 5; export default class ObjectSelector extends LightningElement { // public properties with initial default values @api label = "Object"; - @api placeholder = "Search..."; - @api iconName = "standard:account"; - @api currentSelection; + @api placeholder = "Select on object"; + @api iconName = "standard:custom"; // would be awesome to use the correct icon + _currentSelection; + @api + get currentSelection() { + return this._currentSelection; + } + set currentSelection(val) { + this._currentSelection = val; + this.selectObject(val); + } // private properties + objectApiNames = []; + objectIconCache; lstResult = []; // to store list of returned records - hasRecords = true; searchKey = ""; // to store input field value isSearchLoading = false; // to control loading spinner delayTimeout; - selectedRecord = {}; // to store selected lookup record in object formate - mapData = []; + selectedRecord = ""; + selectedRecordIconName = this.iconName; + objects; + preventBlur = false; connectedCallback() { + this.isSearchLoading = true; //GET LIST OF ALL OBJECTS getAllObjects() - .then((result) => { - if (result != null) { - this.mapData = JSON.parse(JSON.stringify(result)); + .then((objects) => { + if (objects != null) { + this.objects = objects.map((o) => { + return { ...o, iconName: this.iconName }; + }); + this.objectApiNames = objects.map((o) => o.fullName); + if (this.currentSelection) { + this.selectObject(this.currentSelection); + } } }) .catch((error) => { this.error = error; - this.mapData = {}; + this.objects = {}; + }) + .finally(() => { + this.isSearchLoading = false; }); } + // use the UI API to determine the iconName for each object + // this call is slow and if you're interacting with the UI before this loads + // you'll get the generic/fallback icon + @wire(getObjectInfos, { objectApiNames: "$objectApiNames" }) + wiredObjectInfos({ data }) { + if (data) { + // try and extract the Icon path from + const iconNameRegEx = /(\w+)\/(\w+)(?:_\d+)\./; + const objectIconCache = data.results + .filter((r) => r.statusCode === 200) + .filter((r) => r.result.themeInfo) + .reduce((t, v) => { + t[v.result.apiName] = v.result?.themeInfo; + return t; + }, {}); + this.objects.forEach((o) => { + if (!objectIconCache[o.fullName]?.iconUrl) { + return; + } + o.iconUrl = objectIconCache[o.fullName].iconUrl; + o.iconColor = `#${objectIconCache[o.fullName].color}`; + o.iconStyle = `background-color: #${ + objectIconCache[o.fullName].color + };`; + if (o.iconUrl) { + const matches = iconNameRegEx.exec(o.iconUrl); + if (matches) { + o.iconName = `${matches[1]}:${matches[2]}`; + } + } + }); + } + } + + get isReady() { + return !this.objects; + } + // update searchKey property on input field change handleKeyChange(event) { - // Debouncing this method: Do not update the reactive property as long as this function is - // being called within a delay of DELAY. This is to avoid a very large number of Apex method calls. - - var matchedRecords = []; - this.isSearchLoading = true; window.clearTimeout(this.delayTimeout); const searchKey = event.target.value; + // eslint-disable-next-line @lwc/lwc/no-async-operation this.delayTimeout = setTimeout(() => { - matchedRecords = this.mapData.filter(function (link) { - return link.toLowerCase().includes(searchKey.toLowerCase()); + // Require at least two character for matches + if (searchKey.trim().length < 2) { + this.lstResult = []; + return; + } + // constrain results to those containing the text + this.lstResult = this.objects.filter(function (obj) { + return ( + obj.fullName.toLowerCase().includes(searchKey.toLowerCase()) || + obj.label.toLowerCase().includes(searchKey.toLowerCase()) + ); }); - - this.hasRecords = matchedRecords.length == 0 ? false : true; - this.lstResult = JSON.parse(JSON.stringify(matchedRecords)); + // sort by most similar, either label or API name + this.lstResult.sort((a, b) => { + return ( + // take the nearest of the Label and API name + Math.min( + jsLevenshtein(searchKey.toLowerCase(), `${a.fullName}`), + jsLevenshtein(searchKey.toLowerCase(), `${a.label}`) + ) - + Math.min( + jsLevenshtein(searchKey.toLowerCase(), `${b.fullName}`), + jsLevenshtein(searchKey.toLowerCase(), `${b.label}`) + ) + ); + }); + // limit to the MAX_RESULTS closest matches + this.lstResult.splice(MAX_RESULTS); }, DELAY); } + showResultList() { + const lookupInputContainer = this.template.querySelector( + ".lookupInputContainer" + ); + const clsList = lookupInputContainer.classList; + clsList.add("slds-is-open"); + } + + hideResultList() { + // Allow enough time for the click handler of the object list to run before we burn the elements + // 310 is chosen because on some mobile devices clicks can take up to 300ms to fire + // eslint-disable-next-line @lwc/lwc/no-async-operation + setTimeout(() => { + const lookupInputContainer = this.template.querySelector( + ".lookupInputContainer" + ); + const clsList = lookupInputContainer.classList; + clsList.remove("slds-is-open"); + }, 310); + } + // method to toggle lookup result section on UI toggleResult(event) { const lookupInputContainer = this.template.querySelector( @@ -64,30 +164,54 @@ export default class ObjectSelector extends LightningElement { case "lookupContainer": clsList.remove("slds-is-open"); break; + default: + break; } } // method to clear selected lookup record handleRemove() { this.searchKey = ""; - this.selectedRecord = {}; + this.selectedRecord = ""; + this.lstResult = []; this.lookupUpdatehandler(undefined); // update value on parent component as well from helper function // remove selected pill and display input field again const searchBoxWrapper = this.template.querySelector(".searchBoxWrapper"); - searchBoxWrapper.classList.remove("slds-hide"); - searchBoxWrapper.classList.add("slds-show"); + if (searchBoxWrapper) { + searchBoxWrapper.classList.remove("slds-hide"); + searchBoxWrapper.classList.add("slds-show"); + searchBoxWrapper.querySelector("lightning-input").value = + this.selectedRecord; + } const pillDiv = this.template.querySelector(".pillDiv"); - pillDiv.classList.remove("slds-show"); - pillDiv.classList.add("slds-hide"); + if (pillDiv) { + pillDiv.classList.remove("slds-show"); + pillDiv.classList.add("slds-hide"); + } } // method to update selected record from search result - handelSelectedRecord(event) { - var objId = event.target.getAttribute("data-recid"); // get selected record Id - this.selectedRecord = this.lstResult.find((data) => data === objId); // find selected record from list - this.lookupUpdatehandler(this.selectedRecord); // update value on parent component as well from helper function + handleSelectedRecord(event) { + const selectedName = event.target.getAttribute("data-objname"); // get selected record Idrd from list + this.selectObject(selectedName); + this.lookupUpdatehandler(selectedName); // update value on parent component as well from helper function + } + + selectObject(val) { + if (!val || val.trim().length === 0) { + this.handleRemove(); + return; + } + // data isn't ready yet, will auto-retry on data loaded + if (!this.objects) { + return; + } + const obj = this.objects.find((o) => o.fullName === val); + this.selectedRecord = `${obj.label} (${obj.fullName})`; + this.selectedRecordIconName = obj.iconName; this.handelSelectRecordHelper(); // helper function to show/hide lookup result container on UI } + /*COMMON HELPER METHOD STARTED*/ handelSelectRecordHelper() { this.template @@ -103,10 +227,8 @@ export default class ObjectSelector extends LightningElement { // send selected lookup record to parent component using custom event lookupUpdatehandler(value) { //Send only the API Name in the event - var regExp = /\(([^)]+)\)/; - var retVal = regExp.exec(JSON.stringify(value)); const oEvent = new CustomEvent("lookupupdate", { - detail: { selectedRecord: retVal[1] } + detail: { selectedRecord: value } }); this.dispatchEvent(oEvent); } diff --git a/dlrs/main/lwc/objectSelector/objectSelector.js-meta.xml b/dlrs/main/lwc/objectSelector/objectSelector.js-meta.xml index e7247af4..9698be96 100644 --- a/dlrs/main/lwc/objectSelector/objectSelector.js-meta.xml +++ b/dlrs/main/lwc/objectSelector/objectSelector.js-meta.xml @@ -1,6 +1,6 @@ - 56.0 + 57.0 true lightning__AppPage diff --git a/dlrs/main/lwc/rollupEditor/rollupEditor.html b/dlrs/main/lwc/rollupEditor/rollupEditor.html index ff4d93cd..2dcb9e52 100644 --- a/dlrs/main/lwc/rollupEditor/rollupEditor.html +++ b/dlrs/main/lwc/rollupEditor/rollupEditor.html @@ -1,120 +1,232 @@ diff --git a/dlrs/main/lwc/rollupEditor/rollupEditor.js b/dlrs/main/lwc/rollupEditor/rollupEditor.js index 3fa593cc..d74d7d8e 100644 --- a/dlrs/main/lwc/rollupEditor/rollupEditor.js +++ b/dlrs/main/lwc/rollupEditor/rollupEditor.js @@ -26,6 +26,7 @@ export default class RollupEditor extends LightningElement { return this._rollupName; } set rollupName(val) { + this.errors = {}; // clear any existing error this._rollupName = val; this.getRollup(); From 5e9d85504db803377b6a87bd255fd578ac1a1bb2 Mon Sep 17 00:00:00 2001 From: Khang Ly Date: Mon, 1 May 2023 15:06:19 +0700 Subject: [PATCH 021/130] feature: UI separations between Edit and Create mode --- dlrs/main/lwc/rollupEditor/rollupEditor.html | 1269 +++++++++--------- dlrs/main/lwc/rollupEditor/rollupEditor.js | 7 + 2 files changed, 649 insertions(+), 627 deletions(-) diff --git a/dlrs/main/lwc/rollupEditor/rollupEditor.html b/dlrs/main/lwc/rollupEditor/rollupEditor.html index 2dcb9e52..f576ac17 100644 --- a/dlrs/main/lwc/rollupEditor/rollupEditor.html +++ b/dlrs/main/lwc/rollupEditor/rollupEditor.html @@ -1,704 +1,719 @@ diff --git a/dlrs/main/lwc/rollupEditor/rollupEditor.js b/dlrs/main/lwc/rollupEditor/rollupEditor.js index d74d7d8e..17cfe192 100644 --- a/dlrs/main/lwc/rollupEditor/rollupEditor.js +++ b/dlrs/main/lwc/rollupEditor/rollupEditor.js @@ -6,6 +6,7 @@ import saveRollupConfig from "@salesforce/apex/RollupEditorController.saveRollup import getFieldOptions from "@salesforce/apex/RollupEditorController.getFieldOptions"; export default class RollupEditor extends LightningElement { + isLoading = false; DEFAULT_ROLLUP_VALUES = { Active__c: false }; @track rollup = this.DEFAULT_ROLLUP_VALUES; @@ -37,6 +38,10 @@ export default class RollupEditor extends LightningElement { await this.getRelationshipFieldOptions(); } + get saveButtonLabel(){ + return this.rollup.Id ? 'Save' : 'Create' + } + get rollupCanBeActivated() { return this.rollup.Id && !this.rollup.Active__c; } @@ -106,6 +111,7 @@ export default class RollupEditor extends LightningElement { } async runSave() { + this.isLoading = true; this.assembleRollupFromForm(); await this.runValidate(); if (Object.keys(this.errors).length > 0) { @@ -121,6 +127,7 @@ export default class RollupEditor extends LightningElement { variant: "info" }); this.dispatchEvent(evt); + this.isLoading = false; } assembleRollupFromForm() { From 32962b54fe971e7f5d49ded0fab087c59585b9a1 Mon Sep 17 00:00:00 2001 From: Khang Ly Date: Mon, 1 May 2023 15:14:38 +0700 Subject: [PATCH 022/130] feature: rollup name as Header --- dlrs/main/lwc/rollupEditor/rollupEditor.html | 3 ++- dlrs/main/lwc/rollupEditor/rollupEditor.js | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/dlrs/main/lwc/rollupEditor/rollupEditor.html b/dlrs/main/lwc/rollupEditor/rollupEditor.html index f576ac17..8717b637 100644 --- a/dlrs/main/lwc/rollupEditor/rollupEditor.html +++ b/dlrs/main/lwc/rollupEditor/rollupEditor.html @@ -23,7 +23,7 @@

class="slds-card__header-link slds-truncate" title="Lookup Rollup Summary Creation Wizard" > - Lookup Rollup Summary Creation Wizard + {cardHeader}

@@ -256,6 +256,7 @@

Date: Mon, 1 May 2023 16:52:44 +0700 Subject: [PATCH 023/130] feature: refresh FieldOptions everywhen selected objects are changed --- dlrs/main/lwc/rollupEditor/rollupEditor.js | 50 ++++++++++++++-------- 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/dlrs/main/lwc/rollupEditor/rollupEditor.js b/dlrs/main/lwc/rollupEditor/rollupEditor.js index 04e52ce9..2165f59a 100644 --- a/dlrs/main/lwc/rollupEditor/rollupEditor.js +++ b/dlrs/main/lwc/rollupEditor/rollupEditor.js @@ -30,13 +30,19 @@ export default class RollupEditor extends LightningElement { this.errors = {}; // clear any existing error this._rollupName = val; - this.getRollup(); + this.getRollup() + .then(() => { + this.getRelationshipFieldOptions(this.rollup.ParentObject__c) + .then(res =>{ + this.parentRFieldOptions = res; + }) + this.getRelationshipFieldOptions(this.rollup.ChildObject__c) + .then(res =>{ + this.childRFieldOptions = res; + }) + }) } - async connectedCallback() { - await this.getRollup(); - await this.getRelationshipFieldOptions(); - } get cardHeader(){ return this.rollup.DeveloperName ? this.rollup.DeveloperName : 'Lookup Rollup Summary Creation Wizard' @@ -68,19 +74,6 @@ export default class RollupEditor extends LightningElement { } } - async getRelationshipFieldOptions() { - if (this.rollup.ParentObject__c) { - this.parentRFieldOptions = await getFieldOptions({ - objectName: this.rollup.ParentObject__c - }); - } - if (this.rollup.ChildObject__c) { - this.childRFieldOptions = await getFieldOptions({ - objectName: this.rollup.ChildObject__c - }); - } - } - async runValidate() { this.errors = await validateRollupConfig({ rollup: JSON.stringify(this.rollup) @@ -176,11 +169,32 @@ export default class RollupEditor extends LightningElement { } }); } + childObjectSelected(event) { this.rollup.ChildObject__c = event.detail.selectedRecord; + this.getRelationshipFieldOptions(this.rollup.ChildObject__c) + .then(res => { this.childRFieldOptions = res; }); } parentObjectSelected(event) { this.rollup.ParentObject__c = event.detail.selectedRecord; + this.getRelationshipFieldOptions(this.rollup.ParentObject__c) + .then(res => { this.parentRFieldOptions = res; }); + } + + getRelationshipFieldOptions(objectName){ + return new Promise((resolve) => { + if(!objectName || objectName.trim().length === 0) resolve([]) + else { + getFieldOptions({ objectName: objectName }) + .then(res => { + resolve(res); + }).catch(err => { + console.log(`Error in Get Field Options of ${objectName}: `); + console.error(err); + resolve([]); + }) + } + }) } get rollupAsString() { From 520fdb919805b50c5fcd0c553b20652534eb8e57 Mon Sep 17 00:00:00 2001 From: Evan Callahan Date: Mon, 30 Oct 2023 21:04:06 -0700 Subject: [PATCH 024/130] updated v58.0 to v59.0, fixes #1396 --- cumulusci.yml | 2 +- dlrs/libs/fflib-apexmocks/classes/fflib_Answer.cls-meta.xml | 2 +- dlrs/libs/fflib-apexmocks/classes/fflib_AnswerTest.cls-meta.xml | 2 +- dlrs/libs/fflib-apexmocks/classes/fflib_AnyOrder.cls-meta.xml | 2 +- .../fflib-apexmocks/classes/fflib_AnyOrderTest.cls-meta.xml | 2 +- dlrs/libs/fflib-apexmocks/classes/fflib_ApexMocks.cls-meta.xml | 2 +- .../fflib-apexmocks/classes/fflib_ApexMocksConfig.cls-meta.xml | 2 +- .../fflib-apexmocks/classes/fflib_ApexMocksTest.cls-meta.xml | 2 +- .../fflib-apexmocks/classes/fflib_ApexMocksUtils.cls-meta.xml | 2 +- .../classes/fflib_ApexMocksUtilsTest.cls-meta.xml | 2 +- .../fflib-apexmocks/classes/fflib_ArgumentCaptor.cls-meta.xml | 2 +- .../classes/fflib_ArgumentCaptorTest.cls-meta.xml | 2 +- .../libs/fflib-apexmocks/classes/fflib_IDGenerator.cls-meta.xml | 2 +- .../fflib-apexmocks/classes/fflib_IDGeneratorTest.cls-meta.xml | 2 +- dlrs/libs/fflib-apexmocks/classes/fflib_IMatcher.cls-meta.xml | 2 +- dlrs/libs/fflib-apexmocks/classes/fflib_InOrder.cls-meta.xml | 2 +- .../libs/fflib-apexmocks/classes/fflib_InOrderTest.cls-meta.xml | 2 +- dlrs/libs/fflib-apexmocks/classes/fflib_Inheritor.cls-meta.xml | 2 +- .../fflib-apexmocks/classes/fflib_InheritorTest.cls-meta.xml | 2 +- .../fflib-apexmocks/classes/fflib_InvocationOnMock.cls-meta.xml | 2 +- dlrs/libs/fflib-apexmocks/classes/fflib_Match.cls-meta.xml | 2 +- dlrs/libs/fflib-apexmocks/classes/fflib_MatchTest.cls-meta.xml | 2 +- .../classes/fflib_MatcherDefinitions.cls-meta.xml | 2 +- .../classes/fflib_MatcherDefinitionsTest.cls-meta.xml | 2 +- .../classes/fflib_MatchersReturnValue.cls-meta.xml | 2 +- .../fflib-apexmocks/classes/fflib_MethodArgValues.cls-meta.xml | 2 +- .../classes/fflib_MethodArgValuesTest.cls-meta.xml | 2 +- .../classes/fflib_MethodCountRecorder.cls-meta.xml | 2 +- .../classes/fflib_MethodReturnValue.cls-meta.xml | 2 +- .../classes/fflib_MethodReturnValueRecorder.cls-meta.xml | 2 +- .../fflib-apexmocks/classes/fflib_MethodVerifier.cls-meta.xml | 2 +- dlrs/libs/fflib-apexmocks/classes/fflib_Mocks.cls-meta.xml | 2 +- dlrs/libs/fflib-apexmocks/classes/fflib_MyList.cls-meta.xml | 2 +- .../fflib-apexmocks/classes/fflib_QualifiedMethod.cls-meta.xml | 2 +- .../classes/fflib_QualifiedMethodAndArgValues.cls-meta.xml | 2 +- .../classes/fflib_QualifiedMethodTest.cls-meta.xml | 2 +- dlrs/libs/fflib-apexmocks/classes/fflib_System.cls-meta.xml | 2 +- dlrs/libs/fflib-apexmocks/classes/fflib_SystemTest.cls-meta.xml | 2 +- .../fflib-apexmocks/classes/fflib_VerificationMode.cls-meta.xml | 2 +- dlrs/libs/fflib-common/classes/fflib_Application.cls-meta.xml | 2 +- .../fflib-common/classes/fflib_ApplicationTest.cls-meta.xml | 2 +- .../libs/fflib-common/classes/fflib_ISObjectDomain.cls-meta.xml | 2 +- .../fflib-common/classes/fflib_ISObjectSelector.cls-meta.xml | 2 +- .../fflib-common/classes/fflib_ISObjectUnitOfWork.cls-meta.xml | 2 +- dlrs/libs/fflib-common/classes/fflib_QueryFactory.cls-meta.xml | 2 +- .../fflib-common/classes/fflib_QueryFactoryTest.cls-meta.xml | 2 +- .../fflib-common/classes/fflib_SObjectDescribe.cls-meta.xml | 2 +- .../fflib-common/classes/fflib_SObjectDescribeTest.cls-meta.xml | 2 +- dlrs/libs/fflib-common/classes/fflib_SObjectDomain.cls-meta.xml | 2 +- .../fflib-common/classes/fflib_SObjectDomainTest.cls-meta.xml | 2 +- dlrs/libs/fflib-common/classes/fflib_SObjectMocks.cls-meta.xml | 2 +- .../fflib-common/classes/fflib_SObjectSelector.cls-meta.xml | 2 +- .../fflib-common/classes/fflib_SObjectSelectorTest.cls-meta.xml | 2 +- .../fflib-common/classes/fflib_SObjectUnitOfWork.cls-meta.xml | 2 +- .../classes/fflib_SObjectUnitOfWorkTest.cls-meta.xml | 2 +- dlrs/libs/fflib-common/classes/fflib_SecurityUtils.cls-meta.xml | 2 +- .../fflib-common/classes/fflib_SecurityUtilsTest.cls-meta.xml | 2 +- dlrs/libs/fflib-common/classes/fflib_StringBuilder.cls-meta.xml | 2 +- .../fflib-common/classes/fflib_StringBuilderTest.cls-meta.xml | 2 +- dlrs/libs/lrengine/classes/LREngine.cls-meta.xml | 2 +- dlrs/libs/lrengine/classes/TestLREngine.cls-meta.xml | 2 +- dlrs/libs/metadataservice/classes/MetadataService.cls-meta.xml | 2 +- .../metadataservice/classes/MetadataServiceTest.cls-meta.xml | 2 +- dlrs/libs/metadataservice/components/zip.component-meta.xml | 2 +- .../libs/metadataservice/components/zipEntry.component-meta.xml | 2 +- dlrs/main/aura/optimizer/optimizer.cmp-meta.xml | 2 +- .../optimizerNotification/optimizerNotification.cmp-meta.xml | 2 +- dlrs/main/classes/ApexClassesSelector.cls-meta.xml | 2 +- dlrs/main/classes/ApexTriggersSelector.cls-meta.xml | 2 +- dlrs/main/classes/AsyncApexJobsSelector.cls-meta.xml | 2 +- dlrs/main/classes/BypassHandler.cls-meta.xml | 2 +- dlrs/main/classes/BypassHandlerTest.cls-meta.xml | 2 +- dlrs/main/classes/CronJobDetailsSelector.cls-meta.xml | 2 +- dlrs/main/classes/CronTriggersSelector.cls-meta.xml | 2 +- dlrs/main/classes/CustomMetadataService.cls-meta.xml | 2 +- dlrs/main/classes/CustomMetadataServiceTest.cls-meta.xml | 2 +- dlrs/main/classes/MLRSControllerTest.cls-meta.xml | 2 +- .../classes/ManageLookupRollupSummariesController.cls-meta.xml | 2 +- .../ManageLookupRollupSummariesNewController.cls-meta.xml | 2 +- .../classes/ManageLookupRollupSummariesNewTest.cls-meta.xml | 2 +- dlrs/main/classes/MetadataServiceCalloutMock.cls-meta.xml | 2 +- dlrs/main/classes/OptimizerComponentController.cls-meta.xml | 2 +- dlrs/main/classes/OptimizerService.cls-meta.xml | 2 +- dlrs/main/classes/OptimizerServiceTest.cls-meta.xml | 2 +- dlrs/main/classes/RollupActionCalculate.cls-meta.xml | 2 +- dlrs/main/classes/RollupActionCalculateTest.cls-meta.xml | 2 +- dlrs/main/classes/RollupCalculateController.cls-meta.xml | 2 +- dlrs/main/classes/RollupCalculateControllerTest.cls-meta.xml | 2 +- dlrs/main/classes/RollupCalculateJob.cls-meta.xml | 2 +- dlrs/main/classes/RollupCalculateJobSchedulable.cls-meta.xml | 2 +- dlrs/main/classes/RollupController.cls | 2 +- dlrs/main/classes/RollupController.cls-meta.xml | 2 +- dlrs/main/classes/RollupControllerTest.cls-meta.xml | 2 +- dlrs/main/classes/RollupDmlGuard.cls-meta.xml | 2 +- dlrs/main/classes/RollupDmlGuardTest.cls-meta.xml | 2 +- dlrs/main/classes/RollupJob.cls-meta.xml | 2 +- dlrs/main/classes/RollupJobTest.cls-meta.xml | 2 +- .../classes/RollupScheduledCalculateController.cls-meta.xml | 2 +- .../classes/RollupScheduledCalculateControllerTest.cls-meta.xml | 2 +- dlrs/main/classes/RollupService.cls-meta.xml | 2 +- dlrs/main/classes/RollupServiceException.cls-meta.xml | 2 +- dlrs/main/classes/RollupServiceTest.cls-meta.xml | 2 +- dlrs/main/classes/RollupServiceTest2.cls-meta.xml | 2 +- dlrs/main/classes/RollupServiceTest3.cls-meta.xml | 2 +- dlrs/main/classes/RollupServiceTest4.cls-meta.xml | 2 +- dlrs/main/classes/RollupServiceTest5.cls-meta.xml | 2 +- dlrs/main/classes/RollupServiceTest6.cls-meta.xml | 2 +- dlrs/main/classes/RollupSummaries.cls-meta.xml | 2 +- dlrs/main/classes/RollupSummariesSelector.cls-meta.xml | 2 +- dlrs/main/classes/RollupSummariesSelectorTest.cls-meta.xml | 2 +- dlrs/main/classes/RollupSummariesTest.cls-meta.xml | 2 +- dlrs/main/classes/RollupSummary.cls-meta.xml | 2 +- dlrs/main/classes/RollupSummaryEnhancedController.cls-meta.xml | 2 +- .../classes/RollupSummaryEnhancedControllerTest.cls-meta.xml | 2 +- dlrs/main/classes/RollupSummaryLogDeleteController.cls-meta.xml | 2 +- .../classes/RollupSummaryLogDeleteControllerTest.cls-meta.xml | 2 +- .../classes/RollupSummaryScheduleItemsSelector.cls-meta.xml | 2 +- dlrs/main/classes/RollupSummaryViewController.cls-meta.xml | 2 +- dlrs/main/classes/RollupSummaryViewControllerTest.cls-meta.xml | 2 +- dlrs/main/classes/TestContext.cls-meta.xml | 2 +- dlrs/main/classes/Utilities.cls-meta.xml | 2 +- dlrs/main/classes/WelcomeController.cls-meta.xml | 2 +- dlrs/main/classes/WelcomeControllerTest.cls-meta.xml | 2 +- dlrs/main/pages/RollupSummaryView.page-meta.xml | 2 +- dlrs/main/pages/managelookuprollupsummaries.page-meta.xml | 2 +- dlrs/main/pages/managelookuprollupsummaries_New.page-meta.xml | 2 +- dlrs/main/pages/managetrigger.page-meta.xml | 2 +- dlrs/main/pages/managetriggermdt.page-meta.xml | 2 +- dlrs/main/pages/rollupcalculate.page-meta.xml | 2 +- dlrs/main/pages/rollupcalculatemdt.page-meta.xml | 2 +- dlrs/main/pages/rollupscheduledcalculate.page-meta.xml | 2 +- dlrs/main/pages/rollupscheduledcalculatemdt.page-meta.xml | 2 +- dlrs/main/pages/rollupsummaryenhanced.page-meta.xml | 2 +- dlrs/main/pages/rollupsummaryenhancednew.page-meta.xml | 2 +- dlrs/main/pages/rollupsummarylogdelete.page-meta.xml | 2 +- dlrs/main/pages/welcome.page-meta.xml | 2 +- dlrs/main/pages/welcometab.page-meta.xml | 2 +- dlrs/main/triggers/RollupSummariesTrigger.trigger-meta.xml | 2 +- sfdx-project.json | 2 +- unpackaged/config/qa/classes/QAHelper.cls-meta.xml | 2 +- .../UnpackagedRollupServiceTest2Trigger.trigger-meta.xml | 2 +- .../UnpackagedRollupServiceTest3Trigger.trigger-meta.xml | 2 +- .../UnpackagedRollupServiceTest4Trigger.trigger-meta.xml | 2 +- .../UnpackagedRollupServiceTest5Trigger.trigger-meta.xml | 2 +- .../UnpackagedRollupServiceTestTrigger.trigger-meta.xml | 2 +- 145 files changed, 145 insertions(+), 145 deletions(-) diff --git a/cumulusci.yml b/cumulusci.yml index c99c8b3c..9eb7a985 100644 --- a/cumulusci.yml +++ b/cumulusci.yml @@ -4,7 +4,7 @@ project: package: name: Declarative Lookup Rollup Summaries Tool namespace: dlrs - api_version: "58.0" + api_version: "59.0" git: repo_url: https://github.com/SFDO-Community/declarative-lookup-rollup-summaries prefix_beta: beta/ diff --git a/dlrs/libs/fflib-apexmocks/classes/fflib_Answer.cls-meta.xml b/dlrs/libs/fflib-apexmocks/classes/fflib_Answer.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/libs/fflib-apexmocks/classes/fflib_Answer.cls-meta.xml +++ b/dlrs/libs/fflib-apexmocks/classes/fflib_Answer.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/libs/fflib-apexmocks/classes/fflib_AnswerTest.cls-meta.xml b/dlrs/libs/fflib-apexmocks/classes/fflib_AnswerTest.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/libs/fflib-apexmocks/classes/fflib_AnswerTest.cls-meta.xml +++ b/dlrs/libs/fflib-apexmocks/classes/fflib_AnswerTest.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/libs/fflib-apexmocks/classes/fflib_AnyOrder.cls-meta.xml b/dlrs/libs/fflib-apexmocks/classes/fflib_AnyOrder.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/libs/fflib-apexmocks/classes/fflib_AnyOrder.cls-meta.xml +++ b/dlrs/libs/fflib-apexmocks/classes/fflib_AnyOrder.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/libs/fflib-apexmocks/classes/fflib_AnyOrderTest.cls-meta.xml b/dlrs/libs/fflib-apexmocks/classes/fflib_AnyOrderTest.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/libs/fflib-apexmocks/classes/fflib_AnyOrderTest.cls-meta.xml +++ b/dlrs/libs/fflib-apexmocks/classes/fflib_AnyOrderTest.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/libs/fflib-apexmocks/classes/fflib_ApexMocks.cls-meta.xml b/dlrs/libs/fflib-apexmocks/classes/fflib_ApexMocks.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/libs/fflib-apexmocks/classes/fflib_ApexMocks.cls-meta.xml +++ b/dlrs/libs/fflib-apexmocks/classes/fflib_ApexMocks.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/libs/fflib-apexmocks/classes/fflib_ApexMocksConfig.cls-meta.xml b/dlrs/libs/fflib-apexmocks/classes/fflib_ApexMocksConfig.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/libs/fflib-apexmocks/classes/fflib_ApexMocksConfig.cls-meta.xml +++ b/dlrs/libs/fflib-apexmocks/classes/fflib_ApexMocksConfig.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/libs/fflib-apexmocks/classes/fflib_ApexMocksTest.cls-meta.xml b/dlrs/libs/fflib-apexmocks/classes/fflib_ApexMocksTest.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/libs/fflib-apexmocks/classes/fflib_ApexMocksTest.cls-meta.xml +++ b/dlrs/libs/fflib-apexmocks/classes/fflib_ApexMocksTest.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/libs/fflib-apexmocks/classes/fflib_ApexMocksUtils.cls-meta.xml b/dlrs/libs/fflib-apexmocks/classes/fflib_ApexMocksUtils.cls-meta.xml index bb207469..cf999bc3 100644 --- a/dlrs/libs/fflib-apexmocks/classes/fflib_ApexMocksUtils.cls-meta.xml +++ b/dlrs/libs/fflib-apexmocks/classes/fflib_ApexMocksUtils.cls-meta.xml @@ -1,4 +1,4 @@ - 58.0 + 59.0 diff --git a/dlrs/libs/fflib-apexmocks/classes/fflib_ApexMocksUtilsTest.cls-meta.xml b/dlrs/libs/fflib-apexmocks/classes/fflib_ApexMocksUtilsTest.cls-meta.xml index bb207469..cf999bc3 100644 --- a/dlrs/libs/fflib-apexmocks/classes/fflib_ApexMocksUtilsTest.cls-meta.xml +++ b/dlrs/libs/fflib-apexmocks/classes/fflib_ApexMocksUtilsTest.cls-meta.xml @@ -1,4 +1,4 @@ - 58.0 + 59.0 diff --git a/dlrs/libs/fflib-apexmocks/classes/fflib_ArgumentCaptor.cls-meta.xml b/dlrs/libs/fflib-apexmocks/classes/fflib_ArgumentCaptor.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/libs/fflib-apexmocks/classes/fflib_ArgumentCaptor.cls-meta.xml +++ b/dlrs/libs/fflib-apexmocks/classes/fflib_ArgumentCaptor.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/libs/fflib-apexmocks/classes/fflib_ArgumentCaptorTest.cls-meta.xml b/dlrs/libs/fflib-apexmocks/classes/fflib_ArgumentCaptorTest.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/libs/fflib-apexmocks/classes/fflib_ArgumentCaptorTest.cls-meta.xml +++ b/dlrs/libs/fflib-apexmocks/classes/fflib_ArgumentCaptorTest.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/libs/fflib-apexmocks/classes/fflib_IDGenerator.cls-meta.xml b/dlrs/libs/fflib-apexmocks/classes/fflib_IDGenerator.cls-meta.xml index bb207469..cf999bc3 100644 --- a/dlrs/libs/fflib-apexmocks/classes/fflib_IDGenerator.cls-meta.xml +++ b/dlrs/libs/fflib-apexmocks/classes/fflib_IDGenerator.cls-meta.xml @@ -1,4 +1,4 @@ - 58.0 + 59.0 diff --git a/dlrs/libs/fflib-apexmocks/classes/fflib_IDGeneratorTest.cls-meta.xml b/dlrs/libs/fflib-apexmocks/classes/fflib_IDGeneratorTest.cls-meta.xml index bb207469..cf999bc3 100644 --- a/dlrs/libs/fflib-apexmocks/classes/fflib_IDGeneratorTest.cls-meta.xml +++ b/dlrs/libs/fflib-apexmocks/classes/fflib_IDGeneratorTest.cls-meta.xml @@ -1,4 +1,4 @@ - 58.0 + 59.0 diff --git a/dlrs/libs/fflib-apexmocks/classes/fflib_IMatcher.cls-meta.xml b/dlrs/libs/fflib-apexmocks/classes/fflib_IMatcher.cls-meta.xml index bb207469..cf999bc3 100644 --- a/dlrs/libs/fflib-apexmocks/classes/fflib_IMatcher.cls-meta.xml +++ b/dlrs/libs/fflib-apexmocks/classes/fflib_IMatcher.cls-meta.xml @@ -1,4 +1,4 @@ - 58.0 + 59.0 diff --git a/dlrs/libs/fflib-apexmocks/classes/fflib_InOrder.cls-meta.xml b/dlrs/libs/fflib-apexmocks/classes/fflib_InOrder.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/libs/fflib-apexmocks/classes/fflib_InOrder.cls-meta.xml +++ b/dlrs/libs/fflib-apexmocks/classes/fflib_InOrder.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/libs/fflib-apexmocks/classes/fflib_InOrderTest.cls-meta.xml b/dlrs/libs/fflib-apexmocks/classes/fflib_InOrderTest.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/libs/fflib-apexmocks/classes/fflib_InOrderTest.cls-meta.xml +++ b/dlrs/libs/fflib-apexmocks/classes/fflib_InOrderTest.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/libs/fflib-apexmocks/classes/fflib_Inheritor.cls-meta.xml b/dlrs/libs/fflib-apexmocks/classes/fflib_Inheritor.cls-meta.xml index afdb6f1b..65b1c478 100644 --- a/dlrs/libs/fflib-apexmocks/classes/fflib_Inheritor.cls-meta.xml +++ b/dlrs/libs/fflib-apexmocks/classes/fflib_Inheritor.cls-meta.xml @@ -1,4 +1,4 @@ - 58.0 + 59.0 diff --git a/dlrs/libs/fflib-apexmocks/classes/fflib_InheritorTest.cls-meta.xml b/dlrs/libs/fflib-apexmocks/classes/fflib_InheritorTest.cls-meta.xml index afdb6f1b..65b1c478 100644 --- a/dlrs/libs/fflib-apexmocks/classes/fflib_InheritorTest.cls-meta.xml +++ b/dlrs/libs/fflib-apexmocks/classes/fflib_InheritorTest.cls-meta.xml @@ -1,4 +1,4 @@ - 58.0 + 59.0 diff --git a/dlrs/libs/fflib-apexmocks/classes/fflib_InvocationOnMock.cls-meta.xml b/dlrs/libs/fflib-apexmocks/classes/fflib_InvocationOnMock.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/libs/fflib-apexmocks/classes/fflib_InvocationOnMock.cls-meta.xml +++ b/dlrs/libs/fflib-apexmocks/classes/fflib_InvocationOnMock.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/libs/fflib-apexmocks/classes/fflib_Match.cls-meta.xml b/dlrs/libs/fflib-apexmocks/classes/fflib_Match.cls-meta.xml index bb207469..cf999bc3 100644 --- a/dlrs/libs/fflib-apexmocks/classes/fflib_Match.cls-meta.xml +++ b/dlrs/libs/fflib-apexmocks/classes/fflib_Match.cls-meta.xml @@ -1,4 +1,4 @@ - 58.0 + 59.0 diff --git a/dlrs/libs/fflib-apexmocks/classes/fflib_MatchTest.cls-meta.xml b/dlrs/libs/fflib-apexmocks/classes/fflib_MatchTest.cls-meta.xml index bb207469..cf999bc3 100644 --- a/dlrs/libs/fflib-apexmocks/classes/fflib_MatchTest.cls-meta.xml +++ b/dlrs/libs/fflib-apexmocks/classes/fflib_MatchTest.cls-meta.xml @@ -1,4 +1,4 @@ - 58.0 + 59.0 diff --git a/dlrs/libs/fflib-apexmocks/classes/fflib_MatcherDefinitions.cls-meta.xml b/dlrs/libs/fflib-apexmocks/classes/fflib_MatcherDefinitions.cls-meta.xml index bb207469..cf999bc3 100644 --- a/dlrs/libs/fflib-apexmocks/classes/fflib_MatcherDefinitions.cls-meta.xml +++ b/dlrs/libs/fflib-apexmocks/classes/fflib_MatcherDefinitions.cls-meta.xml @@ -1,4 +1,4 @@ - 58.0 + 59.0 diff --git a/dlrs/libs/fflib-apexmocks/classes/fflib_MatcherDefinitionsTest.cls-meta.xml b/dlrs/libs/fflib-apexmocks/classes/fflib_MatcherDefinitionsTest.cls-meta.xml index bb207469..cf999bc3 100644 --- a/dlrs/libs/fflib-apexmocks/classes/fflib_MatcherDefinitionsTest.cls-meta.xml +++ b/dlrs/libs/fflib-apexmocks/classes/fflib_MatcherDefinitionsTest.cls-meta.xml @@ -1,4 +1,4 @@ - 58.0 + 59.0 diff --git a/dlrs/libs/fflib-apexmocks/classes/fflib_MatchersReturnValue.cls-meta.xml b/dlrs/libs/fflib-apexmocks/classes/fflib_MatchersReturnValue.cls-meta.xml index bb207469..cf999bc3 100644 --- a/dlrs/libs/fflib-apexmocks/classes/fflib_MatchersReturnValue.cls-meta.xml +++ b/dlrs/libs/fflib-apexmocks/classes/fflib_MatchersReturnValue.cls-meta.xml @@ -1,4 +1,4 @@ - 58.0 + 59.0 diff --git a/dlrs/libs/fflib-apexmocks/classes/fflib_MethodArgValues.cls-meta.xml b/dlrs/libs/fflib-apexmocks/classes/fflib_MethodArgValues.cls-meta.xml index bb207469..cf999bc3 100644 --- a/dlrs/libs/fflib-apexmocks/classes/fflib_MethodArgValues.cls-meta.xml +++ b/dlrs/libs/fflib-apexmocks/classes/fflib_MethodArgValues.cls-meta.xml @@ -1,4 +1,4 @@ - 58.0 + 59.0 diff --git a/dlrs/libs/fflib-apexmocks/classes/fflib_MethodArgValuesTest.cls-meta.xml b/dlrs/libs/fflib-apexmocks/classes/fflib_MethodArgValuesTest.cls-meta.xml index bb207469..cf999bc3 100644 --- a/dlrs/libs/fflib-apexmocks/classes/fflib_MethodArgValuesTest.cls-meta.xml +++ b/dlrs/libs/fflib-apexmocks/classes/fflib_MethodArgValuesTest.cls-meta.xml @@ -1,4 +1,4 @@ - 58.0 + 59.0 diff --git a/dlrs/libs/fflib-apexmocks/classes/fflib_MethodCountRecorder.cls-meta.xml b/dlrs/libs/fflib-apexmocks/classes/fflib_MethodCountRecorder.cls-meta.xml index bb207469..cf999bc3 100644 --- a/dlrs/libs/fflib-apexmocks/classes/fflib_MethodCountRecorder.cls-meta.xml +++ b/dlrs/libs/fflib-apexmocks/classes/fflib_MethodCountRecorder.cls-meta.xml @@ -1,4 +1,4 @@ - 58.0 + 59.0 diff --git a/dlrs/libs/fflib-apexmocks/classes/fflib_MethodReturnValue.cls-meta.xml b/dlrs/libs/fflib-apexmocks/classes/fflib_MethodReturnValue.cls-meta.xml index bb207469..cf999bc3 100644 --- a/dlrs/libs/fflib-apexmocks/classes/fflib_MethodReturnValue.cls-meta.xml +++ b/dlrs/libs/fflib-apexmocks/classes/fflib_MethodReturnValue.cls-meta.xml @@ -1,4 +1,4 @@ - 58.0 + 59.0 diff --git a/dlrs/libs/fflib-apexmocks/classes/fflib_MethodReturnValueRecorder.cls-meta.xml b/dlrs/libs/fflib-apexmocks/classes/fflib_MethodReturnValueRecorder.cls-meta.xml index bb207469..cf999bc3 100644 --- a/dlrs/libs/fflib-apexmocks/classes/fflib_MethodReturnValueRecorder.cls-meta.xml +++ b/dlrs/libs/fflib-apexmocks/classes/fflib_MethodReturnValueRecorder.cls-meta.xml @@ -1,4 +1,4 @@ - 58.0 + 59.0 diff --git a/dlrs/libs/fflib-apexmocks/classes/fflib_MethodVerifier.cls-meta.xml b/dlrs/libs/fflib-apexmocks/classes/fflib_MethodVerifier.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/libs/fflib-apexmocks/classes/fflib_MethodVerifier.cls-meta.xml +++ b/dlrs/libs/fflib-apexmocks/classes/fflib_MethodVerifier.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/libs/fflib-apexmocks/classes/fflib_Mocks.cls-meta.xml b/dlrs/libs/fflib-apexmocks/classes/fflib_Mocks.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/libs/fflib-apexmocks/classes/fflib_Mocks.cls-meta.xml +++ b/dlrs/libs/fflib-apexmocks/classes/fflib_Mocks.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/libs/fflib-apexmocks/classes/fflib_MyList.cls-meta.xml b/dlrs/libs/fflib-apexmocks/classes/fflib_MyList.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/libs/fflib-apexmocks/classes/fflib_MyList.cls-meta.xml +++ b/dlrs/libs/fflib-apexmocks/classes/fflib_MyList.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/libs/fflib-apexmocks/classes/fflib_QualifiedMethod.cls-meta.xml b/dlrs/libs/fflib-apexmocks/classes/fflib_QualifiedMethod.cls-meta.xml index bb207469..cf999bc3 100644 --- a/dlrs/libs/fflib-apexmocks/classes/fflib_QualifiedMethod.cls-meta.xml +++ b/dlrs/libs/fflib-apexmocks/classes/fflib_QualifiedMethod.cls-meta.xml @@ -1,4 +1,4 @@ - 58.0 + 59.0 diff --git a/dlrs/libs/fflib-apexmocks/classes/fflib_QualifiedMethodAndArgValues.cls-meta.xml b/dlrs/libs/fflib-apexmocks/classes/fflib_QualifiedMethodAndArgValues.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/libs/fflib-apexmocks/classes/fflib_QualifiedMethodAndArgValues.cls-meta.xml +++ b/dlrs/libs/fflib-apexmocks/classes/fflib_QualifiedMethodAndArgValues.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/libs/fflib-apexmocks/classes/fflib_QualifiedMethodTest.cls-meta.xml b/dlrs/libs/fflib-apexmocks/classes/fflib_QualifiedMethodTest.cls-meta.xml index bb207469..cf999bc3 100644 --- a/dlrs/libs/fflib-apexmocks/classes/fflib_QualifiedMethodTest.cls-meta.xml +++ b/dlrs/libs/fflib-apexmocks/classes/fflib_QualifiedMethodTest.cls-meta.xml @@ -1,4 +1,4 @@ - 58.0 + 59.0 diff --git a/dlrs/libs/fflib-apexmocks/classes/fflib_System.cls-meta.xml b/dlrs/libs/fflib-apexmocks/classes/fflib_System.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/libs/fflib-apexmocks/classes/fflib_System.cls-meta.xml +++ b/dlrs/libs/fflib-apexmocks/classes/fflib_System.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/libs/fflib-apexmocks/classes/fflib_SystemTest.cls-meta.xml b/dlrs/libs/fflib-apexmocks/classes/fflib_SystemTest.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/libs/fflib-apexmocks/classes/fflib_SystemTest.cls-meta.xml +++ b/dlrs/libs/fflib-apexmocks/classes/fflib_SystemTest.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/libs/fflib-apexmocks/classes/fflib_VerificationMode.cls-meta.xml b/dlrs/libs/fflib-apexmocks/classes/fflib_VerificationMode.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/libs/fflib-apexmocks/classes/fflib_VerificationMode.cls-meta.xml +++ b/dlrs/libs/fflib-apexmocks/classes/fflib_VerificationMode.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/libs/fflib-common/classes/fflib_Application.cls-meta.xml b/dlrs/libs/fflib-common/classes/fflib_Application.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/libs/fflib-common/classes/fflib_Application.cls-meta.xml +++ b/dlrs/libs/fflib-common/classes/fflib_Application.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/libs/fflib-common/classes/fflib_ApplicationTest.cls-meta.xml b/dlrs/libs/fflib-common/classes/fflib_ApplicationTest.cls-meta.xml index bb207469..cf999bc3 100644 --- a/dlrs/libs/fflib-common/classes/fflib_ApplicationTest.cls-meta.xml +++ b/dlrs/libs/fflib-common/classes/fflib_ApplicationTest.cls-meta.xml @@ -1,4 +1,4 @@ - 58.0 + 59.0 diff --git a/dlrs/libs/fflib-common/classes/fflib_ISObjectDomain.cls-meta.xml b/dlrs/libs/fflib-common/classes/fflib_ISObjectDomain.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/libs/fflib-common/classes/fflib_ISObjectDomain.cls-meta.xml +++ b/dlrs/libs/fflib-common/classes/fflib_ISObjectDomain.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/libs/fflib-common/classes/fflib_ISObjectSelector.cls-meta.xml b/dlrs/libs/fflib-common/classes/fflib_ISObjectSelector.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/libs/fflib-common/classes/fflib_ISObjectSelector.cls-meta.xml +++ b/dlrs/libs/fflib-common/classes/fflib_ISObjectSelector.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/libs/fflib-common/classes/fflib_ISObjectUnitOfWork.cls-meta.xml b/dlrs/libs/fflib-common/classes/fflib_ISObjectUnitOfWork.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/libs/fflib-common/classes/fflib_ISObjectUnitOfWork.cls-meta.xml +++ b/dlrs/libs/fflib-common/classes/fflib_ISObjectUnitOfWork.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/libs/fflib-common/classes/fflib_QueryFactory.cls-meta.xml b/dlrs/libs/fflib-common/classes/fflib_QueryFactory.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/libs/fflib-common/classes/fflib_QueryFactory.cls-meta.xml +++ b/dlrs/libs/fflib-common/classes/fflib_QueryFactory.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/libs/fflib-common/classes/fflib_QueryFactoryTest.cls-meta.xml b/dlrs/libs/fflib-common/classes/fflib_QueryFactoryTest.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/libs/fflib-common/classes/fflib_QueryFactoryTest.cls-meta.xml +++ b/dlrs/libs/fflib-common/classes/fflib_QueryFactoryTest.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/libs/fflib-common/classes/fflib_SObjectDescribe.cls-meta.xml b/dlrs/libs/fflib-common/classes/fflib_SObjectDescribe.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/libs/fflib-common/classes/fflib_SObjectDescribe.cls-meta.xml +++ b/dlrs/libs/fflib-common/classes/fflib_SObjectDescribe.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/libs/fflib-common/classes/fflib_SObjectDescribeTest.cls-meta.xml b/dlrs/libs/fflib-common/classes/fflib_SObjectDescribeTest.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/libs/fflib-common/classes/fflib_SObjectDescribeTest.cls-meta.xml +++ b/dlrs/libs/fflib-common/classes/fflib_SObjectDescribeTest.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/libs/fflib-common/classes/fflib_SObjectDomain.cls-meta.xml b/dlrs/libs/fflib-common/classes/fflib_SObjectDomain.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/libs/fflib-common/classes/fflib_SObjectDomain.cls-meta.xml +++ b/dlrs/libs/fflib-common/classes/fflib_SObjectDomain.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/libs/fflib-common/classes/fflib_SObjectDomainTest.cls-meta.xml b/dlrs/libs/fflib-common/classes/fflib_SObjectDomainTest.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/libs/fflib-common/classes/fflib_SObjectDomainTest.cls-meta.xml +++ b/dlrs/libs/fflib-common/classes/fflib_SObjectDomainTest.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/libs/fflib-common/classes/fflib_SObjectMocks.cls-meta.xml b/dlrs/libs/fflib-common/classes/fflib_SObjectMocks.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/libs/fflib-common/classes/fflib_SObjectMocks.cls-meta.xml +++ b/dlrs/libs/fflib-common/classes/fflib_SObjectMocks.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/libs/fflib-common/classes/fflib_SObjectSelector.cls-meta.xml b/dlrs/libs/fflib-common/classes/fflib_SObjectSelector.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/libs/fflib-common/classes/fflib_SObjectSelector.cls-meta.xml +++ b/dlrs/libs/fflib-common/classes/fflib_SObjectSelector.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/libs/fflib-common/classes/fflib_SObjectSelectorTest.cls-meta.xml b/dlrs/libs/fflib-common/classes/fflib_SObjectSelectorTest.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/libs/fflib-common/classes/fflib_SObjectSelectorTest.cls-meta.xml +++ b/dlrs/libs/fflib-common/classes/fflib_SObjectSelectorTest.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/libs/fflib-common/classes/fflib_SObjectUnitOfWork.cls-meta.xml b/dlrs/libs/fflib-common/classes/fflib_SObjectUnitOfWork.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/libs/fflib-common/classes/fflib_SObjectUnitOfWork.cls-meta.xml +++ b/dlrs/libs/fflib-common/classes/fflib_SObjectUnitOfWork.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/libs/fflib-common/classes/fflib_SObjectUnitOfWorkTest.cls-meta.xml b/dlrs/libs/fflib-common/classes/fflib_SObjectUnitOfWorkTest.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/libs/fflib-common/classes/fflib_SObjectUnitOfWorkTest.cls-meta.xml +++ b/dlrs/libs/fflib-common/classes/fflib_SObjectUnitOfWorkTest.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/libs/fflib-common/classes/fflib_SecurityUtils.cls-meta.xml b/dlrs/libs/fflib-common/classes/fflib_SecurityUtils.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/libs/fflib-common/classes/fflib_SecurityUtils.cls-meta.xml +++ b/dlrs/libs/fflib-common/classes/fflib_SecurityUtils.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/libs/fflib-common/classes/fflib_SecurityUtilsTest.cls-meta.xml b/dlrs/libs/fflib-common/classes/fflib_SecurityUtilsTest.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/libs/fflib-common/classes/fflib_SecurityUtilsTest.cls-meta.xml +++ b/dlrs/libs/fflib-common/classes/fflib_SecurityUtilsTest.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/libs/fflib-common/classes/fflib_StringBuilder.cls-meta.xml b/dlrs/libs/fflib-common/classes/fflib_StringBuilder.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/libs/fflib-common/classes/fflib_StringBuilder.cls-meta.xml +++ b/dlrs/libs/fflib-common/classes/fflib_StringBuilder.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/libs/fflib-common/classes/fflib_StringBuilderTest.cls-meta.xml b/dlrs/libs/fflib-common/classes/fflib_StringBuilderTest.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/libs/fflib-common/classes/fflib_StringBuilderTest.cls-meta.xml +++ b/dlrs/libs/fflib-common/classes/fflib_StringBuilderTest.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/libs/lrengine/classes/LREngine.cls-meta.xml b/dlrs/libs/lrengine/classes/LREngine.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/libs/lrengine/classes/LREngine.cls-meta.xml +++ b/dlrs/libs/lrengine/classes/LREngine.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/libs/lrengine/classes/TestLREngine.cls-meta.xml b/dlrs/libs/lrengine/classes/TestLREngine.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/libs/lrengine/classes/TestLREngine.cls-meta.xml +++ b/dlrs/libs/lrengine/classes/TestLREngine.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/libs/metadataservice/classes/MetadataService.cls-meta.xml b/dlrs/libs/metadataservice/classes/MetadataService.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/libs/metadataservice/classes/MetadataService.cls-meta.xml +++ b/dlrs/libs/metadataservice/classes/MetadataService.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/libs/metadataservice/classes/MetadataServiceTest.cls-meta.xml b/dlrs/libs/metadataservice/classes/MetadataServiceTest.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/libs/metadataservice/classes/MetadataServiceTest.cls-meta.xml +++ b/dlrs/libs/metadataservice/classes/MetadataServiceTest.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/libs/metadataservice/components/zip.component-meta.xml b/dlrs/libs/metadataservice/components/zip.component-meta.xml index 1dd09c45..b55c7e76 100644 --- a/dlrs/libs/metadataservice/components/zip.component-meta.xml +++ b/dlrs/libs/metadataservice/components/zip.component-meta.xml @@ -1,6 +1,6 @@ - 58.0 + 59.0 1 diff --git a/dlrs/libs/metadataservice/components/zipEntry.component-meta.xml b/dlrs/libs/metadataservice/components/zipEntry.component-meta.xml index ade33bd2..52e83d76 100644 --- a/dlrs/libs/metadataservice/components/zipEntry.component-meta.xml +++ b/dlrs/libs/metadataservice/components/zipEntry.component-meta.xml @@ -1,6 +1,6 @@ - 58.0 + 59.0 1 diff --git a/dlrs/main/aura/optimizer/optimizer.cmp-meta.xml b/dlrs/main/aura/optimizer/optimizer.cmp-meta.xml index ebc73acd..5f407995 100644 --- a/dlrs/main/aura/optimizer/optimizer.cmp-meta.xml +++ b/dlrs/main/aura/optimizer/optimizer.cmp-meta.xml @@ -3,6 +3,6 @@ xmlns="urn:metadata.tooling.soap.sforce.com" fqn="optimizer" > - 58.0 + 59.0 A Lightning Component Bundle diff --git a/dlrs/main/aura/optimizerNotification/optimizerNotification.cmp-meta.xml b/dlrs/main/aura/optimizerNotification/optimizerNotification.cmp-meta.xml index af18e04e..02e340ce 100644 --- a/dlrs/main/aura/optimizerNotification/optimizerNotification.cmp-meta.xml +++ b/dlrs/main/aura/optimizerNotification/optimizerNotification.cmp-meta.xml @@ -3,6 +3,6 @@ xmlns="urn:metadata.tooling.soap.sforce.com" fqn="optimizerNotification" > - 58.0 + 59.0 A Lightning Component Bundle diff --git a/dlrs/main/classes/ApexClassesSelector.cls-meta.xml b/dlrs/main/classes/ApexClassesSelector.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/ApexClassesSelector.cls-meta.xml +++ b/dlrs/main/classes/ApexClassesSelector.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/ApexTriggersSelector.cls-meta.xml b/dlrs/main/classes/ApexTriggersSelector.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/ApexTriggersSelector.cls-meta.xml +++ b/dlrs/main/classes/ApexTriggersSelector.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/AsyncApexJobsSelector.cls-meta.xml b/dlrs/main/classes/AsyncApexJobsSelector.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/AsyncApexJobsSelector.cls-meta.xml +++ b/dlrs/main/classes/AsyncApexJobsSelector.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/BypassHandler.cls-meta.xml b/dlrs/main/classes/BypassHandler.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/BypassHandler.cls-meta.xml +++ b/dlrs/main/classes/BypassHandler.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/BypassHandlerTest.cls-meta.xml b/dlrs/main/classes/BypassHandlerTest.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/BypassHandlerTest.cls-meta.xml +++ b/dlrs/main/classes/BypassHandlerTest.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/CronJobDetailsSelector.cls-meta.xml b/dlrs/main/classes/CronJobDetailsSelector.cls-meta.xml index d72639ce..c22c6e28 100644 --- a/dlrs/main/classes/CronJobDetailsSelector.cls-meta.xml +++ b/dlrs/main/classes/CronJobDetailsSelector.cls-meta.xml @@ -3,6 +3,6 @@ xmlns="urn:metadata.tooling.soap.sforce.com" fqn="CronJobDetailsSelector" > - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/CronTriggersSelector.cls-meta.xml b/dlrs/main/classes/CronTriggersSelector.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/CronTriggersSelector.cls-meta.xml +++ b/dlrs/main/classes/CronTriggersSelector.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/CustomMetadataService.cls-meta.xml b/dlrs/main/classes/CustomMetadataService.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/CustomMetadataService.cls-meta.xml +++ b/dlrs/main/classes/CustomMetadataService.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/CustomMetadataServiceTest.cls-meta.xml b/dlrs/main/classes/CustomMetadataServiceTest.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/CustomMetadataServiceTest.cls-meta.xml +++ b/dlrs/main/classes/CustomMetadataServiceTest.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/MLRSControllerTest.cls-meta.xml b/dlrs/main/classes/MLRSControllerTest.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/MLRSControllerTest.cls-meta.xml +++ b/dlrs/main/classes/MLRSControllerTest.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/ManageLookupRollupSummariesController.cls-meta.xml b/dlrs/main/classes/ManageLookupRollupSummariesController.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/ManageLookupRollupSummariesController.cls-meta.xml +++ b/dlrs/main/classes/ManageLookupRollupSummariesController.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/ManageLookupRollupSummariesNewController.cls-meta.xml b/dlrs/main/classes/ManageLookupRollupSummariesNewController.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/ManageLookupRollupSummariesNewController.cls-meta.xml +++ b/dlrs/main/classes/ManageLookupRollupSummariesNewController.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/ManageLookupRollupSummariesNewTest.cls-meta.xml b/dlrs/main/classes/ManageLookupRollupSummariesNewTest.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/ManageLookupRollupSummariesNewTest.cls-meta.xml +++ b/dlrs/main/classes/ManageLookupRollupSummariesNewTest.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/MetadataServiceCalloutMock.cls-meta.xml b/dlrs/main/classes/MetadataServiceCalloutMock.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/MetadataServiceCalloutMock.cls-meta.xml +++ b/dlrs/main/classes/MetadataServiceCalloutMock.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/OptimizerComponentController.cls-meta.xml b/dlrs/main/classes/OptimizerComponentController.cls-meta.xml index 9a9c13a3..f18591cd 100644 --- a/dlrs/main/classes/OptimizerComponentController.cls-meta.xml +++ b/dlrs/main/classes/OptimizerComponentController.cls-meta.xml @@ -3,6 +3,6 @@ xmlns="urn:metadata.tooling.soap.sforce.com" fqn="OptimizerComponentController" > - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/OptimizerService.cls-meta.xml b/dlrs/main/classes/OptimizerService.cls-meta.xml index cb7deda8..4645bafe 100644 --- a/dlrs/main/classes/OptimizerService.cls-meta.xml +++ b/dlrs/main/classes/OptimizerService.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/OptimizerServiceTest.cls-meta.xml b/dlrs/main/classes/OptimizerServiceTest.cls-meta.xml index 422b0dc1..7eae3e03 100644 --- a/dlrs/main/classes/OptimizerServiceTest.cls-meta.xml +++ b/dlrs/main/classes/OptimizerServiceTest.cls-meta.xml @@ -3,6 +3,6 @@ xmlns="urn:metadata.tooling.soap.sforce.com" fqn="OptimizerServiceTest" > - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/RollupActionCalculate.cls-meta.xml b/dlrs/main/classes/RollupActionCalculate.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/RollupActionCalculate.cls-meta.xml +++ b/dlrs/main/classes/RollupActionCalculate.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/RollupActionCalculateTest.cls-meta.xml b/dlrs/main/classes/RollupActionCalculateTest.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/RollupActionCalculateTest.cls-meta.xml +++ b/dlrs/main/classes/RollupActionCalculateTest.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/RollupCalculateController.cls-meta.xml b/dlrs/main/classes/RollupCalculateController.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/RollupCalculateController.cls-meta.xml +++ b/dlrs/main/classes/RollupCalculateController.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/RollupCalculateControllerTest.cls-meta.xml b/dlrs/main/classes/RollupCalculateControllerTest.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/RollupCalculateControllerTest.cls-meta.xml +++ b/dlrs/main/classes/RollupCalculateControllerTest.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/RollupCalculateJob.cls-meta.xml b/dlrs/main/classes/RollupCalculateJob.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/RollupCalculateJob.cls-meta.xml +++ b/dlrs/main/classes/RollupCalculateJob.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/RollupCalculateJobSchedulable.cls-meta.xml b/dlrs/main/classes/RollupCalculateJobSchedulable.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/RollupCalculateJobSchedulable.cls-meta.xml +++ b/dlrs/main/classes/RollupCalculateJobSchedulable.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/RollupController.cls b/dlrs/main/classes/RollupController.cls index 2eebad87..a88b159d 100644 --- a/dlrs/main/classes/RollupController.cls +++ b/dlrs/main/classes/RollupController.cls @@ -29,7 +29,7 @@ **/ public with sharing class RollupController { @TestVisible - private static String FALLBACK_COMPONENT_API_VERSION = '58.0'; + private static String FALLBACK_COMPONENT_API_VERSION = '59.0'; public String ZipData { get; set; } diff --git a/dlrs/main/classes/RollupController.cls-meta.xml b/dlrs/main/classes/RollupController.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/RollupController.cls-meta.xml +++ b/dlrs/main/classes/RollupController.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/RollupControllerTest.cls-meta.xml b/dlrs/main/classes/RollupControllerTest.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/RollupControllerTest.cls-meta.xml +++ b/dlrs/main/classes/RollupControllerTest.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/RollupDmlGuard.cls-meta.xml b/dlrs/main/classes/RollupDmlGuard.cls-meta.xml index 9bbf7b4e..019e8509 100644 --- a/dlrs/main/classes/RollupDmlGuard.cls-meta.xml +++ b/dlrs/main/classes/RollupDmlGuard.cls-meta.xml @@ -1,5 +1,5 @@ - 56.0 + 59.0 Active \ No newline at end of file diff --git a/dlrs/main/classes/RollupDmlGuardTest.cls-meta.xml b/dlrs/main/classes/RollupDmlGuardTest.cls-meta.xml index 9bbf7b4e..019e8509 100644 --- a/dlrs/main/classes/RollupDmlGuardTest.cls-meta.xml +++ b/dlrs/main/classes/RollupDmlGuardTest.cls-meta.xml @@ -1,5 +1,5 @@ - 56.0 + 59.0 Active \ No newline at end of file diff --git a/dlrs/main/classes/RollupJob.cls-meta.xml b/dlrs/main/classes/RollupJob.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/RollupJob.cls-meta.xml +++ b/dlrs/main/classes/RollupJob.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/RollupJobTest.cls-meta.xml b/dlrs/main/classes/RollupJobTest.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/RollupJobTest.cls-meta.xml +++ b/dlrs/main/classes/RollupJobTest.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/RollupScheduledCalculateController.cls-meta.xml b/dlrs/main/classes/RollupScheduledCalculateController.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/RollupScheduledCalculateController.cls-meta.xml +++ b/dlrs/main/classes/RollupScheduledCalculateController.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/RollupScheduledCalculateControllerTest.cls-meta.xml b/dlrs/main/classes/RollupScheduledCalculateControllerTest.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/RollupScheduledCalculateControllerTest.cls-meta.xml +++ b/dlrs/main/classes/RollupScheduledCalculateControllerTest.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/RollupService.cls-meta.xml b/dlrs/main/classes/RollupService.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/RollupService.cls-meta.xml +++ b/dlrs/main/classes/RollupService.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/RollupServiceException.cls-meta.xml b/dlrs/main/classes/RollupServiceException.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/RollupServiceException.cls-meta.xml +++ b/dlrs/main/classes/RollupServiceException.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/RollupServiceTest.cls-meta.xml b/dlrs/main/classes/RollupServiceTest.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/RollupServiceTest.cls-meta.xml +++ b/dlrs/main/classes/RollupServiceTest.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/RollupServiceTest2.cls-meta.xml b/dlrs/main/classes/RollupServiceTest2.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/RollupServiceTest2.cls-meta.xml +++ b/dlrs/main/classes/RollupServiceTest2.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/RollupServiceTest3.cls-meta.xml b/dlrs/main/classes/RollupServiceTest3.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/RollupServiceTest3.cls-meta.xml +++ b/dlrs/main/classes/RollupServiceTest3.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/RollupServiceTest4.cls-meta.xml b/dlrs/main/classes/RollupServiceTest4.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/RollupServiceTest4.cls-meta.xml +++ b/dlrs/main/classes/RollupServiceTest4.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/RollupServiceTest5.cls-meta.xml b/dlrs/main/classes/RollupServiceTest5.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/RollupServiceTest5.cls-meta.xml +++ b/dlrs/main/classes/RollupServiceTest5.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/RollupServiceTest6.cls-meta.xml b/dlrs/main/classes/RollupServiceTest6.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/RollupServiceTest6.cls-meta.xml +++ b/dlrs/main/classes/RollupServiceTest6.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/RollupSummaries.cls-meta.xml b/dlrs/main/classes/RollupSummaries.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/RollupSummaries.cls-meta.xml +++ b/dlrs/main/classes/RollupSummaries.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/RollupSummariesSelector.cls-meta.xml b/dlrs/main/classes/RollupSummariesSelector.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/RollupSummariesSelector.cls-meta.xml +++ b/dlrs/main/classes/RollupSummariesSelector.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/RollupSummariesSelectorTest.cls-meta.xml b/dlrs/main/classes/RollupSummariesSelectorTest.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/RollupSummariesSelectorTest.cls-meta.xml +++ b/dlrs/main/classes/RollupSummariesSelectorTest.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/RollupSummariesTest.cls-meta.xml b/dlrs/main/classes/RollupSummariesTest.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/RollupSummariesTest.cls-meta.xml +++ b/dlrs/main/classes/RollupSummariesTest.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/RollupSummary.cls-meta.xml b/dlrs/main/classes/RollupSummary.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/RollupSummary.cls-meta.xml +++ b/dlrs/main/classes/RollupSummary.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/RollupSummaryEnhancedController.cls-meta.xml b/dlrs/main/classes/RollupSummaryEnhancedController.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/RollupSummaryEnhancedController.cls-meta.xml +++ b/dlrs/main/classes/RollupSummaryEnhancedController.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/RollupSummaryEnhancedControllerTest.cls-meta.xml b/dlrs/main/classes/RollupSummaryEnhancedControllerTest.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/RollupSummaryEnhancedControllerTest.cls-meta.xml +++ b/dlrs/main/classes/RollupSummaryEnhancedControllerTest.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/RollupSummaryLogDeleteController.cls-meta.xml b/dlrs/main/classes/RollupSummaryLogDeleteController.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/RollupSummaryLogDeleteController.cls-meta.xml +++ b/dlrs/main/classes/RollupSummaryLogDeleteController.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/RollupSummaryLogDeleteControllerTest.cls-meta.xml b/dlrs/main/classes/RollupSummaryLogDeleteControllerTest.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/RollupSummaryLogDeleteControllerTest.cls-meta.xml +++ b/dlrs/main/classes/RollupSummaryLogDeleteControllerTest.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/RollupSummaryScheduleItemsSelector.cls-meta.xml b/dlrs/main/classes/RollupSummaryScheduleItemsSelector.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/RollupSummaryScheduleItemsSelector.cls-meta.xml +++ b/dlrs/main/classes/RollupSummaryScheduleItemsSelector.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/RollupSummaryViewController.cls-meta.xml b/dlrs/main/classes/RollupSummaryViewController.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/RollupSummaryViewController.cls-meta.xml +++ b/dlrs/main/classes/RollupSummaryViewController.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/RollupSummaryViewControllerTest.cls-meta.xml b/dlrs/main/classes/RollupSummaryViewControllerTest.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/RollupSummaryViewControllerTest.cls-meta.xml +++ b/dlrs/main/classes/RollupSummaryViewControllerTest.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/TestContext.cls-meta.xml b/dlrs/main/classes/TestContext.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/TestContext.cls-meta.xml +++ b/dlrs/main/classes/TestContext.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/Utilities.cls-meta.xml b/dlrs/main/classes/Utilities.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/Utilities.cls-meta.xml +++ b/dlrs/main/classes/Utilities.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/WelcomeController.cls-meta.xml b/dlrs/main/classes/WelcomeController.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/WelcomeController.cls-meta.xml +++ b/dlrs/main/classes/WelcomeController.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/classes/WelcomeControllerTest.cls-meta.xml b/dlrs/main/classes/WelcomeControllerTest.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/dlrs/main/classes/WelcomeControllerTest.cls-meta.xml +++ b/dlrs/main/classes/WelcomeControllerTest.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/dlrs/main/pages/RollupSummaryView.page-meta.xml b/dlrs/main/pages/RollupSummaryView.page-meta.xml index b85f9c48..197f558b 100644 --- a/dlrs/main/pages/RollupSummaryView.page-meta.xml +++ b/dlrs/main/pages/RollupSummaryView.page-meta.xml @@ -1,6 +1,6 @@ - 58.0 + 59.0 false false diff --git a/dlrs/main/pages/managelookuprollupsummaries.page-meta.xml b/dlrs/main/pages/managelookuprollupsummaries.page-meta.xml index b4586a94..e82ad01b 100644 --- a/dlrs/main/pages/managelookuprollupsummaries.page-meta.xml +++ b/dlrs/main/pages/managelookuprollupsummaries.page-meta.xml @@ -1,6 +1,6 @@ - 58.0 + 59.0 false false diff --git a/dlrs/main/pages/managelookuprollupsummaries_New.page-meta.xml b/dlrs/main/pages/managelookuprollupsummaries_New.page-meta.xml index 3b628f2f..3c5fd22d 100644 --- a/dlrs/main/pages/managelookuprollupsummaries_New.page-meta.xml +++ b/dlrs/main/pages/managelookuprollupsummaries_New.page-meta.xml @@ -1,6 +1,6 @@ - 58.0 + 59.0 true false diff --git a/dlrs/main/pages/managetrigger.page-meta.xml b/dlrs/main/pages/managetrigger.page-meta.xml index e8bf8131..57ed3f83 100644 --- a/dlrs/main/pages/managetrigger.page-meta.xml +++ b/dlrs/main/pages/managetrigger.page-meta.xml @@ -1,6 +1,6 @@ - 58.0 + 59.0 false false diff --git a/dlrs/main/pages/managetriggermdt.page-meta.xml b/dlrs/main/pages/managetriggermdt.page-meta.xml index 19176041..4d6957d1 100644 --- a/dlrs/main/pages/managetriggermdt.page-meta.xml +++ b/dlrs/main/pages/managetriggermdt.page-meta.xml @@ -1,6 +1,6 @@ - 58.0 + 59.0 false false diff --git a/dlrs/main/pages/rollupcalculate.page-meta.xml b/dlrs/main/pages/rollupcalculate.page-meta.xml index 91e63d13..d383cb4b 100644 --- a/dlrs/main/pages/rollupcalculate.page-meta.xml +++ b/dlrs/main/pages/rollupcalculate.page-meta.xml @@ -1,6 +1,6 @@ - 58.0 + 59.0 false false diff --git a/dlrs/main/pages/rollupcalculatemdt.page-meta.xml b/dlrs/main/pages/rollupcalculatemdt.page-meta.xml index e739c8a5..c6ff022e 100644 --- a/dlrs/main/pages/rollupcalculatemdt.page-meta.xml +++ b/dlrs/main/pages/rollupcalculatemdt.page-meta.xml @@ -1,6 +1,6 @@ - 58.0 + 59.0 false false diff --git a/dlrs/main/pages/rollupscheduledcalculate.page-meta.xml b/dlrs/main/pages/rollupscheduledcalculate.page-meta.xml index 5a18a339..6238f026 100644 --- a/dlrs/main/pages/rollupscheduledcalculate.page-meta.xml +++ b/dlrs/main/pages/rollupscheduledcalculate.page-meta.xml @@ -1,6 +1,6 @@ - 58.0 + 59.0 false false diff --git a/dlrs/main/pages/rollupscheduledcalculatemdt.page-meta.xml b/dlrs/main/pages/rollupscheduledcalculatemdt.page-meta.xml index ef3cb31c..16d0190b 100644 --- a/dlrs/main/pages/rollupscheduledcalculatemdt.page-meta.xml +++ b/dlrs/main/pages/rollupscheduledcalculatemdt.page-meta.xml @@ -1,6 +1,6 @@ - 58.0 + 59.0 false false diff --git a/dlrs/main/pages/rollupsummaryenhanced.page-meta.xml b/dlrs/main/pages/rollupsummaryenhanced.page-meta.xml index f5f39eb7..6687554e 100644 --- a/dlrs/main/pages/rollupsummaryenhanced.page-meta.xml +++ b/dlrs/main/pages/rollupsummaryenhanced.page-meta.xml @@ -1,6 +1,6 @@ - 58.0 + 59.0 false false diff --git a/dlrs/main/pages/rollupsummaryenhancednew.page-meta.xml b/dlrs/main/pages/rollupsummaryenhancednew.page-meta.xml index 5ed2c892..e5198e10 100644 --- a/dlrs/main/pages/rollupsummaryenhancednew.page-meta.xml +++ b/dlrs/main/pages/rollupsummaryenhancednew.page-meta.xml @@ -1,6 +1,6 @@ - 58.0 + 59.0 false false diff --git a/dlrs/main/pages/rollupsummarylogdelete.page-meta.xml b/dlrs/main/pages/rollupsummarylogdelete.page-meta.xml index 80586c59..295f583c 100644 --- a/dlrs/main/pages/rollupsummarylogdelete.page-meta.xml +++ b/dlrs/main/pages/rollupsummarylogdelete.page-meta.xml @@ -1,6 +1,6 @@ - 58.0 + 59.0 false false diff --git a/dlrs/main/pages/welcome.page-meta.xml b/dlrs/main/pages/welcome.page-meta.xml index ee86e7e5..0481a4b6 100644 --- a/dlrs/main/pages/welcome.page-meta.xml +++ b/dlrs/main/pages/welcome.page-meta.xml @@ -1,6 +1,6 @@ - 58.0 + 59.0 false false diff --git a/dlrs/main/pages/welcometab.page-meta.xml b/dlrs/main/pages/welcometab.page-meta.xml index 1f52136e..0b640a4a 100644 --- a/dlrs/main/pages/welcometab.page-meta.xml +++ b/dlrs/main/pages/welcometab.page-meta.xml @@ -1,6 +1,6 @@ - 58.0 + 59.0 false false diff --git a/dlrs/main/triggers/RollupSummariesTrigger.trigger-meta.xml b/dlrs/main/triggers/RollupSummariesTrigger.trigger-meta.xml index 28c22eae..26b9451d 100644 --- a/dlrs/main/triggers/RollupSummariesTrigger.trigger-meta.xml +++ b/dlrs/main/triggers/RollupSummariesTrigger.trigger-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/sfdx-project.json b/sfdx-project.json index ae40d13d..9d200aeb 100644 --- a/sfdx-project.json +++ b/sfdx-project.json @@ -28,5 +28,5 @@ ], "namespace": "dlrs", "sfdcLoginUrl": "https://login.salesforce.com", - "sourceApiVersion": "58.0" + "sourceApiVersion": "59.0" } diff --git a/unpackaged/config/qa/classes/QAHelper.cls-meta.xml b/unpackaged/config/qa/classes/QAHelper.cls-meta.xml index 133fce1e..c14e405d 100644 --- a/unpackaged/config/qa/classes/QAHelper.cls-meta.xml +++ b/unpackaged/config/qa/classes/QAHelper.cls-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/unpackaged/config/test_triggers/triggers/UnpackagedRollupServiceTest2Trigger.trigger-meta.xml b/unpackaged/config/test_triggers/triggers/UnpackagedRollupServiceTest2Trigger.trigger-meta.xml index 28c22eae..26b9451d 100644 --- a/unpackaged/config/test_triggers/triggers/UnpackagedRollupServiceTest2Trigger.trigger-meta.xml +++ b/unpackaged/config/test_triggers/triggers/UnpackagedRollupServiceTest2Trigger.trigger-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/unpackaged/config/test_triggers/triggers/UnpackagedRollupServiceTest3Trigger.trigger-meta.xml b/unpackaged/config/test_triggers/triggers/UnpackagedRollupServiceTest3Trigger.trigger-meta.xml index 28c22eae..26b9451d 100644 --- a/unpackaged/config/test_triggers/triggers/UnpackagedRollupServiceTest3Trigger.trigger-meta.xml +++ b/unpackaged/config/test_triggers/triggers/UnpackagedRollupServiceTest3Trigger.trigger-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/unpackaged/config/test_triggers/triggers/UnpackagedRollupServiceTest4Trigger.trigger-meta.xml b/unpackaged/config/test_triggers/triggers/UnpackagedRollupServiceTest4Trigger.trigger-meta.xml index 28c22eae..26b9451d 100644 --- a/unpackaged/config/test_triggers/triggers/UnpackagedRollupServiceTest4Trigger.trigger-meta.xml +++ b/unpackaged/config/test_triggers/triggers/UnpackagedRollupServiceTest4Trigger.trigger-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/unpackaged/config/test_triggers/triggers/UnpackagedRollupServiceTest5Trigger.trigger-meta.xml b/unpackaged/config/test_triggers/triggers/UnpackagedRollupServiceTest5Trigger.trigger-meta.xml index 28c22eae..26b9451d 100644 --- a/unpackaged/config/test_triggers/triggers/UnpackagedRollupServiceTest5Trigger.trigger-meta.xml +++ b/unpackaged/config/test_triggers/triggers/UnpackagedRollupServiceTest5Trigger.trigger-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active diff --git a/unpackaged/config/test_triggers/triggers/UnpackagedRollupServiceTestTrigger.trigger-meta.xml b/unpackaged/config/test_triggers/triggers/UnpackagedRollupServiceTestTrigger.trigger-meta.xml index 28c22eae..26b9451d 100644 --- a/unpackaged/config/test_triggers/triggers/UnpackagedRollupServiceTestTrigger.trigger-meta.xml +++ b/unpackaged/config/test_triggers/triggers/UnpackagedRollupServiceTestTrigger.trigger-meta.xml @@ -1,5 +1,5 @@ - 58.0 + 59.0 Active From eca4314bfe62a6afba77bce1e6c190150ed6d7f5 Mon Sep 17 00:00:00 2001 From: Heber Date: Wed, 10 Jan 2024 10:29:44 -0700 Subject: [PATCH 025/130] Merge in improvements from ah branch --- dlrs/main/classes/CustomMetadataService.cls | 44 ++-- .../LookupRollupStatusCheckController.cls | 146 ++++++------ dlrs/main/classes/RollupEditorController.cls | 16 +- .../autocompleteCombobox.html | 211 +++++++++++------- .../autocompleteCombobox.js | 51 ++--- .../main/lwc/manageRollups/manageRollups.html | 2 +- .../main/lwc/objectSelector/objectSelector.js | 3 +- dlrs/main/lwc/rollupEditor/rollupEditor.html | 38 ++-- dlrs/main/lwc/rollupEditor/rollupEditor.js | 102 +++++---- .../rollupEditorError/rollupEditorError.html | 14 +- .../rollupEditorError/rollupEditorError.js | 4 + .../rollupStatusCheck/rollupStatusCheck.html | 211 +++++++++--------- 12 files changed, 452 insertions(+), 390 deletions(-) diff --git a/dlrs/main/classes/CustomMetadataService.cls b/dlrs/main/classes/CustomMetadataService.cls index 1aa1ed97..f9e97b9e 100644 --- a/dlrs/main/classes/CustomMetadataService.cls +++ b/dlrs/main/classes/CustomMetadataService.cls @@ -115,8 +115,8 @@ public class CustomMetadataService { for (String customMetadataFullName : customMetadataFullNames) qualifiedFullNames.add( qualifiedMetadataType.getDescribe().getName() + - '.' + - customMetadataFullName + '.' + + customMetadataFullName ); List results = service.deleteMetadata( 'CustomMetadata', @@ -211,20 +211,20 @@ public class CustomMetadataService { List messages = new List(); messages.add( (saveResult.errors.size() == 1 ? 'Error ' : 'Errors ') + - 'occured processing component ' + - saveResult.fullName + - '.' + 'occured processing component ' + + saveResult.fullName + + '.' ); for (MetadataService.Error error : saveResult.errors) messages.add( error.message + - ' (' + - error.statusCode + - ').' + - (error.fields != null && - error.fields.size() > 0 - ? ' Fields ' + String.join(error.fields, ',') + '.' - : '') + ' (' + + error.statusCode + + ').' + + (error.fields != null && + error.fields.size() > 0 + ? ' Fields ' + String.join(error.fields, ',') + '.' + : '') ); if (messages.size() > 0) throw new CustomMetadataServiceException(String.join(messages, ' ')); @@ -249,20 +249,20 @@ public class CustomMetadataService { List messages = new List(); messages.add( (deleteResult.errors.size() == 1 ? 'Error ' : 'Errors ') + - 'occured processing component ' + - deleteResult.fullName + - '.' + 'occured processing component ' + + deleteResult.fullName + + '.' ); for (MetadataService.Error error : deleteResult.errors) messages.add( error.message + - ' (' + - error.statusCode + - ').' + - (error.fields != null && - error.fields.size() > 0 - ? ' Fields ' + String.join(error.fields, ',') + '.' - : '') + ' (' + + error.statusCode + + ').' + + (error.fields != null && + error.fields.size() > 0 + ? ' Fields ' + String.join(error.fields, ',') + '.' + : '') ); if (messages.size() > 0) throw new CustomMetadataServiceException(String.join(messages, ' ')); diff --git a/dlrs/main/classes/LookupRollupStatusCheckController.cls b/dlrs/main/classes/LookupRollupStatusCheckController.cls index eec73fbd..101fee63 100644 --- a/dlrs/main/classes/LookupRollupStatusCheckController.cls +++ b/dlrs/main/classes/LookupRollupStatusCheckController.cls @@ -60,30 +60,30 @@ public with sharing class LookupRollupStatusCheckController { */ @AuraEnabled(Cacheable=true) public static String getScheduledFullCalculates(String lookupID) { - try{ - LookupRollupSummary = (LookupRollupSummary2__mdt) new RollupSummariesSelector.CustomMetadataSelector( - false, - true - ) - .selectById(new Set{ lookupID })[0] - .Record; - - if (LookupRollupSummary == null) { + try { + LookupRollupSummary = (LookupRollupSummary2__mdt) new RollupSummariesSelector.CustomMetadataSelector( + false, + true + ) + .selectById(new Set{ lookupID })[0] + .Record; + + if (LookupRollupSummary == null) { + return 'No Schedule for Rollup'; + } + + String id = (LookupRollupSummary.id).to15(); + List ct = new CronTriggersSelector() + .selectScheduledApexById(id); + + if (ct.isEmpty()) { + return 'No Schedule for Rollup'; + } else { + return ct[0].NextFireTime.format(); + } + } catch (Exception e) { return 'No Schedule for Rollup'; } - - String id = (LookupRollupSummary.id).to15(); - List ct = new CronTriggersSelector() - .selectScheduledApexById(id); - - if (ct.isEmpty()) { - return 'No Schedule for Rollup'; - } else { - return ct[0].NextFireTime.format(); - } - }catch (Exception e){ - return 'No Schedule for Rollup'; - } } /** @@ -91,65 +91,65 @@ public with sharing class LookupRollupStatusCheckController { */ @AuraEnabled(Cacheable=true) public static String hasChildTriggerDeployed(String lookupID) { - try{ - LookupRollupSummary = (LookupRollupSummary2__mdt) new RollupSummariesSelector.CustomMetadataSelector( - false, - true - ) - .selectById(new Set{ lookupID })[0] - .Record; - - if (LookupRollupSummary == null) { - return 'Not Deployed'; - } - - RollupSummary rs = new RollupSummary(LookupRollupSummary); - String childTrigger = RollupSummaries.makeTriggerName(rs); - ApexTriggersSelector selector = new ApexTriggersSelector(); - Map loadTriggers = selector.selectByName( - new Set{ ChildTrigger } - ); - - if (loadTriggers.size() == 0) { + try { + LookupRollupSummary = (LookupRollupSummary2__mdt) new RollupSummariesSelector.CustomMetadataSelector( + false, + true + ) + .selectById(new Set{ lookupID })[0] + .Record; + + if (LookupRollupSummary == null) { + return 'Not Deployed'; + } + + RollupSummary rs = new RollupSummary(LookupRollupSummary); + String childTrigger = RollupSummaries.makeTriggerName(rs); + ApexTriggersSelector selector = new ApexTriggersSelector(); + Map loadTriggers = selector.selectByName( + new Set{ ChildTrigger } + ); + + if (loadTriggers.size() == 0) { + return 'Not Deployed'; + } + + return 'Deployed'; + } catch (Exception e) { return 'Not Deployed'; } - - return 'Deployed'; - } catch (Exception e){ - return 'Not Deployed'; } -} @AuraEnabled(Cacheable=true) public static String hasParentTriggerDeployed(String lookupID) { - try{ - LookupRollupSummary = (LookupRollupSummary2__mdt) new RollupSummariesSelector.CustomMetadataSelector( - false, - true - ) - .selectById(new Set{ lookupID })[0] - .Record; - - if (LookupRollupSummary == null) { - return 'Not Deployed'; - } - - RollupSummary rs = new RollupSummary(LookupRollupSummary); - String parentTrigger = RollupSummaries.makeParentTriggerName(rs); - ApexTriggersSelector selector = new ApexTriggersSelector(); - Map loadTriggers = selector.selectByName( - new Set{ ParentTrigger } - ); - - if (loadTriggers.size() == 0) { + try { + LookupRollupSummary = (LookupRollupSummary2__mdt) new RollupSummariesSelector.CustomMetadataSelector( + false, + true + ) + .selectById(new Set{ lookupID })[0] + .Record; + + if (LookupRollupSummary == null) { + return 'Not Deployed'; + } + + RollupSummary rs = new RollupSummary(LookupRollupSummary); + String parentTrigger = RollupSummaries.makeParentTriggerName(rs); + ApexTriggersSelector selector = new ApexTriggersSelector(); + Map loadTriggers = selector.selectByName( + new Set{ ParentTrigger } + ); + + if (loadTriggers.size() == 0) { + return 'Not Deployed'; + } + + return 'Deployed'; + } catch (Exception e) { return 'Not Deployed'; } - - return 'Deployed'; - } catch (Exception e){ - return 'Not Deployed'; } -} /* * Rollup - General Status Information @@ -181,7 +181,7 @@ public with sharing class LookupRollupStatusCheckController { AND ApexClass.name LIKE '%RollupJob%' ]; - if(countScheduled == 0) { + if (countScheduled == 0) { return 'RollupJob is not scheduled'; } diff --git a/dlrs/main/classes/RollupEditorController.cls b/dlrs/main/classes/RollupEditorController.cls index a7ef81eb..0ae34965 100644 --- a/dlrs/main/classes/RollupEditorController.cls +++ b/dlrs/main/classes/RollupEditorController.cls @@ -14,9 +14,7 @@ public with sharing class RollupEditorController { .Record; } - public class SelectOption { - @AuraEnabled public String value; @@ -29,19 +27,18 @@ public with sharing class RollupEditorController { @AuraEnabled public String type; - public SelectOption(String value, String label){ + public SelectOption(String value, String label) { this.value = value; this.label = label; } - } @AuraEnabled - public static List getFieldOptions(String objectName){ - Map mapOfFields = Schema.getGlobalDescribe() - .get(objectName) - .getDescribe() - .fields.getMap(); + public static List getFieldOptions(String objectName) { + Map mapOfFields = Schema.getGlobalDescribe() + .get(objectName) + .getDescribe() + .fields.getMap(); SelectOption emptyOption = new SelectOption('', '-- Select --'); @@ -61,7 +58,6 @@ public with sharing class RollupEditorController { return options; } - /** * returns a map of fieldname => list to use in displaying error in the UI * general errors are applied to the 'record' field name diff --git a/dlrs/main/lwc/autocompleteCombobox/autocompleteCombobox.html b/dlrs/main/lwc/autocompleteCombobox/autocompleteCombobox.html index 0d0f939c..ed432a3f 100644 --- a/dlrs/main/lwc/autocompleteCombobox/autocompleteCombobox.html +++ b/dlrs/main/lwc/autocompleteCombobox/autocompleteCombobox.html @@ -1,92 +1,145 @@ \ No newline at end of file +
+

+ diff --git a/dlrs/main/lwc/autocompleteCombobox/autocompleteCombobox.js b/dlrs/main/lwc/autocompleteCombobox/autocompleteCombobox.js index 2d3b84c6..dace4c8b 100644 --- a/dlrs/main/lwc/autocompleteCombobox/autocompleteCombobox.js +++ b/dlrs/main/lwc/autocompleteCombobox/autocompleteCombobox.js @@ -24,7 +24,6 @@ export default class AutocompleteCombobox extends LightningElement { this.showSearchInput(); } } - _firstTimeSetOptions = true; @track filteredOptions = []; _options = []; @@ -44,10 +43,8 @@ export default class AutocompleteCombobox extends LightningElement { this.showSearchInput(); } } - @track isLoading = false; @track searchKey = ""; - get styleClassCombobox() { let styleClass = "slds-combobox__form-element slds-input-has-icon slds-input-has-icon_left-right"; @@ -59,9 +56,7 @@ export default class AutocompleteCombobox extends LightningElement { } return styleClass; } - // *** EVENT METHODS *** - onToggleDropdown(event) { const targetDataSource = event.target.getAttribute("data-source"); const lookupInputContainer = this.template.querySelector( @@ -80,7 +75,6 @@ export default class AutocompleteCombobox extends LightningElement { break; } } - onChangeSearchKey(event) { // Debouncing this method: Do not update the reactive property as long as this function is // being called within a delay of DELAY. This is to avoid a very large number of Apex method calls. @@ -93,14 +87,12 @@ export default class AutocompleteCombobox extends LightningElement { this.isLoading = false; }, DELAY); } - onSelectOption(event) { this._value = event.target.getAttribute("data-name"); this.selectOptionByValue(); this.showSelectionInput(); this.dispatchSelectionEvent(); } - // method to clear selected lookup record onRemoveSelection() { this._value = ""; @@ -110,9 +102,7 @@ export default class AutocompleteCombobox extends LightningElement { this.showSearchInput(); this.dispatchSelectionEvent(); } - // *** CONTROLLER - filterOptions(searchKey) { try { const lowerCaseSearchKey = searchKey.toLowerCase(); @@ -126,8 +116,12 @@ export default class AutocompleteCombobox extends LightningElement { this.filteredOptions = this._options; } } - selectOptionByValue() { + if (!this._value) { + this.selectedOptions = {}; + this.searchKey = ""; + return; + } try { const lowerCaseValue = this._value.toLowerCase(); this.selectedOption = this._options.find((option) => { @@ -139,44 +133,47 @@ export default class AutocompleteCombobox extends LightningElement { this.searchKey = ""; } } - dispatchSelectionEvent() { const _event = new CustomEvent("changeselection", { detail: { selectedOption: this.selectedOption } }); this.dispatchEvent(_event); } - // *** UI HELPER *** - showSelectionInput() { try { if (!this.selectedOption.value) return; const inputElement = this.template.querySelector(".lookupInputContainer"); - inputElement.classList.remove("slds-is-open"); - + if (inputElement) { + inputElement.classList.remove("slds-is-open"); + } const searchBoxWrapper = this.template.querySelector(".searchBoxWrapper"); - searchBoxWrapper.classList.remove("slds-show"); - searchBoxWrapper.classList.add("slds-hide"); - + if (searchBoxWrapper) { + searchBoxWrapper.classList.remove("slds-show"); + searchBoxWrapper.classList.add("slds-hide"); + } const pillDiv = this.template.querySelector(".pillDiv"); - pillDiv.classList.remove("slds-hide"); - pillDiv.classList.add("slds-show"); + if (pillDiv) { + pillDiv.classList.remove("slds-hide"); + pillDiv.classList.add("slds-show"); + } } catch (err) { console.log(err); } } - showSearchInput() { try { // remove selected pill and display input field again const searchBoxWrapper = this.template.querySelector(".searchBoxWrapper"); - searchBoxWrapper.classList.remove("slds-hide"); - searchBoxWrapper.classList.add("slds-show"); - + if (searchBoxWrapper) { + searchBoxWrapper.classList.remove("slds-hide"); + searchBoxWrapper.classList.add("slds-show"); + } const pillDiv = this.template.querySelector(".pillDiv"); - pillDiv.classList.remove("slds-show"); - pillDiv.classList.add("slds-hide"); + if (pillDiv) { + pillDiv.classList.remove("slds-show"); + pillDiv.classList.add("slds-hide"); + } } catch (error) { console.log(error); } diff --git a/dlrs/main/lwc/manageRollups/manageRollups.html b/dlrs/main/lwc/manageRollups/manageRollups.html index 0ae25618..3fe66639 100644 --- a/dlrs/main/lwc/manageRollups/manageRollups.html +++ b/dlrs/main/lwc/manageRollups/manageRollups.html @@ -5,7 +5,7 @@
- -
- +
-
-
- + + > @@ -461,7 +464,9 @@

-
+
@@ -716,5 +721,4 @@

- diff --git a/dlrs/main/lwc/rollupEditor/rollupEditor.js b/dlrs/main/lwc/rollupEditor/rollupEditor.js index 2165f59a..16a18318 100644 --- a/dlrs/main/lwc/rollupEditor/rollupEditor.js +++ b/dlrs/main/lwc/rollupEditor/rollupEditor.js @@ -29,27 +29,21 @@ export default class RollupEditor extends LightningElement { set rollupName(val) { this.errors = {}; // clear any existing error this._rollupName = val; - - this.getRollup() - .then(() => { - this.getRelationshipFieldOptions(this.rollup.ParentObject__c) - .then(res =>{ - this.parentRFieldOptions = res; - }) - this.getRelationshipFieldOptions(this.rollup.ChildObject__c) - .then(res =>{ - this.childRFieldOptions = res; - }) - }) + this.getRollup(); } + get cardHeader() { + return this.rollup.DeveloperName + ? this.rollup.DeveloperName + : "Lookup Rollup Summary Creation Wizard"; + } - get cardHeader(){ - return this.rollup.DeveloperName ? this.rollup.DeveloperName : 'Lookup Rollup Summary Creation Wizard' + get saveButtonLabel() { + return this.rollup.Id ? "Save" : "Create"; } - get saveButtonLabel(){ - return this.rollup.Id ? 'Save' : 'Create' + async connectedCallback() { + await this.getRollup(); } get rollupCanBeActivated() { @@ -63,14 +57,40 @@ export default class RollupEditor extends LightningElement { async getRollup() { if (!this.rollupName) { this.rollup = this.DEFAULT_ROLLUP_VALUES; - return; + } else { + try { + this.rollup = await getRollupConfig({ + rollupName: this.rollupName + }); + } catch (error) { + this.errors.record = [error.message]; + } } - try { - this.rollup = await getRollupConfig({ - rollupName: this.rollupName + await this.getRelationshipFieldOptions(); + } + + async getRelationshipFieldOptions() { + await this.getParentRelationshipFieldOptions(); + await this.getChildRelationshipFieldOptions(); + } + + async getParentRelationshipFieldOptions() { + if (this.rollup.ParentObject__c) { + this.parentRFieldOptions = await getFieldOptions({ + objectName: this.rollup.ParentObject__c + }); + } else { + this.parentRFieldOptions = []; + } + } + + async getChildRelationshipFieldOptions() { + if (this.rollup.ChildObject__c) { + this.childRFieldOptions = await getFieldOptions({ + objectName: this.rollup.ChildObject__c }); - } catch (error) { - this.errors.record = [error.message]; + } else { + this.childRFieldOptions = []; } } @@ -107,6 +127,21 @@ export default class RollupEditor extends LightningElement { this.runSave(); } + onLabelBlurHandler(event) { + const devNameElem = this.template.querySelector( + '[data-name="rollup_DeveloperName"]' + ); + if (!devNameElem || devNameElem.value.trim().length > 0) { + return; + } + this.rollup.DeveloperName = this._makeApiSafe(event.currentTarget.value); + devNameElem.value = this.rollup.DeveloperName; + } + + _makeApiSafe(val) { + return val.replace(/^([0-9])/, "X$1").replace(/[^0-9a-zA-Z]+/g, "_"); + } + async runSave() { this.isLoading = true; this.assembleRollupFromForm(); @@ -172,29 +207,12 @@ export default class RollupEditor extends LightningElement { childObjectSelected(event) { this.rollup.ChildObject__c = event.detail.selectedRecord; - this.getRelationshipFieldOptions(this.rollup.ChildObject__c) - .then(res => { this.childRFieldOptions = res; }); + this.getChildRelationshipFieldOptions(); } + parentObjectSelected(event) { this.rollup.ParentObject__c = event.detail.selectedRecord; - this.getRelationshipFieldOptions(this.rollup.ParentObject__c) - .then(res => { this.parentRFieldOptions = res; }); - } - - getRelationshipFieldOptions(objectName){ - return new Promise((resolve) => { - if(!objectName || objectName.trim().length === 0) resolve([]) - else { - getFieldOptions({ objectName: objectName }) - .then(res => { - resolve(res); - }).catch(err => { - console.log(`Error in Get Field Options of ${objectName}: `); - console.error(err); - resolve([]); - }) - } - }) + this.getParentRelationshipFieldOptions(); } get rollupAsString() { diff --git a/dlrs/main/lwc/rollupEditorError/rollupEditorError.html b/dlrs/main/lwc/rollupEditorError/rollupEditorError.html index 17dee7d0..95fe5130 100644 --- a/dlrs/main/lwc/rollupEditorError/rollupEditorError.html +++ b/dlrs/main/lwc/rollupEditorError/rollupEditorError.html @@ -1,11 +1,7 @@ diff --git a/dlrs/main/lwc/rollupEditorError/rollupEditorError.js b/dlrs/main/lwc/rollupEditorError/rollupEditorError.js index 7d55e5e0..adc71a92 100644 --- a/dlrs/main/lwc/rollupEditorError/rollupEditorError.js +++ b/dlrs/main/lwc/rollupEditorError/rollupEditorError.js @@ -3,4 +3,8 @@ import { LightningElement, api } from "lwc"; export default class RollupEditorError extends LightningElement { @api errors; + + get hasErrors() { + return !!this.errors; + } } diff --git a/dlrs/main/lwc/rollupStatusCheck/rollupStatusCheck.html b/dlrs/main/lwc/rollupStatusCheck/rollupStatusCheck.html index 03e38560..edb81043 100644 --- a/dlrs/main/lwc/rollupStatusCheck/rollupStatusCheck.html +++ b/dlrs/main/lwc/rollupStatusCheck/rollupStatusCheck.html @@ -1,127 +1,120 @@ \ No newline at end of file +
+ From 140d13469a62cfae7fcf156a43fe87a12b0d1f8d Mon Sep 17 00:00:00 2001 From: Heber Date: Wed, 10 Jan 2024 16:10:07 -0700 Subject: [PATCH 026/130] Restore base components to editor --- dlrs/main/lwc/rollupEditor/rollupEditor.html | 1133 +++++++----------- dlrs/main/lwc/rollupEditor/rollupEditor.js | 48 +- 2 files changed, 434 insertions(+), 747 deletions(-) diff --git a/dlrs/main/lwc/rollupEditor/rollupEditor.html b/dlrs/main/lwc/rollupEditor/rollupEditor.html index ee3bc96a..8119648c 100644 --- a/dlrs/main/lwc/rollupEditor/rollupEditor.html +++ b/dlrs/main/lwc/rollupEditor/rollupEditor.html @@ -1,724 +1,433 @@ diff --git a/dlrs/main/lwc/rollupEditor/rollupEditor.js b/dlrs/main/lwc/rollupEditor/rollupEditor.js index 16a18318..483fda06 100644 --- a/dlrs/main/lwc/rollupEditor/rollupEditor.js +++ b/dlrs/main/lwc/rollupEditor/rollupEditor.js @@ -5,11 +5,21 @@ import validateRollupConfig from "@salesforce/apex/RollupEditorController.valida import saveRollupConfig from "@salesforce/apex/RollupEditorController.saveRollupConfig"; import getFieldOptions from "@salesforce/apex/RollupEditorController.getFieldOptions"; +const DEFAULT_ROLLUP_VALUES = { Active__c: false }; + export default class RollupEditor extends LightningElement { isLoading = false; - DEFAULT_ROLLUP_VALUES = { Active__c: false }; + + openAccordianSections = [ + "Information", + "Objects", + "Relationship", + "RollupDetails", + "CalculationMode" + ]; + @track - rollup = this.DEFAULT_ROLLUP_VALUES; + rollup = DEFAULT_ROLLUP_VALUES; errors = {}; @track @@ -56,7 +66,7 @@ export default class RollupEditor extends LightningElement { async getRollup() { if (!this.rollupName) { - this.rollup = this.DEFAULT_ROLLUP_VALUES; + this.rollup = DEFAULT_ROLLUP_VALUES; } else { try { this.rollup = await getRollupConfig({ @@ -215,14 +225,6 @@ export default class RollupEditor extends LightningElement { this.getParentRelationshipFieldOptions(); } - get rollupAsString() { - return JSON.stringify(this.rollup, null, 2); - } - - get errorsAsString() { - return JSON.stringify(this.errors); - } - get aggregateOptions() { return [ { label: "Sum", value: "Sum" }, @@ -253,28 +255,4 @@ export default class RollupEditor extends LightningElement { { label: "System", value: "System" } ]; } - - onToggleSection(event) { - const sectionName = event.currentTarget.getAttribute("data-section-button"); - const element = this.template.querySelector( - `[data-section-name="${sectionName}"]` - ); - const expandClass = "slds-is-open"; - if (element.className.includes(expandClass)) { - element.className = element.className.replace(expandClass, ""); - } else { - element.className += " " + expandClass; - } - } - - onToggleButtonGroupList() { - const elementName = "expandable-button-list"; - const element = this.template.querySelector(`[data-name="${elementName}"]`); - const expandClass = "slds-is-open"; - if (element.className.includes(expandClass)) { - element.className = element.className.replace(expandClass, ""); - } else { - element.className += " " + expandClass; - } - } } From 8147cadb0cb14211001f9cbaa592980c1a0b3bbd Mon Sep 17 00:00:00 2001 From: Heber Date: Fri, 12 Jan 2024 11:10:08 -0700 Subject: [PATCH 027/130] Cleanup rollup check and integrate --- .../LookupRollupStatusCheckController.cls | 124 +++++---------- dlrs/main/lwc/manageRollups/manageRollups.js | 6 - dlrs/main/lwc/rollupEditor/rollupEditor.html | 26 +++- .../rollupStatusCheck/rollupStatusCheck.html | 143 +++--------------- .../rollupStatusCheck/rollupStatusCheck.js | 45 ++++-- 5 files changed, 116 insertions(+), 228 deletions(-) diff --git a/dlrs/main/classes/LookupRollupStatusCheckController.cls b/dlrs/main/classes/LookupRollupStatusCheckController.cls index 101fee63..01d6d745 100644 --- a/dlrs/main/classes/LookupRollupStatusCheckController.cls +++ b/dlrs/main/classes/LookupRollupStatusCheckController.cls @@ -3,42 +3,29 @@ public with sharing class LookupRollupStatusCheckController { public static LookupRollupSummary2__mdt LookupRollupSummary; public static List rollups; public static Map mapRollups; - public static String test = 'test123'; /** * Check if the rollup has any error logs */ @AuraEnabled(Cacheable=true) public static Integer getAssociatedErrorLogs(String lookupID) { - Integer count = [ + return [ SELECT COUNT() FROM LookupRollupSummaryLog__c WHERE ParentId__c = :lookupID ]; - - return count; } /** * Check if the rollup has a failed calculate rollup jobs */ @AuraEnabled(Cacheable=true) - public static String getCalculateJobs(String lookupID) { - Integer count = [ + public static Integer getCalculateJobs(String lookupID) { + return [ SELECT COUNT() FROM LookupRollupCalculateJob__c WHERE LookupRollupSummaryId__c = :lookupID ]; - - if (count == 0) { - return 'No Calculate Jobs'; - } - - if (count > 0) { - return 'Calculate Jobs'; - } - - return 'No Calculate Jobs'; } /** @@ -46,20 +33,18 @@ public with sharing class LookupRollupStatusCheckController { */ @AuraEnabled(Cacheable=true) public static Integer getSpecificScheduledItems(String lookupID) { - Integer count = [ + return [ SELECT COUNT() FROM LookupRollupSummaryScheduleItems__c WHERE LookupRollupSummary2__c = :lookupID ]; - - return count; } /** * Check if the rollup has a Full Calculate schedule */ @AuraEnabled(Cacheable=true) - public static String getScheduledFullCalculates(String lookupID) { + public static Datetime getScheduledFullCalculates(String lookupID) { try { LookupRollupSummary = (LookupRollupSummary2__mdt) new RollupSummariesSelector.CustomMetadataSelector( false, @@ -68,29 +53,25 @@ public with sharing class LookupRollupStatusCheckController { .selectById(new Set{ lookupID })[0] .Record; - if (LookupRollupSummary == null) { - return 'No Schedule for Rollup'; - } - - String id = (LookupRollupSummary.id).to15(); - List ct = new CronTriggersSelector() - .selectScheduledApexById(id); + if (LookupRollupSummary != null) { + String id = (LookupRollupSummary.id).to15(); + List ct = new CronTriggersSelector() + .selectScheduledApexById(id); - if (ct.isEmpty()) { - return 'No Schedule for Rollup'; - } else { - return ct[0].NextFireTime.format(); + if (!ct.isEmpty()) { + return ct[0].NextFireTime; + } } } catch (Exception e) { - return 'No Schedule for Rollup'; } + return null; } /** * Check if the rollup has a child/parent trigger */ @AuraEnabled(Cacheable=true) - public static String hasChildTriggerDeployed(String lookupID) { + public static Boolean hasChildTriggerDeployed(String lookupID) { try { LookupRollupSummary = (LookupRollupSummary2__mdt) new RollupSummariesSelector.CustomMetadataSelector( false, @@ -99,29 +80,25 @@ public with sharing class LookupRollupStatusCheckController { .selectById(new Set{ lookupID })[0] .Record; - if (LookupRollupSummary == null) { - return 'Not Deployed'; - } - - RollupSummary rs = new RollupSummary(LookupRollupSummary); - String childTrigger = RollupSummaries.makeTriggerName(rs); - ApexTriggersSelector selector = new ApexTriggersSelector(); - Map loadTriggers = selector.selectByName( - new Set{ ChildTrigger } - ); - - if (loadTriggers.size() == 0) { - return 'Not Deployed'; + if (LookupRollupSummary != null) { + RollupSummary rs = new RollupSummary(LookupRollupSummary); + String childTrigger = RollupSummaries.makeTriggerName(rs); + ApexTriggersSelector selector = new ApexTriggersSelector(); + Map loadTriggers = selector.selectByName( + new Set{ ChildTrigger } + ); + + if (loadTriggers.size() > 0) { + return true; + } } - - return 'Deployed'; } catch (Exception e) { - return 'Not Deployed'; } + return false; } @AuraEnabled(Cacheable=true) - public static String hasParentTriggerDeployed(String lookupID) { + public static Boolean hasParentTriggerDeployed(String lookupID) { try { LookupRollupSummary = (LookupRollupSummary2__mdt) new RollupSummariesSelector.CustomMetadataSelector( false, @@ -130,25 +107,21 @@ public with sharing class LookupRollupStatusCheckController { .selectById(new Set{ lookupID })[0] .Record; - if (LookupRollupSummary == null) { - return 'Not Deployed'; - } - - RollupSummary rs = new RollupSummary(LookupRollupSummary); - String parentTrigger = RollupSummaries.makeParentTriggerName(rs); - ApexTriggersSelector selector = new ApexTriggersSelector(); - Map loadTriggers = selector.selectByName( - new Set{ ParentTrigger } - ); - - if (loadTriggers.size() == 0) { - return 'Not Deployed'; + if (LookupRollupSummary != null) { + RollupSummary rs = new RollupSummary(LookupRollupSummary); + String parentTrigger = RollupSummaries.makeParentTriggerName(rs); + ApexTriggersSelector selector = new ApexTriggersSelector(); + Map loadTriggers = selector.selectByName( + new Set{ ParentTrigger } + ); + + if (loadTriggers.size() > 0) { + return true; + } } - - return 'Deployed'; } catch (Exception e) { - return 'Not Deployed'; } + return false; } /* @@ -161,18 +134,16 @@ public with sharing class LookupRollupStatusCheckController { */ @AuraEnabled(Cacheable=true) public static Integer getAllScheduledItems() { - Integer count = [SELECT COUNT() FROM LookupRollupSummaryScheduleItems__c]; - - return count; + return [SELECT COUNT() FROM LookupRollupSummaryScheduleItems__c]; } /** * Check if cron job is running for DLRS */ @AuraEnabled(Cacheable=true) - public static String getScheduledJobs() { + public static Integer getScheduledJobs() { // Check if RollupJob is scheduled - Integer countScheduled = [ + return [ SELECT COUNT() FROM AsyncApexJob WHERE @@ -180,16 +151,5 @@ public with sharing class LookupRollupStatusCheckController { AND status = 'Queued' AND ApexClass.name LIKE '%RollupJob%' ]; - - if (countScheduled == 0) { - return 'RollupJob is not scheduled'; - } - - //No need to warn user if scheduled items are going to be processed - if (countScheduled > 0) { - return 'RollupJob is scheduled'; - } - - return 'RollupJob is not scheduled'; } } diff --git a/dlrs/main/lwc/manageRollups/manageRollups.js b/dlrs/main/lwc/manageRollups/manageRollups.js index 7eb83050..d7d1aa5c 100644 --- a/dlrs/main/lwc/manageRollups/manageRollups.js +++ b/dlrs/main/lwc/manageRollups/manageRollups.js @@ -145,12 +145,6 @@ export default class ManageRollups extends LightningElement { this.requestDelete(event.detail.rollupName); } - //////////////////// - // Tracks changes to channelName text field - handleChannelName(event) { - this.channelName = event.target.value; - } - disconnectedCallback() { this.handleUnsubscribe(); } diff --git a/dlrs/main/lwc/rollupEditor/rollupEditor.html b/dlrs/main/lwc/rollupEditor/rollupEditor.html index 8119648c..9929b2a0 100644 --- a/dlrs/main/lwc/rollupEditor/rollupEditor.html +++ b/dlrs/main/lwc/rollupEditor/rollupEditor.html @@ -36,7 +36,14 @@
- + + + + + + + + + + + -

+

Pick the Parent object you want to roll up to, and then the Child object that you want to roll up from

@@ -202,7 +217,7 @@ > -

+

Select what field you want to rollup, the type of rollup, and what field on the Parent object to store the result.

@@ -425,9 +440,4 @@

Aggregate All Rows

- - - - - diff --git a/dlrs/main/lwc/rollupStatusCheck/rollupStatusCheck.html b/dlrs/main/lwc/rollupStatusCheck/rollupStatusCheck.html index edb81043..da653c53 100644 --- a/dlrs/main/lwc/rollupStatusCheck/rollupStatusCheck.html +++ b/dlrs/main/lwc/rollupStatusCheck/rollupStatusCheck.html @@ -1,120 +1,27 @@ diff --git a/dlrs/main/lwc/rollupStatusCheck/rollupStatusCheck.js b/dlrs/main/lwc/rollupStatusCheck/rollupStatusCheck.js index 7a5bef70..b164b84e 100644 --- a/dlrs/main/lwc/rollupStatusCheck/rollupStatusCheck.js +++ b/dlrs/main/lwc/rollupStatusCheck/rollupStatusCheck.js @@ -11,9 +11,6 @@ import getScheduledJobs from "@salesforce/apex/LookupRollupStatusCheckController const mockLookupRollupSummary2 = ""; export default class rollupStatusCheck extends LightningElement { - // Khang Ly contribute - header = "Status Check"; - lookupID; // General status check variables @@ -21,12 +18,12 @@ export default class rollupStatusCheck extends LightningElement { recordCountAll = "0"; // Rollup Specific Status Check Variables - recordCount = "0"; - nextFullCalculateDate = "NA"; - triggerCount = "0"; - parentTrigger = "NA"; - childTrigger = "NA"; - calculateJobError = "No Errors Found"; + recordCount = 0; + nextFullCalculateDate; + triggerCount = 0; + parentTrigger = false; + childTrigger = false; + calculateJobErrors = 0; // Error Handling error = []; @@ -48,10 +45,31 @@ export default class rollupStatusCheck extends LightningElement { this._name = value; } + get nextFullCalculateAt() { + if (this.nextFullCalculateDate) { + return this.nextFullCalculateDate; + } + return "Not Scheduled"; + } + + get parentTriggerStatus() { + if (this.parentTrigger) { + return "Deployed"; + } + return "Not Deployed"; + } + + get childTriggerStatus() { + if (this.childTrigger) { + return "Deployed"; + } + return "Not Deployed"; + } + // Method to check if there are any failed calculate jobs for the specific rollup @wire(getCalculateJobs, { lookupID: "$_name" }) wiredGetCalculateJobs({ error, data }) { - this.handleApexResponse(data, error, "calculateJobError"); + this.handleApexResponse(data, error, "calculateJobErrors"); } // Method to check if there are any scheduled full calculates for the specific rollup @@ -101,12 +119,11 @@ export default class rollupStatusCheck extends LightningElement { // *** Utility *** handleApexResponse(data, error, propertyName) { - if (data) { - console.log(propertyName + "- data: " + data); - this[propertyName] = data; - } else if (error) { + if (error) { console.log(propertyName + "- error: " + error); this.error.push(error); } + console.log(propertyName + "- data: " + data); + this[propertyName] = data; } } From f2bacee21823e0530bd64352ef08ade853f9a59a Mon Sep 17 00:00:00 2001 From: Heber Date: Sun, 21 Jan 2024 13:31:56 -0700 Subject: [PATCH 028/130] WIP changing layout, adding path --- dlrs/main/classes/RollupEditorController.cls | 14 +- .../__tests__/flexiblePath.test.js | 25 +++ dlrs/main/lwc/flexiblePath/flexiblePath.css | 3 + dlrs/main/lwc/flexiblePath/flexiblePath.html | 105 ++++++++++ dlrs/main/lwc/flexiblePath/flexiblePath.js | 43 +++++ .../lwc/flexiblePath/flexiblePath.js-meta.xml | 5 + dlrs/main/lwc/manageRollups/manageRollups.css | 3 + .../main/lwc/manageRollups/manageRollups.html | 19 +- dlrs/main/lwc/manageRollups/manageRollups.js | 36 +++- .../main/lwc/objectSelector/objectSelector.js | 4 + dlrs/main/lwc/rollupEditor/rollupEditor.html | 181 ++++++++++-------- dlrs/main/lwc/rollupEditor/rollupEditor.js | 43 ++++- 12 files changed, 385 insertions(+), 96 deletions(-) create mode 100644 dlrs/main/lwc/flexiblePath/__tests__/flexiblePath.test.js create mode 100644 dlrs/main/lwc/flexiblePath/flexiblePath.css create mode 100644 dlrs/main/lwc/flexiblePath/flexiblePath.html create mode 100644 dlrs/main/lwc/flexiblePath/flexiblePath.js create mode 100644 dlrs/main/lwc/flexiblePath/flexiblePath.js-meta.xml create mode 100644 dlrs/main/lwc/manageRollups/manageRollups.css diff --git a/dlrs/main/classes/RollupEditorController.cls b/dlrs/main/classes/RollupEditorController.cls index 0ae34965..fd399dcd 100644 --- a/dlrs/main/classes/RollupEditorController.cls +++ b/dlrs/main/classes/RollupEditorController.cls @@ -27,9 +27,13 @@ public with sharing class RollupEditorController { @AuraEnabled public String type; + @AuraEnabled + public List referencesTo; + public SelectOption(String value, String label) { this.value = value; this.label = label; + this.referencesTo = new List(); } } @@ -50,8 +54,16 @@ public with sharing class RollupEditorController { String fieldName = fr.getName(); String label = fr.getLabel(); - SelectOption option = new SelectOption(fieldName, label); + SelectOption option = new SelectOption( + fieldName, + String.format('{0} ({1})', new List{ label, fieldName }) + ); option.type = String.valueof(fr.getType()); + List types = fr.getReferenceTo(); + // if this fields points to a single SObject, pass that up + for (Schema.sObjectType t : types) { + option.referencesTo.add(types[0].getDescribe().getName()); + } options.add(option); } diff --git a/dlrs/main/lwc/flexiblePath/__tests__/flexiblePath.test.js b/dlrs/main/lwc/flexiblePath/__tests__/flexiblePath.test.js new file mode 100644 index 00000000..4e62098d --- /dev/null +++ b/dlrs/main/lwc/flexiblePath/__tests__/flexiblePath.test.js @@ -0,0 +1,25 @@ +import { createElement } from 'lwc'; +import FlexiblePath from 'c/flexiblePath'; + +describe('c-flexible-path', () => { + 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-flexible-path', { + is: FlexiblePath + }); + + // 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/dlrs/main/lwc/flexiblePath/flexiblePath.css b/dlrs/main/lwc/flexiblePath/flexiblePath.css new file mode 100644 index 00000000..eda2cc9a --- /dev/null +++ b/dlrs/main/lwc/flexiblePath/flexiblePath.css @@ -0,0 +1,3 @@ +* { + --slds-c-icon-color-foreground-default: white; +} diff --git a/dlrs/main/lwc/flexiblePath/flexiblePath.html b/dlrs/main/lwc/flexiblePath/flexiblePath.html new file mode 100644 index 00000000..9a677ba6 --- /dev/null +++ b/dlrs/main/lwc/flexiblePath/flexiblePath.html @@ -0,0 +1,105 @@ + diff --git a/dlrs/main/lwc/flexiblePath/flexiblePath.js b/dlrs/main/lwc/flexiblePath/flexiblePath.js new file mode 100644 index 00000000..ef8dcb9a --- /dev/null +++ b/dlrs/main/lwc/flexiblePath/flexiblePath.js @@ -0,0 +1,43 @@ +import { LightningElement, api } from "lwc"; + +/** + * @typedef step + * @property {string} label + * @property {"complete"|"current"|"incomplete"|"failed"} status + */ + +export default class FlexiblePath extends LightningElement { + /** @type {step[]} */ + @api + get steps() { + return this._steps; + } + + set steps(val) { + this._steps = val.map((v) => ({ + ...v, + ["is" + v.status.charAt(0).toUpperCase() + v.status.slice(1)]: true + })); + } + + get nextActionLabel() { + if (!this.steps) { + return "unknown"; + } + let nextLabel = this.steps.find((s) => s.status === "current")?.label; + if (!nextLabel) { + nextLabel = this.steps.find((s) => s.status === "incomplete")?.label; + } + return nextLabel; + } + + handleNextActionClick() { + this.dispatchEvent( + new CustomEvent("nextactionclick", { + detail: { + label: this.nextActionLabel + } + }) + ); + } +} diff --git a/dlrs/main/lwc/flexiblePath/flexiblePath.js-meta.xml b/dlrs/main/lwc/flexiblePath/flexiblePath.js-meta.xml new file mode 100644 index 00000000..6127d855 --- /dev/null +++ b/dlrs/main/lwc/flexiblePath/flexiblePath.js-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + false + \ No newline at end of file diff --git a/dlrs/main/lwc/manageRollups/manageRollups.css b/dlrs/main/lwc/manageRollups/manageRollups.css new file mode 100644 index 00000000..7660a111 --- /dev/null +++ b/dlrs/main/lwc/manageRollups/manageRollups.css @@ -0,0 +1,3 @@ +* { + transition: width 500ms; +} diff --git a/dlrs/main/lwc/manageRollups/manageRollups.html b/dlrs/main/lwc/manageRollups/manageRollups.html index 3fe66639..0e4b4764 100644 --- a/dlrs/main/lwc/manageRollups/manageRollups.html +++ b/dlrs/main/lwc/manageRollups/manageRollups.html @@ -1,7 +1,13 @@ diff --git a/dlrs/main/lwc/manageRollups/manageRollups.js b/dlrs/main/lwc/manageRollups/manageRollups.js index d7d1aa5c..906e37e0 100644 --- a/dlrs/main/lwc/manageRollups/manageRollups.js +++ b/dlrs/main/lwc/manageRollups/manageRollups.js @@ -57,6 +57,10 @@ export default class ManageRollups extends LightningElement { } ]; + editorWidth = 1; + tableWidth = 12; + showEditor = false; + // We only want events for which we've been assigned as the recipient channelName = `/event/UserNotification__e?Recipient__c='${USER_ID.substring( 1, @@ -104,9 +108,15 @@ export default class ManageRollups extends LightningElement { const row = event.detail.row; switch (action.name) { case "rollup_select": - this.template - .querySelector("c-rollup-editor") - .loadRollup(row.DeveloperName); + this.showEditor = true; + // eslint-disable-next-line @lwc/lwc/no-async-operation + setTimeout(() => { + this.template + .querySelector("c-rollup-editor") + .loadRollup(row.DeveloperName); + this.tableWidth = 6; + this.editorWidth = 6; + }, 0); break; case "rollup_delete": this.requestDelete(row.DeveloperName); @@ -134,6 +144,16 @@ export default class ManageRollups extends LightningElement { } } + runCreateNew() { + this.showEditor = true; + // eslint-disable-next-line @lwc/lwc/no-async-operation + setTimeout(() => { + this.template.querySelector("c-rollup-editor").loadRollup(null); + this.tableWidth = 6; + this.editorWidth = 6; + }, 0); + } + handleInputChange() { this.searchFilter = this.template .querySelector("lightning-input") @@ -145,6 +165,16 @@ export default class ManageRollups extends LightningElement { this.requestDelete(event.detail.rollupName); } + handleCancelRequest() { + this.tableWidth = 12; + this.editorWidth = 1; + + // eslint-disable-next-line @lwc/lwc/no-async-operation + setTimeout(() => { + this.showEditor = false; + }, 500); + } + disconnectedCallback() { this.handleUnsubscribe(); } diff --git a/dlrs/main/lwc/objectSelector/objectSelector.js b/dlrs/main/lwc/objectSelector/objectSelector.js index 4cb3ab53..6157370a 100644 --- a/dlrs/main/lwc/objectSelector/objectSelector.js +++ b/dlrs/main/lwc/objectSelector/objectSelector.js @@ -83,6 +83,10 @@ export default class ObjectSelector extends LightningElement { const matches = iconNameRegEx.exec(o.iconUrl); if (matches) { o.iconName = `${matches[1]}:${matches[2]}`; + // We just got a new icon for the selected image! + if (o.fullName === this._currentSelection) { + this.selectedRecordIconName = o.iconName; + } } } }); diff --git a/dlrs/main/lwc/rollupEditor/rollupEditor.html b/dlrs/main/lwc/rollupEditor/rollupEditor.html index 9929b2a0..9d9084fd 100644 --- a/dlrs/main/lwc/rollupEditor/rollupEditor.html +++ b/dlrs/main/lwc/rollupEditor/rollupEditor.html @@ -2,19 +2,20 @@
+ -
+ + + + + @@ -64,7 +73,6 @@ placeholder="My Rollup Name" value={rollup.Label} > - @@ -112,29 +120,27 @@ - - + +

- Pick the Parent object you want to roll up to, and then the - Child object that you want to roll up from + Pick the child object, the field that holds your data, and the + field that holds the reference to the parent.

-
- - + - -
- - - + + + + + +

+ Pick the parent object you want to roll up to and the field that + will hold the resulting value +

+
+
+ + + + + + + + + + + +
+ + -

- Select what field you want to rollup, the type of rollup, and - what field on the Parent object to store the result. -

+

Select the type and configuration of the rollup action

@@ -229,16 +278,21 @@ large-device-size="6" class="slds-form-element_stacked" > - +
+
+ - - - - Aggregate All Rows

type="checkbox" name="rollup_AggregateAllRows__c" data-name="rollup_AggregateAllRows__c" - label="Include Deleted & Archived" + label="Include Deleted & Archived Records" value={rollup.AggregateAllRows__c} > Aggregate All Rows >
- - - - - - Date: Tue, 23 Jan 2024 13:28:37 -0700 Subject: [PATCH 029/130] Add vf links --- dlrs/main/classes/RollupEditorController.cls | 21 ++++++ .../main/lwc/manageRollups/manageRollups.html | 13 +++- dlrs/main/lwc/manageRollups/manageRollups.js | 69 +++++++++++++++---- dlrs/main/lwc/rollupEditor/rollupEditor.html | 26 +++++-- dlrs/main/lwc/rollupEditor/rollupEditor.js | 43 +++++++++++- 5 files changed, 150 insertions(+), 22 deletions(-) diff --git a/dlrs/main/classes/RollupEditorController.cls b/dlrs/main/classes/RollupEditorController.cls index fd399dcd..f45ee30f 100644 --- a/dlrs/main/classes/RollupEditorController.cls +++ b/dlrs/main/classes/RollupEditorController.cls @@ -120,6 +120,27 @@ public with sharing class RollupEditorController { } } + @AuraEnabled(cacheable=true) + public static String getManageTriggerPageUrl(Id rollupId) { + PageReference pageRef = Page.managetriggermdt; + pageRef.getParameters().put('id', rollupId); + return pageRef.getUrl(); + } + + @AuraEnabled(cacheable=true) + public static String getFullCalculatePageUrl(Id rollupId) { + PageReference pageRef = Page.rollupcalculatemdt; + pageRef.getParameters().put('id', rollupId); + return pageRef.getUrl(); + } + + @AuraEnabled(cacheable=true) + public static String getScheduleCalculatePageUrl(Id rollupId) { + PageReference pageRef = Page.rollupscheduledcalculatemdt; + pageRef.getParameters().put('id', rollupId); + return pageRef.getUrl(); + } + private static Map> collectErrors(RollupSummary rollup) { Map> errorMap = new Map>(); if (rollup.Error != null) { diff --git a/dlrs/main/lwc/manageRollups/manageRollups.html b/dlrs/main/lwc/manageRollups/manageRollups.html index 0e4b4764..03f3fd2c 100644 --- a/dlrs/main/lwc/manageRollups/manageRollups.html +++ b/dlrs/main/lwc/manageRollups/manageRollups.html @@ -1,6 +1,12 @@