Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Demen Selcan committed Sep 1, 2020
0 parents commit 0f34c10
Show file tree
Hide file tree
Showing 22 changed files with 318 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
**/lwc/**/*.css
**/lwc/**/*.html
**/lwc/**/*.json
**/lwc/**/*.svg
**/lwc/**/*.xml
**/aura/**/*.auradoc
**/aura/**/*.cmp
**/aura/**/*.css
**/aura/**/*.design
**/aura/**/*.evt
**/aura/**/*.json
**/aura/**/*.svg
**/aura/**/*.tokens
**/aura/**/*.xml
.sfdx
12 changes: 12 additions & 0 deletions .forceignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# List files or directories below to ignore them when running force:source:push, force:source:pull, and force:source:status
# More information: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_exclude_source.htm
#

package.xml

# LWC configuration files
**/jsconfig.json
**/.eslintrc.json

# LWC Jest
**/__tests__/**
38 changes: 38 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This file is used for Git repositories to specify intentionally untracked files that Git should ignore.
# If you are not using git, you can delete this file. For more information see: https://git-scm.com/docs/gitignore
# For useful gitignore templates see: https://github.com/github/gitignore

# Salesforce cache
.sfdx/
.localdevserver/

#VsCode
.vscode/

# 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/
10 changes: 10 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# List files or directories below to ignore them when running prettier
# More information: https://prettier.io/docs/en/ignore.html
#

**/staticresources/**
.localdevserver
.sfdx
.vscode

coverage/
13 changes: 13 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"trailingComma": "none",
"overrides": [
{
"files": "**/lwc/**/*.html",
"options": { "parser": "lwc" }
},
{
"files": "*.{cmp,page,component}",
"options": { "parser": "html" }
}
]
}
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Dynamic iFrame Component

This component lets admins embed iFrames by using a Lightning Component.
The component also lets them add the url, design attributes as well as a custom field to pass parameters to the url.

## Deploy this to your Org

<a href="https://githubsfdeploy.herokuapp.com?owner=CoreSEs&repo=dynamicAuraiFrameComponent">
<img alt="Deploy to Salesforce"
src="https://raw.githubusercontent.com/afawcett/githubsfdeploy/master/deploy.png">
</a>
### Special thanks to

[nikitakarpenkov](https://github.com/nikitakarpenkov/iframe-lightning-component) and [jlondrejcka](https://github.com/jlondrejcka/LDS-Dynamic-Field-Input) as this component uses their code mainly and has only been slightly modified.
18 changes: 18 additions & 0 deletions config/project-scratch-def.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"orgName": "dselcan company",
"edition": "Developer",
"features": [],
"settings": {
"lightningExperienceSettings": {
"enableS1DesktopEnabled": true
},
"securitySettings": {
"passwordPolicies": {
"enableSetPasswordInApi": true
}
},
"mobileSettings": {
"enableS1EncryptedStoragePref2": false
}
}
}
4 changes: 4 additions & 0 deletions force-app/main/default/aura/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"plugins": ["@salesforce/eslint-plugin-aura"],
"extends": ["plugin:@salesforce/eslint-plugin-aura/recommended", "prettier"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<aura:documentation>
<aura:description>Documentation</aura:description>
<aura:example name="ExampleName" ref="exampleComponentName" label="Label">
Example Description
</aura:example>
</aura:documentation>
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<aura:component
implements="forceCommunity:availableForAllPageTypes,force:hasRecordId,force:appHostable,flexipage:availableForAllPageTypes, flexipage:availableForRecordHome"
access="global">
<!-- Attributes -->
<aura:attribute name="iframeUrl" type="String" />
<aura:attribute name="width" type="String" />
<aura:attribute name="height" type="String" />
<aura:attribute name="scrolling" type="String" />
<aura:attribute name="frameBorder" type="String" />
<aura:attribute name="style" type="String" />
<aura:attribute name="crossOrigin" type="String" />
<aura:attribute name="parameter" type="String" />
<aura:attribute name="recordId" type="Id" />
<aura:attribute name="passThroughValue" type="String" />


<!-- Lightning Data Service (LDS) Attributes -->
<aura:attribute name="record" type="Object" />
<aura:attribute name="simpleRecord" type="Object" />
<aura:attribute name="recordError" type="String" />


<!-- Lightning Data Service (LDS) avoid an Apex controller -->
<force:recordData aura:id="recordLoader" recordId="{!v.recordId}" targetRecord="{!v.record}"
targetFields="{!v.simpleRecord}" targetError="{!v.recordError}" recordUpdated="{!c.doInit}" layoutType="FULL" />


<!-- iFrame -->
<iframe src="{!v.iframeUrl + v.passThroughValue}" width="{!v.width}" height="{!v.height}" style="{!v.style}"
frameBorder="{!v.frameBorder}" sandbox="{!v.crossOrigin}" scrolling="{!v.scrolling}" />

</aura:component>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>49.0</apiVersion>
<description>A Lightning Component Bundle</description>
</AuraDefinitionBundle>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.THIS {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<design:component label="dynamic iFrame Component">
<design:attribute name="iframeUrl" label="Source URL (HTTPS only)" default="https://put-your-url.here/" />
<design:attribute name="parameter" label="Custom Field API Name (Optional)"
default="Custom_Field_With_Parameter__c" />
<design:attribute name="width" label="Width" default="100%" />
<design:attribute name="height" label="Height" default="500px" />
<design:attribute name="style" label="Style" default="border: none; overflow: scroll;" />
<design:attribute name="scrolling" label="Scrolling" default="auto" />
<design:attribute name="frameBorder" label="Frame Border" default="0" />
<design:attribute name="crossOrigin" label="Cross Origin" default="allow-same-origin allow-scripts allow-forms" />
</design:component>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
({
doInit: function (component, event, helper) {
if ("v.parameter" != null) {
//get the field name passed to the component
var field = component.get("v.parameter");

//set key to lookup the field value (the simple Record component holds the object information)
var key = "v.simpleRecord." + field;

//use the key to lookup value returned in LDS
var value = component.get(key);

//set the value to and attribute to be used in your component
component.set("v.passThroughValue", value);
}
}
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
({
helperMethod : function() {

}
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
({

// Your renderer method overrides go here

})
36 changes: 36 additions & 0 deletions manifest/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>*</members>
<name>ApexClass</name>
</types>
<types>
<members>*</members>
<name>ApexComponent</name>
</types>
<types>
<members>*</members>
<name>ApexPage</name>
</types>
<types>
<members>*</members>
<name>ApexTestSuite</name>
</types>
<types>
<members>*</members>
<name>ApexTrigger</name>
</types>
<types>
<members>*</members>
<name>AuraDefinitionBundle</name>
</types>
<types>
<members>*</members>
<name>LightningComponentBundle</name>
</types>
<types>
<members>*</members>
<name>StaticResource</name>
</types>
<version>49.0</version>
</Package>
41 changes: 41 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "salesforce-app",
"private": true,
"version": "1.0.0",
"description": "Salesforce App",
"scripts": {
"lint": "npm run lint:lwc && npm run lint:aura",
"lint:aura": "eslint **/aura/**",
"lint:lwc": "eslint **/lwc/**",
"test": "npm run test:unit",
"test:unit": "sfdx-lwc-jest",
"test:unit:watch": "sfdx-lwc-jest --watch",
"test:unit:debug": "sfdx-lwc-jest --debug",
"test:unit:coverage": "sfdx-lwc-jest --coverage",
"prettier": "prettier --write \"**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml}\"",
"prettier:verify": "prettier --list-different \"**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml}\""
},
"devDependencies": {
"@prettier/plugin-xml": "^0.10.0",
"@salesforce/eslint-config-lwc": "^0.7.0",
"@salesforce/eslint-plugin-aura": "^1.4.0",
"@salesforce/sfdx-lwc-jest": "^0.9.2",
"eslint": "^7.6.0",
"eslint-config-prettier": "^6.11.0",
"husky": "^4.2.1",
"lint-staged": "^10.0.7",
"prettier": "^2.0.5",
"prettier-plugin-apex": "^1.6.0"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml}": [
"prettier --write"
],
"**/{aura|lwc}/**": ["eslint"]
}
}
10 changes: 10 additions & 0 deletions scripts/apex/hello.apex
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Use .apex files to store anonymous Apex.
// You can execute anonymous Apex in VS Code by selecting the
// apex text and running the command:
// SFDX: Execute Anonymous Apex with Currently Selected Text
// You can also execute the entire file by running the command:
// SFDX: Execute Anonymous Apex with Editor Contents

string tempvar = 'Enter_your_name_here';
System.debug('Hello World!');
System.debug('My name is ' + tempvar);
6 changes: 6 additions & 0 deletions scripts/soql/account.soql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Use .soql files to store SOQL queries.
// You can execute queries in VS Code by selecting the
// query text and running the command:
// SFDX: Execute SOQL Query with Currently Selected Text

SELECT Id, Name FROM Account
11 changes: 11 additions & 0 deletions sfdx-project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"packageDirectories": [
{
"path": "force-app",
"default": true
}
],
"namespace": "",
"sfdcLoginUrl": "https://login.salesforce.com",
"sourceApiVersion": "49.0"
}

0 comments on commit 0f34c10

Please sign in to comment.