Skip to content

Commit 64a18b1

Browse files
first commit
0 parents  commit 64a18b1

File tree

4,673 files changed

+246104
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,673 files changed

+246104
-0
lines changed

.eslintignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
**/lwc/**/*.css
2+
**/lwc/**/*.html
3+
**/lwc/**/*.json
4+
**/lwc/**/*.svg
5+
**/lwc/**/*.xml
6+
.sfdx

.forceignore

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# List files or directories below to ignore them when running force:source:push, force:source:pull, and force:source:status
2+
# More information: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_exclude_source.htm
3+
#
4+
5+
package.xml
6+
7+
# LWC configuration files
8+
**/jsconfig.json
9+
**/.eslintrc.json
10+
11+
# LWC Jest
12+
**/__tests__/**

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/.git
2+
/.localdevserver
3+
/.sfdx
4+
/.vscode
5+
/config

.prettierignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# List files or directories below to ignore them when running prettier
2+
# More information: https://prettier.io/docs/en/ignore.html
3+
#
4+
5+
**/staticresources/**
6+
.localdevserver
7+
.sfdx
8+
9+
coverage/

.prettierrc

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"trailingComma": "none",
3+
"overrides": [
4+
{
5+
"files": "**/lwc/**/*.html",
6+
"options": { "parser": "lwc" }
7+
},
8+
{
9+
"files": "*.{cmp,page,component}",
10+
"options": { "parser": "html" }
11+
}
12+
]
13+
}

README.md

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Salesforce App
2+
3+
This guide helps Salesforce developers who are new to Visual Studio Code go from zero to a deployed app using Salesforce Extensions for VS Code and Salesforce CLI.
4+
5+
## Part 1: Choosing a Development Model
6+
7+
There are two types of developer processes or models supported in Salesforce Extensions for VS Code and Salesforce CLI. These models are explained below. Each model offers pros and cons and is fully supported.
8+
9+
### Package Development Model
10+
11+
The package development model allows you to create self-contained applications or libraries that are deployed to your org as a single package. These packages are typically developed against source-tracked orgs called scratch orgs. This development model is geared toward a more modern type of software development process that uses org source tracking, source control, and continuous integration and deployment.
12+
13+
If you are starting a new project, we recommend that you consider the package development model. To start developing with this model in Visual Studio Code, see [Package Development Model with VS Code](https://forcedotcom.github.io/salesforcedx-vscode/articles/user-guide/package-development-model). For details about the model, see the [Package Development Model](https://trailhead.salesforce.com/en/content/learn/modules/sfdx_dev_model) Trailhead module.
14+
15+
If you are developing against scratch orgs, use the command `SFDX: Create Project` (VS Code) or `sfdx force:project:create` (Salesforce CLI) to create your project. If you used another command, you might want to start over with that command.
16+
17+
When working with source-tracked orgs, use the commands `SFDX: Push Source to Org` (VS Code) or `sfdx force:source:push` (Salesforce CLI) and `SFDX: Pull Source from Org` (VS Code) or `sfdx force:source:pull` (Salesforce CLI). Do not use the `Retrieve` and `Deploy` commands with scratch orgs.
18+
19+
### Org Development Model
20+
21+
The org development model allows you to connect directly to a non-source-tracked org (sandbox, Developer Edition (DE) org, Trailhead Playground, or even a production org) to retrieve and deploy code directly. This model is similar to the type of development you have done in the past using tools such as Force.com IDE or MavensMate.
22+
23+
To start developing with this model in Visual Studio Code, see [Org Development Model with VS Code](https://forcedotcom.github.io/salesforcedx-vscode/articles/user-guide/org-development-model). For details about the model, see the [Org Development Model](https://trailhead.salesforce.com/content/learn/modules/org-development-model) Trailhead module.
24+
25+
If you are developing against non-source-tracked orgs, use the command `SFDX: Create Project with Manifest` (VS Code) or `sfdx force:project:create --manifest` (Salesforce CLI) to create your project. If you used another command, you might want to start over with this command to create a Salesforce DX project.
26+
27+
When working with non-source-tracked orgs, use the commands `SFDX: Deploy Source to Org` (VS Code) or `sfdx force:source:deploy` (Salesforce CLI) and `SFDX: Retrieve Source from Org` (VS Code) or `sfdx force:source:retrieve` (Salesforce CLI). The `Push` and `Pull` commands work only on orgs with source tracking (scratch orgs).
28+
29+
## The `sfdx-project.json` File
30+
31+
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.
32+
33+
The most important parts of this file for getting started are the `sfdcLoginUrl` and `packageDirectories` properties.
34+
35+
The `sfdcLoginUrl` specifies the default login URL to use when authorizing an org.
36+
37+
The `packageDirectories` filepath tells VS Code and Salesforce CLI where the metadata files for your project are stored. You need at least one package directory set in your file. The default setting is shown below. If you set the value of the `packageDirectories` property called `path` to `force-app`, by default your metadata goes in the `force-app` directory. If you want to change that directory to something like `src`, simply change the `path` value and make sure the directory you’re pointing to exists.
38+
39+
```json
40+
"packageDirectories" : [
41+
{
42+
"path": "force-app",
43+
"default": true
44+
}
45+
]
46+
```
47+
48+
## Part 2: Working with Source
49+
50+
For details about developing against scratch orgs, see the [Package Development Model](https://trailhead.salesforce.com/en/content/learn/modules/sfdx_dev_model) module on Trailhead or [Package Development Model with VS Code](https://forcedotcom.github.io/salesforcedx-vscode/articles/user-guide/package-development-model).
51+
52+
For details about developing against orgs that don’t have source tracking, see the [Org Development Model](https://trailhead.salesforce.com/content/learn/modules/org-development-model) module on Trailhead or [Org Development Model with VS Code](https://forcedotcom.github.io/salesforcedx-vscode/articles/user-guide/org-development-model).
53+
54+
## Part 3: Deploying to Production
55+
56+
Don’t deploy your code to production directly from Visual Studio Code. The deploy and retrieve commands do not support transactional operations, which means that a deployment can fail in a partial state. Also, the deploy and retrieve commands don’t run the tests needed for production deployments. The push and pull commands are disabled for orgs that don’t have source tracking, including production orgs.
57+
58+
Deploy your changes to production using [packaging](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_dev2gp.htm) or by [converting your source](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_force_source.htm#cli_reference_convert) into metadata format and using the [metadata deploy command](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_force_mdapi.htm#cli_reference_deploy).
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
public with sharing class FileUploadController {
2+
3+
@AuraEnabled
4+
public static Boolean uploadFile(Id parentId,String strfileName, String fileType, String fileContent){
5+
6+
return true;
7+
}
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
3+
<apiVersion>48.0</apiVersion>
4+
<status>Active</status>
5+
</ApexClass>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
public with sharing class SalesforceFileUpload implements FileUploadController {
2+
3+
4+
@AuraEnabled
5+
public static Boolean uploadFile(Id parentId,String strfileName, String fileType, String fileContent){
6+
7+
Attachment att = new Attachment();
8+
att.ParentId = parentId;
9+
att.Name = strfileName;
10+
att.Body=Blob.valueOf(fileContent);
11+
Insert att;
12+
13+
return true;
14+
}
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
3+
<apiVersion>48.0</apiVersion>
4+
<status>Active</status>
5+
</ApexClass>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": ["@salesforce/eslint-config-lwc/recommended"]
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
article{
2+
3+
padding: 1rem;
4+
}
5+
6+
h2{
7+
font-weight: bold;
8+
}
9+
10+
.drop-zone{
11+
12+
background-color: lightgray;
13+
}
14+
15+
.active{
16+
17+
border: 3px solid green;
18+
}
19+
20+
.inactive{
21+
22+
border: 1px dotted grey;
23+
}
24+
25+
.inactive:hover{
26+
27+
border: 1px solid grey;
28+
}
29+
30+
header {
31+
32+
border-bottom: 1px solid lightgray;
33+
}
34+
35+
footer{
36+
37+
border-top: 1px solid lightgray;
38+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<template>
2+
<article class="slds-card">
3+
<header class="slds-card__header slds-grid">
4+
<div class="slds-media slds-media_center slds-has-flexi-truncate slds-m-vertical_small">
5+
<div class="slds-media__figure">
6+
<lightning-icon icon-name="doctype:attachment" alternative-text="attachment" size="medium">
7+
</lightning-icon>
8+
</div>
9+
<div class="slds-media__body slds-truncate">
10+
<h2 class="slds-text-heading_medium">
11+
{title}
12+
</h2>
13+
<span class="slds-text_small">
14+
drag your files here!
15+
</span>
16+
</div>
17+
</div>
18+
19+
</header>
20+
<div class="slds-card__body">
21+
22+
<div class="drop-zone">
23+
<div data-id="dropZoneContextId" class={dropZoneContextClass}>
24+
<div data-id="droparea" class="slds-align_absolute-center" style="width:100%;height:10rem">
25+
<div class=""><b>Choose files </b> or drag here</div>
26+
</div>
27+
</div>
28+
</div>
29+
30+
<!-- <lightning-input label=" " name="file to uploder" type="file" multiple
31+
onchange={handleSelectedFiles}></lightning-input>-->
32+
33+
<div class="slds-text-body_small">{fileName}
34+
</div>
35+
<template if:true={showSpinner}>
36+
<lightning-spinner alternative-text="Uploading the file......" size="medium">
37+
</lightning-spinner>
38+
</template>
39+
</div>
40+
<footer>
41+
<ul class="slds-button-group-row slds-align_absolute-center slds-m-vertical_small">
42+
<li class="slds-button-group-item">
43+
<button class="slds-button slds-button_brand slds-button-large"
44+
onclick={handleFileUpload}>Submit</button>
45+
</li>
46+
<li class="slds-button-group-item">
47+
<button class="slds-button slds-button_neutral">Cancel</button>
48+
</li>
49+
</ul>
50+
</footer>
51+
</article>
52+
</template>

0 commit comments

Comments
 (0)