commit eee10ecfb9661f40bd9e8c4cfbabbefcd311235e Author: Levi Olson Date: Wed Feb 19 16:00:10 2020 -0600 Initial Commit diff --git a/.forceignore b/.forceignore new file mode 100755 index 0000000..7b5b5a7 --- /dev/null +++ b/.forceignore @@ -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__/** \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100755 index 0000000..e93464f --- /dev/null +++ b/.gitignore @@ -0,0 +1,29 @@ +# This file is used for Git repositories to specify intentionally untracked files that Git should ignore. +# If you are not using git, you can delete this file. For more information see: https://git-scm.com/docs/gitignore +# For useful gitignore templates see: https://github.com/github/gitignore + +# Salesforce cache +.sfdx/ +.localdevserver/ + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Dependency directories +node_modules/ + +# Eslint cache +.eslintcache + +# MacOS system files +.DS_Store + +# Windows system files +Thumbs.db +ehthumbs.db +[Dd]esktop.ini +$RECYCLE.BIN/ \ No newline at end of file diff --git a/.prettierignore b/.prettierignore new file mode 100755 index 0000000..65adc9d --- /dev/null +++ b/.prettierignore @@ -0,0 +1,6 @@ +# List files or directories below to ignore them when running prettier +# More information: https://prettier.io/docs/en/ignore.html +# + +.sfdx +.localdevserver \ No newline at end of file diff --git a/.prettierrc b/.prettierrc new file mode 100755 index 0000000..15683b6 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,13 @@ +{ + "trailingComma": "none", + "overrides": [ + { + "files": "**/lwc/**/*.html", + "options": { "parser": "lwc" } + }, + { + "files": "*.{cmp,page,component}", + "options": { "parser": "html" } + } + ] +} diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100755 index 0000000..05312a2 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,8 @@ +{ + "recommendations": [ + "salesforce.salesforcedx-vscode", + "redhat.vscode-xml", + "dbaeumer.vscode-eslint", + "esbenp.prettier-vscode" + ] +} diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100755 index 0000000..e07e391 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,16 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Launch Apex Replay Debugger", + "type": "apex-replay", + "request": "launch", + "logFile": "${command:AskForLogFileName}", + "stopOnEntry": true, + "trace": true + } + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100755 index 0000000..6a3ee15 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,8 @@ +{ + "search.exclude": { + "**/node_modules": true, + "**/bower_components": true, + "**/.sfdx": true + }, + "eslint.nodePath": "/Users/leviolson/.vscode/extensions/salesforce.salesforcedx-vscode-lwc-47.17.1/node_modules" +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100755 index 0000000..34baf84 --- /dev/null +++ b/README.md @@ -0,0 +1,58 @@ +# Salesforce App + +This guide helps Salesforce developers who are new to Visual Studio Code go from zero to a deployed app using Salesforce Extensions for VS Code and Salesforce CLI. + +## Part 1: Choosing a Development Model + +There are two types of developer processes or models supported in Salesforce Extensions for VS Code and Salesforce CLI. These models are explained below. Each model offers pros and cons and is fully supported. + +### Package Development Model + +The package development model allows you to create self-contained applications or libraries that are deployed to your org as a single package. These packages are typically developed against source-tracked orgs called scratch orgs. This development model is geared toward a more modern type of software development process that uses org source tracking, source control, and continuous integration and deployment. + +If you are starting a new project, we recommend that you consider the package development model. To start developing with this model in Visual Studio Code, see [Package Development Model with VS Code](https://forcedotcom.github.io/salesforcedx-vscode/articles/user-guide/package-development-model). For details about the model, see the [Package Development Model](https://trailhead.salesforce.com/en/content/learn/modules/sfdx_dev_model) Trailhead module. + +If you are developing against scratch orgs, use the command `SFDX: Create Project` (VS Code) or `sfdx force:project:create` (Salesforce CLI) to create your project. If you used another command, you might want to start over with that command. + +When working with source-tracked orgs, use the commands `SFDX: Push Source to Org` (VS Code) or `sfdx force:source:push` (Salesforce CLI) and `SFDX: Pull Source from Org` (VS Code) or `sfdx force:source:pull` (Salesforce CLI). Do not use the `Retrieve` and `Deploy` commands with scratch orgs. + +### Org Development Model + +The org development model allows you to connect directly to a non-source-tracked org (sandbox, Developer Edition (DE) org, Trailhead Playground, or even a production org) to retrieve and deploy code directly. This model is similar to the type of development you have done in the past using tools such as Force.com IDE or MavensMate. + +To start developing with this model in Visual Studio Code, see [Org Development Model with VS Code](https://forcedotcom.github.io/salesforcedx-vscode/articles/user-guide/org-development-model). For details about the model, see the [Org Development Model](https://trailhead.salesforce.com/content/learn/modules/org-development-model) Trailhead module. + +If you are developing against non-source-tracked orgs, use the command `SFDX: Create Project with Manifest` (VS Code) or `sfdx force:project:create --manifest` (Salesforce CLI) to create your project. If you used another command, you might want to start over with this command to create a Salesforce DX project. + +When working with non-source-tracked orgs, use the commands `SFDX: Deploy Source to Org` (VS Code) or `sfdx force:source:deploy` (Salesforce CLI) and `SFDX: Retrieve Source from Org` (VS Code) or `sfdx force:source:retrieve` (Salesforce CLI). The `Push` and `Pull` commands work only on orgs with source tracking (scratch orgs). + +## The `sfdx-project.json` File + +The `sfdx-project.json` file contains useful configuration information for your project. See [Salesforce DX Project Configuration](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_ws_config.htm) in the _Salesforce DX Developer Guide_ for details about this file. + +The most important parts of this file for getting started are the `sfdcLoginUrl` and `packageDirectories` properties. + +The `sfdcLoginUrl` specifies the default login URL to use when authorizing an org. + +The `packageDirectories` filepath tells VS Code and Salesforce CLI where the metadata files for your project are stored. You need at least one package directory set in your file. The default setting is shown below. If you set the value of the `packageDirectories` property called `path` to `force-app`, by default your metadata goes in the `force-app` directory. If you want to change that directory to something like `src`, simply change the `path` value and make sure the directory you’re pointing to exists. + +```json +"packageDirectories" : [ + { + "path": "force-app", + "default": true + } +] +``` + +## Part 2: Working with Source + +For details about developing against scratch orgs, see the [Package Development Model](https://trailhead.salesforce.com/en/content/learn/modules/sfdx_dev_model) module on Trailhead or [Package Development Model with VS Code](https://forcedotcom.github.io/salesforcedx-vscode/articles/user-guide/package-development-model). + +For details about developing against orgs that don’t have source tracking, see the [Org Development Model](https://trailhead.salesforce.com/content/learn/modules/org-development-model) module on Trailhead or [Org Development Model with VS Code](https://forcedotcom.github.io/salesforcedx-vscode/articles/user-guide/org-development-model). + +## Part 3: Deploying to Production + +Don’t deploy your code to production directly from Visual Studio Code. The deploy and retrieve commands do not support transactional operations, which means that a deployment can fail in a partial state. Also, the deploy and retrieve commands don’t run the tests needed for production deployments. The push and pull commands are disabled for orgs that don’t have source tracking, including production orgs. + +Deploy your changes to production using [packaging](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_dev2gp.htm) or by [converting your source](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_force_source.htm#cli_reference_convert) into metadata format and using the [metadata deploy command](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_force_mdapi.htm#cli_reference_deploy). \ No newline at end of file diff --git a/config/project-scratch-def.json b/config/project-scratch-def.json new file mode 100755 index 0000000..a3ba19b --- /dev/null +++ b/config/project-scratch-def.json @@ -0,0 +1,5 @@ +{ + "orgName": "leviolson company", + "edition": "Developer", + "features": [] +} diff --git a/force-app/main/default/lwc/.eslintrc.json b/force-app/main/default/lwc/.eslintrc.json new file mode 100755 index 0000000..c9f0b19 --- /dev/null +++ b/force-app/main/default/lwc/.eslintrc.json @@ -0,0 +1,6 @@ +{ + "extends": ["@salesforce/eslint-config-lwc/recommended"], + "rules": { + "no-console": "off" + } +} diff --git a/force-app/main/default/lwc/customLayout/customLayout.html b/force-app/main/default/lwc/customLayout/customLayout.html new file mode 100755 index 0000000..615a95b --- /dev/null +++ b/force-app/main/default/lwc/customLayout/customLayout.html @@ -0,0 +1,8 @@ + diff --git a/force-app/main/default/lwc/customLayout/customLayout.js b/force-app/main/default/lwc/customLayout/customLayout.js new file mode 100755 index 0000000..b56c969 --- /dev/null +++ b/force-app/main/default/lwc/customLayout/customLayout.js @@ -0,0 +1,19 @@ +import { LightningElement } from 'lwc'; +import { BaseLayout } from "vlocity_cmt/baseLayout"; + +export default class CustomLayout extends BaseLayout(LightningElement) { + // @api recordId; + // @api theme; + // @api parent; + // @api definition; + // @api isLoaded; + // @api debug; + // @api records; + + connectedCallback() { + this.cards = this.definition.Cards; + console.log("This is definition object", JSON.parse(JSON.stringify(this.definition))); + console.log("This is records", JSON.parse(JSON.stringify(this.records))); + console.log("This is cards", JSON.parse(JSON.stringify(this.cards))); + } +} diff --git a/force-app/main/default/lwc/customLayout/customLayout.js-meta.xml b/force-app/main/default/lwc/customLayout/customLayout.js-meta.xml new file mode 100755 index 0000000..e645336 --- /dev/null +++ b/force-app/main/default/lwc/customLayout/customLayout.js-meta.xml @@ -0,0 +1,6 @@ + + + 47.0 + true + vlocity_cmt + diff --git a/force-app/main/default/lwc/helloWorld/helloWorld.html b/force-app/main/default/lwc/helloWorld/helloWorld.html new file mode 100755 index 0000000..5294f0e --- /dev/null +++ b/force-app/main/default/lwc/helloWorld/helloWorld.html @@ -0,0 +1,8 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/helloWorld/helloWorld.js b/force-app/main/default/lwc/helloWorld/helloWorld.js new file mode 100755 index 0000000..b51c053 --- /dev/null +++ b/force-app/main/default/lwc/helloWorld/helloWorld.js @@ -0,0 +1,8 @@ +import { LightningElement, track } from 'lwc'; + +export default class HelloWorld extends LightningElement { + @track greeting = 'World'; + changeHandler (event) { + this.greeting = event.target.value; + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/helloWorld/helloWorld.js-meta.xml b/force-app/main/default/lwc/helloWorld/helloWorld.js-meta.xml new file mode 100755 index 0000000..ea8665d --- /dev/null +++ b/force-app/main/default/lwc/helloWorld/helloWorld.js-meta.xml @@ -0,0 +1,11 @@ + + + 45.0 + vlocity_cmt + true + + lightning__AppPage + lightning__RecordPage + lightning__HomePage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/jsconfig.json b/force-app/main/default/lwc/jsconfig.json new file mode 100644 index 0000000..e901923 --- /dev/null +++ b/force-app/main/default/lwc/jsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "experimentalDecorators": true, + "baseUrl": ".", + "paths": { + "c/helloWorld": [ + "helloWorld/helloWorld.js" + ], + "c/myCustomComponent": [ + "myCustomComponent/myCustomComponent.js" + ], + "c/myTextComponent": [ + "myTextComponent/myTextComponent.js" + ] + } + }, + "include": [ + "**/*", + "../../../../.sfdx/typings/lwc/**/*.d.ts" + ], + "typeAcquisition": { + "include": [ + "jest" + ] + } +} diff --git a/force-app/main/default/lwc/myCustomComponent/myCustomComponent.html b/force-app/main/default/lwc/myCustomComponent/myCustomComponent.html new file mode 100755 index 0000000..b662fc3 --- /dev/null +++ b/force-app/main/default/lwc/myCustomComponent/myCustomComponent.html @@ -0,0 +1,9 @@ + diff --git a/force-app/main/default/lwc/myCustomComponent/myCustomComponent.js b/force-app/main/default/lwc/myCustomComponent/myCustomComponent.js new file mode 100755 index 0000000..ce6439c --- /dev/null +++ b/force-app/main/default/lwc/myCustomComponent/myCustomComponent.js @@ -0,0 +1,13 @@ +import { LightningElement } from 'lwc'; +import pubsub from 'vlocity_cmt/pubsub'; +import { OmniscriptBaseMixin } from 'vlocity_cmt/omniscriptBaseMixin'; + +export default class MyCustomComponent extends OmniscriptBaseMixin(LightningElement) { + connectedCallback() { + console.log("MyCustomComponent - Connected"); + } + + handleBlur(evt) { + this.omniUpdateDataJson(evt); + } +} diff --git a/force-app/main/default/lwc/myCustomComponent/myCustomComponent.js-meta.xml b/force-app/main/default/lwc/myCustomComponent/myCustomComponent.js-meta.xml new file mode 100755 index 0000000..5bdd128 --- /dev/null +++ b/force-app/main/default/lwc/myCustomComponent/myCustomComponent.js-meta.xml @@ -0,0 +1,6 @@ + + + 47.0 + true + vlocity_cmt + \ No newline at end of file diff --git a/force-app/main/default/lwc/myOmniComponentInBaseClass/myOmniComponentInBaseClass.html b/force-app/main/default/lwc/myOmniComponentInBaseClass/myOmniComponentInBaseClass.html new file mode 100755 index 0000000..170f380 --- /dev/null +++ b/force-app/main/default/lwc/myOmniComponentInBaseClass/myOmniComponentInBaseClass.html @@ -0,0 +1,9 @@ + diff --git a/force-app/main/default/lwc/myOmniComponentInBaseClass/myOmniComponentInBaseClass.js b/force-app/main/default/lwc/myOmniComponentInBaseClass/myOmniComponentInBaseClass.js new file mode 100755 index 0000000..d3b8b77 --- /dev/null +++ b/force-app/main/default/lwc/myOmniComponentInBaseClass/myOmniComponentInBaseClass.js @@ -0,0 +1,17 @@ +import template from './myOmniComponentInBaseClass.html'; +import { LightningElement } from 'lwc'; +import { OmniscriptBaseMixin } from 'vlocity_cmt/omniscriptBaseMixin'; + +export default class MyOmniComponentInBaseClass extends OmniscriptBaseMixin(LightningElement) { + connectedCallback() { + console.log("myOmniComponentInBaseClass - Connected"); + } + + handleBlur(evt) { + this.omniUpdateDataJson(evt.target.value); + } + + render() { + return template; + } +} diff --git a/force-app/main/default/lwc/myOmniComponentInBaseClass/myOmniComponentInBaseClass.js-meta.xml b/force-app/main/default/lwc/myOmniComponentInBaseClass/myOmniComponentInBaseClass.js-meta.xml new file mode 100755 index 0000000..e645336 --- /dev/null +++ b/force-app/main/default/lwc/myOmniComponentInBaseClass/myOmniComponentInBaseClass.js-meta.xml @@ -0,0 +1,6 @@ + + + 47.0 + true + vlocity_cmt + diff --git a/force-app/main/default/lwc/myTextComponent/myTextComponent.html b/force-app/main/default/lwc/myTextComponent/myTextComponent.html new file mode 100755 index 0000000..aede996 --- /dev/null +++ b/force-app/main/default/lwc/myTextComponent/myTextComponent.html @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/myTextComponent/myTextComponent.js b/force-app/main/default/lwc/myTextComponent/myTextComponent.js new file mode 100755 index 0000000..5868ff5 --- /dev/null +++ b/force-app/main/default/lwc/myTextComponent/myTextComponent.js @@ -0,0 +1,13 @@ +import template from "./myTextComponent.html"; +import OmniscriptText from 'vlocity_cmt/omniscriptText'; + +export default class MyTextComponent extends OmniscriptText { + connectedCallback() { + console.log("myTextComponent - Connected"); + + } + + render() { + return template; + } +} diff --git a/force-app/main/default/lwc/myTextComponent/myTextComponent.js-meta.xml b/force-app/main/default/lwc/myTextComponent/myTextComponent.js-meta.xml new file mode 100755 index 0000000..5bdd128 --- /dev/null +++ b/force-app/main/default/lwc/myTextComponent/myTextComponent.js-meta.xml @@ -0,0 +1,6 @@ + + + 47.0 + true + vlocity_cmt + \ No newline at end of file diff --git a/scripts/apex/hello.apex b/scripts/apex/hello.apex new file mode 100644 index 0000000..1fba732 --- /dev/null +++ b/scripts/apex/hello.apex @@ -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); \ No newline at end of file diff --git a/scripts/soql/account.soql b/scripts/soql/account.soql new file mode 100644 index 0000000..b70934f --- /dev/null +++ b/scripts/soql/account.soql @@ -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; \ No newline at end of file diff --git a/sfdx-project.json b/sfdx-project.json new file mode 100755 index 0000000..4571531 --- /dev/null +++ b/sfdx-project.json @@ -0,0 +1,11 @@ +{ + "packageDirectories": [ + { + "path": "force-app", + "default": true + } + ], + "namespace": "", + "sfdcLoginUrl": "https://login.salesforce.com", + "sourceApiVersion": "47.0" +} \ No newline at end of file