commit aa8e65b650759033bbcb2ffa05fc10261a5eb2f7 Author: Himanshu Singh Date: Fri Aug 23 10:44:28 2024 +0530 Initial commit diff --git a/.forceignore b/.forceignore new file mode 100644 index 0000000..3d36001 --- /dev/null +++ b/.forceignore @@ -0,0 +1,15 @@ +# 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__/** +**/tsconfig.json + +**/*.ts diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f5f33eb --- /dev/null +++ b/.gitignore @@ -0,0 +1,45 @@ +# 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 +.sf/ +.sfdx/ +.localdevserver/ +deploy-options.json + +# LWC VSCode autocomplete +**/lwc/jsconfig.json + +# LWC Jest coverage reports +coverage/ + +# 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/ + +# Local environment variables +.env + +# Python Salesforce Functions +**/__pycache__/ +**/.venv/ +**/venv/ diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 0000000..feac116 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npm run precommit \ No newline at end of file diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..8cccc6e --- /dev/null +++ b/.prettierignore @@ -0,0 +1,11 @@ +# List files or directories below to ignore them when running prettier +# More information: https://prettier.io/docs/en/ignore.html +# + +**/staticresources/** +.localdevserver +.sfdx +.sf +.vscode + +coverage/ \ No newline at end of file diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..18039a0 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,17 @@ +{ + "trailingComma": "none", + "plugins": [ + "prettier-plugin-apex", + "@prettier/plugin-xml" + ], + "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 100644 index 0000000..7e6cb10 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,9 @@ +{ + "recommendations": [ + "salesforce.salesforcedx-vscode", + "redhat.vscode-xml", + "dbaeumer.vscode-eslint", + "esbenp.prettier-vscode", + "financialforce.lana" + ] +} diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 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 100644 index 0000000..76decfb --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "search.exclude": { + "**/node_modules": true, + "**/bower_components": true, + "**/.sfdx": true + } +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..afcda4a --- /dev/null +++ b/README.md @@ -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) diff --git a/config/project-scratch-def.json b/config/project-scratch-def.json new file mode 100644 index 0000000..bb72192 --- /dev/null +++ b/config/project-scratch-def.json @@ -0,0 +1,13 @@ +{ + "orgName": "Demo company", + "edition": "Developer", + "features": ["EnableSetPasswordInApi"], + "settings": { + "lightningExperienceSettings": { + "enableS1DesktopEnabled": true + }, + "mobileSettings": { + "enableS1EncryptedStoragePref2": false + } + } +} diff --git a/force-app/main/default/aura/.eslintrc.json b/force-app/main/default/aura/.eslintrc.json new file mode 100644 index 0000000..226a5a2 --- /dev/null +++ b/force-app/main/default/aura/.eslintrc.json @@ -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" + } +} diff --git a/force-app/main/default/aura/AccountController/AccountController.cmp b/force-app/main/default/aura/AccountController/AccountController.cmp new file mode 100644 index 0000000..797c6ea --- /dev/null +++ b/force-app/main/default/aura/AccountController/AccountController.cmp @@ -0,0 +1,63 @@ + + + + + + + + +
+ + + +
+
+ +
+
+
+
\ No newline at end of file diff --git a/force-app/main/default/aura/AccountController/AccountController.cmp-meta.xml b/force-app/main/default/aura/AccountController/AccountController.cmp-meta.xml new file mode 100644 index 0000000..2d81986 --- /dev/null +++ b/force-app/main/default/aura/AccountController/AccountController.cmp-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + A Lightning Component Bundle + diff --git a/force-app/main/default/aura/AccountController/AccountController.css b/force-app/main/default/aura/AccountController/AccountController.css new file mode 100644 index 0000000..2c97e3d --- /dev/null +++ b/force-app/main/default/aura/AccountController/AccountController.css @@ -0,0 +1,3 @@ +.THIS.test{ + background-color: black; +} \ No newline at end of file diff --git a/force-app/main/default/aura/AccountController/AccountControllerController.js b/force-app/main/default/aura/AccountController/AccountControllerController.js new file mode 100644 index 0000000..8d21287 --- /dev/null +++ b/force-app/main/default/aura/AccountController/AccountControllerController.js @@ -0,0 +1,23 @@ +({ + myAction: function(component, event, helper) { + component.set("v.Columns", [ + { label: "Name", fieldName: "Name", type: "text" }, + { label: "Email", fieldName: "Email", type: "email" }, + { label: "Phone", fieldName: "Phone", type: "phone" } + ]); + var action = component.get("c.getContacts"); + action.setParams({ + recordId: component.get("v.recordId") + }); + action.setCallback(this, function(response) { + var state = response.getState(); + if (state === "SUCCESS") { + var contacts = response.getReturnValue(); + component.set("v.Contacts", contacts); + } else { + // Handle error state here + } + }); + $A.enqueueAction(action); + } +}) \ No newline at end of file diff --git a/force-app/main/default/aura/forgotPassword/forgotPassword.cmp b/force-app/main/default/aura/forgotPassword/forgotPassword.cmp new file mode 100644 index 0000000..4ad500e --- /dev/null +++ b/force-app/main/default/aura/forgotPassword/forgotPassword.cmp @@ -0,0 +1,29 @@ + + + + + + + + + + + + +
+ +
+ +
+
+
+ + +
+ +
+ +
+ +
+
\ No newline at end of file diff --git a/force-app/main/default/aura/forgotPassword/forgotPassword.cmp-meta.xml b/force-app/main/default/aura/forgotPassword/forgotPassword.cmp-meta.xml new file mode 100644 index 0000000..5dfaf56 --- /dev/null +++ b/force-app/main/default/aura/forgotPassword/forgotPassword.cmp-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + Sample Component for forgotPassword + diff --git a/force-app/main/default/aura/forgotPassword/forgotPassword.css b/force-app/main/default/aura/forgotPassword/forgotPassword.css new file mode 100644 index 0000000..5d3bb22 --- /dev/null +++ b/force-app/main/default/aura/forgotPassword/forgotPassword.css @@ -0,0 +1,76 @@ +.THIS #sfdc_username_container{ + margin-bottom:10px; + padding: 12px; + background-color:white; + border: 1px solid #CCC; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} + +.THIS #sfdc_user{ + float:left; + width:23px; + height:25px; + padding-top:1px; + padding-left:2px; + margin:0px; + +} + +.THIS .login-icon { + color:#ccc;font-size:22px; +} + +.THIS button.sfdc_button { + width: 100%; + margin-top: 15px; + margin-bottom: 5px; + color: #fff; + background-color: #0070d2; + border-color: #357ebd; + display: inline-block; + text-align: center; + vertical-align: middle; + background-image: none; + border: 1px solid transparent; + white-space: nowrap; + padding: 10px 12px; + font-size: 16px; + font-family: 'Open Sans', sans-serif; + font-weight: 300; + line-height: 1.42857143; + border-radius: 2px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; +} + +.THIS button:hover { + background-color:#3276b1; + border-color:#285e8e; + cursor:pointer; +} + +.THIS input { + margin-left:10px; + margin-top: 3px; + border: 0px solid transparent; + width: 70%; + -webkit-appearance: none; + font-size: 14px; +} + +.THIS #error { + text-align: center; + color:#FF0000; +} + +.THIS a { + color:white; + text-decoration: none; +} +.THIS a:hover { + color:white; + text-decoration: none; +} \ No newline at end of file diff --git a/force-app/main/default/aura/forgotPassword/forgotPassword.design b/force-app/main/default/aura/forgotPassword/forgotPassword.design new file mode 100644 index 0000000..38ebfe8 --- /dev/null +++ b/force-app/main/default/aura/forgotPassword/forgotPassword.design @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/force-app/main/default/aura/forgotPassword/forgotPasswordController.js b/force-app/main/default/aura/forgotPassword/forgotPasswordController.js new file mode 100644 index 0000000..a456ace --- /dev/null +++ b/force-app/main/default/aura/forgotPassword/forgotPasswordController.js @@ -0,0 +1,23 @@ +({ + handleForgotPassword: function (component, event, helpler) { + helpler.handleForgotPassword(component, event, helpler); + }, + onKeyUp: function(component, event, helpler){ + //checks for "enter" key + if (event.getParam('keyCode')===13) { + helpler.handleForgotPassword(component, event, helpler); + } + }, + + setExpId: function (component, event, helper) { + var expId = event.getParam('expid'); + if (expId) { + component.set("v.expid", expId); + } + helper.setBrandingCookie(component, event, helper); + }, + + initialize: function(component, event, helper) { + $A.get("e.siteforce:registerQueryEventMap").setParams({"qsToEvent" : helper.qsToEventMap}).fire(); + } +}) \ No newline at end of file diff --git a/force-app/main/default/aura/forgotPassword/forgotPasswordHelper.js b/force-app/main/default/aura/forgotPassword/forgotPasswordHelper.js new file mode 100644 index 0000000..85467fb --- /dev/null +++ b/force-app/main/default/aura/forgotPassword/forgotPasswordHelper.js @@ -0,0 +1,30 @@ +({ + qsToEventMap: { + 'expid' : 'e.c:setExpId' + }, + + handleForgotPassword: function (component, event, helpler) { + var username = component.find("username").get("v.value"); + var checkEmailUrl = component.get("v.checkEmailUrl"); + var action = component.get("c.forgotPassword"); + action.setParams({username:username, checkEmailUrl:checkEmailUrl}); + action.setCallback(this, function(a) { + var rtnValue = a.getReturnValue(); + if (rtnValue != null) { + component.set("v.errorMessage",rtnValue); + component.set("v.showError",true); + } + }); + $A.enqueueAction(action); + }, + + setBrandingCookie: function (component, event, helpler) { + var expId = component.get("v.expid"); + if (expId) { + var action = component.get("c.setExperienceId"); + action.setParams({expId:expId}); + action.setCallback(this, function(a){ }); + $A.enqueueAction(action); + } + } +}) \ No newline at end of file diff --git a/force-app/main/default/aura/lmsVFPublisher/lmsVFPublisher.app b/force-app/main/default/aura/lmsVFPublisher/lmsVFPublisher.app new file mode 100644 index 0000000..414b72c --- /dev/null +++ b/force-app/main/default/aura/lmsVFPublisher/lmsVFPublisher.app @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/force-app/main/default/aura/lmsVFPublisher/lmsVFPublisher.app-meta.xml b/force-app/main/default/aura/lmsVFPublisher/lmsVFPublisher.app-meta.xml new file mode 100644 index 0000000..e9343ca --- /dev/null +++ b/force-app/main/default/aura/lmsVFPublisher/lmsVFPublisher.app-meta.xml @@ -0,0 +1,5 @@ + + + 60.0 + A Lightning Component Bundle + diff --git a/force-app/main/default/aura/lmsVFPublisher1/lmsVFPublisher1.cmp b/force-app/main/default/aura/lmsVFPublisher1/lmsVFPublisher1.cmp new file mode 100644 index 0000000..24abfe8 --- /dev/null +++ b/force-app/main/default/aura/lmsVFPublisher1/lmsVFPublisher1.cmp @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/force-app/main/default/aura/lmsVFPublisher1/lmsVFPublisher1.cmp-meta.xml b/force-app/main/default/aura/lmsVFPublisher1/lmsVFPublisher1.cmp-meta.xml new file mode 100644 index 0000000..e9343ca --- /dev/null +++ b/force-app/main/default/aura/lmsVFPublisher1/lmsVFPublisher1.cmp-meta.xml @@ -0,0 +1,5 @@ + + + 60.0 + A Lightning Component Bundle + diff --git a/force-app/main/default/aura/loginForm/loginForm.cmp b/force-app/main/default/aura/loginForm/loginForm.cmp new file mode 100644 index 0000000..189eff4 --- /dev/null +++ b/force-app/main/default/aura/loginForm/loginForm.cmp @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+
+
+
+ + +
+ +
+ + +
+ +
+ +
+ + +
+
+
\ No newline at end of file diff --git a/force-app/main/default/aura/loginForm/loginForm.cmp-meta.xml b/force-app/main/default/aura/loginForm/loginForm.cmp-meta.xml new file mode 100644 index 0000000..1cd2a7c --- /dev/null +++ b/force-app/main/default/aura/loginForm/loginForm.cmp-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + Sample Component for loginForm + diff --git a/force-app/main/default/aura/loginForm/loginForm.css b/force-app/main/default/aura/loginForm/loginForm.css new file mode 100644 index 0000000..5b06d29 --- /dev/null +++ b/force-app/main/default/aura/loginForm/loginForm.css @@ -0,0 +1,103 @@ +.THIS #sfdc_username_container{ + margin-bottom:10px; + padding: 12px; + background-color:white; + border: 1px solid #CCC; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} + +.THIS #sfdc_user{ + float:left; + width:23px; + height:25px; + padding-top:1px; + padding-left:2px; + margin:0px; + +} + +.THIS #sfdc_lock{ + float:left; + width:23px; + height:25px; + padding-top:1px; + padding-left:2px; + margin:0px; +} + +.THIS #error { + text-align: center; + color:#FF0000; +} + +.THIS .login-icon { + color:#ccc;font-size:22px; +} + +.THIS #sfdc_password_container{ + padding: 12px; + background-color:white; + border: 1px solid #CCC; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} + +.THIS button.sfdc_button { + width: 100%; + margin-top: 15px; + margin-bottom: 5px; + color: #fff; + background-color: #0070d2; + border-color: #357ebd; + display: inline-block; + text-align: center; + vertical-align: middle; + background-image: none; + border: 1px solid transparent; + white-space: nowrap; + padding: 10px 12px; + font-size: 16px; + font-family: 'Open Sans', sans-serif; + font-weight: 300; + line-height: 1.42857143; + border-radius: 2px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; +} + +.THIS button:hover { + background-color:#3276b1; + border-color:#285e8e; + cursor:pointer; +} + +.THIS button .label { + color: #fff; +} + +.THIS input { + margin-left:10px; + margin-top: 3px; + border: 0px solid transparent; + width: 70%; + -webkit-appearance: none; + font-size: 14px; +} + + +.THIS a { + color:white; + text-decoration: none; +} +.THIS a:hover { + color:white; + text-decoration: none; +} + +.THIS label.uiLabel-hidden { + display:none; +} \ No newline at end of file diff --git a/force-app/main/default/aura/loginForm/loginForm.design b/force-app/main/default/aura/loginForm/loginForm.design new file mode 100644 index 0000000..0e53bfa --- /dev/null +++ b/force-app/main/default/aura/loginForm/loginForm.design @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/force-app/main/default/aura/loginForm/loginFormController.js b/force-app/main/default/aura/loginForm/loginFormController.js new file mode 100644 index 0000000..d37160e --- /dev/null +++ b/force-app/main/default/aura/loginForm/loginFormController.js @@ -0,0 +1,70 @@ +({ + initialize: function(component, event, helper) { + $A.get("e.siteforce:registerQueryEventMap").setParams({"qsToEvent" : helper.qsToEventMap}).fire(); + $A.get("e.siteforce:registerQueryEventMap").setParams({"qsToEvent" : helper.qsToEventMap2}).fire(); + component.set('v.isUsernamePasswordEnabled', helper.getIsUsernamePasswordEnabled(component, event, helper)); + component.set("v.isSelfRegistrationEnabled", helper.getIsSelfRegistrationEnabled(component, event, helper)); + component.set("v.communityForgotPasswordUrl", helper.getCommunityForgotPasswordUrl(component, event, helper)); + component.set("v.communitySelfRegisterUrl", helper.getCommunitySelfRegisterUrl(component, event, helper)); + }, + + handleLogin: function (component, event, helpler) { + helpler.handleLogin(component, event, helpler); + }, + + setStartUrl: function (component, event, helpler) { + var startUrl = event.getParam('startURL'); + if(startUrl) { + component.set("v.startUrl", startUrl); + } + }, + + setExpId: function (component, event, helper) { + var expId = event.getParam('expid'); + if (expId) { + component.set("v.expid", expId); + } + helper.setBrandingCookie(component, event, helper); + }, + + onKeyUp: function(component, event, helpler){ + //checks for "enter" key + if (event.getParam('keyCode')===13) { + helpler.handleLogin(component, event, helpler); + } + }, + + navigateToForgotPassword: function(cmp, event, helper) { + var forgotPwdUrl = cmp.get("v.communityForgotPasswordUrl"); + if ($A.util.isUndefinedOrNull(forgotPwdUrl)) { + forgotPwdUrl = cmp.get("v.forgotPasswordUrl"); + } + var startUrl = cmp.get("v.startUrl"); + if(startUrl){ + if(forgotPwdUrl.indexOf("?") === -1) { + forgotPwdUrl = forgotPwdUrl + '?startURL=' + decodeURIComponent(startUrl); + } else { + forgotPwdUrl = forgotPwdUrl + '&startURL=' + decodeURIComponent(startUrl); + } + } + var attributes = { url: forgotPwdUrl }; + $A.get("e.force:navigateToURL").setParams(attributes).fire(); + }, + + navigateToSelfRegister: function(cmp, event, helper) { + var selfRegUrl = cmp.get("v.communitySelfRegisterUrl"); + if (selfRegUrl == null) { + selfRegUrl = cmp.get("v.selfRegisterUrl"); + } + var startUrl = cmp.get("v.startUrl"); + if(startUrl){ + if(selfRegUrl.indexOf("?") === -1) { + selfRegUrl = selfRegUrl + '?startURL=' + decodeURIComponent(startUrl); + } else { + selfRegUrl = selfRegUrl + '&startURL=' + decodeURIComponent(startUrl); + } + } + var attributes = { url: selfRegUrl }; + $A.get("e.force:navigateToURL").setParams(attributes).fire(); + } +}) \ No newline at end of file diff --git a/force-app/main/default/aura/loginForm/loginFormHelper.js b/force-app/main/default/aura/loginForm/loginFormHelper.js new file mode 100644 index 0000000..5ec671c --- /dev/null +++ b/force-app/main/default/aura/loginForm/loginFormHelper.js @@ -0,0 +1,83 @@ +({ + + qsToEventMap: { + 'startURL' : 'e.c:setStartUrl' + }, + + qsToEventMap2: { + 'expid' : 'e.c:setExpId' + }, + + handleLogin: function (component, event, helpler) { + var username = component.find("username").get("v.value"); + var password = component.find("password").get("v.value"); + var action = component.get("c.login"); + var startUrl = component.get("v.startUrl"); + + startUrl = decodeURIComponent(startUrl); + + action.setParams({username:username, password:password, startUrl:startUrl}); + action.setCallback(this, function(a){ + var rtnValue = a.getReturnValue(); + if (rtnValue !== null) { + component.set("v.errorMessage",rtnValue); + component.set("v.showError",true); + } + }); + $A.enqueueAction(action); + }, + + getIsUsernamePasswordEnabled : function (component, event, helpler) { + var action = component.get("c.getIsUsernamePasswordEnabled"); + action.setCallback(this, function(a){ + var rtnValue = a.getReturnValue(); + if (rtnValue !== null) { + component.set('v.isUsernamePasswordEnabled',rtnValue); + } + }); + $A.enqueueAction(action); + }, + + getIsSelfRegistrationEnabled : function (component, event, helpler) { + var action = component.get("c.getIsSelfRegistrationEnabled"); + action.setCallback(this, function(a){ + var rtnValue = a.getReturnValue(); + if (rtnValue !== null) { + component.set('v.isSelfRegistrationEnabled',rtnValue); + } + }); + $A.enqueueAction(action); + }, + + getCommunityForgotPasswordUrl : function (component, event, helpler) { + var action = component.get("c.getForgotPasswordUrl"); + action.setCallback(this, function(a){ + var rtnValue = a.getReturnValue(); + if (rtnValue !== null) { + component.set('v.communityForgotPasswordUrl',rtnValue); + } + }); + $A.enqueueAction(action); + }, + + getCommunitySelfRegisterUrl : function (component, event, helpler) { + var action = component.get("c.getSelfRegistrationUrl"); + action.setCallback(this, function(a){ + var rtnValue = a.getReturnValue(); + if (rtnValue !== null) { + component.set('v.communitySelfRegisterUrl',rtnValue); + } + }); + $A.enqueueAction(action); + }, + + setBrandingCookie: function (component, event, helpler) { + var expId = component.get("v.expid"); + if (expId) { + var action = component.get("c.setExperienceId"); + action.setParams({expId:expId}); + action.setCallback(this, function(a){ }); + $A.enqueueAction(action); + } + } +}) \ No newline at end of file diff --git a/force-app/main/default/aura/selfRegister/selfRegister.cmp b/force-app/main/default/aura/selfRegister/selfRegister.cmp new file mode 100644 index 0000000..5045e0d --- /dev/null +++ b/force-app/main/default/aura/selfRegister/selfRegister.cmp @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+
+ + +
+ +
+ + +
+ +
+ + +
+ + +
+ + +
+
+ + +
+ + +
+ +
+ + +
+
+ +
+ +
+
+
\ No newline at end of file diff --git a/force-app/main/default/aura/selfRegister/selfRegister.cmp-meta.xml b/force-app/main/default/aura/selfRegister/selfRegister.cmp-meta.xml new file mode 100644 index 0000000..6cca95f --- /dev/null +++ b/force-app/main/default/aura/selfRegister/selfRegister.cmp-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + Sample Component for selfRegister + diff --git a/force-app/main/default/aura/selfRegister/selfRegister.css b/force-app/main/default/aura/selfRegister/selfRegister.css new file mode 100644 index 0000000..2d45808 --- /dev/null +++ b/force-app/main/default/aura/selfRegister/selfRegister.css @@ -0,0 +1,174 @@ +.THIS #sfdc_username_container{ + margin-bottom:10px; + padding: 12px; + background-color:white; + border: 1px solid #CCC; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} + +.THIS #sfdc_nickname_container{ + margin-bottom:10px; + padding: 12px; + background-color:white; + border: 1px solid #CCC; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} + +.THIS #sfdc_email_container{ + margin-bottom:10px; + padding: 12px; + background-color:white; + border: 1px solid #CCC; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} + +.THIS #sfdc_extrafield_container{ + margin-bottom:10px; + padding: 12px; + background-color:white; + border: 1px solid #CCC; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} + +.THIS #sfdc_user{ + float:left; + width:23px; + height:25px; + padding-top:1px; + padding-left:2px; + margin:0px; + +} + +.THIS #sfdc_lock{ + float:left; + width:23px; + height:25px; + padding-top:1px; + padding-left:2px; + margin:0px; +} + +.THIS .login-icon { + color:#ccc;font-size:22px; +} + +.THIS #sfdc_password_container{ + margin-bottom:10px; + padding: 12px; + background-color:white; + border: 1px solid #CCC; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} + +.THIS #sfdc_confirm_password_container{ + padding: 12px; + background-color:white; + border: 1px solid #CCC; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} + +.THIS button.sfdc_button { + width: 100%; + margin-top: 15px; + margin-bottom: 5px; + color: #fff; + background-color: #0070d2; + border-color: #357ebd; + display: inline-block; + text-align: center; + vertical-align: middle; + background-image: none; + border: 1px solid transparent; + white-space: nowrap; + padding: 10px 12px; + font-size: 16px; + font-family: 'Open Sans', sans-serif; + font-weight: 300; + line-height: 1.42857143; + border-radius: 2px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; +} + +.THIS button:hover { + background-color:#3276b1; + border-color:#285e8e; + cursor:pointer; +} + +.THIS input { + margin-left:10px; + margin-top: 3px; + border: 0px solid transparent; + width: 70%; + -webkit-appearance: none; + font-size: 14px; +} + +.THIS #sfdc_forgot{ + font-family: 'Open Sans', 'sans-serif'; + font-weight:300; + font-size: 14px; + margin-top: 10px +} + +.THIS #error { + text-align: center; + color:#FF0000; +} + +.THIS a { + color:white; + text-decoration: none; +} +.THIS a:hover { + color:white; + text-decoration: none; +} + +.THIS input[type="checkbox"] { + appearance: none; + border: 1px solid white; + height: 22px; + width: 22px; + vertical-align: middle; +} + +.THIS input[type="checkbox"]:checked { + border: 1px solid ; +} + +.THIS input[type="checkbox"]:checked:after { + display: block; + position: relative; + content: ''; + left: 3px; + top: 3px; + height: 6px; + width: 10px; + border-bottom: 4px solid /*#354452*/ white; + border-left: 4px solid /*#354452*/ white; + transform:rotate(-45deg); +} + +.THIS input[type="checkbox"].disabled { + opacity: 0.35; +} + +.THIS input[type="checkbox"] + label { + vertical-align: middle; +} \ No newline at end of file diff --git a/force-app/main/default/aura/selfRegister/selfRegister.design b/force-app/main/default/aura/selfRegister/selfRegister.design new file mode 100644 index 0000000..48c2743 --- /dev/null +++ b/force-app/main/default/aura/selfRegister/selfRegister.design @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/force-app/main/default/aura/selfRegister/selfRegisterController.js b/force-app/main/default/aura/selfRegister/selfRegisterController.js new file mode 100644 index 0000000..6981bb6 --- /dev/null +++ b/force-app/main/default/aura/selfRegister/selfRegisterController.js @@ -0,0 +1,33 @@ +({ + initialize: function(component, event, helper) { + $A.get("e.siteforce:registerQueryEventMap").setParams({"qsToEvent" : helper.qsToEventMap}).fire(); + $A.get("e.siteforce:registerQueryEventMap").setParams({"qsToEvent" : helper.qsToEventMap2}).fire(); + component.set('v.extraFields', helper.getExtraFields(component, event, helper)); + }, + + handleSelfRegister: function (component, event, helpler) { + helpler.handleSelfRegister(component, event, helpler); + }, + + setStartUrl: function (component, event, helpler) { + var startUrl = event.getParam('startURL'); + if(startUrl) { + component.set("v.startUrl", startUrl); + } + }, + + setExpId: function (component, event, helper) { + var expId = event.getParam('expid'); + if (expId) { + component.set("v.expid", expId); + } + helper.setBrandingCookie(component, event, helper); + }, + + onKeyUp: function(component, event, helpler){ + //checks for "enter" key + if (event.getParam('keyCode')===13) { + helpler.handleSelfRegister(component, event, helpler); + } + } +}) \ No newline at end of file diff --git a/force-app/main/default/aura/selfRegister/selfRegisterHelper.js b/force-app/main/default/aura/selfRegister/selfRegisterHelper.js new file mode 100644 index 0000000..f12dd70 --- /dev/null +++ b/force-app/main/default/aura/selfRegister/selfRegisterHelper.js @@ -0,0 +1,58 @@ +({ + qsToEventMap: { + 'startURL' : 'e.c:setStartUrl' + }, + + qsToEventMap2: { + 'expid' : 'e.c:setExpId' + }, + + handleSelfRegister: function (component, event, helpler) { + var accountId = component.get("v.accountId"); + var regConfirmUrl = component.get("v.regConfirmUrl"); + var firstname = component.find("firstname").get("v.value"); + var lastname = component.find("lastname").get("v.value"); + var email = component.find("email").get("v.value"); + var includePassword = component.get("v.includePasswordField"); + var password = component.find("password").get("v.value"); + var confirmPassword = component.find("confirmPassword").get("v.value"); + var action = component.get("c.selfRegister"); + var extraFields = JSON.stringify(component.get("v.extraFields")); // somehow apex controllers refuse to deal with list of maps + var startUrl = component.get("v.startUrl"); + + startUrl = decodeURIComponent(startUrl); + + action.setParams({firstname:firstname,lastname:lastname,email:email, + password:password, confirmPassword:confirmPassword, accountId:accountId, regConfirmUrl:regConfirmUrl, extraFields:extraFields, startUrl:startUrl, includePassword:includePassword}); + action.setCallback(this, function(a){ + var rtnValue = a.getReturnValue(); + if (rtnValue !== null) { + component.set("v.errorMessage",rtnValue); + component.set("v.showError",true); + } + }); + $A.enqueueAction(action); + }, + + getExtraFields : function (component, event, helpler) { + var action = component.get("c.getExtraFields"); + action.setParam("extraFieldsFieldSet", component.get("v.extraFieldsFieldSet")); + action.setCallback(this, function(a){ + var rtnValue = a.getReturnValue(); + if (rtnValue !== null) { + component.set('v.extraFields',rtnValue); + } + }); + $A.enqueueAction(action); + }, + + setBrandingCookie: function (component, event, helpler) { + var expId = component.get("v.expid"); + if (expId) { + var action = component.get("c.setExperienceId"); + action.setParams({expId:expId}); + action.setCallback(this, function(a){ }); + $A.enqueueAction(action); + } + } +}) \ No newline at end of file diff --git a/force-app/main/default/aura/setExpId/setExpId.evt b/force-app/main/default/aura/setExpId/setExpId.evt new file mode 100644 index 0000000..c1badd2 --- /dev/null +++ b/force-app/main/default/aura/setExpId/setExpId.evt @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/force-app/main/default/aura/setExpId/setExpId.evt-meta.xml b/force-app/main/default/aura/setExpId/setExpId.evt-meta.xml new file mode 100644 index 0000000..7bd716c --- /dev/null +++ b/force-app/main/default/aura/setExpId/setExpId.evt-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + Sample Event for setExpId + diff --git a/force-app/main/default/aura/setStartUrl/setStartUrl.evt b/force-app/main/default/aura/setStartUrl/setStartUrl.evt new file mode 100644 index 0000000..7b0813b --- /dev/null +++ b/force-app/main/default/aura/setStartUrl/setStartUrl.evt @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/force-app/main/default/aura/setStartUrl/setStartUrl.evt-meta.xml b/force-app/main/default/aura/setStartUrl/setStartUrl.evt-meta.xml new file mode 100644 index 0000000..9fe111f --- /dev/null +++ b/force-app/main/default/aura/setStartUrl/setStartUrl.evt-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + Sample Event for setStartUrl + diff --git a/force-app/main/default/classes/AccountController.cls b/force-app/main/default/classes/AccountController.cls new file mode 100644 index 0000000..84b1343 --- /dev/null +++ b/force-app/main/default/classes/AccountController.cls @@ -0,0 +1,7 @@ +public with sharing class AccountController { + @AuraEnabled(cacheable=true) + public static List findAccounts(String searchKey) { + String key = searchKey + '%'; + return [SELECT Id, Name FROM Account WHERE Name LIKE :key LIMIT 5]; + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/AccountController.cls-meta.xml b/force-app/main/default/classes/AccountController.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/AccountController.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/AccountHelper.cls b/force-app/main/default/classes/AccountHelper.cls new file mode 100644 index 0000000..48c1533 --- /dev/null +++ b/force-app/main/default/classes/AccountHelper.cls @@ -0,0 +1,7 @@ +public with sharing class AccountHelper { + @AuraEnabled(cacheable=true) + public Static List getAccount() { + return[SELECT Name,Phone FROM Account LIMIT 10]; + + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/AccountHelper.cls-meta.xml b/force-app/main/default/classes/AccountHelper.cls-meta.xml new file mode 100644 index 0000000..754ecb1 --- /dev/null +++ b/force-app/main/default/classes/AccountHelper.cls-meta.xml @@ -0,0 +1,5 @@ + + + 57.0 + Active + diff --git a/force-app/main/default/classes/AccountRelatedListController.cls b/force-app/main/default/classes/AccountRelatedListController.cls new file mode 100644 index 0000000..424d39e --- /dev/null +++ b/force-app/main/default/classes/AccountRelatedListController.cls @@ -0,0 +1,30 @@ +// AccountRelatedListController.apxc +public with sharing class AccountRelatedListController { + @AuraEnabled(cacheable=true) + public static List getAccountContacts(Id accountId) { + return [ + SELECT Id, Name, Email, Phone + FROM Contact + WHERE AccountId = :accountId + ]; + } + + @AuraEnabled(cacheable=true) + public static List getAccountOpportunities(Id accountId) { + return [ + SELECT Id, Name, StageName, Amount + FROM Opportunity + WHERE AccountId = :accountId + ]; + } + @AuraEnabled + public static void updateFileds(List recordInput) { + System.debug('recordInput ' + recordInput); + + try { + update recordInput; + } catch (Exception e) { + throw new AuraHandledException('Could not update records: ' + e.getMessage()); + } +} +} \ No newline at end of file diff --git a/force-app/main/default/classes/AccountRelatedListController.cls-meta.xml b/force-app/main/default/classes/AccountRelatedListController.cls-meta.xml new file mode 100644 index 0000000..b1a915c --- /dev/null +++ b/force-app/main/default/classes/AccountRelatedListController.cls-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + Active + diff --git a/force-app/main/default/classes/AccountSearchController.cls b/force-app/main/default/classes/AccountSearchController.cls new file mode 100644 index 0000000..2975323 --- /dev/null +++ b/force-app/main/default/classes/AccountSearchController.cls @@ -0,0 +1,12 @@ +public with sharing class AccountSearchController { + @AuraEnabled(cacheable=true) + public static List searchAccounts(String searchValue) { + List accounts = new List(); + if (String.isNotBlank(searchValue)) { + String searchQuery = searchValue + '%'; + accounts = [SELECT Id, Name,Type,Phone,ShippingStreet,ShippingCity,ShippingState,ShippingPostalCode FROM Account WHERE Name LIKE :searchQuery ORDER BY Name ASC]; + } + System.debug('Accounts: ' + accounts); + return accounts; + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/AccountSearchController.cls-meta.xml b/force-app/main/default/classes/AccountSearchController.cls-meta.xml new file mode 100644 index 0000000..b1a915c --- /dev/null +++ b/force-app/main/default/classes/AccountSearchController.cls-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + Active + diff --git a/force-app/main/default/classes/AccountSearchControllerTest.cls b/force-app/main/default/classes/AccountSearchControllerTest.cls new file mode 100644 index 0000000..e6bacc5 --- /dev/null +++ b/force-app/main/default/classes/AccountSearchControllerTest.cls @@ -0,0 +1,19 @@ +@isTest +public class AccountSearchControllerTest { + @isTest static void testSearchAccounts() { + // Prepare test data + Account testAccount1 = new Account(Name = 'Test Account 1'); + Account testAccount2 = new Account(Name = 'Test Account 2'); + insert new List{ testAccount1, testAccount2 }; + + // Call the method to test + Test.startTest(); + List accounts = AccountSearchController.searchAccounts('Test'); + Test.stopTest(); + + // Verify the results + System.assertEquals(2, accounts.size(), 'Expected to find 2 accounts'); + System.assertEquals(testAccount1.Id, accounts[0].Id, 'The first account ID does not match'); + System.assertEquals(testAccount2.Id, accounts[1].Id, 'The second account ID does not match'); + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/AccountSearchControllerTest.cls-meta.xml b/force-app/main/default/classes/AccountSearchControllerTest.cls-meta.xml new file mode 100644 index 0000000..b1a915c --- /dev/null +++ b/force-app/main/default/classes/AccountSearchControllerTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + Active + diff --git a/force-app/main/default/classes/AddAttachementToProjectHandler.cls b/force-app/main/default/classes/AddAttachementToProjectHandler.cls new file mode 100644 index 0000000..07d99f3 --- /dev/null +++ b/force-app/main/default/classes/AddAttachementToProjectHandler.cls @@ -0,0 +1,62 @@ +/** +* This class handles the addition of attachments to projects. +*/ +public with sharing class AddAttachementToProjectHandler { + //Method to add attachments to a list of projects. + public static void AddAttachments(List newProject) { + // Collect the Opportunity IDs associated with the new projects + try{ + Set oppIds = new Set(); + + for (ProjectDemo__c pro : newProject) { + oppIds.add(pro.Opportunity_Name__c); + + } + + + // Retrieve ContentDocumentLink records for the collected Opportunity IDs + List contentDocumentLinks = [ + SELECT ContentDocumentId, LinkedEntityId, ShareType, Visibility + FROM ContentDocumentLink + WHERE LinkedEntityId IN :oppIds + ]; + + // Organize ContentDocumentLinks by Opportunity ID + Map> projectIdToContentDocumentLinks = new Map>(); + for (ContentDocumentLink cdl : contentDocumentLinks) { + List cdlList = projectIdToContentDocumentLinks.containsKey(cdl.LinkedEntityId) ? + projectIdToContentDocumentLinks.get(cdl.LinkedEntityId) : + new List(); + cdlList.add(cdl); + projectIdToContentDocumentLinks.put(cdl.LinkedEntityId, cdlList); + } + + // Prepare a list of ContentDocumentLinks to be inserted + List insertCdlList = new List(); + for (ProjectDemo__c proj : newProject) { + system.debug('@@@@@@ proid:'+proj.Id); + if (projectIdToContentDocumentLinks.containsKey(proj.Opportunity_Name__c)) { + List contentDocumentLinksToCopy = projectIdToContentDocumentLinks.get(proj.Opportunity_Name__c); + for (ContentDocumentLink cdl : contentDocumentLinksToCopy) { + // Create new ContentDocumentLink records with relevant data + ContentDocumentLink newCdl = new ContentDocumentLink( + ContentDocumentId = cdl.ContentDocumentId, + LinkedEntityId = proj.Id, + ShareType = cdl.ShareType, + Visibility = cdl.Visibility + ); + insertCdlList.add(newCdl); + } + } + } + + // Insert the new ContentDocumentLink records if the list is not empty + if (!insertCdlList.isEmpty()) { + database.insert(insertCdlList); + } + } + catch(exception ex){ + system.debug('Error Occur ==' +ex.getMessage()); + } + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/AddAttachementToProjectHandler.cls-meta.xml b/force-app/main/default/classes/AddAttachementToProjectHandler.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/AddAttachementToProjectHandler.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/AddAttachmentToProjectTest.cls b/force-app/main/default/classes/AddAttachmentToProjectTest.cls new file mode 100644 index 0000000..4c5784d --- /dev/null +++ b/force-app/main/default/classes/AddAttachmentToProjectTest.cls @@ -0,0 +1,41 @@ +@isTest +public class AddAttachmentToProjectTest { + @isTest static void testAddAttachments() { + // Created test data + Opportunity opp = new Opportunity(Name = 'New Opp', StageName = 'Prospecting', CloseDate = Date.today()); + insert opp; + + ProjectDemo__c proj = new ProjectDemo__c(Opportunity_Name__c = opp.Id); + insert proj; + + ContentVersion cv = new ContentVersion( + Title = 'New Content version', + PathOnClient = 'Test.txt', + VersionData = Blob.valueOf('Test Content') + ); + insert cv; + + Id cdId = [SELECT ContentDocumentId FROM ContentVersion WHERE Id = :cv.Id].ContentDocumentId; + + ContentDocumentLink cdl = new ContentDocumentLink( + ContentDocumentId = cdId, + LinkedEntityId = opp.Id, + ShareType = 'V', + Visibility = 'AllUsers' + ); + insert cdl; + + // Calling the method to test + Test.startTest(); + AddAttachementToProjectHandler.AddAttachments(new List{proj}); + Test.stopTest(); + + // Verifing the results + List resultCdlList = [SELECT Id FROM ContentDocumentLink WHERE LinkedEntityId = :proj.Id]; + System.assertEquals(1, resultCdlList.size()); + + + + } + +} \ No newline at end of file diff --git a/force-app/main/default/classes/AddAttachmentToProjectTest.cls-meta.xml b/force-app/main/default/classes/AddAttachmentToProjectTest.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/AddAttachmentToProjectTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/ApexController.cls b/force-app/main/default/classes/ApexController.cls new file mode 100644 index 0000000..d3fdf98 --- /dev/null +++ b/force-app/main/default/classes/ApexController.cls @@ -0,0 +1,17 @@ +public with sharing class ApexController { + @AuraEnabled(cacheable=true) + public static List findMethod(String paramOne) { + // SOQL query here + List records = [SELECT Id, Name FROM Contact WHERE LastName = :paramOne LIMIT 1]; + return records; + } + + @AuraEnabled + public static String changeMethod(String paramForChangeOne) { + // DML operation here + Contact record = [SELECT Id, ChangedName__c FROM Contact WHERE LastName = :paramForChangeOne LIMIT 1]; + record.ChangedName__c = paramForChangeOne; + update record; + return 'Record updated successfully'; + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/ApexController.cls-meta.xml b/force-app/main/default/classes/ApexController.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/ApexController.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/AssignTest.cls b/force-app/main/default/classes/AssignTest.cls new file mode 100644 index 0000000..e8abd9b --- /dev/null +++ b/force-app/main/default/classes/AssignTest.cls @@ -0,0 +1,30 @@ +@isTest +public class AssignTest { + @isTest static void testMthd(){ + + Listoppl=new List(); + Opportunity op=new Opportunity(); + op.CloseDate=Date.today(); + op.Name='Yumi'; + + op.StageName='Closed Won'; + oppl.add(op); + insert oppl; + + List tasksToInsert = new List(); + for (Opportunity opps :oppl) { + if (opps.StageName == 'Closed Won') { + Task newTask = new Task(); + newTask.Subject = 'Opportunity Closed Won ho gyi hai bhai'; + newTask.Description = 'Account Name: ' + opps.Account.Name + '\nOpportunity Name: ' + opps.Name + '\nClose Date: ' + opps.CloseDate; + tasksToInsert.add(newTask); + } + } + if (!tasksToInsert.isEmpty()) { + insert tasksToInsert; + } + + } + + +} \ No newline at end of file diff --git a/force-app/main/default/classes/AssignTest.cls-meta.xml b/force-app/main/default/classes/AssignTest.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/AssignTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/BrevoContactTrigger_Handler.cls b/force-app/main/default/classes/BrevoContactTrigger_Handler.cls new file mode 100644 index 0000000..c81abf4 --- /dev/null +++ b/force-app/main/default/classes/BrevoContactTrigger_Handler.cls @@ -0,0 +1,171 @@ +public class BrevoContactTrigger_Handler { + /*Method to create contact in Brevo when created in SF*/ + + @future(callout=true) + public static void createContactInBrevo(String email, String firstName, String lastName, String phone, Id contactId) { + + try { + // Fetch the contact record + Contact con = [SELECT Brevo_Status__c, Brevo_List__c FROM Contact WHERE Id = :contactId]; + + // Map the Brevo_List__c values to list IDs + Map listMap = new Map{ + 'Salesforce Contact'=> 7, + 'Test List' => 8, + 'Identified Contacts' => 6 + }; + + // Get the list IDs from the Brevo_List__c field + List listIds = new List(); + for (String listName : con.Brevo_List__c.split(';')) { + if (listMap.containsKey(listName)) { + listIds.add(listMap.get(listName)); + } + } + HttpRequest req = new HttpRequest(); + Http http = new Http(); + + req.setEndpoint('https://api.brevo.com/v3/contacts'); + req.setMethod('POST'); + req.setHeader('Content-Type', 'application/json'); + req.setHeader('api-key', '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'); + Map brevoContact = new Map(); + brevoContact.put('email', email); + Map brevoAttributes = new Map(); + brevoAttributes.put('FIRSTNAME', firstName); + brevoAttributes.put('LASTNAME', lastName); + brevoAttributes.put('SMS', phone); + brevoContact.put('attributes', brevoAttributes); + String brevoBody = JSON.serialize(brevoContact); + req.setBody(brevoBody); + + try { + HttpResponse res = http.send(req); + if (res.getStatusCode() != 201) { + System.debug('Failed to create contact in Brevo with status code: ' + res.getStatusCode()); + con.Brevo_Status__c = 'Error: ' + res.getStatusCode(); + }else{ + Map responseMap = (Map) JSON.deserializeUntyped(res.getBody()); + String brevoId = String.valueOf(responseMap.get('id')); + //String successMessage = String.valueOf(responseMap.get('message')); + System.debug('Created Successfully in Brevo with ID: '+ brevoId); + con.Brevo_Status__c = 'Contact created in Brevo successfully: ' + ', Brevo ID: ' + brevoId; + } + database.update(con); + } catch(Exception ex) { + System.debug('API call failed with message: ' + ex.getMessage()); + } + + } catch(Exception ex) { + System.debug('API call failed with message: ' + ex.getMessage()); + } + } + + /*Method to update contact in Brevo when updated in SF Also, if update contact not exist in Brevo create new one*/ + + @future(callout=true) + public static void updateContactInBrevo(String email, String firstName, String lastName, String phone, Id contactId) { + + try { + HttpRequest req = new HttpRequest(); + Http http = new Http(); + + // GET request to check if the contact exists + req.setEndpoint('https://api.brevo.com/v3/contacts/' + email); + req.setMethod('GET'); + req.setHeader('Content-Type', 'application/json'); + req.setHeader('api-key', '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'); + + HttpResponse res = http.send(req); + Contact con = [SELECT Brevo_Status__c FROM Contact WHERE Id = :contactId]; + if (res.getStatusCode() == 200) { + // contact exists, sending a PUT request to update the contact + req.setMethod('PUT'); + Map brevoContact = new Map(); + brevoContact.put('email', email); + Map brevoAttributes = new Map(); + brevoAttributes.put('FIRSTNAME', firstName); + brevoAttributes.put('LASTNAME', lastName); + brevoAttributes.put('SMS', phone); + brevoContact.put('attributes', brevoAttributes); + String brevoBody = JSON.serialize(brevoContact); + req.setBody(brevoBody); + + HttpResponse updateRes = http.send(req); + if (updateRes.getStatusCode() == 204) { + System.debug('Record successfully updated in Brevo with status code: ' + updateRes.getStatusCode()); + con.Brevo_Status__c = 'Update Successfully, Brevo Email: ' + email; + } else { + System.debug('Failed to update contact in Brevo with status code: ' + updateRes.getStatusCode()); + con.Brevo_Status__c = 'Update Error: ' + updateRes.getStatusCode(); + } + database.update(con); + } else { + System.debug('Contact does not exist in Brevo creating new'); + HttpRequest req1 = new HttpRequest(); + Http http1 = new Http(); + + req1.setEndpoint('https://api.brevo.com/v3/contacts'); + req1.setMethod('POST'); + req1.setHeader('Content-Type', 'application/json'); + req1.setHeader('api-key', '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'); + Map brevoContact = new Map(); + brevoContact.put('email', email); + Map brevoAttributes = new Map(); + brevoAttributes.put('FIRSTNAME', firstName); + brevoAttributes.put('LASTNAME', lastName); + brevoAttributes.put('SMS', phone); + brevoContact.put('attributes', brevoAttributes); + String brevoBody = JSON.serialize(brevoContact); + req1.setBody(brevoBody); + + HttpResponse res1 = http.send(req1); + if (res1.getStatusCode() != 201) { + System.debug('Failed to create contact in Brevo with status code: ' + res.getStatusCode()); + con.Brevo_Status__c = 'Create Error: ' + res.getStatusCode(); + }else{ + Map responseMap = (Map) JSON.deserializeUntyped(res1.getBody()); + String brevoId = String.valueOf(responseMap.get('id')); + System.debug('Created Successfully in Brevo with ID: '+ brevoId); + con.Brevo_Status__c = 'Create Success, Brevo ID: ' + brevoId; + } + database.update(con); + } + + } catch(Exception ex) { + System.debug('API call failed with message: ' + ex.getMessage()); + } + } + + /*Method to delete contact from Brevo when deleted from SF*/ + + @future(callout=true) + public static void deleteContactInBrevo(String email) { + HttpRequest req = new HttpRequest(); + Http http = new Http(); + + // GET request to check if the contact exists + req.setEndpoint('https://api.brevo.com/v3/contacts/' + email); + req.setMethod('GET'); + req.setHeader('Content-Type', 'application/json'); + req.setHeader('api-key', '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'); + + try { + HttpResponse res = http.send(req); + if (res.getStatusCode() == 200) { + // contact exists, sending a DELETE request to delete the contact + req.setMethod('DELETE'); + HttpResponse deleteRes = http.send(req); + if (deleteRes.getStatusCode() == 204) { + System.debug('Record successfully deleted from Brevo with status code: ' + deleteRes.getStatusCode()); + + } else { + System.debug('Failed to delete contact in Brevo with status code: ' + deleteRes.getStatusCode()); + } + } + } catch(Exception ex) { + System.debug('API call failed with message: ' + ex.getMessage()); + } + } + +} \ No newline at end of file diff --git a/force-app/main/default/classes/BrevoContactTrigger_Handler.cls-meta.xml b/force-app/main/default/classes/BrevoContactTrigger_Handler.cls-meta.xml new file mode 100644 index 0000000..b1a915c --- /dev/null +++ b/force-app/main/default/classes/BrevoContactTrigger_Handler.cls-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + Active + diff --git a/force-app/main/default/classes/BrevoHandler.cls b/force-app/main/default/classes/BrevoHandler.cls new file mode 100644 index 0000000..7d814e4 --- /dev/null +++ b/force-app/main/default/classes/BrevoHandler.cls @@ -0,0 +1,64 @@ +public class BrevoHandler { + + static Map results = new Map(); + public static void getcontacts(){ + HttpRequest req = new HttpRequest(); + Http http = new Http(); + + // GET request to check if the contact exists + + req.setEndpoint('https://api.brevo.com/v3/contacts/' ); + req.setMethod('GET'); + req.setHeader('Content-Type', 'application/json'); + req.setHeader('api-key', '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'); + + try { + HttpResponse res = http.send(req); + if (res.getStatusCode() == 200) { + System.debug('Contact Already Exist in Brevo'); + results.putAll((Map) JSON.deserializeUntyped(res.getBody())); + + } + } catch(Exception e) { + System.debug('API call failed with message: ' + e.getMessage()); + } + + } + public static void print(){ + BrevoHandler.getcontacts(); + System.debug('@@@@@@@'+results.Size()); + } + + public static void createcontact(string email,string firstname,string lastname,string phone){ + + Brevohandler.getcontacts(); + HttpRequest req = new HttpRequest(); + Http http = new Http(); + + req.setEndpoint('https://api.brevo.com/v3/contacts'); + req.setMethod('POST'); + req.setHeader('Content-Type', 'application/json'); + req.setHeader('api-key', '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'); + Map brevoContact = new Map(); + brevoContact.put('email', email); + Map brevoAttributes = new Map(); + brevoAttributes.put('FIRSTNAME', firstName); + brevoAttributes.put('LASTNAME', lastName); + brevoAttributes.put('SMS', phone); + brevoContact.put('attributes', brevoAttributes); + String brevoBody = JSON.serialize(brevoContact); + req.setBody(brevoBody); + + try { + HttpResponse res = http.send(req); + if (res.getStatusCode() != 201) { + System.debug('Failed to create contact in Brevo with status code: ' + res.getStatusCode()); + }else{ + System.debug('Created Secussfully:'+brevobody); + } + } catch(Exception e) { + System.debug('API call failed with message: ' + e.getMessage()); + } + } + +} \ No newline at end of file diff --git a/force-app/main/default/classes/BrevoHandler.cls-meta.xml b/force-app/main/default/classes/BrevoHandler.cls-meta.xml new file mode 100644 index 0000000..b1a915c --- /dev/null +++ b/force-app/main/default/classes/BrevoHandler.cls-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + Active + diff --git a/force-app/main/default/classes/BrevoMockHttpResponseGenerator.cls b/force-app/main/default/classes/BrevoMockHttpResponseGenerator.cls new file mode 100644 index 0000000..a5ce77f --- /dev/null +++ b/force-app/main/default/classes/BrevoMockHttpResponseGenerator.cls @@ -0,0 +1,26 @@ +// Implement mock callout class +@isTest +global class BrevoMockHttpResponseGenerator implements HttpCalloutMock { + // Implement this interface method + global HTTPResponse respond(HTTPRequest req) { + // Create a fake response + HttpResponse res = new HttpResponse(); + res.setHeader('Content-Type', 'application/json'); + if (req.getMethod() == 'GET') { + if (req.getEndpoint().contains('test@example.com')) { + res.setBody('{"email":"test@example.com"}'); // Set the body as per your requirement for GET + res.setStatusCode(200); + } else if (req.getEndpoint().contains('test2@example.com')) { + res.setBody('{"error":"Contact not found"}'); // Set the body as per your requirement for GET + res.setStatusCode(404); + } + } else if (req.getMethod() == 'PUT') { + res.setBody('{"id":"123"}'); // Set the body as per your requirement for PUT + res.setStatusCode(204); + } else if (req.getMethod() == 'POST') { + res.setBody('{"id":"123"}'); // Set the body as per your requirement for POST + res.setStatusCode(201); + } + return res; + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/BrevoMockHttpResponseGenerator.cls-meta.xml b/force-app/main/default/classes/BrevoMockHttpResponseGenerator.cls-meta.xml new file mode 100644 index 0000000..b1a915c --- /dev/null +++ b/force-app/main/default/classes/BrevoMockHttpResponseGenerator.cls-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + Active + diff --git a/force-app/main/default/classes/CallingFromTrigger.cls b/force-app/main/default/classes/CallingFromTrigger.cls new file mode 100644 index 0000000..674e748 --- /dev/null +++ b/force-app/main/default/classes/CallingFromTrigger.cls @@ -0,0 +1,30 @@ +global class CallingFromTrigger implements DataBase.Batchable{ + Listcontlist=new List(); + global CallingFromTrigger(Listclist){ + contlist=clist; + } + global DataBase.QueryLocator start(Database.BatchableContext BC){ + return(DataBase.getQueryLocator([SELECT Id,Email FROM Contact WHERE Id IN:contlist])); + + } + global void execute(Database.BatchableContext BC,ListScope){ + for(Contact c:Scope){ + c.Description='if Email available then we have sent email'; + + } + Database.update(Scope); + } + global void finish(Database.BatchableContext BC){ + for(Contact c:contlist){ + if(c.Email!=null){ + Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); + mail.setToAddresses(new String[] {c.Email}); + mail.setSubject('Added in Contact'); + String messageBody = 'Hii you are added in contact'; + mail.setPlainTextBody(messageBody); + Messaging.sendEmail(new Messaging.SingleEmailMessage[] {mail}); + } + } + } + +} \ No newline at end of file diff --git a/force-app/main/default/classes/CallingFromTrigger.cls-meta.xml b/force-app/main/default/classes/CallingFromTrigger.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/CallingFromTrigger.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/CallingbatchClass.cls b/force-app/main/default/classes/CallingbatchClass.cls new file mode 100644 index 0000000..f953846 --- /dev/null +++ b/force-app/main/default/classes/CallingbatchClass.cls @@ -0,0 +1,11 @@ +public class CallingbatchClass{ + public static void CallingbatchMethod(Listclist){ + for(Contact c:clist){ + if(c.Email!=null){ + Database.executeBatch(new CallingFromTrigger(clist)); + } + } + + } + +} \ No newline at end of file diff --git a/force-app/main/default/classes/CallingbatchClass.cls-meta.xml b/force-app/main/default/classes/CallingbatchClass.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/CallingbatchClass.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/ChangePasswordController.cls b/force-app/main/default/classes/ChangePasswordController.cls new file mode 100644 index 0000000..31dde01 --- /dev/null +++ b/force-app/main/default/classes/ChangePasswordController.cls @@ -0,0 +1,14 @@ +/** + * An apex page controller that exposes the change password functionality + */ +public with sharing class ChangePasswordController { + public String oldPassword {get; set;} + public String newPassword {get; set;} + public String verifyNewPassword {get; set;} + + public PageReference changePassword() { + return Site.changePassword(newPassword, verifyNewPassword, oldpassword); + } + + public ChangePasswordController() {} +} \ No newline at end of file diff --git a/force-app/main/default/classes/ChangePasswordController.cls-meta.xml b/force-app/main/default/classes/ChangePasswordController.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/ChangePasswordController.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/ChangePasswordControllerTest.cls b/force-app/main/default/classes/ChangePasswordControllerTest.cls new file mode 100644 index 0000000..2814e42 --- /dev/null +++ b/force-app/main/default/classes/ChangePasswordControllerTest.cls @@ -0,0 +1,14 @@ +/** + * An apex page controller that exposes the change password functionality + */ +@IsTest public with sharing class ChangePasswordControllerTest { + @IsTest(SeeAllData=true) public static void testChangePasswordController() { + // Instantiate a new controller with all parameters in the page + ChangePasswordController controller = new ChangePasswordController(); + controller.oldPassword = '123456'; + controller.newPassword = 'qwerty1'; + controller.verifyNewPassword = 'qwerty1'; + + System.assertEquals(controller.changePassword(),null); + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/ChangePasswordControllerTest.cls-meta.xml b/force-app/main/default/classes/ChangePasswordControllerTest.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/ChangePasswordControllerTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/CommunitiesLandingController.cls b/force-app/main/default/classes/CommunitiesLandingController.cls new file mode 100644 index 0000000..9633c5a --- /dev/null +++ b/force-app/main/default/classes/CommunitiesLandingController.cls @@ -0,0 +1,12 @@ +/** + * An apex page controller that takes the user to the right start page based on credentials or lack thereof + */ +public with sharing class CommunitiesLandingController { + + // Code we will invoke on page load. + public PageReference forwardToStartPage() { + return Network.communitiesLanding(); + } + + public CommunitiesLandingController() {} +} \ No newline at end of file diff --git a/force-app/main/default/classes/CommunitiesLandingController.cls-meta.xml b/force-app/main/default/classes/CommunitiesLandingController.cls-meta.xml new file mode 100644 index 0000000..b1a915c --- /dev/null +++ b/force-app/main/default/classes/CommunitiesLandingController.cls-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + Active + diff --git a/force-app/main/default/classes/CommunitiesLandingControllerTest.cls b/force-app/main/default/classes/CommunitiesLandingControllerTest.cls new file mode 100644 index 0000000..84b5643 --- /dev/null +++ b/force-app/main/default/classes/CommunitiesLandingControllerTest.cls @@ -0,0 +1,18 @@ +/** + * An apex page controller that takes the user to the right start page based on credentials or lack thereof + */ +@IsTest public with sharing class CommunitiesLandingControllerTest { + @IsTest(SeeAllData=true) public static void testCommunitiesLandingController() { + // Instantiate a new controller with all parameters in the page + CommunitiesLandingController controller = new CommunitiesLandingController(); + PageReference pageRef = controller.forwardToStartPage(); + //PageRef is either null or an empty object in test context + if(pageRef != null){ + String url = pageRef.getUrl(); + if(url != null){ + System.assertEquals(true, String.isEmpty(url)); + //show up in perforce + } + } + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/CommunitiesLandingControllerTest.cls-meta.xml b/force-app/main/default/classes/CommunitiesLandingControllerTest.cls-meta.xml new file mode 100644 index 0000000..b1a915c --- /dev/null +++ b/force-app/main/default/classes/CommunitiesLandingControllerTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + Active + diff --git a/force-app/main/default/classes/CommunitiesLoginController.cls b/force-app/main/default/classes/CommunitiesLoginController.cls new file mode 100644 index 0000000..35ab098 --- /dev/null +++ b/force-app/main/default/classes/CommunitiesLoginController.cls @@ -0,0 +1,14 @@ +/** + * An apex page controller that exposes the site login functionality + */ +global with sharing class CommunitiesLoginController { + + global CommunitiesLoginController () {} + + // Code we will invoke on page load. + global PageReference forwardToAuthPage() { + String startUrl = System.currentPageReference().getParameters().get('startURL'); + String displayType = System.currentPageReference().getParameters().get('display'); + return Network.forwardToAuthPage(startUrl, displayType); + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/CommunitiesLoginController.cls-meta.xml b/force-app/main/default/classes/CommunitiesLoginController.cls-meta.xml new file mode 100644 index 0000000..b1a915c --- /dev/null +++ b/force-app/main/default/classes/CommunitiesLoginController.cls-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + Active + diff --git a/force-app/main/default/classes/CommunitiesLoginControllerTest.cls b/force-app/main/default/classes/CommunitiesLoginControllerTest.cls new file mode 100644 index 0000000..b892fdc --- /dev/null +++ b/force-app/main/default/classes/CommunitiesLoginControllerTest.cls @@ -0,0 +1,10 @@ +/** + * An apex page controller that exposes the site login functionality + */ +@IsTest global with sharing class CommunitiesLoginControllerTest { + @IsTest(SeeAllData=true) + global static void testCommunitiesLoginController () { + CommunitiesLoginController controller = new CommunitiesLoginController(); + System.assertEquals(null, controller.forwardToAuthPage()); + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/CommunitiesLoginControllerTest.cls-meta.xml b/force-app/main/default/classes/CommunitiesLoginControllerTest.cls-meta.xml new file mode 100644 index 0000000..b1a915c --- /dev/null +++ b/force-app/main/default/classes/CommunitiesLoginControllerTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + Active + diff --git a/force-app/main/default/classes/CommunitiesSelfRegConfirmController.cls b/force-app/main/default/classes/CommunitiesSelfRegConfirmController.cls new file mode 100644 index 0000000..d98d1fe --- /dev/null +++ b/force-app/main/default/classes/CommunitiesSelfRegConfirmController.cls @@ -0,0 +1,7 @@ +/** + * An apex page controller that takes the user to the right start page based on credentials or lack thereof + */ +public with sharing class CommunitiesSelfRegConfirmController { + + public CommunitiesSelfRegConfirmController() {} +} \ No newline at end of file diff --git a/force-app/main/default/classes/CommunitiesSelfRegConfirmController.cls-meta.xml b/force-app/main/default/classes/CommunitiesSelfRegConfirmController.cls-meta.xml new file mode 100644 index 0000000..b1a915c --- /dev/null +++ b/force-app/main/default/classes/CommunitiesSelfRegConfirmController.cls-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + Active + diff --git a/force-app/main/default/classes/CommunitiesSelfRegConfirmControllerTest.cls b/force-app/main/default/classes/CommunitiesSelfRegConfirmControllerTest.cls new file mode 100644 index 0000000..18a60bb --- /dev/null +++ b/force-app/main/default/classes/CommunitiesSelfRegConfirmControllerTest.cls @@ -0,0 +1,9 @@ +/** + * An apex page controller that takes the user to the right start page based on credentials or lack thereof + */ +@IsTest public with sharing class CommunitiesSelfRegConfirmControllerTest { + @IsTest(SeeAllData=true) public static void testCommunitiesSelfRegConfirmController() { + // Instantiate a new controller with all parameters in the page + CommunitiesSelfRegConfirmController controller = new CommunitiesSelfRegConfirmController(); + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/CommunitiesSelfRegConfirmControllerTest.cls-meta.xml b/force-app/main/default/classes/CommunitiesSelfRegConfirmControllerTest.cls-meta.xml new file mode 100644 index 0000000..b1a915c --- /dev/null +++ b/force-app/main/default/classes/CommunitiesSelfRegConfirmControllerTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + Active + diff --git a/force-app/main/default/classes/CommunitiesSelfRegController.cls b/force-app/main/default/classes/CommunitiesSelfRegController.cls new file mode 100644 index 0000000..3b738aa --- /dev/null +++ b/force-app/main/default/classes/CommunitiesSelfRegController.cls @@ -0,0 +1,74 @@ +/** + * An apex page controller that supports self registration of users in communities that allow self registration + */ +public class CommunitiesSelfRegController { + + public String firstName {get; set;} + public String lastName {get; set;} + public String email {get; set;} + public String password {get; set {password = value == null ? value : value.trim(); } } + public String confirmPassword {get; set { confirmPassword = value == null ? value : value.trim(); } } + public String communityNickname {get; set { communityNickname = value == null ? value : value.trim(); } } + + public CommunitiesSelfRegController() { + String expid = ApexPages.currentPage().getParameters().get('expid'); + if (expId != null) { + Site.setExperienceId(expId); + } + } + + private boolean isValidPassword() { + return password == confirmPassword; + } + + public PageReference registerUser() { + + // it's okay if password is null - we'll send the user a random password in that case + if (!isValidPassword()) { + ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.ERROR, Label.site.passwords_dont_match); + ApexPages.addMessage(msg); + return null; + } + + String profileId = null; // To be filled in by customer. + String roleEnum = null; // To be filled in by customer. + String accountId = ''; // To be filled in by customer. + + String userName = email; + + User u = new User(); + u.Username = userName; + u.Email = email; + u.FirstName = firstName; + u.LastName = lastName; + u.CommunityNickname = communityNickname; + u.ProfileId = profileId; + + String userId; + + try { + userId = Site.createExternalUser(u, accountId, password); + } catch(Site.ExternalUserCreateException ex) { + List errors = ex.getDisplayMessages(); + for (String error : errors) { + ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, error)); + } + + // This message is used for debugging. Do not display this in the UI to the end user. + // It has the information around why the user creation failed. + System.debug(ex.getMessage()); + } + + if (userId != null) { + if (password != null && password.length() > 1) { + return Site.login(userName, password, ApexPages.currentPage().getParameters().get('startURL')); + } + else { + PageReference page = System.Page.CommunitiesSelfRegConfirm; + page.setRedirect(true); + return page; + } + } + return null; + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/CommunitiesSelfRegController.cls-meta.xml b/force-app/main/default/classes/CommunitiesSelfRegController.cls-meta.xml new file mode 100644 index 0000000..b1a915c --- /dev/null +++ b/force-app/main/default/classes/CommunitiesSelfRegController.cls-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + Active + diff --git a/force-app/main/default/classes/CommunitiesSelfRegControllerTest.cls b/force-app/main/default/classes/CommunitiesSelfRegControllerTest.cls new file mode 100644 index 0000000..bda9c05 --- /dev/null +++ b/force-app/main/default/classes/CommunitiesSelfRegControllerTest.cls @@ -0,0 +1,20 @@ +/** + * An apex page controller that supports self registration of users in communities that allow self registration + */ +@IsTest public with sharing class CommunitiesSelfRegControllerTest { + @IsTest(SeeAllData=true) + public static void testCommunitiesSelfRegController() { + CommunitiesSelfRegController controller = new CommunitiesSelfRegController(); + controller.firstName = 'FirstName'; + controller.lastName = 'LastName'; + controller.email = 'test@force.com'; + controller.communityNickname = 'test'; + + // registerUser will always return null when the page isn't accessed as a guest user + System.assert(controller.registerUser() == null); + + controller.password = 'abcd1234'; + controller.confirmPassword = 'abcd123'; + System.assert(controller.registerUser() == null); + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/CommunitiesSelfRegControllerTest.cls-meta.xml b/force-app/main/default/classes/CommunitiesSelfRegControllerTest.cls-meta.xml new file mode 100644 index 0000000..b1a915c --- /dev/null +++ b/force-app/main/default/classes/CommunitiesSelfRegControllerTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + Active + diff --git a/force-app/main/default/classes/ContactCreator.cls b/force-app/main/default/classes/ContactCreator.cls new file mode 100644 index 0000000..61e307e --- /dev/null +++ b/force-app/main/default/classes/ContactCreator.cls @@ -0,0 +1,28 @@ +public without sharing class ContactCreator { + @AuraEnabled + public static void createContact(String fname, String lname, String email) { + System.debug('Creating contact with email: ' + email); + + // Check for duplicate email + List existingContacts = [SELECT Id FROM Contact WHERE Email = :email LIMIT 1]; + System.debug('Found ' + existingContacts.size() + ' contacts with the same email'); + + if (!existingContacts.isEmpty()) { + throw new AuraHandledException('A contact with this email already exists.'); + } + + // If no duplicate found, create new contact + Contact newContact = new Contact(); + newContact.FirstName = fname; + newContact.LastName = lname; + newContact.Email = email; + + try { + insert newContact; + System.debug('Successfully created contact with email: ' + email); + } catch (DmlException e) { + System.debug('Error while creating contact: ' + e.getMessage()); + throw new AuraHandledException('An error occurred: ' + e.getMessage()); + } + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/ContactCreator.cls-meta.xml b/force-app/main/default/classes/ContactCreator.cls-meta.xml new file mode 100644 index 0000000..b1a915c --- /dev/null +++ b/force-app/main/default/classes/ContactCreator.cls-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + Active + diff --git a/force-app/main/default/classes/ContactFormController.cls b/force-app/main/default/classes/ContactFormController.cls new file mode 100644 index 0000000..2b56806 --- /dev/null +++ b/force-app/main/default/classes/ContactFormController.cls @@ -0,0 +1,49 @@ +public class ContactFormController { + + public string FirstName { set; get; } + public String LastName { set; get; } + public String Email { set; get; } + public String Phone { set; get; } + public Boolean disabl {set;get; } + Contact con = new Contact(); + + + // checking condition and passing value + public ContactFormController() + { + disabl=true; + + } + + public void change(){ + System.debug('Change is Running now'); + if (String.isNotBlank(FirstName) && String.isNotBlank(LastName) && String.isNotBlank(Email) && String.isNotBlank(Phone)){ + disabl = false; // If all fields are filled, enable the submit button + } else { + disabl = true; // If any field is empty, disable the submit button + } + } + + //saving into contact + // + public void insertAcc(){ + try { + con.FirstName = FirstName; + con.LastName = LastName; + con.Email = Email; + con.Phone = Phone; + insert con; + } catch (Exception e) { + // Handle the exception here + System.debug('Error: ' + e.getMessage()); + + } + + // calling next vf page + + + + + } + +} \ No newline at end of file diff --git a/force-app/main/default/classes/ContactFormController.cls-meta.xml b/force-app/main/default/classes/ContactFormController.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/ContactFormController.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/Controller.cls b/force-app/main/default/classes/Controller.cls new file mode 100644 index 0000000..7a9ee97 --- /dev/null +++ b/force-app/main/default/classes/Controller.cls @@ -0,0 +1,161 @@ +public class Controller { + + // This method is called when a new ContentDocument is inserted + public static void ControllerMethod(List cdlist) { + try { + String cdid = '', Title = ''; + // Iterating over the inserted ContentDocuments + for (ContentDocument cd : cdlist) { + cdid = cd.Id; + Title = cd.Title; + } + // Debugging the data + system.debug('@@@@ getting data' + cdlist + 'ontent Document id:' + cdid); + // Calling the checkDoc method with the Id and Title of the last ContentDocument in the list + Controller.checkDoc(cdid, Title); + } catch (Exception e) { + system.debug('Error in ControllerMethod: ' + e); + } + } + + // This future method is used to perform operations that need to be done asynchronously + @future + public static void checkDoc(String docId, String Title) { + try { + // Fetching all ContentDocumentLink records associated with the given ContentDocument Id + List cdlList = [SELECT Id,LinkedEntityId FROM ContentDocumentLink WHERE ContentDocumentId = :docId]; + system.debug('@@@@@ ContentDocumentLink Record:' + cdlList+'Title of content document:'+ Title); + + List LinkedEntyId = new List(); + // Extracting the LinkedEntityIds from the fetched ContentDocumentLink records + for (ContentDocumentlink cd1 : cdlList) { + LinkedEntyId.add(cd1.LinkedEntityId); + } + system.debug('@@@@@ LinkedEntityId' + LinkedEntyId); + + // Fetching all Contact records associated with the LinkedEntityIds + List cList = [SELECT Id, LastName, Profile_Image__c, Image_url__c, Description FROM Contact WHERE Id = :LinkedEntyId]; + system.debug('Contact list where attachment is added' + cList); + + // Fetching the ContentVersion record associated with the given ContentDocument Id + ContentVersion cv = [SELECT Id, ContentBodyId FROM ContentVersion WHERE ContentDocumentId = :docId]; + system.debug('@@@@@ contentVersion records:' + cv); + + List updatedContacts = new List(); + for (Contact contact : cList) { + if (Title.containsIgnoreCase('Profile')) { + // If the title of the document contains 'Profile', updating the Image_url__c and Description fields of the Contact record + contact.Image_url__c = 'https://suprnova-dev-ed.develop.file.force.com/sfc/servlet.shepherd/version/renditionDownload?rendition=ORIGINAL_Jpg&versionId=' + cv.Id + '&operationContext=CHATTER&contentId=' + cv.ContentBodyId; + contact.Description = 'Profile Photo Updated'; + } + updatedContacts.add(contact); + } + // Updating the Contact records + update updatedContacts; + + } catch (Exception e) { + system.debug('Error in checkDoc: ' + e); + } + } + static Id linkedEntityId; + + // This method is called when a ContentDocument is deleted + public static void deletemethod(List cdlist){ + + String oldId=''; + // Iterating over the deleted ContentDocuments + for(ContentDocument p:cdlist){ + oldId=p.Id; + } + system.debug('@@@@@ deleted document id:'+oldId); + ContentDocumentLink cdl = [SELECT LinkedEntityId FROM ContentDocumentLink WHERE ContentDocumentId = :oldId LIMIT 1]; + system.debug('@@@@@cdl:'+cdl); + linkedEntityId = cdl.LinkedEntityId; + system.debug('@@@@@linkedEntityId:'+linkedEntityId); + + // Calling the checkDoc2 method with the Id of the last deleted ContentDocument in the list + Controller.checkDoc2(linkedEntityId); + } + + // This future method is used to perform operations that need to be done asynchronously after a ContentDocument is deleted + @future + public static void checkDoc2(Id linkedEntityId){ + + try{ + system.debug('Entered In delete Method'+linkedEntityId); + + // Fetching the LinkedEntityId from the ContentDocumentLink record associated with the given ContentDocument Id + // ContentDocumentLink odlEntityId=[SELECT LinkedEntityId FROM ContentDocumentLink WHERE ContentDocumentId=:docId2]; + // system.debug('@@@@@ linked entity id:'+odlEntityId); + + // Fetching all ContentDocuments related to the same Contact as the deleted document + ContentDocumentLink allRelatedCd=[SELECT ContentDocumentId FROM ContentDocumentLink WHERE LinkedEntityId=:linkedEntityId]; + system.debug('###allRelatedCd'+allRelatedCd); + List idTitles=[SELECT Id,Title FROM ContentDocument WHERE Id=:allRelatedCd.ContentDocumentId ]; + ListidofProfile=new List(); + + for(ContentDocument vb:idTitles){ + if(vb.Title.containsIgnoreCase('Profile')){ + idofProfile.add(vb.Id); + } + } + system.debug('@@@@@ idofProfile'+idofProfile); + + // Fetching the latest ContentDocument with a title containing 'Profile' + ContentDocument contentList0=[SELECT Id,Title FROM ContentDocument WHERE Id =:idofProfile ORDER BY CreatedDate DESC LIMIT 1]; + system.debug('@@@@@ ids of profile named files:'+ contentList0); + + List updatedContacts = new List(); + // Fetching all Contact records associated with the LinkedEntityId + ListcList=[SELECT Id,LastName,Profile_Image__c,Image_url__c,Description FROM Contact WHERE Id =:linkedEntityId]; + system.debug('Contact list where attachment is added'+cList); + // Storing the Id and title of the fetched ContentDocument + if(contentList0!=null){ + String profileid=contentList0.Id; + String Title=contentList0.Title; + + + + system.debug('@@@@@ List of ids:'+profileid); + system.debug('@@@@@ List of ids:'+Title); + + // Fetching the LinkedEntityId from the ContentDocumentLink record associated with the fetched ContentDocument + //ListcdLinkList=[SELECT Id,LinkedEntityId FROM ContentDocumentLink WHERE ContentDocumentId=:profileid]; + + // String entityId=''; + //for(ContentDocumentLink cdo:cdLinkList){ + // entityId=cdo.LinkedEntityId; + //} + //system.debug('@@@@ linked entity id :'+ entityId); + + + + // Fetching the ContentVersion record associated with the fetched ContentDocument + ContentVersion cv = [SELECT Id,ContentBodyId FROM ContentVersion WHERE ContentDocumentId = :profileid]; + system.debug('@@@@@ contentVersion records:'+cv); + + + // Updating the Contact records + for (Contact contact : cList) { + contact.Image_url__c='https://suprnova-dev-ed.develop.file.force.com/sfc/servlet.shepherd/version/renditionDownload?rendition=ORIGINAL_Jpg&versionId='+cv.Id+'&operationContext=CHATTER&contentId='+cv.ContentBodyId; + contact.Description = 'previous profile photo updated'; + updatedContacts.add(contact); + } + + } + else{ + for (Contact contact : cList) { + contact.Image_url__c='No profile'; + contact.Description = 'No previous profile '; + updatedContacts.add(contact); + } + } + update updatedContacts; + } + + catch(Exception e){ + System.debug('@@@@@@ error:'+e); + } + } + +} \ No newline at end of file diff --git a/force-app/main/default/classes/Controller.cls-meta.xml b/force-app/main/default/classes/Controller.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/Controller.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/ConvertingLeads.cls b/force-app/main/default/classes/ConvertingLeads.cls new file mode 100644 index 0000000..de162f3 --- /dev/null +++ b/force-app/main/default/classes/ConvertingLeads.cls @@ -0,0 +1,20 @@ +public class ConvertingLeads { + @InvocableMethod + public static void assignLeads(ListLeadIds){ + LeadStatus cLeadStatus=[Select Id,MasterLabel from LeadStatus where isConverted=true limit 1]; + List massLeadConvert=new List(); + List dl=new List(); + for(Id currentLead:LeadIds){ + Database.LeadConvert LeadConvert=new Database.LeadConvert(); + LeadConvert.setLeadId(currentLead); + LeadConvert.setConvertedStatus(cLeadStatus.MasterLabel); + LeadConvert.setDoNotCreateOpportunity(False); + dl.add(LeadConvert); + } + if(!dl.isEmpty()){ + List lcr=Database.convertLead(dl); + } + + } + +} \ No newline at end of file diff --git a/force-app/main/default/classes/ConvertingLeads.cls-meta.xml b/force-app/main/default/classes/ConvertingLeads.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/ConvertingLeads.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/CopyAttachmentHandler.cls b/force-app/main/default/classes/CopyAttachmentHandler.cls new file mode 100644 index 0000000..67598b6 --- /dev/null +++ b/force-app/main/default/classes/CopyAttachmentHandler.cls @@ -0,0 +1,69 @@ +public class CopyAttachmentHandler { + public static void copyAtt(ListpdList){ + try{ + + //releted opp id + Set OppId = new Set(); + Set CdId = new Set(); + + // related attachment id of opp id + Set attId = new Set(); + + for(ProjectDemo__c pd1:pdList){ + OppId.add(pd1.Opportunity_Name__c); + } + System.debug('@@@@@@ oppid'+OppId); + + for(ContentDocumentLink ac:[SELECT Id,ContentDocumentId FROM ContentDocumentLink WHERE LinkedEntityId IN:OppId]){ + attId.add(ac.Id); + CdId.add(ac.ContentDocumentId); + } + System.debug('@@@@@@ Attid'+attId); + System.debug('@@@@@@ CdId'+CdId); + + list newContentVersion=new list(); + list cdl=new list(); + + List attachmentList = [SELECT Id, VersionData,Description, Title, ContentBodyId, ContentDocumentId FROM ContentVersion WHERE ContentDocumentId IN:CdId]; + System.debug('@@@@@@ attachmentList'+attachmentList); + + + for(ContentVersion att: attachmentList) { + ContentVersion newFile = new ContentVersion(); + newFile.Title = att.Title; + newFile.ContentBodyId = att.ContentBodyId; + + newFile.Description=att.Description; + newContentVersion.add(newFile); + } + insert newContentVersion; + + + List CdIdid = new List(); + + for(ContentVersion cvv:newContentVersion){ + CdIdid.add(cvv.ContentDocumentId); + } + System.debug('@@@@@@ new content documnet id'+CdIdid); + + + for(ProjectDemo__c pd:pdList){ + ContentDocumentLink newLink= new ContentDocumentLink(); + newLink.LinkedEntityId=pd.Id; + for(Id ccd:CdIdid){ + newLink.ContentDocumentId=ccd; + } + cdl.add(newLink); + } + insert cdl; + + + } + catch(Exception e){ + system.debug('@@@@ Error'+e); + } + + + } + +} \ No newline at end of file diff --git a/force-app/main/default/classes/CopyAttachmentHandler.cls-meta.xml b/force-app/main/default/classes/CopyAttachmentHandler.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/CopyAttachmentHandler.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/FileController.cls b/force-app/main/default/classes/FileController.cls new file mode 100644 index 0000000..63ecf1b --- /dev/null +++ b/force-app/main/default/classes/FileController.cls @@ -0,0 +1,26 @@ +public with sharing class FileController{ + @AuraEnabled(cacheable=true) + public static List getVersionFiles(String recordId){ + try { + return [ + SELECT + Id, + Title, + ContentDocumentId, + FileType, + ContentSize, + FileExtension, + VersionNumber, + CreatedDate, + VersionData, + FirstPublishLocationId + FROM ContentVersion + WHERE FirstPublishLocationId =:recordId + ORDER BY CreatedDate DESC + ]; + + } catch (Exception e) { + throw new AuraHandledException(e.getMessage()); + } + } + } \ No newline at end of file diff --git a/force-app/main/default/classes/FileController.cls-meta.xml b/force-app/main/default/classes/FileController.cls-meta.xml new file mode 100644 index 0000000..754ecb1 --- /dev/null +++ b/force-app/main/default/classes/FileController.cls-meta.xml @@ -0,0 +1,5 @@ + + + 57.0 + Active + diff --git a/force-app/main/default/classes/FileDescrip.cls b/force-app/main/default/classes/FileDescrip.cls new file mode 100644 index 0000000..19196eb --- /dev/null +++ b/force-app/main/default/classes/FileDescrip.cls @@ -0,0 +1,11 @@ +public with sharing class FileDescrip { + @AuraEnabled(cacheable=false) + public static void updateFileDescription(Id recordId, String description) { + System.debug('Record Id' + recordId); + System.debug('description' + description); + + Account acc = [SELECT Id, File_Description__c FROM Account WHERE Id = :recordId]; + acc.File_Description__c = description; + update acc; + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/FileDescrip.cls-meta.xml b/force-app/main/default/classes/FileDescrip.cls-meta.xml new file mode 100644 index 0000000..754ecb1 --- /dev/null +++ b/force-app/main/default/classes/FileDescrip.cls-meta.xml @@ -0,0 +1,5 @@ + + + 57.0 + Active + diff --git a/force-app/main/default/classes/FileUploadService.cls b/force-app/main/default/classes/FileUploadService.cls new file mode 100644 index 0000000..eae7c36 --- /dev/null +++ b/force-app/main/default/classes/FileUploadService.cls @@ -0,0 +1,64 @@ +public with sharing class FileUploadService { + + @AuraEnabled + public static String uploadFile(String base64, String filename, String recordId) { + + ContentVersion cv = new ContentVersion(); + cv.VersionData = EncodingUtil.base64Decode(base64); + cv.Title = filename+'FPU'; + cv.PathOnClient = filename; + insert cv; + system.debug('cv data'+cv); + + ContentDocumentLink cdl = new ContentDocumentLink(); + cdl.ContentDocumentId = [SELECT ContentDocumentId FROM ContentVersion WHERE Id =: cv.id].ContentDocumentId; + cdl.LinkedEntityId = recordId; + cdl.ShareType = 'V'; + insert cdl; + system.debug('cdl data'+cdl); + + ContentVersion cvv = [SELECT Id,ContentBodyId FROM ContentVersion WHERE Id = :cv.Id]; + system.debug('cvv data'+cvv); + String imageUrl= 'https://suprnova-dev-ed.develop.file.force.com/sfc/servlet.shepherd/version/renditionDownload?rendition=ORIGINAL_Jpg&versionId='+cvv.Id +'&operationContext=CHATTER&contentId='+cvv.ContentBodyId; + + Friend__c c=[SELECT ProfileUrl__c FROM Friend__c WHERE Id = :recordId]; + c.ProfileUrl__c=imageUrl; + update c; + + return imageUrl; + + } + @AuraEnabled +public static String deletefile(String Contentv, String recordid) { + try { + system.debug('@@@@@'+Contentv+'@@@@'+recordid); + List cvList = [SELECT ContentDocumentId FROM ContentVersion WHERE Id = :Contentv]; + if (cvList.isEmpty()) { + throw new AuraHandledException('No ContentVersion found with the given ID'); + } + ContentVersion cv = cvList[0]; + + List cdList = [SELECT Id FROM ContentDocument WHERE Id = :cv.ContentDocumentId]; + if (cdList.isEmpty()) { + throw new AuraHandledException('No ContentDocument found with the given ID'); + } + ContentDocument cd = cdList[0]; + + List cList = [SELECT ProfileUrl__c FROM Friend__c WHERE Id = :recordid]; + if (cList.isEmpty()) { + throw new AuraHandledException('No Friend__c record found with the given ID'); + } + Friend__c c = cList[0]; + + c.ProfileUrl__c = null; + update c; + + delete cd; + + return 'Deletion successful'; + } catch (Exception e) { + throw new AuraHandledException(e.getMessage()); + } +} + +} \ No newline at end of file diff --git a/force-app/main/default/classes/FileUploadService.cls-meta.xml b/force-app/main/default/classes/FileUploadService.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/FileUploadService.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/ForgotPasswordController.cls b/force-app/main/default/classes/ForgotPasswordController.cls new file mode 100644 index 0000000..480df8b --- /dev/null +++ b/force-app/main/default/classes/ForgotPasswordController.cls @@ -0,0 +1,19 @@ +/** + * An apex page controller that exposes the site forgot password functionality + */ +public with sharing class ForgotPasswordController { + public String username {get; set;} + + public ForgotPasswordController() {} + + public PageReference forgotPassword() { + boolean success = Site.forgotPassword(username); + PageReference pr = Page.ForgotPasswordConfirm; + pr.setRedirect(true); + + if (success) { + return pr; + } + return null; + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/ForgotPasswordController.cls-meta.xml b/force-app/main/default/classes/ForgotPasswordController.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/ForgotPasswordController.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/ForgotPasswordControllerTest.cls b/force-app/main/default/classes/ForgotPasswordControllerTest.cls new file mode 100644 index 0000000..1712f2c --- /dev/null +++ b/force-app/main/default/classes/ForgotPasswordControllerTest.cls @@ -0,0 +1,12 @@ +/** + * An apex page controller that exposes the site forgot password functionality + */ +@IsTest public with sharing class ForgotPasswordControllerTest { + @IsTest(SeeAllData=true) public static void testForgotPasswordController() { + // Instantiate a new controller with all parameters in the page + ForgotPasswordController controller = new ForgotPasswordController(); + controller.username = 'test@salesforce.com'; + + System.assertEquals(controller.forgotPassword(),null); + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/ForgotPasswordControllerTest.cls-meta.xml b/force-app/main/default/classes/ForgotPasswordControllerTest.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/ForgotPasswordControllerTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/GCPAuthManagementService.cls b/force-app/main/default/classes/GCPAuthManagementService.cls new file mode 100644 index 0000000..dc2a7cd --- /dev/null +++ b/force-app/main/default/classes/GCPAuthManagementService.cls @@ -0,0 +1,87 @@ +public class GCPAuthManagementService{ + + // Class to deserialise response from the Google token URL and get the + // ID Token + public class GoogleAuthResponse { + public String id_token; + } + + + /** + * Get GCP service account keys from metadata + * @return the metadata record for the GCP service account + */ + public GCP_Key__mdt getGCPServiceAccount(String functionName) { + List gcp_sa_keys = new List(); + gcp_sa_keys = [SELECT + client_email__c, + audience__c, + token_endpoint__c, + query_fields__c, + object__c + FROM GCP_Key__mdt + WHERE function_name__c =: functionName]; + + System.debug('getGCPServiceAccount: ' + gcp_sa_keys); + + if (gcp_sa_keys.size() > 0) { + return gcp_sa_keys[0]; + } else { + throw new GCPException('Cannot find GCP Service Account Keys'); + } + } + + /** + * Constructs the JWT and invokes the Google Auth endpoint + * @param serviceAccount has the GCP keys obtained from the + * custom metadata object + * @return the auth response from GCP containing the id token + */ + public GoogleAuthResponse getGCPAuthToken(GCP_Key__mdt serviceAccount) { + + GoogleAuthResponse result = new GoogleAuthResponse(); + + Auth.JWT jwt = new Auth.JWT(); + jwt.setAud(serviceAccount.token_endpoint__c); + jwt.setIss(serviceAccount.client_email__c); + + System.debug('getGCPAuthToken jwt: ' + jwt); + + // Additional claims to set scope + Map claims = new Map(); + claims.put('target_audience', serviceAccount.audience__c); + jwt.setAdditionalClaims(claims); + + // Create the object that signs the JWT bearer token + Auth.JWS jws = new Auth.JWS(jwt, 'google_cloud'); + + // Get the resulting JWS in case debugging is required + String token = jws.getCompactSerialization(); + + // Set the token endpoint that the JWT bearer token is posted to + String tokenEndpoint = serviceAccount.token_endpoint__c; + + Auth.JWTBearerTokenExchange bearer = + new Auth.JWTBearerTokenExchange(tokenEndpoint, jws); + + if (!Test.isRunningTest()) { + System.HttpResponse response = bearer.getHTTPResponse(); + + result = + (GoogleAuthResponse) JSON.deserialize( + response.getBody(), GoogleAuthResponse.class); + + System.debug('GoogleAuthResponse result: ' + result); + + + } else { + result.id_token = 'IN TEST'; + } + + return result; + } + + + public class GCPException extends Exception {} + +} \ No newline at end of file diff --git a/force-app/main/default/classes/GCPAuthManagementService.cls-meta.xml b/force-app/main/default/classes/GCPAuthManagementService.cls-meta.xml new file mode 100644 index 0000000..f5e18fd --- /dev/null +++ b/force-app/main/default/classes/GCPAuthManagementService.cls-meta.xml @@ -0,0 +1,5 @@ + + + 60.0 + Active + diff --git a/force-app/main/default/classes/GetAllObjects.cls b/force-app/main/default/classes/GetAllObjects.cls new file mode 100644 index 0000000..6625ac7 --- /dev/null +++ b/force-app/main/default/classes/GetAllObjects.cls @@ -0,0 +1,32 @@ +public with sharing class GetAllObjects { + + // The @AuraEnabled annotation makes the method accessible from Lightning component + @AuraEnabled(cacheable=true) + public static List getAllObjects() { + // Initialize a list to hold the names of all accessible, createable, and updateable objects + List objectNames = new List(); + + // Loop through all sObject types in the org + for(Schema.SObjectType objType : Schema.getGlobalDescribe().Values()) { + // Get the describe result for the current sObject type + Schema.DescribeSObjectResult describeResult = objType.getDescribe(); + + // Check if the object is accessible, createable, and updateable to ensure it's not a system object + // Also check if the object has a 'Name' field, if it's updateable and if it's accessible + if (describeResult.isAccessible() && describeResult.isCreateable() && describeResult.isUpdateable() && + describeResult.fields.getMap().containsKey('Name') && + describeResult.fields.getMap().get('Name').getDescribe().isUpdateable() && + describeResult.fields.getMap().get('Name').getDescribe().isAccessible()) + { + // If the object meets the criteria, add its name to the list + objectNames.add(describeResult.getName()); + } + } + + // Sort the list of object names + objectNames.sort(); + + // Return the sorted list of object names + return objectNames; + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/GetAllObjects.cls-meta.xml b/force-app/main/default/classes/GetAllObjects.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/GetAllObjects.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/GitLab.cls b/force-app/main/default/classes/GitLab.cls new file mode 100644 index 0000000..c7636ab --- /dev/null +++ b/force-app/main/default/classes/GitLab.cls @@ -0,0 +1,8 @@ +public with sharing class GitLab { + + public static void GitLabMethod() { + + System.debug('Welcome to GitLab'); + + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/GitLab.cls-meta.xml b/force-app/main/default/classes/GitLab.cls-meta.xml new file mode 100644 index 0000000..b1a915c --- /dev/null +++ b/force-app/main/default/classes/GitLab.cls-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + Active + diff --git a/force-app/main/default/classes/GitLabTest.cls b/force-app/main/default/classes/GitLabTest.cls new file mode 100644 index 0000000..eec95f1 --- /dev/null +++ b/force-app/main/default/classes/GitLabTest.cls @@ -0,0 +1,10 @@ +@isTest +public class GitLabTest { + + @isTest static void testGitLabMethod() { + + // Call the method to test + GitLab.GitLabMethod(); + + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/GitLabTest.cls-meta.xml b/force-app/main/default/classes/GitLabTest.cls-meta.xml new file mode 100644 index 0000000..b1a915c --- /dev/null +++ b/force-app/main/default/classes/GitLabTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + Active + diff --git a/force-app/main/default/classes/GoogleCloudPubSubService.cls b/force-app/main/default/classes/GoogleCloudPubSubService.cls new file mode 100644 index 0000000..241ef8b --- /dev/null +++ b/force-app/main/default/classes/GoogleCloudPubSubService.cls @@ -0,0 +1,123 @@ +public with sharing class GoogleCloudPubSubService { + // AuraEnabled annotation makes the method available to Lightning components + public static String Endpoint ='https://pubsub.googleapis.com/v1/projects/cosmic-kayak-415607/subscriptions/Salesforce_Sub:'; + public static String token = 'Bearer ' + 'ya29.a0AfB_byCl9AVfe1VW7aF3xcztdGfO2CV_fYiuSEDSfpOBurXq0q5iTvKbJIzbZZUfIvvazwe61V5IEa3ktEof_CsByETJuNjni09HPdjL2mPuqrTabCF3EEtm48FL_58FdMPJgB_03RTXVcVB0itk_CgBe5f9M1cgYpZ-vu-C0hjchmA-vs04Oej_4ynTUPAv3zydoKlCXrJfTeHyxx6GWiHiz7Butdy7JvwysN_Q_E1KYrTzzX4tijS4V9qGw6vE5_WHGkeM3AR4wMncOmxKLnY6jOkDgh7sMOnRMJbqEXjgs0NzWVV4S3F2WfJ7FSgKqgmYGxkB6z7ddeApsrl2opozhZEbbF915ghHysBXB0rrDCCFUhaLWyTp4LJz8QbwlQNLA1SF4cMSERbJFPmGoeWfVLJOf5QYJwaCgYKAXYSARESFQHGX2Mih7BuVj3ub1fCx4ZEKbKu0w0425'; + @AuraEnabled + public static List> pullMessages() { + // Initialize a map to hold the response body + Map responseBody = new Map(); + // Initialize a list to hold the processed messages data + List> messagesData = new List>(); + try { + // Endpoint URL + String url = Endpoint+'pull'; + + // Create a map for the request payload + Map payloadMap = new Map(); + payloadMap.put('maxMessages', 10); // Set the maximum number of messages to pull + + // Convert the payload map to a JSON string + String payloadJson = JSON.serialize(payloadMap); + + // Create a new HttpRequest + HttpRequest req = new HttpRequest(); + req.setEndpoint(url); // Set the endpoint URL + req.setMethod('POST'); // Set the HTTP method to POST + req.setTimeout(120000); // Set the timeout to 120 seconds + req.setHeader('Content-Type', 'application/json'); // Set the Content-Type header to application/json + + // Set the Authorization header to the bearer token + req.setHeader('Authorization',token); + req.setBody(payloadJson); // Set the request body + + // Create a new Http object and send the request + Http http = new Http(); + HttpResponse res = http.send(req); + if(res.getStatusCode() == 200){ + // If the response status code is 200 (OK), deserialize the response body + responseBody = (Map) JSON.deserializeUntyped(res.getBody()); + } + + // Get the received messages from the response body + List receivedMessagesObjects = (List) responseBody.get('receivedMessages'); + List> receivedMessages = new List>(); + for (Object obj : receivedMessagesObjects) { + // Cast each received message to a map and add it to the list + receivedMessages.add((Map) obj); + } + + for (Map receivedMessage : receivedMessages) { + // Get the message from the received message + Map message = (Map)receivedMessage.get('message'); + // Get the data from the message and decode it + String data = (String)message.get('data'); + Blob dataAsBlob = EncodingUtil.base64Decode(data); + String decodedData = dataAsBlob.toString(); + // Deserialize the decoded data to a map + Map decodedDataMap = (Map) JSON.deserializeUntyped(decodedData); + // Get the message ID, ack ID, and publish time from the message + String messageId = (String)message.get('messageId'); + String ackId = (String)receivedMessage.get('ackId'); + String publishTime = (String)message.get('publishTime'); + + // Create a map to hold the message data + Map messageData = new Map(); + messageData.put('messageId', messageId); + messageData.put('data', decodedDataMap); + messageData.put('ackId', ackId); + messageData.put('publishTime', publishTime); + + // Add the message data to the list + messagesData.add(messageData); + } + + // Log the entire response body + System.debug('Response Body: ' +messagesData); + + + } catch (Exception e) { + // Log any exceptions that occur + System.debug('Error in pullMessages: ' + e.getMessage()); + } + return messagesData; // Return the list of message data + } + @AuraEnabled(cacheable=true) + public static void acknowledgeMessages(List ackIds) { + try { + // Endpoint URL + String url = Endpoint+'acknowledge'; + + // Create a map for the request payload + Map payloadMap = new Map(); + payloadMap.put('ackIds', ackIds); // Set the ackIds to acknowledge + + // Convert the payload map to a JSON string + String payloadJson = JSON.serialize(payloadMap); + + // Create a new HttpRequest + HttpRequest req = new HttpRequest(); + req.setEndpoint(url); // Set the endpoint URL + req.setMethod('POST'); // Set the HTTP method to POST + req.setTimeout(120000); // Set the timeout to 120 seconds + req.setHeader('Content-Type', 'application/json'); // Set the Content-Type header to application/json + + // Set the Authorization header to the bearer token + req.setHeader('Authorization',token); + req.setBody(payloadJson); // Set the request body + + // Create a new Http object and send the request + Http http = new Http(); + HttpResponse res = http.send(req); + + if(res.getStatusCode() == 200){ + System.debug('Acknowledge successful'); + } else { + System.debug('Acknowledge failed: ' + res.getStatus()); + } + } catch (Exception e) { + // Log any exceptions that occur + System.debug('Error in acknowledgeMessages: ' + e.getMessage()); + } + } + +} \ No newline at end of file diff --git a/force-app/main/default/classes/GoogleCloudPubSubService.cls-meta.xml b/force-app/main/default/classes/GoogleCloudPubSubService.cls-meta.xml new file mode 100644 index 0000000..b1a915c --- /dev/null +++ b/force-app/main/default/classes/GoogleCloudPubSubService.cls-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + Active + diff --git a/force-app/main/default/classes/GoogleOrderPubSubQueueable.cls b/force-app/main/default/classes/GoogleOrderPubSubQueueable.cls new file mode 100644 index 0000000..d588884 --- /dev/null +++ b/force-app/main/default/classes/GoogleOrderPubSubQueueable.cls @@ -0,0 +1,62 @@ +public class GoogleOrderPubSubQueueable implements Queueable, Database.AllowsCallouts { + + public List orderList; + + public GoogleOrderPubSubQueueable(List order){ + this.orderList=order; + } + + public void execute(QueueableContext context) { + + //GCP Authentication + GCPAuthManagementService gms = new GCPAuthManagementService(); + GCP_Key__mdt serviceAccount = gms.getGCPServiceAccount('Salesforce_PubSub_Orders'); + + GCPAuthManagementService.GoogleAuthResponse gmsg = new GCPAuthManagementService.GoogleAuthResponse(); + gmsg = gms.getGCPAuthToken(serviceAccount); + + + String selectFields = serviceAccount.query_fields__c; + List fields = selectFields.split(','); + + String sobType = serviceAccount.object__c; + + JSONGenerator gen = JSON.createGenerator(true); + gen.writeStartObject(); + gen.writeFieldName('records'); + gen.writeStartArray(); + for (SObject sob : Database.query('' + + ' select ' + String.join(fields, ',') + + ' from ' + sobType + + ' where id IN: orderList' + )) { + gen.writeStartObject(); + for (String field : fields) { + Object value = sob.get(field); + // if no value returned, exclude from JSON + if (value != null) gen.writeStringField(field, String.valueOf(value)); + } + gen.writeEndObject(); + } + gen.writeEndArray(); + gen.writeEndObject(); + String body = gen.getAsString(); + System.debug('body-' + body); + + // send order to google pubsub as message + HttpRequest req = new HttpRequest(); + req.setEndpoint(serviceAccount.audience__c); + req.setHeader('Content-Type', 'application/json'); + req.setHeader('Authorization', 'Bearer ' + gmsg.id_token); + req.setMethod('POST'); + req.setbody(body); + + Http http = new Http(); + HTTPResponse response = http.send(req); + + system.debug('HTTP Request: ' + req); + system.debug('HTTP Response: ' + response.getBody()); + + + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/GoogleOrderPubSubQueueable.cls-meta.xml b/force-app/main/default/classes/GoogleOrderPubSubQueueable.cls-meta.xml new file mode 100644 index 0000000..f5e18fd --- /dev/null +++ b/force-app/main/default/classes/GoogleOrderPubSubQueueable.cls-meta.xml @@ -0,0 +1,5 @@ + + + 60.0 + Active + diff --git a/force-app/main/default/classes/InvokeSendLink.cls b/force-app/main/default/classes/InvokeSendLink.cls new file mode 100644 index 0000000..d14cfc8 --- /dev/null +++ b/force-app/main/default/classes/InvokeSendLink.cls @@ -0,0 +1,88 @@ +public class InvokeSendLink { + private static final String RAZORPAY_API_URL = 'https://api.razorpay.com/v1/payment_links/'; + private static final String RAZORPAY_KEY_ID = System.label.Key_Id_of_Razor_Pay; + private static final String RAZORPAY_KEY_SECRET = System.label.key_secret_of_RazorPay; + + public class SendLinkInput { + @InvocableVariable(label = 'Opportunity Name' required=true) + public String OppName; + + @InvocableVariable(label = 'Amount' required=true) + public Decimal Amount; + + @InvocableVariable(label = 'Email' required=true) + public String Email; + + @InvocableVariable(label = 'Phone' required=true) + public String Phone; + + @InvocableVariable(label = 'ContactName' required=true) + public String ContactName; + } + + public class SendLinkOutput { + @InvocableVariable(label = 'Payment ID') + public String paymentId; + + @InvocableVariable(label = 'Status') + public String status; + } + + + @InvocableMethod(label='Send Payment Link' description='Sending the Payment Link To Donor') + public static List InvokeMethod(List inputs) { + List outputs = new List(); + + if (inputs != null && !inputs.isEmpty()) { + for (SendLinkInput input : inputs) { + SendLinkOutput output = sendLinkMethod(input.Amount, input.Email, input.Phone, input.ContactName); + outputs.add(output); + } + } + System.debug(outputs); + return outputs; + } + + //Send Payment Link Method + public static SendLinkOutput sendLinkMethod(Decimal Amount,String Email,String Phone,String ContactName){ + HttpRequest req = new HttpRequest(); + req.setEndpoint(RAZORPAY_API_URL); + req.setMethod('POST'); + req.setHeader('Content-Type', 'application/json'); + req.setHeader('Authorization', 'Basic ' + EncodingUtil.base64Encode(Blob.valueOf(RAZORPAY_KEY_ID + ':' + RAZORPAY_KEY_SECRET))); + + Map requestBody = new Map{ + 'amount' => (Integer)(Amount * 100), // Razorpay expects amount in paise + 'currency' => 'INR', + 'description' => 'Payment link expires in 24 hours', + 'expire_by' => System.now().addDays(1).getTime() / 1000, + 'customer' => new Map{ + 'name' => ContactName, + 'contact' => '+91'+Phone, + 'email' => Email + }, + 'notify' => new Map{ + 'sms' => true, + 'email' => true + } + }; + + req.setBody(JSON.serialize(requestBody)); + + Http http = new Http(); + HttpResponse res = http.send(req); + + if (res.getStatusCode() == 200) { + Map responseBody = (Map)JSON.deserializeUntyped(res.getBody()); + SendLinkOutput output = new SendLinkOutput(); + output.paymentId = (String)responseBody.get('id'); + output.status = (String)responseBody.get('status'); + return output; + + } else { + System.debug('Error creating payment link. Status code: ' + res.getStatusCode()); + System.debug('Response body: ' + res.getBody()); + return null; + } + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/InvokeSendLink.cls-meta.xml b/force-app/main/default/classes/InvokeSendLink.cls-meta.xml new file mode 100644 index 0000000..651b172 --- /dev/null +++ b/force-app/main/default/classes/InvokeSendLink.cls-meta.xml @@ -0,0 +1,5 @@ + + + 61.0 + Active + diff --git a/force-app/main/default/classes/JourneyHandler.cls b/force-app/main/default/classes/JourneyHandler.cls new file mode 100644 index 0000000..6d72742 --- /dev/null +++ b/force-app/main/default/classes/JourneyHandler.cls @@ -0,0 +1,35 @@ +public class JourneyHandler { + public static void journeyHandlerMethod(Map oldPlayers, Map newPlayers){ + List mailList = new List(); + + for(Player__c play : newPlayers.values()) { + Player__c oldplay = oldPlayers.get(play.Id); + + // Check if 'Country__c' field is updated + if(oldplay.Country__c != play.Country__c) { + // Create a new email + Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); + + // Set the recipient email address + mail.setToAddresses(new String[] {play.Email__c}); + + // Set the email subject + mail.setSubject('Country Change Notification'); + // mail.setTemplateId(emailTemplate.Id); + + // Set the email body + mail.setPlainTextBody('Dear ' + play.Name + ',\n\nYour country has been updated from ' + oldplay.Country__c + ' to ' + play.Country__c + '.\n\nBest,\nYour Team'); + + // Add the email to the list + mailList.add(mail); + } + } + + // Send all emails in the list + if(!mailList.isEmpty()) { + System.debug('Mail sent '); + Messaging.sendEmail(mailList); + + } + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/JourneyHandler.cls-meta.xml b/force-app/main/default/classes/JourneyHandler.cls-meta.xml new file mode 100644 index 0000000..b1a915c --- /dev/null +++ b/force-app/main/default/classes/JourneyHandler.cls-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + Active + diff --git a/force-app/main/default/classes/LightningForgotPasswordController.cls b/force-app/main/default/classes/LightningForgotPasswordController.cls new file mode 100644 index 0000000..2a21187 --- /dev/null +++ b/force-app/main/default/classes/LightningForgotPasswordController.cls @@ -0,0 +1,35 @@ +global class LightningForgotPasswordController { + + public LightningForgotPasswordController() { + + } + + @AuraEnabled + public static String forgotPassword(String username, String checkEmailUrl) { + try { + Site.forgotPassword(username); + ApexPages.PageReference checkEmailRef = new PageReference(checkEmailUrl); + if(!Site.isValidUsername(username)) { + return Label.Site.invalid_email; + } + aura.redirect(checkEmailRef); + return null; + } + catch (Exception ex) { + return ex.getMessage(); + } + } + + @AuraEnabled + global static String setExperienceId(String expId) { + // Return null if there is no error, else it will return the error message + try { + if (expId != null) { + Site.setExperienceId(expId); + } + return null; + } catch (Exception ex) { + return ex.getMessage(); + } + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/LightningForgotPasswordController.cls-meta.xml b/force-app/main/default/classes/LightningForgotPasswordController.cls-meta.xml new file mode 100644 index 0000000..b1a915c --- /dev/null +++ b/force-app/main/default/classes/LightningForgotPasswordController.cls-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + Active + diff --git a/force-app/main/default/classes/LightningForgotPasswordControllerTest.cls b/force-app/main/default/classes/LightningForgotPasswordControllerTest.cls new file mode 100644 index 0000000..ab49bb8 --- /dev/null +++ b/force-app/main/default/classes/LightningForgotPasswordControllerTest.cls @@ -0,0 +1,25 @@ +@IsTest(SeeAllData = true) +public with sharing class LightningForgotPasswordControllerTest { + + /* Verifies that ForgotPasswordController handles invalid usernames appropriately */ + @IsTest + static void testLightningForgotPasswordControllerInvalidUserName() { + System.assertEquals(LightningForgotPasswordController.forgotPassword('fakeUser', 'http://a.com'), Label.Site.invalid_email); + System.assertEquals(LightningForgotPasswordController.forgotPassword(null, 'http://a.com'), Label.Site.invalid_email); + System.assertEquals(LightningForgotPasswordController.forgotPassword('a', '/home/home.jsp'), Label.Site.invalid_email); + } + + /* Verifies that null checkEmailRef url throws proper exception. */ + @IsTest + static void testLightningForgotPasswordControllerWithNullCheckEmailRef() { + System.assertEquals(LightningForgotPasswordController.forgotPassword('a', null), 'Argument 1 cannot be null'); + System.assertEquals(LightningForgotPasswordController.forgotPassword('a@salesforce.com', null), 'Argument 1 cannot be null'); + } + + /* Verifies that LightningForgotPasswordController object is instantiated correctly. */ + @IsTest + static void LightningForgotPasswordControllerInstantiation() { + LightningForgotPasswordController controller = new LightningForgotPasswordController(); + System.assertNotEquals(controller, null); + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/LightningForgotPasswordControllerTest.cls-meta.xml b/force-app/main/default/classes/LightningForgotPasswordControllerTest.cls-meta.xml new file mode 100644 index 0000000..b1a915c --- /dev/null +++ b/force-app/main/default/classes/LightningForgotPasswordControllerTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + Active + diff --git a/force-app/main/default/classes/LightningLoginFormController.cls b/force-app/main/default/classes/LightningLoginFormController.cls new file mode 100644 index 0000000..3c77267 --- /dev/null +++ b/force-app/main/default/classes/LightningLoginFormController.cls @@ -0,0 +1,65 @@ +global class LightningLoginFormController { + + public LightningLoginFormController() { + + } + + @AuraEnabled + public static String login(String username, String password, String startUrl) { + try{ + ApexPages.PageReference lgn = Site.login(username, password, startUrl); + aura.redirect(lgn); + return null; + } + catch (Exception ex) { + return ex.getMessage(); + } + } + + @AuraEnabled + public static Boolean getIsUsernamePasswordEnabled() { + Auth.AuthConfiguration authConfig = getAuthConfig(); + return authConfig.getUsernamePasswordEnabled(); + } + + @AuraEnabled + public static Boolean getIsSelfRegistrationEnabled() { + Auth.AuthConfiguration authConfig = getAuthConfig(); + return authConfig.getSelfRegistrationEnabled(); + } + + @AuraEnabled + public static String getSelfRegistrationUrl() { + Auth.AuthConfiguration authConfig = getAuthConfig(); + if (authConfig.getSelfRegistrationEnabled()) { + return authConfig.getSelfRegistrationUrl(); + } + return null; + } + + @AuraEnabled + public static String getForgotPasswordUrl() { + Auth.AuthConfiguration authConfig = getAuthConfig(); + return authConfig.getForgotPasswordUrl(); + } + + @TestVisible + private static Auth.AuthConfiguration getAuthConfig(){ + Id networkId = Network.getNetworkId(); + Auth.AuthConfiguration authConfig = new Auth.AuthConfiguration(networkId,''); + return authConfig; + } + + @AuraEnabled + global static String setExperienceId(String expId) { + // Return null if there is no error, else it will return the error message + try { + if (expId != null) { + Site.setExperienceId(expId); + } + return null; + } catch (Exception ex) { + return ex.getMessage(); + } + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/LightningLoginFormController.cls-meta.xml b/force-app/main/default/classes/LightningLoginFormController.cls-meta.xml new file mode 100644 index 0000000..b1a915c --- /dev/null +++ b/force-app/main/default/classes/LightningLoginFormController.cls-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + Active + diff --git a/force-app/main/default/classes/LightningLoginFormControllerTest.cls b/force-app/main/default/classes/LightningLoginFormControllerTest.cls new file mode 100644 index 0000000..b008372 --- /dev/null +++ b/force-app/main/default/classes/LightningLoginFormControllerTest.cls @@ -0,0 +1,30 @@ +@IsTest(SeeAllData = true) +public with sharing class LightningLoginFormControllerTest { + + @IsTest + static void LightningLoginFormControllerInstantiation() { + LightningLoginFormController controller = new LightningLoginFormController(); + System.assertNotEquals(controller, null); + } + + @IsTest + static void testIsUsernamePasswordEnabled() { + System.assertEquals(true, LightningLoginFormController.getIsUsernamePasswordEnabled()); + } + + @IsTest + static void testIsSelfRegistrationEnabled() { + System.assertEquals(false, LightningLoginFormController.getIsSelfRegistrationEnabled()); + } + + @IsTest + static void testGetSelfRegistrationURL() { + System.assertEquals(null, LightningLoginFormController.getSelfRegistrationUrl()); + } + + @IsTest + static void testAuthConfig() { + Auth.AuthConfiguration authConfig = LightningLoginFormController.getAuthConfig(); + System.assertNotEquals(null, authConfig); + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/LightningLoginFormControllerTest.cls-meta.xml b/force-app/main/default/classes/LightningLoginFormControllerTest.cls-meta.xml new file mode 100644 index 0000000..b1a915c --- /dev/null +++ b/force-app/main/default/classes/LightningLoginFormControllerTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + Active + diff --git a/force-app/main/default/classes/LightningSelfRegisterController.cls b/force-app/main/default/classes/LightningSelfRegisterController.cls new file mode 100644 index 0000000..b284918 --- /dev/null +++ b/force-app/main/default/classes/LightningSelfRegisterController.cls @@ -0,0 +1,137 @@ +global class LightningSelfRegisterController { + + public LightningSelfRegisterController() { + + } + + @TestVisible + private static boolean isValidPassword(String password, String confirmPassword) { + return password == confirmPassword; + } + + @TestVisible + private static boolean siteAsContainerEnabled(String communityUrl) { + Auth.AuthConfiguration authConfig = new Auth.AuthConfiguration(communityUrl,''); + return authConfig.isCommunityUsingSiteAsContainer(); + } + + @TestVisible + private static void validatePassword(User u, String password, String confirmPassword) { + if(!Test.isRunningTest()) { + Site.validatePassword(u, password, confirmPassword); + } + return; + } + + @AuraEnabled + public static String selfRegister(String firstname ,String lastname, String email, String password, String confirmPassword, String accountId, String regConfirmUrl, String extraFields, String startUrl, Boolean includePassword) { + Savepoint sp = null; + try { + sp = Database.setSavepoint(); + + if (lastname == null || String.isEmpty(lastname)) { + return Label.Site.lastname_is_required; + } + + if (email == null || String.isEmpty(email)) { + return Label.Site.email_is_required; + } + + User u = new User(); + u.Username = email; + u.put('Email',email); + + u.FirstName = firstname; + u.LastName = lastname; + + String networkId = Network.getNetworkId(); + + // If using site to host the community the user should not hit s1 after logging in from mobile. + if(networkId != null && siteAsContainerEnabled(Network.getLoginUrl(networkId))) { + u.put('UserPreferencesHideS1BrowserUI',true); + } + + String nickname = ((firstname != null && firstname.length() > 0) ? firstname.substring(0,1) : '' ) + lastname.substring(0,1); + nickname += String.valueOf(Crypto.getRandomInteger()).substring(1,7); + u.put('CommunityNickname', nickname); + + if (extraFields != null) { + List extraFieldsList = (List) JSON.deserializeUntyped(extraFields); + for (Object thisFieldObject : extraFieldsList) { + Map thisField = (Map) thisFieldObject; + Schema.SObjectField sof = Schema.SObjectType.User.fields.getMap().get((String) thisField.get('fieldPath')); + u.put(sof, thisField.get('value')); + } + } + + if (includePassword) { + if (!isValidPassword(password, confirmPassword)) { + return Label.site.passwords_dont_match; + } + validatePassword(u, password, confirmPassword); + } + else { + password = null; + } + + // lastName is a required field on user, but if it isn't specified, we'll default it to the username + String userId = Site.createPortalUser(u, accountId, password); + // create a fake userId for test. + if (Test.isRunningTest()) { + userId = 'fakeUserId'; + } + if (userId != null) { + if (password != null && password.length() > 1) { + ApexPages.PageReference lgn = Site.login(email, password, startUrl); + if(!Test.isRunningTest()) { + aura.redirect(lgn); + } + } + else { + ApexPages.PageReference confirmRef = new PageReference(regConfirmUrl); + if(!Test.isRunningTest()) { + aura.redirect(confirmRef); + } + + } + } + return null; + } + catch (Exception ex) { + Database.rollback(sp); + return ex.getMessage(); + } + } + + @AuraEnabled + public static List> getExtraFields(String extraFieldsFieldSet) { + List> extraFields = new List>(); + Schema.FieldSet fieldSet = Schema.SObjectType.User.fieldSets.getMap().get(extraFieldsFieldSet); + if(!Test.isRunningTest()) { + if (fieldSet != null) { + for (Schema.FieldSetMember f : fieldSet.getFields()) { + Map fieldDetail = new Map(); + fieldDetail.put('dbRequired', f.getDBRequired()); + fieldDetail.put('fieldPath', f.getFieldPath()); + fieldDetail.put('label', f.getLabel()); + fieldDetail.put('required', f.getRequired()); + fieldDetail.put('type', f.getType()); + fieldDetail.put('value', ''); // client will populate + extraFields.add(fieldDetail); + }}} + return extraFields; + } + + @AuraEnabled + global static String setExperienceId(String expId) { + // Return null if there is no error, else it will return the error message + try { + if (expId != null) { + Site.setExperienceId(expId); + } + return null; + } catch (Exception ex) { + return ex.getMessage(); + } + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/LightningSelfRegisterController.cls-meta.xml b/force-app/main/default/classes/LightningSelfRegisterController.cls-meta.xml new file mode 100644 index 0000000..b1a915c --- /dev/null +++ b/force-app/main/default/classes/LightningSelfRegisterController.cls-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + Active + diff --git a/force-app/main/default/classes/LightningSelfRegisterControllerTest.cls b/force-app/main/default/classes/LightningSelfRegisterControllerTest.cls new file mode 100644 index 0000000..5dec8d9 --- /dev/null +++ b/force-app/main/default/classes/LightningSelfRegisterControllerTest.cls @@ -0,0 +1,102 @@ +@IsTest(SeeAllData = true) +public with sharing class LightningSelfRegisterControllerTest { + + /* Verifies that IsValidPassword method with various password combinations. */ + @IsTest + static void testIsValidPassword() { + System.assert(LightningSelfRegisterController.isValidPassword('password?@12334', 'password?@12334') == true); + System.assert(LightningSelfRegisterController.isValidPassword('password?@12334', 'dummyPassword') == false); + System.assert(LightningSelfRegisterController.isValidPassword('password?@12334', null) == false); + System.assert(LightningSelfRegisterController.isValidPassword(null, 'fakePwd') == false); + } + + @IsTest + static void testSiteAsContainerEnabled() { + System.assertNotEquals(null, LightningSelfRegisterController.siteAsContainerEnabled('https://portaleu1-developer-edition.eu11.force.com')); + } + + /* Verifies the selfRegistration method flow with various invalid inputs */ + @IsTest + static void testSelfRegistration() { + Map < String, String > paramsMap = initializeParams(); + System.assertNotEquals(null, paramsMap); + System.assertEquals(Label.Site.lastname_is_required, LightningSelfRegisterController.selfRegister(paramsMap.get('firstName'), '', paramsMap.get('email'), paramsMap.get('password'), paramsMap.get('confirmPasswordCorrect'), null, paramsMap.get('regConfirmUrl'), null, paramsMap.get('startUrl'), true)); + System.assertEquals(Label.Site.email_is_required, LightningSelfRegisterController.selfRegister(paramsMap.get('firstName'), paramsMap.get('lastName'), '', paramsMap.get('password'), paramsMap.get('confirmPasswordCorrect'), null, paramsMap.get('regConfirmUrl'), null, paramsMap.get('startUrl'), true)); + System.assertEquals(Label.Site.email_is_required, LightningSelfRegisterController.selfRegister(null, paramsMap.get('lastName'), '', null, paramsMap.get('confirmPasswordCorrect'), null, paramsMap.get('regConfirmUrl'), null, paramsMap.get('startUrl'), true)); + System.assertEquals(Label.site.passwords_dont_match, LightningSelfRegisterController.selfRegister(paramsMap.get('firstName'), paramsMap.get('lastName'), paramsMap.get('email'), paramsMap.get('password'), paramsMap.get('confirmPasswordWrong'), null, paramsMap.get('regConfirmUrl'), null, paramsMap.get('startUrl'), true)); + System.assertNotEquals(null, LightningSelfRegisterController.selfRegister(paramsMap.get('firstName'), paramsMap.get('lastName'), '', paramsMap.get('password'), paramsMap.get('confirmPasswordWrong'), null, paramsMap.get('regConfirmUrl'), null, paramsMap.get('startUrl'), false)); + } + + + /* Verifies the selfRegistration flow for valid inputs */ + @IsTest + static void testSelfRegisterWithProperCredentials() { + Map < String, String > paramsMap = initializeParams(); + System.assertEquals(null, LightningSelfRegisterController.selfRegister(paramsMap.get('firstName'), paramsMap.get('lastName'), paramsMap.get('email'), paramsMap.get('password'), paramsMap.get('confirmPasswordCorrect'), null, paramsMap.get('regConfirmUrl'), null, paramsMap.get('startUrl'), true)); + } + + /* Verifies SelfRegistration flow with an accounId that is created within the test */ + @IsTest + static void testSelfRegisterWithCreatedAccount() { + Account acc = new Account(name = 'test acc'); + insert acc; + List < Account > accounts = [SELECT Id FROM Account LIMIT 1]; + System.assert(!accounts.isEmpty(), 'There must be at least one account in this environment!'); + String accountId = accounts[0].Id; + Map < String, String > paramsMap = initializeParams(); + System.assertEquals(null, LightningSelfRegisterController.selfRegister(paramsMap.get('firstName'), paramsMap.get('lastName'), paramsMap.get('email'), paramsMap.get('password'), paramsMap.get('confirmPasswordCorrect'), accountId, paramsMap.get('regConfirmUrl'), null, paramsMap.get('startUrl'), false)); + } + + @IsTest + static void testGetNullExtraFields() { + System.assertEquals(new List < Map < String, Object >> (), LightningSelfRegisterController.getExtraFields(null)); + } + + @IsTest + static void testGetNonEmptyExtraFields() { + System.assertEquals(new List < Map < String, Object >> (), LightningSelfRegisterController.getExtraFields('field1')); + } + + /* Verifies validation of extraFields within the Self Registration flow */ + @IsTest + static void testGetExtraFieldsInSelfRegistration() { + List < Map < String, Object >> fieldlist = new List < Map < String, Object >> (); + Map < String, String > paramsMap = initializeParams(); + Map < String, Object > fieldMap = new Map < String, Object > (); + fieldMap.put('description', 'new field'); + fieldMap.put('fieldPath', 'dummyPath'); + fieldlist.add(fieldMap); + String extraFields = JSON.serialize(fieldlist); + System.assertNotEquals(null, LightningSelfRegisterController.selfRegister(paramsMap.get('firstName'), paramsMap.get('lastName'), paramsMap.get('email'), paramsMap.get('password'), paramsMap.get('confirmPasswordCorrect'), null, paramsMap.get('regConfirmUrl'), extraFields, paramsMap.get('startUrl'), true)); + } + + @IsTest + static void LightningSelfRegisterControllerInstantiation() { + LightningSelfRegisterController controller = new LightningSelfRegisterController(); + System.assertNotEquals(controller, null); + } + + /* Helper method to initialize the parameters required for SelfRegistration. */ + private static Map < String, String > initializeParams() { + Map < String, String > paramsMap = new Map < String, String > (); + String firstName = 'test'; + String lastName = 'User'; + String email = 'testUser@salesforce.com'; + String password = 'testuser123'; + String confirmPasswordCorrect = 'testuser123'; + String confirmPasswordWrong = 'wrongpassword'; + String accountId = 'testuser123'; + String regConfirmUrl = 'http://registration-confirm.com'; + String startUrl = 'http://my.company.salesforce.com'; + paramsMap.put('firstName', firstName); + paramsMap.put('lastName', lastName); + paramsMap.put('email', email); + paramsMap.put('password', password); + paramsMap.put('confirmPasswordCorrect', confirmPasswordCorrect); + paramsMap.put('confirmPasswordWrong', confirmPasswordWrong); + paramsMap.put('accountId', accountId); + paramsMap.put('regConfirmUrl', regConfirmUrl); + paramsMap.put('startUrl', startUrl); + return paramsMap; + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/LightningSelfRegisterControllerTest.cls-meta.xml b/force-app/main/default/classes/LightningSelfRegisterControllerTest.cls-meta.xml new file mode 100644 index 0000000..b1a915c --- /dev/null +++ b/force-app/main/default/classes/LightningSelfRegisterControllerTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + Active + diff --git a/force-app/main/default/classes/LongRunningCallout.cls b/force-app/main/default/classes/LongRunningCallout.cls new file mode 100644 index 0000000..f7baa79 --- /dev/null +++ b/force-app/main/default/classes/LongRunningCallout.cls @@ -0,0 +1,35 @@ +public class LongRunningCallout { + // Declare requestLabel and result as class variables + public String requestLabel {get; set;} + public String result {get; set;} + + public Object startRequest() { + // Create continuation with a timeout + Continuation con = new Continuation(60); + con.continuationMethod = 'processResponse'; + + // Create callout request + HttpRequest req = new HttpRequest(); + req.setMethod('GET'); + req.setEndpoint('https://jsonplaceholder.typicode.com/posts'); + + // Add callout request to continuation + this.requestLabel = con.addHttpRequest(req); + + // Return the continuation + return con; + } + + // The callback method that processes the callout response + public Object processResponse() { + // Get the response by using the request label + HttpResponse response = Continuation.getResponse(this.requestLabel); + result = response.getBody(); + System.debug('Response-result:' + result); + // Process the response + System.debug('Response: ' + response.getBody()); + + // You can return null or a PageReference here + return null; + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/LongRunningCallout.cls-meta.xml b/force-app/main/default/classes/LongRunningCallout.cls-meta.xml new file mode 100644 index 0000000..f5e18fd --- /dev/null +++ b/force-app/main/default/classes/LongRunningCallout.cls-meta.xml @@ -0,0 +1,5 @@ + + + 60.0 + Active + diff --git a/force-app/main/default/classes/MakeContactController.cls b/force-app/main/default/classes/MakeContactController.cls new file mode 100644 index 0000000..b121260 --- /dev/null +++ b/force-app/main/default/classes/MakeContactController.cls @@ -0,0 +1,7 @@ +global class MakeContactController { + global PageReference save(){ + PageReference pageref=new PageReference('/apex/ThankuPAge'); + return pageref; + } + +} \ No newline at end of file diff --git a/force-app/main/default/classes/MakeContactController.cls-meta.xml b/force-app/main/default/classes/MakeContactController.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/MakeContactController.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/MakeProfile.cls b/force-app/main/default/classes/MakeProfile.cls new file mode 100644 index 0000000..afa1922 --- /dev/null +++ b/force-app/main/default/classes/MakeProfile.cls @@ -0,0 +1,14 @@ +public with sharing class MakeProfile { + @AuraEnabled + public static string getUrl(String contentVersionId){ + try { + system.debug('entered in method'); + ContentVersion cv = [SELECT ContentBodyId FROM ContentVersion WHERE Id = :contentVersionId]; + system.debug('@@@'+cv); + return 'https://suprnova-dev-ed.develop.file.force.com/sfc/servlet.shepherd/version/renditionDownload?rendition=ORIGINAL_Jpg&versionId='+contentVersionId+'&operationContext=CHATTER&contentId='+cv.ContentBodyId; + } catch (Exception e) { + throw new AuraHandledException(e.getMessage()); + } + } + +} \ No newline at end of file diff --git a/force-app/main/default/classes/MakeProfile.cls-meta.xml b/force-app/main/default/classes/MakeProfile.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/MakeProfile.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/MatchName.cls b/force-app/main/default/classes/MatchName.cls new file mode 100644 index 0000000..3a825d2 --- /dev/null +++ b/force-app/main/default/classes/MatchName.cls @@ -0,0 +1,20 @@ +public with sharing class MatchName { // Declaring a public Apex class with sharing rules + + @AuraEnabled // Annotation to enable client- and server-side access to the Apex method + + public static Boolean matchNameMethod(String acName){ // Declaring a public static method that returns a Boolean value and takes a String parameter + + try{ + List aclist=[SELECT Id,Name From Account WHERE Name =:acName]; // SOQL query to fetch Accounts with the given name + + if(aclist.isEmpty()){ // Checking if the list of Accounts is empty + return false; // If the list is empty, return false + } + else{ + return true; // If the list is not empty, return true + } + } catch (Exception e) { + throw new AuraHandledException(e.getMessage()); // Catching any exceptions and throwing an AuraHandledException with the error message + } + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/MatchName.cls-meta.xml b/force-app/main/default/classes/MatchName.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/MatchName.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/MicrobatchSelfRegController.cls b/force-app/main/default/classes/MicrobatchSelfRegController.cls new file mode 100644 index 0000000..e848951 --- /dev/null +++ b/force-app/main/default/classes/MicrobatchSelfRegController.cls @@ -0,0 +1,57 @@ +public class MicrobatchSelfRegController { + public String firstName {get; set;} + public String lastName {get; set;} + public String email {get; set;} + public String communityNickname {get; set { communityNickname = value == null ? value : value.trim(); } } + + public MicrobatchSelfRegController() { + String expid = ApexPages.currentPage().getParameters().get('expid'); + if (expId != null) { + Site.setExperienceId(expId); + } + } + + public PageReference registerUser() { + String userName = email; + String accountName; // to be filled by customer + String contactName; //to be filled by customer + String profileId = null; //to be filled by customer + String UUID; + + User u = new User(); + u.Username = userName; + u.Email = email; + u.FirstName = firstName; + u.LastName = lastName; + u.CommunityNickname = communityNickname; + u.ProfileId = profileId; + u.LocaleSidKey = 'en_US'; + u.TimeZoneSidKey = 'GMT'; + u.LanguageLocaleKey = 'en_US'; + u.EmailEncodingKey = 'UTF-8'; + + Account acc = new Account(); + acc.Name = 'Account for ' + lastName; + Contact c = new Contact(); + c.lastName = lastName; + + try { + UUID = Network.createExternalUserAsync(u, c,acc); + } catch(Site.ExternalUserCreateException ex) { + List errors = ex.getDisplayMessages(); + for (String error : errors) { + ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, error)); + } + + // This message is used for debugging. Do not display this in the UI to the end user. + // It has the information around why the user creation failed. + System.debug(ex.getMessage()); + } + if (UUID != null) { + PageReference page = System.Page.CommunitiesSelfRegConfirm; + page.setRedirect(true); + return page; + } + return null; + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/MicrobatchSelfRegController.cls-meta.xml b/force-app/main/default/classes/MicrobatchSelfRegController.cls-meta.xml new file mode 100644 index 0000000..b1a915c --- /dev/null +++ b/force-app/main/default/classes/MicrobatchSelfRegController.cls-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + Active + diff --git a/force-app/main/default/classes/MicrobatchSelfRegControllerTest.cls b/force-app/main/default/classes/MicrobatchSelfRegControllerTest.cls new file mode 100644 index 0000000..b6b8365 --- /dev/null +++ b/force-app/main/default/classes/MicrobatchSelfRegControllerTest.cls @@ -0,0 +1,14 @@ +@IsTest + public with sharing class MicrobatchSelfRegControllerTest { + @IsTest(SeeAllData=true) + public static void testMicrobatchSelfRegController() { + MicrobatchSelfRegController controller = new MicrobatchSelfRegController(); + controller.firstName = 'FirstName'; + controller.lastName = 'LastName'; + controller.email = 'test@force.com'; + controller.communityNickname = 'test'; + + // registerUser will always return null when the page isn't accessed as a guest user + System.assert(controller.registerUser() == null); + } + } \ No newline at end of file diff --git a/force-app/main/default/classes/MicrobatchSelfRegControllerTest.cls-meta.xml b/force-app/main/default/classes/MicrobatchSelfRegControllerTest.cls-meta.xml new file mode 100644 index 0000000..b1a915c --- /dev/null +++ b/force-app/main/default/classes/MicrobatchSelfRegControllerTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + Active + diff --git a/force-app/main/default/classes/MyAccounts.cls b/force-app/main/default/classes/MyAccounts.cls new file mode 100644 index 0000000..2b9de80 --- /dev/null +++ b/force-app/main/default/classes/MyAccounts.cls @@ -0,0 +1,7 @@ +public with sharing class MyAccounts { + @AuraEnabled(cacheable=true) + public static List getAccounts() { + return[SELECT Name,Phone FROM Account]; + + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/MyAccounts.cls-meta.xml b/force-app/main/default/classes/MyAccounts.cls-meta.xml new file mode 100644 index 0000000..754ecb1 --- /dev/null +++ b/force-app/main/default/classes/MyAccounts.cls-meta.xml @@ -0,0 +1,5 @@ + + + 57.0 + Active + diff --git a/force-app/main/default/classes/MyContactListController.cls b/force-app/main/default/classes/MyContactListController.cls new file mode 100644 index 0000000..91b0eab --- /dev/null +++ b/force-app/main/default/classes/MyContactListController.cls @@ -0,0 +1,6 @@ +public class MyContactListController { + @AuraEnabled(cacheable=true) + public static List getContacts(Id recordId) { + return [SELECT Id, Name, Email, Phone FROM Contact WHERE AccountId = :recordId]; + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/MyContactListController.cls-meta.xml b/force-app/main/default/classes/MyContactListController.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/MyContactListController.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/MyContinuationController.cls b/force-app/main/default/classes/MyContinuationController.cls new file mode 100644 index 0000000..0ed2660 --- /dev/null +++ b/force-app/main/default/classes/MyContinuationController.cls @@ -0,0 +1,36 @@ +public with sharing class MyContinuationController { + // Unique label that identifies the continuation + public String continuationToken; + + // Result of the long-running operation + public String result {get;set;} + + // Method that starts the continuation + @AuraEnabled + public Object getstartRequest() { + // Create continuation with a timeout + Continuation con = new Continuation(40); + con.continuationMethod = 'processResponse'; + + // Create callout request + HttpRequest req = new HttpRequest(); + req.setMethod('GET'); + req.setEndpoint('http://long-running-service.com'); + + // Add callout request to continuation + this.continuationToken = con.addHttpRequest(req); + + return con; + } + + // Callback method that processes the callout response + public Object processResponse() { + // Get the response by using the unique label + HttpResponse response = Continuation.getResponse(this.continuationToken); + + // Set the result variable that's displayed on the Visualforce page + this.result = response.getBody(); + + return null; + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/MyContinuationController.cls-meta.xml b/force-app/main/default/classes/MyContinuationController.cls-meta.xml new file mode 100644 index 0000000..f5e18fd --- /dev/null +++ b/force-app/main/default/classes/MyContinuationController.cls-meta.xml @@ -0,0 +1,5 @@ + + + 60.0 + Active + diff --git a/force-app/main/default/classes/MyProfilePageController.cls b/force-app/main/default/classes/MyProfilePageController.cls new file mode 100644 index 0000000..f3fe255 --- /dev/null +++ b/force-app/main/default/classes/MyProfilePageController.cls @@ -0,0 +1,53 @@ +/** + * An apex class that updates portal user details. + Guest users are never able to access this page. + */ +public with sharing class MyProfilePageController { + + private User user; + private boolean isEdit = false; + + public User getUser() { + return user; + } + + public MyProfilePageController() { + user = [SELECT id, email, username, usertype, communitynickname, timezonesidkey, languagelocalekey, firstname, lastname, phone, title, + street, city, country, postalcode, state, localesidkey, mobilephone, extension, fax, contact.email + FROM User + WHERE id = :UserInfo.getUserId()]; + // guest users should never be able to access this page + if (user.usertype == 'GUEST') { + throw new NoAccessException(); + } + } + + public Boolean getIsEdit() { + return isEdit; + } + + public void edit() { + isEdit=true; + } + + public void save() { + try { + update user; + isEdit=false; + } catch(DmlException e) { + ApexPages.addMessages(e); + } + } + + public PageReference changePassword() { + return Page.ChangePassword; + } + + public void cancel() { + isEdit=false; + user = [SELECT id, email, username, communitynickname, timezonesidkey, languagelocalekey, firstname, lastname, phone, title, + street, city, country, postalcode, state, localesidkey, mobilephone, extension, fax, contact.email + FROM User + WHERE id = :UserInfo.getUserId()]; + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/MyProfilePageController.cls-meta.xml b/force-app/main/default/classes/MyProfilePageController.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/MyProfilePageController.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/MyProfilePageControllerTest.cls b/force-app/main/default/classes/MyProfilePageControllerTest.cls new file mode 100644 index 0000000..1b59342 --- /dev/null +++ b/force-app/main/default/classes/MyProfilePageControllerTest.cls @@ -0,0 +1,55 @@ +/** + * An apex class that updates details of a portal user. + Guest users are never able to access this page. + */ +@IsTest public with sharing class MyProfilePageControllerTest { + + @IsTest(SeeAllData=true) static void testSave() { + // Modify the test to query for a portal user that exists in your org + List existingPortalUsers = [SELECT id, profileId, userRoleId FROM User WHERE UserRoleId <> null AND UserType='CustomerSuccess']; + + if (existingPortalUsers.isEmpty()) { + User currentUser = [select id, title, firstname, lastname, email, phone, mobilephone, fax, street, city, state, postalcode, country + FROM User WHERE id =: UserInfo.getUserId()]; + MyProfilePageController controller = new MyProfilePageController(); + System.assertEquals(currentUser.Id, controller.getUser().Id, 'Did not successfully load the current user'); + System.assert(controller.getIsEdit() == false, 'isEdit should default to false'); + controller.edit(); + System.assert(controller.getIsEdit() == true); + controller.cancel(); + System.assert(controller.getIsEdit() == false); + + System.assert(Page.ChangePassword.getUrl().equals(controller.changePassword().getUrl())); + + String randFax = Math.rint(Math.random() * 1000) + '5551234'; + controller.getUser().Fax = randFax; + controller.save(); + System.assert(controller.getIsEdit() == false); + + currentUser = [Select id, fax from User where id =: currentUser.Id]; + System.assert(currentUser.fax == randFax); + } else { + User existingPortalUser = existingPortalUsers[0]; + String randFax = Math.rint(Math.random() * 1000) + '5551234'; + + System.runAs(existingPortalUser) { + MyProfilePageController controller = new MyProfilePageController(); + System.assertEquals(existingPortalUser.Id, controller.getUser().Id, 'Did not successfully load the current user'); + System.assert(controller.getIsEdit() == false, 'isEdit should default to false'); + controller.edit(); + System.assert(controller.getIsEdit() == true); + + controller.cancel(); + System.assert(controller.getIsEdit() == false); + + controller.getUser().Fax = randFax; + controller.save(); + System.assert(controller.getIsEdit() == false); + } + + // verify that the user was updated + existingPortalUser = [Select id, fax from User where id =: existingPortalUser.Id]; + System.assert(existingPortalUser.fax == randFax); + } + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/MyProfilePageControllerTest.cls-meta.xml b/force-app/main/default/classes/MyProfilePageControllerTest.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/MyProfilePageControllerTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/NotifyBatch.cls b/force-app/main/default/classes/NotifyBatch.cls new file mode 100644 index 0000000..73a3a48 --- /dev/null +++ b/force-app/main/default/classes/NotifyBatch.cls @@ -0,0 +1,73 @@ +public class NotifyBatch implements Database.Batchable,Database.stateful,Schedulable { + public Map> maplist = new Map>(); + public void execute(SchedulableContext SC) { + NotifyBatch obj = new NotifyBatch() ; + Database.executeBatch(obj, 50); + } + public Database.QueryLocator start(Database.BatchableContext bc) { + String strPending = 'Pending'; + String SOQL = 'SELECT Id, Status, TargetObjectId, ElapsedTimeInDays, CreatedDate from ProcessInstance where Status =:strPending' ; + return Database.getQueryLocator(SOQL); + } + public void execute(Database.BatchableContext bc, List records){ + Set pids = new Set(); + for(ProcessInstance pLoop : records) { + if(pLoop.CreatedDate < Date.Today() || Test.isRunningTest()) + pids.add(pLoop.ID); + } + if(pids.size() > 0) { + List PWI = [Select ProcessInstance.CompletedDate,ProcessInstance.ElapsedTimeInDays,ProcessInstance.ElapsedTimeInHours,ProcessInstance.ElapsedTimeInMinutes,ProcessInstance.LastActorId,ProcessInstance.ProcessDefinitionId, + ProcessInstance.Status, + ProcessInstance.TargetObjectId, + ProcessInstance.ID, + ID, + ActorId, + ElapsedTimeInDays, + ElapsedTimeInHours, + ElapsedTimeInMinutes, + OriginalActor.Id, + OriginalActor.Email, + OriginalActor.LastName, + ProcessInstanceId + from ProcessInstanceWorkitem where ProcessInstanceId IN: pids ORDER BY CreatedDate Desc]; + for(ProcessInstanceWorkitem op2 : PWI) { + if(maplist.ContainsKey(op2.OriginalActor.Email)) { + List lst = maplist.get(op2.OriginalActor.Email); + lst.add(op2.Id); + maplist.put(op2.OriginalActor.Email, lst); + } else { + maplist.put(op2.OriginalActor.Email, new List{op2.Id}); + } + System.debug('maplist>>>>>> '+maplist.values()); + } + } + } + public void finish(Database.BatchableContext bc){ + if(maplist.size() > 0) { + List Singleemails = new List(); + for(String iloop : maplist.keyset()) { + List records = maplist.get(iloop); + List URLs = new List(); + for(Id rec : records) { + URLs.add(URL.getSalesforceBaseUrl().toExternalForm() + '/' + rec + '\r\n'); + } + Messaging.SingleEmailMessage Singleemail = new Messaging.SingleEmailMessage(); + Singleemail.settoAddresses(new List{iloop}); + Singleemail.setReplyTo('noreply@salesforce.com'); + Singleemail.setSenderDisplayName('SFDC Administrator'); + Singleemail.setSaveAsActivity(false); + Singleemail.setSubject('Waiting for Approval'); + String body = 'Hello' + '
' + '
' + 'The below items are waiting for your Approval. Please Approve'; + for(String key : URLs) { + body = body + '
' + key; + } + body = body + '
' + '
' + '
' + 'Thanks.'; + + Singleemail.setHTMLBody(body); + Singleemails.add(Singleemail); + } + if(Singleemails.Size() > 0) + Messaging.sendEmail(Singleemails); + } + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/NotifyBatch.cls-meta.xml b/force-app/main/default/classes/NotifyBatch.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/NotifyBatch.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/NotifyBatchTest.cls b/force-app/main/default/classes/NotifyBatchTest.cls new file mode 100644 index 0000000..fc3c89c --- /dev/null +++ b/force-app/main/default/classes/NotifyBatchTest.cls @@ -0,0 +1,41 @@ +@isTest +public class NotifyBatchTest { + @isTest + static void testNotifyBatch() { + // Create test data for ProcessInstance records + List testProcessInstances = new List(); + for (Integer i = 0; i < 200; i++) { // Creating more than 100 records to test batch size + ProcessInstance pi = new ProcessInstance(Status = 'Pending'); + testProcessInstances.add(pi); + } + insert testProcessInstances; + + Test.startTest(); + + // Schedule the batch class + String jobId = System.schedule('Test NotifyBatch', '0 0 0 15 3 ? 2022', new NotifyBatch()); + + Test.stopTest(); + + // Verify that the batch job has processed the records + // You can add your own assertions here based on your batch logic + + // Query ProcessInstanceWorkitem records or assert other expected behavior + + // Example: Query ProcessInstanceWorkitem records + List workitems = [ + SELECT Id + FROM ProcessInstanceWorkitem + WHERE ProcessInstanceId IN :testProcessInstances + ]; + + // Add your assertions here to verify the expected behavior of the batch job + System.assertEquals(testProcessInstances.size(), workitems.size()); + + // Clean up the test data + delete testProcessInstances; + + // Optionally, you can assert other aspects of the batch job's behavior + // For example, you can check the contents of the email messages sent, etc. + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/NotifyBatchTest.cls-meta.xml b/force-app/main/default/classes/NotifyBatchTest.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/NotifyBatchTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/PK_vfcontroller.cls b/force-app/main/default/classes/PK_vfcontroller.cls new file mode 100644 index 0000000..a39ea2b --- /dev/null +++ b/force-app/main/default/classes/PK_vfcontroller.cls @@ -0,0 +1,11 @@ +public class PK_vfcontroller { + + // Instance variable to hold the list of contacts + public Contact contacts {get; set;} + + // Constructor + public PK_vfcontroller() { + // Query to retrieve all contacts + contacts = [SELECT Name FROM Contact LIMIT 1]; + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/PK_vfcontroller.cls-meta.xml b/force-app/main/default/classes/PK_vfcontroller.cls-meta.xml new file mode 100644 index 0000000..b1a915c --- /dev/null +++ b/force-app/main/default/classes/PK_vfcontroller.cls-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + Active + diff --git a/force-app/main/default/classes/ProfilePhotoClass.cls b/force-app/main/default/classes/ProfilePhotoClass.cls new file mode 100644 index 0000000..33f0d76 --- /dev/null +++ b/force-app/main/default/classes/ProfilePhotoClass.cls @@ -0,0 +1,37 @@ +public with sharing class ProfilePhotoClass { + @AuraEnabled(cacheable=true) + public static string ProfilePhotoMethod(String Id){ + try { + + List allRelatedCd=[SELECT ContentDocumentId FROM ContentDocumentLink WHERE LinkedEntityId=:Id ]; + System.debug('allRelatedCd'+allRelatedCd); + List idTitles=new List(); + for(ContentDocumentLink cd:allRelatedCd){ + idTitles.add([SELECT Id,Title FROM ContentDocument WHERE Id=:cd.ContentDocumentId]); + } + + System.debug('idTitles'+idTitles); + + ListidofProfile=new List();//Storing that ids whos title contains Profile + + for(ContentDocument vb:idTitles){ + if(vb.Title.containsIgnoreCase('Profile')){ + idofProfile.add(vb.Id); + } + } + System.debug('idofProfile'+idofProfile); + + ContentDocument contentList0=[SELECT Id FROM ContentDocument WHERE Id =:idofProfile ORDER BY CreatedDate DESC LIMIT 1]; + + System.debug('contentList0'+contentList0); + + ContentVersion cv = [SELECT Id,ContentBodyId FROM ContentVersion WHERE ContentDocumentId = :contentList0.Id]; + System.debug('cv'+cv); + + return 'https://suprnova-dev-ed.develop.file.force.com/sfc/servlet.shepherd/version/renditionDownload?rendition=ORIGINAL_Jpg&versionId='+cv.Id+'&operationContext=CHATTER&contentId='+cv.ContentBodyId; + } catch (Exception e) { + throw new AuraHandledException(e.getMessage()); + } + + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/ProfilePhotoClass.cls-meta.xml b/force-app/main/default/classes/ProfilePhotoClass.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/ProfilePhotoClass.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/PubSubDataRetriever.cls b/force-app/main/default/classes/PubSubDataRetriever.cls new file mode 100644 index 0000000..6bf4409 --- /dev/null +++ b/force-app/main/default/classes/PubSubDataRetriever.cls @@ -0,0 +1,54 @@ +public class PubSubDataRetriever { + + // Google Cloud Pub/Sub parameters + private static final String PUBSUB_PROJECT_ID = 'operating-ethos-414907'; + private static final String PUBSUB_SUBSCRIPTION_ID = 'SalesforceTopic-sub'; + private static final String PUBSUB_ENDPOINT = 'https://pubsub.googleapis.com/v1/projects/' + PUBSUB_PROJECT_ID + + '/subscriptions/' + PUBSUB_SUBSCRIPTION_ID + ':pull'; + + // Google Cloud API credentials + private static final String GOOGLE_CLOUD_API_KEY = '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'; + + // Method to retrieve data from Cloud Pub/Sub + public static List> getDataFromPubSub() { + List> pubsubMessages = new List>(); + + // Build request JSON body + String requestBody = '{"returnImmediately": false, "maxMessages": 10}'; + + // Create HTTP request + HttpRequest request = new HttpRequest(); + request.setEndpoint(PUBSUB_ENDPOINT); + request.setMethod('POST'); + request.setHeader('Authorization', 'Bearer ' + GOOGLE_CLOUD_API_KEY); + request.setHeader('Content-Type', 'application/json'); + request.setBody(requestBody); + + // Send HTTP request + Http http = new Http(); + HttpResponse response = http.send(request); + + // Parse response + if (response.getStatusCode() == 200) { + Map responseData = (Map) JSON.deserializeUntyped(response.getBody()); + if (responseData.containsKey('receivedMessages')) { + List receivedMessages = (List) responseData.get('receivedMessages'); + for (Object message : receivedMessages) { + Map messageData = new Map(); + Map messageAttributes = (Map) ((Map) message).get('message'); + String data = (String) messageAttributes.get('data'); + messageData.put('data', EncodingUtil.base64Decode(data).toString()); + pubsubMessages.add(messageData); + } + } + } else { + System.debug('Error retrieving data from Cloud Pub/Sub. Status code: ' + response.getStatusCode()); + System.debug('Response body: ' + response.getBody()); + } + + // Print response body + System.debug('Response body: ' + response.getBody()); + + return pubsubMessages; + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/PubSubDataRetriever.cls-meta.xml b/force-app/main/default/classes/PubSubDataRetriever.cls-meta.xml new file mode 100644 index 0000000..f5e18fd --- /dev/null +++ b/force-app/main/default/classes/PubSubDataRetriever.cls-meta.xml @@ -0,0 +1,5 @@ + + + 60.0 + Active + diff --git a/force-app/main/default/classes/RazorpayWebhookHandler.cls b/force-app/main/default/classes/RazorpayWebhookHandler.cls new file mode 100644 index 0000000..a484ecb --- /dev/null +++ b/force-app/main/default/classes/RazorpayWebhookHandler.cls @@ -0,0 +1,57 @@ +@RestResource(urlMapping='/razorpay/webhook/*') +global without sharing class RazorpayWebhookHandler { + @HttpPost + global static void handleWebhook() { + + String requestBody = RestContext.request.requestBody.toString(); + System.debug('Received payload: ' + requestBody); + + Map payload = (Map) JSON.deserializeUntyped(requestBody); + + // Process the webhook payload + if(payload != null){ + processWebhook(payload); + } + else{ + System.debug('No Payload'); + + } + } + + private static void processWebhook(Map payload) { + try { + String eventType = (String) payload.get('event'); + Map paymentDetails = (Map) payload.get('payload'); + Map payment = (Map) paymentDetails.get('payment_link'); + Map entityMap = (Map) payment.get('entity'); + + String paymentLinkId = (String) entityMap.get('id'); + String paymentStatus = (String) entityMap.get('status'); + Decimal paidAmount = (Decimal) entityMap.get('amount_paid'); + + // Update the Salesforce record with the new payment status + updatePaymentStatus(paymentLinkId, paymentStatus,paidAmount); + RestContext.response.statusCode = 200; + RestContext.response.addHeader('Content-Type', 'application/json'); + RestContext.response.responseBody = Blob.valueOf('{"status":"success"}'); + } catch (Exception e) { + System.debug('Error in webhook processing: ' + e.getMessage() + '\n' + e.getStackTraceString()); + RestContext.response.statusCode = 500; + RestContext.response.addHeader('Content-Type', 'application/json'); + RestContext.response.responseBody = Blob.valueOf('{"status":"error","message":"' + e.getMessage() + '"}'); + } + } + + private static void updatePaymentStatus(String paymentLinkId, String paymentStatus,Decimal paidAmount) { + System.debug('PaymentLinkId: '+ paymentLinkId + 'paymentStatus :'+paymentStatus); + List oppList = [SELECT Id,Payment_Link_ID__c,Payment_Staus__c,Recieved_Amount__c FROM Opportunity WHERE Payment_Link_ID__c = :paymentLinkId LIMIT 1]; + + if (!oppList.isEmpty()) { + Opportunity opp = oppList[0]; + opp.Payment_Staus__c = paymentStatus; + opp.Recieved_Amount__c = paidAmount/100; + update opp; + } + + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/RazorpayWebhookHandler.cls-meta.xml b/force-app/main/default/classes/RazorpayWebhookHandler.cls-meta.xml new file mode 100644 index 0000000..651b172 --- /dev/null +++ b/force-app/main/default/classes/RazorpayWebhookHandler.cls-meta.xml @@ -0,0 +1,5 @@ + + + 61.0 + Active + diff --git a/force-app/main/default/classes/ReelatedCon.cls b/force-app/main/default/classes/ReelatedCon.cls new file mode 100644 index 0000000..ea01071 --- /dev/null +++ b/force-app/main/default/classes/ReelatedCon.cls @@ -0,0 +1,7 @@ +public with sharing class ReelatedCon { + + @AuraEnabled(cacheable=true) + public static List getcon(){ + Return[SELECT FirstName,LastName,Email,Phone From Contact WHERE AccountId='0015j000013q201AAA']; + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/ReelatedCon.cls-meta.xml b/force-app/main/default/classes/ReelatedCon.cls-meta.xml new file mode 100644 index 0000000..754ecb1 --- /dev/null +++ b/force-app/main/default/classes/ReelatedCon.cls-meta.xml @@ -0,0 +1,5 @@ + + + 57.0 + Active + diff --git a/force-app/main/default/classes/ReelatedCon1.cls b/force-app/main/default/classes/ReelatedCon1.cls new file mode 100644 index 0000000..46020cb --- /dev/null +++ b/force-app/main/default/classes/ReelatedCon1.cls @@ -0,0 +1,6 @@ +public with sharing class ReelatedCon1 { + @AuraEnabled(cacheable=true) + public static List getcon(){ + Return[SELECT FirstName,LastName,Email,Phone From Contact WHERE AccountId='0015j000013q201AAA']; + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/ReelatedCon1.cls-meta.xml b/force-app/main/default/classes/ReelatedCon1.cls-meta.xml new file mode 100644 index 0000000..754ecb1 --- /dev/null +++ b/force-app/main/default/classes/ReelatedCon1.cls-meta.xml @@ -0,0 +1,5 @@ + + + 57.0 + Active + diff --git a/force-app/main/default/classes/RelatedCon.cls b/force-app/main/default/classes/RelatedCon.cls new file mode 100644 index 0000000..5b1da96 --- /dev/null +++ b/force-app/main/default/classes/RelatedCon.cls @@ -0,0 +1,6 @@ +public with sharing class RelatedCon{ + @AuraEnabled(cacheable=true) + public static List getcon(String acId){ + Return[SELECT FirstName,LastName,Email,Phone From Contact WHERE AccountId=:acId]; + } + } \ No newline at end of file diff --git a/force-app/main/default/classes/RelatedCon.cls-meta.xml b/force-app/main/default/classes/RelatedCon.cls-meta.xml new file mode 100644 index 0000000..754ecb1 --- /dev/null +++ b/force-app/main/default/classes/RelatedCon.cls-meta.xml @@ -0,0 +1,5 @@ + + + 57.0 + Active + diff --git a/force-app/main/default/classes/RenewaloppClass.cls b/force-app/main/default/classes/RenewaloppClass.cls new file mode 100644 index 0000000..861176d --- /dev/null +++ b/force-app/main/default/classes/RenewaloppClass.cls @@ -0,0 +1,121 @@ +public class RenewaloppClass{ + public static void RenewalOppMethod(ListOpplist){ + try{ + List RenewalOpportunities = new List(); + Id newrectypeId = Schema.SObjectType.Opportunity.getRecordTypeInfosByName().get('New Business').getRecordTypeId(); + Id RenewablerectypeId = Schema.SObjectType.Opportunity.getRecordTypeInfosByName().get('Renewable Business').getRecordTypeId(); + System.debug('@@@@@ +new Business Id:' + newrectypeId); + System.debug('@@@@@ + Renewable Business Id:' + RenewablerectypeId); + Listopplist2=new List(Opplist); + system.debug('@@@@@+ Getting Data'+opplist2); + Listopt=new List(); + for(Opportunity op : Opplist){ + System.debug('@@@@@ Opplist in loop'+Opplist); + if (op.RecordTypeId == newrectypeId && op.StageName == 'Closed Won') { + Opportunity renewalOpp = new Opportunity(); + System.debug('@@@@@@ inside the 1st loop' ); + // Set the fields for the Renewal Opportunity + renewalOpp.RecordTypeId = RenewablerectypeId; + renewalOpp.Name = op.Name + ' - Renewal'; + renewalOpp.CloseDate = System.today() + 30; + renewalOpp.StageName = 'Renewal Ready'; + renewalOpp.Parent_Opportunity__c = op.Id; + renewalOpportunities.add(renewalOpp); + + } + else if (op.RecordTypeId == RenewablerectypeId && op.StageName == 'Closed Won'){ + Opportunity renewalOpp = new Opportunity(); + System.debug('@@@@@@ inside the 2nd loop' ); + // Set the fields for the Renewal Opportunity + renewalOpp.RecordTypeId = RenewablerectypeId; + renewalOpp.Name = op.Name + ' - Renewal'; + renewalOpp.CloseDate = System.today() + 30; + renewalOpp.StageName = 'Renewal Ready'; + renewalOpp.Parent_Opportunity__c = op.Id; + renewalOpportunities.add(renewalOpp); + + } + else{ + System.debug('@@@@ nothiggg'); + } + } + + insert RenewalOpportunities; + } + catch(Exception e){ + System.debug('@@@@@ Error:' + e); + } + } + //For Update.... + public static void RenewaloppMethod2(Map nMap,Map oMap){ + try { + List RenewalOpportunities = new List(); + Boolean exist=False; + Id newrectypeId = Schema.SObjectType.Opportunity.getRecordTypeInfosByName().get('New Business').getRecordTypeId(); + Id RenewablerectypeId = Schema.SObjectType.Opportunity.getRecordTypeInfosByName().get('Renewable Business').getRecordTypeId(); + + System.debug('@@@@@ +new Business Id:' + newrectypeId); + System.debug('@@@@@ + Renewable Business Id:' + RenewablerectypeId); + Set idd = new Set(); // Use set to store Id values + + //getting id from nMap + for (Opportunity od1 : nMap.values()) { + idd.add(od1.Id); // Add the Id value to the list using the add() method + } + + + List oppt = [SELECT Parent_Opportunity__c FROM Opportunity WHERE RecordTypeId=:RenewablerectypeId AND Parent_Opportunity__c IN :idd]; + system.debug('@@@@@ Opppp id value'+oppt); + + //getting those opportunities which has already child in related And stroring them into set of id + Set set1 = new Set(); + for(Opportunity ol: [SELECT Parent_Opportunity__c FROM Opportunity WHERE RecordTypeId=:RenewablerectypeId AND Parent_Opportunity__c IN :idd]){ + set1.add(ol.Parent_Opportunity__c); + } + + //updating value of exist + for(Opportunity opl :nMap.values()){ + system.debug('@@@@@ in loop'); + if(set1.contains(opl.Id)){ + exist=True; + system.debug('coantans???'+exist); + } + else{ + exist=False; + system.debug('coantans???'+exist); + } + //checking the conditions + if(oMap.get(opl.Id).StageName!=nMap.get(opl.Id).StageName && nMap.get(opl.Id).StageName=='Closed Won' && exist==False){ + + if (opl.RecordTypeId == newrectypeId || opl.RecordTypeId == RenewablerectypeId ) { + Opportunity renewalOpp = new Opportunity(); + + system.debug('Making record'); + + // Set the fields for the Renewal Opportunity + renewalOpp.RecordTypeId = RenewablerectypeId; + renewalOpp.Name = opl.Name + ' - Renewal'; + renewalOpp.CloseDate = System.today() + 30; + renewalOpp.StageName = 'Renewal Ready'; + renewalOpp.Parent_Opportunity__c = opl.Id; + RenewalOpportunities.add(renewalOpp); + } + + else{ + System.debug('@@@@@@ no Criteria matched'); + } + } + else{ + System.debug('Record already attached'); + } + + + insert RenewalOpportunities; + } + } + catch(Exception e){ + System.debug('@@@@ Error:' + e); + } + } + +} \ No newline at end of file diff --git a/force-app/main/default/classes/RenewaloppClass.cls-meta.xml b/force-app/main/default/classes/RenewaloppClass.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/RenewaloppClass.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/RenewaloppClassTest.cls b/force-app/main/default/classes/RenewaloppClassTest.cls new file mode 100644 index 0000000..b523289 --- /dev/null +++ b/force-app/main/default/classes/RenewaloppClassTest.cls @@ -0,0 +1,88 @@ +@isTest +public class RenewaloppClassTest { + public static ListOpportunities=new List(); + @testsetup static void stup(){ + Id newrectypeId = Schema.SObjectType.Opportunity.getRecordTypeInfosByName().get('New Business').getRecordTypeId(); + Id RenewablerectypeId = Schema.SObjectType.Opportunity.getRecordTypeInfosByName().get('Renewable Business').getRecordTypeId(); + + + Opportunity op=new Opportunity(); + op.Name='Test 1'; + op.StageName='Closed Won'; + op.CloseDate=System.today(); + op.RecordTypeId=newrectypeId; + Opportunities.add(op); + + Opportunity op1=new Opportunity(); + op1.Name='Test 2'; + op1.StageName='Closed Won'; + op1.CloseDate=System.today(); + op1.RecordTypeId=RenewablerectypeId; + Opportunities.add(op1); + + insert Opportunities; + + + + + } + + @isTest static void testRenewaloppMethod2() { + // Create test data + Account testAccount = new Account(Name = 'Test Account'); + insert testAccount; + + Id newrectypeId = Schema.SObjectType.Opportunity.getRecordTypeInfosByName().get('New Business').getRecordTypeId(); + Id RenewablerectypeId = Schema.SObjectType.Opportunity.getRecordTypeInfosByName().get('Renewable Business').getRecordTypeId(); + + Opportunity testOpp1 = new Opportunity(); + testOpp1.Name = 'Test Opp 1'; + testOpp1.AccountId = testAccount.Id; + testOpp1.CloseDate = System.today(); + testOpp1.StageName = 'Prospecting'; + testOpp1.RecordTypeId = newrectypeId; + insert testOpp1; + + Opportunity testOpp2 = new Opportunity(); + testOpp2.Id=testOpp1.Id; + testOpp2.AccountId = testAccount.Id; + testOpp2.CloseDate = System.today(); + testOpp2.StageName = 'Closed Won'; + testOpp2.RecordTypeId = RenewablerectypeId; + Update testOpp2; + + Opportunity testOpp3 = new Opportunity(); + testOpp3.Name='Test Opp 3'; + + testOpp3.CloseDate = System.today(); + testOpp3.StageName = 'Closed Won'; + testOpp3.RecordTypeId = RenewablerectypeId; + Insert testOpp3; + + Opportunity testOpp4 = new Opportunity(); + testOpp4.Id=testOpp3.Id; + + testOpp4.CloseDate = System.today(); + testOpp4.StageName = 'Closed Won'; + testOpp4.RecordTypeId = RenewablerectypeId; + update testOpp4; + + Map nMap = new Map(); + nMap.put(testOpp2.Id, testOpp2); + nMap.put(testOpp4.Id, testOpp4); + + + Map oMap = new Map(); + oMap.put(testOpp1.Id, testOpp1); + nMap.put(testOpp3.Id, testOpp3); + + + // Call the method to test + System.Test.startTest(); + RenewaloppClass.RenewaloppMethod2(nMap, oMap); + System.Test.stopTest(); + + + } + +} \ No newline at end of file diff --git a/force-app/main/default/classes/RenewaloppClassTest.cls-meta.xml b/force-app/main/default/classes/RenewaloppClassTest.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/RenewaloppClassTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/SaveToPDF.cls b/force-app/main/default/classes/SaveToPDF.cls new file mode 100644 index 0000000..89235bf --- /dev/null +++ b/force-app/main/default/classes/SaveToPDF.cls @@ -0,0 +1,13 @@ +public with sharing class SaveToPDF { + + // Determines whether page is rendered as a PDF or just displayed as HTML + public String renderAs { get; set; } + + + // Action method to "print" to PDF + public PageReference print() { + renderAs = 'PDF'; + return null; + } + +} \ No newline at end of file diff --git a/force-app/main/default/classes/SaveToPDF.cls-meta.xml b/force-app/main/default/classes/SaveToPDF.cls-meta.xml new file mode 100644 index 0000000..b1a915c --- /dev/null +++ b/force-app/main/default/classes/SaveToPDF.cls-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + Active + diff --git a/force-app/main/default/classes/SearchRecord.cls b/force-app/main/default/classes/SearchRecord.cls new file mode 100644 index 0000000..7e3eb3b --- /dev/null +++ b/force-app/main/default/classes/SearchRecord.cls @@ -0,0 +1,14 @@ +public with sharing class SearchRecord { + @AuraEnabled(cacheable=true) + public static List sRecords(String input){ + List v1=new List(); + if(input !=''){ + string s='%'+input+'%'; + v1 = [SELECT Id,Name FROM Account WHERE Name LIKE:s]; + + } + return v1; + } + + +} \ No newline at end of file diff --git a/force-app/main/default/classes/SearchRecord.cls-meta.xml b/force-app/main/default/classes/SearchRecord.cls-meta.xml new file mode 100644 index 0000000..754ecb1 --- /dev/null +++ b/force-app/main/default/classes/SearchRecord.cls-meta.xml @@ -0,0 +1,5 @@ + + + 57.0 + Active + diff --git a/force-app/main/default/classes/SiteLoginController.cls b/force-app/main/default/classes/SiteLoginController.cls new file mode 100644 index 0000000..fb2f4c7 --- /dev/null +++ b/force-app/main/default/classes/SiteLoginController.cls @@ -0,0 +1,14 @@ +/** + * An apex page controller that exposes the site login functionality + */ +global with sharing class SiteLoginController { + global String username {get; set;} + global String password {get; set;} + + global PageReference login() { + String startUrl = System.currentPageReference().getParameters().get('startURL'); + return Site.login(username, password, startUrl); + } + + global SiteLoginController () {} +} \ No newline at end of file diff --git a/force-app/main/default/classes/SiteLoginController.cls-meta.xml b/force-app/main/default/classes/SiteLoginController.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/SiteLoginController.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/SiteLoginControllerTest.cls b/force-app/main/default/classes/SiteLoginControllerTest.cls new file mode 100644 index 0000000..88ec4a9 --- /dev/null +++ b/force-app/main/default/classes/SiteLoginControllerTest.cls @@ -0,0 +1,13 @@ +/** + * An apex page controller that exposes the site login functionality + */ +@IsTest global with sharing class SiteLoginControllerTest { + @IsTest(SeeAllData=true) global static void testSiteLoginController () { + // Instantiate a new controller with all parameters in the page + SiteLoginController controller = new SiteLoginController (); + controller.username = 'test@salesforce.com'; + controller.password = '123456'; + + System.assertEquals(controller.login(),null); + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/SiteLoginControllerTest.cls-meta.xml b/force-app/main/default/classes/SiteLoginControllerTest.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/SiteLoginControllerTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/SiteRegisterController.cls b/force-app/main/default/classes/SiteRegisterController.cls new file mode 100644 index 0000000..9332bc4 --- /dev/null +++ b/force-app/main/default/classes/SiteRegisterController.cls @@ -0,0 +1,50 @@ +/** + * An apex class that creates a portal user + */ +public with sharing class SiteRegisterController { + // PORTAL_ACCOUNT_ID is the account on which the contact will be created on and then enabled as a portal user. + // you need to add the account owner into the role hierarchy before this will work - please see Customer Portal Setup help for more information. + private static Id PORTAL_ACCOUNT_ID = '001x000xxx35tPN'; + + public SiteRegisterController () { + } + + public String username {get; set;} + public String email {get; set;} + public String password {get; set {password = value == null ? value : value.trim(); } } + public String confirmPassword {get; set { confirmPassword = value == null ? value : value.trim(); } } + public String communityNickname {get; set { communityNickname = value == null ? value : value.trim(); } } + + private boolean isValidPassword() { + return password == confirmPassword; + } + + public PageReference registerUser() { + // it's okay if password is null - we'll send the user a random password in that case + if (!isValidPassword()) { + ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.ERROR, Label.site.passwords_dont_match); + ApexPages.addMessage(msg); + return null; + } + User u = new User(); + u.Username = username; + u.Email = email; + u.CommunityNickname = communityNickname; + + String accountId = PORTAL_ACCOUNT_ID; + + // lastName is a required field on user, but if it isn't specified, we'll default it to the username + String userId = Site.createPortalUser(u, accountId, password); + if (userId != null) { + if (password != null && password.length() > 1) { + return Site.login(username, password, null); + } + else { + PageReference page = System.Page.SiteRegisterConfirm; + page.setRedirect(true); + return page; + } + } + return null; + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/SiteRegisterController.cls-meta.xml b/force-app/main/default/classes/SiteRegisterController.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/SiteRegisterController.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/SiteRegisterControllerTest.cls b/force-app/main/default/classes/SiteRegisterControllerTest.cls new file mode 100644 index 0000000..79f27fa --- /dev/null +++ b/force-app/main/default/classes/SiteRegisterControllerTest.cls @@ -0,0 +1,17 @@ +/** + * Class containing tests for SiteRegisterController + */ +@IsTest public with sharing class SiteRegisterControllerTest { + @IsTest(SeeAllData=true) static void testRegistration() { + SiteRegisterController controller = new SiteRegisterController(); + controller.username = 'test@force.com'; + controller.email = 'test@force.com'; + controller.communityNickname = 'test'; + // registerUser will always return null when the page isn't accessed as a guest user + System.assert(controller.registerUser() == null); + + controller.password = 'abcd1234'; + controller.confirmPassword = 'abcd123'; + System.assert(controller.registerUser() == null); + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/SiteRegisterControllerTest.cls-meta.xml b/force-app/main/default/classes/SiteRegisterControllerTest.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/SiteRegisterControllerTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/StackImpl.cls b/force-app/main/default/classes/StackImpl.cls new file mode 100644 index 0000000..8c461d0 --- /dev/null +++ b/force-app/main/default/classes/StackImpl.cls @@ -0,0 +1,5 @@ +public class StackImpl { + public static void hello(){ + System.debug('I m deployed through Bit Bucket Tool'); + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/StackImpl.cls-meta.xml b/force-app/main/default/classes/StackImpl.cls-meta.xml new file mode 100644 index 0000000..db9bf8c --- /dev/null +++ b/force-app/main/default/classes/StackImpl.cls-meta.xml @@ -0,0 +1,5 @@ + + + 48.0 + Active + diff --git a/force-app/main/default/classes/StackImplTest.cls b/force-app/main/default/classes/StackImplTest.cls new file mode 100644 index 0000000..6957765 --- /dev/null +++ b/force-app/main/default/classes/StackImplTest.cls @@ -0,0 +1,10 @@ +@isTest +public class StackImplTest { + @isTest static void testHello() { + // Call the method to test + StackImpl.hello(); + + // Normally, you would add assertions here to check the behavior of your method. + // Since your method does not return a value or modify any data, there's nothing specific to assert in this case. + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/StackImplTest.cls-meta.xml b/force-app/main/default/classes/StackImplTest.cls-meta.xml new file mode 100644 index 0000000..db9bf8c --- /dev/null +++ b/force-app/main/default/classes/StackImplTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 48.0 + Active + diff --git a/force-app/main/default/classes/SubmitFormController.cls b/force-app/main/default/classes/SubmitFormController.cls new file mode 100644 index 0000000..b84c61e --- /dev/null +++ b/force-app/main/default/classes/SubmitFormController.cls @@ -0,0 +1,10 @@ +public class SubmitFormController +{ + public string username{get;set;} + public string password{get;set;} + public void submitForm() + { + System.debug('## User name: '+username); + System.debug('## Password: '+password); + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/SubmitFormController.cls-meta.xml b/force-app/main/default/classes/SubmitFormController.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/SubmitFormController.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/SubscriberContactController.cls b/force-app/main/default/classes/SubscriberContactController.cls new file mode 100644 index 0000000..895642a --- /dev/null +++ b/force-app/main/default/classes/SubscriberContactController.cls @@ -0,0 +1,24 @@ +public class SubscriberContactController { + public Contact contact { get; set; } + + public SubscriberContactController() { + HttpRequest req = new HttpRequest(); + req.setEndpoint('http://yourwebsite.com/api/contact'); // replace with your API endpoint + req.setMethod('GET'); + + Http http = new Http(); + HttpResponse res = http.send(req); + + // Parse thee JSON response + if (res.getStatusCode() == 200) { + Map data = (Map) JSON.deserializeUntyped(res.getBody()); + this.contact = new Contact(); + this.contact.LastName = (String) data.get('fullName'); + this.contact.Email = (String) data.get('email'); + this.contact.Phone = (String) data.get('phone'); + this.contact.Website__c = (String) data.get('website'); + this.contact.Description = (String) data.get('message'); + } + } + +} \ No newline at end of file diff --git a/force-app/main/default/classes/SubscriberContactController.cls-meta.xml b/force-app/main/default/classes/SubscriberContactController.cls-meta.xml new file mode 100644 index 0000000..f5e18fd --- /dev/null +++ b/force-app/main/default/classes/SubscriberContactController.cls-meta.xml @@ -0,0 +1,5 @@ + + + 60.0 + Active + diff --git a/force-app/main/default/classes/TestBrevoContactTrigger_Handler.cls b/force-app/main/default/classes/TestBrevoContactTrigger_Handler.cls new file mode 100644 index 0000000..9732430 --- /dev/null +++ b/force-app/main/default/classes/TestBrevoContactTrigger_Handler.cls @@ -0,0 +1,59 @@ +@isTest +public class TestBrevoContactTrigger_Handler { + @isTest + static void testBrevoContactTrigger_Handler() { + // Create a new contact + Contact con = new Contact(LastName = 'Test', Email = 'test@example.com'); + insert con; + // Set the mock callout class + Test.setMock(HttpCalloutMock.class, new BrevoMockHttpResponseGenerator()); + // Start the test, this enables governor limit testing and prevents actual callouts + Test.startTest(); + // Call your method here + BrevoContactTrigger_Handler.createContactInBrevo(con.Email, con.FirstName, con.LastName, con.Phone, con.Id); + // Stop the test, this changes limit context back to test from trigger + Test.stopTest(); + } + @isTest + static void testUpdateContactInBrevo_ExistingContact() { + // Create a new contact + Contact con = new Contact(LastName = 'Test', Email = 'test@example.com'); + insert con; + // Set the mock callout class + Test.setMock(HttpCalloutMock.class, new BrevoMockHttpResponseGenerator()); + // Start the test + Test.startTest(); + // Call your method here + BrevoContactTrigger_Handler.updateContactInBrevo(con.Email, con.FirstName, con.LastName, con.Phone, con.Id); + // Stop the test + Test.stopTest(); + } + @isTest + static void testUpdateContactInBrevo_NonExistingContact() { + // Create a new contact + Contact con = new Contact(LastName = 'Test', Email = 'test2@example.com'); + insert con; + // Set the mock callout class + Test.setMock(HttpCalloutMock.class, new BrevoMockHttpResponseGenerator()); + // Start the test + Test.startTest(); + // Call your method here + BrevoContactTrigger_Handler.updateContactInBrevo(con.Email, con.FirstName, con.LastName, con.Phone, con.Id); + // Stop the test + Test.stopTest(); + } + @isTest + static void testDeleteContactInBrevo() { + // Create a new contact + Contact con = new Contact(LastName = 'Test', Email = 'test@example.com'); + insert con; + // Set the mock callout class + Test.setMock(HttpCalloutMock.class, new BrevoMockHttpResponseGenerator()); + // Start the test + Test.startTest(); + // Call your method here + BrevoContactTrigger_Handler.deleteContactInBrevo(con.Email); + // Stop the test + Test.stopTest(); + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/TestBrevoContactTrigger_Handler.cls-meta.xml b/force-app/main/default/classes/TestBrevoContactTrigger_Handler.cls-meta.xml new file mode 100644 index 0000000..b1a915c --- /dev/null +++ b/force-app/main/default/classes/TestBrevoContactTrigger_Handler.cls-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + Active + diff --git a/force-app/main/default/classes/TestController.cls b/force-app/main/default/classes/TestController.cls new file mode 100644 index 0000000..607533f --- /dev/null +++ b/force-app/main/default/classes/TestController.cls @@ -0,0 +1,114 @@ +@isTest +public class TestController { + @IsTest + static void TestControllerMethod() { + Contact con = new Contact(); + con.LastName = 'LastName'; + insert con; + + ContentVersion testContent = new ContentVersion(); + testContent.Title = 'Profilejiou'; + testContent.PathOnClient = 'version.jpg'; + testContent.VersionData = Blob.valueOf('Profilejiou'); + insert testContent; + + Id contentDocumentId = [SELECT ContentDocumentId FROM ContentVersion WHERE Id = :testContent.Id].ContentDocumentId; + + ContentDocumentLink cdl = new ContentDocumentLink(); + cdl.ContentDocumentId = contentDocumentId; + cdl.LinkedEntityId = con.Id; + insert cdl; + + Listdc=[SELECT Id FROM ContentDocument WHERE Id=:contentDocumentId]; + + + ContentDistribution link12 = new ContentDistribution(); + link12.Name='hiiii'; + link12.ContentVersionId =testContent.Id ; + insert link12; + // ContentDistribution cds = [SELECT DistributionPublicUrl FROM ContentDistribution WHERE Id=:link12.Id]; + + Listconlist=[SELECT Id,LastName,Image_url__c,Description FROM Contact WHERE Id =:con.Id]; + + List updatec = new List(); + for (Contact contact : conlist) { + contact.Description = 'attachment inserted ftw'; + //contact.PublicUrlOfAttachment__c=cds.DistributionPublicUrl; + if(testContent.Title.containsIgnoreCase('Profile')) { + contact.Image_url__c='https://suprnova-dev-ed.develop.file.force.com/sfc/servlet.shepherd/version/renditionDownload?rendition=ORIGINAL_Jpg&versionId='+testContent.Id+'&operationContext=CHATTER&contentId='+testContent.ContentBodyId; + } + else{ + contact.Image_url__c='No profile'; + } + + + updatec.add(contact); + + } + update updatec; + + + Test.startTest(); + // Call the method to be tested from the Controller class + Controller.checkDoc(contentDocumentId, 'Profilejiou'); + Test.stopTest(); + + + } + @IsTest static void TestControllerMethod2() { + Contact con = new Contact(); + con.LastName = 'LastName'; + insert con; + + ContentVersion testContent = new ContentVersion(); + testContent.Title = 'Profilejiou'; + testContent.PathOnClient = 'version.jpg'; + testContent.VersionData = Blob.valueOf('Profilejiou'); + insert testContent; + + ContentVersion testContent2 = new ContentVersion(); + testContent2.Title = 'Profilejiou12'; + testContent2.PathOnClient = 'version2.jpg'; + testContent2.VersionData = Blob.valueOf('Profilejiou12'); + insert testContent2; + + Id contentDocumentId = [SELECT ContentDocumentId FROM ContentVersion WHERE Id = :testContent.Id].ContentDocumentId; + + + ContentDocumentLink cdl = new ContentDocumentLink(); + cdl.ContentDocumentId = contentDocumentId; + cdl.LinkedEntityId = con.Id; + insert cdl; + + Listdc=[SELECT Id FROM ContentDocument WHERE Id=:contentDocumentId]; + + ContentDistribution link12 = new ContentDistribution(); + link12.Name='hiiii'; + link12.ContentVersionId =testContent.Id ; + insert link12; + // ContentDistribution cds = [SELECT DistributionPublicUrl FROM ContentDistribution WHERE Id=:link12.Id]; + + Listconlist=[SELECT Id,LastName,Profile_Image__c,Image_url__c,Description FROM Contact WHERE Id =:con.Id]; + + List updateagain = new List(); + for (Contact contact : conlist) { + contact.Description = 'attachment inserted ftw'; + //contact.PublicUrlOfAttachment__c=cds.DistributionPublicUrl; + if(testContent.Title.containsIgnoreCase('Profile')) { + contact.Image_url__c='https://suprnova-dev-ed.develop.file.force.com/sfc/servlet.shepherd/version/renditionDownload?rendition=ORIGINAL_Jpg&versionId='+testContent.Id+'&operationContext=CHATTER&contentId='+testContent.ContentBodyId; + } + else{ + contact.Image_url__c='No profile'; + } + + updateagain.add(contact); + } + update updateagain; + + Test.startTest(); + // Call the method to be tested from the Controller class + Controller.deletemethod(dc); + Test.stopTest(); + } + +} \ No newline at end of file diff --git a/force-app/main/default/classes/TestController.cls-meta.xml b/force-app/main/default/classes/TestController.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/TestController.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/UpdateAccount.cls b/force-app/main/default/classes/UpdateAccount.cls new file mode 100644 index 0000000..5ebf45e --- /dev/null +++ b/force-app/main/default/classes/UpdateAccount.cls @@ -0,0 +1,58 @@ +global class UpdateAccount implements Database.Batchable + +{ + List failedUpdates; + global Database.QueryLocator start(Database.BatchableContext BC) + { + String query1 = 'SELECT Id,Description, NumberOfEmployees,(SELECT LastName FROM Contacts) FROM Account'; + + return Database.getQueryLocator(query1); + + + } + + global void execute(Database.BatchableContext BC, List scope) + { + for(Account a : scope) + { + a.Description = 'New Description from batch class'; + a.NumberOfEmployees =500; + + for(Contact con:a.Contacts){ + con.LastName= 'newLAstNAme'; + } + } + List results = Database.update(scope, false); + for (Database.SaveResult result : results) { + if (!result.isSuccess()) { + failedUpdates.add(result.getId()); + } + } + } + + global void finish(Database.BatchableContext BC){ + if (!failedUpdates.isEmpty()) { + Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); + mail.setToAddresses(new String[] {'himanshu.s@hicglobalsolutions.com'}); + mail.setSubject('Batch Apex Failure'); + String messageBody = 'The following records failed to update: '; + for (Id failedId : failedUpdates) { + messageBody += failedId + ', '; + + } + mail.setPlainTextBody(messageBody); + + Messaging.sendEmail(new Messaging.SingleEmailMessage[] {mail}); + } + } + /*global void execute(SchedulableContext SC) { + UpdateAccount batchJob = new UpdateAccount(); + Database.executeBatch(batchJob); + } + + public static void scheduleJob() { + UpdateAccount batchJob = new UpdateAccount(); + String cronExpression = '0 0 0 ? * MON *'; // Every Monday at midnight + System.schedule('Update Account Batch', cronExpression, batchJob); + }*/ +} \ No newline at end of file diff --git a/force-app/main/default/classes/UpdateAccount.cls-meta.xml b/force-app/main/default/classes/UpdateAccount.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/UpdateAccount.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/UpdateAccountCloseDealAmount.cls b/force-app/main/default/classes/UpdateAccountCloseDealAmount.cls new file mode 100644 index 0000000..dcf53b9 --- /dev/null +++ b/force-app/main/default/classes/UpdateAccountCloseDealAmount.cls @@ -0,0 +1,20 @@ +global class UpdateAccountCloseDealAmount implements Database.Batchable { + global Database.QueryLocator start(Database.BatchableContext BC) { + return Database.getQueryLocator('SELECT Id, CloseDealAmount__c, (SELECT Amount FROM Opportunities WHERE StageName = \'Closed Won\') FROM Account'); + } + + global void execute(Database.BatchableContext BC, List scope) { + for(Account acc : scope) { + Decimal maxAmount = 0; + for(Opportunity opp : acc.Opportunities) { + if(opp.Amount > maxAmount) { + maxAmount = opp.Amount; + } + } + acc.CloseDealAmount__c = maxAmount; + } + update scope; + } + + global void finish(Database.BatchableContext BC) {} +} \ No newline at end of file diff --git a/force-app/main/default/classes/UpdateAccountCloseDealAmount.cls-meta.xml b/force-app/main/default/classes/UpdateAccountCloseDealAmount.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/UpdateAccountCloseDealAmount.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/UpdateAccountCloseDealAmountTest.cls b/force-app/main/default/classes/UpdateAccountCloseDealAmountTest.cls new file mode 100644 index 0000000..6794be2 --- /dev/null +++ b/force-app/main/default/classes/UpdateAccountCloseDealAmountTest.cls @@ -0,0 +1,21 @@ +@isTest +private class UpdateAccountCloseDealAmountTest { + @isTest static void testUpdateAccountCloseDealAmount() { + // Create test data + Account acc = new Account(Name = 'Test Account'); + insert acc; + + Opportunity opp1 = new Opportunity(Name = 'Test Opp 1', AccountId = acc.Id, StageName = 'Closed Won', CloseDate = Date.today(), Amount = 100); + Opportunity opp2 = new Opportunity(Name = 'Test Opp 2', AccountId = acc.Id, StageName = 'Closed Won', CloseDate = Date.today(), Amount = 200); + insert new List{opp1, opp2}; + + // Execute batch job + Test.startTest(); + Database.executeBatch(new UpdateAccountCloseDealAmount()); + Test.stopTest(); + + // Verify results + Account updatedAcc = [SELECT CloseDealAmount__c FROM Account WHERE Id = :acc.Id]; + System.assertEquals(200, updatedAcc.CloseDealAmount__c); + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/UpdateAccountCloseDealAmountTest.cls-meta.xml b/force-app/main/default/classes/UpdateAccountCloseDealAmountTest.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/UpdateAccountCloseDealAmountTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/addController.cls b/force-app/main/default/classes/addController.cls new file mode 100644 index 0000000..1ee1bd0 --- /dev/null +++ b/force-app/main/default/classes/addController.cls @@ -0,0 +1,108 @@ +public class addController { + + public List AccountsList {get; set;} + + + public string FirstName { set; get; } + public String LastName { set; get; } + public String Email { set; get; } + public String Phone { set; get; } + public string OpportunityName { set; get; } + public string StageName { set; get; } + public string Amount { set; get; } + public string CloseDate { set; get; } + public Boolean disabl {set;get; } + public Boolean Choice1{set;get;} + public Boolean Choice2{set;get;} + + Opportunity opp=new Opportunity(); + Contact con = new Contact(); + + //collecting the records from account and opportunity + + public addController() { + AccountsList =[SELECT Id,Name,Industry FROM Account]; + disabl=true; + } + + + + + // validation for contact + + + public void change(){ + System.debug('Change is Running now'); + if (String.isNotBlank(FirstName) && String.isNotBlank(LastName) && String.isNotBlank(Email) && String.isNotBlank(Phone)){ + disabl = false; // If all fields are filled, enable the submit button + } else { + disabl = true; // If any field is empty, disable the submit button + } + } + + // Save button validation for opp form + public void change1(){ + System.debug('Change is Running now'); + if (String.isNotBlank(OpportunityName) && String.isNotBlank(StageName) && String.isNotBlank(CloseDate) && String.isNotBlank(Amount)){ + disabl = false; // If all fields are filled, enable the submit button + } else { + disabl = true; // If any field is empty, disable the submit button + } + } + + + //saving into contact + + public void insertCon(){ + try { + con.FirstName = FirstName; + con.LastName = LastName; + con.Email = Email; + con.Phone = Phone; + insert con; + } catch (Exception e) { + // Handle the exception here + System.debug('Error: ' + e.getMessage()); + + } + + } + + // to insert opp + public void insertOpp(){ + + opp.Name=OpportunityName; + opp.CloseDate=Date.valueOf(CloseDate); + opp.Amount=Decimal.valueOf(Amount); + opp.StageName=StageName; + insert opp; + + } + //to jump choice page + public PageReference Choicepage(){ + PageReference pageref=new PageReference('/apex/ChoicePage'); + return pageref; + } + + + //For Any specific form + + public PageReference jump(){ + system.debug('@@@@@Choice1'+Choice1); + system.debug('@@@@@Choice2'+Choice2); + if(Choice1==True && Choice2==True){ + ApexPages.addmessage(new ApexPages.message(ApexPages.severity.FATAL,'You can select Only one at a time')); + return null; + } + else if(Choice1==True){ + PageReference pageref=new PageReference('/apex/ContactForm'); + return pageref; + } else { + PageReference pageref=new PageReference('/apex/OpportunityForm'); + return pageref; + } + } + + + +} \ No newline at end of file diff --git a/force-app/main/default/classes/addController.cls-meta.xml b/force-app/main/default/classes/addController.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/addController.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/assignClass.cls b/force-app/main/default/classes/assignClass.cls new file mode 100644 index 0000000..389e84c --- /dev/null +++ b/force-app/main/default/classes/assignClass.cls @@ -0,0 +1,19 @@ +public class assignClass { + public static void assignMethod(Listopp){ + List tasksToInsert = new List(); + for (Opportunity opps :opp) { + if (opps.StageName == 'Closed Won') { + Task newTask = new Task(); + newTask.OwnerId = opps.OwnerId; + newTask.Subject = 'Opportunity Closed Won ho gyi hai bhai'; + newTask.Description = 'Account Name: ' + opps.Account.Name + '\nOpportunity Name: ' + opps.Name + '\nClose Date: ' + opps.CloseDate; + tasksToInsert.add(newTask); + } + } + if (!tasksToInsert.isEmpty()) { + insert tasksToInsert; + } +} + + +} \ No newline at end of file diff --git a/force-app/main/default/classes/assignClass.cls-meta.xml b/force-app/main/default/classes/assignClass.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/assignClass.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/campaignClass.cls b/force-app/main/default/classes/campaignClass.cls new file mode 100644 index 0000000..37b5536 --- /dev/null +++ b/force-app/main/default/classes/campaignClass.cls @@ -0,0 +1,22 @@ +public class campaignClass { + public static void campaignMethod(Listld){ + + String id=''; + for(Lead ls:ld){ + id=ls.Id; + + } + system.debug('@@@@@ ld id'+id); + + Campaign camp=new Campaign(); + camp.Name='Monthly-Newsletter'; + insert camp; + + CampaignMember cm=new CampaignMember(); + cm.CampaignId=camp.Id; + cm.LeadId=id; + insert cm; + } + + +} \ No newline at end of file diff --git a/force-app/main/default/classes/campaignClass.cls-meta.xml b/force-app/main/default/classes/campaignClass.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/campaignClass.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/campaignClassTest.cls b/force-app/main/default/classes/campaignClassTest.cls new file mode 100644 index 0000000..436242d --- /dev/null +++ b/force-app/main/default/classes/campaignClassTest.cls @@ -0,0 +1,30 @@ +@isTest +public class campaignClassTest { + @isTest static void testCampaignMethod() { + // Create test data + Listllist=new List(); + Lead ld=new Lead(); + ld.LastName='kp'; + ld.MultiPic__c='P1'; + ld.Company='hTTp'; + ld.Status='Closed-Converted'; + llist.add(ld); + insert llist; + + String s=ld.Id; + + Campaign camp=new Campaign(); + camp.Name='Monthly-Newsletter'; + insert camp; + + CampaignMember cm=new CampaignMember(); + cm.CampaignId=camp.Id; + cm.LeadId=s; + insert cm; + + Test.startTest(); + campaignClass.campaignMethod(llist); + Test.stopTest(); + + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/campaignClassTest.cls-meta.xml b/force-app/main/default/classes/campaignClassTest.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/campaignClassTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/deleteLeadJob.cls b/force-app/main/default/classes/deleteLeadJob.cls new file mode 100644 index 0000000..733e6ad --- /dev/null +++ b/force-app/main/default/classes/deleteLeadJob.cls @@ -0,0 +1,15 @@ +global class deleteLeadJob implements Database.Batchable{ + global Database.QueryLocator start(Database.BatchableContext BC) + { + + return DataBase.getQueryLocator([SELECT Id FROM Lead WHERE Status = 'Closed - Not Converted']); + } + global void execute(DataBase.BatchableContext BC, List Scope){ + delete Scope; + + } + global void finish(DataBase.BatchableContext BC){ +} + + +} \ No newline at end of file diff --git a/force-app/main/default/classes/deleteLeadJob.cls-meta.xml b/force-app/main/default/classes/deleteLeadJob.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/deleteLeadJob.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/forProcessBuilder.cls b/force-app/main/default/classes/forProcessBuilder.cls new file mode 100644 index 0000000..7d7b43d --- /dev/null +++ b/force-app/main/default/classes/forProcessBuilder.cls @@ -0,0 +1,9 @@ +public class forProcessBuilder { + @InvocableMethod + public static void method(){ + Listclist=new List(); + Database.executeBatch(new CallingFromTrigger(clist)); + + } + +} \ No newline at end of file diff --git a/force-app/main/default/classes/forProcessBuilder.cls-meta.xml b/force-app/main/default/classes/forProcessBuilder.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/forProcessBuilder.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/getFriendLocation.cls b/force-app/main/default/classes/getFriendLocation.cls new file mode 100644 index 0000000..c9dd986 --- /dev/null +++ b/force-app/main/default/classes/getFriendLocation.cls @@ -0,0 +1,18 @@ +// This class is declared as public and uses the 'with sharing' keyword to enforce the sharing rules of the current user +public with sharing class getFriendLocation { + // The @AuraEnabled annotation makes this method accessible from Lightning components + @AuraEnabled + // This method takes a record ID as a parameter and returns a list of Friend__c records + public static List getLoacation(String rcId){ + try { + // A SOQL query is used to fetch the Friend__c records with the specified record ID + ListfList=[SELECT Home_Town__c FROM Friend__c WHERE id=:rcId]; + // The fetched records are returned + return fList; + + } catch (Exception e) { + // If an exception occurs, it's caught and rethrown as an AuraHandledException with the original exception's message + throw new AuraHandledException(e.getMessage()); + } + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/getFriendLocation.cls-meta.xml b/force-app/main/default/classes/getFriendLocation.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/getFriendLocation.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/getMembershipAndAccount.cls b/force-app/main/default/classes/getMembershipAndAccount.cls new file mode 100644 index 0000000..7767a67 --- /dev/null +++ b/force-app/main/default/classes/getMembershipAndAccount.cls @@ -0,0 +1,23 @@ +// getMembershipAndAccount apex Class Created By Sumit M + +// This class is declared as public and uses the with sharing keyword to enforce the sharing rules of the current user +public with sharing class getMembershipAndAccount { + + @AuraEnabled(cacheable=true) + public static List getMembershipAndAccountMethod() { + // Get the ID of the current user + Id currentUserId = UserInfo.getUserId(); + + // Retrieve the AccountId from the User object + + Id userAccountId = [SELECT AccountId FROM User WHERE Id = '0055j00000BLqLPAA1'].AccountId; + // Log the userAccountId for debugging purposes + SYSTEM.debug('userAccountId ' + userAccountId); + + // Query the Membership__c records related to the current user's account + // This SOQL query gets the Id, Name, Membership_Created_Date__c, Financial_Product__r.Name, and Balance__c fields from the Membership__c records where the Member__c field matches the userAccountId + List Membership = [SELECT Id, Name,Membership_Created_Date__c,Financial_Product__r.Name,Balance__c,Member__r.Name,Member__r.AccountNumber,Member__r.Industry,Member__r.Type FROM Membership__c WHERE Member__c = '0015j00001WGOKyAAP']; + // Return the list of Membership__c records + return Membership; + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/getMembershipAndAccount.cls-meta.xml b/force-app/main/default/classes/getMembershipAndAccount.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/getMembershipAndAccount.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/getObjects.cls b/force-app/main/default/classes/getObjects.cls new file mode 100644 index 0000000..97bfccc --- /dev/null +++ b/force-app/main/default/classes/getObjects.cls @@ -0,0 +1,35 @@ +public with sharing class getObjects { + +// The @AuraEnabled annotation makes the method accessible from Lightning component +// The @AuraEnabled annotation makes the method accessible from Lightning component +@AuraEnabled(cacheable=true) +public static List getObjectMethod() { + // Initialize a list to hold the names of all accessible, createable, and updateable custom objects + List customObjectNames = new List(); + + // Loop through all sObject types in the org + for(Schema.SObjectType objType : Schema.getGlobalDescribe().Values()) { + // Get the describe result for the current sObject type + Schema.DescribeSObjectResult describeResult = objType.getDescribe(); + + // Check if the object is custom and has a 'Name' field + if (describeResult.isCustom() && describeResult.fields.getMap().containsKey('Name') && + describeResult.fields.getMap().get('Name').getDescribe().isAccessible()) { + + // Check if the object is accessible, createable, and updateable + if (describeResult.isAccessible() && describeResult.isCreateable() && describeResult.isUpdateable()) { + // If the object meets the criteria, add its name to the list + customObjectNames.add(describeResult.getName()); + } + } + } + + // Sort the list of custom object names + customObjectNames.sort(); + + // Return the sorted list of custom object names + return customObjectNames; +} + + +} \ No newline at end of file diff --git a/force-app/main/default/classes/getObjects.cls-meta.xml b/force-app/main/default/classes/getObjects.cls-meta.xml new file mode 100644 index 0000000..b1a915c --- /dev/null +++ b/force-app/main/default/classes/getObjects.cls-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + Active + diff --git a/force-app/main/default/classes/getObjectsTest.cls b/force-app/main/default/classes/getObjectsTest.cls new file mode 100644 index 0000000..e1cf4df --- /dev/null +++ b/force-app/main/default/classes/getObjectsTest.cls @@ -0,0 +1,12 @@ +@isTest +public class getObjectsTest { + @isTest static void testGetObjectMethod() { + // Call the method to test + List result = getObjects.getObjectMethod(); + + // Perform some basic assertions + // Modify this part based on your specific requirements + System.assertNotEquals(null, result, 'The returned list should not be null'); + System.assert(result.size() > 0, 'The returned list should not be empty'); + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/getObjectsTest.cls-meta.xml b/force-app/main/default/classes/getObjectsTest.cls-meta.xml new file mode 100644 index 0000000..b1a915c --- /dev/null +++ b/force-app/main/default/classes/getObjectsTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + Active + diff --git a/force-app/main/default/classes/getPlayer.cls b/force-app/main/default/classes/getPlayer.cls new file mode 100644 index 0000000..9c4aa41 --- /dev/null +++ b/force-app/main/default/classes/getPlayer.cls @@ -0,0 +1,22 @@ +// Declaring a public class with sharing keyword to enforce the sharing rules of the current user +public with sharing class getPlayer { + // AuraEnabled annotation to enable client and server-side access to the Apex method + @AuraEnabled + // Method to get the list of players based on the selected Id + public static List getPlayerList(Id SelectedId){ + try { + // Query to fetch the player records related to the selected Id + List playerList=[SELECT Id,Name,Country__c FROM Player__c WHERE Cricket_Team__c=:SelectedId]; + + // Check if the player list is not empty + if(!playerList.isEmpty()){ + return playerList; // Return the player list + } + return null; // Return null if no players found + + } catch (Exception e) { + // Catch any exceptions and throw an AuraHandledException with the error message + throw new AuraHandledException(e.getMessage()); + } + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/getPlayer.cls-meta.xml b/force-app/main/default/classes/getPlayer.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/getPlayer.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/leadConverthandler.cls b/force-app/main/default/classes/leadConverthandler.cls new file mode 100644 index 0000000..6bab053 --- /dev/null +++ b/force-app/main/default/classes/leadConverthandler.cls @@ -0,0 +1,25 @@ +public class leadConverthandler { + public static void convertmethod(listleadlist){ + try{ + List leadConverts = new List(); + for (Lead lead : leadlist) { + if (lead.Status == 'Closed - Converted' && lead.IsConverted == false) { + Database.LeadConvert lc = new Database.LeadConvert(); + lc.setLeadId(lead.Id); + LeadStatus convertStatus = [SELECT Id, MasterLabel FROM LeadStatus WHERE IsConverted=true LIMIT 1]; + lc.setConvertedStatus(convertStatus.MasterLabel); + + + leadConverts.add(lc); + } + } + if (!leadConverts.isEmpty()) { + List lcr = Database.convertLead(leadConverts); + } + }catch(Exception e){ + System.debug('Error'+e); + } + + } + +} \ No newline at end of file diff --git a/force-app/main/default/classes/leadConverthandler.cls-meta.xml b/force-app/main/default/classes/leadConverthandler.cls-meta.xml new file mode 100644 index 0000000..b1a915c --- /dev/null +++ b/force-app/main/default/classes/leadConverthandler.cls-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + Active + diff --git a/force-app/main/default/classes/mak.cls b/force-app/main/default/classes/mak.cls new file mode 100644 index 0000000..908c609 --- /dev/null +++ b/force-app/main/default/classes/mak.cls @@ -0,0 +1,3 @@ +public class mak { + +} \ No newline at end of file diff --git a/force-app/main/default/classes/mak.cls-meta.xml b/force-app/main/default/classes/mak.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/mak.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/njni.cls b/force-app/main/default/classes/njni.cls new file mode 100644 index 0000000..fc400ad --- /dev/null +++ b/force-app/main/default/classes/njni.cls @@ -0,0 +1,3 @@ +public class njni { + +} \ No newline at end of file diff --git a/force-app/main/default/classes/njni.cls-meta.xml b/force-app/main/default/classes/njni.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/njni.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/opportunityDataTableController.cls b/force-app/main/default/classes/opportunityDataTableController.cls new file mode 100644 index 0000000..66c2766 --- /dev/null +++ b/force-app/main/default/classes/opportunityDataTableController.cls @@ -0,0 +1,10 @@ +public class opportunityDataTableController { + public List opportunity {get; set;} + + //collecting the records from account and opportunity + + public opportunityDataTableController() { + opportunity =[SELECT Name,StageName,CloseDate,Opportunity.Account.Name FROM Opportunity]; + } + +} \ No newline at end of file diff --git a/force-app/main/default/classes/opportunityDataTableController.cls-meta.xml b/force-app/main/default/classes/opportunityDataTableController.cls-meta.xml new file mode 100644 index 0000000..f5e18fd --- /dev/null +++ b/force-app/main/default/classes/opportunityDataTableController.cls-meta.xml @@ -0,0 +1,5 @@ + + + 60.0 + Active + diff --git a/force-app/main/default/classes/test1234.cls b/force-app/main/default/classes/test1234.cls new file mode 100644 index 0000000..67b3185 --- /dev/null +++ b/force-app/main/default/classes/test1234.cls @@ -0,0 +1,25 @@ +public class test1234{ + public static void main1(){ + /* List ol = new List(); + for(Integer i=1;i<=5;i++){ + Opportunity opl = new Opportunity(); + opl.Name='test'+i; + opl.StageName = 'Prospecting'; + opl.CloseDate=Date.today(); + ol.add(opl); + } + insert ol;*/ + // First, query for the opportunities you want to update + List oppsToUpdate = [SELECT Id, Name,StageName FROM Opportunity WHERE Name = 'Today1' OR Name='Today2']; + system.debug('@@@@ reocrds'+ oppsToUpdate); + // Then, make the changes to the records + for(Opportunity opp : oppsToUpdate) { + opp.StageName = 'Closed Won'; + } + + // Finally, update the records in the database + update oppsToUpdate; + } + + +} \ No newline at end of file diff --git a/force-app/main/default/classes/test1234.cls-meta.xml b/force-app/main/default/classes/test1234.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/test1234.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/testApex.cls b/force-app/main/default/classes/testApex.cls new file mode 100644 index 0000000..8b9bd2c --- /dev/null +++ b/force-app/main/default/classes/testApex.cls @@ -0,0 +1,31 @@ +public class testApex { + public static void method(){ + try{ + //collecting contentdocumentlink record from contentdocumentlink + List cdlList = [SELECT Id,ContentDocumentId, LinkedEntityId FROM ContentDocumentLink WHERE ContentDocumentId='0695j00000Hql43AAB']; + system.debug('ContentDocumentLink Record:'+cdlList); + + //collecting linkedentityid to find object from contentdocumentlink + List LinkedEntyId = new List(); + for (ContentDocumentlink cd1 :cdlList) { + LinkedEntyId.add(cd1.LinkedEntityId); + } + system.debug('LinkedEntityId'+LinkedEntyId); + + //colleting those records where linkedentityid==contactid + ListcList=[SELECT Id,LastName,Profile_Image__c,Description FROM Contact WHERE Id =:LinkedEntyId]; + system.debug('Contact list where attachment is added'+cList); + List updatedContacts = new List(); + for (Contact contact : cList) { + contact.Description = 'attachment inserted'; + updatedContacts.add(contact); + } + update updatedContacts; + + } + catch(Exception e){ + system.debug('Error Message:'+e); + } + } + +} \ No newline at end of file diff --git a/force-app/main/default/classes/testApex.cls-meta.xml b/force-app/main/default/classes/testApex.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/testApex.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/testhjk.cls b/force-app/main/default/classes/testhjk.cls new file mode 100644 index 0000000..e63f0e3 --- /dev/null +++ b/force-app/main/default/classes/testhjk.cls @@ -0,0 +1,11 @@ +public class testhjk { + static string n=''; + public static void first(){ + n='rohit'; + system.debug('First'+n); +} + public static void second(){ + system.debug('second'+n); +} + +} \ No newline at end of file diff --git a/force-app/main/default/classes/testhjk.cls-meta.xml b/force-app/main/default/classes/testhjk.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/testhjk.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/threeObjectUpdate.cls b/force-app/main/default/classes/threeObjectUpdate.cls new file mode 100644 index 0000000..39eb24a --- /dev/null +++ b/force-app/main/default/classes/threeObjectUpdate.cls @@ -0,0 +1,57 @@ +global class threeObjectUpdate implements Schedulable, Database.Batchable + +{ + List failedUpdates; + global Database.QueryLocator start(Database.BatchableContext BC) + { + String query1 = 'SELECT Id,Description, NumberOfEmployees,(SELECT LastName FROM Contacts) FROM Account'; + + return Database.getQueryLocator(query1); + + + } + + global void execute(Database.BatchableContext BC, List scope) + { + for(Account a : scope) + { + a.Description = 'New Description from batch 2'; + a.NumberOfEmployees =200; + + for(Contact con:a.Contacts){ + con.LastName= 'Last batch Name'; + } + } + List results = Database.update(scope, false); + for (Database.SaveResult result : results) { + if (!result.isSuccess()) { + failedUpdates.add(result.getId()); + } + } + } + global void finish(Database.BatchableContext BC){ + if (!failedUpdates.isEmpty()) { + Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); + mail.setToAddresses(new String[] {'himanshu.s@hicglobalsolutions.com'}); + mail.setSubject('Batch Apex Failure'); + String messageBody = 'The following records failed to update: '; + for (Id failedId : failedUpdates) { + messageBody += failedId + ', '; + + } + mail.setPlainTextBody(messageBody); + + Messaging.sendEmail(new Messaging.SingleEmailMessage[] {mail}); + } + } + global void execute(SchedulableContext SC) { + threeObjectUpdate batchJob = new threeObjectUpdate(); + Database.executeBatch(batchJob); + } + + public static void scheduleJob() { + threeObjectUpdate batchJob = new threeObjectUpdate(); + String cronExpression = '0 0 0 ? * MON *'; // Every Monday at midnight + System.schedule('Update Account Batch', cronExpression, batchJob); + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/threeObjectUpdate.cls-meta.xml b/force-app/main/default/classes/threeObjectUpdate.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/threeObjectUpdate.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/updatePhone.cls b/force-app/main/default/classes/updatePhone.cls new file mode 100644 index 0000000..e4b60c5 --- /dev/null +++ b/force-app/main/default/classes/updatePhone.cls @@ -0,0 +1,21 @@ +global class updatePhone implements Database.Batchable +{ + global Database.QueryLocator start(Database.BatchableContext BC) + { + String query = 'SELECT Id,Phone FROM Account'; + + return Database.getQueryLocator(query); + + } + global void execute(Database.BatchableContext BC, List scope) + { + for(Account a : scope) + { + a.Phone = '999999999'; + } + Database.update(scope); + } + global void finish(Database.BatchableContext BC) { + } + +} \ No newline at end of file diff --git a/force-app/main/default/classes/updatePhone.cls-meta.xml b/force-app/main/default/classes/updatePhone.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/updatePhone.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/classes/updateStatusjob.cls b/force-app/main/default/classes/updateStatusjob.cls new file mode 100644 index 0000000..52e655c --- /dev/null +++ b/force-app/main/default/classes/updateStatusjob.cls @@ -0,0 +1,22 @@ +global class updateStatusjob implements Database.Batchable +{ + global Database.QueryLocator start(Database.BatchableContext BC) + { + String query = 'SELECT Id,Industry, Active__c FROM Account'; + + return Database.getQueryLocator(query); + } + global void execute(Database.BatchableContext BC, List scope) + { + for(Account a : scope) + { + a.Industry = 'Technology'; + a.Active__c='Yes'; + } + update scope; + } + global void finish(Database.BatchableContext BC){ + + } + +} \ No newline at end of file diff --git a/force-app/main/default/classes/updateStatusjob.cls-meta.xml b/force-app/main/default/classes/updateStatusjob.cls-meta.xml new file mode 100644 index 0000000..7a51829 --- /dev/null +++ b/force-app/main/default/classes/updateStatusjob.cls-meta.xml @@ -0,0 +1,5 @@ + + + 58.0 + Active + diff --git a/force-app/main/default/components/SiteFooter.component b/force-app/main/default/components/SiteFooter.component new file mode 100644 index 0000000..2023a51 --- /dev/null +++ b/force-app/main/default/components/SiteFooter.component @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/force-app/main/default/components/SiteFooter.component-meta.xml b/force-app/main/default/components/SiteFooter.component-meta.xml new file mode 100644 index 0000000..fb5706e --- /dev/null +++ b/force-app/main/default/components/SiteFooter.component-meta.xml @@ -0,0 +1,6 @@ + + + 58.0 + Default Lightning Platform site footer component + + diff --git a/force-app/main/default/components/SiteHeader.component b/force-app/main/default/components/SiteHeader.component new file mode 100644 index 0000000..3ebfbe7 --- /dev/null +++ b/force-app/main/default/components/SiteHeader.component @@ -0,0 +1,15 @@ + + + + + + {!$Label.site.login_button} + + {!$Label.site.forgot_your_password_q} + + {!$Label.site.new_user_q} + + {!$Label.site.logout} + + + \ No newline at end of file diff --git a/force-app/main/default/components/SiteHeader.component-meta.xml b/force-app/main/default/components/SiteHeader.component-meta.xml new file mode 100644 index 0000000..f73e3de --- /dev/null +++ b/force-app/main/default/components/SiteHeader.component-meta.xml @@ -0,0 +1,6 @@ + + + 58.0 + Default Lightning Platform site header component + + diff --git a/force-app/main/default/components/SiteLogin.component b/force-app/main/default/components/SiteLogin.component new file mode 100644 index 0000000..ec891e0 --- /dev/null +++ b/force-app/main/default/components/SiteLogin.component @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + {!$Label.site.forgot_your_password_q} + + {!$Label.site.new_user_q} + + + + + \ No newline at end of file diff --git a/force-app/main/default/components/SiteLogin.component-meta.xml b/force-app/main/default/components/SiteLogin.component-meta.xml new file mode 100644 index 0000000..337bd1a --- /dev/null +++ b/force-app/main/default/components/SiteLogin.component-meta.xml @@ -0,0 +1,6 @@ + + + 58.0 + Default Salesforce Sites Login component + + diff --git a/force-app/main/default/components/SitePoweredBy.component b/force-app/main/default/components/SitePoweredBy.component new file mode 100644 index 0000000..52b3779 --- /dev/null +++ b/force-app/main/default/components/SitePoweredBy.component @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/force-app/main/default/components/SitePoweredBy.component-meta.xml b/force-app/main/default/components/SitePoweredBy.component-meta.xml new file mode 100644 index 0000000..52ee0d4 --- /dev/null +++ b/force-app/main/default/components/SitePoweredBy.component-meta.xml @@ -0,0 +1,6 @@ + + + 58.0 + Default Lightning Platform site powered by component + + diff --git a/force-app/main/default/lwc/.eslintrc.json b/force-app/main/default/lwc/.eslintrc.json new file mode 100644 index 0000000..a82e76d --- /dev/null +++ b/force-app/main/default/lwc/.eslintrc.json @@ -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 + } + } + ] +} diff --git a/force-app/main/default/lwc/accountListLWC/accountListLWC.html b/force-app/main/default/lwc/accountListLWC/accountListLWC.html new file mode 100644 index 0000000..7164cbb --- /dev/null +++ b/force-app/main/default/lwc/accountListLWC/accountListLWC.html @@ -0,0 +1,13 @@ + + \ No newline at end of file diff --git a/force-app/main/default/lwc/accountListLWC/accountListLWC.js b/force-app/main/default/lwc/accountListLWC/accountListLWC.js new file mode 100644 index 0000000..9353eb7 --- /dev/null +++ b/force-app/main/default/lwc/accountListLWC/accountListLWC.js @@ -0,0 +1,44 @@ +// accountList.js +import { LightningElement, api } from 'lwc'; +import { NavigationMixin } from 'lightning/navigation'; + +export default class AccountListLWC extends NavigationMixin(LightningElement) { + @api accounts; + + columns = [ + { label: 'Account Name', fieldName: 'Name' }, + { label: 'Type', fieldName:'Type'}, + { label: 'Phone', fieldName:'Phone'}, + { + label: 'Action', + type: 'button', + initialWidth: 135, + typeAttributes: { + label: 'View details', + name: 'view_details', + title: 'Click to View Details', + disabled: false, + value: 'view', + variant: 'base', + }, + } + ]; + + handleRowAction(event) { + const actionName = event.detail.action.name; + const row = event.detail.row; + switch (actionName) { + case 'view_details': + this[NavigationMixin.Navigate]({ + type:'standard__recordPage', + attributes:{ + recordId: row.Id, + objectApiName:'Account', + actionName:'view' + } + }) + break; + default: + } + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/accountListLWC/accountListLWC.js-meta.xml b/force-app/main/default/lwc/accountListLWC/accountListLWC.js-meta.xml new file mode 100644 index 0000000..6127d85 --- /dev/null +++ b/force-app/main/default/lwc/accountListLWC/accountListLWC.js-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + false + \ No newline at end of file diff --git a/force-app/main/default/lwc/accountLocator/accountLocator.html b/force-app/main/default/lwc/accountLocator/accountLocator.html new file mode 100644 index 0000000..e2e0c9a --- /dev/null +++ b/force-app/main/default/lwc/accountLocator/accountLocator.html @@ -0,0 +1,15 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/accountLocator/accountLocator.js b/force-app/main/default/lwc/accountLocator/accountLocator.js new file mode 100644 index 0000000..e209cc1 --- /dev/null +++ b/force-app/main/default/lwc/accountLocator/accountLocator.js @@ -0,0 +1,12 @@ +// accountLocatorController.js +import { LightningElement, track } from 'lwc'; + +export default class AccountLocator extends LightningElement { + @track accounts; + + handleSearch(event) { + this.accounts = event.detail; + + } + +} \ No newline at end of file diff --git a/force-app/main/default/lwc/accountLocator/accountLocator.js-meta.xml b/force-app/main/default/lwc/accountLocator/accountLocator.js-meta.xml new file mode 100644 index 0000000..9d66e64 --- /dev/null +++ b/force-app/main/default/lwc/accountLocator/accountLocator.js-meta.xml @@ -0,0 +1,10 @@ + + + 59.0 + true + + lightning__HomePage + lightning__AppPage + lightningCommunity__Page + + \ No newline at end of file diff --git a/force-app/main/default/lwc/accountMap/accountMap.html b/force-app/main/default/lwc/accountMap/accountMap.html new file mode 100644 index 0000000..6c4b068 --- /dev/null +++ b/force-app/main/default/lwc/accountMap/accountMap.html @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/accountMap/accountMap.js b/force-app/main/default/lwc/accountMap/accountMap.js new file mode 100644 index 0000000..532ada4 --- /dev/null +++ b/force-app/main/default/lwc/accountMap/accountMap.js @@ -0,0 +1,40 @@ +// accountMap.js +import { LightningElement, api, track } from 'lwc'; + +export default class AccountMap extends LightningElement { + @track mapMarkers = []; + _accounts; + + connectedCallback() { + this.loadMapMarkers(); + } + + loadMapMarkers() { + if (this._accounts && this._accounts.length > 0) { + + this.mapMarkers = this._accounts.map(account => { + return { + location: { + Street: account.ShippingStreet, + City: account.ShippingCity, + PostalCode: account.ShippingPostalCode + }, + title: account.Name, + description: `Phone: ${account.Phone}`, + icon: 'standard:location' + }; + }); + } + } + + @api + get accounts() { + return this._accounts; + } + + set accounts(value) { + this._accounts = value; + this.loadMapMarkers(); + } + +} \ No newline at end of file diff --git a/force-app/main/default/lwc/accountMap/accountMap.js-meta.xml b/force-app/main/default/lwc/accountMap/accountMap.js-meta.xml new file mode 100644 index 0000000..6127d85 --- /dev/null +++ b/force-app/main/default/lwc/accountMap/accountMap.js-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + false + \ No newline at end of file diff --git a/force-app/main/default/lwc/accountSearch/accountSearch.html b/force-app/main/default/lwc/accountSearch/accountSearch.html new file mode 100644 index 0000000..2a9a5b9 --- /dev/null +++ b/force-app/main/default/lwc/accountSearch/accountSearch.html @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/accountSearch/accountSearch.js b/force-app/main/default/lwc/accountSearch/accountSearch.js new file mode 100644 index 0000000..28dc867 --- /dev/null +++ b/force-app/main/default/lwc/accountSearch/accountSearch.js @@ -0,0 +1,29 @@ +// accountSearchController.js +import { LightningElement, track } from 'lwc'; +import searchAccounts from '@salesforce/apex/AccountSearchController.searchAccounts'; + +export default class AccountSearch extends LightningElement { + @track searchValue = ''; + + handleSearchChange(event) { + this.searchValue = event.target.value; + this.searchAccounts(); + } + + searchAccounts() { + try { + searchAccounts({ searchValue: this.searchValue }) + .then(result => { + console.log('Search Results: ', JSON.stringify(result)); // Debugging line + this.accounts = result; + const searchEvent = new CustomEvent('search', { detail: this.accounts }); + this.dispatchEvent(searchEvent); + }) + .catch(error => { + console.error('Error in AccountSearch: ' + error.message); + }); + } catch (err) { + console.error('Error in AccountSearch: ' + err.message); + } + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/accountSearch/accountSearch.js-meta.xml b/force-app/main/default/lwc/accountSearch/accountSearch.js-meta.xml new file mode 100644 index 0000000..fcdb4b8 --- /dev/null +++ b/force-app/main/default/lwc/accountSearch/accountSearch.js-meta.xml @@ -0,0 +1,8 @@ + + + 59.0 + true + + lightning__HomePage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/apiDecorator/apiDecorator.html b/force-app/main/default/lwc/apiDecorator/apiDecorator.html new file mode 100644 index 0000000..7470a98 --- /dev/null +++ b/force-app/main/default/lwc/apiDecorator/apiDecorator.html @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/apiDecorator/apiDecorator.js b/force-app/main/default/lwc/apiDecorator/apiDecorator.js new file mode 100644 index 0000000..6ff1fdc --- /dev/null +++ b/force-app/main/default/lwc/apiDecorator/apiDecorator.js @@ -0,0 +1,5 @@ +import { LightningElement,api} from 'lwc'; + +export default class ApiDecorator extends LightningElement { + itemName="Welcome to Api "; +} \ No newline at end of file diff --git a/force-app/main/default/lwc/apiDecorator/apiDecorator.js-meta.xml b/force-app/main/default/lwc/apiDecorator/apiDecorator.js-meta.xml new file mode 100644 index 0000000..d77eec4 --- /dev/null +++ b/force-app/main/default/lwc/apiDecorator/apiDecorator.js-meta.xml @@ -0,0 +1,8 @@ + + + 57.0 + true + + lightning__RecordPage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/bikeCard/bikeCard.html b/force-app/main/default/lwc/bikeCard/bikeCard.html new file mode 100644 index 0000000..f6bb186 --- /dev/null +++ b/force-app/main/default/lwc/bikeCard/bikeCard.html @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/bikeCard/bikeCard.js b/force-app/main/default/lwc/bikeCard/bikeCard.js new file mode 100644 index 0000000..200d3e7 --- /dev/null +++ b/force-app/main/default/lwc/bikeCard/bikeCard.js @@ -0,0 +1,9 @@ +import { LightningElement } from 'lwc'; +export default class bikeCard extends LightningElement { + name = 'Electra X4'; + description = 'A sweet bike built for comfort.'; + category = 'Mountain'; + material = 'Steel'; + price = '$2,700'; + pictureUrl = 'https://s3-us-west-1.amazonaws.com/sfdc-demo/ebikes/electrax4.jpg'; +} \ No newline at end of file diff --git a/force-app/main/default/lwc/bikeCard/bikeCard.js-meta.xml b/force-app/main/default/lwc/bikeCard/bikeCard.js-meta.xml new file mode 100644 index 0000000..86726ba --- /dev/null +++ b/force-app/main/default/lwc/bikeCard/bikeCard.js-meta.xml @@ -0,0 +1,12 @@ + + + + 57.0 + true + Bike Card + + lightning__AppPage + lightning__RecordPage + lightning__HomePage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/c2pModelComponent/c2pModelComponent.html b/force-app/main/default/lwc/c2pModelComponent/c2pModelComponent.html new file mode 100644 index 0000000..71c9077 --- /dev/null +++ b/force-app/main/default/lwc/c2pModelComponent/c2pModelComponent.html @@ -0,0 +1,18 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/c2pModelComponent/c2pModelComponent.js b/force-app/main/default/lwc/c2pModelComponent/c2pModelComponent.js new file mode 100644 index 0000000..58a2c0a --- /dev/null +++ b/force-app/main/default/lwc/c2pModelComponent/c2pModelComponent.js @@ -0,0 +1,19 @@ +import { LightningElement } from 'lwc'; + +export default class C2pModelComponent extends LightningElement { + + msg = [{ name : 'Event 1', + mess : 'Closed 1'}, +{ + name : 'Event 2', + mess : 'Closed 2' +}] + closeHandler(){ + + const myEvent = new CustomEvent('close',{ + detail :this.msg + }); + this.dispatchEvent(myEvent); + + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/c2pModelComponent/c2pModelComponent.js-meta.xml b/force-app/main/default/lwc/c2pModelComponent/c2pModelComponent.js-meta.xml new file mode 100644 index 0000000..6127d85 --- /dev/null +++ b/force-app/main/default/lwc/c2pModelComponent/c2pModelComponent.js-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + false + \ No newline at end of file diff --git a/force-app/main/default/lwc/c2pParentComponet/c2pParentComponet.html b/force-app/main/default/lwc/c2pParentComponet/c2pParentComponet.html new file mode 100644 index 0000000..3c61a21 --- /dev/null +++ b/force-app/main/default/lwc/c2pParentComponet/c2pParentComponet.html @@ -0,0 +1,20 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/c2pParentComponet/c2pParentComponet.js b/force-app/main/default/lwc/c2pParentComponet/c2pParentComponet.js new file mode 100644 index 0000000..f0d0917 --- /dev/null +++ b/force-app/main/default/lwc/c2pParentComponet/c2pParentComponet.js @@ -0,0 +1,18 @@ +import { LightningElement } from 'lwc'; + +export default class C2pParentComponet extends LightningElement { + + showModal=false; + message; + + clickHandler(){ + this.showModal = true ; + } + + closeHandler(event){ + this.message = event.detail + this.showModal = false ; + console.log(this.message[0].name); + + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/c2pParentComponet/c2pParentComponet.js-meta.xml b/force-app/main/default/lwc/c2pParentComponet/c2pParentComponet.js-meta.xml new file mode 100644 index 0000000..011be21 --- /dev/null +++ b/force-app/main/default/lwc/c2pParentComponet/c2pParentComponet.js-meta.xml @@ -0,0 +1,8 @@ + + + 59.0 + true + + lightning__AppPage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/calculator/calculator.html b/force-app/main/default/lwc/calculator/calculator.html new file mode 100644 index 0000000..a5236eb --- /dev/null +++ b/force-app/main/default/lwc/calculator/calculator.html @@ -0,0 +1,177 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/calculator/calculator.js b/force-app/main/default/lwc/calculator/calculator.js new file mode 100644 index 0000000..4a4210e --- /dev/null +++ b/force-app/main/default/lwc/calculator/calculator.js @@ -0,0 +1,110 @@ +import { LightningElement } from 'lwc'; + + +export default class PracticeJavaScript extends LightningElement { + calcResult = ''; + calcExpression = ''; + clrExpression = false; + prevOper = ''; + operations = { + current: 0, + '=': function(){ + return this.current; + }, + '+': function(n){ + this.current += parseInt(n); + return this; + }, + '-': function(n){ + this.current -= parseInt(n); + return this; + }, + '*': function(n){ + this.current *= parseInt(n); + return this; + }, + '/': function(n){ + this.current /= parseInt(n); + return this; + } + } + + + get showResult(){ + return this.operations.current; + } + handleClear(event){ + this.calcResult = ''; + this.calcExpression = ''; + + } + + + handleClick(event){ + if (this.clrExpression){ + this.calcExpression = ''; + this.calcResult = ''; + this.operations.current = 0; + this.clrExpression = false; + } + this.calcExpression = this.calcExpression + event.target.label; + if (event.target.label === "CLR"){ + this.calcResult = ''; + this.calcExpression = ''; + this.operations.current = 0; + } + else if (event.target.label === "+"){ + if (this.operations.current === 0) + { + this.operations.current = parseInt(this.calcResult); + } + else{ + this.calcResult = this.operations[this.prevOper](this.calcResult); + } + this.prevOper = '+'; + this.calcResult = ''; + } + else if (event.target.label === "-"){ + if (this.operations.current === 0) + { + this.operations.current = parseInt(this.calcResult); + } + else{ + this.calcResult = this.operations[this.prevOper](this.calcResult); + } + this.prevOper = '-'; + this.calcResult = ''; + } + else if (event.target.label === "*"){ + if (this.operations.current === 0) + { + this.operations.current = parseInt(this.calcResult); + } + else{ + this.calcResult = this.operations[this.prevOper](this.calcResult); + } + this.prevOper = '*'; + this.calcResult = ''; + } + else if (event.target.label === "/"){ + if (this.operations.current === 0) + { + this.operations.current = parseInt(this.calcResult); + } + else{ + this.calcResult = this.operations[this.prevOper](this.calcResult); + } + this.prevOper = '/'; + this.calcResult = ''; + } + else if (event.target.label === "="){ + this.calcResult = this.operations[this.prevOper](this.calcResult); + this.calcResult = this.operations['='](); + this.clrExpression = true; + } + else{ + this.calcResult = this.calcResult + event.target.label; + + } + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/calculator/calculator.js-meta.xml b/force-app/main/default/lwc/calculator/calculator.js-meta.xml new file mode 100644 index 0000000..519ef48 --- /dev/null +++ b/force-app/main/default/lwc/calculator/calculator.js-meta.xml @@ -0,0 +1,8 @@ + + + 57.0 + true + + lightning__HomePage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/calculatorChild/calculatorChild.html b/force-app/main/default/lwc/calculatorChild/calculatorChild.html new file mode 100644 index 0000000..2f7103f --- /dev/null +++ b/force-app/main/default/lwc/calculatorChild/calculatorChild.html @@ -0,0 +1,147 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/calculatorChild/calculatorChild.js b/force-app/main/default/lwc/calculatorChild/calculatorChild.js new file mode 100644 index 0000000..95371e0 --- /dev/null +++ b/force-app/main/default/lwc/calculatorChild/calculatorChild.js @@ -0,0 +1,21 @@ +import { LightningElement } from 'lwc'; + +export default class CalculatorChild extends LightningElement { + handleNumbers(event){ + const valueformultiply=event.target.value; + + this.dispatchEvent(new CustomEvent('numbers',{ + detail:valueformultiply + })); + + } + handleMultiply(event){ + const valueoflogic=event.target.value; + this.dispatchEvent(new CustomEvent('logical',{ + detail:valueoflogic + })); + } + handleClearAll(event){ + this.dispatchEvent(new CustomEvent('clear')); + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/calculatorChild/calculatorChild.js-meta.xml b/force-app/main/default/lwc/calculatorChild/calculatorChild.js-meta.xml new file mode 100644 index 0000000..3fe0e73 --- /dev/null +++ b/force-app/main/default/lwc/calculatorChild/calculatorChild.js-meta.xml @@ -0,0 +1,5 @@ + + + 57.0 + false + \ No newline at end of file diff --git a/force-app/main/default/lwc/calculatorParent/calculatorParent.html b/force-app/main/default/lwc/calculatorParent/calculatorParent.html new file mode 100644 index 0000000..1e8c1ed --- /dev/null +++ b/force-app/main/default/lwc/calculatorParent/calculatorParent.html @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/calculatorParent/calculatorParent.js b/force-app/main/default/lwc/calculatorParent/calculatorParent.js new file mode 100644 index 0000000..3bff2ba --- /dev/null +++ b/force-app/main/default/lwc/calculatorParent/calculatorParent.js @@ -0,0 +1,26 @@ +import { LightningElement } from 'lwc'; + +export default class CalculatorParent extends LightningElement { + expression; + number; + cal; + output=0; + handlenumbers(event){ + this.expression+=event.detail; + this.number=event.detail; + if(this.cal=null){ + this.output=this.number; + } + } + handlelogical(event){ + this.expression+=event.detail; + this.cal=event.detail; + + } + handleClear(){ + this.expression = ''; + this.output = ''; + } + + +} \ No newline at end of file diff --git a/force-app/main/default/lwc/calculatorParent/calculatorParent.js-meta.xml b/force-app/main/default/lwc/calculatorParent/calculatorParent.js-meta.xml new file mode 100644 index 0000000..519ef48 --- /dev/null +++ b/force-app/main/default/lwc/calculatorParent/calculatorParent.js-meta.xml @@ -0,0 +1,8 @@ + + + 57.0 + true + + lightning__HomePage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/callBackMethods/callBackMethods.html b/force-app/main/default/lwc/callBackMethods/callBackMethods.html new file mode 100644 index 0000000..cd7c16d --- /dev/null +++ b/force-app/main/default/lwc/callBackMethods/callBackMethods.html @@ -0,0 +1,37 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/callBackMethods/callBackMethods.js b/force-app/main/default/lwc/callBackMethods/callBackMethods.js new file mode 100644 index 0000000..9ccefc5 --- /dev/null +++ b/force-app/main/default/lwc/callBackMethods/callBackMethods.js @@ -0,0 +1,58 @@ +import { LightningElement,api, wire, track } from 'lwc'; +import { getRecord, getFieldValue } from 'lightning/uiRecordApi'; +// import templateOne from './templateOne.html'; +// import templateTwo from './templateTwo.html'; + +// import NAME_FIELD from '@salesforce/schema/Account.Name'; +// import PHONE_FIELD from '@salesforce/schema/Account.Phone'; +const FIELDS =[ + 'Account.Name', + 'Account.Phone', +] +export default class BaiscLWCLearn extends LightningElement { + message = 'Api Example'; + @api recordId; + @track ShowButton=false; + showInfo = false; + showInputFiledVal = false; + buttonLabel; + @wire(getRecord, {recordId: '$recordId',fields:FIELDS}) + record; //it contain data and error + + get name(){ + return this.record.data.fields.Name.value; + } + + get phone(){ + return this.record.data.fields.Phone.value; + } + + getName(event){ + console.log('Name', event.target.value); + this.ShowButton=true; + } + + connectedCallback(){ + console.log('Connected Call Back is Called'); + } + buttonClicked(event) + { + this.buttonLabel = event.currentTarget.dataset.id; + this.showInfo = true; + this.showInputFiledVal = true; + //this.template.querySelector('.input1').value = buttonLabel + ' is Clicked'; + } + + renderedCallback() + { + if(this.showInputFiledVal) + { + this.template.querySelector('.input1').value = this.buttonLabel + ' is Clicked'; + this.showInputFiledVal = false; + } + } + + disconnectedCallback(){ + console.log('Disconnected Call Back is Called'); + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/callBackMethods/callBackMethods.js-meta.xml b/force-app/main/default/lwc/callBackMethods/callBackMethods.js-meta.xml new file mode 100644 index 0000000..ca5b3ed --- /dev/null +++ b/force-app/main/default/lwc/callBackMethods/callBackMethods.js-meta.xml @@ -0,0 +1,10 @@ + + + 57.0 + true + + lightning__HomePage + lightning__RecordPage + + + \ No newline at end of file diff --git a/force-app/main/default/lwc/callingFlow/callingFlow.html b/force-app/main/default/lwc/callingFlow/callingFlow.html new file mode 100644 index 0000000..70d85f5 --- /dev/null +++ b/force-app/main/default/lwc/callingFlow/callingFlow.html @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/callingFlow/callingFlow.js b/force-app/main/default/lwc/callingFlow/callingFlow.js new file mode 100644 index 0000000..6a97f77 --- /dev/null +++ b/force-app/main/default/lwc/callingFlow/callingFlow.js @@ -0,0 +1,14 @@ +import { LightningElement, track } from 'lwc'; + +export default class MyComponent extends LightningElement { + @track isFlowVisible = false; + + launchFlow() { + this.isFlowVisible = true; + this.template.querySelector('lightning-flow').startFlow('ShowingText'); + } + + hideFlow() { + this.isFlowVisible = false; + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/callingFlow/callingFlow.js-meta.xml b/force-app/main/default/lwc/callingFlow/callingFlow.js-meta.xml new file mode 100644 index 0000000..5b8c38a --- /dev/null +++ b/force-app/main/default/lwc/callingFlow/callingFlow.js-meta.xml @@ -0,0 +1,9 @@ + + + 58.0 + true + + lightning__HomePage + lightning__AppPage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/calllwc/calllwc.css b/force-app/main/default/lwc/calllwc/calllwc.css new file mode 100644 index 0000000..8c5d474 --- /dev/null +++ b/force-app/main/default/lwc/calllwc/calllwc.css @@ -0,0 +1,26 @@ +.chat-content { + position: relative; + font-weight: 400; + line-height: 1.3; + max-width: 70%; + padding: 10px; + font-size: 0.875em; + border-radius: 10px 10px 0; + float: right; + margin-left: 40px; + white-space: pre-wrap; + text-align: left; +} + +.agent.chat-content { + color: #000; + background: #7e0c65; + border-radius: 10px 10px 10px 0; + float: left; +} + +.chasitor.chat-content { + background: rgb(6, 223, 6); + color: rgb(0, 0, 0); + margin-left: auto; +} \ No newline at end of file diff --git a/force-app/main/default/lwc/calllwc/calllwc.html b/force-app/main/default/lwc/calllwc/calllwc.html new file mode 100644 index 0000000..2b1d2f8 --- /dev/null +++ b/force-app/main/default/lwc/calllwc/calllwc.html @@ -0,0 +1,34 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/calllwc/calllwc.js b/force-app/main/default/lwc/calllwc/calllwc.js new file mode 100644 index 0000000..b02e6e4 --- /dev/null +++ b/force-app/main/default/lwc/calllwc/calllwc.js @@ -0,0 +1,83 @@ +import { track, api } from 'lwc'; +import { ShowToastEvent } from 'lightning/platformShowToastEvent'; +import Botimage from '@salesforce/resourceUrl/Botimage'; +import ChatMessage from 'lightningsnapin/baseChatMessage'; + +const CHAT_CONTENT_CLASS = 'chat-content'; +const AGENT_USER_TYPE = 'agent'; +const CHASITOR_USER_TYPE = 'chasitor'; +const SUPPORTED_USER_TYPES = [AGENT_USER_TYPE, CHASITOR_USER_TYPE]; + +export default class calllwc extends ChatMessage { + @track messageStyle = ''; + @track imageURL = Botimage; + @track name = 'Order Product Image'; + @track showImage = false; + @track fileUpload = false; // Initialize to false + @track mapMarkers = []; // Initialize to empty array + @track showMap = false; + + handleGeolocationSuccess(position) { + const { latitude, longitude } = position.coords; + this.mapMarkers = [{ + location: { + Street: '', + City: '', + Country: '', + Latitude: latitude, + Longitude: longitude + }, + title: 'You are here', + description: 'Your current location' + }]; + } + + handleClick(){ + if(navigator.geolocation){ + navigator.geolocation.getCurrentPosition( + this.handleGeolocationSuccess.bind(this), + error => console.error('Geolocation error:', error) + ); + } + } + + @api + handleUploadFinished(event) { + console.log('Upload finished'); + // Get the list of uploaded files + const uploadedFiles = event.detail.files; + console.log('No. of files uploaded : ' + uploadedFiles.length); + console.log('file : ', event.detail.files); + + // Show success message + const toastEvent = new ShowToastEvent({ + title: 'Success!', + message: 'Upload completed successfully', + variant: 'success', + }); + this.dispatchEvent(toastEvent); + } + + isSupportedUserType(userType) { + return SUPPORTED_USER_TYPES.includes(userType); + } + + connectedCallback() { + if (this.isSupportedUserType(this.userType)) { + this.messageStyle = `${CHAT_CONTENT_CLASS} ${this.userType}`; + } else { + throw new Error(`Unsupported user type: ${this.userType}`); + } + if (this.messageContent.value === 'Einstein Chatbot') { + this.showImage = true; + } else if (this.messageContent.value === 'File Upload') { + this.fileUpload = true; + } else if (this.messageContent.value === 'Current Location') { + this.handleClick(); // Call the handleClick method to get the current location + this.showMap = true; + console.log('Map ' ,this.showMap ); + } else { + this.showImage = false; + } + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/calllwc/calllwc.js-meta.xml b/force-app/main/default/lwc/calllwc/calllwc.js-meta.xml new file mode 100644 index 0000000..ca0d885 --- /dev/null +++ b/force-app/main/default/lwc/calllwc/calllwc.js-meta.xml @@ -0,0 +1,10 @@ + + + 59.0 + true + calllwc + + lightningSnapin__ChatMessage + lightning__HomePage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/childExample/childExample.html b/force-app/main/default/lwc/childExample/childExample.html new file mode 100644 index 0000000..840ee16 --- /dev/null +++ b/force-app/main/default/lwc/childExample/childExample.html @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/childExample/childExample.js b/force-app/main/default/lwc/childExample/childExample.js new file mode 100644 index 0000000..e71b8ea --- /dev/null +++ b/force-app/main/default/lwc/childExample/childExample.js @@ -0,0 +1,5 @@ +import { LightningElement,api } from 'lwc'; + +export default class ChildExample extends LightningElement { + @api counter=0; +} \ No newline at end of file diff --git a/force-app/main/default/lwc/childExample/childExample.js-meta.xml b/force-app/main/default/lwc/childExample/childExample.js-meta.xml new file mode 100644 index 0000000..3fe0e73 --- /dev/null +++ b/force-app/main/default/lwc/childExample/childExample.js-meta.xml @@ -0,0 +1,5 @@ + + + 57.0 + false + \ No newline at end of file diff --git a/force-app/main/default/lwc/childExp1/childExp1.html b/force-app/main/default/lwc/childExp1/childExp1.html new file mode 100644 index 0000000..1f6d8c4 --- /dev/null +++ b/force-app/main/default/lwc/childExp1/childExp1.html @@ -0,0 +1,6 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/childExp1/childExp1.js b/force-app/main/default/lwc/childExp1/childExp1.js new file mode 100644 index 0000000..6858270 --- /dev/null +++ b/force-app/main/default/lwc/childExp1/childExp1.js @@ -0,0 +1,5 @@ +import { LightningElement,api } from 'lwc'; + +export default class ChildExp1 extends LightningElement { + @api counter=0; +} \ No newline at end of file diff --git a/force-app/main/default/lwc/childExp1/childExp1.js-meta.xml b/force-app/main/default/lwc/childExp1/childExp1.js-meta.xml new file mode 100644 index 0000000..3fe0e73 --- /dev/null +++ b/force-app/main/default/lwc/childExp1/childExp1.js-meta.xml @@ -0,0 +1,5 @@ + + + 57.0 + false + \ No newline at end of file diff --git a/force-app/main/default/lwc/chlidExp/chlidExp.html b/force-app/main/default/lwc/chlidExp/chlidExp.html new file mode 100644 index 0000000..01158ed --- /dev/null +++ b/force-app/main/default/lwc/chlidExp/chlidExp.html @@ -0,0 +1,41 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/chlidExp/chlidExp.js b/force-app/main/default/lwc/chlidExp/chlidExp.js new file mode 100644 index 0000000..f190c66 --- /dev/null +++ b/force-app/main/default/lwc/chlidExp/chlidExp.js @@ -0,0 +1,23 @@ +import { LightningElement } from 'lwc'; + +export default class ChlidExp extends LightningElement { + handleSubstract(){ + this.dispatchEvent(new CustomEvent('substract')); + + } + + handleAdd(){ + this.dispatchEvent(new CustomEvent('add')); + + } + + handleMultiply(event){ + const valueformultiply=event.target.value; + + this.dispatchEvent(new CustomEvent('multiply',{ + detail:valueformultiply + })) + + } + +} \ No newline at end of file diff --git a/force-app/main/default/lwc/chlidExp/chlidExp.js-meta.xml b/force-app/main/default/lwc/chlidExp/chlidExp.js-meta.xml new file mode 100644 index 0000000..3fe0e73 --- /dev/null +++ b/force-app/main/default/lwc/chlidExp/chlidExp.js-meta.xml @@ -0,0 +1,5 @@ + + + 57.0 + false + \ No newline at end of file diff --git a/force-app/main/default/lwc/cloud_Pub_Sub/cloud_Pub_Sub.css b/force-app/main/default/lwc/cloud_Pub_Sub/cloud_Pub_Sub.css new file mode 100644 index 0000000..d7cb7db --- /dev/null +++ b/force-app/main/default/lwc/cloud_Pub_Sub/cloud_Pub_Sub.css @@ -0,0 +1,4 @@ +.shadow-box { + box-shadow: 0 0 2px #0176d3; + margin-bottom: 5px; +} \ No newline at end of file diff --git a/force-app/main/default/lwc/cloud_Pub_Sub/cloud_Pub_Sub.html b/force-app/main/default/lwc/cloud_Pub_Sub/cloud_Pub_Sub.html new file mode 100644 index 0000000..86a2bd1 --- /dev/null +++ b/force-app/main/default/lwc/cloud_Pub_Sub/cloud_Pub_Sub.html @@ -0,0 +1,33 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/cloud_Pub_Sub/cloud_Pub_Sub.js b/force-app/main/default/lwc/cloud_Pub_Sub/cloud_Pub_Sub.js new file mode 100644 index 0000000..e66e90a --- /dev/null +++ b/force-app/main/default/lwc/cloud_Pub_Sub/cloud_Pub_Sub.js @@ -0,0 +1,23 @@ +import { LightningElement, track } from 'lwc'; +import pullMessages from '@salesforce/apex/GoogleCloudPubSubService.pullMessages'; +export default class Cloud_Pub_Sub extends LightningElement { + @track messages = []; + + getMessages() { + console.log('onclick'); + try { + pullMessages() + .then(result => { + this.messages = result; + console.log('got message', this.messages); + }) + .catch(error => { + console.error('Error in pullMessages: ', error); + }); + + } catch (e) { + console.error('Error in getMessages: ', e); + } + } + +} \ No newline at end of file diff --git a/force-app/main/default/lwc/cloud_Pub_Sub/cloud_Pub_Sub.js-meta.xml b/force-app/main/default/lwc/cloud_Pub_Sub/cloud_Pub_Sub.js-meta.xml new file mode 100644 index 0000000..8f8e5eb --- /dev/null +++ b/force-app/main/default/lwc/cloud_Pub_Sub/cloud_Pub_Sub.js-meta.xml @@ -0,0 +1,11 @@ + + + 59.0 + true + + lightning__HomePage + lightning__RecordPage + lightningCommunity__Page + lightningCommunity__Default + + \ No newline at end of file diff --git a/force-app/main/default/lwc/conditionalRenderingComponent/conditionalRenderingComponent.html b/force-app/main/default/lwc/conditionalRenderingComponent/conditionalRenderingComponent.html new file mode 100644 index 0000000..daafd4b --- /dev/null +++ b/force-app/main/default/lwc/conditionalRenderingComponent/conditionalRenderingComponent.html @@ -0,0 +1,25 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/conditionalRenderingComponent/conditionalRenderingComponent.js b/force-app/main/default/lwc/conditionalRenderingComponent/conditionalRenderingComponent.js new file mode 100644 index 0000000..1dc13b1 --- /dev/null +++ b/force-app/main/default/lwc/conditionalRenderingComponent/conditionalRenderingComponent.js @@ -0,0 +1,19 @@ +import { LightningElement } from 'lwc'; + +export default class ConditionalRenderingComponent extends LightningElement { + isVisible = false; + name + handleClick() { + this.isVisible = true; + } + handleInputChange(event){ + this.name = event.target.value; + } + get helloName(){ + return this.name === 'hello' + } + + //falsy Values + // 0,false,'',null,undefined + +} \ No newline at end of file diff --git a/force-app/main/default/lwc/conditionalRenderingComponent/conditionalRenderingComponent.js-meta.xml b/force-app/main/default/lwc/conditionalRenderingComponent/conditionalRenderingComponent.js-meta.xml new file mode 100644 index 0000000..09b9c8d --- /dev/null +++ b/force-app/main/default/lwc/conditionalRenderingComponent/conditionalRenderingComponent.js-meta.xml @@ -0,0 +1,9 @@ + + + 59.0 + true + + lightning__AppPage + lightning__HomePage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/connectedCallBack/connectedCallBack.html b/force-app/main/default/lwc/connectedCallBack/connectedCallBack.html new file mode 100644 index 0000000..760a24f --- /dev/null +++ b/force-app/main/default/lwc/connectedCallBack/connectedCallBack.html @@ -0,0 +1,17 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/connectedCallBack/connectedCallBack.js b/force-app/main/default/lwc/connectedCallBack/connectedCallBack.js new file mode 100644 index 0000000..9be191c --- /dev/null +++ b/force-app/main/default/lwc/connectedCallBack/connectedCallBack.js @@ -0,0 +1,16 @@ +import { LightningElement } from 'lwc'; +export default class App extends LightningElement { + name = 'Electra X4'; + description = 'A sweet bike built for comfort.'; + category = 'Mountain'; + material = 'Steel'; + price = '$2,700'; + time=10000; + pictureUrl = 'https://s3-us-west-1.amazonaws.com/sfdc-demo/ebikes/electrax4.jpg'; + ready = false; + connectedCallback() { + setTimeout(() => { + this.ready = true; + }, this.time); + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/connectedCallBack/connectedCallBack.js-meta.xml b/force-app/main/default/lwc/connectedCallBack/connectedCallBack.js-meta.xml new file mode 100644 index 0000000..5fecdd0 --- /dev/null +++ b/force-app/main/default/lwc/connectedCallBack/connectedCallBack.js-meta.xml @@ -0,0 +1,8 @@ + + + 58.0 + true + + lightning__HomePage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/createContact/createContact.css b/force-app/main/default/lwc/createContact/createContact.css new file mode 100644 index 0000000..5db389e --- /dev/null +++ b/force-app/main/default/lwc/createContact/createContact.css @@ -0,0 +1,3 @@ +.custom-background { + background-color: rgb(251, 238, 193); +} \ No newline at end of file diff --git a/force-app/main/default/lwc/createContact/createContact.html b/force-app/main/default/lwc/createContact/createContact.html new file mode 100644 index 0000000..178b8b9 --- /dev/null +++ b/force-app/main/default/lwc/createContact/createContact.html @@ -0,0 +1,21 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/createContact/createContact.js b/force-app/main/default/lwc/createContact/createContact.js new file mode 100644 index 0000000..1124e8b --- /dev/null +++ b/force-app/main/default/lwc/createContact/createContact.js @@ -0,0 +1,51 @@ +import { LightningElement, track } from 'lwc'; +import { ShowToastEvent } from 'lightning/platformShowToastEvent'; +import createContact from '@salesforce/apex/ContactCreator.createContact'; + +export default class CreateContact extends LightningElement { + @track contact = { + fname: '', + lname: '', + email: '' + }; + + handleChange(event) { + const field = event.target.name; + this.contact[field] = event.target.value; + } + + handleSave() { + const { fname, lname, email } = this.contact; + console.log('debug',this.contact); + if(!fname || !lname || !email) { + this.showToast('Error', 'First Name, Last Name and Email cannot be empty', 'error'); + } else { + createContact({ fname, lname, email }) + .then(result => { + this.resetContact(); + this.showToast('Success', 'Contact created', 'success'); + }) + .catch(error => { + this.showToast('Error creating record', 'A contact with this email already exists', 'error'); + }); + } + } + + showToast(title, message, variant) { + this.dispatchEvent( + new ShowToastEvent({ + title, + message, + variant + }) + ); + } + + resetContact() { + this.contact = { + fname: '', + lname: '', + email: '' + }; + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/createContact/createContact.js-meta.xml b/force-app/main/default/lwc/createContact/createContact.js-meta.xml new file mode 100644 index 0000000..e94cf53 --- /dev/null +++ b/force-app/main/default/lwc/createContact/createContact.js-meta.xml @@ -0,0 +1,10 @@ + + + 59.0 + true + + lightning__HomePage + lightningCommunity__Page + lightningCommunity__Default + + \ No newline at end of file diff --git a/force-app/main/default/lwc/createCustomPhotoUploader/createCustomPhotoUploader.css b/force-app/main/default/lwc/createCustomPhotoUploader/createCustomPhotoUploader.css new file mode 100644 index 0000000..7ac40ca --- /dev/null +++ b/force-app/main/default/lwc/createCustomPhotoUploader/createCustomPhotoUploader.css @@ -0,0 +1,77 @@ +/* myComponent.css */ +.image-container { + position: relative; + display: inline-block; +} + +.image { + height: 100px; + width: 100px; + border-radius:100px; + display: block; +} +.card-image{ + display: flex; + justify-content: center; + align-items: center; + height: 100%; +} +.overlay-icon-1{ + position: absolute; + top: -4px; + right: 12px; +} + +.overlay-icon { + position: absolute; + bottom: 2px; + right: 10px; +} + +.dropdown-content { + display: none; + position: absolute; + background-color: #f9f9f9; + min-width: 160px; + box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); +} + + +.dropdown-content p { + padding: 3px 4px; + cursor: pointer; +} + +.dropdown-content p:hover { + background-color: #ddd; /* Change the background color of each item when hovering over it */ +} + +.overlay-icon:hover .dropdown-content { + display: block; +} +.removeImage { + border-radius: 50%; + padding: 0px 4px; + margin: 8px 2px 8px 8px; + color: #fff; + background-color: #9f201b; + cursor: pointer; +} + /* for preview */ + .image-preview-container { + width: 50%; + margin: 0 auto; + border: 1px solid rgba(0, 0, 0, 0.1); + padding: 3rem; + border-radius: 20px; +} + +.image-preview-container img { + width: 100%; + display: none; + margin-bottom: 30px; +} +.custom-close-button { + --sds-c-icon-size-m: 2rem; /* Adjust the size */ + font-weight: bold; /* Make it bold */ +} \ No newline at end of file diff --git a/force-app/main/default/lwc/createCustomPhotoUploader/createCustomPhotoUploader.html b/force-app/main/default/lwc/createCustomPhotoUploader/createCustomPhotoUploader.html new file mode 100644 index 0000000..cb90020 --- /dev/null +++ b/force-app/main/default/lwc/createCustomPhotoUploader/createCustomPhotoUploader.html @@ -0,0 +1,259 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/createCustomPhotoUploader/createCustomPhotoUploader.js b/force-app/main/default/lwc/createCustomPhotoUploader/createCustomPhotoUploader.js new file mode 100644 index 0000000..7b008c1 --- /dev/null +++ b/force-app/main/default/lwc/createCustomPhotoUploader/createCustomPhotoUploader.js @@ -0,0 +1,161 @@ +import { LightningElement,api,track,wire} from 'lwc'; +import uploadFile from '@salesforce/apex/FileUploadService.uploadFile'; +import deletefile from '@salesforce/apex/FileUploadService.deletefile'; +import { ShowToastEvent } from 'lightning/platformShowToastEvent'; +import { refreshApex } from '@salesforce/apex'; +import { getRecord, getFieldValue } from 'lightning/uiRecordApi'; + +// Import the reference to the fields that you wish to display +import ProfileUrl__c_FIELD from '@salesforce/schema/Friend__c.ProfileUrl__c'; + +export default class CreateCustomPhotoUploader extends LightningElement { + + fields = [ProfileUrl__c_FIELD]; + uploadPhotoPrompt = false; + showPhotoPrompt=false; + deletePhotoPrompt=false; + Contentv; + @api recordId; + fileData; + imageUrl; + spinner=false; + isphoto=false; + + @wire(getRecord, { recordId: '$recordId', fields: [ProfileUrl__c_FIELD] }) + wiredRecord({ error, data }) { + if (data) { + this.imageUrl = getFieldValue(data, ProfileUrl__c_FIELD); + } else if (error) { + console.error('Error getting record', error); + } + } + renderedCallback() { + console.log('Img url:',this.imageUrl); + if(this.imageUrl!=null){ + let url = new URL(this.imageUrl); + let params = new URLSearchParams(url.search); + this.Contentv= params.get('versionId'); + console.log('@@@ Content iddddd',this.Contentv); + } + + } + UploadFilechange(event) { + const file = event.target.files[0]; + const fileType = file.type; + const acceptedFormats = ['image/png', 'image/jpeg']; + if (!acceptedFormats.includes(fileType)) { + // Show an error message and return + this.dispatchEvent( + new ShowToastEvent({ + title: 'Error', + message: 'Invalid file type. Please upload a .png or .jpeg file.', + variant: 'error', + }), + ); + return; + + } + var reader = new FileReader(); + reader.onload = () => { + var base64 = reader.result.split(',')[1]; + this.fileData = { + 'filename': file.name, + 'base64': base64, + 'recordId': this.recordId + } + console.log(this.fileData); + } + reader.readAsDataURL(file); + } + + handleClick(){ + if(this.fileData==null){ + console.log('inside click if'); + this.dispatchEvent( + new ShowToastEvent({ + title: 'Error', + message: 'Please Choose Photo!', + variant: 'error', + }), + ); + }else if(this.fileData != null){ + this.spinner = true; + console.log('inside else'); + const {base64, filename, recordId} = this.fileData; + uploadFile({ base64, filename, recordId }) + .then(result=>{ + if(result){ + this.imageUrl = result; + // window.localStorage.setItem('imageUrl', this.imageUrl) + this.isphoto=true; + this.dispatchEvent( + new ShowToastEvent({ + title:`${filename} uploaded successfully!!`, + variant: 'success', + }), + ); + console.log('image url:',this.imageUrl); + let url = new URL(this.imageUrl); + let params = new URLSearchParams(url.search); + this.Contentv= params.get('versionId'); + console.log('@@@ Content iddddd',this.Contentv); + // Hide the spinner after 2.5 seconds + setTimeout(() => { + this.spinner = false; + }, 2500); + this.fileData = null + this.hidePrompt(); + }else if(error){ + console.log(error); + } + }) + } + } + + removeReceiptImage(){ + this.fileData=null; + } + + showPrompt() { + this.uploadPhotoPrompt = true; + } + hidePrompt() { + this.uploadPhotoPrompt = false; + this.showPhotoPrompt= false; + this.fileData=null; + this.deletePhotoPrompt=false; + + } + showPhoto() { + this.showPhotoPrompt=true; + + } + uploadPhoto() { + + this.uploadPhotoPrompt=true; + } + deletePhoto(){ + this.deletePhotoPrompt=true; + } + + handleDelete(){ + deletefile({Contentv: this.Contentv,recordid:this.recordId}) + .then(result=>{ + if(result){ + this.dispatchEvent( + new ShowToastEvent({ + title:result, + variant: 'success', + }), + ); + setTimeout(() => { + this.spinner = false; + }, 2500); + this.isphoto=false; + this.hidePrompt(); + } + + }) + } + + } \ No newline at end of file diff --git a/force-app/main/default/lwc/createCustomPhotoUploader/createCustomPhotoUploader.js-meta.xml b/force-app/main/default/lwc/createCustomPhotoUploader/createCustomPhotoUploader.js-meta.xml new file mode 100644 index 0000000..fa684e5 --- /dev/null +++ b/force-app/main/default/lwc/createCustomPhotoUploader/createCustomPhotoUploader.js-meta.xml @@ -0,0 +1,8 @@ + + + 58.0 + true + + lightning__RecordPage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/createRecordWithoutApex/createRecordWithoutApex.html b/force-app/main/default/lwc/createRecordWithoutApex/createRecordWithoutApex.html new file mode 100644 index 0000000..36aeb75 --- /dev/null +++ b/force-app/main/default/lwc/createRecordWithoutApex/createRecordWithoutApex.html @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/createRecordWithoutApex/createRecordWithoutApex.js b/force-app/main/default/lwc/createRecordWithoutApex/createRecordWithoutApex.js new file mode 100644 index 0000000..c173115 --- /dev/null +++ b/force-app/main/default/lwc/createRecordWithoutApex/createRecordWithoutApex.js @@ -0,0 +1,56 @@ +import { LightningElement } from 'lwc'; // Importing necessary modules from LWC +import { createRecord } from 'lightning/uiRecordApi'; // Importing createRecord from uiRecordApi to create a new record +import ACCOUNT_OBJECT from '@salesforce/schema/Account'; // Importing Account object from Salesforce schema +import { ShowToastEvent } from 'lightning/platformShowToastEvent'; // Importing ShowToastEvent to display toast messages +import NAME_FIELD from '@salesforce/schema/Account.Name'; // Importing Name field from Account object in Salesforce schema +import matchNameMethod from '@salesforce/apex/MatchName.matchNameMethod'; // Importing Apex method to check for matching account names + +export default class CreateRecordWithoutApex extends LightningElement { + Name = ''; // Variable to hold the name value entered in the LWC + + // Function to handle the change in name input field value + handleNameChange(event) { + this.Name = event.target.value; // Updating the Name variable with the entered value + } + + // Function to handle account creation + async handleCreateAccount() { + const fields = {}; + fields[NAME_FIELD.fieldApiName] = this.Name; // Setting the Name field with the entered value + const recordInput = { apiName: ACCOUNT_OBJECT.objectApiName, fields }; // Preparing the record input for account creation + + try { + const matchName = await matchNameMethod({ acName: this.Name }); // Checking if a matching account name exists + if (!matchName) { // If no matching account name exists, create a new account record + const account = await createRecord(recordInput); + this.showSuccessToast(); // Show success toast message after account creation + window.location.reload(); // Reload the window to reflect the changes + } else { + this.failToast(); // If a matching account name exists, show failure toast message + window.location.reload(); // Reload the window to reflect the changes + } + } catch (error) { + console.error(error); // Log any errors encountered during the process + } + } + + showSuccessToast() { // Function to display success toast message + const event = new ShowToastEvent({ + label: 'Record Created', + message: 'Congratulations!!! You have Created Record', + variant: 'success', + mode: 'dismissable', + }); + this.dispatchEvent(event); // Dispatching the toast event + } + + failToast() { // Function to display failure toast message + const event = new ShowToastEvent({ + label: 'Record Creation failed', + message: 'Failed!! Duplicate Name Found!!! Try With Different Name', + variant: 'error', + mode: 'dismissable', + }); + this.dispatchEvent(event); // Dispatching the toast event + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/createRecordWithoutApex/createRecordWithoutApex.js-meta.xml b/force-app/main/default/lwc/createRecordWithoutApex/createRecordWithoutApex.js-meta.xml new file mode 100644 index 0000000..5fecdd0 --- /dev/null +++ b/force-app/main/default/lwc/createRecordWithoutApex/createRecordWithoutApex.js-meta.xml @@ -0,0 +1,8 @@ + + + 58.0 + true + + lightning__HomePage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/creatingCustomPhotoUploader/creatingCustomPhotoUploader.html b/force-app/main/default/lwc/creatingCustomPhotoUploader/creatingCustomPhotoUploader.html new file mode 100644 index 0000000..0e9530c --- /dev/null +++ b/force-app/main/default/lwc/creatingCustomPhotoUploader/creatingCustomPhotoUploader.html @@ -0,0 +1,36 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/creatingCustomPhotoUploader/creatingCustomPhotoUploader.js b/force-app/main/default/lwc/creatingCustomPhotoUploader/creatingCustomPhotoUploader.js new file mode 100644 index 0000000..c9f86a6 --- /dev/null +++ b/force-app/main/default/lwc/creatingCustomPhotoUploader/creatingCustomPhotoUploader.js @@ -0,0 +1,166 @@ +import { LightningElement, api,track } from 'lwc'; +import { ShowToastEvent } from 'lightning/platformShowToastEvent'; +import LightningPrompt from 'lightning/prompt'; +import uploadFile from '@salesforce/apex/FileUploadService.uploadFile' +import { FlowAttributeChangeEvent, FlowNavigationNextEvent } from 'lightning/flowSupport'; +export default class creatingCustomPhotoUploader extends LightningElement { + @api recordId; + fileData + UploadFilechange(event) { + const file = event.target.files[0]; + const fileType = file.type; + const acceptedFormats = ['image/png', 'image/jpeg']; + + if (!acceptedFormats.includes(fileType)) { + // Show an error message and return + this.dispatchEvent( + new ShowToastEvent({ + title: 'Error', + message: 'Invalid file type. Please upload a .png or .jpeg file.', + variant: 'error', + }), + ); + return; + } + + var reader = new FileReader(); + reader.onload = () => { + var base64 = reader.result.split(',')[1]; + this.fileData = { + 'filename': file.name, + 'base64': base64, + 'recordId': this.recordId + } + console.log(this.fileData); + } + reader.readAsDataURL(file); + } + + + handleClick(){ + const {base64, filename, recordId} = this.fileData + uploadFile({ base64, filename, recordId }).then(result=>{ + this.fileData = null + let title = `${filename} uploaded successfully!!` + this.toast(title) + }) + } + + toast(title){ + const toastEvent = new ShowToastEvent({ + title, + variant:"success" + }) + this.dispatchEvent(toastEvent) + } + notify() + { + //Ask question using Prompt + this.template.querySelector('c-common-notification').notify('prompt', 'What is your Email?','header','Notification','info'); + } + + + @api notificationType; + @api message; + @api variant; + @api header; + @api colorTheme; + @api value; + @api isCallerFlow=false; + @api autoCloseTime = 5000; + @track showToastBar=false; + connectedCallback() + { + //If Flow then show modal when screen is shown + if(this.isCallerFlow==true) + { + this.showNotification(); + } + } + showNotification() + { + if(this.notificationType=='Confirm') + { + this.handleConfirm(); + } + else if(this.notificationType=='Prompt') + { + this.handlePrompt(); + } + else if(this.notificationType=='Alert') + { + this.handleAlert(); + } + else if(this.notificationType=='Toast') + { + this.handleToast(); + } + } + + @api + notify(type, message,variant,header,theme) { + this.notificationType = type; + this.message = message; + this.variant=variant; + this.header=header; + this.colorTheme = theme; + this.showNotification(); + } + + handlePrompt(){ + LightningPrompt.open({ + message: this.message, + theme: this.colorTheme, + label: this.header, + variant: this.variant, + defaultValue: '', + }).then((result) => { + this.value=result; + const selectedEvent = new CustomEvent('selection', { detail: result }); + // Dispatches the event + this.dispatchEvent(selectedEvent); + + if(this.isCallerFlow==true) + { + const attributeChangeEvent = new FlowAttributeChangeEvent( + 'value',result); + this.dispatchEvent(attributeChangeEvent); + + var navigationEvent = new FlowNavigationNextEvent(); + this.dispatchEvent(navigationEvent); + } + }); + } + + + + //Toast Section + closeModel() { + this.showToastBar = false; + if(this.isCallerFlow==true) + { + var navigationEvent = new FlowNavigationNextEvent(); + this.dispatchEvent(navigationEvent); + } + } + + get getIconName() { + return 'utility:' + this.colorTheme; + } + + get innerClass() { + return 'slds-icon_container slds-icon-utility-' + this.colorTheme + ' slds-icon-utility-success slds-m-right_small slds-no-flex slds-align-top'; + } + + get outerClass() { + return 'slds-notify slds-notify_toast slds-theme_' + this.colorTheme; + } + + handleToast(){ + var that=this; + that.showToastBar = true; + setTimeout(() => { + that.closeModel(); + }, that.autoCloseTime); + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/creatingCustomPhotoUploader/creatingCustomPhotoUploader.js-meta.xml b/force-app/main/default/lwc/creatingCustomPhotoUploader/creatingCustomPhotoUploader.js-meta.xml new file mode 100644 index 0000000..060a2d1 --- /dev/null +++ b/force-app/main/default/lwc/creatingCustomPhotoUploader/creatingCustomPhotoUploader.js-meta.xml @@ -0,0 +1,26 @@ + + + 56.0 + true + Notification + + lightning__RecordAction + lightning__HomePage + lightning__RecordPage + lightning__AppPage + lightning__Tab + lightning__FlowScreen + + + + + + + + + + + + + + \ No newline at end of file diff --git a/force-app/main/default/lwc/customFooterFlowComponent/customFooterFlowComponent.html b/force-app/main/default/lwc/customFooterFlowComponent/customFooterFlowComponent.html new file mode 100644 index 0000000..17ff6b5 --- /dev/null +++ b/force-app/main/default/lwc/customFooterFlowComponent/customFooterFlowComponent.html @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/customFooterFlowComponent/customFooterFlowComponent.js b/force-app/main/default/lwc/customFooterFlowComponent/customFooterFlowComponent.js new file mode 100644 index 0000000..357eef1 --- /dev/null +++ b/force-app/main/default/lwc/customFooterFlowComponent/customFooterFlowComponent.js @@ -0,0 +1,37 @@ +import { LightningElement, api } from 'lwc'; +import { FlowAttributeChangeEvent, FlowNavigationBackEvent, FlowNavigationNextEvent} from 'lightning/flowSupport'; + +/*FlowAttributeChangeEvent — Informs the runtime that a component property has changed. +FlowNavigationBackEvent — Requests navigation to the previous screen. +FlowNavigationNextEvent — Requests navigation to the next screen. +FlowNavigationFinishEvent — Requests the flow runtime to terminate the flow.*/ + +export default class CustomFooterFlowComponent extends LightningElement { + + @api btnName; + + handleSaveData(event){ + + if(event.target.name === 'Save as Draft'){ + this.btnName = event.target.name; + console.log('btn name: ',this.btnName); + const attributeChangeEvent = new FlowAttributeChangeEvent('btnName', this.btnName); + this.dispatchEvent(attributeChangeEvent); + } + else if(event.target.name === 'Send Checklists'){ + this.btnName = event.target.name; + console.log('btn name: ',this.btnName); + const attributeChangeEvent = new FlowAttributeChangeEvent('btnName', this.btnName); + this.dispatchEvent(attributeChangeEvent); + } + const navigateNextEvent = new FlowNavigationNextEvent(); + this.dispatchEvent(navigateNextEvent); + } + + handleGoBack(){ + // navigate to the back screen + const navigateBackEvent = new FlowNavigationBackEvent(); + this.dispatchEvent(navigateBackEvent); + } + +} \ No newline at end of file diff --git a/force-app/main/default/lwc/customFooterFlowComponent/customFooterFlowComponent.js-meta.xml b/force-app/main/default/lwc/customFooterFlowComponent/customFooterFlowComponent.js-meta.xml new file mode 100644 index 0000000..77d0b50 --- /dev/null +++ b/force-app/main/default/lwc/customFooterFlowComponent/customFooterFlowComponent.js-meta.xml @@ -0,0 +1,13 @@ + + + 59.0 + true + + lightning__FlowScreen + + + + + + + \ No newline at end of file diff --git a/force-app/main/default/lwc/customLookup/customLookup.html b/force-app/main/default/lwc/customLookup/customLookup.html new file mode 100644 index 0000000..3225ad7 --- /dev/null +++ b/force-app/main/default/lwc/customLookup/customLookup.html @@ -0,0 +1,15 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/customLookup/customLookup.js b/force-app/main/default/lwc/customLookup/customLookup.js new file mode 100644 index 0000000..ca98479 --- /dev/null +++ b/force-app/main/default/lwc/customLookup/customLookup.js @@ -0,0 +1,31 @@ +import { LightningElement,wire } from 'lwc'; +import findAccounts from '@salesforce/apex/AccountController.findAccounts'; + +export default class customLookup extends LightningElement { + value = ''; + resultObj = []; // Declare an object to store the result + + handleOnChange(event){ + this.value = event.target.value; + console.log(this.value); + findAccounts({searchKey: this.value}) + .then(result => { + this.resultObj = result; // Store the result in the object + console.log("Printing reslt ",this.resultObj); // Log the object + }) + .catch(error => { + console.error(error); + }); + } + handleMouseOver(event) { + const recordId = event.currentTarget.dataset.id; + const record = this.resultObj.find(rec => rec.Id === recordId); + record.showCard = true; + } + + handleMouseOut(event) { + const recordId = event.currentTarget.dataset.id; + const record = this.resultObj.find(rec => rec.Id === recordId); + record.showCard = false; + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/customLookup/customLookup.js-meta.xml b/force-app/main/default/lwc/customLookup/customLookup.js-meta.xml new file mode 100644 index 0000000..fa684e5 --- /dev/null +++ b/force-app/main/default/lwc/customLookup/customLookup.js-meta.xml @@ -0,0 +1,8 @@ + + + 58.0 + true + + lightning__RecordPage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/dOEComponent/dOEComponent.css b/force-app/main/default/lwc/dOEComponent/dOEComponent.css new file mode 100644 index 0000000..5cddbc0 --- /dev/null +++ b/force-app/main/default/lwc/dOEComponent/dOEComponent.css @@ -0,0 +1,33 @@ +/* .custom-button { + height: 120px; + width: 250px; + display: flex; + color: #022160; + align-items: center; + justify-content: center; + text-align: center; + padding: 10px; + border-radius: 10px; + box-shadow: 0 2px 4px rgba(0,0,0,0.2); + cursor: pointer; + background-color: #ffffff + }*/ + svg { + fill: blue; + } + + .custom-button { + height: 120px; /* Adjust based on your design needs */ + width: 250px; /* Adjust based on your design needs */ + display: flex; + color: #022160; + align-items: center; + justify-content: center; + text-align: center; + padding: 10px; + border-radius: 10px; /* Optional for rounded corners */ + box-shadow: 0 2px 4px rgba(0,0,0,0.2); /* Optional for shadow effect */ + cursor: pointer; + background-color: #ffffff; + margin: 10px; /* Add this line */ +} \ No newline at end of file diff --git a/force-app/main/default/lwc/dOEComponent/dOEComponent.html b/force-app/main/default/lwc/dOEComponent/dOEComponent.html new file mode 100644 index 0000000..23646a6 --- /dev/null +++ b/force-app/main/default/lwc/dOEComponent/dOEComponent.html @@ -0,0 +1,58 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/dOEComponent/dOEComponent.js b/force-app/main/default/lwc/dOEComponent/dOEComponent.js new file mode 100644 index 0000000..41007bb --- /dev/null +++ b/force-app/main/default/lwc/dOEComponent/dOEComponent.js @@ -0,0 +1,7 @@ +import { LightningElement } from 'lwc'; + +export default class DOEComponent extends LightningElement { + handleclick(){ + console.log('clicked'); + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/dOEComponent/dOEComponent.js-meta.xml b/force-app/main/default/lwc/dOEComponent/dOEComponent.js-meta.xml new file mode 100644 index 0000000..1688b73 --- /dev/null +++ b/force-app/main/default/lwc/dOEComponent/dOEComponent.js-meta.xml @@ -0,0 +1,10 @@ + + + 59.0 + true + + lightning__AppPage + lightningCommunity__Default + lightningCommunity__Page + + \ No newline at end of file diff --git a/force-app/main/default/lwc/designSystemComponent/designSystemComponent.css b/force-app/main/default/lwc/designSystemComponent/designSystemComponent.css new file mode 100644 index 0000000..d471f2d --- /dev/null +++ b/force-app/main/default/lwc/designSystemComponent/designSystemComponent.css @@ -0,0 +1,4 @@ +.designTokens{ + color: var(--lwc-brandAccessible); + background-color: var(--lwc-colorBackgroundAlt); +} \ No newline at end of file diff --git a/force-app/main/default/lwc/designSystemComponent/designSystemComponent.html b/force-app/main/default/lwc/designSystemComponent/designSystemComponent.html new file mode 100644 index 0000000..77eee6b --- /dev/null +++ b/force-app/main/default/lwc/designSystemComponent/designSystemComponent.html @@ -0,0 +1,22 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/designSystemComponent/designSystemComponent.js b/force-app/main/default/lwc/designSystemComponent/designSystemComponent.js new file mode 100644 index 0000000..efca777 --- /dev/null +++ b/force-app/main/default/lwc/designSystemComponent/designSystemComponent.js @@ -0,0 +1,3 @@ +import { LightningElement } from 'lwc'; + +export default class DesignSystemComponent extends LightningElement {} \ No newline at end of file diff --git a/force-app/main/default/lwc/designSystemComponent/designSystemComponent.js-meta.xml b/force-app/main/default/lwc/designSystemComponent/designSystemComponent.js-meta.xml new file mode 100644 index 0000000..011be21 --- /dev/null +++ b/force-app/main/default/lwc/designSystemComponent/designSystemComponent.js-meta.xml @@ -0,0 +1,8 @@ + + + 59.0 + true + + lightning__AppPage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/dynamicRecordPicker/dynamicRecordPicker.css b/force-app/main/default/lwc/dynamicRecordPicker/dynamicRecordPicker.css new file mode 100644 index 0000000..0507c98 --- /dev/null +++ b/force-app/main/default/lwc/dynamicRecordPicker/dynamicRecordPicker.css @@ -0,0 +1,15 @@ +.loading-container { + position: relative; +} + +.spinner-container { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + display: flex; + align-items: center; + justify-content: center; + background-color: rgba(255, 255, 255, 0.8); +} \ No newline at end of file diff --git a/force-app/main/default/lwc/dynamicRecordPicker/dynamicRecordPicker.html b/force-app/main/default/lwc/dynamicRecordPicker/dynamicRecordPicker.html new file mode 100644 index 0000000..bee4015 --- /dev/null +++ b/force-app/main/default/lwc/dynamicRecordPicker/dynamicRecordPicker.html @@ -0,0 +1,40 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/dynamicRecordPicker/dynamicRecordPicker.js b/force-app/main/default/lwc/dynamicRecordPicker/dynamicRecordPicker.js new file mode 100644 index 0000000..8a9a2dd --- /dev/null +++ b/force-app/main/default/lwc/dynamicRecordPicker/dynamicRecordPicker.js @@ -0,0 +1,45 @@ +import { LightningElement, wire, track } from 'lwc'; +import getAllObjects from '@salesforce/apex/GetAllObjects.getAllObjects'; + +export default class DynamicRecordPicker extends LightningElement { + @track targetObjects = []; + selectedTarget = ''; + currentSelectedRecordId = null; + @track isLoading = true; + + @track targetObjects = [ + { label: 'Account', value: 'Account' }, + { label: 'Contact', value: 'Contact' }, + { label: 'Lead', value: 'Lead' }, + { label: 'Opportunity', value: 'Opportunity' } + ]; + + @wire(getAllObjects) + wiredObjects({ error, data }) { + if (data) { + // this.targetObjects = data.map(obj => ({ label: obj, value: obj })); + // Set the selectedTarget to the first object in the list + if(this.targetObjects.length > 0) { + this.selectedTarget = this.targetObjects[0].value; + } + console.log('@@@data',this.targetObjects); + this.isLoading = false; + } else if (error) { + console.error(error); + this.isLoading = false; + } + } + + //To hide combobox + get showTargetSelector() { + return this.currentSelectedRecordId === null; + } + + handleTargetSelection(event) { + this.selectedTarget = event.target.value; + } + + handleRecordSelect(event) { + this.currentSelectedRecordId = event.detail.recordId; + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/dynamicRecordPicker/dynamicRecordPicker.js-meta.xml b/force-app/main/default/lwc/dynamicRecordPicker/dynamicRecordPicker.js-meta.xml new file mode 100644 index 0000000..5fecdd0 --- /dev/null +++ b/force-app/main/default/lwc/dynamicRecordPicker/dynamicRecordPicker.js-meta.xml @@ -0,0 +1,8 @@ + + + 58.0 + true + + lightning__HomePage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/fileupload/fileupload.html b/force-app/main/default/lwc/fileupload/fileupload.html new file mode 100644 index 0000000..54201f9 --- /dev/null +++ b/force-app/main/default/lwc/fileupload/fileupload.html @@ -0,0 +1,19 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/fileupload/fileupload.js b/force-app/main/default/lwc/fileupload/fileupload.js new file mode 100644 index 0000000..e2f5bb6 --- /dev/null +++ b/force-app/main/default/lwc/fileupload/fileupload.js @@ -0,0 +1,34 @@ +import { track } from 'lwc'; + +import BaseChatMessage from 'lightningsnapin/BaseChatMessage'; +const CHAT_CONTENT_CLASS = 'chat-content'; +const AGENT_USER_TYPE = 'agent'; +const CHASITOR_USER_TYPE = 'chasitor'; +const SUPPORTED_USER_TYPES = [AGENT_USER_TYPE, CHASITOR_USER_TYPE]; +const LWC_PREFIX = 'lwc:'; + +export default class fileupload extends BaseChatMessage { + + @track content = ''; + showNow=false; + showNoContent=false; + text = ''; // Declare 'text' variable + + connectedCallback() { + if(this.messageContent.value.startsWith(LWC_PREFIX)) { // Use the constant LWC_PREFIX + if(this.messageContent.value.split(':')[1]==="Yes") { // Use double quotes + this.showNow=true; + } else { + this.text='The file upload option is not available'; + this.showNoContent=true; + } + } else { + this.showNoContent=true; + this.text=this.messageContent.value; + } + } + + handleUploadFinished(event) { // Add 'event' parameter + const uploadedFiles = event.detail.files; + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/fileupload/fileupload.js-meta.xml b/force-app/main/default/lwc/fileupload/fileupload.js-meta.xml new file mode 100644 index 0000000..a48b7c9 --- /dev/null +++ b/force-app/main/default/lwc/fileupload/fileupload.js-meta.xml @@ -0,0 +1,8 @@ + + + 59.0 + true + + lightningSnapin__ChatMessage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/formLWC/formLWC.html b/force-app/main/default/lwc/formLWC/formLWC.html new file mode 100644 index 0000000..4e9b8a2 --- /dev/null +++ b/force-app/main/default/lwc/formLWC/formLWC.html @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/formLWC/formLWC.js b/force-app/main/default/lwc/formLWC/formLWC.js new file mode 100644 index 0000000..84ffd3b --- /dev/null +++ b/force-app/main/default/lwc/formLWC/formLWC.js @@ -0,0 +1,12 @@ +import { LightningElement, track } from 'lwc'; + +export default class ContactForm extends LightningElement { + @track firstName = ''; + @track lastName = ''; + @track email = ''; + + handleSubmit() { + // handle form submission logic here + window.print(); + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/formLWC/formLWC.js-meta.xml b/force-app/main/default/lwc/formLWC/formLWC.js-meta.xml new file mode 100644 index 0000000..56af8a8 --- /dev/null +++ b/force-app/main/default/lwc/formLWC/formLWC.js-meta.xml @@ -0,0 +1,9 @@ + + + 58.0 + true + + lightning__RecordPage + lightning__HomePage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/hello/hello.html b/force-app/main/default/lwc/hello/hello.html new file mode 100644 index 0000000..5eda547 --- /dev/null +++ b/force-app/main/default/lwc/hello/hello.html @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/hello/hello.js b/force-app/main/default/lwc/hello/hello.js new file mode 100644 index 0000000..9730436 --- /dev/null +++ b/force-app/main/default/lwc/hello/hello.js @@ -0,0 +1,5 @@ +import { LightningElement,api } from 'lwc'; + +export default class Hello extends LightningElement { + @api name = 'World'; +} \ No newline at end of file diff --git a/force-app/main/default/lwc/hello/hello.js-meta.xml b/force-app/main/default/lwc/hello/hello.js-meta.xml new file mode 100644 index 0000000..ccd127c --- /dev/null +++ b/force-app/main/default/lwc/hello/hello.js-meta.xml @@ -0,0 +1,10 @@ + + + 60.0 + true + + lightning__AppPage + lightning__RecordPage + lightning__HomePage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/helloWorld/helloWorld.html b/force-app/main/default/lwc/helloWorld/helloWorld.html new file mode 100644 index 0000000..1eb9d79 --- /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 100644 index 0000000..7bb04a1 --- /dev/null +++ b/force-app/main/default/lwc/helloWorld/helloWorld.js @@ -0,0 +1,7 @@ +import { LightningElement } from 'lwc'; +export default class helloWorld extends LightningElement { + 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 100644 index 0000000..0bc0653 --- /dev/null +++ b/force-app/main/default/lwc/helloWorld/helloWorld.js-meta.xml @@ -0,0 +1,10 @@ + + + 52.0 + true + + lightning__AppPage + lightning__RecordPage + lightning__HomePage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/helloWorldComponent/helloWorldComponent.html b/force-app/main/default/lwc/helloWorldComponent/helloWorldComponent.html new file mode 100644 index 0000000..b4e36bf --- /dev/null +++ b/force-app/main/default/lwc/helloWorldComponent/helloWorldComponent.html @@ -0,0 +1,27 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/helloWorldComponent/helloWorldComponent.js b/force-app/main/default/lwc/helloWorldComponent/helloWorldComponent.js new file mode 100644 index 0000000..ad0ae35 --- /dev/null +++ b/force-app/main/default/lwc/helloWorldComponent/helloWorldComponent.js @@ -0,0 +1,42 @@ +import { LightningElement,track } from 'lwc'; + +export default class HelloWorldComponent extends LightningElement { + + // Learning Data Binding + + fullName = 'Jonathan Fox' + title = 'Software Engineer' + //change Title + changeTitle(event){ + this.title = event.target.value; + } + + //Learning @track decorator + + @track address = { + city : 'San Francisco', + postcode : 94105, + state : 'CA', + country : 'USA' + } + myArray = ['a','b','c'] + + + trackhandler(event){ + this.address.city = event.target.value + // if not using @track + // this.address = {...this.address, "city": event.target.value} + } + + //Learning Getter + users = ['John','Jane','Jack'] + num1 = 10 + num2 = 20 + get firstuser(){ + return this.users[0] + + } + get sum(){ + return this.num1 + this.num2 + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/helloWorldComponent/helloWorldComponent.js-meta.xml b/force-app/main/default/lwc/helloWorldComponent/helloWorldComponent.js-meta.xml new file mode 100644 index 0000000..09b9c8d --- /dev/null +++ b/force-app/main/default/lwc/helloWorldComponent/helloWorldComponent.js-meta.xml @@ -0,0 +1,9 @@ + + + 59.0 + true + + lightning__AppPage + lightning__HomePage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/lifeCycleHooksChildComponent/lifeCycleHooksChildComponent.html b/force-app/main/default/lwc/lifeCycleHooksChildComponent/lifeCycleHooksChildComponent.html new file mode 100644 index 0000000..2c4f06a --- /dev/null +++ b/force-app/main/default/lwc/lifeCycleHooksChildComponent/lifeCycleHooksChildComponent.html @@ -0,0 +1,8 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/lifeCycleHooksChildComponent/lifeCycleHooksChildComponent.js b/force-app/main/default/lwc/lifeCycleHooksChildComponent/lifeCycleHooksChildComponent.js new file mode 100644 index 0000000..74db91b --- /dev/null +++ b/force-app/main/default/lwc/lifeCycleHooksChildComponent/lifeCycleHooksChildComponent.js @@ -0,0 +1,18 @@ +import { LightningElement } from 'lwc'; + +export default class LifeCycleHooksChildComponent extends LightningElement { + constructor(){ + super() + console.log('Child Constructor Called'); + } + connectedCallback(){ + console.log('Child Connected callback Called'); + throw new Error ("Loading of child compoent is failed") + } + renderedCallback(){ + console.log('Child Rendered Callback Called'); + } + disconnectedCallback(){ + alert('Child disconnected Callback Called'); + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/lifeCycleHooksChildComponent/lifeCycleHooksChildComponent.js-meta.xml b/force-app/main/default/lwc/lifeCycleHooksChildComponent/lifeCycleHooksChildComponent.js-meta.xml new file mode 100644 index 0000000..6127d85 --- /dev/null +++ b/force-app/main/default/lwc/lifeCycleHooksChildComponent/lifeCycleHooksChildComponent.js-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + false + \ No newline at end of file diff --git a/force-app/main/default/lwc/lifeCycleHooksParentComponent/lifeCycleHooksParentComponent.html b/force-app/main/default/lwc/lifeCycleHooksParentComponent/lifeCycleHooksParentComponent.html new file mode 100644 index 0000000..f5921e2 --- /dev/null +++ b/force-app/main/default/lwc/lifeCycleHooksParentComponent/lifeCycleHooksParentComponent.html @@ -0,0 +1,24 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/lifeCycleHooksParentComponent/lifeCycleHooksParentComponent.js b/force-app/main/default/lwc/lifeCycleHooksParentComponent/lifeCycleHooksParentComponent.js new file mode 100644 index 0000000..bf31abb --- /dev/null +++ b/force-app/main/default/lwc/lifeCycleHooksParentComponent/lifeCycleHooksParentComponent.js @@ -0,0 +1,25 @@ +import { LightningElement } from 'lwc'; + +export default class LifeCycleHooksParentComponent extends LightningElement { + isChildVisible = false + constructor(){ + super() + console.log('Parent Constructor Called'); + } + connectedCallback(){ + console.log('Parent Connected callback Called'); + } + renderedCallback(){ + console.log('Parent Rendered Callback Called'); + } + errorCallback(err,stack){ + console.log('Error',err.message); + console.log('Stack',stack); + } + + handleClick(){ + this.isChildVisible = !this.isChildVisible; + + } + +} \ No newline at end of file diff --git a/force-app/main/default/lwc/lifeCycleHooksParentComponent/lifeCycleHooksParentComponent.js-meta.xml b/force-app/main/default/lwc/lifeCycleHooksParentComponent/lifeCycleHooksParentComponent.js-meta.xml new file mode 100644 index 0000000..011be21 --- /dev/null +++ b/force-app/main/default/lwc/lifeCycleHooksParentComponent/lifeCycleHooksParentComponent.js-meta.xml @@ -0,0 +1,8 @@ + + + 59.0 + true + + lightning__AppPage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/lightningDatatableLWCExample/lightningDatatableLWCExample.html b/force-app/main/default/lwc/lightningDatatableLWCExample/lightningDatatableLWCExample.html new file mode 100644 index 0000000..d562419 --- /dev/null +++ b/force-app/main/default/lwc/lightningDatatableLWCExample/lightningDatatableLWCExample.html @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/lightningDatatableLWCExample/lightningDatatableLWCExample.js b/force-app/main/default/lwc/lightningDatatableLWCExample/lightningDatatableLWCExample.js new file mode 100644 index 0000000..b029171 --- /dev/null +++ b/force-app/main/default/lwc/lightningDatatableLWCExample/lightningDatatableLWCExample.js @@ -0,0 +1,48 @@ +import { LightningElement, wire, track,api } from 'lwc'; +import { NavigationMixin } from 'lightning/navigation'; +import getAccounts from '@salesforce/apex/MyAccounts.getAccounts'; + + +export default class LightningDatatableLWCExample extends NavigationMixin(LightningElement) { + @track columns = [ + { + label: 'Account Name', + fieldName: 'Name', + type: 'text', + sortable: true + }, + { + label: 'Phone', + fieldName: 'Phone', + type: 'phone', + sortable: true + } + ]; + + @track error; + @track data; + + @wire(getAccounts) + wiredAccounts({ error, data }) { + if (data) { + this.data = data; + } else if (error) { + this.error = error; + } + } + + handleRowAction(event) { + const selectedRecord =event.detail.row.Id; + console.log('@@@@@@ getting selected id: '+selectedRecord); + + this[NavigationMixin.Navigate]({ + type: 'standard__recordPage', + attributes: { + recordId: selectedRecord, + objectApiName: 'Account', + actionName: 'view' + } + }); + } + +} \ No newline at end of file diff --git a/force-app/main/default/lwc/lightningDatatableLWCExample/lightningDatatableLWCExample.js-meta.xml b/force-app/main/default/lwc/lightningDatatableLWCExample/lightningDatatableLWCExample.js-meta.xml new file mode 100644 index 0000000..b216d10 --- /dev/null +++ b/force-app/main/default/lwc/lightningDatatableLWCExample/lightningDatatableLWCExample.js-meta.xml @@ -0,0 +1,10 @@ + + + 57.0 + true + + lightning__AppPage + lightning__RecordPage + lightning__HomePage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/lms/lms.html b/force-app/main/default/lwc/lms/lms.html new file mode 100644 index 0000000..f379f42 --- /dev/null +++ b/force-app/main/default/lwc/lms/lms.html @@ -0,0 +1,6 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/lms/lms.js b/force-app/main/default/lwc/lms/lms.js new file mode 100644 index 0000000..aa22f94 --- /dev/null +++ b/force-app/main/default/lwc/lms/lms.js @@ -0,0 +1,22 @@ +import { LightningElement,wire } from 'lwc'; +import { subscribe, MessageContext } from 'lightning/messageService'; +import COUNTER_UPDATED_CHANNEL from '@salesforce/messageChannel/CounterUpdated__c'; + +export default class Lms extends LightningElement { + @wire(MessageContext) + messageContext; + + connectedCallback() { + this.subscription = subscribe( + this.messageContext, + COUNTER_UPDATED_CHANNEL, + (message) => { + this.updateCounter(message.counterValue); + } + ); + } + updateCounter(counterValue) { + this.counterValue = counterValue; + } + +} \ No newline at end of file diff --git a/force-app/main/default/lwc/lms/lms.js-meta.xml b/force-app/main/default/lwc/lms/lms.js-meta.xml new file mode 100644 index 0000000..9fa43f2 --- /dev/null +++ b/force-app/main/default/lwc/lms/lms.js-meta.xml @@ -0,0 +1,9 @@ + + + 59.0 + true + + lightning__HomePage + lightning__RecordPage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/locationViwer/locationViwer.html b/force-app/main/default/lwc/locationViwer/locationViwer.html new file mode 100644 index 0000000..1e7a253 --- /dev/null +++ b/force-app/main/default/lwc/locationViwer/locationViwer.html @@ -0,0 +1,8 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/locationViwer/locationViwer.js b/force-app/main/default/lwc/locationViwer/locationViwer.js new file mode 100644 index 0000000..f52bd3a --- /dev/null +++ b/force-app/main/default/lwc/locationViwer/locationViwer.js @@ -0,0 +1,37 @@ +// Import necessary modules from the lwc library and the getFriendLocation Apex class +import { LightningElement, api, track } from 'lwc'; +import getLoacation from '@salesforce/apex/getFriendLocation.getLoacation'; + +// Define the LocationViwer class which extends the LightningElement base class +export default class LocationViwer extends LightningElement { + @api recordId; // Public property to hold the record ID + @track CityOfFriend; // Tracked property to hold the friend's city + error; // Property to hold any errors + mapMarkers; // Property to hold the map markers + + // Lifecycle hook which fires when a component is inserted into the DOM + connectedCallback(){ + console.log('Record id:', this.recordId); // Log the record ID + + // Call the getLoacation function from the Apex class with the record ID as a parameter + getLoacation({rcId: this.recordId}) + .then(result => { // Handle the Promise resolution + console.log(result); // Log the result + this.CityOfFriend = result[0].Home_Town__c; // Assign the friend's city to CityOfFriend + console.log('@@@@CityOfFriend:', this.CityOfFriend); + + // Define mapMarkers with the friend's city as a location + this.mapMarkers = [{ + location: { + City: this.CityOfFriend, + }, + }]; + }) + .catch(error => { // Handle any errors + this.error = error; // Assign the error to the error property + }) + } + + zoomLevel = 15; // Set the zoom level for the map + listView = 'visible'; // Set the list view for the map to visible +} \ No newline at end of file diff --git a/force-app/main/default/lwc/locationViwer/locationViwer.js-meta.xml b/force-app/main/default/lwc/locationViwer/locationViwer.js-meta.xml new file mode 100644 index 0000000..56af8a8 --- /dev/null +++ b/force-app/main/default/lwc/locationViwer/locationViwer.js-meta.xml @@ -0,0 +1,9 @@ + + + 58.0 + true + + lightning__RecordPage + lightning__HomePage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/logger/logger.html b/force-app/main/default/lwc/logger/logger.html new file mode 100644 index 0000000..6d1e75a --- /dev/null +++ b/force-app/main/default/lwc/logger/logger.html @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/logger/logger.js b/force-app/main/default/lwc/logger/logger.js new file mode 100644 index 0000000..dbd7279 --- /dev/null +++ b/force-app/main/default/lwc/logger/logger.js @@ -0,0 +1,12 @@ +import { LightningElement } from 'lwc'; +import { log } from 'lightning/logger'; + +export default class Logger extends LightningElement { + handleClick() { + let msg = { + type: 'click', + action: 'Approve' + } + log(msg); + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/logger/logger.js-meta.xml b/force-app/main/default/lwc/logger/logger.js-meta.xml new file mode 100644 index 0000000..0ac90a6 --- /dev/null +++ b/force-app/main/default/lwc/logger/logger.js-meta.xml @@ -0,0 +1,8 @@ + + + 59.0 + true + + lightning__RecordPage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/loopingComponent/loopingComponent.html b/force-app/main/default/lwc/loopingComponent/loopingComponent.html new file mode 100644 index 0000000..f64e452 --- /dev/null +++ b/force-app/main/default/lwc/loopingComponent/loopingComponent.html @@ -0,0 +1,76 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/loopingComponent/loopingComponent.js b/force-app/main/default/lwc/loopingComponent/loopingComponent.js new file mode 100644 index 0000000..b0d7bce --- /dev/null +++ b/force-app/main/default/lwc/loopingComponent/loopingComponent.js @@ -0,0 +1,35 @@ +import { LightningElement } from 'lwc'; + +export default class LoopingComponent extends LightningElement { + + carList = ['Ford Mustang', 'Toyota Camry', 'Honda Civic', 'Chevy Camaro', 'Dodge Challenger']; + + ceoList =[ + { + id : 1, + name: 'Elon Musk', + company: 'Tesla' + }, + { + id : 2, + name: 'Jeff Bezos', + company: 'Amazon' + }, + { + id : 3, + name: 'Bill Gates', + company: 'Microsoft' + }, + { + id : 4, + name: 'Mark Zuckerberg', + company: 'Facebook' + }, + { + id : 5, + name: 'Sundar Pichai', + company: 'Google' + }, + ] + +} \ No newline at end of file diff --git a/force-app/main/default/lwc/loopingComponent/loopingComponent.js-meta.xml b/force-app/main/default/lwc/loopingComponent/loopingComponent.js-meta.xml new file mode 100644 index 0000000..011be21 --- /dev/null +++ b/force-app/main/default/lwc/loopingComponent/loopingComponent.js-meta.xml @@ -0,0 +1,8 @@ + + + 59.0 + true + + lightning__AppPage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/membershipAndAccount/membershipAndAccount.css b/force-app/main/default/lwc/membershipAndAccount/membershipAndAccount.css new file mode 100644 index 0000000..4e55186 --- /dev/null +++ b/force-app/main/default/lwc/membershipAndAccount/membershipAndAccount.css @@ -0,0 +1,54 @@ +.card{ + box-shadow: 0px 0px 1px 0px ; /* Adjusted shadow */ + display: flex; + flex-direction: column; + border-radius: 10px; + background-color: #ffffff; + width: 230px; + margin-bottom: 24px; + padding: 10px 0 15px 15px; + font-size: medium; +} + +@media (max-width: 768px) { + .slds-scrollable_y { + padding-left: 10px; /* Adjust as needed */ + } +} + +.slds-scrollable_y{ + height: 248px; + margin: 22px; + padding:17px; +} + +.container { + width: 100%; + font-family: Arial, sans-serif; + background-color: #f2f2f4; +} + +.container h1 { + font-size: 24px; + color: #172068; + font-weight: bold; + margin-bottom: 10px; +} +.container.p{ + color: #172068; +} +.loading-container { + position: relative; +} + +.spinner-container { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + display: flex; + align-items: center; + justify-content: center; + background-color: rgba(255, 255, 255, 0.8); +} \ No newline at end of file diff --git a/force-app/main/default/lwc/membershipAndAccount/membershipAndAccount.html b/force-app/main/default/lwc/membershipAndAccount/membershipAndAccount.html new file mode 100644 index 0000000..a26b1a2 --- /dev/null +++ b/force-app/main/default/lwc/membershipAndAccount/membershipAndAccount.html @@ -0,0 +1,38 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/membershipAndAccount/membershipAndAccount.js b/force-app/main/default/lwc/membershipAndAccount/membershipAndAccount.js new file mode 100644 index 0000000..df783d8 --- /dev/null +++ b/force-app/main/default/lwc/membershipAndAccount/membershipAndAccount.js @@ -0,0 +1,34 @@ +import { LightningElement, wire, track } from 'lwc'; +import getMembershipAndAccountMethod from '@salesforce/apex/getMembershipAndAccount.getMembershipAndAccountMethod'; + +export default class MembershipAndAccount extends LightningElement { + @track Membership = []; + @track AccInfo = {}; + @track isLoading = true; + + @wire(getMembershipAndAccountMethod) + wiredDate({error, data}){ + if (data) { + this.Membership = data.map(item => { + let flatItem = {...item}; + flatItem.Financial_Product_Name = item.Financial_Product__r.Name; + return flatItem; + }); + console.log("Membership",this.Membership); + + if (data.length > 0) { + this.AccInfo = { + Industry: data[0].Member__r.Industry, + AccountNumber: data[0].Member__r.AccountNumber, + AccountName:data[0].Member__r.Name, + Type:data[0].Member__r.AccountNumber + }; + } + console.log("Acc info",this.AccInfo); + this.isLoading = false; + } else if(error){ + console.log('Error',error); + this.isLoading = false; + } + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/membershipAndAccount/membershipAndAccount.js-meta.xml b/force-app/main/default/lwc/membershipAndAccount/membershipAndAccount.js-meta.xml new file mode 100644 index 0000000..4546800 --- /dev/null +++ b/force-app/main/default/lwc/membershipAndAccount/membershipAndAccount.js-meta.xml @@ -0,0 +1,25 @@ + + + 58.0 + true + + lightning__HomePage + lightningCommunity__Page + lightningCommunity__Default + lightning__RecordPage + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/force-app/main/default/lwc/memoryGame/memoryGame.css b/force-app/main/default/lwc/memoryGame/memoryGame.css new file mode 100644 index 0000000..4e54417 --- /dev/null +++ b/force-app/main/default/lwc/memoryGame/memoryGame.css @@ -0,0 +1,23 @@ +.container{ + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; +} +.score-panel{ + text-align: left; + margin-bottom: 12px; +} +.timer{ + display: inline-block; + margin: 0 1rem; +} +.restart{ + float: right; + cursor: pointer; + margin: 0px 8px; +} +.timer::before{ + content: "\f4fc"; + font-family: "FontAwesome"; +} \ No newline at end of file diff --git a/force-app/main/default/lwc/memoryGame/memoryGame.html b/force-app/main/default/lwc/memoryGame/memoryGame.html new file mode 100644 index 0000000..5ca3f6c --- /dev/null +++ b/force-app/main/default/lwc/memoryGame/memoryGame.html @@ -0,0 +1,24 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/memoryGame/memoryGame.js b/force-app/main/default/lwc/memoryGame/memoryGame.js new file mode 100644 index 0000000..f5994e0 --- /dev/null +++ b/force-app/main/default/lwc/memoryGame/memoryGame.js @@ -0,0 +1,47 @@ +import { LightningElement } from 'lwc'; +import {loadStyle} from 'lightning/platformResourceLoader' +import fontawesome11 from '@salesforce/resourceUrl/fontawesome11' +export default class MemoryGame extends LightningElement { + isLoaded = false; + + cards = [ + {id:1,listclass:"card",type:"diamond",icon:"fa fa-diamond"}, + {id:2,listclass:"card",type:"plane",icon:"fa fa-plane"}, + {id:3,listclass:"card",type:"anchor",icon:"fa fa-anchor"}, + {id:4,listclass:"card",type:"bolt",icon:"fa fa-bolt"}, + {id:5,listclass:"card",type:"cube",icon:"fa fa-cube"}, + {id:6,listclass:"card",type:"anchor",icon:"fa fa-anchor"}, + {id:7,listclass:"card",type:"leaf",icon:"fa fa-leaf"}, + {id:8,listclass:"card",type:"bicycle",icon:"fa fa-bicycle"}, + {id:9,listclass:"card",type:"diamond",icon:"fa fa-diamond"}, + {id:10,listclass:"card",type:"bomb",icon:"fa fa-bomb"}, + {id:11,listclass:"card",type:"leaf",icon:"fa fa-leaf"}, + {id:12,listclass:"card",type:"bomb",icon:"fa fa-bomb"}, + {id:13,listclass:"card",type:"bolt",icon:"fa fa-bolt"}, + {id:14,listclass:"card",type:"bicycle",icon:"fa fa-bicycle"}, + {id:15,listclass:"card",type:"plane",icon:"fa fa-plane"}, + {id:16,listclass:"card",type:"cube",icon:"fa fa-cube"}, + {id:17,listclass:"card",type:"user",icon:"fa fa-user-check"}, + + ] + renderedCallback(){ + try { + if(this.isLoaded == true){ + return + }else{ + loadStyle(this,fontawesome11+'/fontawesome-free-6.5.2-web/css/all.css') + .then(()=>{ + console.log('loded Succesfully'); + }) + .catch(error=>{ + console.error('error',error); + }) + this.isLoaded = true; + } + } catch (error) { + console.error('Got Error when loading Library:',error); + } + + + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/memoryGame/memoryGame.js-meta.xml b/force-app/main/default/lwc/memoryGame/memoryGame.js-meta.xml new file mode 100644 index 0000000..011be21 --- /dev/null +++ b/force-app/main/default/lwc/memoryGame/memoryGame.js-meta.xml @@ -0,0 +1,8 @@ + + + 59.0 + true + + lightning__AppPage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/navigateToHome/navigateToHome.html b/force-app/main/default/lwc/navigateToHome/navigateToHome.html new file mode 100644 index 0000000..bd5fb3e --- /dev/null +++ b/force-app/main/default/lwc/navigateToHome/navigateToHome.html @@ -0,0 +1,8 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/navigateToHome/navigateToHome.js b/force-app/main/default/lwc/navigateToHome/navigateToHome.js new file mode 100644 index 0000000..b798c2a --- /dev/null +++ b/force-app/main/default/lwc/navigateToHome/navigateToHome.js @@ -0,0 +1,13 @@ +import { LightningElement } from 'lwc'; +import {NavigationMixin} from 'lightning/navigation'; +export default class NavigateToHome extends NavigationMixin(LightningElement) { + + navigateToHome(){ + this[NavigationMixin.Navigate]({ + type:'standard__namedPage', + attributes:{ + pageName:'home' + } + }) + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/navigateToHome/navigateToHome.js-meta.xml b/force-app/main/default/lwc/navigateToHome/navigateToHome.js-meta.xml new file mode 100644 index 0000000..011be21 --- /dev/null +++ b/force-app/main/default/lwc/navigateToHome/navigateToHome.js-meta.xml @@ -0,0 +1,8 @@ + + + 59.0 + true + + lightning__AppPage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/navigateToRecordPage/navigateToRecordPage.html b/force-app/main/default/lwc/navigateToRecordPage/navigateToRecordPage.html new file mode 100644 index 0000000..12e6424 --- /dev/null +++ b/force-app/main/default/lwc/navigateToRecordPage/navigateToRecordPage.html @@ -0,0 +1,8 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/navigateToRecordPage/navigateToRecordPage.js b/force-app/main/default/lwc/navigateToRecordPage/navigateToRecordPage.js new file mode 100644 index 0000000..0e89bb9 --- /dev/null +++ b/force-app/main/default/lwc/navigateToRecordPage/navigateToRecordPage.js @@ -0,0 +1,34 @@ +import { LightningElement, wire } from 'lwc'; +import { NavigationMixin } from 'lightning/navigation'; +import getAccounts from '@salesforce/apex/MyAccounts.getAccounts'; + +const columns = [ + { label: 'Name', fieldName: 'Name' }, + { label: 'Phone', fieldName: 'Phone', type: 'phone' } +]; + +export default class AccountList extends NavigationMixin(LightningElement) { + columns = columns; + accounts; + + @wire(getAccounts) + AcCList({ error, data }) { + if (data) { + this.accounts = data; + } else if (error) { + console.error(error); + } + } + + gotoRecordPage(event) { + this.record = event.detail.row; + this[NavigationMixin.Navigate]({ + type: 'standard__recordPage', + attributes: { + recordId: this.record.id, + objectApiName: 'Account', + actionName: 'view' + } + }); + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/navigateToRecordPage/navigateToRecordPage.js-meta.xml b/force-app/main/default/lwc/navigateToRecordPage/navigateToRecordPage.js-meta.xml new file mode 100644 index 0000000..14a8e29 --- /dev/null +++ b/force-app/main/default/lwc/navigateToRecordPage/navigateToRecordPage.js-meta.xml @@ -0,0 +1,9 @@ + + + 57.0 + true + + lightning__AppPage + lightning__HomePage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/p2cCarousalComponent/p2cCarousalComponent.html b/force-app/main/default/lwc/p2cCarousalComponent/p2cCarousalComponent.html new file mode 100644 index 0000000..1df6f84 --- /dev/null +++ b/force-app/main/default/lwc/p2cCarousalComponent/p2cCarousalComponent.html @@ -0,0 +1,16 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/p2cCarousalComponent/p2cCarousalComponent.js b/force-app/main/default/lwc/p2cCarousalComponent/p2cCarousalComponent.js new file mode 100644 index 0000000..79550ed --- /dev/null +++ b/force-app/main/default/lwc/p2cCarousalComponent/p2cCarousalComponent.js @@ -0,0 +1,5 @@ +import { LightningElement,api } from 'lwc'; + +export default class P2cCarousalComponent extends LightningElement { + @api caraousalDetails +} \ No newline at end of file diff --git a/force-app/main/default/lwc/p2cCarousalComponent/p2cCarousalComponent.js-meta.xml b/force-app/main/default/lwc/p2cCarousalComponent/p2cCarousalComponent.js-meta.xml new file mode 100644 index 0000000..6127d85 --- /dev/null +++ b/force-app/main/default/lwc/p2cCarousalComponent/p2cCarousalComponent.js-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + false + \ No newline at end of file diff --git a/force-app/main/default/lwc/p2cChildComponent/p2cChildComponent.html b/force-app/main/default/lwc/p2cChildComponent/p2cChildComponent.html new file mode 100644 index 0000000..32af363 --- /dev/null +++ b/force-app/main/default/lwc/p2cChildComponent/p2cChildComponent.html @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/p2cChildComponent/p2cChildComponent.js b/force-app/main/default/lwc/p2cChildComponent/p2cChildComponent.js new file mode 100644 index 0000000..05d02e1 --- /dev/null +++ b/force-app/main/default/lwc/p2cChildComponent/p2cChildComponent.js @@ -0,0 +1,9 @@ +import { LightningElement,api } from 'lwc'; + +export default class P2cChildComponent extends LightningElement { + @api message; + @api number; + @api isVisible; + @api heading; + +} \ No newline at end of file diff --git a/force-app/main/default/lwc/p2cChildComponent/p2cChildComponent.js-meta.xml b/force-app/main/default/lwc/p2cChildComponent/p2cChildComponent.js-meta.xml new file mode 100644 index 0000000..6127d85 --- /dev/null +++ b/force-app/main/default/lwc/p2cChildComponent/p2cChildComponent.js-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + false + \ No newline at end of file diff --git a/force-app/main/default/lwc/p2cParentComponent/p2cParentComponent.html b/force-app/main/default/lwc/p2cParentComponent/p2cParentComponent.html new file mode 100644 index 0000000..7aad246 --- /dev/null +++ b/force-app/main/default/lwc/p2cParentComponent/p2cParentComponent.html @@ -0,0 +1,34 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/p2cParentComponent/p2cParentComponent.js b/force-app/main/default/lwc/p2cParentComponent/p2cParentComponent.js new file mode 100644 index 0000000..305976c --- /dev/null +++ b/force-app/main/default/lwc/p2cParentComponent/p2cParentComponent.js @@ -0,0 +1,30 @@ +import { LightningElement,api } from 'lwc'; + +export default class P2cParentComponent extends LightningElement { + carousalData = [ + { + src : "https://www.lightningdesignsystem.com/assets/images/carousel/carousel-01.jpg", + header : "First Card", + description :"First card description." + }, + { + src : "https://www.lightningdesignsystem.com/assets/images/carousel/carousel-01.jpg", + header : "Secound Card", + description :"Secound card description." + }, + { + src : "https://www.lightningdesignsystem.com/assets/images/carousel/carousel-01.jpg", + header : "Third Card", + description :"Third card description." + } +] + percentage=10 + changeHandler(event){ + this.percentage = (event.target.value)*10; + + } + + handleClick(){ + this.template.querySelector('c-p2c-slider-component').resetSlider() + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/p2cParentComponent/p2cParentComponent.js-meta.xml b/force-app/main/default/lwc/p2cParentComponent/p2cParentComponent.js-meta.xml new file mode 100644 index 0000000..011be21 --- /dev/null +++ b/force-app/main/default/lwc/p2cParentComponent/p2cParentComponent.js-meta.xml @@ -0,0 +1,8 @@ + + + 59.0 + true + + lightning__AppPage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/p2cProgressComponent/p2cProgressComponent.html b/force-app/main/default/lwc/p2cProgressComponent/p2cProgressComponent.html new file mode 100644 index 0000000..c9d5665 --- /dev/null +++ b/force-app/main/default/lwc/p2cProgressComponent/p2cProgressComponent.html @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/p2cProgressComponent/p2cProgressComponent.js b/force-app/main/default/lwc/p2cProgressComponent/p2cProgressComponent.js new file mode 100644 index 0000000..f8aef17 --- /dev/null +++ b/force-app/main/default/lwc/p2cProgressComponent/p2cProgressComponent.js @@ -0,0 +1,6 @@ +import { LightningElement,api } from 'lwc'; + +export default class P2cProgressComponent extends LightningElement { + @api progressvalue; + +} \ No newline at end of file diff --git a/force-app/main/default/lwc/p2cProgressComponent/p2cProgressComponent.js-meta.xml b/force-app/main/default/lwc/p2cProgressComponent/p2cProgressComponent.js-meta.xml new file mode 100644 index 0000000..6127d85 --- /dev/null +++ b/force-app/main/default/lwc/p2cProgressComponent/p2cProgressComponent.js-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + false + \ No newline at end of file diff --git a/force-app/main/default/lwc/p2cSliderComponent/p2cSliderComponent.html b/force-app/main/default/lwc/p2cSliderComponent/p2cSliderComponent.html new file mode 100644 index 0000000..20f5399 --- /dev/null +++ b/force-app/main/default/lwc/p2cSliderComponent/p2cSliderComponent.html @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/p2cSliderComponent/p2cSliderComponent.js b/force-app/main/default/lwc/p2cSliderComponent/p2cSliderComponent.js new file mode 100644 index 0000000..13975ec --- /dev/null +++ b/force-app/main/default/lwc/p2cSliderComponent/p2cSliderComponent.js @@ -0,0 +1,12 @@ +import { LightningElement,api } from 'lwc'; + +export default class P2cSliderComponent extends LightningElement { + val= 20 + changeHandler(event){ + this.val = event.target.value; + } + @api resetSlider(){ + this.val = 50; + } + +} \ No newline at end of file diff --git a/force-app/main/default/lwc/p2cSliderComponent/p2cSliderComponent.js-meta.xml b/force-app/main/default/lwc/p2cSliderComponent/p2cSliderComponent.js-meta.xml new file mode 100644 index 0000000..6127d85 --- /dev/null +++ b/force-app/main/default/lwc/p2cSliderComponent/p2cSliderComponent.js-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + false + \ No newline at end of file diff --git a/force-app/main/default/lwc/parentExample/parentExample.html b/force-app/main/default/lwc/parentExample/parentExample.html new file mode 100644 index 0000000..9cfdec6 --- /dev/null +++ b/force-app/main/default/lwc/parentExample/parentExample.html @@ -0,0 +1,15 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/parentExample/parentExample.js b/force-app/main/default/lwc/parentExample/parentExample.js new file mode 100644 index 0000000..dfefdbc --- /dev/null +++ b/force-app/main/default/lwc/parentExample/parentExample.js @@ -0,0 +1,9 @@ +import { LightningElement } from 'lwc'; + +export default class ParentExample extends LightningElement { + startcounter=0; + handleStartCounter(event){ + this.startcounter=event.target.value; + + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/parentExample/parentExample.js-meta.xml b/force-app/main/default/lwc/parentExample/parentExample.js-meta.xml new file mode 100644 index 0000000..519ef48 --- /dev/null +++ b/force-app/main/default/lwc/parentExample/parentExample.js-meta.xml @@ -0,0 +1,8 @@ + + + 57.0 + true + + lightning__HomePage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/parentExp/parentExp.html b/force-app/main/default/lwc/parentExp/parentExp.html new file mode 100644 index 0000000..5701968 --- /dev/null +++ b/force-app/main/default/lwc/parentExp/parentExp.html @@ -0,0 +1,12 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/parentExp/parentExp.js b/force-app/main/default/lwc/parentExp/parentExp.js new file mode 100644 index 0000000..17e9e64 --- /dev/null +++ b/force-app/main/default/lwc/parentExp/parentExp.js @@ -0,0 +1,16 @@ +import { LightningElement } from 'lwc'; + +export default class ParentExp extends LightningElement { + countvalue=0; + + handleDecrement(){ + this.countvalue--; + } + handleIncrement(){ + this.countvalue++; + } + handleMultiply(event){ + const multiplingNumber=event.detail; + this.countvalue*=multiplingNumber; + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/parentExp/parentExp.js-meta.xml b/force-app/main/default/lwc/parentExp/parentExp.js-meta.xml new file mode 100644 index 0000000..519ef48 --- /dev/null +++ b/force-app/main/default/lwc/parentExp/parentExp.js-meta.xml @@ -0,0 +1,8 @@ + + + 57.0 + true + + lightning__HomePage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/parentExp1/parentExp1.html b/force-app/main/default/lwc/parentExp1/parentExp1.html new file mode 100644 index 0000000..33aa890 --- /dev/null +++ b/force-app/main/default/lwc/parentExp1/parentExp1.html @@ -0,0 +1,18 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/parentExp1/parentExp1.js b/force-app/main/default/lwc/parentExp1/parentExp1.js new file mode 100644 index 0000000..217435a --- /dev/null +++ b/force-app/main/default/lwc/parentExp1/parentExp1.js @@ -0,0 +1,10 @@ +import { LightningElement } from 'lwc'; + +export default class ParentExp1 extends LightningElement { + startCounter=0; + + handleStartChange(event){ + this.startCounter = event.target.value; + + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/parentExp1/parentExp1.js-meta.xml b/force-app/main/default/lwc/parentExp1/parentExp1.js-meta.xml new file mode 100644 index 0000000..3fe0e73 --- /dev/null +++ b/force-app/main/default/lwc/parentExp1/parentExp1.js-meta.xml @@ -0,0 +1,5 @@ + + + 57.0 + false + \ No newline at end of file diff --git a/force-app/main/default/lwc/parentExpFirst/parentExpFirst.html b/force-app/main/default/lwc/parentExpFirst/parentExpFirst.html new file mode 100644 index 0000000..33aa890 --- /dev/null +++ b/force-app/main/default/lwc/parentExpFirst/parentExpFirst.html @@ -0,0 +1,18 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/parentExpFirst/parentExpFirst.js b/force-app/main/default/lwc/parentExpFirst/parentExpFirst.js new file mode 100644 index 0000000..217435a --- /dev/null +++ b/force-app/main/default/lwc/parentExpFirst/parentExpFirst.js @@ -0,0 +1,10 @@ +import { LightningElement } from 'lwc'; + +export default class ParentExp1 extends LightningElement { + startCounter=0; + + handleStartChange(event){ + this.startCounter = event.target.value; + + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/parentExpFirst/parentExpFirst.js-meta.xml b/force-app/main/default/lwc/parentExpFirst/parentExpFirst.js-meta.xml new file mode 100644 index 0000000..3fe0e73 --- /dev/null +++ b/force-app/main/default/lwc/parentExpFirst/parentExpFirst.js-meta.xml @@ -0,0 +1,5 @@ + + + 57.0 + false + \ No newline at end of file diff --git a/force-app/main/default/lwc/polymorphicRecordPicker/PolymorphicRecordPicker.css b/force-app/main/default/lwc/polymorphicRecordPicker/PolymorphicRecordPicker.css new file mode 100644 index 0000000..4a7d865 --- /dev/null +++ b/force-app/main/default/lwc/polymorphicRecordPicker/PolymorphicRecordPicker.css @@ -0,0 +1,20 @@ +/* Container with relative positioning */ +.loading-container { + position: relative; + display: inline-block; +} + +/* Spinner container with absolute positioning and centered content */ +.spinner-container { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + /* Flex display for center alignment of content */ + display: flex; + align-items: center; + justify-content: center; + /* Semi-transparent white background */ + background-color: rgba(255, 255, 255, 0.8); +} \ No newline at end of file diff --git a/force-app/main/default/lwc/polymorphicRecordPicker/polymorphicRecordPicker.html b/force-app/main/default/lwc/polymorphicRecordPicker/polymorphicRecordPicker.html new file mode 100644 index 0000000..5cbbc54 --- /dev/null +++ b/force-app/main/default/lwc/polymorphicRecordPicker/polymorphicRecordPicker.html @@ -0,0 +1,44 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/polymorphicRecordPicker/polymorphicRecordPicker.js b/force-app/main/default/lwc/polymorphicRecordPicker/polymorphicRecordPicker.js new file mode 100644 index 0000000..c1a1dea --- /dev/null +++ b/force-app/main/default/lwc/polymorphicRecordPicker/polymorphicRecordPicker.js @@ -0,0 +1,68 @@ +// Import necessary modules from the Lightning Web Components (LWC) and Apex +import { LightningElement, wire, track } from 'lwc'; +import getObjectMethod from '@salesforce/apex/getObjects.getObjectMethod'; + +// Define the PolymorphicRecordPicker class +export default class PolymorphicRecordPicker extends LightningElement { + // Track the target objects, selected target, current selected record ID, and loading state + @track targetObjects = [ + { label: 'Account', value: 'Account' }, + { label: 'Contact', value: 'Contact' }, + { label: 'Lead', value: 'Lead' }, + { label: 'Opportunity', value: 'Opportunity' } + ]; + selectedTarget = ''; + currentSelectedRecordId = null; + @track isLoading = true; + + + // Wire the getAllObjects Apex method to the wiredObjects function + @wire(getObjectMethod) + wiredObjects({ error, data }) { + try { + // If data is returned + if (data) { + + // Map the data to the targetObjects array + this.targetObjects = [...this.targetObjects, ...data.map(obj => ({ label: obj, value: obj }))]; + + // Set the selectedTarget to the first object in the list + if (this.targetObjects.length > 0) { + this.selectedTarget = this.targetObjects[0].value; + } + + // Log the targetObjects array + console.log('@@@data', this.targetObjects); + // Set isLoading to false to hide the loading spinner + this.isLoading = false; + } + // If an error occurred + else if (error) { + // Log the error + console.error(error); + // Set isLoading to false to hide the loading spinner + this.isLoading = false; + } + } catch (e) { + console.error('An error occurred: ', e); + } + } + + // Getter to determine whether to show the target selector + get showTargetSelector() { + // Return true if the currentSelectedRecordId is null + return this.currentSelectedRecordId === null; + } + + // Handler for the target selection event + handleTargetSelection(event) { + // Set the selectedTarget to the value of the event target + this.selectedTarget = event.target.value; + } + + // Handler for the record select event + handleRecordSelect(event) { + // Set the currentSelectedRecordId to the record ID from the event detail + this.currentSelectedRecordId = event.detail.recordId; + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/polymorphicRecordPicker/polymorphicRecordPicker.js-meta.xml b/force-app/main/default/lwc/polymorphicRecordPicker/polymorphicRecordPicker.js-meta.xml new file mode 100644 index 0000000..a19e36b --- /dev/null +++ b/force-app/main/default/lwc/polymorphicRecordPicker/polymorphicRecordPicker.js-meta.xml @@ -0,0 +1,9 @@ + + + + 58.0 + true + + lightning__HomePage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/previewFileModal/PreviewFileModal.css b/force-app/main/default/lwc/previewFileModal/PreviewFileModal.css new file mode 100644 index 0000000..770d0ac --- /dev/null +++ b/force-app/main/default/lwc/previewFileModal/PreviewFileModal.css @@ -0,0 +1,4 @@ +.slds-modal__container { + width: 90% !important; + max-width: 90% !important; + } \ No newline at end of file diff --git a/force-app/main/default/lwc/previewFileModal/previewFileModal.html b/force-app/main/default/lwc/previewFileModal/previewFileModal.html new file mode 100644 index 0000000..912eeab --- /dev/null +++ b/force-app/main/default/lwc/previewFileModal/previewFileModal.html @@ -0,0 +1,63 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/previewFileModal/previewFileModal.js b/force-app/main/default/lwc/previewFileModal/previewFileModal.js new file mode 100644 index 0000000..d50a1ae --- /dev/null +++ b/force-app/main/default/lwc/previewFileModal/previewFileModal.js @@ -0,0 +1,19 @@ +import { LightningElement, api } from "lwc"; + +export default class PreviewFileModal extends LightningElement { + @api url; + @api description=""; + @api fileExtension; + showFrame = false; + showModal = false; + @api show() { + console.log("###showFrame : " + this.fileExtension); + if (this.fileExtension === "pdf") this.showFrame = true; + else this.showFrame = false; + this.showModal = true; + console.log("description in last"+this.description); + } + closeModal() { + this.showModal = false; + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/previewFileModal/previewFileModal.js-meta.xml b/force-app/main/default/lwc/previewFileModal/previewFileModal.js-meta.xml new file mode 100644 index 0000000..8f2f6ae --- /dev/null +++ b/force-app/main/default/lwc/previewFileModal/previewFileModal.js-meta.xml @@ -0,0 +1,10 @@ + + + 57.0 + true + + lightning__AppPage + lightning__HomePage + lightning__RecordPage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/previewFileThumbnailCard/previewFileThumbnailCard.html b/force-app/main/default/lwc/previewFileThumbnailCard/previewFileThumbnailCard.html new file mode 100644 index 0000000..af90663 --- /dev/null +++ b/force-app/main/default/lwc/previewFileThumbnailCard/previewFileThumbnailCard.html @@ -0,0 +1,65 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/previewFileThumbnailCard/previewFileThumbnailCard.js b/force-app/main/default/lwc/previewFileThumbnailCard/previewFileThumbnailCard.js new file mode 100644 index 0000000..0311c61 --- /dev/null +++ b/force-app/main/default/lwc/previewFileThumbnailCard/previewFileThumbnailCard.js @@ -0,0 +1,63 @@ +import { LightningElement, api } from "lwc"; + +export default class PreviewFileThumbnailCard extends LightningElement { + @api file; + @api recordId; + @api thumbnail; + @api note; + + renderedCallback(){ + console.log('Note in Child' ,this.note); + } + + + get iconName() { + if (this.file.Extension) { + if (this.file.Extension === "pdf") { + return "doctype:pdf"; + } + if (this.file.Extension === "ppt") { + return "doctype:ppt"; + } + if (this.file.Extension === "xls") { + return "doctype:excel"; + } + if (this.file.Extension === "csv") { + return "doctype:csv"; + } + if (this.file.Extension === "txt") { + return "doctype:txt"; + } + if (this.file.Extension === "xml") { + return "doctype:xml"; + } + if (this.file.Extension === "doc") { + return "doctype:word"; + } + if (this.file.Extension === "zip") { + return "doctype:zip"; + } + if (this.file.Extension === "rtf") { + return "doctype:rtf"; + } + if (this.file.Extension === "psd") { + return "doctype:psd"; + } + if (this.file.Extension === "html") { + return "doctype:html"; + } + if (this.file.Extension === "gdoc") { + return "doctype:gdoc"; + } + } + return "doctype:image"; + } + + filePreview() { + console.log("###Click"); + const showPreview = this.template.querySelector("c-preview-file-modal"); + showPreview.show(); + showPreview.description=this.note; + console.log(`des${this.note}`) + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/previewFileThumbnailCard/previewFileThumbnailCard.js-meta.xml b/force-app/main/default/lwc/previewFileThumbnailCard/previewFileThumbnailCard.js-meta.xml new file mode 100644 index 0000000..8f2f6ae --- /dev/null +++ b/force-app/main/default/lwc/previewFileThumbnailCard/previewFileThumbnailCard.js-meta.xml @@ -0,0 +1,10 @@ + + + 57.0 + true + + lightning__AppPage + lightning__HomePage + lightning__RecordPage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/previewFileThumbnails/previewFileThumbnails.html b/force-app/main/default/lwc/previewFileThumbnails/previewFileThumbnails.html new file mode 100644 index 0000000..6ef5a87 --- /dev/null +++ b/force-app/main/default/lwc/previewFileThumbnails/previewFileThumbnails.html @@ -0,0 +1,41 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/previewFileThumbnails/previewFileThumbnails.js b/force-app/main/default/lwc/previewFileThumbnails/previewFileThumbnails.js new file mode 100644 index 0000000..8ddebaa --- /dev/null +++ b/force-app/main/default/lwc/previewFileThumbnails/previewFileThumbnails.js @@ -0,0 +1,104 @@ +import { LightningElement, wire, api, track } from "lwc"; +import { refreshApex } from "@salesforce/apex"; +import { ShowToastEvent } from "lightning/platformShowToastEvent"; +import updateFileDescription from '@salesforce/apex/FileDescrip.updateFileDescription'; +import getFileVersions from "@salesforce/apex/FileController.getVersionFiles"; + +export default class PreviewFileThumbnails extends LightningElement { + isDisable=true; + @track descrip=""; + @track addDes=""; + loaded = false; + @track fileList; + @api recordId; + @track files = []; + get acceptedFormats() { + return [".pdf", ".png", ".jpg", ".jpeg"]; + } + + @wire(getFileVersions, { recordId: "$recordId" }) + fileResponse(value) { + this.wiredActivities = value; + const { data, error } = value; + this.fileList = ""; + this.files = []; + if (data) { + this.fileList = data; + for (let i = 0; i < this.fileList.length; i++) { + let file = { + Id: this.fileList[i].Id, + Title: this.fileList[i].Title, + Extension: this.fileList[i].FileExtension, + ContentDocumentId: this.fileList[i].ContentDocumentId, + ContentDocument: this.fileList[i].ContentDocument, + CreatedDate: this.fileList[i].CreatedDate, + thumbnailFileCard: + "/sfc/servlet.shepherd/version/renditionDownload?rendition=THUMB720BY480&versionId=" + + this.fileList[i].Id + + "&operationContext=CHATTER&contentId=" + + this.fileList[i].ContentDocumentId, + downloadUrl: + "/sfc/servlet.shepherd/document/download/" + + this.fileList[i].ContentDocumentId + }; + this.files.push(file); + } + this.loaded = true; + } else if (error) { + this.dispatchEvent( + new ShowToastEvent({ + title: "Error loading Files", + message: error.body.message, + variant: "error" + }) + ); + } + } + handleUploadFinished(event) { + const uploadedFiles = event.detail.files; + refreshApex(this.wiredActivities); + this.dispatchEvent( + new ShowToastEvent({ + title: "Success!", + message: uploadedFiles.length + " Files Uploaded Successfully.", + variant: "success" + }) + ); + + } + addnotes(event){ + this.descrip=event.target.value; + console.log("@@@@text:"+this.descrip); + if(this.descrip==""){ + this.isDisable=true; + } + else{ + this.isDisable=false; + } + } + add() { + this.addDes = this.descrip; + console.log('add des:', this.addDes); + console.log('RecordId', this.recordId); + updateFileDescription({ recordId: this.recordId, description:this.addDes }) + .then(result => { + const event = new ShowToastEvent({ + title: 'INSERTED', + message: 'SUCCESS', + variant: 'success' + }); + this.dispatchEvent(event); + }) + .catch(error => { + console.log(error); + const event = new ShowToastEvent({ + title: 'error', + message: 'Failed', + variant: 'error' + }); + this.dispatchEvent(event); + }); +} + + +} \ No newline at end of file diff --git a/force-app/main/default/lwc/previewFileThumbnails/previewFileThumbnails.js-meta.xml b/force-app/main/default/lwc/previewFileThumbnails/previewFileThumbnails.js-meta.xml new file mode 100644 index 0000000..8f2f6ae --- /dev/null +++ b/force-app/main/default/lwc/previewFileThumbnails/previewFileThumbnails.js-meta.xml @@ -0,0 +1,10 @@ + + + 57.0 + true + + lightning__AppPage + lightning__HomePage + lightning__RecordPage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/profilePhoto/profilePhoto.css b/force-app/main/default/lwc/profilePhoto/profilePhoto.css new file mode 100644 index 0000000..0d39aa0 --- /dev/null +++ b/force-app/main/default/lwc/profilePhoto/profilePhoto.css @@ -0,0 +1,30 @@ +/* myComponent.css */ +.image-container { + position: relative; + display: inline-block; +} + +.image { + height: 100px; + width: 100px; + border-radius:100px; + display: block; +} + +.overlay-icon { + position: absolute; + bottom: 8px; /* Position from the bottom */ + right: 16px; /* Position from the right */ +} + +.dropdown-content { + display: none; + position: absolute; + background-color: #f9f9f9; + min-width: 160px; + box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); +} + +.overlay-icon:hover .dropdown-content { + display: block; +} \ No newline at end of file diff --git a/force-app/main/default/lwc/profilePhoto/profilePhoto.html b/force-app/main/default/lwc/profilePhoto/profilePhoto.html new file mode 100644 index 0000000..ca7be3e --- /dev/null +++ b/force-app/main/default/lwc/profilePhoto/profilePhoto.html @@ -0,0 +1,16 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/profilePhoto/profilePhoto.js b/force-app/main/default/lwc/profilePhoto/profilePhoto.js new file mode 100644 index 0000000..a5aecc2 --- /dev/null +++ b/force-app/main/default/lwc/profilePhoto/profilePhoto.js @@ -0,0 +1,33 @@ +import { LightningElement,api} from 'lwc'; +import ProfilePhotoMethod from '@salesforce/apex/ProfilePhotoClass.ProfilePhotoMethod' + +export default class ProfilePhoto extends LightningElement { + @api recordId; + imageUrl=''; + error; + connectedCallback(){ + console.log('Current page Record id',this.recordId); + ProfilePhotoMethod({Id:this.recordId}) + .then(result=>{ + this.imageUrl=result; + console.log('url from this image url',this.imageUrl); + console.log('From result',result); + }) + .catch(error => { // Handle any errors + this.error = error; // Assign the error to the error property + }) + + } + showPhoto() { + // Your code for showing the photo here + window.print('Print') + } + + deletePhoto() { + // Your code for deleting the photo here + } + + uploadPhoto() { + // Your code for uploading a photo here + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/profilePhoto/profilePhoto.js-meta.xml b/force-app/main/default/lwc/profilePhoto/profilePhoto.js-meta.xml new file mode 100644 index 0000000..fa684e5 --- /dev/null +++ b/force-app/main/default/lwc/profilePhoto/profilePhoto.js-meta.xml @@ -0,0 +1,8 @@ + + + 58.0 + true + + lightning__RecordPage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/pubSub/pubSub.html b/force-app/main/default/lwc/pubSub/pubSub.html new file mode 100644 index 0000000..27e0f69 --- /dev/null +++ b/force-app/main/default/lwc/pubSub/pubSub.html @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/pubSub/pubSub.js b/force-app/main/default/lwc/pubSub/pubSub.js new file mode 100644 index 0000000..6e41d31 --- /dev/null +++ b/force-app/main/default/lwc/pubSub/pubSub.js @@ -0,0 +1,38 @@ +let callbacks = {}; + +const register = (eventName, callback) => { + if (!callbacks[eventName]) { + callbacks[eventName] = new Set(); + } + callbacks[eventName].add(callback); +}; + +const unRegister = (eventName, callback) => { + if (!callbacks[eventName]) { + callbacks[eventName] = new Set(); + } + callbacks[eventName].delete(callback); +}; + +const unRegisterAll = () => { + callbacks = {}; +}; + +const fire = (eventName, payload) => { + if (callbacks[eventName]) { + callbacks[eventName].forEach(callback => { + try { + callback(payload); + } catch (error) { + console.log(error); + } + }); + } +}; + +export default { + register, + unRegister, + unRegisterAll, + fire +}; \ No newline at end of file diff --git a/force-app/main/default/lwc/pubSub/pubSub.js-meta.xml b/force-app/main/default/lwc/pubSub/pubSub.js-meta.xml new file mode 100644 index 0000000..6127d85 --- /dev/null +++ b/force-app/main/default/lwc/pubSub/pubSub.js-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + false + \ No newline at end of file diff --git a/force-app/main/default/lwc/pubSubComponent/pubSubComponent.js b/force-app/main/default/lwc/pubSubComponent/pubSubComponent.js new file mode 100644 index 0000000..35f1e7e --- /dev/null +++ b/force-app/main/default/lwc/pubSubComponent/pubSubComponent.js @@ -0,0 +1,47 @@ +const store = {} +/** + subscribers a callback for an event + @param {string} eventName - name of the event to listen for + @param {function} callback -Function to invoke when said event is fired + */ +const subscribe = (eventName,callback) =>{ + if(!store[eventName]){ + store[eventName] = new Set(); + } + store[eventName].add(callback); +}; + +/** +unsubscribe a callback for an event + @param {string} eventName - name of the event to unsubscribe from + @param {Function} callback -Function to unsubscribe + */ + const unsubscribe = (eventName,callback) =>{ + if(store[eventName]){ + store[eventName].delete(callback); + } +}; + +/** + Publish an evnet to listners + @param {string} eventName - name of the event to publish + @param {Function} payload - payload og the event to publish + */ + + const publish = (eventName,payload) =>{ + if(store[eventName]){ + store[eventName].forEach(callback => { + try { + callback(payload); + } catch (error) { + console.error(error); + } + }); + } + }; + + export default{ + subscribe, + unsubscribe, + publish + }; \ No newline at end of file diff --git a/force-app/main/default/lwc/pubSubComponent/pubSubComponent.js-meta.xml b/force-app/main/default/lwc/pubSubComponent/pubSubComponent.js-meta.xml new file mode 100644 index 0000000..6127d85 --- /dev/null +++ b/force-app/main/default/lwc/pubSubComponent/pubSubComponent.js-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + false + \ No newline at end of file diff --git a/force-app/main/default/lwc/pubSubComponentA/pubSubComponentA.html b/force-app/main/default/lwc/pubSubComponentA/pubSubComponentA.html new file mode 100644 index 0000000..4772bcb --- /dev/null +++ b/force-app/main/default/lwc/pubSubComponentA/pubSubComponentA.html @@ -0,0 +1,8 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/pubSubComponentA/pubSubComponentA.js b/force-app/main/default/lwc/pubSubComponentA/pubSubComponentA.js new file mode 100644 index 0000000..1796ea1 --- /dev/null +++ b/force-app/main/default/lwc/pubSubComponentA/pubSubComponentA.js @@ -0,0 +1,11 @@ +import { LightningElement } from 'lwc'; +import pubSubComponent from 'c/pubSubComponent'; +export default class PubSubComponentA extends LightningElement { + message; + inputHandler(event){ + this.message = event.target.value; + } + publishHandler(){ + pubSubComponent.publish('componentA',this.message) + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/pubSubComponentA/pubSubComponentA.js-meta.xml b/force-app/main/default/lwc/pubSubComponentA/pubSubComponentA.js-meta.xml new file mode 100644 index 0000000..011be21 --- /dev/null +++ b/force-app/main/default/lwc/pubSubComponentA/pubSubComponentA.js-meta.xml @@ -0,0 +1,8 @@ + + + 59.0 + true + + lightning__AppPage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/pubSubComponentB/pubSubComponentB.html b/force-app/main/default/lwc/pubSubComponentB/pubSubComponentB.html new file mode 100644 index 0000000..8aebcec --- /dev/null +++ b/force-app/main/default/lwc/pubSubComponentB/pubSubComponentB.html @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/pubSubComponentB/pubSubComponentB.js b/force-app/main/default/lwc/pubSubComponentB/pubSubComponentB.js new file mode 100644 index 0000000..29e5273 --- /dev/null +++ b/force-app/main/default/lwc/pubSubComponentB/pubSubComponentB.js @@ -0,0 +1,13 @@ +import { LightningElement } from 'lwc'; +import pubSubComponent from 'c/pubSubComponent'; +export default class PubSubComponentB extends LightningElement { + message; + connectedCallback(){ + this.callsubscriber() + } + callsubscriber(){ + pubSubComponent.subscribe('componentA',(message)=>{ + this.message = message; + }); + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/pubSubComponentB/pubSubComponentB.js-meta.xml b/force-app/main/default/lwc/pubSubComponentB/pubSubComponentB.js-meta.xml new file mode 100644 index 0000000..011be21 --- /dev/null +++ b/force-app/main/default/lwc/pubSubComponentB/pubSubComponentB.js-meta.xml @@ -0,0 +1,8 @@ + + + 59.0 + true + + lightning__AppPage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/publisher/publisher.html b/force-app/main/default/lwc/publisher/publisher.html new file mode 100644 index 0000000..456b396 --- /dev/null +++ b/force-app/main/default/lwc/publisher/publisher.html @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/publisher/publisher.js b/force-app/main/default/lwc/publisher/publisher.js new file mode 100644 index 0000000..2e1fb3c --- /dev/null +++ b/force-app/main/default/lwc/publisher/publisher.js @@ -0,0 +1,13 @@ +import { LightningElement } from 'lwc'; +import pubSub from 'c/pubSub'; +export default class Publisher extends LightningElement { + + handleOnClick(){ + console.log("Event Firing"); + let message ={ + "message" : 'Hello Bro' + } + pubSub.fire('simplevt',message); + console.log('Event Fired'); + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/publisher/publisher.js-meta.xml b/force-app/main/default/lwc/publisher/publisher.js-meta.xml new file mode 100644 index 0000000..9fa43f2 --- /dev/null +++ b/force-app/main/default/lwc/publisher/publisher.js-meta.xml @@ -0,0 +1,9 @@ + + + 59.0 + true + + lightning__HomePage + lightning__RecordPage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/quizAppCoponent/js-confetti.js b/force-app/main/default/lwc/quizAppCoponent/js-confetti.js new file mode 100644 index 0000000..82987cc --- /dev/null +++ b/force-app/main/default/lwc/quizAppCoponent/js-confetti.js @@ -0,0 +1,2 @@ +var JSConfetti=function(){"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){for(var i=0;i2&&void 0!==arguments[2]?arguments[2]:0,n=Math.random()*(e-t)+t;return Math.floor(n*Math.pow(10,i))/Math.pow(10,i)}function o(t){return t[s(0,t.length)]}var a=["#fcf403","#62fc03","#f4fc03","#03e7fc","#03fca5","#a503fc","#fc03ad","#fc03c2"];function r(t){return Math.log(t)/Math.log(1920)}var h=function(){function e(i){t(this,e);var n=i.initialPosition,a=i.direction,h=i.confettiRadius,c=i.confettiColors,u=i.emojis,l=i.emojiSize,d=i.canvasWidth,f=s(.9,1.7,3)*r(d);this.confettiSpeed={x:f,y:f},this.finalConfettiSpeedX=s(.2,.6,3),this.rotationSpeed=u.length?.01:s(.03,.07,3)*r(d),this.dragForceCoefficient=s(5e-4,9e-4,6),this.radius={x:h,y:h},this.initialRadius=h,this.rotationAngle="left"===a?s(0,.2,3):s(-.2,0,3),this.emojiSize=l,this.emojiRotationAngle=s(0,2*Math.PI),this.radiusYUpdateDirection="down";var m="left"===a?s(82,15)*Math.PI/180:s(-15,-82)*Math.PI/180;this.absCos=Math.abs(Math.cos(m)),this.absSin=Math.abs(Math.sin(m));var v=s(-150,0),p={x:n.x+("left"===a?-v:v)*this.absCos,y:n.y-v*this.absSin};this.currentPosition=Object.assign({},p),this.initialPosition=Object.assign({},p),this.color=u.length?null:o(c),this.emoji=u.length?o(u):null,this.createdAt=(new Date).getTime(),this.direction=a}return i(e,[{key:"draw",value:function(t){var e=this.currentPosition,i=this.radius,n=this.color,s=this.emoji,o=this.rotationAngle,a=this.emojiRotationAngle,r=this.emojiSize,h=window.devicePixelRatio;n?(t.fillStyle=n,t.beginPath(),t.ellipse(e.x*h,e.y*h,i.x*h,i.y*h,o,0,2*Math.PI),t.fill()):s&&(t.font="".concat(r,"px serif"),t.save(),t.translate(h*e.x,h*e.y),t.rotate(a),t.textAlign="center",t.fillText(s,0,0),t.restore())}},{key:"updatePosition",value:function(t,e){var i=this.confettiSpeed,n=this.dragForceCoefficient,s=this.finalConfettiSpeedX,o=this.radiusYUpdateDirection,a=this.rotationSpeed,r=this.createdAt,h=this.direction,c=e-r;i.x>s&&(this.confettiSpeed.x-=n*t),this.currentPosition.x+=i.x*("left"===h?-this.absCos:this.absCos)*t,this.currentPosition.y=this.initialPosition.y-i.y*this.absSin*c+.00125*Math.pow(c,2)/2,this.rotationSpeed-=this.emoji?1e-4:1e-5*t,this.rotationSpeed<0&&(this.rotationSpeed=0),this.emoji?this.emojiRotationAngle+=this.rotationSpeed*t%(2*Math.PI):"down"===o?(this.radius.y-=t*a,this.radius.y<=0&&(this.radius.y=0,this.radiusYUpdateDirection="up")):(this.radius.y+=t*a,this.radius.y>=this.initialRadius&&(this.radius.y=this.initialRadius,this.radiusYUpdateDirection="down"))}},{key:"getIsVisibleOnCanvas",value:function(t){return this.currentPosition.y0&&void 0!==arguments[0]?arguments[0]:{};t(this,e),this.activeConfettiBatches=[],this.canvas=i.canvas||c(),this.canvasContext=this.canvas.getContext("2d"),this.requestAnimationFrameRequested=!1,this.lastUpdated=(new Date).getTime(),this.iterationIndex=0,this.loop=this.loop.bind(this),requestAnimationFrame(this.loop)}return i(e,[{key:"loop",value:function(){var t,e,i,s,o;this.requestAnimationFrameRequested=!1,t=this.canvas,e=window.devicePixelRatio,i=getComputedStyle(t),s=n(i.getPropertyValue("width")),o=n(i.getPropertyValue("height")),t.setAttribute("width",(s*e).toString()),t.setAttribute("height",(o*e).toString());var a=(new Date).getTime(),r=a-this.lastUpdated,h=this.canvas.offsetHeight,c=this.iterationIndex%10==0;this.activeConfettiBatches=this.activeConfettiBatches.filter((function(t){return t.processShapes({timeDelta:r,currentTime:a},h,c),!c||!t.complete()})),this.iterationIndex++,this.queueAnimationFrameIfNeeded(a)}},{key:"queueAnimationFrameIfNeeded",value:function(t){this.requestAnimationFrameRequested||this.activeConfettiBatches.length<1||(this.requestAnimationFrameRequested=!0,this.lastUpdated=t||(new Date).getTime(),requestAnimationFrame(this.loop))}},{key:"addConfetti",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=u(t),i=e.confettiRadius,n=e.confettiNumber,s=e.confettiColors,o=e.emojis,a=e.emojiSize,r=this.canvas.getBoundingClientRect(),c=r.width,d=r.height,f=5*d/7,m={x:0,y:f},v={x:c,y:f},p=new l(this.canvasContext),y=0;y + + +
+
+ +
+ + + + +
+
+
+
+ + \ No newline at end of file diff --git a/force-app/main/default/lwc/quizAppCoponent/quizAppCoponent.js b/force-app/main/default/lwc/quizAppCoponent/quizAppCoponent.js new file mode 100644 index 0000000..5e5968f --- /dev/null +++ b/force-app/main/default/lwc/quizAppCoponent/quizAppCoponent.js @@ -0,0 +1,143 @@ +import { LightningElement, api } from 'lwc'; +import { ShowToastEvent } from 'lightning/platformShowToastEvent'; +import { JSConfetti } from './js-confetti'; + +export default class QuizAppCoponent extends LightningElement { + + myQuestions = [ + { + id: 1, + question: 'What is the capital of France?', + options: { + a: 'Paris', + b: 'London', + c: 'Rome', + d: 'Berlin' + }, + correctAnswer: 'a' + }, + { + id: 2, + question: 'What is the largest ocean in the world?', + options: { + a: 'Pacific Ocean', + b: 'Atlantic Ocean', + c: 'Southern Ocean', + d: 'Arctic Ocean' + }, + correctAnswer: 'a' + }, + { + id: 3, + question: 'What is the highest mountain in the world?', + options: { + a: 'Mount Everest', + b: 'Mount Kilimanjaro', + c: 'K2', + d: 'Mount Elbrus' + }, + correctAnswer: 'a' + }, + { + id: 4, + question: 'What is the full form of US?', + options: { + a: 'India', + b: 'United States', + c: 'Pakistan', + d: 'China' + }, + correctAnswer: 'b' + }, + { + id: 5, + question: 'What is the most common language in the world?', + options: { + a: 'Spanish', + b: 'English', + c: 'Arabic', + d: 'Hindi' + }, + correctAnswer: 'b' + } + ]; + selected = {}; + correctAnswer = 0; + + get allNotSelected() { + return !(Object.keys(this.selected).length === this.myQuestions.length); + } + get emojis() { + return this.correctAnswer <= 2 ? '🥺😟😔🥲' : '😀😁🥳🎇'; + } + get variant(){ + return this.correctAnswer <= 2 ? 'error' : 'success'; + } + + + handleChange(event) { + const { name, value } = event.target; + this.selected = { ...this.selected, [name]: value }; + + + } + handleSubmit(event) { + event.preventDefault(); + let correct = this.myQuestions.filter(item => this.selected[item.id] === item.correctAnswer); + this.correctAnswer = correct.length; + this.showConfetti(); + this.showToast(); + } + handleReset() { + this.selected = {}; + this.confetti(); + } + + showToast() { + const event = new ShowToastEvent({ + title: 'Your Score', + message: 'You scored ' + this.correctAnswer + ' out of ' + this.myQuestions.length, + variant: this.variant, + }); + this.dispatchEvent(event); + + } + @api size = 'small'; + @api number = 'normal'; + @api type = 'emoji'; + @api emoji = this.emojis; + + + + sizeOptions = [ + { label: 'small', value: 60 }, + { label: 'medium', value: 100 }, + { label: 'large', value: 140 } + ]; + numberOptions = [ + { label: 'few', value: 15 }, + { label: 'normal', value: 30 }, + { label: 'plenty', value: 50 } + ]; + + showConfetti() { + // Confetti will be shown immediatelly when component renders + const jsConfetti = new JSConfetti(); + // The emoji confettis accept the emojiSize and confettiNumber parameters + if (this.type === 'emoji') { + jsConfetti.addConfetti({ + emojis: [...this.emojis], + emojiSize: this.sizeOptions.filter(o => o.label === this.size)[0].value, + confettiNumber: this.numberOptions.filter(o => o.label === this.number)[0].value, + }); + } + + // The default confettis only accept the confettiNumber parameter + else { + jsConfetti.addConfetti({ + confettiNumber: this.numberOptions.filter(o => o.label === this.number)[0].value * 4, + }); + } + } + +} \ No newline at end of file diff --git a/force-app/main/default/lwc/quizAppCoponent/quizAppCoponent.js-meta.xml b/force-app/main/default/lwc/quizAppCoponent/quizAppCoponent.js-meta.xml new file mode 100644 index 0000000..95e1902 --- /dev/null +++ b/force-app/main/default/lwc/quizAppCoponent/quizAppCoponent.js-meta.xml @@ -0,0 +1,9 @@ + + + 59.0 + true + + lightning__AppPage + lightningCommunity__Page + + \ No newline at end of file diff --git a/force-app/main/default/lwc/recordPicker/recordPicker.html b/force-app/main/default/lwc/recordPicker/recordPicker.html new file mode 100644 index 0000000..3e9a961 --- /dev/null +++ b/force-app/main/default/lwc/recordPicker/recordPicker.html @@ -0,0 +1,16 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/recordPicker/recordPicker.js b/force-app/main/default/lwc/recordPicker/recordPicker.js new file mode 100644 index 0000000..b70b0d3 --- /dev/null +++ b/force-app/main/default/lwc/recordPicker/recordPicker.js @@ -0,0 +1,11 @@ +import { LightningElement } from 'lwc'; + +export default class RecordPicker extends LightningElement { + handleChange( event ) { + console.log(event.detail.recordId); + } + displayInfo = { + // primaryField: 'Account.Name', + additionalFields: ['Title'], + }; +} \ No newline at end of file diff --git a/force-app/main/default/lwc/recordPicker/recordPicker.js-meta.xml b/force-app/main/default/lwc/recordPicker/recordPicker.js-meta.xml new file mode 100644 index 0000000..5fecdd0 --- /dev/null +++ b/force-app/main/default/lwc/recordPicker/recordPicker.js-meta.xml @@ -0,0 +1,8 @@ + + + 58.0 + true + + lightning__HomePage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/refreshApexModule/refreshApexModule.html b/force-app/main/default/lwc/refreshApexModule/refreshApexModule.html new file mode 100644 index 0000000..44a997e --- /dev/null +++ b/force-app/main/default/lwc/refreshApexModule/refreshApexModule.html @@ -0,0 +1,15 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/refreshApexModule/refreshApexModule.js b/force-app/main/default/lwc/refreshApexModule/refreshApexModule.js new file mode 100644 index 0000000..2507b84 --- /dev/null +++ b/force-app/main/default/lwc/refreshApexModule/refreshApexModule.js @@ -0,0 +1,68 @@ +import { LightningElement, wire, track } from 'lwc'; +import findMethod from '@salesforce/apex/ApexController.findMethod'; +import changeMethod from '@salesforce/apex/ApexController.changeMethod'; +import {refreshApex} from '@salesforce/apex'; +import { ShowToastEvent } from 'lightning/platformShowToastEvent'; + +export default class RefreshApexModule extends LightningElement { + @track paramForChangeOne; + @ track parameters; + + + // Wired Apex result + _wiredResult; + connectedCallback(){ + console.log(this.parameters) + } + + @wire(findMethod, { paramOne: '$paramForChangeOne'}) + wiredCallback(result) { + this._wiredResult = result; + console.log(result); + if (result.data) { + this.parameters = result.data; + + this.error = undefined; + } else if (result.error) { + this.error = result.error; + this.parameters = undefined; + } + } + + // Function to refresh data + refreshData() { + return refreshApex(this._wiredResult); + } + + // Function to change something and then refresh the data + callFromHtml() { + console.log('@@@Call from html called'); + console.log('@paramett2222',this.parameters) + changeMethod({paramForChangeOne: this.paramForChangeOne}) + .then(result => { + if (result) { + this.showNotification('success', 'Success Message', ''); + } + // Refreshing table data using refresh apex + return this.refreshData(); + }) + .catch(error => { + console.log(error); + }); + } + + showNotification(variant, title, message) { + const evt = new ShowToastEvent({ + title: title, + message: message, + variant: variant, + }); + this.dispatchEvent(evt); + } + + handleParamOneChange(event) { + this.paramForChangeOne = event.target.value; + } + + +} \ No newline at end of file diff --git a/force-app/main/default/lwc/refreshApexModule/refreshApexModule.js-meta.xml b/force-app/main/default/lwc/refreshApexModule/refreshApexModule.js-meta.xml new file mode 100644 index 0000000..56af8a8 --- /dev/null +++ b/force-app/main/default/lwc/refreshApexModule/refreshApexModule.js-meta.xml @@ -0,0 +1,9 @@ + + + 58.0 + true + + lightning__RecordPage + lightning__HomePage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/relatedContact/relatedContact.html b/force-app/main/default/lwc/relatedContact/relatedContact.html new file mode 100644 index 0000000..74c5d72 --- /dev/null +++ b/force-app/main/default/lwc/relatedContact/relatedContact.html @@ -0,0 +1,15 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/relatedContact/relatedContact.js b/force-app/main/default/lwc/relatedContact/relatedContact.js new file mode 100644 index 0000000..bac9359 --- /dev/null +++ b/force-app/main/default/lwc/relatedContact/relatedContact.js @@ -0,0 +1,44 @@ +import { LightningElement,wire,track,api } from 'lwc'; +import getcon from '@salesforce/apex/RelatedCon.getcon'; +export default class RelatedContact extends LightningElement { + + @api recordId; + + @track columns = [{ + label: 'FirstName', + fieldName: 'firstName', + type: 'text', + sortable: true + }, + + { + label: 'LastName', + fieldName: 'LastName', + type: 'text', + sortable: true + }, + { + label: 'Email', + fieldName: 'Email', + type: 'Email', + sortable: true + }, + { + label: 'Phone ', + fieldName: 'phone', + type: 'Phone', + sortable: true + } +]; + +@track error; +@track ConList ; +@wire(getcon,{acId:'$recordId'}) wiredContact({error, data}) { + if (data) { + this.ConList = data; + console.log("@@@@@data"+data); + } else if (error) { + this.error = error; + } +} +} \ No newline at end of file diff --git a/force-app/main/default/lwc/relatedContact/relatedContact.js-meta.xml b/force-app/main/default/lwc/relatedContact/relatedContact.js-meta.xml new file mode 100644 index 0000000..bdb4682 --- /dev/null +++ b/force-app/main/default/lwc/relatedContact/relatedContact.js-meta.xml @@ -0,0 +1,9 @@ + + + 57.0 + true + + lightning__HomePage + lightning__RecordPage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/relatedPlayer/relatedPlayer.html b/force-app/main/default/lwc/relatedPlayer/relatedPlayer.html new file mode 100644 index 0000000..5a47704 --- /dev/null +++ b/force-app/main/default/lwc/relatedPlayer/relatedPlayer.html @@ -0,0 +1,28 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/relatedPlayer/relatedPlayer.js b/force-app/main/default/lwc/relatedPlayer/relatedPlayer.js new file mode 100644 index 0000000..be613b9 --- /dev/null +++ b/force-app/main/default/lwc/relatedPlayer/relatedPlayer.js @@ -0,0 +1,96 @@ +// Importing necessary modules from the Lightning Web Components (LWC) and Salesforce Apex +import { LightningElement,api,track} from 'lwc'; +import getPlayerList from '@salesforce/apex/getPlayer.getPlayerList'; +import {NavigationMixin} from 'lightning/navigation'; + +// Defining actions for the data table +const actions=[ + {label:'View',name:'view'}, +]; + +// Defining columns for the data table +const columns=[ + {label:'Player Name',fieldName:'Name'}, + {label:'Country',fieldName:'Country__c'}, + { + type:'action', + typeAttributes : { rowActions : actions}, + }, +]; + +// Exporting the default class which extends NavigationMixin and LightningElement +export default class RelatedPlayer extends NavigationMixin(LightningElement ){ + @track showPlayer='Show Player'; // Track variable for button label + + @track isVisible=false; // Track variable for visibility of player list + + @api recordId; // Record Id from the parent component + + @track data=[]; // Track variable for storing player data + + @track playerData=[]; // Track variable for storing player data + + columns=columns; // Columns for the data table + + error; // Variable to store any error during Apex method call + + // Lifecycle hook which fires when component is inserted into DOM + connectedCallback(){ + console.log(this.recordId); + //get player list + getPlayerList({SelectedId:this.recordId}) + .then(result=>{ + this.data=result; + console.log(result); + }) + .catch(error=>{ + this.error=error; + }) + } + + // Function to handle click event of the button + handleclick(event){ + const label=event.target.label; + if(label==='Show Player'){ + this.showPlayer='Hide Player'; + this.isVisible=true; + + }else if(label==="Hide Player"){ + this.showPlayer="Show Player" + this.isVisible=false; + + } + } + + // Function to handle row action of the data table + handleRowAction(event){ + const actionName=event.detail.action.name; + const row=event.detail.row; + switch(actionName){ + case 'view': + this.navigateToPlayerRecordPage(row); + break + default: + } + + } + + // Function to navigate to player record page + navigateToPlayerRecordPage(rowData){ + const player=rowData; + console.log(player); + console.log('Playrer Id' , player.Id); + + if(player.Id){ + this[NavigationMixin.Navigate]({ + type: 'standard__recordPage', + attributes: { + recordId: player.Id, + actionName: 'view', + }, + }) + } + + + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/relatedPlayer/relatedPlayer.js-meta.xml b/force-app/main/default/lwc/relatedPlayer/relatedPlayer.js-meta.xml new file mode 100644 index 0000000..2323255 --- /dev/null +++ b/force-app/main/default/lwc/relatedPlayer/relatedPlayer.js-meta.xml @@ -0,0 +1,9 @@ + + + 58.0 + true + + lightning__AppPage + lightning__RecordPage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/relatedRecordComponent/relatedRecordComponent.html b/force-app/main/default/lwc/relatedRecordComponent/relatedRecordComponent.html new file mode 100644 index 0000000..1d792a9 --- /dev/null +++ b/force-app/main/default/lwc/relatedRecordComponent/relatedRecordComponent.html @@ -0,0 +1,39 @@ + + \ No newline at end of file diff --git a/force-app/main/default/lwc/relatedRecordComponent/relatedRecordComponent.js b/force-app/main/default/lwc/relatedRecordComponent/relatedRecordComponent.js new file mode 100644 index 0000000..6bf7642 --- /dev/null +++ b/force-app/main/default/lwc/relatedRecordComponent/relatedRecordComponent.js @@ -0,0 +1,133 @@ +import { LightningElement, wire, track, api } from 'lwc'; +import getAccountContacts from '@salesforce/apex/AccountRelatedListController.getAccountContacts'; +import getAccountOpportunities from '@salesforce/apex/AccountRelatedListController.getAccountOpportunities'; +import updateFileds from '@salesforce/apex/AccountRelatedListController.updateFileds'; +import { ShowToastEvent } from 'lightning/platformShowToastEvent'; +import { refreshApex } from '@salesforce/apex'; +import { getObjectInfo, getPicklistValues } from "lightning/uiObjectInfoApi"; +import OPPORTUNITY_OBJECT from "@salesforce/schema/Opportunity"; +import STAGE_FIELD from "@salesforce/schema/Opportunity.StageName"; + +export default class RelatedRecordComponent extends LightningElement { + @api recordId; + @track contactsData = []; + @track opportunitiesData = []; + @track draftValues = []; + @track ValuesToUpdate = []; + @track stageOptions; + opportunityRecordTypeId; + stages; + sumOfAmount=0; + + @wire(getObjectInfo, { objectApiName: OPPORTUNITY_OBJECT }) + results({ error, data }) { + if (data) { + this.opportunityRecordTypeId = data.defaultRecordTypeId; + this.error = undefined; + } else if (error) { + this.error = error; + this.opportunityRecordTypeId = undefined; + } + } + + @wire(getPicklistValues, { recordTypeId: "$opportunityRecordTypeId", fieldApiName: STAGE_FIELD }) + picklistResults({ error, data }) { + if (data) { + this.stages = data.values; + console.log('stages ',this.stages); + this.error = undefined; + this.stageOptions = this.stages.map(item => item.value); + console.log('stageOptions',this.stageOptions); + } else if (error) { + this.error = error; + this.stages = undefined; + console.log('stages ',this.stages); + } + } + + + contactsColumns = [ + { label: 'Name', fieldName: 'Name', editable: true }, + { label: 'Email', fieldName: 'Email', type: 'email', editable: true }, + { label: 'Phone', fieldName: 'Phone', type: 'phone', editable: true }, + // Add more fields as needed + ]; + + opportunitiesColumns = [ + { label: 'Name', fieldName: 'Name', editable: true }, + { + label: 'Stage', + fieldName: 'StageName', + type: 'picklist', + editable: true, + typeAttributes: { + placeholder: 'Choose Stage', + options: this.stageOptions, // provide options from StageName picklist values + value: { fieldName: 'StageName' }, // bind to StageName field + context: { fieldName: 'Id' }, // bind to record Id + variant: 'label-hidden', + name: 'StageName', + label: 'Stage' + } + }, + { label: 'Amount', fieldName: 'Amount', type: 'currency', editable: true }, + // Add more fields as needed + ]; + + @wire(getAccountContacts, { accountId: '$recordId' }) + wiredContacts({ error, data }) { + if (data) { + this.contactsData = data; + } else if (error) { + console.error('Error fetching contacts:', error); + } + } + + @wire(getAccountOpportunities, { accountId: '$recordId' }) + wiredOpportunities({ error, data }) { + if (data) { + this.opportunitiesData = data; + this.opportunitiesData.forEach(item =>{ + this.sumOfAmount +=item.Amount + }) + + } else if (error) { + console.error('Error fetching opportunities:', error); + } + } + + handleSave(event) { + this.ValuesToUpdate = event.detail.draftValues; + console.log('ValuesToUpdate:', this.ValuesToUpdate); + + updateFileds({recordInput:this.ValuesToUpdate}) + .then(() => { + this.dispatchEvent( + new ShowToastEvent({ + title: 'Success', + message: 'Records updated', + variant: 'success' + }) + ); + // Clear all draft values + this.draftValues = []; + // this.ValuesToUpdate = []; + + return Promise.all([ + refreshApex(this.contactsData), + refreshApex(this.opportunitiesData) + ]); + }) + .catch(error => { + // Handle error + console.error('Error updating record:', error.body.message); + this.dispatchEvent( + new ShowToastEvent({ + title: 'Error', + message: error.body.message, + variant: 'error' + }) + ); + }); + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/relatedRecordComponent/relatedRecordComponent.js-meta.xml b/force-app/main/default/lwc/relatedRecordComponent/relatedRecordComponent.js-meta.xml new file mode 100644 index 0000000..0ac90a6 --- /dev/null +++ b/force-app/main/default/lwc/relatedRecordComponent/relatedRecordComponent.js-meta.xml @@ -0,0 +1,8 @@ + + + 59.0 + true + + lightning__RecordPage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/renderMethodComponent/renderMethodComponent.html b/force-app/main/default/lwc/renderMethodComponent/renderMethodComponent.html new file mode 100644 index 0000000..9718b65 --- /dev/null +++ b/force-app/main/default/lwc/renderMethodComponent/renderMethodComponent.html @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/renderMethodComponent/renderMethodComponent.js b/force-app/main/default/lwc/renderMethodComponent/renderMethodComponent.js new file mode 100644 index 0000000..1d6f81f --- /dev/null +++ b/force-app/main/default/lwc/renderMethodComponent/renderMethodComponent.js @@ -0,0 +1,24 @@ +import { LightningElement } from 'lwc'; +import { ShowToastEvent } from 'lightning/platformShowToastEvent'; +import signUpTamplate from './signUpTamplate.html' +import signInTemplate from './signInTemplate.html' +import renderTamplate from './renderMethodComponent.html' +export default class RenderMethodComponent extends LightningElement { + selectedBtn = '' + render(){ + return this.selectedBtn === 'SignUp' ? signUpTamplate : + this.selectedBtn === "SignIn" ? signInTemplate : + renderTamplate + } + handleClick(event){ + this.selectedBtn = event.target.label; + } + submitHandler(event){ + this.dispatchEvent(new ShowToastEvent({ + title: `${event.target.label} `, + message: `${event.target.label} Successfully`, + variant: "success" + })); + } + +} \ No newline at end of file diff --git a/force-app/main/default/lwc/renderMethodComponent/renderMethodComponent.js-meta.xml b/force-app/main/default/lwc/renderMethodComponent/renderMethodComponent.js-meta.xml new file mode 100644 index 0000000..011be21 --- /dev/null +++ b/force-app/main/default/lwc/renderMethodComponent/renderMethodComponent.js-meta.xml @@ -0,0 +1,8 @@ + + + 59.0 + true + + lightning__AppPage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/renderMethodComponent/signInTemplate.html b/force-app/main/default/lwc/renderMethodComponent/signInTemplate.html new file mode 100644 index 0000000..69a5c1e --- /dev/null +++ b/force-app/main/default/lwc/renderMethodComponent/signInTemplate.html @@ -0,0 +1,24 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/renderMethodComponent/signUpTamplate.html b/force-app/main/default/lwc/renderMethodComponent/signUpTamplate.html new file mode 100644 index 0000000..34fc777 --- /dev/null +++ b/force-app/main/default/lwc/renderMethodComponent/signUpTamplate.html @@ -0,0 +1,26 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/searchRecord/searchRecord.html b/force-app/main/default/lwc/searchRecord/searchRecord.html new file mode 100644 index 0000000..685fd29 --- /dev/null +++ b/force-app/main/default/lwc/searchRecord/searchRecord.html @@ -0,0 +1,30 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/searchRecord/searchRecord.js b/force-app/main/default/lwc/searchRecord/searchRecord.js new file mode 100644 index 0000000..a303ff5 --- /dev/null +++ b/force-app/main/default/lwc/searchRecord/searchRecord.js @@ -0,0 +1,34 @@ +import { LightningElement,track,wire} from 'lwc'; +import sRecords from '@salesforce/apex/SearchRecord.sRecords'; +export default class SearchRecord extends LightningElement { + + @track AccName =''; + @track acclist =[]; + @track searchedRecord=false; + @track accId; + @track msgResult=false; + @wire (sRecords,{input: '$AccName'}) records({error,data}){ + if(data){ + this.acclist=data; + this.searchedRecord=data.length>0; + this.msgResult=data.length=== 0 && this.AccName !==''; + + } + else if(error){ + console.log(error); + } + } + Search(event){ + this.AccName = event.target.value; + } + + seletion(event){ + this.accId=event.target.dataset.value; + console.log('@@@@@@ getting selected id: '+this.accId); + this.AccName=event.target.dataset.label; + const sevent=new CustomEvent('Selected',{ detail:this.accId}); + this.dispatchEvent(sevent); + searchedRecord=false; + } + +} \ No newline at end of file diff --git a/force-app/main/default/lwc/searchRecord/searchRecord.js-meta.xml b/force-app/main/default/lwc/searchRecord/searchRecord.js-meta.xml new file mode 100644 index 0000000..bdb4682 --- /dev/null +++ b/force-app/main/default/lwc/searchRecord/searchRecord.js-meta.xml @@ -0,0 +1,9 @@ + + + 57.0 + true + + lightning__HomePage + lightning__RecordPage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/sendMoneyComponantRMG/SendMoneyComponantRMG.css b/force-app/main/default/lwc/sendMoneyComponantRMG/SendMoneyComponantRMG.css new file mode 100644 index 0000000..7ab35b0 --- /dev/null +++ b/force-app/main/default/lwc/sendMoneyComponantRMG/SendMoneyComponantRMG.css @@ -0,0 +1,4 @@ +.bordered-card { + border: 1px solid #000; /* Adjust color and width as needed */ + cursor: pointer; +} \ No newline at end of file diff --git a/force-app/main/default/lwc/sendMoneyComponantRMG/sendMoneyComponantRMG.html b/force-app/main/default/lwc/sendMoneyComponantRMG/sendMoneyComponantRMG.html new file mode 100644 index 0000000..9d16b09 --- /dev/null +++ b/force-app/main/default/lwc/sendMoneyComponantRMG/sendMoneyComponantRMG.html @@ -0,0 +1,44 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/sendMoneyComponantRMG/sendMoneyComponantRMG.js b/force-app/main/default/lwc/sendMoneyComponantRMG/sendMoneyComponantRMG.js new file mode 100644 index 0000000..1751c88 --- /dev/null +++ b/force-app/main/default/lwc/sendMoneyComponantRMG/sendMoneyComponantRMG.js @@ -0,0 +1,3 @@ +import { LightningElement } from 'lwc'; + +export default class SendMoneyComponantRMG extends LightningElement {} \ No newline at end of file diff --git a/force-app/main/default/lwc/sendMoneyComponantRMG/sendMoneyComponantRMG.js-meta.xml b/force-app/main/default/lwc/sendMoneyComponantRMG/sendMoneyComponantRMG.js-meta.xml new file mode 100644 index 0000000..cd49d55 --- /dev/null +++ b/force-app/main/default/lwc/sendMoneyComponantRMG/sendMoneyComponantRMG.js-meta.xml @@ -0,0 +1,24 @@ + + + 50.0 + true + + lightning__RecordPage + lightning__AppPage + lightning__HomePage + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/force-app/main/default/lwc/sendMoneyWithRMGPAY/sendMoneyWithRMGPAY.css b/force-app/main/default/lwc/sendMoneyWithRMGPAY/sendMoneyWithRMGPAY.css new file mode 100644 index 0000000..1a2d8a7 --- /dev/null +++ b/force-app/main/default/lwc/sendMoneyWithRMGPAY/sendMoneyWithRMGPAY.css @@ -0,0 +1,148 @@ +/* Main container */ +.container { + width: 100%; + padding: 20px; + font-family: Arial, sans-serif; + background-color: #f2f2f4; +} + +.container h1 { + font-size: 24px; + color: #172068; + font-weight: bold; +} + +.container p { + font-weight: bold; + font-size: 16px; + color: #5e5454; +} +/* options css */ +.options { + display: flex; + justify-content: space-between; + margin-top: 20px; +} +/* option css for ever option */ +.options .option { + background-color: #ffffff; + flex: 1; + padding: 10px; + text-align: center; + cursor: pointer; + box-shadow: 0px 0px 1px 0px ; /* Adjusted shadow */ + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + margin: 10px; + border-radius: 10px; + height: 200px; +} +/* option text */ +.option-text{ + font-size: 15px; + color: #6878be; +} + +/* logo for css */ +.logo { + width: 40px; + height: 40px; + border-radius: 50%; + background-color: #f5f5f5; + padding: 5px; + fill: #192b67; +} + +/* Added this media query at the end of your CSS */ +@media (max-width: 600px) { + .options { + flex-direction: column; + } +} + +/* css for accordion */ +.accordion-button { + display: flex; + width: 100%; + align-items: flex-start; + justify-content: space-between; + padding: 10px 0; + + background-color: #ffffff; + border: none; + flex: 1; + padding: 10px; + color:#6878be; + box-shadow: 0px 0px 1px 0px; + + +} + +.accordion-button .content { + display: flex; + align-items: center; + +} + +/* css for arrow finctionality */ +.arrow { + float: right; /* This positions the icon on the right */ + font-weight: bold; + font-size: 16px; /* This increases the size of the icon */ +} +.arrow.right { + transform: rotate(0deg); +} + +.arrow.down { + transform: rotate(90deg); +} + +/* css for accordion content */ +.accordion-content { + display: none; + padding: 10px 10px 10px 40px; + background-color: #ffffff; + box-shadow: 0px 0px 1px 0px ; + color:#6878be; + + +} + +.container h1, .container p, .accordion { + padding-left: 10px; + padding-right: 10px; +} +/* css for background round circle of icons */ +.icon-circle { + display: inline-flex; + justify-content: center; + align-items: center; + border-radius: 50%; + padding: 5px; + background-color: #f5f5f5; + margin-right: 10px; + +} + + +/* first and last border redius */ +.four { + border-bottom-left-radius: 10px; + border-bottom-right-radius: 10px; +} +.first{ + border-top-right-radius: 10px; + border-top-left-radius: 10px; +} + +.accordion{ + margin-top: 10px; + color: #6878be; +} + /* svg icon color */ +.icon-circle svg{ + fill: #6878be; +} \ No newline at end of file diff --git a/force-app/main/default/lwc/sendMoneyWithRMGPAY/sendMoneyWithRMGPAY.html b/force-app/main/default/lwc/sendMoneyWithRMGPAY/sendMoneyWithRMGPAY.html new file mode 100644 index 0000000..8893b9c --- /dev/null +++ b/force-app/main/default/lwc/sendMoneyWithRMGPAY/sendMoneyWithRMGPAY.html @@ -0,0 +1,118 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/sendMoneyWithRMGPAY/sendMoneyWithRMGPAY.js b/force-app/main/default/lwc/sendMoneyWithRMGPAY/sendMoneyWithRMGPAY.js new file mode 100644 index 0000000..139a07e --- /dev/null +++ b/force-app/main/default/lwc/sendMoneyWithRMGPAY/sendMoneyWithRMGPAY.js @@ -0,0 +1,57 @@ +// Importing necessary modules from the Lightning Web Components (LWC) library +import { LightningElement } from 'lwc'; + +// Defining a new class 'SendMoneyWithRMGPAY' which extends from 'LightningElement' +export default class SendMoneyWithRMGPAY extends LightningElement { + + // Method to handle click events on the first card + + handleclick() { + console.log("handling click on first card"); + } + + // Method to handle click events on the accordion buttons + + handleOnClick(event) { + + // Get the target element from the event object + let target = event.target; + + // Check if the target is an SVG, a path, an arrow, a span, or has the class 'content' + + if (target.tagName.toLowerCase() === 'svg' || target.tagName.toLowerCase() === 'path' || target.classList.contains('arrow') || target.tagName.toLowerCase() === 'span' || target.classList.contains('content')) { + + // If so, find the closest parent element with the class 'accordion-button' + + target = target.closest('.accordion-button'); + } + + // Toggle the 'active' class on the target element + + target.classList.toggle("active"); + + // Get the next sibling element of the target (the content panel of the accordion) + + let panel = target.nextElementSibling; + + // Find the arrow element within the target + + let arrow = target.querySelector('.arrow'); + + // Check if the panel is currently displayed + + if (panel.style.display === "block") { + + // If so, hide the panel and change the arrow to point right + panel.style.display = "none"; + arrow.classList.remove('down'); + arrow.classList.add('right'); + } else { + + // If not, display the panel and change the arrow to point down + panel.style.display = "block"; + arrow.classList.remove('right'); + arrow.classList.add('down'); + } + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/sendMoneyWithRMGPAY/sendMoneyWithRMGPAY.js-meta.xml b/force-app/main/default/lwc/sendMoneyWithRMGPAY/sendMoneyWithRMGPAY.js-meta.xml new file mode 100644 index 0000000..150a75c --- /dev/null +++ b/force-app/main/default/lwc/sendMoneyWithRMGPAY/sendMoneyWithRMGPAY.js-meta.xml @@ -0,0 +1,28 @@ + + + 58.0 + true + + lightning__RecordPage + lightning__AppPage + lightning__HomePage + lightningCommunity__Default + lightningCommunity__Page + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/force-app/main/default/lwc/setterDemoChildComponent/setterDemoChildComponent.html b/force-app/main/default/lwc/setterDemoChildComponent/setterDemoChildComponent.html new file mode 100644 index 0000000..da75b4c --- /dev/null +++ b/force-app/main/default/lwc/setterDemoChildComponent/setterDemoChildComponent.html @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/setterDemoChildComponent/setterDemoChildComponent.js b/force-app/main/default/lwc/setterDemoChildComponent/setterDemoChildComponent.js new file mode 100644 index 0000000..261b37f --- /dev/null +++ b/force-app/main/default/lwc/setterDemoChildComponent/setterDemoChildComponent.js @@ -0,0 +1,14 @@ +import { LightningElement,api } from 'lwc'; + +export default class SetterDemoChildComponent extends LightningElement { + userDetails + @api + get details(){ + return this.userDetails; + } + set details(data){ + let newAge = data.age*2 + this.userDetails = {...data,age:newAge}; + + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/setterDemoChildComponent/setterDemoChildComponent.js-meta.xml b/force-app/main/default/lwc/setterDemoChildComponent/setterDemoChildComponent.js-meta.xml new file mode 100644 index 0000000..6127d85 --- /dev/null +++ b/force-app/main/default/lwc/setterDemoChildComponent/setterDemoChildComponent.js-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + false + \ No newline at end of file diff --git a/force-app/main/default/lwc/setterDemoParentComponent/setterDemoParentComponent.html b/force-app/main/default/lwc/setterDemoParentComponent/setterDemoParentComponent.html new file mode 100644 index 0000000..9240818 --- /dev/null +++ b/force-app/main/default/lwc/setterDemoParentComponent/setterDemoParentComponent.html @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/setterDemoParentComponent/setterDemoParentComponent.js b/force-app/main/default/lwc/setterDemoParentComponent/setterDemoParentComponent.js new file mode 100644 index 0000000..a267f9f --- /dev/null +++ b/force-app/main/default/lwc/setterDemoParentComponent/setterDemoParentComponent.js @@ -0,0 +1,8 @@ +import { LightningElement } from 'lwc'; + +export default class SetterDemoParentComponent extends LightningElement { + userDetails = { + name : 'Yumi', + age : 25, + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/setterDemoParentComponent/setterDemoParentComponent.js-meta.xml b/force-app/main/default/lwc/setterDemoParentComponent/setterDemoParentComponent.js-meta.xml new file mode 100644 index 0000000..011be21 --- /dev/null +++ b/force-app/main/default/lwc/setterDemoParentComponent/setterDemoParentComponent.js-meta.xml @@ -0,0 +1,8 @@ + + + 59.0 + true + + lightning__AppPage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/slotChildComponent/slotChildComponent.html b/force-app/main/default/lwc/slotChildComponent/slotChildComponent.html new file mode 100644 index 0000000..1176442 --- /dev/null +++ b/force-app/main/default/lwc/slotChildComponent/slotChildComponent.html @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/slotChildComponent/slotChildComponent.js b/force-app/main/default/lwc/slotChildComponent/slotChildComponent.js new file mode 100644 index 0000000..25860ea --- /dev/null +++ b/force-app/main/default/lwc/slotChildComponent/slotChildComponent.js @@ -0,0 +1,3 @@ +import { LightningElement } from 'lwc'; + +export default class SlotChildComponent extends LightningElement {} \ No newline at end of file diff --git a/force-app/main/default/lwc/slotChildComponent/slotChildComponent.js-meta.xml b/force-app/main/default/lwc/slotChildComponent/slotChildComponent.js-meta.xml new file mode 100644 index 0000000..6127d85 --- /dev/null +++ b/force-app/main/default/lwc/slotChildComponent/slotChildComponent.js-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + false + \ No newline at end of file diff --git a/force-app/main/default/lwc/slotParentComponent/slotParentComponent.html b/force-app/main/default/lwc/slotParentComponent/slotParentComponent.html new file mode 100644 index 0000000..908e025 --- /dev/null +++ b/force-app/main/default/lwc/slotParentComponent/slotParentComponent.html @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/slotParentComponent/slotParentComponent.js b/force-app/main/default/lwc/slotParentComponent/slotParentComponent.js new file mode 100644 index 0000000..462ef43 --- /dev/null +++ b/force-app/main/default/lwc/slotParentComponent/slotParentComponent.js @@ -0,0 +1,3 @@ +import { LightningElement } from 'lwc'; + +export default class SlotParentComponent extends LightningElement {} \ No newline at end of file diff --git a/force-app/main/default/lwc/slotParentComponent/slotParentComponent.js-meta.xml b/force-app/main/default/lwc/slotParentComponent/slotParentComponent.js-meta.xml new file mode 100644 index 0000000..011be21 --- /dev/null +++ b/force-app/main/default/lwc/slotParentComponent/slotParentComponent.js-meta.xml @@ -0,0 +1,8 @@ + + + 59.0 + true + + lightning__AppPage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/subscriber/subscriber.html b/force-app/main/default/lwc/subscriber/subscriber.html new file mode 100644 index 0000000..2c7e789 --- /dev/null +++ b/force-app/main/default/lwc/subscriber/subscriber.html @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/subscriber/subscriber.js b/force-app/main/default/lwc/subscriber/subscriber.js new file mode 100644 index 0000000..8f24405 --- /dev/null +++ b/force-app/main/default/lwc/subscriber/subscriber.js @@ -0,0 +1,16 @@ +import { LightningElement } from 'lwc'; +import pubSub from 'c/pubSub'; +export default class Subscriber extends LightningElement { + message; + connectedCallback(){ + this.register(); + } + handleEvent(messageFromEvt){ + console.log("event handled",messageFromEvt.message); + this.message=messageFromEvt.message; + } + register(){ + console.log('event registerd'); + pubSub.register('simplevt',this.handleEvent.bind(this)) + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/subscriber/subscriber.js-meta.xml b/force-app/main/default/lwc/subscriber/subscriber.js-meta.xml new file mode 100644 index 0000000..9fa43f2 --- /dev/null +++ b/force-app/main/default/lwc/subscriber/subscriber.js-meta.xml @@ -0,0 +1,9 @@ + + + 59.0 + true + + lightning__HomePage + lightning__RecordPage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/testLwc/testLwc.html b/force-app/main/default/lwc/testLwc/testLwc.html new file mode 100644 index 0000000..93af483 --- /dev/null +++ b/force-app/main/default/lwc/testLwc/testLwc.html @@ -0,0 +1,8 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/testLwc/testLwc.js b/force-app/main/default/lwc/testLwc/testLwc.js new file mode 100644 index 0000000..1db0b0b --- /dev/null +++ b/force-app/main/default/lwc/testLwc/testLwc.js @@ -0,0 +1,17 @@ +import { LightningElement } from 'lwc'; +import { NavigationMixin } from 'lightning/navigation'; +export default class TestLwc extends NavigationMixin(LightningElement) { + + navigateToAccountsList() { + this[NavigationMixin.Navigate]({ + type: 'standard__objectPage', + attributes: { + objectApiName: 'Account', + actionName: 'list' + }, + state: { + filterName: 'Recent' // Optional filter name + } + }); + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/testLwc/testLwc.js-meta.xml b/force-app/main/default/lwc/testLwc/testLwc.js-meta.xml new file mode 100644 index 0000000..e46dbc2 --- /dev/null +++ b/force-app/main/default/lwc/testLwc/testLwc.js-meta.xml @@ -0,0 +1,9 @@ + + + 59.0 + true + + lightning__HomePage + lightning__FlowScreen + + \ No newline at end of file diff --git a/force-app/main/default/lwc/toDoListComponent/toDoListComponent.html b/force-app/main/default/lwc/toDoListComponent/toDoListComponent.html new file mode 100644 index 0000000..bf5f509 --- /dev/null +++ b/force-app/main/default/lwc/toDoListComponent/toDoListComponent.html @@ -0,0 +1,31 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/toDoListComponent/toDoListComponent.js b/force-app/main/default/lwc/toDoListComponent/toDoListComponent.js new file mode 100644 index 0000000..d920454 --- /dev/null +++ b/force-app/main/default/lwc/toDoListComponent/toDoListComponent.js @@ -0,0 +1,30 @@ +import { LightningElement } from 'lwc'; + +export default class ToDoListComponent extends LightningElement { + titleValue = ''; + descriptionValue = ''; + createTask = false; + isDisabled = true; + + handleChange(event) { + if (event.target.label === 'Title') { + this.titleValue = event.target.value; + } else if (event.target.label === 'Description') { + this.descriptionValue = event.target.value; + } + this.updateButtonState(); + } + + updateButtonState() { + if (this.titleValue != '' && this.titleValue === ' ') { + this.isDisabled = false; + } else { + this.isDisabled = true; + } + } + + handleCreate() { + console.log(this.titleValue, this.descriptionValue); + this.createTask = true; + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/toDoListComponent/toDoListComponent.js-meta.xml b/force-app/main/default/lwc/toDoListComponent/toDoListComponent.js-meta.xml new file mode 100644 index 0000000..011be21 --- /dev/null +++ b/force-app/main/default/lwc/toDoListComponent/toDoListComponent.js-meta.xml @@ -0,0 +1,8 @@ + + + 59.0 + true + + lightning__AppPage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/trackDemo/trackDemo.html b/force-app/main/default/lwc/trackDemo/trackDemo.html new file mode 100644 index 0000000..87c90e3 --- /dev/null +++ b/force-app/main/default/lwc/trackDemo/trackDemo.html @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/trackDemo/trackDemo.js b/force-app/main/default/lwc/trackDemo/trackDemo.js new file mode 100644 index 0000000..161e8da --- /dev/null +++ b/force-app/main/default/lwc/trackDemo/trackDemo.js @@ -0,0 +1,19 @@ +import { LightningElement,track } from 'lwc'; + +export default class TrackDemo extends LightningElement { + + @track fullName={firstName:"",lastName:""}; + + handleChange(event){ + const field=event.target.name; + // window.alert(field) + + if(field === 'firstName'){ + this.fullName.firstName=event.target.value; + } + else if(field === 'lastName'){ + this.fullName.lastName=event.target.value; + } + + } +} \ No newline at end of file diff --git a/force-app/main/default/lwc/trackDemo/trackDemo.js-meta.xml b/force-app/main/default/lwc/trackDemo/trackDemo.js-meta.xml new file mode 100644 index 0000000..519ef48 --- /dev/null +++ b/force-app/main/default/lwc/trackDemo/trackDemo.js-meta.xml @@ -0,0 +1,8 @@ + + + 57.0 + true + + lightning__HomePage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/weatherApplication/__tests__/weatherApplication.test.js b/force-app/main/default/lwc/weatherApplication/__tests__/weatherApplication.test.js new file mode 100644 index 0000000..c703304 --- /dev/null +++ b/force-app/main/default/lwc/weatherApplication/__tests__/weatherApplication.test.js @@ -0,0 +1,25 @@ +import { createElement } from 'lwc'; +import WeatherApplication from 'c/weatherApplication'; + +describe('c-weather-application', () => { + afterEach(() => { + // The jsdom instance is shared across test cases in a single file so reset the DOM + while (document.body.firstChild) { + document.body.removeChild(document.body.firstChild); + } + }); + + it('TODO: test case generated by CLI command, please fill in test logic', () => { + // Arrange + const element = createElement('c-weather-application', { + is: WeatherApplication + }); + + // Act + document.body.appendChild(element); + + // Assert + // const div = element.shadowRoot.querySelector('div'); + expect(1).toBe(1); + }); +}); \ No newline at end of file diff --git a/force-app/main/default/lwc/weatherApplication/weatherApplication.html b/force-app/main/default/lwc/weatherApplication/weatherApplication.html new file mode 100644 index 0000000..49b786e --- /dev/null +++ b/force-app/main/default/lwc/weatherApplication/weatherApplication.html @@ -0,0 +1,67 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/weatherApplication/weatherApplication.js b/force-app/main/default/lwc/weatherApplication/weatherApplication.js new file mode 100644 index 0000000..d8508f3 --- /dev/null +++ b/force-app/main/default/lwc/weatherApplication/weatherApplication.js @@ -0,0 +1,19 @@ +import { LightningElement } from 'lwc'; + +export default class WeatherApplication extends LightningElement { + value = ''; + + get options() { + return [ + // { label: 'choose one...', value: '' }, + { label: 'one', value: '1' }, + { label: 'two', value: '2' }, + { label: 'three', value: '3' }, + ]; + } + + handleChange(event) { + this.value = event.detail.value; + } + +} \ No newline at end of file diff --git a/force-app/main/default/lwc/weatherApplication/weatherApplication.js-meta.xml b/force-app/main/default/lwc/weatherApplication/weatherApplication.js-meta.xml new file mode 100644 index 0000000..90b3bcd --- /dev/null +++ b/force-app/main/default/lwc/weatherApplication/weatherApplication.js-meta.xml @@ -0,0 +1,8 @@ + + + 61.0 + true + + lightning__AppPage + + \ No newline at end of file diff --git a/force-app/main/default/lwc/wrapperTable/wrapperTable.html b/force-app/main/default/lwc/wrapperTable/wrapperTable.html new file mode 100644 index 0000000..a9c6b70 --- /dev/null +++ b/force-app/main/default/lwc/wrapperTable/wrapperTable.html @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/force-app/main/default/lwc/wrapperTable/wrapperTable.js b/force-app/main/default/lwc/wrapperTable/wrapperTable.js new file mode 100644 index 0000000..43a4eb7 --- /dev/null +++ b/force-app/main/default/lwc/wrapperTable/wrapperTable.js @@ -0,0 +1,14 @@ +import { LightningElement,track} from 'lwc'; + +export default class WrapperTable extends LightningElement { + @track data = [ + { id: 1, name: 'John Doe', email: 'john.doe@example.com' }, + { id: 2, name: 'Jane Smith', email: 'jane.smith@example.com' } + ]; + + @track columns = [ + { label: 'ID', fieldName: 'id' }, + { label: 'Name', fieldName: 'name' }, + { label: 'Email', fieldName: 'email' } + ]; +} \ No newline at end of file diff --git a/force-app/main/default/lwc/wrapperTable/wrapperTable.js-meta.xml b/force-app/main/default/lwc/wrapperTable/wrapperTable.js-meta.xml new file mode 100644 index 0000000..0ac90a6 --- /dev/null +++ b/force-app/main/default/lwc/wrapperTable/wrapperTable.js-meta.xml @@ -0,0 +1,8 @@ + + + 59.0 + true + + lightning__RecordPage + + \ No newline at end of file diff --git a/force-app/main/default/pages/AnswersHome.page b/force-app/main/default/pages/AnswersHome.page new file mode 100644 index 0000000..a305b75 --- /dev/null +++ b/force-app/main/default/pages/AnswersHome.page @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/force-app/main/default/pages/AnswersHome.page-meta.xml b/force-app/main/default/pages/AnswersHome.page-meta.xml new file mode 100644 index 0000000..ee98ad9 --- /dev/null +++ b/force-app/main/default/pages/AnswersHome.page-meta.xml @@ -0,0 +1,8 @@ + + + 58.0 + false + false + Default Lightning Platform home page for Answers sites + + diff --git a/force-app/main/default/pages/BandwidthExceeded.page b/force-app/main/default/pages/BandwidthExceeded.page new file mode 100644 index 0000000..c6619ce --- /dev/null +++ b/force-app/main/default/pages/BandwidthExceeded.page @@ -0,0 +1,13 @@ + + + + + + + +
+
+ +
+
+
\ No newline at end of file diff --git a/force-app/main/default/pages/BandwidthExceeded.page-meta.xml b/force-app/main/default/pages/BandwidthExceeded.page-meta.xml new file mode 100644 index 0000000..434d03a --- /dev/null +++ b/force-app/main/default/pages/BandwidthExceeded.page-meta.xml @@ -0,0 +1,8 @@ + + + 58.0 + false + false + Default Lightning Platform Limit Exceeded page + + diff --git a/force-app/main/default/pages/Celena.page b/force-app/main/default/pages/Celena.page new file mode 100644 index 0000000..1c09c78 --- /dev/null +++ b/force-app/main/default/pages/Celena.page @@ -0,0 +1,9 @@ + + + + + + + +
Banana 1Banana 2Banana 3
+
\ No newline at end of file diff --git a/force-app/main/default/pages/Celena.page-meta.xml b/force-app/main/default/pages/Celena.page-meta.xml new file mode 100644 index 0000000..544e65a --- /dev/null +++ b/force-app/main/default/pages/Celena.page-meta.xml @@ -0,0 +1,27 @@ + + + 60.0 + false + false + + + 3 + 22 + npe01 + + + 3 + 25 + npe03 + + + 3 + 15 + npe4 + + + 3 + 13 + npe5 + + diff --git a/force-app/main/default/pages/ChangePassword.page b/force-app/main/default/pages/ChangePassword.page new file mode 100644 index 0000000..ffb6b69 --- /dev/null +++ b/force-app/main/default/pages/ChangePassword.page @@ -0,0 +1,41 @@ + + + +
+ +
+
+ +
+ + + + +
+ +
+ + + + + + + + + + + + + +
+
+
+
+ +
+
+
+
+
+
+
\ No newline at end of file diff --git a/force-app/main/default/pages/ChangePassword.page-meta.xml b/force-app/main/default/pages/ChangePassword.page-meta.xml new file mode 100644 index 0000000..e5676ba --- /dev/null +++ b/force-app/main/default/pages/ChangePassword.page-meta.xml @@ -0,0 +1,8 @@ + + + 58.0 + false + false + Default Salesforce Sites Change Password page + + diff --git a/force-app/main/default/pages/ChoicePage.page b/force-app/main/default/pages/ChoicePage.page new file mode 100644 index 0000000..b9d942a --- /dev/null +++ b/force-app/main/default/pages/ChoicePage.page @@ -0,0 +1,62 @@ + + + + + + Salesforce Lightning Design System Trailhead Module + + + + + + +
+ + + + + + + + + +
+
+
+
+ Choose Any One +
+ + Contact + + + + + + + Opportunity + + + + + + +
+
+ +
+
+ +
+
+ + + +
+
+ + + + + +
\ No newline at end of file diff --git a/force-app/main/default/pages/ChoicePage.page-meta.xml b/force-app/main/default/pages/ChoicePage.page-meta.xml new file mode 100644 index 0000000..ebfb517 --- /dev/null +++ b/force-app/main/default/pages/ChoicePage.page-meta.xml @@ -0,0 +1,7 @@ + + + 58.0 + false + false + + diff --git a/force-app/main/default/pages/CommunitiesLanding.page b/force-app/main/default/pages/CommunitiesLanding.page new file mode 100644 index 0000000..247a950 --- /dev/null +++ b/force-app/main/default/pages/CommunitiesLanding.page @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/force-app/main/default/pages/CommunitiesLanding.page-meta.xml b/force-app/main/default/pages/CommunitiesLanding.page-meta.xml new file mode 100644 index 0000000..dcdd637 --- /dev/null +++ b/force-app/main/default/pages/CommunitiesLanding.page-meta.xml @@ -0,0 +1,28 @@ + + + 59.0 + false + false + Default experiences landing page + + + 3 + 22 + npe01 + + + 3 + 25 + npe03 + + + 3 + 15 + npe4 + + + 3 + 13 + npe5 + + diff --git a/force-app/main/default/pages/CommunitiesLogin.page b/force-app/main/default/pages/CommunitiesLogin.page new file mode 100644 index 0000000..ba837c9 --- /dev/null +++ b/force-app/main/default/pages/CommunitiesLogin.page @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/force-app/main/default/pages/CommunitiesLogin.page-meta.xml b/force-app/main/default/pages/CommunitiesLogin.page-meta.xml new file mode 100644 index 0000000..1021566 --- /dev/null +++ b/force-app/main/default/pages/CommunitiesLogin.page-meta.xml @@ -0,0 +1,28 @@ + + + 59.0 + false + false + Default experiences login page + + + 3 + 22 + npe01 + + + 3 + 25 + npe03 + + + 3 + 15 + npe4 + + + 3 + 13 + npe5 + + diff --git a/force-app/main/default/pages/CommunitiesSelfReg.page b/force-app/main/default/pages/CommunitiesSelfReg.page new file mode 100644 index 0000000..ba08f09 --- /dev/null +++ b/force-app/main/default/pages/CommunitiesSelfReg.page @@ -0,0 +1,28 @@ + + +
+ + + + + + + + + + + + + + + + + + +
+
+
+
+
+ +
\ No newline at end of file diff --git a/force-app/main/default/pages/CommunitiesSelfReg.page-meta.xml b/force-app/main/default/pages/CommunitiesSelfReg.page-meta.xml new file mode 100644 index 0000000..602c4d7 --- /dev/null +++ b/force-app/main/default/pages/CommunitiesSelfReg.page-meta.xml @@ -0,0 +1,28 @@ + + + 59.0 + false + false + Default experiences self registration page + + + 3 + 22 + npe01 + + + 3 + 25 + npe03 + + + 3 + 15 + npe4 + + + 3 + 13 + npe5 + + diff --git a/force-app/main/default/pages/CommunitiesSelfRegConfirm.page b/force-app/main/default/pages/CommunitiesSelfRegConfirm.page new file mode 100644 index 0000000..cdf230f --- /dev/null +++ b/force-app/main/default/pages/CommunitiesSelfRegConfirm.page @@ -0,0 +1,28 @@ + + +
+ +
+
+ +
+ + + + +
+ +
+
+ {!$Label.site.go_to_login_page} +
+
+
+
+ +
+
+
+
+
+
\ No newline at end of file diff --git a/force-app/main/default/pages/CommunitiesSelfRegConfirm.page-meta.xml b/force-app/main/default/pages/CommunitiesSelfRegConfirm.page-meta.xml new file mode 100644 index 0000000..21ae6c6 --- /dev/null +++ b/force-app/main/default/pages/CommunitiesSelfRegConfirm.page-meta.xml @@ -0,0 +1,28 @@ + + + 59.0 + false + false + Default experiences self registration confirmation page + + + 3 + 22 + npe01 + + + 3 + 25 + npe03 + + + 3 + 15 + npe4 + + + 3 + 13 + npe5 + + diff --git a/force-app/main/default/pages/CommunitiesTemplate.page b/force-app/main/default/pages/CommunitiesTemplate.page new file mode 100644 index 0000000..345cb1d --- /dev/null +++ b/force-app/main/default/pages/CommunitiesTemplate.page @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/force-app/main/default/pages/CommunitiesTemplate.page-meta.xml b/force-app/main/default/pages/CommunitiesTemplate.page-meta.xml new file mode 100644 index 0000000..713b083 --- /dev/null +++ b/force-app/main/default/pages/CommunitiesTemplate.page-meta.xml @@ -0,0 +1,28 @@ + + + 59.0 + false + false + Default template for experiences pages + + + 3 + 22 + npe01 + + + 3 + 25 + npe03 + + + 3 + 15 + npe4 + + + 3 + 13 + npe5 + + diff --git a/force-app/main/default/pages/ContactForm.page b/force-app/main/default/pages/ContactForm.page new file mode 100644 index 0000000..d84de26 --- /dev/null +++ b/force-app/main/default/pages/ContactForm.page @@ -0,0 +1,88 @@ + + + + + + Salesforce Lightning Design System Trailhead Module + + + + + + + + + +
+ + + + + + + +
+
+
+ +
+ +
Create New Contact
+ + + + + +
+ + +
+ + + + + + +
+ + +
+ + + +

+

+ + +
+ + + +

+

+ +
+
+ + +
+
+ +
+ +
+
+ +
+
+
+ + + + + + + +
\ No newline at end of file diff --git a/force-app/main/default/pages/ContactForm.page-meta.xml b/force-app/main/default/pages/ContactForm.page-meta.xml new file mode 100644 index 0000000..b924008 --- /dev/null +++ b/force-app/main/default/pages/ContactForm.page-meta.xml @@ -0,0 +1,7 @@ + + + 58.0 + false + false + + diff --git a/force-app/main/default/pages/Exception.page b/force-app/main/default/pages/Exception.page new file mode 100644 index 0000000..6a1c44f --- /dev/null +++ b/force-app/main/default/pages/Exception.page @@ -0,0 +1,33 @@ + + + +
+ +
+
+ +
+ + + + + + + + + +
+
+
+
+
+ +
+
+ +
+
+
+
+
+
\ No newline at end of file diff --git a/force-app/main/default/pages/Exception.page-meta.xml b/force-app/main/default/pages/Exception.page-meta.xml new file mode 100644 index 0000000..f7627c3 --- /dev/null +++ b/force-app/main/default/pages/Exception.page-meta.xml @@ -0,0 +1,8 @@ + + + 58.0 + false + false + Default Lightning Platform page for post-authentication errors + + diff --git a/force-app/main/default/pages/FileNotFound.page b/force-app/main/default/pages/FileNotFound.page new file mode 100644 index 0000000..de87624 --- /dev/null +++ b/force-app/main/default/pages/FileNotFound.page @@ -0,0 +1,31 @@ + + + +
+ +
+
+ +
+ + + + + + + + +
+
+ +
+
+
+ +
+
+
+
+
+ +
\ No newline at end of file diff --git a/force-app/main/default/pages/FileNotFound.page-meta.xml b/force-app/main/default/pages/FileNotFound.page-meta.xml new file mode 100644 index 0000000..38720aa --- /dev/null +++ b/force-app/main/default/pages/FileNotFound.page-meta.xml @@ -0,0 +1,8 @@ + + + 58.0 + false + false + Default Lightning Platform Page/Data Not Found page + + diff --git a/force-app/main/default/pages/ForgotPassword.page b/force-app/main/default/pages/ForgotPassword.page new file mode 100644 index 0000000..9877886 --- /dev/null +++ b/force-app/main/default/pages/ForgotPassword.page @@ -0,0 +1,36 @@ + + + +
+ +
+
+ +
+ + + + +
+ +
+ + + + + + + + +
+
+
+
+ +
+
+
+
+
+
+
\ No newline at end of file diff --git a/force-app/main/default/pages/ForgotPassword.page-meta.xml b/force-app/main/default/pages/ForgotPassword.page-meta.xml new file mode 100644 index 0000000..48e8aba --- /dev/null +++ b/force-app/main/default/pages/ForgotPassword.page-meta.xml @@ -0,0 +1,8 @@ + + + 58.0 + false + false + Default Salesforce Sites Forgot Password Confirmation page + + diff --git a/force-app/main/default/pages/ForgotPasswordConfirm.page b/force-app/main/default/pages/ForgotPasswordConfirm.page new file mode 100644 index 0000000..77f2654 --- /dev/null +++ b/force-app/main/default/pages/ForgotPasswordConfirm.page @@ -0,0 +1,30 @@ + + + +
+ +
+
+ +
+ + + + +
+ +
+
+ {!$Label.site.go_to_login_page} +
+
+
+
+ +
+
+
+
+
+
+
\ No newline at end of file diff --git a/force-app/main/default/pages/ForgotPasswordConfirm.page-meta.xml b/force-app/main/default/pages/ForgotPasswordConfirm.page-meta.xml new file mode 100644 index 0000000..b099697 --- /dev/null +++ b/force-app/main/default/pages/ForgotPasswordConfirm.page-meta.xml @@ -0,0 +1,8 @@ + + + 58.0 + false + false + Default Salesforce Sites Forgot Password Confirmation page + + diff --git a/force-app/main/default/pages/IdeasHome.page b/force-app/main/default/pages/IdeasHome.page new file mode 100644 index 0000000..165405b --- /dev/null +++ b/force-app/main/default/pages/IdeasHome.page @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/force-app/main/default/pages/IdeasHome.page-meta.xml b/force-app/main/default/pages/IdeasHome.page-meta.xml new file mode 100644 index 0000000..7d9ca7c --- /dev/null +++ b/force-app/main/default/pages/IdeasHome.page-meta.xml @@ -0,0 +1,8 @@ + + + 58.0 + false + false + Default Lightning Platform home page for ideas sites + + diff --git a/force-app/main/default/pages/InMaintenance.page b/force-app/main/default/pages/InMaintenance.page new file mode 100644 index 0000000..a0f5f0f --- /dev/null +++ b/force-app/main/default/pages/InMaintenance.page @@ -0,0 +1,15 @@ + + + + + + + + + +
+
+ +
+
+
\ No newline at end of file diff --git a/force-app/main/default/pages/InMaintenance.page-meta.xml b/force-app/main/default/pages/InMaintenance.page-meta.xml new file mode 100644 index 0000000..ddd59cc --- /dev/null +++ b/force-app/main/default/pages/InMaintenance.page-meta.xml @@ -0,0 +1,8 @@ + + + 58.0 + false + false + Default Lightning Platform In Maintenance page + + diff --git a/force-app/main/default/pages/LongRunningCalloutPage.page b/force-app/main/default/pages/LongRunningCalloutPage.page new file mode 100644 index 0000000..52c4a86 --- /dev/null +++ b/force-app/main/default/pages/LongRunningCalloutPage.page @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/force-app/main/default/pages/LongRunningCalloutPage.page-meta.xml b/force-app/main/default/pages/LongRunningCalloutPage.page-meta.xml new file mode 100644 index 0000000..cd15d60 --- /dev/null +++ b/force-app/main/default/pages/LongRunningCalloutPage.page-meta.xml @@ -0,0 +1,27 @@ + + + 60.0 + false + false + + + 3 + 22 + npe01 + + + 3 + 25 + npe03 + + + 3 + 15 + npe4 + + + 3 + 13 + npe5 + + diff --git a/force-app/main/default/pages/MakeContact.page b/force-app/main/default/pages/MakeContact.page new file mode 100644 index 0000000..027d432 --- /dev/null +++ b/force-app/main/default/pages/MakeContact.page @@ -0,0 +1,65 @@ + + + + + + Salesforce Lightning Design System Trailhead Module + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+ + + +
\ No newline at end of file diff --git a/force-app/main/default/pages/MakeContact.page-meta.xml b/force-app/main/default/pages/MakeContact.page-meta.xml new file mode 100644 index 0000000..cff1f5b --- /dev/null +++ b/force-app/main/default/pages/MakeContact.page-meta.xml @@ -0,0 +1,7 @@ + + + 58.0 + false + false + + diff --git a/force-app/main/default/pages/MicrobatchSelfReg.page b/force-app/main/default/pages/MicrobatchSelfReg.page new file mode 100644 index 0000000..96b3069 --- /dev/null +++ b/force-app/main/default/pages/MicrobatchSelfReg.page @@ -0,0 +1,24 @@ + + +
+ + + + + + + + + + + + + + +
+
+
+
+
+ +
\ No newline at end of file diff --git a/force-app/main/default/pages/MicrobatchSelfReg.page-meta.xml b/force-app/main/default/pages/MicrobatchSelfReg.page-meta.xml new file mode 100644 index 0000000..bd9d2ec --- /dev/null +++ b/force-app/main/default/pages/MicrobatchSelfReg.page-meta.xml @@ -0,0 +1,28 @@ + + + 59.0 + false + false + Process self-registration requests in batches instead of individually + + + 3 + 22 + npe01 + + + 3 + 25 + npe03 + + + 3 + 15 + npe4 + + + 3 + 13 + npe5 + + diff --git a/force-app/main/default/pages/MyProfilePage.page b/force-app/main/default/pages/MyProfilePage.page new file mode 100644 index 0000000..bf72930 --- /dev/null +++ b/force-app/main/default/pages/MyProfilePage.page @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/force-app/main/default/pages/MyProfilePage.page-meta.xml b/force-app/main/default/pages/MyProfilePage.page-meta.xml new file mode 100644 index 0000000..bad383d --- /dev/null +++ b/force-app/main/default/pages/MyProfilePage.page-meta.xml @@ -0,0 +1,8 @@ + + + 58.0 + false + false + Default Salesforce Sites My Profile page + + diff --git a/force-app/main/default/pages/OpportunityForm.page b/force-app/main/default/pages/OpportunityForm.page new file mode 100644 index 0000000..b33a4e5 --- /dev/null +++ b/force-app/main/default/pages/OpportunityForm.page @@ -0,0 +1,88 @@ + + + + + + Salesforce Lightning Design System Trailhead Module + + + + + + + + + +
+ + + + + + + +
+
+
+ +
+
+
Create New Opportunity
+ + + + +
+
+ + +
+
+ + + + +
+
+ + +
+ + + +

+

+ + +
+ + + +

+

+ +
+
+ + +
+
+ +
+ +
+
+ +
+
+
+ + + + + + + +
\ No newline at end of file diff --git a/force-app/main/default/pages/OpportunityForm.page-meta.xml b/force-app/main/default/pages/OpportunityForm.page-meta.xml new file mode 100644 index 0000000..53f9bb3 --- /dev/null +++ b/force-app/main/default/pages/OpportunityForm.page-meta.xml @@ -0,0 +1,7 @@ + + + 58.0 + false + false + + diff --git a/force-app/main/default/pages/PdfForm.page b/force-app/main/default/pages/PdfForm.page new file mode 100644 index 0000000..a6f7ad2 --- /dev/null +++ b/force-app/main/default/pages/PdfForm.page @@ -0,0 +1,979 @@ + + + + + + + + + + + +
+ +
+ + + +
+ + + + + + + + + + + + +
+ + + + + +

+ PROMULGATED BY THE TEXAS REAL ESTATE COMMISSION (TREC)
+ ONE TO FOUR FAMILY RESIDENTIAL CONTRACT (RESALE) +

+

+ NOTICE: Not For Use For Condominium Transactions +

+
+
+ + + +
+ +
    +
  1. PARTIES: The parties to this contract are + +
    (Seller) and + (Buyer).
    Seller agrees to sell and convey to Buyer and Buyer agrees to buy from Seller the Property defined below. +
  2. +
  3. PROPERTY:  The land,  improvements and accessories are collectively referred to as the Property + (Property). +
      +
    1. LAND: Lot + Block , + + Addition, City of + ,Country of , + Texas, known as + (address/zip code), or as described on attached exhibit. +
    2. +
    3. IMPROVEMENTS: The house, garage and all other fixtures and improvements attached to the + above-described   real   property,  including   without   limitation,  the   following   permanently + installed   and   built-in   items,  if   any:  all equipment  and  appliances, valances,  screens, + shutters, awnings, wall-to-wall carpeting, mirrors, ceiling fans, attic fans, mail boxes, television + antennas,mounts and brackets for televisions and speakers,heating and air-conditioning units, + security and fire detection equipment, wiring, plumbing and lighting fixtures, chandeliers, water + softener system, kitchen equipment,  garage   door  openers, cleaning  equipment,  shrubbery, + landscaping,   outdoor   cooking  equipment,  and  all  other  property  attached  to  the  above + described real property. +
    4. +
    5. ACCESSORIES:   The following described related accessories, if any: window air conditioning + units, stove, fireplace screens, curtains and rods,  blinds, window shades,  draperies and rods, + door keys,  mailbox keys,  above ground pool,  swimming  pool  equipment  and  maintenance + accessories, artificial fireplace logs, security systems that are not fixtures, and controls for:  (i) + garage doors,(ii) entry gates,and (iii) other improvements and accessories.“Controls” includes + Seller’s transferable rights to the  (i)  software  and  applications used  to  access  and  control + improvements  or  accessories,  and  (ii)  hardware  used  solely  to  control  improvements  or + accessories. +
    6. +
    7. EXCLUSIONS: The following improvements and accessories will  be  retained  by  Seller  and + must be removed prior to delivery of possession: + + . +
    8. +
    9. RESERVATIONS:  Any  reservation  for  oil,  gas,  or  other minerals,  water,  timber,  or other + interests is made in accordance with an attached addendum. +
    10. +
    +
  4. +
  5. SALES PRICE: +
      +
    1. Cash portion of Sales Price payable by Buyer at closing + + $ + The term  “Cash portion of the Sales Price”  does  not  include proceeds from borrowing of any + kind or selling other real property except as disclosed in this contract. +
    2. +
    3. Sum of all financing described in the attached: + Third Party Financing Addendum,
      + Loan Assumption Addendum, + Seller Financing Addendum + $ +
    4. +
    5. Sales Price (Sum of A and B) + $ +
    6. +
    +
  6. +
  7. LEASES:  Except  as  disclosed in this contract, Seller  is not aware  of any  leases  affecting  the + Property. After the Effective Date, Seller may not, without Buyer's written consent, create  a  new + lease, amend any existing lease,  or  convey  any  interest  in the Property.  (Check all applicable boxes)
    +
  8. + +
    +

    + + A. RESIDENTIAL LEASES: The Property  is  subject to  one  or  more  residential leases  and the +         Addendum Regarding Residential Leases is attached to this contract.
    +

    +

    + + B. FIXTURE LEASES:  Fixtures on the  Property  are  subject  to one  or  more  fixture leases (for +         example,  solar panels,  propane tanks,  water softener,  security system)  and  the  Addendum +         Regarding Fixture Leases is attached to this contract.
    +

    +

    + + C. NATURAL RESOURCE LEASES:  “Natural Resource Lease”  means an existing  oil  and  gas, +         mineral, water, wind, or other natural resource lease affecting the Property to which Seller is  a +         party. +

    +
    +
    +

    + + (1) Seller has delivered to Buyer a copy of all the Natural Resource Leases.
    +

    +

    + + (2) Seller has not delivered to Buyer a copy of all the Natural  Resource  Leases.   Seller  shall +          provide to Buyer a copy of all the Natural Resource Leases within 3 days after the Effective +          Date.  Buyer  may terminate the contract  within _____ days   after   the   date   the   Buyer +          receives  all  the  Natural Resource Leases and the earnest  money  shall  be  refunded  to +          Buyer. +

    +
    +
+
+

Initialed for identification by Buyer + + + and Seller + + TREC NO. 20-17

+
+ + + + +
+
+ + + +
+ +

Contract Concerning + Page 2 of 11

+

(Address of Property)

+ +
+ + +

5. EARNEST MONEY AND TERMINATION OPTION: +

    +
  1. DELIVERY OF EARNEST MONEY AND OPTION FEE: Within 3 days after the Effective Date, Buyer must deliver to + (Escrow Agent) at + + (address): $ + as earnest money and $ + + as the Option Fee. The earnest money and Option Fee shall be made payable to Escrow Agent + and may be paid separately or combined in a single payment. + +

    (1) Buyer shall deliver additional earnest  money of $ + + to Escrow Agent within + days after the Effective Date of this contract. + +

    +

    (2) If the last day to deliver the earnest money, Option Fee, or the additional earnest money + falls on a Saturday, Sunday, or legal holiday, the time to deliver the earnest money, Option + Fee, or the additional earnest money, as applicable, is extended until the end of the next day + that is not a Saturday, Sunday, or legal holiday. + + +

    +

    (3) he amount(s) Escrow Agent receives under this paragraph shall be applied first to the
    + Option Fee, then to the earnest money, and then to the additional earnest money. + + +

    +

    (4) Buyer authorizes Escrow Agent to release and deliver the Option Fee to Seller at any time + without further notice to or consent from Buyer, and releases Escrow Agent from liability for + delivery of the Option Fee to Seller. The Option Fee will be credited to the Sales Price at + closing. +

    +
  2. +
  3. + TERMINATION OPTION: For nominal consideration, the receipt of which Seller acknowledges, + and Buyer's agreement to pay the Option Fee within the time required, Seller grants Buyer the + unrestricted right to terminate this contract by giving notice of termination to Seller within + days after the Effective Date of this contract (Option Period). Notices under this + paragraph must be given by 5:00 p.m. (local time where the Property is located) by the date + specified. If Buyer gives notice of termination within the time prescribed: (i) the Option Fee will + not be refunded and Escrow Agent shall release any Option Fee remaining with Escrow Agent to + Seller; and (ii) any earnest money will be refunded to Buyer. + +
  4. +
  5. FAILURE TO TIMELY DELIVER EARNEST MONEY: If Buyer fails to deliver the earnest money + within the time required, Seller may terminate this contract or exercise Seller's remedies under + Paragraph 15, or both, by providing notice to Buyer before Buyer delivers the earnest money. + +
  6. +
  7. FAILURE TO TIMELY DELIVER OPTION FEE: If no dollar amount is stated as the Option Fee or if + Buyer fails to deliver the Option Fee within the time required, Buyer shall not have the + unrestricted right to terminate this contract under this paragraph 5. + +
  8. +
  9. TIME: Time is of the essence for this paragraph and strict compliance with the time for
    + performance is required.
    +
  10. + + +
+

+

6. TITLE POLICY AND SURVEY: +

    +
  1. TITLE POLICY: Seller shall furnish to Buyer at  Seller’s  Buyer’s expense an owner policy of + title insurance (Title Policy) issued by (Title Company) + in the amount of the Sales Price, dated at or after closing, insuring Buyer against loss under the + provisions of the Title Policy, subject to the promulgated exclusions (including existing building + and zoning ordinances) and the following exceptions: + + + +

    + (1)Restrictive covenants common to the platted subdivision in which the Property is located. +

    +

    + (2)The standard printed exception for standby fees, taxes and assessments. +

    +

    + (3) Liens created as part of the financing described in Paragraph 3. +

    +

    + (4) Utility easements created by the dedication deed or plat of the subdivision in which the Property is located. +

    +

    + (5) Reservations or exceptions otherwise permitted by this contract or as may be approved by + Buyer in writing. +

    +

    + (6)The standard printed exception as to marital rights. +

    +

    + (7) The standard printed exception as to waters, tidelands, beaches, streams, and related + matters. +

    +

    + (8)The standard printed exception as to discrepancies, conflicts, shortages in area or boundary + lines, encroachments or protrusions, or overlapping improvements: +

    +

    + + (i) will not be amended or deleted from the title policy; or
    + + (ii) will be amended to read, "shortages in area" at the expense of + Buyer + Seller. +

    +

    (9)The exception or exclusion regarding minerals approved by the Texas Department of Insurance. +

    +
  2. +
  3. COMMITMENT: Within 20 days after the Title Company receives a copy of this contract, Seller + shall furnish to Buyer a commitment for title insurance (Commitment) and, at Buyer's expense, + legible copies of restrictive covenants and documents evidencing exceptions in the Commitment + (Exception Documents) other than the standard printed exceptions. Seller authorizes the Title + Company to deliver the Commitment and Exception Documents to Buyer at Buyer's address + shown in Paragraph 21. If the Commitment and Exception Documents are not delivered to + Buyer within the specified time, the time for delivery will be automatically extended up to 15 + days or 3 days before the Closing Date, whichever is earlier. If the Commitment and Exception + Documents are not delivered within the time required, Buyer may terminate this contract and + the earnest money will be refunded to Buyer. +
  4. + +
+

+
+
+

Initialed for identification by Buyer + + + and Seller + + TREC NO. 20-17

+
+ + + + + + + +
+
+ + + +
+

Contract Concerning + Page 3 of 11

+

(Address of Property)

+
+

C. SURVEY: The survey must be made by a registered professional land surveyor acceptable to the + Title Company and Buyer’s lender(s). (Check one box only)

+ +

+ + (1) Within + days after the Effective Date of this contract, Seller shall furnish to Buyer and + Title Company Seller's existing survey of the Property and a Residential Real Property + Affidavit promulgated by the Texas Department of Insurance (T-47 Affidavit). If Seller fails + to furnish the existing survey or affidavit within the time prescribed, Buyer shall + obtain a new survey at Seller's expense no later than 3 days prior to Closing Date. + If the existing survey or affidavit is not acceptable to Title Company or Buyer's lender(s), + Buyer shall obtain a new survey at Seller's Buyer's expense no later than 3 days prior + to Closing Date.

+

+ + (2) Within + days after the Effective Date of this contract, Buyer shall obtain a new survey + at Buyer's expense. Buyer is deemed to receive the survey on the date of actual receipt or + the date specified in this paragraph, whichever is earlier. +

+

+ + (3) Within + days after the Effective Date of this contract, Seller, at Seller's expense shall + furnish a new survey to Buyer. +

+

+ D. OBJECTIONS: Buyer may object in writing to defects, exceptions, or encumbrances to title: + disclosed on the survey other than items 6A(1) through (7) above; disclosed in the + Commitment other than items 6A(1) through (9) above; or which prohibit the following use or + activity: . Buyer must object the earlier of (i) the Closing Date or (ii) days after Buyer receives the Commitment, Exception Documents, and the survey. Buyer’s failure to object within the time allowed will constitute a waiver of Buyer’s right to object; except that the requirements in Schedule C of the Commitment are not waived by Buyer. Provided Seller is not obligated to + incur any expense, Seller shall cure any timely objections of Buyer or any third party lender + within 15 days after Seller receives the objections (Cure Period) and the Closing Date will be extended as necessary. If objections are not cured within the Cure Period, Buyer may, by delivering notice to Seller within 5 days after the end of the Cure Period: (i) terminate this contract and the earnest money will be refunded to Buyer; or (ii) waive the objections. If Buyer does not terminate within the time required, Buyer shall be deemed to have waived the objections. If the Commitment or survey is revised or any new Exception Document(s) is delivered, Buyer may object to any new matter revealed in the revised Commitment or survey or new Exception Document(s) within the same time stated in this paragraph to make + objections beginning when the revised Commitment, survey, or Exception Document(s) is delivered to Buyer. + +

+

+ E. TITLE NOTICES: + +

+

(1) ABSTRACT OR TITLE POLICY: Broker advises Buyer to have an abstract of title covering the Property examined by an attorney of Buyer’s selection, or Buyer should be furnished with or + obtain a Title Policy. If a Title Policy is furnished, the Commitment should be promptly + reviewed by an attorney of Buyer’s choice due to the time limitations on Buyer’s right to object. +

+

+ (2) MEMBERSHIP IN PROPERTY OWNERS ASSOCIATION(S): The Property is is not subject + to mandatory membership in a property owners association(s). If the Property is subject to + mandatory membership in a property owners association(s), Seller notifies Buyer under + §5.012, Texas Property Code, that, as a purchaser of property in the residential community + identified in Paragraph 2A in which the Property is located, you are obligated to be a member of the property owners association(s). Restrictive covenants governing the use and + occupancy of the Property and all dedicatory instruments governing the establishment, maintenance, or operation of this residential community have been or will be recorded in + the Real Property Records of the county in which the Property is located. Copies of the + restrictive covenants and dedicatory instruments may be obtained from the county clerk. + You are obligated to pay assessments to the property owners association(s). The + amount of the assessments is subject to change. Your failure to pay the + assessments could result in enforcement of the association’s lien on and the + foreclosure of the Property.
+ Section 207.003, Property Code, entitles an owner to receive copies of any document that + governs the establishment, maintenance, or operation of a subdivision, including, but not + limited to, restrictions, bylaws, rules and regulations, and a resale certificate from a + property owners' association. A resale certificate contains information including, but not + limited to, statements specifying the amount and frequency of regular assessments and the style and cause number of lawsuits to which the property owners' association is a party, + other than lawsuits relating to unpaid ad valorem taxes of an individual member of the + association. These documents must be made available to you by the property owners' + association or the association's agent on your request. If Buyer is concerned about + these matters, the TREC promulgated Addendum for Property Subject to + Mandatory Membership in a Property Owners Association(s) should be used. + +

+

(3) STATUTORY TAX DISTRICTS: If the Property is situated in a utility or other statutorily + created district providing water, sewer, drainage, or flood control facilities and services, + Chapter 49, Texas Water Code, requires Seller to deliver and Buyer to sign the statutory + notice relating to the tax rate, bonded indebtedness, or standby fee of the district prior to + final execution of this contract. + +

+
+
+

Initialed for identification by Buyer + + + and Seller + + TREC NO. 20-17

+
+ + + + + +
+
+ + + +
+ +

Contract Concerning + Page 4 of 11

+

(Address of Property)

+ +
+ + +

+ (4) TIDE WATERS: If the Property abuts the tidally influenced waters of the state, §33.135,
+      Texas Natural Resources Code, requires a notice regarding coastal area property to be
+      included in the contract. An addendum containing the notice promulgated by TREC or
+      required by the parties must be used.
+ +

+

+ (5) ANNEXATION: If the Property is located outside the limits of a municipality, Seller notifies
+      Buyer under §5.011, Texas Property Code, that the Property may now or later be included in
+      the extraterritorial jurisdiction of a municipality and may now or later be subject to
+      annexation by the municipality. Each municipality maintains a map that depicts
+      its boundaries and extraterritorial jurisdiction. To determine if the Property is located within a
+      municipality’s extraterritorial jurisdiction or is likely to be located within a municipality’s
+      extraterritorial jurisdiction, contact all municipalities located in the general proximity of the
+      Property for further information. + +

+

+ (6) PROPERTY LOCATED IN A CERTIFICATED SERVICE AREA OF A UTILITY SERVICE PROVIDER: + Notice required by §13.257, Water Code: The real property, described in Paragraph 2, + that you are about to purchase may be located in a certificated water or sewer service area, + which is authorized by law to provide water or sewer service to the properties in the + certificated area. If your property is located in a certificated area there may be special costs + or charges that you will be required to pay before you can receive water or sewer service. + There may be a period required to construct lines or other facilities necessary to provide + water or sewer service to your property. You are advised to determine if the property is in a + certificated area and contact the utility service provider to determine the cost that you will + be required to pay and the period, if any, that is required to provide water or sewer service + o your property. The undersigned Buyer hereby acknowledges receipt of the foregoing + notice at or before the execution of a binding contract for the purchase of the real property + ;described in Paragraph 2 or at closing of purchase of the real property. + +

+

+ (7) PUBLIC IMPROVEMENT DISTRICTS: If the Property is in a public improvement district, Seller + must give Buyer written notice as required by §5.014, Property Code. An addendum + containing the required notice shall be attached to this contract. + +

+

(8) TRANSFER FEES: If the Property is subject to a private transfer fee obligation, §5.205, +      Property Code, requires Seller to notify Buyer as follows: The private transfer fee obligation +      may be governed by Chapter 5, Subchapter G of the Texas Property Code. + +

+

+ (9) PROPANE GAS SYSTEM SERVICE AREA: If the Property is located in a propane gas system + service area owned by a distribution system retailer, Seller must give Buyer written notice + as required by §141.010, Texas Utilities Code. An addendum containing the notice approved + by TREC or required by the parties should be used. + +

+

+ (10) NOTICE OF WATER LEVEL FLUCTUATIONS: If the Property adjoins an impoundment of
+       water, including a reservoir or lake, constructed and maintained under Chapter 11, Water +       Code, that has a storage capacity of at least 5,000 acre-feet at the impoundment’s normal +       operating level, Seller hereby notifies Buyer: “The water level of the impoundment of water +       adjoining the Property fluctuates for various reasons, including as a result of: (1) an entity + lawfully exercising its right to use the water stored in the impoundment; or (2) drought or + flood conditions.” + +

+

+ + + (11) REQUIRED NOTICES: The following notices have been given or are attached to this contract + (for example, MUD, WCID, PID notices): +
+ + + + +

+ + +
+ +
+ + +

+ 7. PROPERTY CONDITION: + +

+
    +
  1. ACCESS, INSPECTIONS AND UTILITIES: Seller shall permit Buyer and Buyer’s agents access +      to the Property at reasonable times. Buyer may have the Property inspected by inspectors +      selected by Buyer and licensed by TREC or otherwise permitted by law to make inspections. +      Any hydrostatic testing must be separately authorized by Seller in writing. Seller at Seller's +      expense shall immediately cause existing utilities to be turned on and shall keep the utilities +      on during the time this contract is in effect. +
  2. +
  3. SELLER'S DISCLOSURE NOTICE PURSUANT TO §5.008, TEXAS PROPERTY CODE (Notice):
    +      (Check one box only) +

    + (1) Buyer has received the Notice. + +

    +

    + (2) Buyer has not received the Notice. Within __________ days after the Effective Date of this + contract, Seller shall deliver the Notice to Buyer. If Buyer does not receive the Notice, + Buyer may terminate this contract at any time prior to the closing and the earnest money + will be refunded to Buyer. If Seller delivers the Notice, Buyer may terminate this contract + for any reason within 7 days after Buyer receives the Notice or prior to the closing, + whichever first occurs, and the earnest money will be refunded to Buyer. + +

    +

    + + (3) The Seller is not required to furnish the notice under the Texas Property Code +

    +
  4. +
  5. SELLER’S DISCLOSURE OF LEAD-BASED PAINT AND LEAD-BASED PAINT HAZARDS is required + by Federal law for a residential dwelling constructed prior to 1978. +
  6. + +
  7. ACCEPTANCE OF PROPERTY CONDITION: “As Is” means the present condition of the Property + with any and all defects and without warranty except for the warranties of title and the + warranties in this contract. Buyer’s agreement to accept the Property As Is under Paragraph + 7D(1) or (2) does not preclude Buyer from inspecting the Property under Paragraph 7A, from + negotiating repairs or treatments in a subsequent amendment, or from terminating this + contract during the Option Period, if any. +
  8. +
+
+
+ +

Initialed for identification by Buyer + + and Seller + TREC NO. 20-17

+
+ + + + + + + + +
+
+ + + +
+

Contract Concerning + Page 5 of 11

+

(Address of Property)

+
+ +

    (Check one box only)

+

+ + (1) Buyer accepts the Property As Is + +

+

+ + (2) Buyer accepts the Property As Is provided Seller, at Seller’s expense, shall complete the         following specific repairs and treatments: +

+
+ +
+

E. LENDER REQUIRED REPAIRS AND TREATMENTS: Unless otherwise agreed in writing, neither +      party is obligated to pay for lender required repairs, which includes treatment for wood +     destroying insects. If the parties do not agree to pay for the lender required repairs or +     treatments, this contract will terminate and the earnest money will be refunded to Buyer. If +     the cost of lender required repairs and treatments exceeds 5% of the Sales Price, Buyer may +     terminate this contract and the earnest money will be refunded to Buyer. + +

+

+ F. COMPLETION OF REPAIRS AND TREATMENTS: Unless otherwise agreed in writing, Seller shall +     complete all agreed repairs and treatments prior to the Closing Date and obtain any required +     permits. The repairs and treatments must be performed by persons who are licensed to +     provide such repairs or treatments or, if no license is required by law, are commercially +     engaged in the trade of providing such repairs or treatments. Seller shall: (i) provide Buyer +     with copies of documentation from the repair person(s) showing the scope of work and +      payment for the work completed; and (ii) at Seller’s expense, arrange for the transfer of any +       transferable warranties with respect to the repairs and treatments to Buyer at closing. If Seller +      fails to complete any agreed repairs and treatments prior to the Closing Date, Buyer may +      exercise remedies under Paragraph 15 or extend the Closing Date up to 5 days if necessary for +      Seller to complete the repairs and treatments.
+ +

+

G.ENVIRONMENTAL MATTERS: Buyer is advised that the presence of wetlands, toxic substances, +      including asbestos and wastes or other environmental hazards, or the presence of a threatened +      or endangered species or its habitat may affect Buyer’s intended use of the Property. If Buyer +      is concerned about these matters, an addendum promulgated by TREC or required by the +      parties should be used.
+ + +

+

H. RESIDENTIAL SERVICE CONTRACTS: Buyer may purchase a residential service contract from a +     provider or administrator licensed by the Texas Department of Licensing and Regulation. If +     Buyer purchases a residential service contract, Seller shall reimburse Buyer at closing for the +     cost of the residential service contract in an amount not exceeding $ . Buyer +     should review any residential service contract for the scope of coverage, exclusions and +     limitations. The purchase of a residential service contract is optional. Similar coverage +     may be purchased from various companies authorized to do business in Texas. + +

+ +
+

+ 8. BROKERS AND SALES AGENTS: +

+
    +
  1. BROKER OR SALES AGENT DISCLOSURE: Texas law requires a real estate broker or sales +     agent who is a party to a transaction or acting on behalf of a spouse, parent, child, business + entity in which the broker or sales agent owns more than 10%, or a trust for which the + broker or sales agent acts as a trustee or of which the broker or sales agent or the broker or + sales agent’s spouse, parent or child is a beneficiary, to notify the other party in writing + before entering into a contract of sale. Disclose if applicable:____________________________ +
  2. +
  3. BROKERS’ FEES: All obligations of the parties for payment of brokers’ fees are contained in + separate written agreements. +
  4. +
+ +

+ 9.CLOSING: +

+
    +
  1. The closing of the sale will be on or before , 20 , or within 7 days + after objections made under Paragraph 6D have been cured or waived, whichever date is later + (Closing Date). If either party fails to close the sale by the Closing Date, the non-defaulting + party may exercise the remedies contained in Paragraph 15. +
  2. +
  3. At closing: +
  4. +
+ + + +

(1) Seller shall execute and deliver a general warranty deed conveying title to the Property to + Buyer and showing no additional exceptions to those permitted in Paragraph 6 and furnish + tax statements or certificates showing no delinquent taxes on the Property. + +

+

(2) Buyer shall pay the Sales Price in good funds acceptable to the Escrow Agent. + + +

+

(3) Seller and Buyer shall execute and deliver any notices, statements, certificates, affidavits, + releases, loan documents, transfer of any warranties, and other documents reasonably + required for the closing of the sale and the issuance of the Title Policy. + +

+

(4) There will be no liens, assessments, or security interests against the Property which will + not be satisfied out of the sales proceeds unless securing the payment of any loans + assumed by Buyer and assumed loans will not be in default. + +

+

(5) Private transfer fees (as defined by Chapter 5, Subchapter G of the Texas Property Code) + will be the obligation of Seller unless provided otherwise in this contract. Transfer fees + assessed by a property owners’ association are governed by the Addendum for Property + Subject to Mandatory Membership in a Property Owners Association. + +

+ +
+ +

Initialed for identification by Buyer + + and Seller + TREC NO. 20-17

+ + + +
+ + + + + + + +
+ +
+ + + +
+ +

Contract Concerning + Page 6 of 11

+

(Address of Property)

+ + + + +
+

+ 10. POSSESSION: +

    +
  1. BUYER’S POSSESSION: Seller shall deliver to Buyer possession of the Property in its present or + required condition, ordinary wear and tear excepted: + upon closing and funding according + to a temporary residential lease form promulgated by TREC or other written lease required by + the parties. Any possession by Buyer prior to closing or by Seller after closing which is not + authorized by a written lease will establish a tenancy at sufferance relationship between the + parties. Consult your insurance agent prior to change of ownership and possession + because insurance coverage may be limited or terminated. The absence of a written + lease or appropriate insurance coverage may expose the parties to economic loss. +
  2. +
  3. SMART DEVICES: “Smart Device” means a device that connects to the internet to enable + remote use, monitoring, and management of: (i) the Property; (ii) items identified in any NonRealty Items Addendum; or (iii) items in a Fixture Lease assigned to Buyer. At the time Seller + delivers possession of the Property to Buyer, Seller shall: +

    (1) deliver to Buyer written information containing all access codes, usernames, passwords, + and applications Buyer will need to access, operate, manage, and control the Smart + Devices; and + +

    +

    (2) terminate and remove all access and connections to the improvements and accessories + from any of Seller’s personal devices including but not limited to phones and computers. + +

    + +
  4. + +
+

+

11.SPECIAL PROVISIONS: (This paragraph is intended to be used only for additional informational + items. An informational item is a statement that completes a blank in a contract form, discloses + factual information, or provides instructions. Real estate brokers and sales agents are prohibited + from practicing law and shall not add to, delete, or modify any provision of this contract unless + drafted by a party to this contract or a party's attorney.) +
+ + + + +

+

+ 12. SETTLEMENT AND OTHER EXPENSES: +

    +
  1. The following expenses must be paid at or prior to closing: + +

    (1) Expenses payable by Seller (Seller's Expenses): +

    + (a) Releases of existing liens, including prepayment penalties and recording fees; release of + Seller’s loan liability; tax statements or certificates; preparation of deed; one-half of + escrow fee; and other expenses payable by Seller under this contract. + +

    +

    (b) Seller shall also pay an amount + not to exceed $ + to be applied in the + following order: Buyer’s Expenses which Buyer is prohibited from paying by FHA, VA, + Texas Veterans Land Board or other governmental loan programs, and then to other + Buyer’s Expenses as allowed by the lender. +

    +

    +

    (2) Expenses payable by Buyer (Buyer's Expenses): Appraisal fees; loan application fees; + origination charges; credit reports; preparation of loan documents; interest on the notes + from date of disbursement to one month prior to dates of first monthly payments; + recording fees; copies of easements and restrictions; loan title policy with endorsements + required by lender; loan-related inspection fees; photos; amortization schedules; one-half + of escrow fee; all prepaid items, including required premiums for flood and hazard + insurance, reserve deposits for insurance, ad valorem taxes and special governmental + assessments; final compliance inspection; courier fee; repair inspection; underwriting fee; + wire transfer fee; expenses incident to any loan; Private Mortgage Insurance Premium + (PMI), VA Loan Funding Fee, or FHA Mortgage Insurance Premium (MIP) as required by the + lender; and other expenses payable by Buyer under this contract. + +

    +
  2. +
  3. If any expense exceeds an amount expressly stated in this contract for such expense to be + paid by a party, that party may terminate this contract unless the other party agrees to pay + such excess. Buyer may not pay charges and fees expressly prohibited by FHA, VA, Texas + Veterans Land Board or other governmental loan program regulations. +
  4. + +
+

+

13.PRORATIONS:Taxes for the current year, interest, rents, and regular periodic maintenance + fees, assessments, and dues (including prepaid items) will be prorated through the Closing Date. + The tax proration may be calculated taking into consideration any change in exemptions that will affect the + current year's taxes. If taxes for the current year vary from the amount prorated at closing, the parties shall + adjust the prorations when tax statements for the current year are available. If taxes are not paid at or prior to + closing, Buyer shall pay taxes for the current year. + +

+

14. CASUALTY LOSS: If any part of the Property is damaged or destroyed by fire or other casualty + after the Effective Date of this contract, Seller shall restore the Property to its previous condition + as soon as reasonably possible, but in any event by the Closing Date. If Seller fails to do so due + to factors beyond Seller’s control, Buyer may (a) terminate this contract and the earnest money +

+ + + + +
+
+ +

Initialed for identification by Buyer + + and Seller + TREC NO. 20-17

+ +
+ + + + + +
+ +
+ + + +
+ +

Contract Concerning + Page 7 of 11

+

(Address of Property)

+ + + + + +

will be refunded to Buyer (b) extend the time for performance up to 15 days and the Closing Date + will be extended as necessary or (c) accept the Property in its damaged condition with an + assignment of insurance proceeds, if permitted by Seller’s insurance carrier, and receive credit + from Seller at closing in the amount of the deductible under the insurance policy. Seller’s + obligations under this paragraph are independent of any other obligations of Seller under this + contract. + +

+

15. DEFAULT: If Buyer fails to comply with this contract, Buyer will be in default, and Seller may (a) + enforce specific performance, seek such other relief as may be provided by law, or both, or (b) + terminate this contract and receive the earnest money as liquidated damages, thereby releasing +both parties from this contract. If Seller fails to comply with this contract, Seller will be in default +and Buyer may (a) enforce specific performance, seek such other relief as may be provided by +law, or both, or (b) terminate this contract and receive the earnest money, thereby releasing both +parties from this contract. . + +

+

16. MEDIATION: It is the policy of the State of Texas to encourage resolution of disputes through +alternative dispute resolution procedures such as mediation. Any dispute between Seller and +Buyer related to this contract which is not resolved through informal discussion will be +submitted to a mutually acceptable mediation service or provider. The parties to the mediation +shall bear the mediation costs equally. This paragraph does not preclude a party from seeking +equitable relief from a court of competent jurisdiction. + +

+

17. ATTORNEY'S FEES: A Buyer, Seller, Listing Broker, Other Broker, or Escrow Agent who prevails +in any legal proceeding related to this contract is entitled to recover reasonable attorney’s fees +and all costs of such proceeding. + + +

+

18. ESCROW: +

    +
  1. ESCROW: The Escrow Agent is not (i) a party to this contract and does not have liability for the +performance or nonperformance of any party to this contract, (ii) liable for interest on the +earnest money and (iii) liable for the loss of any earnest money caused by the failure of any +financial institution in which the earnest money has been deposited unless the financial +institution is acting as Escrow Agent. Escrow Agent may require any disbursement made in +connection with this contract to be conditioned on Escrow Agent’s collection of good funds +acceptable to Escrow Agent. + +
  2. +
  3. EXPENSES: At closing, the earnest money must be applied first to any cash down payment, +then to Buyer's Expenses and any excess refunded to Buyer. If no closing occurs, Escrow Agent +may: (i) require a written release of liability of the Escrow Agent from all parties before +releasing any earnest money; and (ii) require payment of unpaid expenses incurred on behalf +of a party. Escrow Agent may deduct authorized expenses from the earnest money payable to a +party. “Authorized expenses” means expenses incurred by Escrow Agent on behalf of the party +entitled to the earnest money that were authorized by this contract or that party. +
  4. +
  5. DEMAND: Upon termination of this contract, either party or the Escrow Agent may send a +release of earnest money to each party and the parties shall execute counterparts of the +release and deliver same to the Escrow Agent. If either party fails to execute the release, either +party may make a written demand to the Escrow Agent for the earnest money. If only one +party makes written demand for the earnest money, Escrow Agent shall promptly provide a +copy of the demand to the other party. If Escrow Agent does not receive written objection to +the demand from the other party within 15 days, Escrow Agent may disburse the earnest +money to the party making demand reduced by the amount of unpaid expenses incurred on +behalf of the party receiving the earnest money and Escrow Agent may pay the same to the +creditors. If Escrow Agent complies with the provisions of this paragraph, each party hereby +releases Escrow Agent from all adverse claims related to the disbursal of the earnest money. + +
  6. +
  7. DAMAGES: Any party who wrongfully fails or refuses to sign a release acceptable to the Escrow +Agent within 7 days of receipt of the request will be liable to the other party for (i) damages; +(ii) the earnest money; (iii) reasonable attorney's fees; and (iv) all costs of suit. +
  8. +
  9. NOTICES: Escrow Agent’s notices will be effective when sent in compliance with Paragraph 21. +Notice of objection to the demand will be deemed effective upon receipt by Escrow Agent. + +
  10. + +
+ +

+

19. REPRESENTATIONS: + All covenants, representations and warranties in this contract survive +closing. If any representation of Seller in this contract is untrue on the Closing Date, Seller will be +in default. Unless expressly prohibited by written agreement, Seller may continue to show the +Property and receive, negotiate and accept back up offers. + +

+

20.FEDERAL TAX REQUIREMENTS: + If Seller is a "foreign person,” as defined by Internal Revenue +Code and its regulations, or if Seller fails to deliver an affidavit or a certificate of non-foreign +status to Buyer that Seller is not a "foreign person,” then Buyer shall withhold from the sales +proceeds an amount sufficient to comply with applicable tax law and deliver the same to the +Internal Revenue Service together with appropriate tax forms. Internal Revenue Service +regulations require filing written reports if currency in excess of specified amounts is received in +the transaction. + +

+
+ +

Initialed for identification by Buyer + + and Seller + TREC NO. 20-17

+ +
+ + + + + + + + +
\ No newline at end of file diff --git a/force-app/main/default/pages/PdfForm.page-meta.xml b/force-app/main/default/pages/PdfForm.page-meta.xml new file mode 100644 index 0000000..1cae3ce --- /dev/null +++ b/force-app/main/default/pages/PdfForm.page-meta.xml @@ -0,0 +1,27 @@ + + + 59.0 + false + false + + + 3 + 22 + npe01 + + + 3 + 25 + npe03 + + + 3 + 15 + npe4 + + + 3 + 13 + npe5 + + diff --git a/force-app/main/default/pages/Publisher.page b/force-app/main/default/pages/Publisher.page new file mode 100644 index 0000000..057c865 --- /dev/null +++ b/force-app/main/default/pages/Publisher.page @@ -0,0 +1,17 @@ + + + +
+ + + \ No newline at end of file diff --git a/force-app/main/default/pages/Publisher.page-meta.xml b/force-app/main/default/pages/Publisher.page-meta.xml new file mode 100644 index 0000000..caed452 --- /dev/null +++ b/force-app/main/default/pages/Publisher.page-meta.xml @@ -0,0 +1,27 @@ + + + 60.0 + false + false + + + 3 + 22 + npe01 + + + 3 + 25 + npe03 + + + 3 + 15 + npe4 + + + 3 + 13 + npe5 + + diff --git a/force-app/main/default/pages/SiteLogin.page b/force-app/main/default/pages/SiteLogin.page new file mode 100644 index 0000000..6f0900b --- /dev/null +++ b/force-app/main/default/pages/SiteLogin.page @@ -0,0 +1,29 @@ + + + +
+ +
+
+ +
+ + + + +
+ +
+ +
+
+
+
+ +
+
+
+
+
+
+
\ No newline at end of file diff --git a/force-app/main/default/pages/SiteLogin.page-meta.xml b/force-app/main/default/pages/SiteLogin.page-meta.xml new file mode 100644 index 0000000..1bf2398 --- /dev/null +++ b/force-app/main/default/pages/SiteLogin.page-meta.xml @@ -0,0 +1,8 @@ + + + 58.0 + false + false + Default Salesforce Sites Login page + + diff --git a/force-app/main/default/pages/SiteRegister.page b/force-app/main/default/pages/SiteRegister.page new file mode 100644 index 0000000..b4e443e --- /dev/null +++ b/force-app/main/default/pages/SiteRegister.page @@ -0,0 +1,45 @@ + + + +
+ +
+
+ +
+ + + + +
+ +
+ + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+
+
+
+
+
\ No newline at end of file diff --git a/force-app/main/default/pages/SiteRegister.page-meta.xml b/force-app/main/default/pages/SiteRegister.page-meta.xml new file mode 100644 index 0000000..ec807f4 --- /dev/null +++ b/force-app/main/default/pages/SiteRegister.page-meta.xml @@ -0,0 +1,8 @@ + + + 58.0 + false + false + Default Salesforce Sites User Registration page + + diff --git a/force-app/main/default/pages/SiteRegisterConfirm.page b/force-app/main/default/pages/SiteRegisterConfirm.page new file mode 100644 index 0000000..6001957 --- /dev/null +++ b/force-app/main/default/pages/SiteRegisterConfirm.page @@ -0,0 +1,30 @@ + + + +
+ +
+
+ +
+ + + + +
+ +
+
+ {!$Label.site.go_to_login_page} +
+
+
+
+ +
+
+
+
+
+
+
\ No newline at end of file diff --git a/force-app/main/default/pages/SiteRegisterConfirm.page-meta.xml b/force-app/main/default/pages/SiteRegisterConfirm.page-meta.xml new file mode 100644 index 0000000..b2d6f7a --- /dev/null +++ b/force-app/main/default/pages/SiteRegisterConfirm.page-meta.xml @@ -0,0 +1,8 @@ + + + 58.0 + false + false + Default Salesforce Sites User Registration Confirmation page + + diff --git a/force-app/main/default/pages/SiteTemplate.page b/force-app/main/default/pages/SiteTemplate.page new file mode 100644 index 0000000..2476eb5 --- /dev/null +++ b/force-app/main/default/pages/SiteTemplate.page @@ -0,0 +1,13 @@ + + + + +
+
+ + +
+ + +
+
\ No newline at end of file diff --git a/force-app/main/default/pages/SiteTemplate.page-meta.xml b/force-app/main/default/pages/SiteTemplate.page-meta.xml new file mode 100644 index 0000000..f11d051 --- /dev/null +++ b/force-app/main/default/pages/SiteTemplate.page-meta.xml @@ -0,0 +1,8 @@ + + + 58.0 + false + false + Default Lightning Platform template for site pages + + diff --git a/force-app/main/default/pages/StdExceptionTemplate.page b/force-app/main/default/pages/StdExceptionTemplate.page new file mode 100644 index 0000000..965917d --- /dev/null +++ b/force-app/main/default/pages/StdExceptionTemplate.page @@ -0,0 +1,23 @@ + + +
+ +
+
+ +
+ + + + + + + + +
+
+ +
+
+
+
\ No newline at end of file diff --git a/force-app/main/default/pages/StdExceptionTemplate.page-meta.xml b/force-app/main/default/pages/StdExceptionTemplate.page-meta.xml new file mode 100644 index 0000000..9933c9f --- /dev/null +++ b/force-app/main/default/pages/StdExceptionTemplate.page-meta.xml @@ -0,0 +1,8 @@ + + + 58.0 + false + false + Default Lightning Platform template for standard exception pages + + diff --git a/force-app/main/default/pages/SubscribeContact.page b/force-app/main/default/pages/SubscribeContact.page new file mode 100644 index 0000000..9e483bd --- /dev/null +++ b/force-app/main/default/pages/SubscribeContact.page @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/force-app/main/default/pages/SubscribeContact.page-meta.xml b/force-app/main/default/pages/SubscribeContact.page-meta.xml new file mode 100644 index 0000000..e32ccc6 --- /dev/null +++ b/force-app/main/default/pages/SubscribeContact.page-meta.xml @@ -0,0 +1,27 @@ + + + 60.0 + false + false + + + 3 + 22 + npe01 + + + 3 + 25 + npe03 + + + 3 + 15 + npe4 + + + 3 + 13 + npe5 + + diff --git a/force-app/main/default/pages/TestVffff.page b/force-app/main/default/pages/TestVffff.page new file mode 100644 index 0000000..8068e64 --- /dev/null +++ b/force-app/main/default/pages/TestVffff.page @@ -0,0 +1,55 @@ + + + +
+
+
+ +

PDF Fonts Test Page

+ +

This text, which has no styles applied, is styled in the default font for the + Visualforce PDF rendering engine.

+ +

The fonts available when rendering a page as a PDF are as follows. The first +listed font-family value for each typeface is the recommended choice.

+ + + + + + + + + +
Font NameStyle font-family Value to Use (Synonyms)
Arial + Unicode MS
    +
  • Arial Unicode MS
  • +
Helvetica
    +
  • sans-serif
  • +
  • SansSerif
  • +
  • Dialog
  • +
Times
    +
  • serif
  • +
  • Times
  • +
Courier
    +
  • monospace
  • +
  • Courier
  • +
  • Monospaced
  • +
  • DialogInput
  • +
+ +

Notes: +

    +
  • These rules apply to server-side PDF rendering. You might see different results + when viewing this page in a web browser.
  • +
  • Text styled with any value besides those listed above receives the default font + style, Times. This means that, ironically, while Helvetica's synonyms render as + Helvetica, using "Helvetica" for the font-family style renders as Times. + We recommend using "sans-serif".
  • +
  • Arial Unicode MS is the only multibyte font available, providing support for the + extended character sets of languages that don't use the Latin character set.
  • +
+

+ +
\ No newline at end of file diff --git a/force-app/main/default/pages/TestVffff.page-meta.xml b/force-app/main/default/pages/TestVffff.page-meta.xml new file mode 100644 index 0000000..4419d33 --- /dev/null +++ b/force-app/main/default/pages/TestVffff.page-meta.xml @@ -0,0 +1,27 @@ + + + 59.0 + false + false + + + 3 + 22 + npe01 + + + 3 + 25 + npe03 + + + 3 + 15 + npe4 + + + 3 + 13 + npe5 + + diff --git a/force-app/main/default/pages/ThankuPage.page b/force-app/main/default/pages/ThankuPage.page new file mode 100644 index 0000000..eb9d6f6 --- /dev/null +++ b/force-app/main/default/pages/ThankuPage.page @@ -0,0 +1,3 @@ + + Thanku + \ No newline at end of file diff --git a/force-app/main/default/pages/ThankuPage.page-meta.xml b/force-app/main/default/pages/ThankuPage.page-meta.xml new file mode 100644 index 0000000..a478c22 --- /dev/null +++ b/force-app/main/default/pages/ThankuPage.page-meta.xml @@ -0,0 +1,7 @@ + + + 58.0 + true + false + + diff --git a/force-app/main/default/pages/Unauthorized.page b/force-app/main/default/pages/Unauthorized.page new file mode 100644 index 0000000..b0e4ff2 --- /dev/null +++ b/force-app/main/default/pages/Unauthorized.page @@ -0,0 +1,38 @@ + + + +
+ +
+
+ +
+ + + + + + +
+
+ +
+ +
+
+
+ + + +
+
+
+ +
+
+
+
+
+
+ +
\ No newline at end of file diff --git a/force-app/main/default/pages/Unauthorized.page-meta.xml b/force-app/main/default/pages/Unauthorized.page-meta.xml new file mode 100644 index 0000000..7726134 --- /dev/null +++ b/force-app/main/default/pages/Unauthorized.page-meta.xml @@ -0,0 +1,8 @@ + + + 58.0 + false + false + Default Lightning Platform Authorization Required page + + diff --git a/force-app/main/default/pages/UnderConstruction.page b/force-app/main/default/pages/UnderConstruction.page new file mode 100644 index 0000000..81dc16e --- /dev/null +++ b/force-app/main/default/pages/UnderConstruction.page @@ -0,0 +1,15 @@ + + + + + + + + + +
+
+ +
+
+
\ No newline at end of file diff --git a/force-app/main/default/pages/UnderConstruction.page-meta.xml b/force-app/main/default/pages/UnderConstruction.page-meta.xml new file mode 100644 index 0000000..cdbf00e --- /dev/null +++ b/force-app/main/default/pages/UnderConstruction.page-meta.xml @@ -0,0 +1,8 @@ + + + 58.0 + false + false + Default Lightning Platform Under Construction page + + diff --git a/force-app/main/default/pages/addOpporContact.page b/force-app/main/default/pages/addOpporContact.page new file mode 100644 index 0000000..d7e06ae --- /dev/null +++ b/force-app/main/default/pages/addOpporContact.page @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + +
+ +
+
+
\ No newline at end of file diff --git a/force-app/main/default/pages/addOpporContact.page-meta.xml b/force-app/main/default/pages/addOpporContact.page-meta.xml new file mode 100644 index 0000000..1e33d2a --- /dev/null +++ b/force-app/main/default/pages/addOpporContact.page-meta.xml @@ -0,0 +1,7 @@ + + + 58.0 + false + false + + diff --git a/force-app/main/default/pages/nob.page b/force-app/main/default/pages/nob.page new file mode 100644 index 0000000..332cf62 --- /dev/null +++ b/force-app/main/default/pages/nob.page @@ -0,0 +1,19 @@ + +
    +
  1. fist li +
      +
    1. li A +
        +
      1. li inside A
      2. + +
      +
    2. +
    3. li B
    4. + +
    +
  2. +
  3. second li
  4. + +
+ +
\ No newline at end of file diff --git a/force-app/main/default/pages/nob.page-meta.xml b/force-app/main/default/pages/nob.page-meta.xml new file mode 100644 index 0000000..65098ac --- /dev/null +++ b/force-app/main/default/pages/nob.page-meta.xml @@ -0,0 +1,27 @@ + + + 59.0 + false + false + + + 3 + 22 + npe01 + + + 3 + 25 + npe03 + + + 3 + 15 + npe4 + + + 3 + 13 + npe5 + + diff --git a/force-app/main/default/pages/subscriberVF.page b/force-app/main/default/pages/subscriberVF.page new file mode 100644 index 0000000..41846c7 --- /dev/null +++ b/force-app/main/default/pages/subscriberVF.page @@ -0,0 +1,6 @@ + + +

Congratulations

+ This is your new Page + +
\ No newline at end of file diff --git a/force-app/main/default/pages/subscriberVF.page-meta.xml b/force-app/main/default/pages/subscriberVF.page-meta.xml new file mode 100644 index 0000000..788aea5 --- /dev/null +++ b/force-app/main/default/pages/subscriberVF.page-meta.xml @@ -0,0 +1,27 @@ + + + 60.0 + false + false + + + 3 + 22 + npe01 + + + 3 + 25 + npe03 + + + 3 + 15 + npe4 + + + 3 + 13 + npe5 + + diff --git a/force-app/main/default/pages/test.page b/force-app/main/default/pages/test.page new file mode 100644 index 0000000..10d8daa --- /dev/null +++ b/force-app/main/default/pages/test.page @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + +
+ Opportunity Records Assiociated with Account + +
+ +
+ + + + + + + + + + + + + + + + + + + + +
Opportunity NameStage NameClose DateAccount Name
{!opp.Name}{!opp.StageName}{!opp.CloseDate}{!opp.Account.Name}
+
+ + + + + +
\ No newline at end of file diff --git a/force-app/main/default/pages/test.page-meta.xml b/force-app/main/default/pages/test.page-meta.xml new file mode 100644 index 0000000..5900e2f --- /dev/null +++ b/force-app/main/default/pages/test.page-meta.xml @@ -0,0 +1,27 @@ + + + 60.0 + false + false + + + 3 + 22 + npe01 + + + 3 + 25 + npe03 + + + 3 + 15 + npe4 + + + 3 + 13 + npe5 + + diff --git a/force-app/main/default/pages/tvf.page b/force-app/main/default/pages/tvf.page new file mode 100644 index 0000000..ef80b24 --- /dev/null +++ b/force-app/main/default/pages/tvf.page @@ -0,0 +1,21 @@ + + + + + + + +
+ Username:

+ Password:

+     + +
+
+
\ No newline at end of file diff --git a/force-app/main/default/pages/tvf.page-meta.xml b/force-app/main/default/pages/tvf.page-meta.xml new file mode 100644 index 0000000..cb4f0be --- /dev/null +++ b/force-app/main/default/pages/tvf.page-meta.xml @@ -0,0 +1,7 @@ + + + 58.0 + false + false + + diff --git a/force-app/main/default/staticresources/Botimage.png b/force-app/main/default/staticresources/Botimage.png new file mode 100644 index 0000000..490c9ae Binary files /dev/null and b/force-app/main/default/staticresources/Botimage.png differ diff --git a/force-app/main/default/staticresources/Botimage.resource-meta.xml b/force-app/main/default/staticresources/Botimage.resource-meta.xml new file mode 100644 index 0000000..f7d6923 --- /dev/null +++ b/force-app/main/default/staticresources/Botimage.resource-meta.xml @@ -0,0 +1,5 @@ + + + Private + image/png + diff --git a/force-app/main/default/staticresources/Checkboxx1.png b/force-app/main/default/staticresources/Checkboxx1.png new file mode 100644 index 0000000..2f2ce76 Binary files /dev/null and b/force-app/main/default/staticresources/Checkboxx1.png differ diff --git a/force-app/main/default/staticresources/Checkboxx1.resource-meta.xml b/force-app/main/default/staticresources/Checkboxx1.resource-meta.xml new file mode 100644 index 0000000..3418a83 --- /dev/null +++ b/force-app/main/default/staticresources/Checkboxx1.resource-meta.xml @@ -0,0 +1,5 @@ + + + Public + image/png + diff --git a/force-app/main/default/staticresources/Confetti.js b/force-app/main/default/staticresources/Confetti.js new file mode 100644 index 0000000..e947b26 --- /dev/null +++ b/force-app/main/default/staticresources/Confetti.js @@ -0,0 +1,2 @@ +!function(t,e){!function(){var o=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame||function(e){t.setTimeout(e,1e3/60)},n={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,ticks:200,x:.5,y:.5,zIndex:100,colors:["#610B0B","#FFFF00","#FF00BF","#0040FF","#585858","#00FFBF","#FE642E","#FFBF00","#0101DF","#FF8000","#00FF00","#FF0040","#A901DB","#0B0B3B","#FF0000"]};function i(){}function r(t,e,o){return function(t,e){return e?e(t):t}(t&&null!=t[e]?t[e]:n[e],o)}function a(t){return parseInt(t,16)}function l(t){t.width=document.documentElement.clientWidth,t.height=document.documentElement.clientHeight}function c(t){var e=t.getBoundingClientRect();t.width=e.width,t.height=e.height}function s(n,r,a,s,u){var d=r.slice(),f=n.getContext("2d"),h=n.width,m=n.height,b=a?l:c;function g(){h=m=null}var y,v=(y=function(e){o(function i(){h||m||(b(n),h=n.width,m=n.height),f.clearRect(0,0,h,m),(d=d.filter(function(t){return function(t,e){e.x+=Math.cos(e.angle2D)*e.velocity,e.y+=Math.sin(e.angle2D)*e.velocity+3,e.wobble+=.1,e.velocity*=e.decay,e.tiltAngle+=.1,e.tiltSin=Math.sin(e.tiltAngle),e.tiltCos=Math.cos(e.tiltAngle),e.random=Math.random()+5,e.wobbleX=e.x+10*Math.cos(e.wobble),e.wobbleY=e.y+10*Math.sin(e.wobble);var o=e.tick++/e.totalTicks,n=e.x+e.random*e.tiltCos,i=e.y+e.random*e.tiltSin,r=e.wobbleX+e.random*e.tiltCos,a=e.wobbleY+e.random*e.tiltSin;return t.fillStyle="rgba("+e.color.r+", "+e.color.g+", "+e.color.b+", "+(1-o)+")",t.beginPath(),t.moveTo(Math.floor(e.x),Math.floor(e.y)),t.lineTo(Math.floor(e.wobbleX),Math.floor(i)),t.lineTo(Math.floor(r),Math.floor(a)),t.lineTo(Math.floor(n),Math.floor(e.wobbleY)),t.closePath(),t.fill(),e.tick + + Public + text/javascript + diff --git a/force-app/main/default/staticresources/Doller.jpeg b/force-app/main/default/staticresources/Doller.jpeg new file mode 100644 index 0000000..e8b11a5 Binary files /dev/null and b/force-app/main/default/staticresources/Doller.jpeg differ diff --git a/force-app/main/default/staticresources/Doller.resource-meta.xml b/force-app/main/default/staticresources/Doller.resource-meta.xml new file mode 100644 index 0000000..c3d439f --- /dev/null +++ b/force-app/main/default/staticresources/Doller.resource-meta.xml @@ -0,0 +1,5 @@ + + + Public + image/jpeg + diff --git a/force-app/main/default/staticresources/Equal.png b/force-app/main/default/staticresources/Equal.png new file mode 100644 index 0000000..e957dc1 Binary files /dev/null and b/force-app/main/default/staticresources/Equal.png differ diff --git a/force-app/main/default/staticresources/Equal.resource-meta.xml b/force-app/main/default/staticresources/Equal.resource-meta.xml new file mode 100644 index 0000000..79f964b --- /dev/null +++ b/force-app/main/default/staticresources/Equal.resource-meta.xml @@ -0,0 +1,6 @@ + + + Public + image/png + Equal Home Photo + diff --git a/force-app/main/default/staticresources/Jquery.js b/force-app/main/default/staticresources/Jquery.js new file mode 100644 index 0000000..4024b66 --- /dev/null +++ b/force-app/main/default/staticresources/Jquery.js @@ -0,0 +1,4 @@ +/*! jQuery v2.2.4 | (c) jQuery Foundation | jquery.org/license */ +!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="2.2.4",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:g,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=a&&a.toString();return!n.isArray(a)&&b-parseFloat(b)+1>=0},isPlainObject:function(a){var b;if("object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;if(a.constructor&&!k.call(a,"constructor")&&!k.call(a.constructor.prototype||{},"isPrototypeOf"))return!1;for(b in a);return void 0===b||k.call(a,b)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=d.createElement("script"),b.text=a,d.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):g.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:h.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&&h.push(e);else for(g in a)e=b(a[g],g,c),null!=e&&h.push(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(d=e.call(arguments,2),f=function(){return a.apply(b||this,d.concat(e.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ga(),z=ga(),A=ga(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+L+"*\\]",O=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",P=new RegExp(L+"+","g"),Q=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),R=new RegExp("^"+L+"*,"+L+"*"),S=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(O),V=new RegExp("^"+M+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,aa=/'|\\/g,ba=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ca=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(ea){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fa(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==x&&9!==x&&11!==x)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a)))if(f=o[1]){if(9===x){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(o[2])return H.apply(d,b.getElementsByTagName(a)),d;if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==x)w=b,s=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(aa,"\\$&"):b.setAttribute("id",k=u),r=g(a),h=r.length,l=V.test(k)?"#"+k:"[id='"+k+"']";while(h--)r[h]=l+" "+qa(r[h]);s=r.join(","),w=_.test(a)&&oa(b.parentNode)||b}if(s)try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(Q,"$1"),b,d,e)}function ga(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ha(a){return a[u]=!0,a}function ia(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ja(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function ka(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function la(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function na(a){return ha(function(b){return b=+b,ha(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function oa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=fa.support={},f=fa.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fa.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ia(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ia(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ia(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ia(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ia(function(a){var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ia(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ka(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ka(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},fa.matches=function(a,b){return fa(a,null,null,b)},fa.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fa(b,n,null,[a]).length>0},fa.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fa.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fa.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fa.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fa.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fa.selectors={cacheLength:50,createPseudo:ha,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fa.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fa.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ba,ca).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fa.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(P," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fa.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ha(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ha(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ha(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ha(function(a){return function(b){return fa(a,b).length>0}}),contains:ha(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ha(function(a){return V.test(a||"")||fa.error("unsupported lang: "+a),a=a.replace(ba,ca).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Y.test(a.nodeName)},input:function(a){return X.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:na(function(){return[0]}),last:na(function(a,b){return[b-1]}),eq:na(function(a,b,c){return[0>c?c+b:c]}),even:na(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:na(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:na(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:na(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function ra(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j,k=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(j=b[u]||(b[u]={}),i=j[b.uniqueID]||(j[b.uniqueID]={}),(h=i[d])&&h[0]===w&&h[1]===f)return k[2]=h[2];if(i[d]=k,k[2]=a(b,c,g))return!0}}}function sa(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ta(a,b,c){for(var d=0,e=b.length;e>d;d++)fa(a,b[d],c);return c}function ua(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function va(a,b,c,d,e,f){return d&&!d[u]&&(d=va(d)),e&&!e[u]&&(e=va(e,f)),ha(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ta(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ua(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ua(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ua(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function wa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ra(function(a){return a===b},h,!0),l=ra(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ra(sa(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return va(i>1&&sa(m),i>1&&qa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,e>i&&wa(a.slice(i,e)),f>e&&wa(a=a.slice(e)),f>e&&qa(a))}m.push(c)}return sa(m)}function xa(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ua(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&fa.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ha(f):f}return h=fa.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xa(e,d)),f.selector=a}return f},i=fa.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ba,ca),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ba,ca),_.test(j[0].type)&&oa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qa(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&oa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ia(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ia(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ja("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ia(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ja("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ia(function(a){return null==a.getAttribute("disabled")})||ja(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fa}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return h.call(b,a)>-1!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:B.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&f.parentNode&&(this.length=1,this[0]=f),this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?void 0!==c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};C.prototype=n.fn,A=n(d);var D=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=w.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?h.call(n(a),this[0]):h.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function F(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return F(a,"nextSibling")},prev:function(a){return F(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(E[a]||n.uniqueSort(e),D.test(a)&&e.reverse()),this.pushStack(e)}});var G=/\S+/g;function H(a){var b={};return n.each(a.match(G)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?H(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);d>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().progress(h(b,j,i)).done(h(b,k,c)).fail(g.reject):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function J(){d.removeEventListener("DOMContentLoaded",J),a.removeEventListener("load",J),n.ready()}n.ready.promise=function(b){return I||(I=n.Deferred(),"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(n.ready):(d.addEventListener("DOMContentLoaded",J),a.addEventListener("load",J))),I.promise(b)},n.ready.promise();var K=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)K(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},L=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function M(){this.expando=n.expando+M.uid++}M.uid=1,M.prototype={register:function(a,b){var c=b||{};return a.nodeType?a[this.expando]=c:Object.defineProperty(a,this.expando,{value:c,writable:!0,configurable:!0}),a[this.expando]},cache:function(a){if(!L(a))return{};var b=a[this.expando];return b||(b={},L(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[b]=c;else for(d in b)e[d]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=a[this.expando];if(void 0!==f){if(void 0===b)this.register(a);else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in f?d=[b,e]:(d=e,d=d in f?[d]:d.match(G)||[])),c=d.length;while(c--)delete f[d[c]]}(void 0===b||n.isEmptyObject(f))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!n.isEmptyObject(b)}};var N=new M,O=new M,P=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Q=/[A-Z]/g;function R(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Q,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:P.test(c)?n.parseJSON(c):c; +}catch(e){}O.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return O.hasData(a)||N.hasData(a)},data:function(a,b,c){return O.access(a,b,c)},removeData:function(a,b){O.remove(a,b)},_data:function(a,b,c){return N.access(a,b,c)},_removeData:function(a,b){N.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=O.get(f),1===f.nodeType&&!N.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),R(f,d,e[d])));N.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){O.set(this,a)}):K(this,function(b){var c,d;if(f&&void 0===b){if(c=O.get(f,a)||O.get(f,a.replace(Q,"-$&").toLowerCase()),void 0!==c)return c;if(d=n.camelCase(a),c=O.get(f,d),void 0!==c)return c;if(c=R(f,d,void 0),void 0!==c)return c}else d=n.camelCase(a),this.each(function(){var c=O.get(this,d);O.set(this,d,b),a.indexOf("-")>-1&&void 0!==c&&O.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){O.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=N.get(a,b),c&&(!d||n.isArray(c)?d=N.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return N.get(a,c)||N.access(a,c,{empty:n.Callbacks("once memory").add(function(){N.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length",""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};$.optgroup=$.option,$.tbody=$.tfoot=$.colgroup=$.caption=$.thead,$.th=$.td;function _(a,b){var c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function aa(a,b){for(var c=0,d=a.length;d>c;c++)N.set(a[c],"globalEval",!b||N.get(b[c],"globalEval"))}var ba=/<|&#?\w+;/;function ca(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],o=0,p=a.length;p>o;o++)if(f=a[o],f||0===f)if("object"===n.type(f))n.merge(m,f.nodeType?[f]:f);else if(ba.test(f)){g=g||l.appendChild(b.createElement("div")),h=(Y.exec(f)||["",""])[1].toLowerCase(),i=$[h]||$._default,g.innerHTML=i[1]+n.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;n.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push(b.createTextNode(f));l.textContent="",o=0;while(f=m[o++])if(d&&n.inArray(f,d)>-1)e&&e.push(f);else if(j=n.contains(f.ownerDocument,f),g=_(l.appendChild(f),"script"),j&&aa(g),c){k=0;while(f=g[k++])Z.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var da=/^key/,ea=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,fa=/^([^.]*)(?:\.(.+)|)/;function ga(){return!0}function ha(){return!1}function ia(){try{return d.activeElement}catch(a){}}function ja(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)ja(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=ha;else if(!e)return a;return 1===f&&(g=e,e=function(a){return n().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=n.guid++)),a.each(function(){n.event.add(this,b,e,d,c)})}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return"undefined"!=typeof n&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(G)||[""],j=b.length;while(j--)h=fa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.hasData(a)&&N.get(a);if(r&&(i=r.events)){b=(b||"").match(G)||[""],j=b.length;while(j--)if(h=fa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&N.remove(a,"handle events")}},dispatch:function(a){a=n.event.fix(a);var b,c,d,f,g,h=[],i=e.call(arguments),j=(N.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())a.rnamespace&&!a.rnamespace.test(g.namespace)||(a.handleObj=g,a.data=g.data,d=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==d&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!==this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>-1:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h]*)\/>/gi,la=/\s*$/g;function pa(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function qa(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function ra(a){var b=na.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function sa(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(N.hasData(a)&&(f=N.access(a),g=N.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}O.hasData(a)&&(h=O.access(a),i=n.extend({},h),O.set(b,i))}}function ta(a,b){var c=b.nodeName.toLowerCase();"input"===c&&X.test(a.type)?b.checked=a.checked:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}function ua(a,b,c,d){b=f.apply([],b);var e,g,h,i,j,k,m=0,o=a.length,p=o-1,q=b[0],r=n.isFunction(q);if(r||o>1&&"string"==typeof q&&!l.checkClone&&ma.test(q))return a.each(function(e){var f=a.eq(e);r&&(b[0]=q.call(this,e,f.html())),ua(f,b,c,d)});if(o&&(e=ca(b,a[0].ownerDocument,!1,a,d),g=e.firstChild,1===e.childNodes.length&&(e=g),g||d)){for(h=n.map(_(e,"script"),qa),i=h.length;o>m;m++)j=e,m!==p&&(j=n.clone(j,!0,!0),i&&n.merge(h,_(j,"script"))),c.call(a[m],j,m);if(i)for(k=h[h.length-1].ownerDocument,n.map(h,ra),m=0;i>m;m++)j=h[m],Z.test(j.type||"")&&!N.access(j,"globalEval")&&n.contains(k,j)&&(j.src?n._evalUrl&&n._evalUrl(j.src):n.globalEval(j.textContent.replace(oa,"")))}return a}function va(a,b,c){for(var d,e=b?n.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||n.cleanData(_(d)),d.parentNode&&(c&&n.contains(d.ownerDocument,d)&&aa(_(d,"script")),d.parentNode.removeChild(d));return a}n.extend({htmlPrefilter:function(a){return a.replace(ka,"<$1>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=_(h),f=_(a),d=0,e=f.length;e>d;d++)ta(f[d],g[d]);if(b)if(c)for(f=f||_(a),g=g||_(h),d=0,e=f.length;e>d;d++)sa(f[d],g[d]);else sa(a,h);return g=_(h,"script"),g.length>0&&aa(g,!i&&_(a,"script")),h},cleanData:function(a){for(var b,c,d,e=n.event.special,f=0;void 0!==(c=a[f]);f++)if(L(c)){if(b=c[N.expando]){if(b.events)for(d in b.events)e[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);c[N.expando]=void 0}c[O.expando]&&(c[O.expando]=void 0)}}}),n.fn.extend({domManip:ua,detach:function(a){return va(this,a,!0)},remove:function(a){return va(this,a)},text:function(a){return K(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.appendChild(a)}})},prepend:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(_(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return K(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!la.test(a)&&!$[(Y.exec(a)||["",""])[1].toLowerCase()]){a=n.htmlPrefilter(a);try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(_(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return ua(this,arguments,function(b){var c=this.parentNode;n.inArray(this,a)<0&&(n.cleanData(_(this)),c&&c.replaceChild(b,this))},a)}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),f=e.length-1,h=0;f>=h;h++)c=h===f?this:this.clone(!0),n(e[h])[b](c),g.apply(d,c.get());return this.pushStack(d)}});var wa,xa={HTML:"block",BODY:"block"};function ya(a,b){var c=n(b.createElement(a)).appendTo(b.body),d=n.css(c[0],"display");return c.detach(),d}function za(a){var b=d,c=xa[a];return c||(c=ya(a,b),"none"!==c&&c||(wa=(wa||n("