Initialize Repository

This commit is contained in:
Christopher Gary committed 2021-04-02 22:25:09 -04:00
commit 2622f14385
20 files changed
+455

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
**/lwc/**/*.css
**/lwc/**/*.html
**/lwc/**/*.json
**/lwc/**/*.svg
**/lwc/**/*.xml
**/aura/**/*.auradoc
**/aura/**/*.cmp
**/aura/**/*.css
**/aura/**/*.design
**/aura/**/*.evt
**/aura/**/*.json
**/aura/**/*.svg
**/aura/**/*.tokens
**/aura/**/*.xml
.sfdx
+18
View File
@@ -0,0 +1,18 @@
# 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__/**
# Exclude applications
*.appMenu
# Exclude FlexiPage
*.flexipage
+42
View File
@@ -0,0 +1,42 @@
# 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/
# LWC VSCode autocomplete
**/lwc/jsconfig.json
# LWC Jest coverage reports
coverage/
# SOQL Query Results
**/scripts/soql/query-results
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Dependency directories
node_modules/
# build and scripts directories
build/
scripts/
# Eslint cache
.eslintcache
# MacOS system files
.DS_Store
# Windows system files
Thumbs.db
ehthumbs.db
[Dd]esktop.ini
$RECYCLE.BIN/
+10
View File
@@ -0,0 +1,10 @@
# List files or directories below to ignore them when running prettier
# More information: https://prettier.io/docs/en/ignore.html
#
**/staticresources/**
.localdevserver
.sfdx
.vscode
coverage/
+13
View File
@@ -0,0 +1,13 @@
{
"trailingComma": "none",
"overrides": [
{
"files": "**/lwc/**/*.html",
"options": { "parser": "lwc" }
},
{
"files": "*.{cmp,page,component}",
"options": { "parser": "html" }
}
]
}
+9
View File
@@ -0,0 +1,9 @@
{
"recommendations": [
"salesforce.salesforcedx-vscode",
"redhat.vscode-xml",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"financialforce.lana"
]
}
+16
View File
@@ -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
}
]
}
+7
View File
@@ -0,0 +1,7 @@
{
"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
"**/.sfdx": true
}
}
+18
View File
@@ -0,0 +1,18 @@
# Salesforce DX Project: Next Steps
Now that you’ve created a Salesforce DX project, what’s next? Here are some documentation resources to get you started.
## How Do You Plan to Deploy Your Changes?
Do you want to deploy a set of changes, or create a self-contained application? Choose a [development model](https://developer.salesforce.com/tools/vscode/en/user-guide/development-models).
## Configure Your Salesforce DX Project
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.
## Read All About It
- [Salesforce Extensions Documentation](https://developer.salesforce.com/tools/vscode/)
- [Salesforce CLI Setup Guide](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_intro.htm)
- [Salesforce DX Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_intro.htm)
- [Salesforce CLI Command Reference](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference.htm)
+116
View File
@@ -0,0 +1,116 @@
{
"orgName":"Opportunity Clone Dev Org",
"country":"US",
"adminEmail":"cgary@cloudperformer.com",
"edition": "Developer",
"description": "Developer Edition Scratch Org with all features installed.",
"hasSampleData": false,
"features":["API","AuthorApex","BigObjectsBulkAPI","CascadeDelete","CaseClassification",
"ChangeDataCapture","Communities","ConnectedAppToolingAPI","ContactsToMultipleAccounts",
"ContractApprovals","Communities","CustomNotificationType","IoT","DebugApex",
"EnablePRM","Entitlements","EventLogFile","FlowSites","ForceComPlatform",
"GenericStreaming","IdentityProvisioningFeatures","Interaction","LiveMessage",
"Knowledge","LightningSalesConsole","LightningServiceConsole","LiveAgent",
"MarketingUser","OutboundMessageHTTPSession","ProcessBuilder","RecordTypes",
"SalesforceContentUser","SalesforceIdentityForCommunities","SalesUser",
"SAML20SingleLogout","SessionIdInLogEnabled","SingleSignOn","Sites",
"StreamingAPI","ServiceCloud","ServiceUser","Workflow","WorkflowFlowActionFeature",
"WorkThanksPref"],
"settings": {
"accountSettings":{
"enableAccountHistoryTracking":true,
"enableAccountTeams":true,
"enableContactHistoryTracking":true,
"enableRelateContactToMultipleAccounts":true,
"showViewHierarchyLink":true
},
"activitiesSettings":{
"autoRelateEventAttendees":true,
"enableActivityReminders":true,
"enableClickCreateEvents":true,
"enableDragAndDropScheduling":true,
"enableEmailTracking":true,
"enableGroupTasks":true,
"enableListViewScheduling":true,
"enableMultidayEvents":true,
"enableRecurringEvents":true,
"enableRecurringTasks":true,
"enableSidebarCalendarShortcut":true,
"enableSimpleTaskCreateUI":true,
"enableUNSTaskDelegatedToNotifications":true,
"showHomePageHoverLinksForEvents":true,
"showMyTasksHoverLinks":true
},
"apexSettings":{
"enableApexApprovalLockUnlock":true,
"enableApexCtrlImplicitWithSharingPref":true,
"enableApexPropertyGetterPref":true,
"enableAuraApexCtrlAuthUserAccessCheckPref":true,
"enableAuraApexCtrlGuestUserAccessCheckPref":true,
"enableMngdCtrlActionAccessPref":true,
"enableNonCertifiedApexMdCrud":true
},
"communitiesSettings":{
"enableNetworksEnabled":true
},
"contractSettings":{
"autoCalculateEndDate":true,
"notifyOwnersOnContractExpiration":true
},
"entitlementSettings":{
"assetLookupLimitedToActiveEntitlementsOnAccount":true,
"assetLookupLimitedToActiveEntitlementsOnContact":true,
"assetLookupLimitedToSameAccount":true,
"assetLookupLimitedToSameContact":true,
"enableEntitlements":true,
"enableEntitlementVersioning":true,
"entitlementLookupLimitedToActiveStatus":true,
"entitlementLookupLimitedToSameAccount":true,
"entitlementLookupLimitedToSameAsset":true,
"entitlementLookupLimitedToSameContact":true
},
"ioTSettings":{
"enableIoT":true
},
"knowledgeSettings":{
"defaultLanguage":"en_US",
"enableChatterQuestionKBDeflection":true,
"enableCreateEditOnArticlesTab":true,
"enableExternalMediaContent":true,
"enableKnowledge":true,
"enableLightningKnowledge":true,
"showArticleSummariesInternalApp":true,
"showValidationStatusField":true
},
"liveAgentSettings":{
"enableLiveAgent":true
},
"macroSettings":{
"enableAdvancedSearch":true,
"macrosInFolders":true
},
"nameSettings":{
"enableMiddleName":true,
"enableNameSuffix":true
},
"omniChannelSettings":{
"enableOmniChannel":true,
"enableOmniSkillsRouting":true
},
"opportunitySettings":{
"enableUpdateReminders":true,
"autoActivateNewReminders":true,
"enableOpportunityTeam":true,
"promptToAddProducts":true
},
"orderSettings": {
"enableOrders":true,
"enableNegativeQuantity":true,
"enableReductionOrders":true,
"enableZeroQuantity":true
},
"quoteSettings": {
"enableQuote":true
}
}
}
@@ -0,0 +1,9 @@
{
"plugins": ["@salesforce/eslint-plugin-aura"],
"extends": ["plugin:@salesforce/eslint-plugin-aura/recommended", "prettier"],
"rules": {
"func-names": "off",
"vars-on-top": "off",
"no-unused-expressions": "off"
}
}
@@ -0,0 +1,65 @@
/**
* @description This service exposes methods that contain logic to make cloning an opportunity
* much easier and more functional.
* @author Cloud Performer Inc. <cgary@cloudperformer.com>
* @version 1.0
* @group Opportunity Cloning
* @history 2021-04-02 - CJG - Created
*/
public with sharing class OpportunityCloneService {
/**
* @description exception class that is thrown when something happens in the opportunity
* clonde process.
*/
public class CloneException extends System.Exception {}
public static Map<String,Schema.DescribeSObjectResult> opportunityChildrenMap;
static {
List<Schema.ChildRelationship> childRelationshipList =
Schema.Opportunity.getSObjectType().getDescribe().getChildRelationships();
opportunityChildrenMap = new Map<String, Schema.DescribeSObjectResult>();
for(Schema.ChildRelationship childRel:childRelationshipList) {
Schema.DescribeSObjectResult childObjRes = childRel.getChildSObject().getDescribe();
opportunityChildrenMap.put(childObjRes.getName(),childObjRes);
}
}
@AuraEnabled(cacheable=true)
public static List<String> ObtainOpporunityChildRelationships(){
return new List<String>(opportunityChildrenMap.keySet());
}
public static String ObtainQueryStringForOppAndChildren(Id oppRecordId, List<String> relationships) {
String queryString = 'SELECT ';
queryString += String.join(ObtainFieldsForObject('Opportunity'),',');
List<String> subqueryList = new List<String>();
for(String relationship:relationships){
Schema.DescribeSObjectResult childObject = opportunityChildrenMap.get(relationship);
String childQueryString = '(SELECT ' + String.join(ObtainFieldsForObject(childObject.getName()),',') + ' FROM ';
childQueryString += relationship + ')';
subqueryList.add(childQueryString);
}
queryString += ', ' + String.join(subqueryList,',') + 'FROM Opportunity WHERE Id =\'' + oppRecordId + '\'';
return queryString;
}
/**
* @description this method is responsible for getting the list of fields for a particular object
*/
private static List<String> ObtainFieldsForObject(String objectName) {
List<String> fieldNameList;
List<String> objectListToDescribe = new List<String>{objectName};
List<Schema.DescribeSObjectResult> describeItem = System.Schema.describeSObjects(objectListToDescribe);
if(describeItem.isEmpty()) {
throw new OpportunityCloneService.CloneException('Could not find info for ' + objectName + '.');
}
Map<String, Schema.SObjectField> fieldSObjectMapping = describeItem[0].fields.getMap();
fieldNameList = new List<String>();
for(Schema.SObjectField fieldToken:fieldSObjectMapping.values()) {
Schema.DescribeFieldResult fieldTokenDescribe = fieldToken.getDescribe();
if(fieldTokenDescribe.isCreateable() && fieldTokenDescribe.isUpdateable()) {
fieldNameList.add(fieldTokenDescribe.getName());
}
}
return fieldNameList;
}
}
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>51.0</apiVersion>
<status>Active</status>
</ApexClass>
+11
View File
@@ -0,0 +1,11 @@
{
"extends": ["@salesforce/eslint-config-lwc/recommended", "prettier"],
"overrides": [
{
"files": ["*.test.js"],
"rules": {
"@lwc/lwc/no-unexpected-wire-adapter-usages": "off"
}
}
]
}
@@ -0,0 +1,3 @@
<template>
</template>
@@ -0,0 +1,3 @@
import { LightningElement } from 'lwc';
export default class OpportunityCustomClone extends LightningElement {}
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>51.0</apiVersion>
<isExposed>false</isExposed>
</LightningComponentBundle>
+36
View File
@@ -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>51.0</version>
</Package>
+43
View File
@@ -0,0 +1,43 @@
{
"name": "salesforce-app",
"private": true,
"version": "1.0.0",
"description": "Salesforce App",
"scripts": {
"lint": "npm run lint:lwc && npm run lint:aura",
"lint:aura": "eslint **/aura/**",
"lint:lwc": "eslint **/lwc/**",
"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 --list-different \"**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml}\""
},
"devDependencies": {
"@prettier/plugin-xml": "^0.12.0",
"@salesforce/eslint-config-lwc": "^0.7.0",
"@salesforce/eslint-plugin-aura": "^1.4.0",
"@salesforce/sfdx-lwc-jest": "^0.9.2",
"eslint": "^7.6.0",
"eslint-config-prettier": "^6.11.0",
"husky": "^4.2.1",
"lint-staged": "^10.0.7",
"prettier": "^2.0.5",
"prettier-plugin-apex": "^1.6.0"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml}": [
"prettier --write"
],
"**/{aura|lwc}/**": [
"eslint"
]
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"packageDirectories": [
{
"path": "force-app",
"default": true
}
],
"namespace": "",
"sfdcLoginUrl": "https://login.salesforce.com",
"sourceApiVersion": "51.0"
}