From 9a2cd4a320da1dc98b6eacd3ee2753e94dbd56f6 Mon Sep 17 00:00:00 2001
From: Philippe Ozil <pozil@salesforce.com>
Date: Fri, 29 Sep 2023 15:28:23 +0200
Subject: [PATCH] feat: add property name in tile

---
 force-app/main/default/classes/PropertyController.cls        | 1 +
 force-app/main/default/lwc/barcodeScanner/barcodeScanner.js  | 5 ++---
 .../lwc/listContactsFromDevice/listContactsFromDevice.js     | 5 ++---
 .../default/lwc/propertyTile/__tests__/propertyTile.test.js  | 5 ++++-
 force-app/main/default/lwc/propertyTile/propertyTile.css     | 2 +-
 force-app/main/default/lwc/propertyTile/propertyTile.html    | 4 ++--
 6 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/force-app/main/default/classes/PropertyController.cls b/force-app/main/default/classes/PropertyController.cls
index 143ddc98c..0fd38adde 100644
--- a/force-app/main/default/classes/PropertyController.cls
+++ b/force-app/main/default/classes/PropertyController.cls
@@ -52,6 +52,7 @@ public with sharing class PropertyController {
         result.records = [
             SELECT
                 Id,
+                Name,
                 Address__c,
                 City__c,
                 State__c,
diff --git a/force-app/main/default/lwc/barcodeScanner/barcodeScanner.js b/force-app/main/default/lwc/barcodeScanner/barcodeScanner.js
index f9f90fe08..9d11a138e 100644
--- a/force-app/main/default/lwc/barcodeScanner/barcodeScanner.js
+++ b/force-app/main/default/lwc/barcodeScanner/barcodeScanner.js
@@ -31,9 +31,8 @@ export default class BarcodeScanner extends NavigationMixin(LightningElement) {
 
             // Try starting the scanning process, then using the result to navigate to a property record
             try {
-                const captureResult = await this.myScanner.beginCapture(
-                    scanningOptions
-                );
+                const captureResult =
+                    await this.myScanner.beginCapture(scanningOptions);
 
                 // Extract QR code data
                 this.scannedQrCode = captureResult.value;
diff --git a/force-app/main/default/lwc/listContactsFromDevice/listContactsFromDevice.js b/force-app/main/default/lwc/listContactsFromDevice/listContactsFromDevice.js
index 957e732ba..183514ed8 100644
--- a/force-app/main/default/lwc/listContactsFromDevice/listContactsFromDevice.js
+++ b/force-app/main/default/lwc/listContactsFromDevice/listContactsFromDevice.js
@@ -22,9 +22,8 @@ export default class ListContactsFromDevice extends LightningElement {
         };
 
         try {
-            this.deviceContacts = await this.contactsService.getContacts(
-                options
-            );
+            this.deviceContacts =
+                await this.contactsService.getContacts(options);
         } catch (error) {
             this.error = error;
         }
diff --git a/force-app/main/default/lwc/propertyTile/__tests__/propertyTile.test.js b/force-app/main/default/lwc/propertyTile/__tests__/propertyTile.test.js
index 1b878db59..9bf9f2901 100644
--- a/force-app/main/default/lwc/propertyTile/__tests__/propertyTile.test.js
+++ b/force-app/main/default/lwc/propertyTile/__tests__/propertyTile.test.js
@@ -2,6 +2,7 @@ import { createElement } from 'lwc';
 import PropertyTile from 'c/propertyTile';
 
 const PROPERTY = {
+    Name: 'My House',
     City__c: 'Some City',
     Beds__c: '3',
     Baths__c: '1',
@@ -32,7 +33,9 @@ describe('c-property-tile', () => {
         document.body.appendChild(element);
 
         const headerEl = element.shadowRoot.querySelector('.truncate');
-        expect(headerEl.textContent).toBe(PROPERTY.City__c);
+        expect(headerEl.textContent).toBe(
+            `${PROPERTY.City__c} • ${PROPERTY.Name}`
+        );
 
         const paragraphEl = element.shadowRoot.querySelector('p');
         expect(paragraphEl.textContent).toBe(
diff --git a/force-app/main/default/lwc/propertyTile/propertyTile.css b/force-app/main/default/lwc/propertyTile/propertyTile.css
index ddd3f43fb..07ac902cb 100644
--- a/force-app/main/default/lwc/propertyTile/propertyTile.css
+++ b/force-app/main/default/lwc/propertyTile/propertyTile.css
@@ -14,7 +14,7 @@
     left: 0;
     /* @sldsValidatorIgnore */
     right: 0;
-    background-color: rgba(0, 0, 0, 0.3);
+    background-color: rgba(0, 0, 0, 0.5);
 }
 
 .truncate {
diff --git a/force-app/main/default/lwc/propertyTile/propertyTile.html b/force-app/main/default/lwc/propertyTile/propertyTile.html
index 2cc576cf6..188afdb69 100644
--- a/force-app/main/default/lwc/propertyTile/propertyTile.html
+++ b/force-app/main/default/lwc/propertyTile/propertyTile.html
@@ -1,11 +1,11 @@
 <template>
-    <a onclick={handlePropertySelected}>
+    <a onclick={handlePropertySelected} title={property.Name}>
         <div class="tile" style={backgroundImageStyle}>
             <div
                 class="lower-third slds-var-p-horizontal_x-small slds-var-p-vertical_xx-small slds-text-color_inverse"
             >
                 <h1 class="truncate slds-text-heading_small">
-                    {property.City__c}
+                    <strong>{property.City__c} • </strong>{property.Name}
                 </h1>
                 <p>Beds: {property.Beds__c} - Baths: {property.Baths__c}</p>
                 <p>