Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: pozil/sfdc-ui-lookup-lwc
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.0.6
Choose a base ref
...
head repository: pozil/sfdc-ui-lookup-lwc
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 22,125 additions and 9,909 deletions.
  1. +0 −6 .eslintignore
  2. +5 −1 .forceignore
  3. +4 −0 .github/CODEOWNERS
  4. +112 −0 .github/workflows/ci-pr.yml
  5. +106 −0 .github/workflows/ci.yml
  6. +0 −96 .github/workflows/scratch-org-sfdx-ci.yml
  7. +1 −0 .gitignore
  8. +1 −0 .husky/.gitignore
  9. +4 −0 .husky/pre-commit
  10. +3 −1 .prettierignore
  11. +5 −0 .prettierrc
  12. +284 −65 README.md
  13. +16 −0 codecov.yml
  14. +41 −0 install-dev.bat
  15. +4 −4 install-dev.sh
  16. +0 −10 install-scripts/check-version.js
  17. +41 −0 jest-mocks/lightning/navigation.js
  18. +3 −0 jest-sa11y-setup.js
  19. +11 −0 jest.config.js
  20. +20,013 −9,196 package-lock.json
  21. +32 −34 package.json
  22. BIN screenshots/dropdown-open.png
  23. BIN screenshots/lookup-animation.gif
  24. +1 −1 sfdx-project.json
  25. +2 −2 src-sample/main/default/aura/SampleLookupApp/SampleLookupApp.app-meta.xml
  26. +1 −6 src-sample/main/default/aura/SampleLookupAppTemplate/SampleLookupAppTemplate.cmp
  27. +2 −2 src-sample/main/default/aura/SampleLookupAppTemplate/SampleLookupAppTemplate.cmp-meta.xml
  28. +48 −17 src-sample/main/default/classes/SampleLookupController.cls
  29. +2 −2 src-sample/main/default/classes/SampleLookupController.cls-meta.xml
  30. +0 −43 src-sample/main/default/classes/SampleLookupControllerTest.cls
  31. +48 −0 src-sample/main/default/classes/SampleLookupControllerTests.cls
  32. +3 −3 ...ault/classes/{SampleLookupControllerTest.cls-meta.xml → SampleLookupControllerTests.cls-meta.xml}
  33. +9 −1 src-sample/main/default/lwc/.eslintrc.json
  34. +34 −14 src-sample/main/default/lwc/sampleLookupContainer/sampleLookupContainer.html
  35. +92 −39 src-sample/main/default/lwc/sampleLookupContainer/sampleLookupContainer.js
  36. +3 −3 src-sample/main/default/lwc/sampleLookupContainer/sampleLookupContainer.js-meta.xml
  37. +33 −15 src/main/default/classes/LookupSearchResult.cls
  38. +2 −2 src/main/default/classes/LookupSearchResult.cls-meta.xml
  39. +58 −0 src/main/default/classes/LookupSearchResultTests.cls
  40. +5 −0 src/main/default/classes/LookupSearchResultTests.cls-meta.xml
  41. +9 −1 src/main/default/lwc/.eslintrc.json
  42. +127 −32 src/main/default/lwc/lookup/__tests__/lookupEventFiring.test.js
  43. +171 −35 src/main/default/lwc/lookup/__tests__/lookupEventHandling.test.js
  44. +92 −32 src/main/default/lwc/lookup/__tests__/lookupExposedFunctions.test.js
  45. +209 −52 src/main/default/lwc/lookup/__tests__/lookupRendering.test.js
  46. +57 −0 src/main/default/lwc/lookup/__tests__/lookupTest.utils.js
  47. +11 −2 src/main/default/lwc/lookup/lookup.css
  48. +94 −64 src/main/default/lwc/lookup/lookup.html
  49. +323 −125 src/main/default/lwc/lookup/lookup.js
  50. +3 −3 src/main/default/lwc/lookup/lookup.js-meta.xml
6 changes: 0 additions & 6 deletions .eslintignore

This file was deleted.

6 changes: 5 additions & 1 deletion .forceignore
Original file line number Diff line number Diff line change
@@ -6,4 +6,8 @@ package.xml
**/.eslintrc.json

# LWC Jest
**/__tests__/**
**/__tests__/**

# TS configuration files
**/tsconfig.json
**/*.ts
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Default owners for everything in the repo.
# They will be assigned for review on all PRs.
* @pozil
#ECCN:EAR99
112 changes: 112 additions & 0 deletions .github/workflows/ci-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# Unique name for this workflow
name: CI (PR)

# Definition when the workflow should run
on:
workflow_dispatch:
pull_request:
types: [opened, edited, synchronize, reopened]

# Jobs to be executed
jobs:
formatting-and-lwc-tests:
runs-on: ubuntu-latest
steps:
# Checkout the code in the pull request
- name: 'Checkout source code'
uses: actions/checkout@v4

# Install Volta to enforce proper node and package manager versions
- name: 'Install Volta'
uses: volta-cli/action@v4

# Cache node_modules to speed up the process
- name: 'Restore node_modules cache'
id: cache-npm
uses: actions/cache@v4
with:
path: node_modules
key: npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
npm-${{ env.cache-name }}-
npm-
# Install npm dependencies for Prettier and Jest
- name: 'Install npm dependencies'
if: steps.cache-npm.outputs.cache-hit != 'true'
run: npm ci

# Prettier formatting
- name: 'Code formatting'
run: npm run prettier:verify

# ESlint
- name: 'Linting'
run: npm run lint

# LWC unit tests
- name: 'LWC unit tests'
run: npm run test:coverage

# Upload code coverage data
- name: 'Upload code coverage for LWC to Codecov.io'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: LWC

scratch-org-tests:
runs-on: ubuntu-latest
needs: formatting-and-lwc-tests
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
# Checkout the code in the pull request
- name: 'Checkout source code'
uses: actions/checkout@v4

# Install Salesforce CLI
- name: 'Install Salesforce CLI'
run: |
npm install @salesforce/cli --location=global
nodeInstallPath=$(npm config get prefix)
echo "$nodeInstallPath/bin" >> $GITHUB_PATH
sf --version
# Store secret for dev hub
- name: 'Populate auth file with DEVHUB_SFDX_URL secret'
shell: bash
run: |
echo ${{ secrets.DEVHUB_SFDX_URL}} > ./DEVHUB_SFDX_URL.txt
secretFileSize=$(wc -c "./DEVHUB_SFDX_URL.txt" | awk '{print $1}')
if [ $secretFileSize == 1 ]; then
echo "Missing DEVHUB_SFDX_URL secret. Is this workflow running on a fork?";
exit 1;
fi
# Authenticate dev hub
- name: 'Authenticate Dev Hub'
run: sf org login sfdx-url -f ./DEVHUB_SFDX_URL.txt -a devhub -d

# Create scratch org
- name: 'Create scratch org'
run: sf org create scratch -f config/project-scratch-def.json -a scratch-org -d -y 1

# Deploy source to scratch org
- name: 'Push source'
run: sf project deploy start

# Run Apex tests in scratch org
- name: 'Run Apex tests'
run: sf apex test run -c -r human -d ./tests/apex -w 20

# Upload Apex code coverage data
- name: 'Upload code coverage for Apex to Codecov.io'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: Apex

# Housekeeping
- name: 'Delete scratch org'
if: always()
run: sf org delete scratch -p -o scratch-org
106 changes: 106 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# Unique name for this workflow
name: CI

# Definition when the workflow should run
on:
workflow_dispatch:
push:
branches:
- master

# Jobs to be executed
jobs:
formatting-and-lwc-tests:
runs-on: ubuntu-latest
steps:
# Checkout the code in the pull request
- name: 'Checkout source code'
uses: actions/checkout@v4

# Install Volta to enforce proper node and package manager versions
- name: 'Install Volta'
uses: volta-cli/action@v4

# Cache node_modules to speed up the process
- name: 'Restore node_modules cache'
id: cache-npm
uses: actions/cache@v4
with:
path: node_modules
key: npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
npm-${{ env.cache-name }}-
npm-
# Install npm dependencies for Prettier and Jest
- name: 'Install npm dependencies'
if: steps.cache-npm.outputs.cache-hit != 'true'
run: npm ci

# Prettier formatting
- name: 'Code formatting'
run: npm run prettier:verify

# ESlint
- name: 'Linting'
run: npm run lint

# LWC unit tests
- name: 'LWC unit tests'
run: npm run test:coverage

# Upload LWC code coverage data
- name: 'Upload code coverage for LWC to Codecov.io'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: LWC

scratch-org-tests:
runs-on: ubuntu-latest
needs: formatting-and-lwc-tests
steps:
# Checkout the code in the pull request
- name: 'Checkout source code'
uses: actions/checkout@v4

# Install Salesforce CLI
- name: 'Install Salesforce CLI'
run: |
npm install @salesforce/cli --location=global
nodeInstallPath=$(npm config get prefix)
echo "$nodeInstallPath/bin" >> $GITHUB_PATH
sf --version
# Store secret for dev hub
- name: 'Populate auth file with DEVHUB_SFDX_URL secret'
shell: bash
run: echo ${{ secrets.DEVHUB_SFDX_URL}} > ./DEVHUB_SFDX_URL.txt

# Authenticate dev hub
- name: 'Authenticate Dev Hub'
run: sf org login sfdx-url -f ./DEVHUB_SFDX_URL.txt -a devhub -d

# Create scratch org
- name: 'Create scratch org'
run: sf org create scratch -f config/project-scratch-def.json -a scratch-org -d -y 1

# Deploy source to scratch org
- name: 'Push source'
run: sf project deploy start

# Run Apex tests in scratch org
- name: 'Run Apex tests'
run: sf apex test run -c -r human -d ./tests/apex -w 20

# Upload Apex code coverage data
- name: 'Upload code coverage for Apex to Codecov.io'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: Apex

# Housekeeping
- name: 'Delete scratch org'
if: always()
run: sf org delete scratch -p -o scratch-org
96 changes: 0 additions & 96 deletions .github/workflows/scratch-org-sfdx-ci.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
**/__MACOSX
**/.DS_Store
**/jsconfig.json
.sf
.sfdx
.vscode
.localdevserver
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run precommit
4 changes: 3 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.localdevserver
.sf
.sfdx
.vscode
**/jsconfig.json
**/jsconfig.json
/coverage
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -2,6 +2,11 @@
"trailingComma": "none",
"singleQuote": true,
"tabWidth": 4,
"printWidth": 120,
"plugins": [
"prettier-plugin-apex",
"@prettier/plugin-xml"
],
"overrides": [
{
"files": "**/lwc/**/*.html",
Loading