Skip to content

Commit

Permalink
Summer '19 release (trailheadapps#51)
Browse files Browse the repository at this point in the history
* Updating API and removing MD

* [220] Implement custom Apex type instead of stringified JSON (trailheadapps#36)

* VS Code extensions properly detect hasSampleData as boolean (trailheadapps#46)

* Remove duplicate declaration of `products` property (trailheadapps#47)

* Cleaning up acct metadata

* Update lwc-jest to pre-release

* Dependency updates (trailheadapps#52)

* E-Bikes Communities repo migration (trailheadapps#53)

* Summer '19 README updates (trailheadapps#54)
  • Loading branch information
muenzpraeger authored Jun 16, 2019
1 parent 48638b0 commit 3f6086a
Show file tree
Hide file tree
Showing 266 changed files with 86,160 additions and 2,195 deletions.
18 changes: 17 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,16 @@ jobs:
name: Push Source
command: |
node_modules/sfdx-cli/bin/run force:source:push -u ciorg
deploy_community_metadata:
# This deploys the non-source metadata to the ci scratch org.
<<: *defaults
steps:
- attach_workspace:
at: ~/
- run:
name: Push Source
command: |
node_modules/sfdx-cli/bin/run force:mdapi:deploy -u ciorg --deploydir mdapiDeploy/unpackaged -w 1
create_and_test_package:
<<: *defaults
steps:
Expand Down Expand Up @@ -217,6 +227,12 @@ workflows:
filters:
branches:
ignore: master
- deploy_community_metadata:
requires:
- deploy_source
filters:
branches:
ignore: master
- create_and_test_package:
requires:
- setup_dx_orgs
Expand All @@ -225,7 +241,7 @@ workflows:
only: master
- run_apex_tests:
requires:
- deploy_source
- deploy_community_metadata
filters:
branches:
ignore: master
Expand Down
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
**/lwc/**/*.svg
**/lwc/**/*.xml
.sfdx
lcc-react-js-bike-model/
3 changes: 3 additions & 0 deletions .forceignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ package.xml

# LWC Jest
**/__tests__/**

# Allowing EBikes profile for source push/pull
!**/E-Bikes Profile.profile-meta.xml
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ yarn-error.log*

# Dependency directories
node_modules/
yarn.lock

# Eslint cache
.eslintcache
Expand All @@ -31,4 +32,5 @@ ehthumbs.db
$RECYCLE.BIN/

# VS Code project settings
.vscode/
.vscode/

1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
# More information: https://prettier.io/docs/en/ignore.html
#

lcc-react-js-bike-model/
**/staticresources/**
.sfdx
104 changes: 47 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,19 @@

![ebikes-logo](ebikes-logo.png)

E-Bikes is a sample application that demonstrates how to build applications with Lightning Web Components. E-Bikes is a fictitious electric bicycle manufacturer. The application helps E-Bikes manage their products and reseller orders using a rich user experience.

> If you want to experience Salesforce Communities with Lightning Web Components, check out the [E-Bikes Communities repository](https://github.com/trailheadapps/ebikes-communities-lwc).
E-Bikes is a sample application that demonstrates how to build applications with Lightning Web Components and integrate with Salesforce Communities. E-Bikes is a fictitious electric bicycle manufacturer. The application helps E-Bikes manage their products and reseller orders using a rich user experience.

> This sample application is designed to run on Salesforce Platform. If you want to experience Lightning Web Components on any platform, please visit https://lwc.dev, and try out our Lightning Web Components sample application [LWC Recipes OSS](https://github.com/trailheadapps/lwc-recipes-oss).
## Table of contents

- Installation Instructions

- [Installing E-Bikes using a scratch org](#installing-e-bikes-using-a-scratch-org)
- [Installing E-Bikes using an unlocked package](#installing-e-bikes-using-an-unlocked-package)
- [Installing E-Bikes using a scratch org](#installing-e-bikes-using-a-scratch-org)

- [Optional installation instructions](#optional-installation-instructions)

- [Application Walkthrough](#application-walkthrough)

## Installation Instructions
- [Salesforce Application Walkthrough](#salesforce-application-walkthrough)

There are two ways to install E-Bikes:

- [Using a Scratch Org](#installing-e-bikes-using-a-scratch-org): This is the recommended installation option. Use this option if you are a developer who wants to experience the app and the code.
- [Using an Unlocked Package](#installing-e-bikes-using-an-unlocked-package): This option allows anybody to experience the sample app without installing a local development environment.
- [Communities Application Walkthrough](#communities-application-walkthrough)

## Installing E-Bikes using a Scratch Org

Expand Down Expand Up @@ -74,57 +64,25 @@ sfdx force:user:permset:assign -n ebikes
sfdx force:data:tree:import --plan ./data/sample-data-plan.json
```

8. Open the scratch org:
8. Deploy Community metadata

```
sfdx force:org:open
sfdx force:mdapi:deploy -u ebikes --deploydir mdapiDeploy/unpackaged -w 1
```

9. In **Setup**, under **Themes and Branding**, activate the **Lightning Lite** theme.

10. In App Launcher, select the **E-Bikes** app.

## Installing E-Bikes using an Unlocked Package

1. [Sign up](https://developer.salesforce.com/signup) for a Developer Edition (DE) org.

2. Enable MyDomain in your DE org. Instructions to do this are [here](https://trailhead.salesforce.com/modules/identity_login/units/identity_login_my_domain).

3. Click [this link](https://login.salesforce.com/packaging/installPackage.apexp?p0=04tB0000000KAfOIAW) to install the E-Bikes unlocked package in your DE org.

4. Select **Install for All Users**
9. Open the scratch org:

5. In **Setup**, under **Themes and Branding**, activate the **Lightning Lite** theme.

6. Import Account data:

- Click [here](https://raw.githubusercontent.com/trailheadapps/ebikes-lwc/master/data/accounts.csv) to acccess the **accounts.csv** file. Right click in the browser window and save the file as **accounts.csv**.
- In **Setup**, type **Data Import** in the Quick Find box and click **Data Import Wizard**.
- Click **Launch Wizard**.
- Click the **Standard objects** tab, click **Accounts and Contacts**, and click **Add new records**.
- Drag the **accounts.csv** file you just saved and drop it in the upload area.
- Click **Next**, **Next**, and **Start Import**.

7. Import Product Family data:
```
sfdx force:org:open
```

- Click [here](https://raw.githubusercontent.com/trailheadapps/ebikes-lwc/master/data/product_families.csv) to acccess the **product_families.csv** file. Right click in the browser window and save the file as **product_families.csv**.
- In **Setup**, type **Data Import** in the Quick Find box and click **Data Import Wizard**.
- Click **Launch Wizard**.
- Click the **Custom objects** tab, click **Product Families**, and click **Add new records**.
- Drag the **product_families.csv** file you just saved and drop it in the upload area.
- Click **Next**, **Next**, and **Start Import**.
10. In **Setup**, under **Themes and Branding**, activate the **Lightning Lite** theme.

8. Import Product data:
11. In **Setup**, select **All Communities**. Click on **Builder** for the _E-Bikes_ Community.

- Click [here](https://raw.githubusercontent.com/trailheadapps/ebikes-lwc/master/data/products.csv) to acccess the **products.csv** file. Right click in the browser window and save the file as **products.csv**.
- In **Setup**, type **Data Import** in the Quick Find box and click **Data Import Wizard**.
- Click **Launch Wizard**.
- Click the **Custom objects** tab, click **Products**, and click **Add new records**.
- In the **Add new records** menu, under _Which Product Family field in your file do you want to match against to set the Product Family lookup field?_ select **Product Family Name** in the dropdown menu.
- Drag the **products.csv** file you just saved and drop it in the upload area.
- Click **Next**, **Next**, and **Start Import**.
12. Click **Publish**, to publish the community. Click on the workspace icon in the top left corner, then click **View E-Bikes** to see the live community.

9. In App Launcher, select the **E-Bikes** app.
13. For experiencing the Salesforce app, open the App Launcher, and select the **E-Bikes** app.

## Optional Installation Instructions

Expand Down Expand Up @@ -156,7 +114,7 @@ npm run lint:lwc
npm run prettier
```

## Application Walkthrough
## Salesforce Application Walkthrough

### Product Explorer

Expand Down Expand Up @@ -191,3 +149,35 @@ npm run prettier
### Account Record Page

The account record page features an **Account Map** component that locates the account on a map.

## Communities Application Walkthrough

### Home

1. See the custom hero component in Communities that pulls in rich assets and navigates to the product or product family that is configured.

2. Check all the properties exposed in the hero component in Community Builder.

### Create Case

1. Select the _My Cases_ list view in the record list on the right side of the page.

2. Fill in the details of the case on the left side of the page.

3. Click on Create Case and see the record list to be updated with your new case.

### Product Explorer

1. Click the **Product Explorer** tab.

2. Filter the list using the filter component in the left sidebar.

3. Click a product in the tile list to see the details in the product card.

4. Click the expand icon in the product card to navigate to the product record page.

### Product Record Page

1. The product record page features a **Similar Products** component.

2. Click the **View Details** button to navigate to a similar product record page.
4 changes: 1 addition & 3 deletions bin/check-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ const pjson = require('../package.json');
const version = pjson.engines.node;
if (!semver.satisfies(process.version, version)) {
console.log(
`\n\nRequired node version ${version} not satisfied with current version ${
process.version
}.\n\n`
`\n\nRequired node version ${version} not satisfied with current version ${process.version}.\n\n`
);
process.exit(1);
}
15 changes: 15 additions & 0 deletions bin/orgInit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

DURATION=7

if [ "$#" -eq 1 ]; then
DURATION=$1
fi

sfdx force:org:create -a ebikes -s -f config/project-scratch-def.json -d $DURATION
sfdx force:source:push
sfdx force:user:permset:assign -n ebikes
sfdx force:data:tree:import --plan ./data/sample-data-plan.json
sfdx force:mdapi:deploy -u ebikes --deploydir mdapiDeploy/unpackaged -w 1
sfdx force:org:open -p /lightning/page/home
echo "Org is set up"
4 changes: 3 additions & 1 deletion config/project-scratch-def.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"orgName": "Ebikes",
"edition": "Developer",
"hasSampleData": "false",
"hasSampleData": false,
"features": ["Communities", "Sites"],
"settings": {
"orgPreferenceSettings": {
"networksEnabled": true,
"s1DesktopEnabled": true,
"selfSetPasswordInApi": true,
"s1EncryptedStoragePref2": false
Expand Down
9 changes: 9 additions & 0 deletions force-app/main/default/applications/EBikes.app-meta.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@
<logoVersion>1</logoVersion>
<shouldOverrideOrgTheme>false</shouldOverrideOrgTheme>
</brand>
<actionOverrides>
<actionName>View</actionName>
<comment>Action override created by Lightning App Builder on activation. Added manually because this isn't registered by force:source:pull.</comment>
<content>Account_Record_Page</content>
<formFactor>Large</formFactor>
<skipRecordTypeSelect>false</skipRecordTypeSelect>
<type>Flexipage</type>
<pageOrSobjectType>Account</pageOrSobjectType>
</actionOverrides>
<formFactors>Large</formFactors>
<label>E-Bikes</label>
<navType>Standard</navType>
Expand Down
12 changes: 12 additions & 0 deletions force-app/main/default/aura/bikeCustomizer/bikeCustomizer.cmp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<aura:component
implements="flexipage:availableForAllPageTypes,forceCommunity:availableForAllPageTypes"
access="global"
>
<lightning:container
aura:id="jsApp"
src="{!$Resource.lccEbikes + '/index.html'}"
/>
<c:bikeCustomizerButtonBar
onchange="{!c.handleChange}"
></c:bikeCustomizerButtonBar>
</aura:component>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<AuraDefinitionBundle xmlns="urn:metadata.tooling.soap.sforce.com" fqn="bikeCustomizer">
<apiVersion>46.0</apiVersion>
<description>A Lightning Component Bundle</description>
</AuraDefinitionBundle>
8 changes: 8 additions & 0 deletions force-app/main/default/aura/bikeCustomizer/bikeCustomizer.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.THIS {
margin-bottom: 15px;
}

.THIS iframe {
height: 400px;
width: 100%;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<design:component label="Bike Customizer"></design:component>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
({
handleChange: function(component, event) {
var bikePart = event.getParam('bikePart');
var color = event.getParam('color');

if (color) {
var changeColorMsg = {
name: 'change-color',
value: {
detail: {
meshName: bikePart,
color: color
}
}
};
component.find('jsApp').message(changeColorMsg);
}
var moveCameraMsg = {
name: 'move-camera',
value: {
detail: bikePart
}
};
component.find('jsApp').message(moveCameraMsg);
}
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<aura:component
access="global"
implements="forceCommunity:availableForAllPageTypes"
description="Aura Component wrapper around LWC to handle refreshView event. Create Case is the LWC component handling the create case form."
>
<c:createCase onrefresh="{!c.handleRefresh}" />
</aura:component>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<AuraDefinitionBundle xmlns="urn:metadata.tooling.soap.sforce.com" fqn="createAndRefreshCase">
<apiVersion>46.0</apiVersion>
<description>A Lightning Component Bundle</description>
<masterLabel>Create and Refresh Case (Aura)</masterLabel>
</AuraDefinitionBundle>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
({
handleRefresh: function(component, event) {
$A.get('e.force:refreshView').fire();
}
});
Loading

0 comments on commit 3f6086a

Please sign in to comment.