diff --git a/.github/workflows/verifies_test_data.yml b/.github/workflows/verifies_test_data.yml new file mode 100644 index 00000000..5022690b --- /dev/null +++ b/.github/workflows/verifies_test_data.yml @@ -0,0 +1,36 @@ +name: Verifies Sample Data + +on: + push: + branches: + - '**' + - '!master' + +env: + CUMULUSCI_KEYCHAIN_CLASS: cumulusci.core.keychain.EnvironmentProjectKeychain + CUMULUSCI_SERVICE_github: ${{ secrets.CUMULUSCI_SERVICE_github }} + +jobs: + unit_tests: + name: 'Verify sample data' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install sfdx + run: | + mkdir sfdx + wget -qO- https://developer.salesforce.com/media/salesforce-cli/sfdx-linux-amd64.tar.xz | tar xJ -C sfdx --strip-components 1 + ./sfdx/install + echo ${{ secrets.SFDX_AUTH_URL }} > sfdx_auth + sfdx force:auth:sfdxurl:store -f sfdx_auth -d + - name: Set up Python + uses: actions/setup-python@v1 + with: + python-version: '3.8' + - name: Install CumulusCI + run: | + python -m pip install -U pip + pip install cumulusci + - name: Deploy and load sample data + run: | + cci flow run dev_org --org dev --delete-org diff --git a/.prettierrc b/.prettierrc index 15683b69..94fdbd1c 100755 --- a/.prettierrc +++ b/.prettierrc @@ -1,5 +1,6 @@ { "trailingComma": "none", + "singleQuote": true, "overrides": [ { "files": "**/lwc/**/*.html", diff --git a/datasets/sample.sql b/datasets/sample.sql index 80b4ddc0..71bb59f2 100644 --- a/datasets/sample.sql +++ b/datasets/sample.sql @@ -4,9 +4,9 @@ CREATE TABLE "Account" ( "Name" VARCHAR(255), PRIMARY KEY (sf_id) ); -INSERT INTO "Account" VALUES('001S000001CBEYZIA5','Test Provider 3'); -INSERT INTO "Account" VALUES('001S000001CBEYaIAP','Test Provider 1'); -INSERT INTO "Account" VALUES('001S000001CBEYbIAP','Test Provider 2'); +INSERT INTO "Account" VALUES('0011100001vqJwAAAU','Test Provider 3'); +INSERT INTO "Account" VALUES('0011100001vqJwBAAU','Test Provider 1'); +INSERT INTO "Account" VALUES('0011100001vqJwCAAU','Test Provider 2'); CREATE TABLE "Client_Profile__c" ( sf_id VARCHAR(255) NOT NULL, "Date_of_Birth__c" VARCHAR(255), @@ -15,11 +15,16 @@ CREATE TABLE "Client_Profile__c" ( "Postal_Code__c" VARCHAR(255), "Location__Latitude__s" VARCHAR(255), "Location__Longitude__s" VARCHAR(255), + "Homeless__c" VARCHAR(255), + "Runaway__c" VARCHAR(255), + "Home_Owner__c" VARCHAR(255), + "Home_Renter__c" VARCHAR(255), + "Near_Homeless__c" VARCHAR(255), contact__c VARCHAR(255), PRIMARY KEY (sf_id) ); -INSERT INTO "Client_Profile__c" VALUES('a00S0000007dUHBIA2','2005-05-24','Micah','McLaughlin','94102','','','003S000001LarKCIAZ'); -INSERT INTO "Client_Profile__c" VALUES('a00S0000007dUHCIA2','1979-04-20','Shane','McLaughlin','94102','','','003S000001LarKDIAZ'); +INSERT INTO "Client_Profile__c" VALUES('a001100000FSejMAAT','2005-05-24','Micah','McLaughlin','94102','','','false','false','false','false','false','0031100001ffeU1AAI'); +INSERT INTO "Client_Profile__c" VALUES('a001100000FSejNAAT','1979-04-20','Shane','McLaughlin','94102','','','false','false','false','false','false','0031100001ffeU2AAI'); CREATE TABLE "Contact" ( sf_id VARCHAR(255) NOT NULL, "FirstName" VARCHAR(255), @@ -33,12 +38,12 @@ CREATE TABLE "Contact" ( reports_to_id VARCHAR(255), PRIMARY KEY (sf_id) ); -INSERT INTO "Contact" VALUES('003S000001LarKCIAZ','Micah','McLaughlin','8324728021','micah@mailinator.com','2005-05-24','false','false','false',''); -INSERT INTO "Contact" VALUES('003S000001LarKDIAZ','Shane','McLaughlin','8324728021','shane.m@mailinator.com','1979-04-20','false','false','false',''); -INSERT INTO "Contact" VALUES('003S000001LarKEIAZ','Contact','WithoutProfile','8324728021','noprofile@mailinator.com','','false','false','false',''); -INSERT INTO "Contact" VALUES('003S000001LarOQIAZ','Test 1','Contact','','','','false','false','false',''); -INSERT INTO "Contact" VALUES('003S000001LarHKIAZ','Test 3','Contact','','','','false','false','false',''); -INSERT INTO "Contact" VALUES('003S000001LarPSIAZ','Test 2','Contact','','','','false','false','false',''); +INSERT INTO "Contact" VALUES('0031100001ffeU1AAI','Micah','McLaughlin','8324728021','micah@mailinator.com','2005-05-24','false','false','false',''); +INSERT INTO "Contact" VALUES('0031100001ffeU2AAI','Shane','McLaughlin','8324728021','shane.m@mailinator.com','1979-04-20','false','false','false',''); +INSERT INTO "Contact" VALUES('0031100001ffeU3AAI','Contact','WithoutProfile','8324728021','noprofile@mailinator.com','','false','false','false',''); +INSERT INTO "Contact" VALUES('0031100001ffeU4AAI','Test 1','Contact','','','','false','false','false',''); +INSERT INTO "Contact" VALUES('0031100001ffeV1AAI','Test 3','Contact','','','','false','false','false',''); +INSERT INTO "Contact" VALUES('0031100001ffeV2AAI','Test 2','Contact','','','','false','false','false',''); CREATE TABLE "FeedItem" ( sf_id VARCHAR(255) NOT NULL, "Body" VARCHAR(255), @@ -46,8 +51,8 @@ CREATE TABLE "FeedItem" ( parent_id VARCHAR(255), PRIMARY KEY (sf_id) ); -INSERT INTO "FeedItem" VALUES('0D5S000000RU4uIKAT','

This one is my favorite

','TextPost','a04S0000009JpNcIAK'); -INSERT INTO "FeedItem" VALUES('0D5S000000RU4uHKAT','

Here is another comment

','TextPost','a04S0000009JpNcIAK'); +INSERT INTO "FeedItem" VALUES('0D51100000jRqGoCAK','

This one is my favorite

','TextPost','a0511000009MhizAAC'); +INSERT INTO "FeedItem" VALUES('0D51100000jRqGpCAK','

Here is another comment

','TextPost','a0511000009MhizAAC'); CREATE TABLE "Open_Hours__c" ( sf_id VARCHAR(255) NOT NULL, "End_Time__c" VARCHAR(255), @@ -56,10 +61,10 @@ CREATE TABLE "Open_Hours__c" ( service__c VARCHAR(255), PRIMARY KEY (sf_id) ); -INSERT INTO "Open_Hours__c" VALUES('a01S000000JktoMIAR','17:00:00.000Z','09:00:00.000Z','Thursday','a04S0000009JpNdIAK'); -INSERT INTO "Open_Hours__c" VALUES('a01S000000JktoNIAR','17:00:00.000Z','09:00:00.000Z','Tuesday','a04S0000009JpNdIAK'); -INSERT INTO "Open_Hours__c" VALUES('a01S000000JktoOIAR','17:00:00.000Z','09:00:00.000Z','Monday','a04S0000009JpNdIAK'); -INSERT INTO "Open_Hours__c" VALUES('a01S000000JktoPIAR','17:00:00.000Z','09:00:00.000Z','Wednesday','a04S0000009JpNdIAK'); +INSERT INTO "Open_Hours__c" VALUES('a011100000igZywAAE','17:00:00.000Z','09:00:00.000Z','Thursday','a0511000009Mhj0AAC'); +INSERT INTO "Open_Hours__c" VALUES('a011100000igZyxAAE','17:00:00.000Z','09:00:00.000Z','Tuesday','a0511000009Mhj0AAC'); +INSERT INTO "Open_Hours__c" VALUES('a011100000igZyyAAE','17:00:00.000Z','09:00:00.000Z','Monday','a0511000009Mhj0AAC'); +INSERT INTO "Open_Hours__c" VALUES('a011100000igZyzAAE','17:00:00.000Z','09:00:00.000Z','Wednesday','a0511000009Mhj0AAC'); CREATE TABLE "Referral__c" ( sf_id VARCHAR(255) NOT NULL, "Preferred_Channel__c" VARCHAR(255), @@ -68,21 +73,21 @@ CREATE TABLE "Referral__c" ( service__c VARCHAR(255), PRIMARY KEY (sf_id) ); -INSERT INTO "Referral__c" VALUES('a02S000000EjCvNIAV','Email','','003S000001LarKCIAZ','a04S0000009JpNcIAK'); -INSERT INTO "Referral__c" VALUES('a02S000000EjCvOIAV','SMS','3.0','003S000001LarKDIAZ','a04S0000009JpNdIAK'); -INSERT INTO "Referral__c" VALUES('a02S000000EjCvcIAF','SMS','1.0','003S000001LarPSIAZ','a04S0000009JpNbIAK'); -INSERT INTO "Referral__c" VALUES('a02S000000EjCvhIAF','SMS','3.0','003S000001LarPSIAZ','a04S0000009JpNeIAK'); -INSERT INTO "Referral__c" VALUES('a02S000000EjCvXIAV','SMS','3.0','003S000001LarHKIAZ','a04S0000009JpNdIAK'); -INSERT INTO "Referral__c" VALUES('a02S000000EjCvYIAV','SMS','','003S000001LarOQIAZ','a04S0000009JpNcIAK'); -INSERT INTO "Referral__c" VALUES('a02S000000EjCvZIAV','SMS','','003S000001LarOQIAZ','a04S0000009JpNaIAK'); +INSERT INTO "Referral__c" VALUES('a0311000009dalLAAQ','SMS','3.0','0031100001ffeV1AAI','a0511000009Mhj0AAC'); +INSERT INTO "Referral__c" VALUES('a0311000009dalMAAQ','Email','','0031100001ffeU1AAI','a0511000009MhizAAC'); +INSERT INTO "Referral__c" VALUES('a0311000009dalNAAQ','SMS','3.0','0031100001ffeU2AAI','a0511000009Mhj0AAC'); +INSERT INTO "Referral__c" VALUES('a0311000009dalOAAQ','SMS','','0031100001ffeU4AAI','a0511000009MhixAAC'); +INSERT INTO "Referral__c" VALUES('a0311000009dalPAAQ','SMS','','0031100001ffeU4AAI','a0511000009MhizAAC'); +INSERT INTO "Referral__c" VALUES('a0311000009dalQAAQ','SMS','1.0','0031100001ffeV2AAI','a0511000009MhiyAAC'); +INSERT INTO "Referral__c" VALUES('a0311000009dalRAAQ','SMS','3.0','0031100001ffeV2AAI','a0511000009Mhj1AAC'); CREATE TABLE "Service_Exclusion__c" ( sf_id VARCHAR(255) NOT NULL, contact__c VARCHAR(255), service__c VARCHAR(255), PRIMARY KEY (sf_id) ); -INSERT INTO "Service_Exclusion__c" VALUES('a03S0000007KiR5IAK','','a04S0000009JpNaIAK'); -INSERT INTO "Service_Exclusion__c" VALUES('a03S0000007KiR6IAK','','a04S0000009JpNeIAK'); +INSERT INTO "Service_Exclusion__c" VALUES('a041100000GnUYJAA3','','a0511000009MhixAAC'); +INSERT INTO "Service_Exclusion__c" VALUES('a041100000GnUYKAA3','','a0511000009Mhj1AAC'); CREATE TABLE "Service__c" ( sf_id VARCHAR(255) NOT NULL, "Name" VARCHAR(255), @@ -99,14 +104,19 @@ CREATE TABLE "Service__c" ( "Preferred__c" VARCHAR(255), "Location__Latitude__s" VARCHAR(255), "Location__Longitude__s" VARCHAR(255), + "Homeless__c" VARCHAR(255), + "Runaway__c" VARCHAR(255), + "Home_Owner__c" VARCHAR(255), + "Home_Renter__c" VARCHAR(255), + "Near_Homeless__c" VARCHAR(255), account__c VARCHAR(255), PRIMARY KEY (sf_id) ); -INSERT INTO "Service__c" VALUES('a04S0000009JpNaIAK','hidden service (all contacts)','','18.0','San Francisco','Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut efficitur lacus in aliquet dignissim. Cras molestie risus vel magna gravida congue facilisis non nisl. Maecenas laoreet est libero, vitae cursus justo posuere in. Nunc vel elit sapien. Integer velit augue, volutpat ut mattis et, lacinia at orci.','555 555 5555','2400 Clay','Housing','www.google.com','94102','','false','37.7897','-122.397',''); -INSERT INTO "Service__c" VALUES('a04S0000009JpNbIAK','far service','','18.0','San Francisco','Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut efficitur lacus in aliquet dignissim. Cras molestie risus vel magna gravida congue facilisis non nisl. Maecenas laoreet est libero, vitae cursus justo posuere in. Nunc vel elit sapien. Integer velit augue, volutpat ut mattis et, lacinia at orci.','555 555 5555','2400 Clay','Housing','www.google.com','94102','','false','2.0','-2.0',''); -INSERT INTO "Service__c" VALUES('a04S0000009JpNcIAK','Test Service for Adults','','18.0','San Francisco','Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut efficitur lacus in aliquet dignissim. Cras molestie risus vel magna gravida congue facilisis non nisl. Maecenas laoreet est libero, vitae cursus justo posuere in. Nunc vel elit sapien. Integer velit augue, volutpat ut mattis et, lacinia at orci.','555 555 5555','2400 Clay','Food','www.google.com','94102','','false','37.7897','-122.397',''); -INSERT INTO "Service__c" VALUES('a04S0000009JpNdIAK','Test Service for Teens','17.0','13.0','San Francisco','Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut efficitur lacus in aliquet dignissim. Cras molestie risus vel magna gravida congue facilisis non nisl. Maecenas laoreet est libero, vitae cursus justo posuere in. Nunc vel elit sapien. Integer velit augue, volutpat ut mattis et, lacinia at orci.','555 555 5555','2400 Clay','Education','www.google.com','94102','','false','37.7897','-122.397',''); -INSERT INTO "Service__c" VALUES('a04S0000009JpNeIAK','hidden service (only hidden from Shane)','','18.0','San Francisco','Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut efficitur lacus in aliquet dignissim. Cras molestie risus vel magna gravida congue facilisis non nisl. Maecenas laoreet est libero, vitae cursus justo posuere in. Nunc vel elit sapien. Integer velit augue, volutpat ut mattis et, lacinia at orci.','555 555 5555','2400 Clay','Health','www.google.com','94102','','false','37.7897','-122.397',''); +INSERT INTO "Service__c" VALUES('a0511000009MhixAAC','hidden service (all contacts)','','18.0','San Francisco','Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut efficitur lacus in aliquet dignissim. Cras molestie risus vel magna gravida congue facilisis non nisl. Maecenas laoreet est libero, vitae cursus justo posuere in. Nunc vel elit sapien. Integer velit augue, volutpat ut mattis et, lacinia at orci.','555 555 5555','2400 Clay','Housing','www.google.com','94102','','false','37.7897','-122.397','false','false','false','false','false',''); +INSERT INTO "Service__c" VALUES('a0511000009MhiyAAC','far service','','18.0','San Francisco','Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut efficitur lacus in aliquet dignissim. Cras molestie risus vel magna gravida congue facilisis non nisl. Maecenas laoreet est libero, vitae cursus justo posuere in. Nunc vel elit sapien. Integer velit augue, volutpat ut mattis et, lacinia at orci.','555 555 5555','2400 Clay','Housing','www.google.com','94102','','false','2.0','-2.0','false','false','false','false','false',''); +INSERT INTO "Service__c" VALUES('a0511000009MhizAAC','Test Service for Adults','','18.0','San Francisco','Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut efficitur lacus in aliquet dignissim. Cras molestie risus vel magna gravida congue facilisis non nisl. Maecenas laoreet est libero, vitae cursus justo posuere in. Nunc vel elit sapien. Integer velit augue, volutpat ut mattis et, lacinia at orci.','555 555 5555','2400 Clay','Food','www.google.com','94102','','false','37.7897','-122.397','false','false','false','false','false',''); +INSERT INTO "Service__c" VALUES('a0511000009Mhj0AAC','Test Service for Teens','17.0','13.0','San Francisco','Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut efficitur lacus in aliquet dignissim. Cras molestie risus vel magna gravida congue facilisis non nisl. Maecenas laoreet est libero, vitae cursus justo posuere in. Nunc vel elit sapien. Integer velit augue, volutpat ut mattis et, lacinia at orci.','555 555 5555','2400 Clay','Education','www.google.com','94102','','false','37.7897','-122.397','false','false','false','false','false',''); +INSERT INTO "Service__c" VALUES('a0511000009Mhj1AAC','hidden service (only hidden from Shane)','','18.0','San Francisco','Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut efficitur lacus in aliquet dignissim. Cras molestie risus vel magna gravida congue facilisis non nisl. Maecenas laoreet est libero, vitae cursus justo posuere in. Nunc vel elit sapien. Integer velit augue, volutpat ut mattis et, lacinia at orci.','555 555 5555','2400 Clay','Health','www.google.com','94102','','false','37.7897','-122.397','false','false','false','false','false',''); CREATE TABLE "Task" ( sf_id VARCHAR(255) NOT NULL, "Subject" VARCHAR(255), @@ -117,7 +127,7 @@ CREATE TABLE "Task" ( what_id VARCHAR(255), PRIMARY KEY (sf_id) ); -INSERT INTO "Task" VALUES('00TS000000cMiJ4MAK','Info to Client','','Completed','Normal','','a02S000000EjCvNIAV'); -INSERT INTO "Task" VALUES('00TS000000cMiJ5MAK','Reminder','','Not Started','Normal','','a02S000000EjCvNIAV'); -INSERT INTO "Task" VALUES('00TS000000cMiJ6MAK','Survey','','Not Started','Normal','','a02S000000EjCvNIAV'); +INSERT INTO "Task" VALUES('00T1100000OxrlOEAR','Info to Client','','Completed','Normal','','a0311000009dalMAAQ'); +INSERT INTO "Task" VALUES('00T1100000OxrlPEAR','Reminder','','Not Started','Normal','','a0311000009dalMAAQ'); +INSERT INTO "Task" VALUES('00T1100000OxrlQEAR','Survey','','Not Started','Normal','','a0311000009dalMAAQ'); COMMIT; diff --git a/force-app/main/default/lwc/serviceRecommendation/serviceRecommendation.html b/force-app/main/default/lwc/serviceRecommendation/serviceRecommendation.html index 7a34f94a..a86d9190 100644 --- a/force-app/main/default/lwc/serviceRecommendation/serviceRecommendation.html +++ b/force-app/main/default/lwc/serviceRecommendation/serviceRecommendation.html @@ -1,85 +1,216 @@ \ No newline at end of file +
+
+ +
+ +
+
+
+ + + diff --git a/force-app/main/default/lwc/serviceRecommendations/serviceRecommendations.js b/force-app/main/default/lwc/serviceRecommendations/serviceRecommendations.js index bd73d97f..7402dccd 100644 --- a/force-app/main/default/lwc/serviceRecommendations/serviceRecommendations.js +++ b/force-app/main/default/lwc/serviceRecommendations/serviceRecommendations.js @@ -2,141 +2,180 @@ import { LightningElement, track, api } from 'lwc'; import { loadStyle } from 'lightning/platformResourceLoader'; import mapModal from '@salesforce/resourceUrl/mapModal'; +import { subscribe, unsubscribe } from 'lightning/empApi'; -import getRecs from '@salesforce/apex/getRecommendations.getRecommendations' +import getRecommendations from '@salesforce/apex/getRecommendations.getRecommendations'; -export default class ServiceRecommendations extends LightningElement { - @track returnRecommendations; - @track returnHiddenRecommendations; - @api recordId; - @api typefilters; - @track serviceId; - - @track showRecommendations = false; - @track showRelevancePopover = false; - @track showDropdown = false; - @track showAddComment = false; - @track showExpandedMap = false; - @track showHiddenRecsList = false; - - @track showHoursFilterChangePopover = false; - @track showLocationFilterChangePopover = false; - - get locationFilterOperatorOptions() { - return [ - { label: 'Within', value: 'Within' }, - { label: 'In Progress', value: 'inProgress' }, - { label: 'Finished', value: 'finished' }, - ]; - } +const eventChannel = '/event/Client_Profile_Update_Notification__e'; - mapMarkers = [ - { - location: { - Street: '415 Mission St', - City: 'San Francisco', - State: 'CA', - }, - - title: 'Salesforce Tower', - description: - 'lorem ipsum', - }, +export default class ServiceRecommendations extends LightningElement { + subscription = {}; + + @track returnRecommendations; + @track returnHiddenRecommendations; + @api recordId; + @api typefilters; + @track serviceId; + + @track showRecommendations = false; + @track showRelevancePopover = false; + @track showDropdown = false; + @track showAddComment = false; + @track showExpandedMap = false; + @track showHiddenRecsList = false; + + @track showHoursFilterChangePopover = false; + @track showLocationFilterChangePopover = false; + + get locationFilterOperatorOptions() { + return [ + { label: 'Within', value: 'Within' }, + { label: 'In Progress', value: 'inProgress' }, + { label: 'Finished', value: 'finished' } ]; - connectedCallback(){ - - Promise.all([ - loadStyle(this, mapModal) - ]) - } - - handleRequestRecommendations(){ - console.log('getting recommendations'); - console.log('recorid Id'+ this.recordId) - getRecs({contactId: '003J000001uUczOIAS'}) - .then((result) => { - window.console.log('success'); - if(this.showRecommendations === false){ - this.showRecommendations = !this.showRecommendations; - } - window.console.log('result' + JSON.stringify(result)); - this.returnRecommendations = result; - }) - .catch((error) => { - window.console.log('error:' + error); - }); - } - - handleExpand(){ - this.showExpandedMap = !this.showExpandedMap; - } - - handleFilterList(){ - window.console.log('show filter window'+ this.template.querySelector('.mapModalDiv').classList); - - this.template.querySelector('.mapModalDiv').classList.toggle('width67'); - this.template.querySelector('.mapModalDiv').classList.toggle('mapDivNarrow'); - this.template.querySelector('.recommendationsDiv').classList.toggle('recommendationsDivWide'); - //this.template.querySelector('.innerRecModalDiv').classList.toggle('modalWidth100'); - this.template.querySelector('.recommendationsDiv').classList.toggle('recommendationsDivNarrow'); - this.template.querySelector('.filterDiv').classList.toggle('slds-hide'); + } + + mapMarkers = [ + { + location: { + Street: '415 Mission St', + City: 'San Francisco', + State: 'CA' + }, + + title: 'Salesforce Tower', + description: 'lorem ipsum' } - - handleCloseFilters(){ - window.console.log('close filters'); - this.template.querySelector('.mapModalDiv').classList.toggle('width67'); - this.template.querySelector('.mapModalDiv').classList.toggle('mapDivNarrow'); - //this.template.querySelector('.innerRecModalDiv').classList.toggle('modalWidth100'); - this.template.querySelector('.recommendationsDiv').classList.toggle('recommendationsDivWide'); - this.template.querySelector('.recommendationsDiv').classList.toggle('recommendationsDivNarrow'); - this.template.querySelector('.filterDiv').classList.toggle('slds-hide'); - } - - handleSortList() { - - } - - handleShowHidden(){ - this.showHiddenRecsList = !this.showHiddenRecsList; - } - - changeFilter(event){ - window.console.log(event); - let tgt = event.currentTarget; - let filterAttribute = tgt.getAttribute('data-filter'); - window.console.log(filterAttribute); - if(filterAttribute === 'openhours'){ - this.showHoursFilterChangePopover = !this.showHoursFilterChangePopover; + ]; + connectedCallback() { + Promise.all([loadStyle(this, mapModal)]); + } + + handleRequestRecommendations() { + console.log('getting recommendations'); + console.log('record Id' + this.recordId); + getRecommendations({ contactId: this.recordId }) + .then((result) => { + window.console.log('success'); + if (this.showRecommendations === false) { + this.showRecommendations = !this.showRecommendations; } - if(filterAttribute === 'location'){ - this.showLocationFilterChangePopover = !this.showLocationFilterChangePopover; - } - - + window.console.log('result' + JSON.stringify(result)); + this.returnRecommendations = result; + }) + .catch((error) => { + // window.console.log('error:' + error); + console.log(JSON.parse(JSON.stringify(error))); + }); + } + + handleExpand() { + this.showExpandedMap = !this.showExpandedMap; + } + + handleFilterList() { + window.console.log( + 'show filter window' + + this.template.querySelector('.mapModalDiv').classList + ); + + this.template.querySelector('.mapModalDiv').classList.toggle('width67'); + this.template + .querySelector('.mapModalDiv') + .classList.toggle('mapDivNarrow'); + this.template + .querySelector('.recommendationsDiv') + .classList.toggle('recommendationsDivWide'); + //this.template.querySelector('.innerRecModalDiv').classList.toggle('modalWidth100'); + this.template + .querySelector('.recommendationsDiv') + .classList.toggle('recommendationsDivNarrow'); + this.template.querySelector('.filterDiv').classList.toggle('slds-hide'); + } + + handleCloseFilters() { + window.console.log('close filters'); + this.template.querySelector('.mapModalDiv').classList.toggle('width67'); + this.template + .querySelector('.mapModalDiv') + .classList.toggle('mapDivNarrow'); + //this.template.querySelector('.innerRecModalDiv').classList.toggle('modalWidth100'); + this.template + .querySelector('.recommendationsDiv') + .classList.toggle('recommendationsDivWide'); + this.template + .querySelector('.recommendationsDiv') + .classList.toggle('recommendationsDivNarrow'); + this.template.querySelector('.filterDiv').classList.toggle('slds-hide'); + } + + handleSortList() {} + + handleShowHidden() { + this.showHiddenRecsList = !this.showHiddenRecsList; + } + + changeFilter(event) { + window.console.log(event); + let tgt = event.currentTarget; + let filterAttribute = tgt.getAttribute('data-filter'); + window.console.log(filterAttribute); + if (filterAttribute === 'openhours') { + this.showHoursFilterChangePopover = !this.showHoursFilterChangePopover; } - - removeFilter(){ - + if (filterAttribute === 'location') { + this.showLocationFilterChangePopover = !this + .showLocationFilterChangePopover; } + } - removeFilters(){ + removeFilter() {} - } + removeFilters() {} - handleSortMenu(event){ - window.console.log('show sort menu'); - const menuItem = event.currentTarget; - const parent = menuItem.parentElement; - window.console.log('children' + parent.children); - for (let sibling of parent.children){ - sibling.checked = false; - } - menuItem.checked = !menuItem.checked; - //run sorting - } - - handleUpdateTypeFilters(event){ - window.console.log('type filters' + event.typefilters); + handleSortMenu(event) { + window.console.log('show sort menu'); + const menuItem = event.currentTarget; + const parent = menuItem.parentElement; + window.console.log('children' + parent.children); + for (let sibling of parent.children) { + sibling.checked = false; } - -} \ No newline at end of file + menuItem.checked = !menuItem.checked; + //run sorting + } + + handleUpdateTypeFilters(event) { + window.console.log('type filters' + event.typefilters); + } + + handleSubscribe() { + const context = this; + const messageCallback = function (response) { + // console.log(JSON.stringify(response)); + // console.log(context.recordId); + if (response.data.payload.ContactId__c === context.recordId) { + context.handleRequestRecommendations(); + } + }; + subscribe(eventChannel, -1, messageCallback).then((response) => { + // Response contains the subscription information on subscribe call + // console.log( + // 'Subscription request sent to: ', + // JSON.stringify(response.channel) + // ); + this.subscription = response; + }); + } + + renderedCallback() { + this.handleSubscribe(); + } + + disconnectedCallback() { + unsubscribe(this.subscription, (response) => { + console.log('unsubscribe() response: ', JSON.stringify(response)); + // Response is true for successful unsubscribe + }); + } +} diff --git a/force-app/main/default/objects/Client_Profile_Update_Notification__e/Client_Profile_Update_Notification__e.object-meta.xml b/force-app/main/default/objects/Client_Profile_Update_Notification__e/Client_Profile_Update_Notification__e.object-meta.xml new file mode 100644 index 00000000..50edfda7 --- /dev/null +++ b/force-app/main/default/objects/Client_Profile_Update_Notification__e/Client_Profile_Update_Notification__e.object-meta.xml @@ -0,0 +1,8 @@ + + + Deployed + + Client Profile Update Notifications + added from sfdx plugin + StandardVolume + \ No newline at end of file diff --git a/force-app/main/default/objects/Client_Profile_Update_Notification__e/fields/ClientProfileId__c.field-meta.xml b/force-app/main/default/objects/Client_Profile_Update_Notification__e/fields/ClientProfileId__c.field-meta.xml new file mode 100644 index 00000000..221656ad --- /dev/null +++ b/force-app/main/default/objects/Client_Profile_Update_Notification__e/fields/ClientProfileId__c.field-meta.xml @@ -0,0 +1,7 @@ + + + + Text + ClientProfileId__c + 18 + \ No newline at end of file diff --git a/force-app/main/default/objects/Client_Profile_Update_Notification__e/fields/ContactId__c.field-meta.xml b/force-app/main/default/objects/Client_Profile_Update_Notification__e/fields/ContactId__c.field-meta.xml new file mode 100644 index 00000000..b80b8a1b --- /dev/null +++ b/force-app/main/default/objects/Client_Profile_Update_Notification__e/fields/ContactId__c.field-meta.xml @@ -0,0 +1,7 @@ + + + + Text + ContactId__c + 18 + \ No newline at end of file diff --git a/force-app/main/default/permissionsets/RefRecAdmin.permissionset-meta.xml b/force-app/main/default/permissionsets/RefRecAdmin.permissionset-meta.xml index ed4e70fa..2a4acb1f 100644 --- a/force-app/main/default/permissionsets/RefRecAdmin.permissionset-meta.xml +++ b/force-app/main/default/permissionsets/RefRecAdmin.permissionset-meta.xml @@ -47,6 +47,11 @@ Open_Hours__c true + + true + true + Client_Profile_Update_Notification__e + true true @@ -217,6 +222,16 @@ true Service__c.Runaway__c + + true + true + Client_Profile_Update_Notification__e.ClientProfileId__c + + + true + true + Client_Profile_Update_Notification__e.ContactId__c + Service__c Visible diff --git a/orgs/dev.json b/orgs/dev.json index 38ed7f6c..4ffb39f8 100644 --- a/orgs/dev.json +++ b/orgs/dev.json @@ -18,6 +18,9 @@ "forceRelogin": false } }, + "mobileSettings": { + "enableS1EncryptedStoragePref2": false + }, "languageSettings": { "enableTranslationWorkbench": true }