From d25e58af0536d74d4a8050a0e17947954067a934 Mon Sep 17 00:00:00 2001 From: Sz Date: Mon, 15 Jan 2024 13:13:39 +0000 Subject: [PATCH 01/21] Test Custom Field Checks --- .../objects/Account/fields/IsVIP__c.field-meta.xml | 10 ++++++++++ .../objects/Contact/fields/IsVIP__c.field-meta.xml | 10 ++++++++++ 2 files changed, 20 insertions(+) create mode 100644 force-app/main/default/objects/Account/fields/IsVIP__c.field-meta.xml create mode 100644 force-app/main/default/objects/Contact/fields/IsVIP__c.field-meta.xml diff --git a/force-app/main/default/objects/Account/fields/IsVIP__c.field-meta.xml b/force-app/main/default/objects/Account/fields/IsVIP__c.field-meta.xml new file mode 100644 index 0000000..af77786 --- /dev/null +++ b/force-app/main/default/objects/Account/fields/IsVIP__c.field-meta.xml @@ -0,0 +1,10 @@ + + + IsVIP__c + false + VIP is if VIP contacts exist + false + + false + Checkbox + diff --git a/force-app/main/default/objects/Contact/fields/IsVIP__c.field-meta.xml b/force-app/main/default/objects/Contact/fields/IsVIP__c.field-meta.xml new file mode 100644 index 0000000..436aa68 --- /dev/null +++ b/force-app/main/default/objects/Contact/fields/IsVIP__c.field-meta.xml @@ -0,0 +1,10 @@ + + + IsVIP__c + false + Will update Accounts VIP status + false + + false + Checkbox + From 11f40a09b5403c9c08aeca961b2b65b5ffb125a7 Mon Sep 17 00:00:00 2001 From: Szandor72 Date: Mon, 15 Jan 2024 13:23:19 +0000 Subject: [PATCH 02/21] Prettified Code! --- .../main/default/objects/Account/fields/IsVIP__c.field-meta.xml | 2 +- .../main/default/objects/Contact/fields/IsVIP__c.field-meta.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/force-app/main/default/objects/Account/fields/IsVIP__c.field-meta.xml b/force-app/main/default/objects/Account/fields/IsVIP__c.field-meta.xml index af77786..f50b43a 100644 --- a/force-app/main/default/objects/Account/fields/IsVIP__c.field-meta.xml +++ b/force-app/main/default/objects/Account/fields/IsVIP__c.field-meta.xml @@ -1,4 +1,4 @@ - + IsVIP__c false diff --git a/force-app/main/default/objects/Contact/fields/IsVIP__c.field-meta.xml b/force-app/main/default/objects/Contact/fields/IsVIP__c.field-meta.xml index 436aa68..79ba7ac 100644 --- a/force-app/main/default/objects/Contact/fields/IsVIP__c.field-meta.xml +++ b/force-app/main/default/objects/Contact/fields/IsVIP__c.field-meta.xml @@ -1,4 +1,4 @@ - + IsVIP__c false From cfbc1985138fe6150f21387bb325c53e6a2a03a6 Mon Sep 17 00:00:00 2001 From: Sz Date: Mon, 15 Jan 2024 13:26:13 +0000 Subject: [PATCH 03/21] This will not pass checks --- .../Contact/fields/Faulty_Url_Field__c.field-meta.xml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 force-app/main/default/objects/Contact/fields/Faulty_Url_Field__c.field-meta.xml diff --git a/force-app/main/default/objects/Contact/fields/Faulty_Url_Field__c.field-meta.xml b/force-app/main/default/objects/Contact/fields/Faulty_Url_Field__c.field-meta.xml new file mode 100644 index 0000000..3102a4d --- /dev/null +++ b/force-app/main/default/objects/Contact/fields/Faulty_Url_Field__c.field-meta.xml @@ -0,0 +1,9 @@ + + + Faulty_Url_Field__c + false + + false + false + Url + From b69bc42fafbc3b69149cf42c96e03ad7c66ee3a0 Mon Sep 17 00:00:00 2001 From: Sz Date: Mon, 15 Jan 2024 13:31:48 +0000 Subject: [PATCH 04/21] Should fail another check --- ...tom_Contact_Record_Page.flexipage-meta.xml | 177 ++++++++++++++++++ 1 file changed, 177 insertions(+) create mode 100644 force-app/main/default/flexipages/Custom_Contact_Record_Page.flexipage-meta.xml diff --git a/force-app/main/default/flexipages/Custom_Contact_Record_Page.flexipage-meta.xml b/force-app/main/default/flexipages/Custom_Contact_Record_Page.flexipage-meta.xml new file mode 100644 index 0000000..cd690cc --- /dev/null +++ b/force-app/main/default/flexipages/Custom_Contact_Record_Page.flexipage-meta.xml @@ -0,0 +1,177 @@ + + + + + + + collapsed + false + + + enableActionsConfiguration + false + + + enableActionsInNative + false + + + hideChatterActions + false + + + numVisibleActions + 3 + + force:highlightsPanel + force_highlightsPanel + + + Replace + header + Region + + + + + + displayOption + BOTH + + runtime_sales_merge:mergeCandidatesPreviewCard + runtime_sales_merge_mergeCandidatesPreviewCard + + + + + + relatedListComponentOverride + NONE + + + rowsToDisplay + 10 + + + showActionBar + true + + force:relatedListContainer + force_relatedListContainer + + + Replace + relatedTabContent + Facet + + + + + force:detailPanel + force_detailPanel + + + Replace + detailTabContent + Facet + + + + + runtime_sales_social:socialPanel + runtime_sales_social_socialPanel + + + Replace + newsTabContent + Facet + + + + + + active + true + + + body + relatedTabContent + + + title + Standard.Tab.relatedLists + + flexipage:tab + relatedListsTab + + + + + + body + detailTabContent + + + title + Standard.Tab.detail + + flexipage:tab + detailTab + + + + + + body + newsTabContent + + + title + Standard.Tab.news + + flexipage:tab + newsTab + + + Replace + maintabs + Facet + + + + + + tabs + maintabs + + flexipage:tabset + flexipage_tabset + + + Replace + main + Region + + + + + + showLegacyActivityComposer + false + + runtime_sales_activities:activityPanel + runtime_sales_activities_activityPanel + + + Replace + sidebar + Region + + Contact Record Page + sfa__Contact_rec_L + Contact + + RecordPage + From d1525684c14bf4d12365cd2fd824839048b758bd Mon Sep 17 00:00:00 2001 From: "Ch. Szandor Knapp" Date: Tue, 16 Jan 2024 11:35:14 +0100 Subject: [PATCH 05/21] chore: update tooling --- .ci/legacy-metadata-files.txt | 4 ++-- .gitignore | 1 + package-lock.json | 16 +++++++++------- package.json | 2 +- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.ci/legacy-metadata-files.txt b/.ci/legacy-metadata-files.txt index 32fcbac..efe599a 100644 --- a/.ci/legacy-metadata-files.txt +++ b/.ci/legacy-metadata-files.txt @@ -1,2 +1,2 @@ -force-app/main/default/classes/AccountService.cls -force-app/main/default/classes/AccountService.cls-meta.xml \ No newline at end of file +# Add all files the should be treated as legacy files here, e.g.: +# force-app\main\default\classes\ContentDocumentTriggerHandler.cls \ No newline at end of file diff --git a/.gitignore b/.gitignore index 4d90a71..73925e0 100644 --- a/.gitignore +++ b/.gitignore @@ -208,6 +208,7 @@ deploy-options.json **/lwc/.eslintrc.json jest.config.cjs .ci +package.xml # LWC VS Code autocomplete diff --git a/package-lock.json b/package-lock.json index abf3495..df5d474 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,7 @@ "@salesforce/eslint-plugin-aura": "^2.0.0", "@salesforce/eslint-plugin-lightning": "^1.0.0", "@salesforce/sfdx-lwc-jest": "^1.1.0", - "devops-center-local-config-files": "^1.2.0", + "devops-center-local-config-files": "^1.3.2", "eslint": "^8.11.0", "eslint-plugin-import": "^2.25.4", "eslint-plugin-jest": "^26.1.2", @@ -3662,11 +3662,12 @@ } }, "node_modules/devops-center-local-config-files": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/devops-center-local-config-files/-/devops-center-local-config-files-1.2.0.tgz", - "integrity": "sha512-oI5eamJvls8/MF/crRJ0U4Rz1O4R4c1o7Jb34iUTSEyZy9quom46DmUCKRVc8ZwJf84izig/DhEcZmIbg0oHcw==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/devops-center-local-config-files/-/devops-center-local-config-files-1.3.2.tgz", + "integrity": "sha512-946FvcCjkgbKqRKDfPUvrdDwzVUdp6mt5ITA0t6SJGMqGrbnSJLtiYZXVP4w3FJWCKubtlKSswDwWAv/XA/H7A==", "dev": true, "dependencies": { + "execa": "^5.1.1", "fs-extra": "^11.1.0" } }, @@ -13079,11 +13080,12 @@ "dev": true }, "devops-center-local-config-files": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/devops-center-local-config-files/-/devops-center-local-config-files-1.2.0.tgz", - "integrity": "sha512-oI5eamJvls8/MF/crRJ0U4Rz1O4R4c1o7Jb34iUTSEyZy9quom46DmUCKRVc8ZwJf84izig/DhEcZmIbg0oHcw==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/devops-center-local-config-files/-/devops-center-local-config-files-1.3.2.tgz", + "integrity": "sha512-946FvcCjkgbKqRKDfPUvrdDwzVUdp6mt5ITA0t6SJGMqGrbnSJLtiYZXVP4w3FJWCKubtlKSswDwWAv/XA/H7A==", "dev": true, "requires": { + "execa": "^5.1.1", "fs-extra": "^11.1.0" }, "dependencies": { diff --git a/package.json b/package.json index 5b532bf..b5404fd 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "@salesforce/eslint-plugin-aura": "^2.0.0", "@salesforce/eslint-plugin-lightning": "^1.0.0", "@salesforce/sfdx-lwc-jest": "^1.1.0", - "devops-center-local-config-files": "^1.2.0", + "devops-center-local-config-files": "^1.3.2", "eslint": "^8.11.0", "eslint-plugin-import": "^2.25.4", "eslint-plugin-jest": "^26.1.2", From 9c905d9dec85cd13ea3cbda146793e2524d6eca8 Mon Sep 17 00:00:00 2001 From: "Ch. Szandor Knapp" Date: Tue, 16 Jan 2024 12:40:47 +0100 Subject: [PATCH 06/21] chore: update tooling --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index df5d474..fd0cb90 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,7 @@ "@salesforce/eslint-plugin-aura": "^2.0.0", "@salesforce/eslint-plugin-lightning": "^1.0.0", "@salesforce/sfdx-lwc-jest": "^1.1.0", - "devops-center-local-config-files": "^1.3.2", + "devops-center-local-config-files": "^1.3.3", "eslint": "^8.11.0", "eslint-plugin-import": "^2.25.4", "eslint-plugin-jest": "^26.1.2", @@ -3662,9 +3662,9 @@ } }, "node_modules/devops-center-local-config-files": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/devops-center-local-config-files/-/devops-center-local-config-files-1.3.2.tgz", - "integrity": "sha512-946FvcCjkgbKqRKDfPUvrdDwzVUdp6mt5ITA0t6SJGMqGrbnSJLtiYZXVP4w3FJWCKubtlKSswDwWAv/XA/H7A==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/devops-center-local-config-files/-/devops-center-local-config-files-1.3.3.tgz", + "integrity": "sha512-+W38jFqoCxkeKDTcEcCVdsJ7L0PizqoC5V8pUy6A8II1NyC9Wt01IaDfREPZ1ou+z3Hs4SL881fmGYnsVZswPw==", "dev": true, "dependencies": { "execa": "^5.1.1", @@ -13080,9 +13080,9 @@ "dev": true }, "devops-center-local-config-files": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/devops-center-local-config-files/-/devops-center-local-config-files-1.3.2.tgz", - "integrity": "sha512-946FvcCjkgbKqRKDfPUvrdDwzVUdp6mt5ITA0t6SJGMqGrbnSJLtiYZXVP4w3FJWCKubtlKSswDwWAv/XA/H7A==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/devops-center-local-config-files/-/devops-center-local-config-files-1.3.3.tgz", + "integrity": "sha512-+W38jFqoCxkeKDTcEcCVdsJ7L0PizqoC5V8pUy6A8II1NyC9Wt01IaDfREPZ1ou+z3Hs4SL881fmGYnsVZswPw==", "dev": true, "requires": { "execa": "^5.1.1", diff --git a/package.json b/package.json index b5404fd..066324b 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "@salesforce/eslint-plugin-aura": "^2.0.0", "@salesforce/eslint-plugin-lightning": "^1.0.0", "@salesforce/sfdx-lwc-jest": "^1.1.0", - "devops-center-local-config-files": "^1.3.2", + "devops-center-local-config-files": "^1.3.3", "eslint": "^8.11.0", "eslint-plugin-import": "^2.25.4", "eslint-plugin-jest": "^26.1.2", From f9ec424b2f2cd385ab1dc697e6f50aa9de0af005 Mon Sep 17 00:00:00 2001 From: "Ch. Szandor Knapp" Date: Tue, 16 Jan 2024 13:10:37 +0100 Subject: [PATCH 07/21] chore: deps update --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index fd0cb90..1e8fb3c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,7 @@ "@salesforce/eslint-plugin-aura": "^2.0.0", "@salesforce/eslint-plugin-lightning": "^1.0.0", "@salesforce/sfdx-lwc-jest": "^1.1.0", - "devops-center-local-config-files": "^1.3.3", + "devops-center-local-config-files": "^1.3.4", "eslint": "^8.11.0", "eslint-plugin-import": "^2.25.4", "eslint-plugin-jest": "^26.1.2", @@ -3662,9 +3662,9 @@ } }, "node_modules/devops-center-local-config-files": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/devops-center-local-config-files/-/devops-center-local-config-files-1.3.3.tgz", - "integrity": "sha512-+W38jFqoCxkeKDTcEcCVdsJ7L0PizqoC5V8pUy6A8II1NyC9Wt01IaDfREPZ1ou+z3Hs4SL881fmGYnsVZswPw==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/devops-center-local-config-files/-/devops-center-local-config-files-1.3.4.tgz", + "integrity": "sha512-ntNYV0oyBxs/xAujvxMAO3lTxpvOFGgvXjA/n9H4b3TYz7AzHX0wP161iffYdapHzDSXoss5EDd2dLT4tAKarg==", "dev": true, "dependencies": { "execa": "^5.1.1", @@ -13080,9 +13080,9 @@ "dev": true }, "devops-center-local-config-files": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/devops-center-local-config-files/-/devops-center-local-config-files-1.3.3.tgz", - "integrity": "sha512-+W38jFqoCxkeKDTcEcCVdsJ7L0PizqoC5V8pUy6A8II1NyC9Wt01IaDfREPZ1ou+z3Hs4SL881fmGYnsVZswPw==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/devops-center-local-config-files/-/devops-center-local-config-files-1.3.4.tgz", + "integrity": "sha512-ntNYV0oyBxs/xAujvxMAO3lTxpvOFGgvXjA/n9H4b3TYz7AzHX0wP161iffYdapHzDSXoss5EDd2dLT4tAKarg==", "dev": true, "requires": { "execa": "^5.1.1", diff --git a/package.json b/package.json index 066324b..b1e4032 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "@salesforce/eslint-plugin-aura": "^2.0.0", "@salesforce/eslint-plugin-lightning": "^1.0.0", "@salesforce/sfdx-lwc-jest": "^1.1.0", - "devops-center-local-config-files": "^1.3.3", + "devops-center-local-config-files": "^1.3.4", "eslint": "^8.11.0", "eslint-plugin-import": "^2.25.4", "eslint-plugin-jest": "^26.1.2", From 1c01317b34330e860c881a10a91ad4650b676122 Mon Sep 17 00:00:00 2001 From: "Ch. Szandor Knapp" Date: Tue, 16 Jan 2024 13:43:03 +0100 Subject: [PATCH 08/21] chore: update legacy file list --- .ci/legacy-metadata-files.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.ci/legacy-metadata-files.txt b/.ci/legacy-metadata-files.txt index efe599a..032f281 100644 --- a/.ci/legacy-metadata-files.txt +++ b/.ci/legacy-metadata-files.txt @@ -1,2 +1,4 @@ # Add all files the should be treated as legacy files here, e.g.: -# force-app\main\default\classes\ContentDocumentTriggerHandler.cls \ No newline at end of file +# force-app\main\default\classes\ContentDocumentTriggerHandler.cls +force-app\main\default\objects\Contact\fields\Faulty_Url_Field__c.field-meta.xml +force-app\main\default\flexipages\Custom_Contact_Record_Page.flexipage-meta.xml \ No newline at end of file From 4c5ebd667344740356cc69ce934652a0eb5cf209 Mon Sep 17 00:00:00 2001 From: "Ch. Szandor Knapp" Date: Tue, 16 Jan 2024 13:53:34 +0100 Subject: [PATCH 09/21] chore: force build --- .ci/legacy-metadata-files.txt | 8 ++++---- .gitignore | 1 + .../Contact/fields/Faulty_Url_Field__c.field-meta.xml | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.ci/legacy-metadata-files.txt b/.ci/legacy-metadata-files.txt index 032f281..f949300 100644 --- a/.ci/legacy-metadata-files.txt +++ b/.ci/legacy-metadata-files.txt @@ -1,4 +1,4 @@ -# Add all files the should be treated as legacy files here, e.g.: -# force-app\main\default\classes\ContentDocumentTriggerHandler.cls -force-app\main\default\objects\Contact\fields\Faulty_Url_Field__c.field-meta.xml -force-app\main\default\flexipages\Custom_Contact_Record_Page.flexipage-meta.xml \ No newline at end of file +# Add all files that should be treated as legacy files here, e.g.: +# force-app/main/default/classes/ContentDocumentTriggerHandler.cls +force-app/main/default/objects/Contact/fields/Faulty_Url_Field__c.field-meta.xml +force-app/main/default/flexipages/Custom_Contact_Record_Page.flexipage-meta.xml \ No newline at end of file diff --git a/.gitignore b/.gitignore index 73925e0..b2bad52 100644 --- a/.gitignore +++ b/.gitignore @@ -207,6 +207,7 @@ deploy-options.json **/aura/.eslintrc.json **/lwc/.eslintrc.json jest.config.cjs +!.ci/legacy-metadata-files.txt .ci package.xml diff --git a/force-app/main/default/objects/Contact/fields/Faulty_Url_Field__c.field-meta.xml b/force-app/main/default/objects/Contact/fields/Faulty_Url_Field__c.field-meta.xml index 3102a4d..48114a2 100644 --- a/force-app/main/default/objects/Contact/fields/Faulty_Url_Field__c.field-meta.xml +++ b/force-app/main/default/objects/Contact/fields/Faulty_Url_Field__c.field-meta.xml @@ -1,8 +1,8 @@ - + Faulty_Url_Field__c false - + false false Url From 42fb2c3ff8d70dcaa6c3d176fadd54b233939b0b Mon Sep 17 00:00:00 2001 From: "Ch. Szandor Knapp" Date: Tue, 16 Jan 2024 14:02:24 +0100 Subject: [PATCH 10/21] feat: add flow --- .../flows/UpdateVIPStatus.flow-meta.xml | 194 ++++++++++++++++++ 1 file changed, 194 insertions(+) create mode 100644 force-app/main/default/flows/UpdateVIPStatus.flow-meta.xml diff --git a/force-app/main/default/flows/UpdateVIPStatus.flow-meta.xml b/force-app/main/default/flows/UpdateVIPStatus.flow-meta.xml new file mode 100644 index 0000000..9af8cd8 --- /dev/null +++ b/force-app/main/default/flows/UpdateVIPStatus.flow-meta.xml @@ -0,0 +1,194 @@ + + + 57.0 + + Account_is_VIP + + 50 + 815 + + GetAccount.IsVIP__c + Assign + + true + + + + UpdateAccountCheckbox + + + + ContactCountAssignment + + 314 + 575 + + NumberOfVIPContacts + AssignCount + + GetContacts + + + + Account_needs_update_if_VIP_Contacts + + + + IsNoVIP + + 314 + 815 + + GetAccount.IsVIP__c + Assign + + false + + + + UpdateAccountCheckbox + + + + Account_needs_update_if_VIP_Contacts + + 314 + 695 + Default Outcome + + AccountHasVIPContacts + and + + NumberOfVIPContacts + GreaterThan + + 0.0 + + + + Account_is_VIP + + + + + AccountHasNoVIPContacts + and + + NumberOfVIPContacts + EqualTo + + 0.0 + + + + IsNoVIP + + + + + Default + UpdateVIPStatus {!$Flow.CurrentDateTime} + + + BuilderType + + LightningFlowBuilder + + + + CanvasMode + + AUTO_LAYOUT_CANVAS + + + + OriginBuilderType + + LightningFlowBuilder + + + AutoLaunchedFlow + + GetAccount + + 314 + 455 + false + + ContactCountAssignment + + and + + Id + EqualTo + + $Record.AccountId + + + true + Account + true + + + GetContacts + + 314 + 335 + false + + GetAccount + + and + + IsVIP__c + EqualTo + + true + + + + AccountId + EqualTo + + $Record.Account.Id + + + false + Contact + true + + + UpdateAccountCheckbox + + 314 + 1031 + GetAccount + + + 188 + 0 + + GetContacts + + ISNEW() || ISCHANGED({!$Record.IsVIP__c}) + Contact + CreateAndUpdate + RecordAfterSave + + Active + + NumberOfVIPContacts + NumberOfVIPContacts + Number + false + false + false + 0 + + 0.0 + + + From e98c37718841f4b643c561052d6dc0cf7a555349 Mon Sep 17 00:00:00 2001 From: "Ch. Szandor Knapp" Date: Tue, 16 Jan 2024 15:08:02 +0100 Subject: [PATCH 11/21] chore: make build pass --- .ci/legacy-metadata-files.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.ci/legacy-metadata-files.txt b/.ci/legacy-metadata-files.txt index f949300..116a759 100644 --- a/.ci/legacy-metadata-files.txt +++ b/.ci/legacy-metadata-files.txt @@ -1,4 +1,5 @@ # Add all files that should be treated as legacy files here, e.g.: # force-app/main/default/classes/ContentDocumentTriggerHandler.cls force-app/main/default/objects/Contact/fields/Faulty_Url_Field__c.field-meta.xml -force-app/main/default/flexipages/Custom_Contact_Record_Page.flexipage-meta.xml \ No newline at end of file +force-app/main/default/flexipages/Custom_Contact_Record_Page.flexipage-meta.xml +force-app/main/default/flows/UpdateVIPStatus.flow-meta.xml \ No newline at end of file From 245f63876578d3accfa71051c99d3bbab7448a16 Mon Sep 17 00:00:00 2001 From: "Ch. Szandor Knapp" Date: Tue, 16 Jan 2024 15:09:57 +0100 Subject: [PATCH 12/21] chore: make build fail due to apex issues --- .../main/default/classes/AccountService.cls | 84 +++++++++++++++++++ .../classes/AccountService.cls-meta.xml | 5 ++ 2 files changed, 89 insertions(+) create mode 100644 force-app/main/default/classes/AccountService.cls create mode 100644 force-app/main/default/classes/AccountService.cls-meta.xml diff --git a/force-app/main/default/classes/AccountService.cls b/force-app/main/default/classes/AccountService.cls new file mode 100644 index 0000000..83cbfae --- /dev/null +++ b/force-app/main/default/classes/AccountService.cls @@ -0,0 +1,84 @@ +/** + * AccountService Class + * Provides various services related to Account object + */ +public class AccountService { + /** + * Fetches details for a given account + * @param accountId The ID of the account + * @return Account The details of the account + */ + public Account getAccDetails(Id accountId) { + // SOQL query inside a loop - bad practice + for (Id accId : new List{ accountId }) { + Account acc = [SELECT Id, Name, Industry FROM Account WHERE Id = :accId]; + return acc; + } + return null; + } + + public Account getAccDetails2(Id accountId) { + // SOQL query inside a loop - bad practice + for (Id accId : new List{ accountId }) { + Account acc = [SELECT Id, Name, Industry FROM Account WHERE Id = :accId]; + update acc; + return acc; + } + return null; + } + + // This method lacks ApexDocs + public void UpdateAccount(List accounts) { + // DML operation inside a loop - bad practice + for (Account acc : accounts) { + acc.Name += ' - Updated'; + update acc; // This should be done in bulk outside the loop + } + } + + /** + * Deletes a specified account + * @param accountId The ID of the account to be deleted + */ + public void delete_Account(Id accountId) { + // Hardcoding IDs - bad practice + Id hardCodedId = '001xx000003DGAXAA4'; + delete [SELECT Id FROM Account WHERE Id = :hardCodedId]; + } + + // This method lacks ApexDocs + public List ListAccounts() { + // Not using bulkified approach - bad practice + List accounts = [SELECT Id, Name FROM Account LIMIT 1]; + return accounts; + } + + /** + * Calculates the annual revenue + * - This ApexDoc is incomplete and lacks parameter description + * @return Decimal The calculated annual revenue + */ + public String CalculateAnnualRevenue() { + // Lack of null checks and exception handling - bad practice + Account acc = [ + SELECT Industry + FROM Account + WHERE Id = '001xx000003DGAZAA4' + ]; + return acc.Industry; + } + + // This method lacks ApexDocs + public List ListAccounts2() { + // Not using bulkified approach - bad practice + List accounts = [SELECT Id, Name FROM Account LIMIT 1]; + return accounts; + } + + // This method lacks ApexDocs + public List ListAccounts3() { + // Not using bulkified approach - bad practice + List accounts = [SELECT Id, Name FROM Account LIMIT 1]; + return accounts; + } +} diff --git a/force-app/main/default/classes/AccountService.cls-meta.xml b/force-app/main/default/classes/AccountService.cls-meta.xml new file mode 100644 index 0000000..c14e405 --- /dev/null +++ b/force-app/main/default/classes/AccountService.cls-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + Active + From b8a8c8ba817e8edbce52a1ee0a5ecc6d6b54ffca Mon Sep 17 00:00:00 2001 From: "Ch. Szandor Knapp" Date: Tue, 16 Jan 2024 15:12:50 +0100 Subject: [PATCH 13/21] chore: fail build due to apex --- .../flows/UpdateVIPStatus.flow-meta.xml | 2 +- sfdx-project.json | 20 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/force-app/main/default/flows/UpdateVIPStatus.flow-meta.xml b/force-app/main/default/flows/UpdateVIPStatus.flow-meta.xml index 9af8cd8..1de6964 100644 --- a/force-app/main/default/flows/UpdateVIPStatus.flow-meta.xml +++ b/force-app/main/default/flows/UpdateVIPStatus.flow-meta.xml @@ -1,6 +1,6 @@ - 57.0 + 59.0 Account_is_VIP diff --git a/sfdx-project.json b/sfdx-project.json index 87baa62..04191bb 100644 --- a/sfdx-project.json +++ b/sfdx-project.json @@ -1,12 +1,12 @@ { - "packageDirectories": [ - { - "path": "force-app", - "default": true - } - ], - "name": "default-scratch-org", - "namespace": "", - "sfdcLoginUrl": "https://login.salesforce.com", - "sourceApiVersion": "57.0" + "packageDirectories": [ + { + "path": "force-app", + "default": true + } + ], + "name": "default-scratch-org", + "namespace": "", + "sfdcLoginUrl": "https://login.salesforce.com", + "sourceApiVersion": "59.0" } From ea161d56c2e1b8a8f85733aaf070b9be3e2973e0 Mon Sep 17 00:00:00 2001 From: "Ch. Szandor Knapp" Date: Tue, 16 Jan 2024 15:17:19 +0100 Subject: [PATCH 14/21] chore: update tooling --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1e8fb3c..8deb47b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,7 @@ "@salesforce/eslint-plugin-aura": "^2.0.0", "@salesforce/eslint-plugin-lightning": "^1.0.0", "@salesforce/sfdx-lwc-jest": "^1.1.0", - "devops-center-local-config-files": "^1.3.4", + "devops-center-local-config-files": "^1.3.5", "eslint": "^8.11.0", "eslint-plugin-import": "^2.25.4", "eslint-plugin-jest": "^26.1.2", @@ -3662,9 +3662,9 @@ } }, "node_modules/devops-center-local-config-files": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/devops-center-local-config-files/-/devops-center-local-config-files-1.3.4.tgz", - "integrity": "sha512-ntNYV0oyBxs/xAujvxMAO3lTxpvOFGgvXjA/n9H4b3TYz7AzHX0wP161iffYdapHzDSXoss5EDd2dLT4tAKarg==", + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/devops-center-local-config-files/-/devops-center-local-config-files-1.3.5.tgz", + "integrity": "sha512-W1wDuH+972ODUrHsAys/+1CUKDyktMqwChzq5X7jbRc+4bQAOoMZn9QHMta+dhYtSxlPFzACFWX+1WcxUJtrGg==", "dev": true, "dependencies": { "execa": "^5.1.1", @@ -13080,9 +13080,9 @@ "dev": true }, "devops-center-local-config-files": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/devops-center-local-config-files/-/devops-center-local-config-files-1.3.4.tgz", - "integrity": "sha512-ntNYV0oyBxs/xAujvxMAO3lTxpvOFGgvXjA/n9H4b3TYz7AzHX0wP161iffYdapHzDSXoss5EDd2dLT4tAKarg==", + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/devops-center-local-config-files/-/devops-center-local-config-files-1.3.5.tgz", + "integrity": "sha512-W1wDuH+972ODUrHsAys/+1CUKDyktMqwChzq5X7jbRc+4bQAOoMZn9QHMta+dhYtSxlPFzACFWX+1WcxUJtrGg==", "dev": true, "requires": { "execa": "^5.1.1", diff --git a/package.json b/package.json index b1e4032..51508f5 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "@salesforce/eslint-plugin-aura": "^2.0.0", "@salesforce/eslint-plugin-lightning": "^1.0.0", "@salesforce/sfdx-lwc-jest": "^1.1.0", - "devops-center-local-config-files": "^1.3.4", + "devops-center-local-config-files": "^1.3.5", "eslint": "^8.11.0", "eslint-plugin-import": "^2.25.4", "eslint-plugin-jest": "^26.1.2", From 0ea2571f051f628d42b2f3cd1613834ac2522f26 Mon Sep 17 00:00:00 2001 From: "Ch. Szandor Knapp" Date: Tue, 16 Jan 2024 15:24:51 +0100 Subject: [PATCH 15/21] chore: prettify --- .github/workflows/validate-code.yml | 20 +-- .github/workflows/validate-deployment.yml | 20 +-- .github/workflows/validate-metadata.yml | 18 +-- config/project-scratch-def.json | 20 +-- demo-classes/AccountService.cls | 132 +++++++++--------- demo-classes/CaseService.cls | 14 +- .../classes/ContentDocumentTriggerHandler.cls | 114 +++++++-------- .../ContentDocumentTriggerHandlerTest.cls | 71 +++++----- ...tom_Contact_Record_Page.flexipage-meta.xml | 11 +- .../triggers/ContentDocumentTrigger.trigger | 4 +- 10 files changed, 221 insertions(+), 203 deletions(-) diff --git a/.github/workflows/validate-code.yml b/.github/workflows/validate-code.yml index b4bf5fe..2cf97d8 100644 --- a/.github/workflows/validate-code.yml +++ b/.github/workflows/validate-code.yml @@ -1,15 +1,15 @@ name: Code Scans with SFDX Scanner on: - pull_request: - types: [opened, synchronize, reopened] - branches: - - integration - paths: - - 'force-app/**' + pull_request: + types: [opened, synchronize, reopened] + branches: + - integration + paths: + - "force-app/**" jobs: - sfdx-scanner: - name: 'Validate Code' - uses: 'Szandor72/devops-center-actions/.github/workflows/validate-code.yml@main' - secrets: inherit + sfdx-scanner: + name: "Validate Code" + uses: "Szandor72/devops-center-actions/.github/workflows/validate-code.yml@main" + secrets: inherit diff --git a/.github/workflows/validate-deployment.yml b/.github/workflows/validate-deployment.yml index a95c4d0..f804a89 100644 --- a/.github/workflows/validate-deployment.yml +++ b/.github/workflows/validate-deployment.yml @@ -1,15 +1,15 @@ name: Validate Deployment on: - pull_request: - types: [opened, synchronize, reopened] - branches: - - integration - paths: - - 'force-app/**' + pull_request: + types: [opened, synchronize, reopened] + branches: + - integration + paths: + - "force-app/**" jobs: - validate-deployment: - name: 'SFDX Scanner' - uses: 'Szandor72/devops-center-actions/.github/workflows/validate-deployment.yml@main' - secrets: inherit + validate-deployment: + name: "SFDX Scanner" + uses: "Szandor72/devops-center-actions/.github/workflows/validate-deployment.yml@main" + secrets: inherit diff --git a/.github/workflows/validate-metadata.yml b/.github/workflows/validate-metadata.yml index 53c3216..05d2f77 100644 --- a/.github/workflows/validate-metadata.yml +++ b/.github/workflows/validate-metadata.yml @@ -1,14 +1,14 @@ name: Custom Metadata Checks on: - pull_request: - types: [opened, synchronize, reopened] - branches: - - integration - paths: - - 'force-app/**' + pull_request: + types: [opened, synchronize, reopened] + branches: + - integration + paths: + - "force-app/**" jobs: - validate-metadata: - name: 'Validate Metadata' - uses: 'Szandor72/devops-center-actions/.github/workflows/validate-metadata.yml@main' + validate-metadata: + name: "Validate Metadata" + uses: "Szandor72/devops-center-actions/.github/workflows/validate-metadata.yml@main" diff --git a/config/project-scratch-def.json b/config/project-scratch-def.json index 5881c18..bb72192 100644 --- a/config/project-scratch-def.json +++ b/config/project-scratch-def.json @@ -1,13 +1,13 @@ { - "orgName": "Demo company", - "edition": "Developer", - "features": ["EnableSetPasswordInApi"], - "settings": { - "lightningExperienceSettings": { - "enableS1DesktopEnabled": true - }, - "mobileSettings": { - "enableS1EncryptedStoragePref2": false - } + "orgName": "Demo company", + "edition": "Developer", + "features": ["EnableSetPasswordInApi"], + "settings": { + "lightningExperienceSettings": { + "enableS1DesktopEnabled": true + }, + "mobileSettings": { + "enableS1EncryptedStoragePref2": false } + } } diff --git a/demo-classes/AccountService.cls b/demo-classes/AccountService.cls index 0108999..83cbfae 100644 --- a/demo-classes/AccountService.cls +++ b/demo-classes/AccountService.cls @@ -3,78 +3,82 @@ * Provides various services related to Account object */ public class AccountService { - /** - * Fetches details for a given account - * @param accountId The ID of the account - * @return Account The details of the account - */ - public Account getAccDetails(Id accountId) { - // SOQL query inside a loop - bad practice - for (Id accId : new List{ accountId }) { - Account acc = [SELECT Id, Name, Industry FROM Account WHERE Id = :accId]; - return acc; - } - return null; + /** + * Fetches details for a given account + * @param accountId The ID of the account + * @return Account The details of the account + */ + public Account getAccDetails(Id accountId) { + // SOQL query inside a loop - bad practice + for (Id accId : new List{ accountId }) { + Account acc = [SELECT Id, Name, Industry FROM Account WHERE Id = :accId]; + return acc; } + return null; + } - public Account getAccDetails2(Id accountId) { - // SOQL query inside a loop - bad practice - for (Id accId : new List{ accountId }) { - Account acc = [SELECT Id, Name, Industry FROM Account WHERE Id = :accId]; - update acc; - return acc; - } - return null; + public Account getAccDetails2(Id accountId) { + // SOQL query inside a loop - bad practice + for (Id accId : new List{ accountId }) { + Account acc = [SELECT Id, Name, Industry FROM Account WHERE Id = :accId]; + update acc; + return acc; } + return null; + } - // This method lacks ApexDocs - public void UpdateAccount(List accounts) { - // DML operation inside a loop - bad practice - for (Account acc : accounts) { - acc.Name += ' - Updated'; - update acc; // This should be done in bulk outside the loop - } + // This method lacks ApexDocs + public void UpdateAccount(List accounts) { + // DML operation inside a loop - bad practice + for (Account acc : accounts) { + acc.Name += ' - Updated'; + update acc; // This should be done in bulk outside the loop } + } - /** - * Deletes a specified account - * @param accountId The ID of the account to be deleted - */ - public void delete_Account(Id accountId) { - // Hardcoding IDs - bad practice - Id hardCodedId = '001xx000003DGAXAA4'; - delete [SELECT Id FROM Account WHERE Id = :hardCodedId]; - } + /** + * Deletes a specified account + * @param accountId The ID of the account to be deleted + */ + public void delete_Account(Id accountId) { + // Hardcoding IDs - bad practice + Id hardCodedId = '001xx000003DGAXAA4'; + delete [SELECT Id FROM Account WHERE Id = :hardCodedId]; + } - // This method lacks ApexDocs - public List ListAccounts() { - // Not using bulkified approach - bad practice - List accounts = [SELECT Id, Name FROM Account LIMIT 1]; - return accounts; - } + // This method lacks ApexDocs + public List ListAccounts() { + // Not using bulkified approach - bad practice + List accounts = [SELECT Id, Name FROM Account LIMIT 1]; + return accounts; + } - /** - * Calculates the annual revenue - * - This ApexDoc is incomplete and lacks parameter description - * @return Decimal The calculated annual revenue - */ - public String CalculateAnnualRevenue() { - // Lack of null checks and exception handling - bad practice - Account acc = [SELECT Industry FROM Account WHERE Id = '001xx000003DGAZAA4']; - return acc.Industry; - } + /** + * Calculates the annual revenue + * - This ApexDoc is incomplete and lacks parameter description + * @return Decimal The calculated annual revenue + */ + public String CalculateAnnualRevenue() { + // Lack of null checks and exception handling - bad practice + Account acc = [ + SELECT Industry + FROM Account + WHERE Id = '001xx000003DGAZAA4' + ]; + return acc.Industry; + } - // This method lacks ApexDocs - public List ListAccounts2() { - // Not using bulkified approach - bad practice - List accounts = [SELECT Id, Name FROM Account LIMIT 1]; - return accounts; - } + // This method lacks ApexDocs + public List ListAccounts2() { + // Not using bulkified approach - bad practice + List accounts = [SELECT Id, Name FROM Account LIMIT 1]; + return accounts; + } - // This method lacks ApexDocs - public List ListAccounts3() { - // Not using bulkified approach - bad practice - List accounts = [SELECT Id, Name FROM Account LIMIT 1]; - return accounts; - } + // This method lacks ApexDocs + public List ListAccounts3() { + // Not using bulkified approach - bad practice + List accounts = [SELECT Id, Name FROM Account LIMIT 1]; + return accounts; + } } diff --git a/demo-classes/CaseService.cls b/demo-classes/CaseService.cls index b4ab6b8..0c7b6b1 100644 --- a/demo-classes/CaseService.cls +++ b/demo-classes/CaseService.cls @@ -2,12 +2,12 @@ * @description service related updates */ public with sharing class CaseService { - public static void doUpdates(Set caseIds) { - List cases = [SELECT Id, Status FROM Case WHERE Id IN :caseIds]; - for (Case c : cases) { - c.Status = 'Closed'; - // raise pmd error - update c; - } + public static void doUpdates(Set caseIds) { + List cases = [SELECT Id, Status FROM Case WHERE Id IN :caseIds]; + for (Case c : cases) { + c.Status = 'Closed'; + // raise pmd error + update c; } + } } diff --git a/force-app/main/default/classes/ContentDocumentTriggerHandler.cls b/force-app/main/default/classes/ContentDocumentTriggerHandler.cls index 88f7988..987ba75 100644 --- a/force-app/main/default/classes/ContentDocumentTriggerHandler.cls +++ b/force-app/main/default/classes/ContentDocumentTriggerHandler.cls @@ -2,67 +2,69 @@ * @description Handles legacy metadata scan file uploads from GitHub */ public with sharing class ContentDocumentTriggerHandler { - /** - * @description sends a notification for legacy scan file uploads - * @param newContentDocumentMap - received from trigger - */ - @SuppressWarnings('PMD.ApexCRUDViolation') - public static void notifyOnLegacyCodeScanFileUploads( - Map newContentDocumentMap + /** + * @description sends a notification for legacy scan file uploads + * @param newContentDocumentMap - received from trigger + */ + @SuppressWarnings('PMD.ApexCRUDViolation') + public static void notifyOnLegacyCodeScanFileUploads( + Map newContentDocumentMap + ) { + Boolean isBulkOperation = newContentDocumentMap.values().size() > 1; + if (isBulkOperation) { + return; + } + List notificationTypes = [ + SELECT Id, DeveloperName + FROM CustomNotificationType + WHERE DeveloperName = 'NewMetadataScanAvailable' + ]; + if (notificationTypes.isEmpty()) { + return; + } + CustomNotificationType notificationType = notificationTypes[0]; + for ( + ContentDocument matchingFile : filterContentDocuments( + newContentDocumentMap.values() + ) ) { - Boolean isBulkOperation = newContentDocumentMap.values().size() > 1; - if (isBulkOperation) { - return; - } - List notificationTypes = [ - SELECT Id, DeveloperName - FROM CustomNotificationType - WHERE DeveloperName = 'NewMetadataScanAvailable' - ]; - if (notificationTypes.isEmpty()) { - return; - } - CustomNotificationType notificationType = notificationTypes[0]; - for ( - ContentDocument matchingFile : filterContentDocuments(newContentDocumentMap.values()) - ) { - Messaging.CustomNotification notification = new Messaging.CustomNotification(); + Messaging.CustomNotification notification = new Messaging.CustomNotification(); - notification.setTitle('New Metadata Scan Available'); - notification.setBody( - 'Please review the scan and discuss necessary changes with the developer' - ); + notification.setTitle('New Metadata Scan Available'); + notification.setBody( + 'Please review the scan and discuss necessary changes with the developer' + ); - notification.setNotificationTypeId(notificationType.Id); - notification.setTargetId(matchingFile.Id); + notification.setNotificationTypeId(notificationType.Id); + notification.setTargetId(matchingFile.Id); - // TODO identify targets for notification, i.e. public group's first level members? - // uploading user should be a technical user - try { - notification.send(new Set{ UserInfo.getUserId() }); - } catch (Exception e) { - return; - } - } + // TODO identify targets for notification, i.e. public group's first level members? + // uploading user should be a technical user + try { + notification.send(new Set{ UserInfo.getUserId() }); + } catch (Exception e) { + return; + } } + } - /** - * @description Filter ContentDocument sobjects by file extension and title - * @param contentDocuments list of ContentDocument sobjects to filter - * @return matchingContentDocuments - */ - public static List filterContentDocuments( - List contentDocuments - ) { - List matchingContentDocuments = new List(); - for (ContentDocument uploadedFile : contentDocuments) { - if ( - String.isNotBlank(uploadedFile.Title) && - uploadedFile.Title.contains('legacy-scan-results_') - ) { - matchingContentDocuments.add(uploadedFile); - } - } - return matchingContentDocuments; + /** + * @description Filter ContentDocument sobjects by file extension and title + * @param contentDocuments list of ContentDocument sobjects to filter + * @return matchingContentDocuments + */ + public static List filterContentDocuments( + List contentDocuments + ) { + List matchingContentDocuments = new List(); + for (ContentDocument uploadedFile : contentDocuments) { + if ( + String.isNotBlank(uploadedFile.Title) && + uploadedFile.Title.contains('legacy-scan-results_') + ) { + matchingContentDocuments.add(uploadedFile); + } } + return matchingContentDocuments; + } } diff --git a/force-app/main/default/classes/ContentDocumentTriggerHandlerTest.cls b/force-app/main/default/classes/ContentDocumentTriggerHandlerTest.cls index 1f059ab..a3327ee 100644 --- a/force-app/main/default/classes/ContentDocumentTriggerHandlerTest.cls +++ b/force-app/main/default/classes/ContentDocumentTriggerHandlerTest.cls @@ -3,38 +3,45 @@ */ @isTest private class ContentDocumentTriggerHandlerTest { - /** - * @description Test method for handleLegacyCodeScanFileUploads - */ - @isTest - static void testHandleLegacyCodeScanFileUploads() { - ContentVersion cv = new ContentVersion( - Title = 'legacy-scan-results_AND_SOME_HASH.csv', - PathOnClient = 'legacy-scan-results_AND_SOME_HASH.csv', - VersionData = Blob.valueOf('Test Content') - ); - insert cv; - cv = [SELECT ContentDocumentId FROM ContentVersion WHERE Id = :cv.Id LIMIT 1]; - Map newContentDocumentMap = new Map{ - cv.ContentDocumentId => [ - SELECT Id, Title, FileExtension - FROM ContentDocument - WHERE Id = :cv.ContentDocumentId - ] - }; + /** + * @description Test method for handleLegacyCodeScanFileUploads + */ + @isTest + static void testHandleLegacyCodeScanFileUploads() { + ContentVersion cv = new ContentVersion( + Title = 'legacy-scan-results_AND_SOME_HASH.csv', + PathOnClient = 'legacy-scan-results_AND_SOME_HASH.csv', + VersionData = Blob.valueOf('Test Content') + ); + insert cv; + cv = [ + SELECT ContentDocumentId + FROM ContentVersion + WHERE Id = :cv.Id + LIMIT 1 + ]; + Map newContentDocumentMap = new Map{ + cv.ContentDocumentId => [ + SELECT Id, Title, FileExtension + FROM ContentDocument + WHERE Id = :cv.ContentDocumentId + ] + }; - Test.startTest(); - String unexpectedExceptionMessage = ''; - try { - ContentDocumentTriggerHandler.notifyOnLegacyCodeScanFileUploads(newContentDocumentMap); - } catch (Exception e) { - unexpectedExceptionMessage = e.getMessage(); - } - Assert.isTrue( - String.isBlank(unexpectedExceptionMessage), - 'No Exception accepted. Code needs to exit gracefully all of the times. ' + - unexpectedExceptionMessage - ); - Test.stopTest(); + Test.startTest(); + String unexpectedExceptionMessage = ''; + try { + ContentDocumentTriggerHandler.notifyOnLegacyCodeScanFileUploads( + newContentDocumentMap + ); + } catch (Exception e) { + unexpectedExceptionMessage = e.getMessage(); } + Assert.isTrue( + String.isBlank(unexpectedExceptionMessage), + 'No Exception accepted. Code needs to exit gracefully all of the times. ' + + unexpectedExceptionMessage + ); + Test.stopTest(); + } } diff --git a/force-app/main/default/flexipages/Custom_Contact_Record_Page.flexipage-meta.xml b/force-app/main/default/flexipages/Custom_Contact_Record_Page.flexipage-meta.xml index cd690cc..398ccc9 100644 --- a/force-app/main/default/flexipages/Custom_Contact_Record_Page.flexipage-meta.xml +++ b/force-app/main/default/flexipages/Custom_Contact_Record_Page.flexipage-meta.xml @@ -1,4 +1,4 @@ - + @@ -38,8 +38,10 @@ displayOption BOTH - runtime_sales_merge:mergeCandidatesPreviewCard - runtime_sales_merge_mergeCandidatesPreviewCard + runtime_sales_merge:mergeCandidatesPreviewCard + runtime_sales_merge_mergeCandidatesPreviewCard @@ -159,7 +161,8 @@ showLegacyActivityComposer false - runtime_sales_activities:activityPanel + runtime_sales_activities:activityPanel runtime_sales_activities_activityPanel diff --git a/force-app/main/default/triggers/ContentDocumentTrigger.trigger b/force-app/main/default/triggers/ContentDocumentTrigger.trigger index f1f501e..ed324e3 100644 --- a/force-app/main/default/triggers/ContentDocumentTrigger.trigger +++ b/force-app/main/default/triggers/ContentDocumentTrigger.trigger @@ -1,3 +1,5 @@ trigger ContentDocumentTrigger on ContentDocument(after insert) { - ContentDocumentTRiggerHandler.notifyOnLegacyCodeScanFileUploads(Trigger.newMap); + ContentDocumentTRiggerHandler.notifyOnLegacyCodeScanFileUploads( + Trigger.newMap + ); } From d62631a3a140bd10d3c1d90a2c01a84b98483edf Mon Sep 17 00:00:00 2001 From: "Ch. Szandor Knapp" Date: Tue, 16 Jan 2024 15:26:49 +0100 Subject: [PATCH 16/21] fix: +x on husky --- .husky/pre-commit | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 .husky/pre-commit diff --git a/.husky/pre-commit b/.husky/pre-commit old mode 100644 new mode 100755 From 315127e8a6f94137406fbc4bba3cf23fda298d66 Mon Sep 17 00:00:00 2001 From: "Ch. Szandor Knapp" Date: Tue, 16 Jan 2024 15:30:28 +0100 Subject: [PATCH 17/21] chore: build pass --- .ci/legacy-metadata-files.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.ci/legacy-metadata-files.txt b/.ci/legacy-metadata-files.txt index 116a759..62c706c 100644 --- a/.ci/legacy-metadata-files.txt +++ b/.ci/legacy-metadata-files.txt @@ -2,4 +2,5 @@ # force-app/main/default/classes/ContentDocumentTriggerHandler.cls force-app/main/default/objects/Contact/fields/Faulty_Url_Field__c.field-meta.xml force-app/main/default/flexipages/Custom_Contact_Record_Page.flexipage-meta.xml -force-app/main/default/flows/UpdateVIPStatus.flow-meta.xml \ No newline at end of file +force-app/main/default/flows/UpdateVIPStatus.flow-meta.xml +force-app/main/default/classes/AccountService.cls \ No newline at end of file From 91a8d9afc312a01b56f625f503321241feedd1aa Mon Sep 17 00:00:00 2001 From: "Ch. Szandor Knapp" Date: Tue, 16 Jan 2024 15:41:19 +0100 Subject: [PATCH 18/21] chore: test unrelated change, no csv file upload --- .../default/objects/Account/fields/IsVIP__c.field-meta.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/force-app/main/default/objects/Account/fields/IsVIP__c.field-meta.xml b/force-app/main/default/objects/Account/fields/IsVIP__c.field-meta.xml index f50b43a..aad5121 100644 --- a/force-app/main/default/objects/Account/fields/IsVIP__c.field-meta.xml +++ b/force-app/main/default/objects/Account/fields/IsVIP__c.field-meta.xml @@ -2,7 +2,8 @@ IsVIP__c false - VIP is if VIP contacts exist + Account is a VIP if at least one VIP contact exist false false From 49fb28a912d469710beb5d39d2589a29ca5be04c Mon Sep 17 00:00:00 2001 From: "Ch. Szandor Knapp" Date: Tue, 16 Jan 2024 16:01:42 +0100 Subject: [PATCH 19/21] chore: update tooling --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8deb47b..77e0427 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,7 @@ "@salesforce/eslint-plugin-aura": "^2.0.0", "@salesforce/eslint-plugin-lightning": "^1.0.0", "@salesforce/sfdx-lwc-jest": "^1.1.0", - "devops-center-local-config-files": "^1.3.5", + "devops-center-local-config-files": "^1.3.6", "eslint": "^8.11.0", "eslint-plugin-import": "^2.25.4", "eslint-plugin-jest": "^26.1.2", @@ -3662,9 +3662,9 @@ } }, "node_modules/devops-center-local-config-files": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/devops-center-local-config-files/-/devops-center-local-config-files-1.3.5.tgz", - "integrity": "sha512-W1wDuH+972ODUrHsAys/+1CUKDyktMqwChzq5X7jbRc+4bQAOoMZn9QHMta+dhYtSxlPFzACFWX+1WcxUJtrGg==", + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/devops-center-local-config-files/-/devops-center-local-config-files-1.3.6.tgz", + "integrity": "sha512-lzrpDK5CFppn+TDF9UfWC22TZg/WcKndcblVRDwte7kx4eDAppl/9v03SEGJlKuaEhDYzzbl/4nODEPCZMEuJA==", "dev": true, "dependencies": { "execa": "^5.1.1", @@ -13080,9 +13080,9 @@ "dev": true }, "devops-center-local-config-files": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/devops-center-local-config-files/-/devops-center-local-config-files-1.3.5.tgz", - "integrity": "sha512-W1wDuH+972ODUrHsAys/+1CUKDyktMqwChzq5X7jbRc+4bQAOoMZn9QHMta+dhYtSxlPFzACFWX+1WcxUJtrGg==", + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/devops-center-local-config-files/-/devops-center-local-config-files-1.3.6.tgz", + "integrity": "sha512-lzrpDK5CFppn+TDF9UfWC22TZg/WcKndcblVRDwte7kx4eDAppl/9v03SEGJlKuaEhDYzzbl/4nODEPCZMEuJA==", "dev": true, "requires": { "execa": "^5.1.1", diff --git a/package.json b/package.json index 51508f5..5c687f4 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "@salesforce/eslint-plugin-aura": "^2.0.0", "@salesforce/eslint-plugin-lightning": "^1.0.0", "@salesforce/sfdx-lwc-jest": "^1.1.0", - "devops-center-local-config-files": "^1.3.5", + "devops-center-local-config-files": "^1.3.6", "eslint": "^8.11.0", "eslint-plugin-import": "^2.25.4", "eslint-plugin-jest": "^26.1.2", From 358ca78dfd9d7df812e60da2dd5eb31cb161e8ed Mon Sep 17 00:00:00 2001 From: "Ch. Szandor Knapp" Date: Tue, 16 Jan 2024 16:53:11 +0100 Subject: [PATCH 20/21] chore: fresh csv upload expected due to change in legacy code --- force-app/main/default/classes/AccountService.cls | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/force-app/main/default/classes/AccountService.cls b/force-app/main/default/classes/AccountService.cls index 83cbfae..1625367 100644 --- a/force-app/main/default/classes/AccountService.cls +++ b/force-app/main/default/classes/AccountService.cls @@ -27,6 +27,16 @@ public class AccountService { return null; } + public Account getAccDetails3(Id accountId) { + // SOQL query inside a loop - bad practice + for (Id accId : new List{ accountId }) { + Account acc = [SELECT Id, Name, Industry FROM Account WHERE Id = :accId]; + update acc; + return acc; + } + return null; + } + // This method lacks ApexDocs public void UpdateAccount(List accounts) { // DML operation inside a loop - bad practice From 1dfeb200fa7fbe0bccaf9da903c93e92e2cfb5d4 Mon Sep 17 00:00:00 2001 From: "Ch. Szandor Knapp" Date: Wed, 17 Jan 2024 10:41:44 +0100 Subject: [PATCH 21/21] chore: force build --- .../Account/fields/IsVIP__c.field-meta.xml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/force-app/main/default/objects/Account/fields/IsVIP__c.field-meta.xml b/force-app/main/default/objects/Account/fields/IsVIP__c.field-meta.xml index aad5121..16dcc0f 100644 --- a/force-app/main/default/objects/Account/fields/IsVIP__c.field-meta.xml +++ b/force-app/main/default/objects/Account/fields/IsVIP__c.field-meta.xml @@ -1,11 +1,10 @@ - IsVIP__c - false - Account is a VIP if at least one VIP contact exist - false - - false - Checkbox + IsVIP__c + false + VIP Accounts have special SLAs + false + + false + Checkbox