Skip to content

Commit 102d8cb

Browse files
RubenHalmanjunners
authored andcommitted
resync project files
1 parent 30b4780 commit 102d8cb

File tree

8 files changed

+76
-82
lines changed

8 files changed

+76
-82
lines changed

example-flows/README.md

Lines changed: 16 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,27 @@
1-
# ⚡️ Lightning Flow Scanner Demo Flows
1+
# Lightning Flow Scanner Demo Repository
22

3-
Welcome to the **Lightning Flow Scanner Demo Flows**! This project includes a curated set of Salesforce Flow metadata files (`.flow-meta.xml`) intended for:
3+
Welcome to the Lightning Flow Scanner Demo Repository! Get up and running and try the Lightning Flow Scanner now using our Demo Flows. We've prepared a set of example flows that showcase various types of violations, as well as flows that demonstrate how to resolve them. This repository is designed to provide you with practical examples of best practices, ensuring you have valuable resources at your fingertips to improve your code scanning and development process. Explore, learn, and enhance your Salesforce Flow scanning capabilities with our curated test data and sample flows. Happy flow building! 🚀🌟
44

5-
- ✅ Demonstrating best practices and violations detectable by [Lightning Flow Scanner](https://github.com/Lightning-Flow-Scanner)
6-
- 🧪 Serving as a reliable input set for automated testing in the main scanner repository
7-
- 🚀 Easy deployment to any org using the Salesforce CLI
5+
## Getting Started
86

9-
These flows are designed to support testing, demoing, and local development without maintaining a separate demo repository.
7+
Follow these steps to get up and running with the Lightning Flow Scanner Demo Repository and try out our demo flows:
108

11-
---
9+
### Step 1: Clone the Repository
10+
To clone the repository, press Ctrl+Shift+P on Windows or Shift+⌘+P on macOS to open the command palette and use the Git Clone command. Alternatively, you can click the link below to clone the repository:
1211

13-
## 🔧 Usage
12+
![Clone this repo](https://raw.githubusercontent.com/Force-Config-Control/Force-Flow-Control-Examples/master/docs/CloneRepository.png)
1413

15-
You can deploy the demo flows using:
14+
### Step 2: Open in Editor
15+
When prompted, select to open the repository. This will open the cloned repository in your preferred code editor. You can also click the link below for direct access:
1616

17-
```bash
18-
npm run deploy:testflows -- --target-org my-sandbox
19-
```
17+
![Open in Editor](https://raw.githubusercontent.com/Force-Config-Control/Force-Flow-Control-Examples/master/docs/OpenDirectory.png)
2018

21-
Or with an environment variable:
19+
### Step 3: Install Recommended Extensions
20+
Upon opening the repository, you may be prompted to install recommended extensions. It's essential to do this to ensure a smooth experience when working with the Lightning Flow Scanner. Click the link below for reference:
2221

23-
```bash
24-
SF_TARGET_ORG=my-sandbox npm run deploy:testflows
25-
```
22+
![Install Recommended Extensions](https://raw.githubusercontent.com/Force-Config-Control/Force-Flow-Control-Examples/master/docs/InstallRecommendedExtensions.png)
2623

27-
---
24+
### Step 4: Run Flow Commands
25+
Press Ctrl+Shift+P on Windows or Shift+⌘+P on macOS to open the command palette and type `Flow` to see the available commands from Lightning Flow Scanner. Examples of how the commands run can be found in the [Readme of the Extension repository](https://github.com/Force-Config-Control/lightning-flow-scanner-vsce).
2826

29-
## 📁 Project Structure
30-
31-
This is a standard Salesforce DX project structure:
32-
33-
```
34-
example-flows/
35-
└── force-app/
36-
└── main/
37-
└── default/
38-
└── flows/
39-
├── Copy_API_Name.flow-meta.xml
40-
├── Hardcoded_Id.flow-meta.xml
41-
├── ...
42-
```
43-
44-
---
45-
46-
## 🧪 Connected to Unit Tests
47-
48-
These flows are directly referenced by unit tests in the main [`lightning-flow-scanner-core`](https://github.com/Lightning-Flow-Scanner/lightning-flow-scanner-core) repository. Tests point to:
49-
50-
```
51-
../example-flows/force-app/main/default/flows/
52-
```
53-
54-
No more maintaining a separate flows repo! 🎉
55-
56-
---
57-
58-
## 💡 Want to Explore in VS Code?
59-
60-
1. **Clone this repo**
61-
- `git clone https://github.com/Lightning-Flow-Scanner/lightning-flow-scanner-core.git`
62-
2. **Open `example-flows/` in VS Code**
63-
3. **Install recommended extensions when prompted**
64-
4. Use Salesforce CLI or the Lightning Flow Scanner VS Code extension to scan and analyze the flows.
65-
66-
---
67-
68-
## 🧩 Recommended VS Code Extensions
69-
70-
- [Lightning Flow Scanner Extension](https://marketplace.visualstudio.com/items?itemName=ForceConfigControl.lightningflowscanner)
71-
72-
## 📖 Resources
73-
74-
- [Lightning Flow Scanner Core](https://github.com/Lightning-Flow-Scanner/lightning-flow-scanner-core)
75-
- [Lightning Flow Scanner VS Code Extension](https://marketplace.visualstudio.com/items?itemName=ForceConfigControl.lightningflowscanner)
76-
- [Salesforce DX Documentation](https://developer.salesforce.com/tools/sfdxcli)
77-
78-
---
79-
80-
Happy Flow Scanning! 🚦✨
27+
![Flow Commands](https://raw.githubusercontent.com/Force-Config-Control/Force-Flow-Control-Examples/master/docs/FlowCommands.png)

example-flows/config/project-scratch-def.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"orgName": "Lightning Flow Scanner",
2+
"orgName": "LFS Org",
33
"edition": "Developer",
44
"features": ["EnableSetPasswordInApi"],
55
"settings": {
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"plugins": ["@salesforce/eslint-plugin-aura"],
3+
"extends": ["plugin:@salesforce/eslint-plugin-aura/recommended"],
4+
"rules": {
5+
"vars-on-top": "off",
6+
"no-unused-expressions": "off"
7+
}
8+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
@isTest
2+
private class SOQLQueryInLoopFixedTest {
3+
4+
@isTest
5+
static void testFlowExecution() {
6+
// Create test data
7+
Account acc = new Account(Name = 'Test Account', Industry = 'None');
8+
insert acc;
9+
10+
// Start the flow
11+
Test.startTest();
12+
// Replace 'FlowNamespace' with the appropriate namespace if the flow is in a namespace
13+
Flow.Interview curInterview = Flow.Interview.createInterview('', 'Fixed_SOQL_Query_In_A_Loop_Fixed', new Map<String, Object>{ 'Accounts' => new List<Account>{ acc } });
14+
curInterview.start();
15+
16+
Test.stopTest();
17+
18+
}
19+
}
20+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
3+
<apiVersion>59.0</apiVersion>
4+
<status>Active</status>
5+
</ApexClass>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"extends": ["@salesforce/eslint-config-lwc/recommended"],
3+
"overrides": [
4+
{
5+
"files": ["*.test.js"],
6+
"rules": {
7+
"@lwc/lwc/no-unexpected-wire-adapter-usages": "off"
8+
},
9+
"env": {
10+
"node": true
11+
}
12+
}
13+
]
14+
}

example-flows/package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,30 @@
44
"version": "1.0.0",
55
"description": "Salesforce App",
66
"scripts": {
7-
"lint": "eslint **/{aura,lwc}/**/*.js",
7+
"lint": "eslint **/{aura,lwc}/**",
88
"test": "npm run test:unit",
99
"test:unit": "sfdx-lwc-jest",
1010
"test:unit:watch": "sfdx-lwc-jest --watch",
1111
"test:unit:debug": "sfdx-lwc-jest --debug",
1212
"test:unit:coverage": "sfdx-lwc-jest --coverage",
1313
"prettier": "prettier --write \"**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml}\"",
14-
"prettier:verify": "prettier --check \"**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml}\"",
14+
"prettier:verify": "prettier --list-different \"**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml}\"",
1515
"postinstall": "husky install",
1616
"precommit": "lint-staged"
1717
},
1818
"devDependencies": {
1919
"@lwc/eslint-plugin-lwc": "^1.1.2",
20-
"@prettier/plugin-xml": "^3.2.2",
20+
"@prettier/plugin-xml": "^2.0.1",
2121
"@salesforce/eslint-config-lwc": "^3.2.3",
2222
"@salesforce/eslint-plugin-aura": "^2.0.0",
2323
"@salesforce/eslint-plugin-lightning": "^1.0.0",
24-
"@salesforce/sfdx-lwc-jest": "^7.0.1",
25-
"eslint": "8.57.1",
24+
"@salesforce/sfdx-lwc-jest": "^1.1.0",
25+
"eslint": "^8.11.0",
2626
"eslint-plugin-import": "^2.25.4",
27-
"eslint-plugin-jest": "^28.8.1",
28-
"husky": "^9.1.5",
29-
"lint-staged": "^15.1.0",
30-
"prettier": "^3.1.0",
31-
"prettier-plugin-apex": "^2.0.1"
27+
"eslint-plugin-jest": "^26.1.2",
28+
"husky": "^7.0.4",
29+
"lint-staged": "^12.3.7",
30+
"prettier": "^2.6.0",
31+
"prettier-plugin-apex": "^1.10.0"
3232
}
3333
}

example-flows/sfdx-project.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"default": true
66
}
77
],
8-
"name": "example-flows",
8+
"name": "FlowDemo",
99
"namespace": "",
1010
"sfdcLoginUrl": "https://login.salesforce.com",
11-
"sourceApiVersion": "62.0"
11+
"sourceApiVersion": "63.0"
1212
}

0 commit comments

Comments
 (0)