Skip to content

Commit

Permalink
feat: add property name in tile
Browse files Browse the repository at this point in the history
  • Loading branch information
pozil committed Sep 29, 2023
1 parent 565fa38 commit 9a2cd4a
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
1 change: 1 addition & 0 deletions force-app/main/default/classes/PropertyController.cls
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public with sharing class PropertyController {
result.records = [
SELECT
Id,
Name,
Address__c,
City__c,
State__c,
Expand Down
5 changes: 2 additions & 3 deletions force-app/main/default/lwc/barcodeScanner/barcodeScanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion force-app/main/default/lwc/propertyTile/propertyTile.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions force-app/main/default/lwc/propertyTile/propertyTile.html
Original file line number Diff line number Diff line change
@@ -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>
Expand Down

0 comments on commit 9a2cd4a

Please sign in to comment.