-
Notifications
You must be signed in to change notification settings - Fork 587
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1611 from alexed1/AutoNav
Auto nav
- Loading branch information
Showing
22 changed files
with
360 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# List files or directories below to ignore them when running force:source:push, force:source:pull, and force:source:status | ||
# More information: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_exclude_source.htm | ||
# | ||
|
||
package.xml | ||
|
||
# LWC configuration files | ||
**/jsconfig.json | ||
**/.eslintrc.json | ||
|
||
# LWC Jest | ||
**/__tests__/** |
4 changes: 4 additions & 0 deletions
4
flow_screen_components/AutoNavigate_Refresh/.husky/pre-commit
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npm run precommit |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# ers_AutoNavigate_Refresh | ||
|
||
Lightning Web Component for Flow Screens: **ers_AutoNavigate_Refresh** | ||
|
||
Lightning Flow Builder Name: **Auto Navigate + Console Tab Refresh** | ||
|
||
** This component is designed to be used on a FLow Screen when you need to refresh the console tabs and/or ** | ||
** automatically navigate to the previous or next screen. The refresh and navigation can be further controlled ** | ||
** by making this component conditionally visible so the action(s) will only occur when the conditional ** | ||
** visibility is true.** | ||
|
||
Additional components packaged with this LWC: | ||
|
||
Lightning Web Components: ers_AutoNavigate_RefreshCPE //TODO | ||
|
||
**Documentation:** https://unofficialsf.com/TODO/ | ||
|
||
**Created by:** Eric Smith | ||
**Date:** November 27, 2024 | ||
|
||
LinkedIn: https://www.linkedin.com/in/ericrsmith2 | ||
Salesforce: https://trailblazer.me/id/ericsmith | ||
Blog: https://ericsplayground.wordpress.com/blog/ | ||
Twitter: https://twitter.com/esmith35 | ||
|
||
--- | ||
|
||
**You must install these components FIRST in order to install and use this component** | ||
|
||
|
||
--- | ||
|
||
**Install ers_AutoNavigate_Refresh** | ||
[Version 1.0.0 (Production or Developer)](https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5G000004fz9nQAA) | ||
[Version 1.0.0 (Sandbox)](https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5G000004fz9nQAA) | ||
|
||
--- | ||
|
||
# Release Notes | ||
|
||
## 11/27/24 - Eric Smith - Version 1.0.0 |
13 changes: 13 additions & 0 deletions
13
flow_screen_components/AutoNavigate_Refresh/config/project-scratch-def.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"orgName": "Demo company", | ||
"edition": "Developer", | ||
"features": ["EnableSetPasswordInApi"], | ||
"settings": { | ||
"lightningExperienceSettings": { | ||
"enableS1DesktopEnabled": true | ||
}, | ||
"mobileSettings": { | ||
"enableS1EncryptedStoragePref2": false | ||
} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
flow_screen_components/AutoNavigate_Refresh/force-app/main/default/aura/.eslintrc.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"plugins": ["@salesforce/eslint-plugin-aura"], | ||
"extends": ["plugin:@salesforce/eslint-plugin-aura/recommended"], | ||
"rules": { | ||
"vars-on-top": "off", | ||
"no-unused-expressions": "off" | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
flow_screen_components/AutoNavigate_Refresh/force-app/main/default/lwc/.eslintrc.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"extends": ["@salesforce/eslint-config-lwc/recommended"], | ||
"overrides": [ | ||
{ | ||
"files": ["*.test.js"], | ||
"rules": { | ||
"@lwc/lwc/no-unexpected-wire-adapter-usages": "off" | ||
}, | ||
"env": { | ||
"node": true | ||
} | ||
} | ||
] | ||
} |
3 changes: 3 additions & 0 deletions
3
...Refresh/force-app/main/default/lwc/ers_AutoNavigate_Refresh/ers_AutoNavigate_Refresh.html
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<template> | ||
|
||
</template> |
88 changes: 88 additions & 0 deletions
88
...e_Refresh/force-app/main/default/lwc/ers_AutoNavigate_Refresh/ers_AutoNavigate_Refresh.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
/** | ||
* Lightning Web Component for Flow Screens: ers_AutoNavigate_Refresh | ||
* | ||
* This component is designed to be used on a Flow Screen when you need to refresh the console tabs and/or | ||
* automatically navigate to the previous or next screen. The refresh and navigation can be further controlled | ||
* by making this component conditionally visible so the action(s) will only occur when the conditional | ||
* visibility is true. | ||
* | ||
* Additional components packaged with this LWC: | ||
* | ||
* Lightning Web Components: ers_AutoNavigate_RefreshCPE //TODO | ||
* CREATED BY: Eric Smith | ||
* | ||
* VERSION: 1.0.0 | ||
* DATE: 11/27/2024 | ||
* | ||
* RELEASE NOTES: https://github.com/alexed1/LightningFlowComponents/tree/master/flow_screen_components/ers_AutoNavigate_Refresh/README.md | ||
* | ||
**/ | ||
|
||
import { LightningElement, wire, api } from 'lwc'; | ||
import { FlowNavigationBackEvent, FlowNavigationNextEvent, FlowNavigationFinishEvent } from 'lightning/flowSupport'; | ||
import { | ||
IsConsoleNavigation, | ||
getFocusedTabInfo, | ||
refreshTab | ||
} from 'lightning/platformWorkspaceApi'; | ||
|
||
export default class Ers_AutoNavigate_Refresh extends LightningElement { | ||
|
||
@api | ||
get navDirection() { | ||
return this._navDirection; | ||
} | ||
set navDirection(value) { | ||
if (value.toLowerCase() === "back" || value.toLowerCase() === "previous") { | ||
this._navDirection = "back"; | ||
} else { | ||
this._navDirection = "next"; | ||
} | ||
} | ||
_navDirection = "Next"; | ||
|
||
@api skipRefresh = false; | ||
|
||
/* SYSTEM INPUTS */ | ||
@api availableActions = []; | ||
|
||
rendered; | ||
|
||
@wire(IsConsoleNavigation) isConsoleNavigation; | ||
|
||
async refreshTab() { | ||
if (!this.isConsoleNavigation) { | ||
return; | ||
} | ||
const { tabId } = await getFocusedTabInfo(); | ||
await refreshTab(tabId, { | ||
includeAllSubtabs: true | ||
}); | ||
} | ||
|
||
renderedCallback() { | ||
|
||
if (this.rendered) | ||
return; | ||
this.rendered = true; | ||
|
||
// Refresh Console Tab | ||
if (!this.skipRefresh) { | ||
this.refreshTab(); | ||
} | ||
|
||
// Auto Navigate to Previous or Next Screen | ||
if (this._navDirection === "back" && this.availableActions.find(action => action === 'BACK')) { | ||
this.dispatchEvent(new FlowNavigationBackEvent()); | ||
} else { | ||
if (this.availableActions.find(action => action === 'FINISH')) { | ||
this.dispatchEvent(new FlowNavigationFinishEvent()); | ||
} else { | ||
this.dispatchEvent(new FlowNavigationNextEvent()); | ||
} | ||
} | ||
|
||
} | ||
|
||
} |
18 changes: 18 additions & 0 deletions
18
.../force-app/main/default/lwc/ers_AutoNavigate_Refresh/ers_AutoNavigate_Refresh.js-meta.xml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<apiVersion>62.0</apiVersion> | ||
<isExposed>true</isExposed> | ||
<masterLabel>Auto Navigate + Console Tab Refresh</masterLabel> | ||
<description>Flow screen component to refresh the console tab and auto-navigate Previous or Next/Finish - By Eric Smith</description> | ||
<targets> | ||
<target>lightning__FlowScreen</target> | ||
</targets> | ||
<targetConfigs> | ||
<targetConfig targets="lightning__FlowScreen"> | ||
<property name="navDirection" label="Navigation Direction (Default Next)" type="String" role="inputOnly" | ||
description="Next, Forward, Previous or Back" /> | ||
<property name="skipRefresh" label="Skip Console Tab Refresh? (Default False)" type="Boolean" role="inputOnly" | ||
description="Set to True to skip the console tab refresh step" /> | ||
</targetConfig> | ||
</targetConfigs> | ||
</LightningComponentBundle> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
const { jestConfig } = require('@salesforce/sfdx-lwc-jest/config'); | ||
|
||
module.exports = { | ||
...jestConfig, | ||
modulePathIgnorePatterns: ['<rootDir>/.localdevserver'] | ||
}; |
36 changes: 36 additions & 0 deletions
36
flow_screen_components/AutoNavigate_Refresh/manifest/package.xml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<Package xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<types> | ||
<members>*</members> | ||
<name>ApexClass</name> | ||
</types> | ||
<types> | ||
<members>*</members> | ||
<name>ApexComponent</name> | ||
</types> | ||
<types> | ||
<members>*</members> | ||
<name>ApexPage</name> | ||
</types> | ||
<types> | ||
<members>*</members> | ||
<name>ApexTestSuite</name> | ||
</types> | ||
<types> | ||
<members>*</members> | ||
<name>ApexTrigger</name> | ||
</types> | ||
<types> | ||
<members>*</members> | ||
<name>AuraDefinitionBundle</name> | ||
</types> | ||
<types> | ||
<members>*</members> | ||
<name>LightningComponentBundle</name> | ||
</types> | ||
<types> | ||
<members>*</members> | ||
<name>StaticResource</name> | ||
</types> | ||
<version>62.0</version> | ||
</Package> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"name": "salesforce-app", | ||
"private": true, | ||
"version": "1.0.0", | ||
"description": "Salesforce App", | ||
"scripts": { | ||
"lint": "eslint **/{aura,lwc}/**/*.js", | ||
"test": "npm run test:unit", | ||
"test:unit": "sfdx-lwc-jest", | ||
"test:unit:watch": "sfdx-lwc-jest --watch", | ||
"test:unit:debug": "sfdx-lwc-jest --debug", | ||
"test:unit:coverage": "sfdx-lwc-jest --coverage", | ||
"prettier": "prettier --write \"**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml}\"", | ||
"prettier:verify": "prettier --check \"**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml}\"", | ||
"postinstall": "husky install", | ||
"precommit": "lint-staged" | ||
}, | ||
"devDependencies": { | ||
"@lwc/eslint-plugin-lwc": "^1.1.2", | ||
"@prettier/plugin-xml": "^3.2.2", | ||
"@salesforce/eslint-config-lwc": "^3.2.3", | ||
"@salesforce/eslint-plugin-aura": "^2.0.0", | ||
"@salesforce/eslint-plugin-lightning": "^1.0.0", | ||
"@salesforce/sfdx-lwc-jest": "^5.1.0", | ||
"eslint": "^9.9.1", | ||
"eslint-plugin-import": "^2.25.4", | ||
"eslint-plugin-jest": "^28.8.1", | ||
"husky": "^9.1.5", | ||
"lint-staged": "^15.1.0", | ||
"prettier": "^3.1.0", | ||
"prettier-plugin-apex": "^2.0.1" | ||
}, | ||
"lint-staged": { | ||
"**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml}": [ | ||
"prettier --write" | ||
], | ||
"**/{aura,lwc}/**/*.js": [ | ||
"eslint" | ||
] | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
flow_screen_components/AutoNavigate_Refresh/packaging/CreateNewUnlockedPackage.bat
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@echo off | ||
if "%1" neq "" set packageName=%1 | ||
@echo on | ||
sfdx package:create -v lexhost --name "%packageName%" --path force-app --package-type Unlocked |
4 changes: 4 additions & 0 deletions
4
flow_screen_components/AutoNavigate_Refresh/packaging/CreateNewVersion.bat
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@echo off | ||
if "%1" neq "" set version=%1 | ||
@echo on | ||
sfdx package:version:create -v lexhost -w 20 -x -c -n %version%.0 -d force-app\ |
5 changes: 5 additions & 0 deletions
5
flow_screen_components/AutoNavigate_Refresh/packaging/Details.bat
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@echo off | ||
if "%1" neq "" set packageName=%1 | ||
if "%2" neq "" set version=%2 | ||
@echo on | ||
sfdx package:version:report -v lexhost --package "%packageName%@%version%" |
5 changes: 5 additions & 0 deletions
5
flow_screen_components/AutoNavigate_Refresh/packaging/Promote.bat
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@echo off | ||
if "%1" neq "" set packageName=%1 | ||
if "%2" neq "" set version=%2 | ||
@echo on | ||
sfdx package:version:promote -v lexhost --package "%packageName%@%version%" |
9 changes: 9 additions & 0 deletions
9
flow_screen_components/AutoNavigate_Refresh/packaging/SetPackageName.bat
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
@echo off | ||
if "%1" neq "" goto skipprompt | ||
set /p packageName="Set Package Name: " | ||
goto exit | ||
:skipprompt | ||
set packageName=%1 | ||
:exit | ||
echo Package Name: %packageName% | ||
@echo on |
9 changes: 9 additions & 0 deletions
9
flow_screen_components/AutoNavigate_Refresh/packaging/SetVersion.bat
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
@echo off | ||
if "%1" neq "" goto skipprompt | ||
set /p version="Set Version Number: " | ||
goto exit | ||
:skipprompt | ||
set version=%1 | ||
:exit | ||
echo Version: %version% | ||
@echo on |
4 changes: 4 additions & 0 deletions
4
flow_screen_components/AutoNavigate_Refresh/packaging/ShowVersion.bat
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@echo off | ||
echo Package Name: %packageName% | ||
echo Version: %version% | ||
@echo on |
10 changes: 10 additions & 0 deletions
10
flow_screen_components/AutoNavigate_Refresh/scripts/apex/hello.apex
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Use .apex files to store anonymous Apex. | ||
// You can execute anonymous Apex in VS Code by selecting the | ||
// apex text and running the command: | ||
// SFDX: Execute Anonymous Apex with Currently Selected Text | ||
// You can also execute the entire file by running the command: | ||
// SFDX: Execute Anonymous Apex with Editor Contents | ||
|
||
string tempvar = 'Enter_your_name_here'; | ||
System.debug('Hello World!'); | ||
System.debug('My name is ' + tempvar); |
6 changes: 6 additions & 0 deletions
6
flow_screen_components/AutoNavigate_Refresh/scripts/soql/account.soql
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Use .soql files to store SOQL queries. | ||
// You can execute queries in VS Code by selecting the | ||
// query text and running the command: | ||
// SFDX: Execute SOQL Query with Currently Selected Text | ||
|
||
SELECT Id, Name FROM Account |
20 changes: 20 additions & 0 deletions
20
flow_screen_components/AutoNavigate_Refresh/sfdx-project.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"packageDirectories": [ | ||
{ | ||
"path": "force-app", | ||
"default": true, | ||
"package": "AutoNavigate_Refresh", | ||
"versionName": "ver 0.1", | ||
"versionNumber": "0.1.0.NEXT", | ||
"versionDescription": "" | ||
} | ||
], | ||
"name": "AutoNavigate_Refresh", | ||
"namespace": "", | ||
"sfdcLoginUrl": "https://login.salesforce.com", | ||
"sourceApiVersion": "62.0", | ||
"packageAliases": { | ||
"AutoNavigate_Refresh": "0Ho5G000000sXuZSAU", | ||
"[email protected]": "04t5G000004fz9nQAA" | ||
} | ||
} |