Last active
March 13, 2020 15:06
-
-
Save nautilytics/aa2f4642f1d6fca3c6ed56b3e2bdb538 to your computer and use it in GitHub Desktop.
Example files for the creation of a React + d3.js application in a Salesforce Sandbox instance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global with sharing class EventController { | |
public String accountId {get; set;} | |
public EventController() {} | |
@RemoteAction | |
global static List<Event> findEvents(String accountId) { | |
return [SELECT Type, CreatedDate, Id from Events WHERE WhoId =:accountId]; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"landing-pages": [ | |
{ | |
"path": "index.html", | |
"apex-controller": "LeadController" | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "sample_react_d3_app_salesforce", | |
"homepage": "./", | |
"scripts": { | |
"salesforce_build": "react-scripts build && cd build && zip -r SampleReactD3App.zip *", | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<aura:component implements="flexipage:availableForAllPageTypes" access="global" controller="LeadController"> | |
<lightning:card title="React D3 Sample"> | |
<lightning:container | |
aura:id="sampleReactD3App" | |
src="{!$Resource.SampleReactD3App + '/index.html'}" | |
onmessage="{!c.handleMessage}" | |
onerror="{!c.handleError}" | |
/> | |
</lightning:card> | |
</aura:component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.THIS iframe { | |
height: 500px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment