Initial commit: SyncMadeEasy Salesforce package source
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
commit
39fe4689cf
|
|
@ -0,0 +1 @@
|
|||
{"sessionId":"7cb4f688-9ba1-48e2-a81c-bb0980ad02f5","pid":10296,"procStart":"134326474338722578","acquiredAt":1788248883812}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
# 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__/**
|
||||
|
||||
node_modules/
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
# 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/
|
||||
|
||||
# ApexPMD cache
|
||||
.pmdCache
|
||||
|
||||
# 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/
|
||||
|
|
@ -0,0 +1 @@
|
|||
npm run precommit
|
||||
|
|
@ -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/
|
||||
|
|
@ -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" }
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"recommendations": [
|
||||
"salesforce.salesforcedx-vscode",
|
||||
"redhat.vscode-xml",
|
||||
"dbaeumer.vscode-eslint",
|
||||
"esbenp.prettier-vscode",
|
||||
"financialforce.lana"
|
||||
]
|
||||
}
|
||||
|
|
@ -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
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"search.exclude": {
|
||||
"**/node_modules": true,
|
||||
"**/bower_components": true,
|
||||
"**/.sf": true,
|
||||
"**/.sfdx": true
|
||||
},
|
||||
"xml.preferences.showSchemaDocumentationType": "none"
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
# Salesforce DX Project
|
||||
|
||||
Salesforce DX is a development approach that brings source-driven development, team collaboration, and continuous integration to the Salesforce Platform. Instead of working directly in an org through a web browser, you work with metadata as source files in a local DX project, track changes in version control, and deploy through automated processes.
|
||||
|
||||
This project template gets you started with the tools and structure you need to build Salesforce applications using source control, scratch orgs, and the Salesforce CLI.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before you start, make sure you have:
|
||||
|
||||
- **Salesforce CLI** - Download from [developer.salesforce.com/tools/salesforcecli](https://developer.salesforce.com/tools/salesforcecli). See [Install Salesforce CLI](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm) for details.
|
||||
- **VS Code with Salesforce Extension Pack** - See [Installation Instructions](https://developer.salesforce.com/docs/platform/sfvscode-extensions/guide/install.html) for details. Includes the Agentforce Vibes extension.
|
||||
- **A development org** - Sign up for a free Developer Edition org [here](https://developer.salesforce.com/signup).
|
||||
- **Dev Hub enabled** (optional, required to create scratch orgs) - You can enable Dev Hub in your development org under Setup > Dev Hub. See [Provide Developers Access to Salesforce DX Tools](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_setup_dx_tools.htm).
|
||||
|
||||
## Project Structure
|
||||
|
||||
Your DX project follows this structure:
|
||||
|
||||
- **`force-app/main/default/`** - Your metadata source files live in this default package directory. You can configure additional package directories in the `sfdx-project.json` file.
|
||||
- **`config/`** - Scratch org definitions and project settings
|
||||
- **`scripts/`** - Automation scripts for common tasks
|
||||
- **`sfdx-project.json`** - Project manifest that defines package directories, namespace, API version, and other project-level settings
|
||||
|
||||
See [Salesforce DX Project Configuration](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_ws_config.htm).
|
||||
|
||||
## Get Started
|
||||
|
||||
Ready to start developing? The [Get Started with Salesforce DX](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_get_started_dx.htm) guide walks you through your first project, from creating a scratch org to creating a simple Apex class or LWC to deploying your code to a sandbox.
|
||||
|
||||
## Common Salesforce CLI Commands
|
||||
|
||||
Here are common CLI commands that you'll use the most:
|
||||
|
||||
- `sf org login web`: Authorize an org
|
||||
- `sf org open`: Open your org in a browser
|
||||
- `sf org create scratch`: Create a scratch org
|
||||
- `sf project deploy start`: Deploy metadata to your org
|
||||
- `sf project retrieve start`: Retrieve metadata from your org
|
||||
- `sf template generate <artifact>`: Scaffold new components, such as Apex classes and triggers, LWC components, Lightning apps, and more
|
||||
- `sf apex <command>`: Run Apex tests, run anonymous Apex blocks, and view logs
|
||||
- `sf data <command>`: Work with test data
|
||||
- `sf alias <command>`: Manage org aliases
|
||||
- `sf config <command>`: Configure CLI settings
|
||||
|
||||
## Use Agentforce Vibes to Build Lightning Apps
|
||||
|
||||
Transform your ideas into custom Lightning apps that extend CRM workflows directly in Lightning Experience. Through natural conversations with Agentforce Vibes, implement custom objects and fields, complex business logic, and dynamic UI components. See [Build a Lightning App Using Agentforce Vibes](https://developer.salesforce.com/docs/platform/einstein-for-devs/guide/lexapp-overview.html).
|
||||
|
||||
## Additional Resources
|
||||
|
||||
- [Agentforce Vibes Developer Guide](https://developer.salesforce.com/docs/platform/einstein-for-devs/guide/einstein-overview.html)
|
||||
- [Salesforce CLI Installation 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/)
|
||||
- [Salesforce CLI Command Reference](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/)
|
||||
- [Salesforce CLI Plugin Development Guide](https://developer.salesforce.com/docs/platform/salesforce-cli-plugin/guide/conceptual-overview.html)
|
||||
- [Salesforce VS Code Extensions Documentation](https://developer.salesforce.com/tools/vscode/)
|
||||
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"orgName": "Demo company",
|
||||
"edition": "Developer",
|
||||
"features": ["EnableSetPasswordInApi"],
|
||||
"settings": {
|
||||
"lightningExperienceSettings": {
|
||||
"enableS1DesktopEnabled": true
|
||||
},
|
||||
"mobileSettings": {
|
||||
"enableS1EncryptedStoragePref2": false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
const { defineConfig } = require('eslint/config');
|
||||
const eslintJs = require('@eslint/js');
|
||||
const jestPlugin = require('eslint-plugin-jest');
|
||||
const auraConfig = require('@salesforce/eslint-plugin-aura');
|
||||
const lwcConfig = require('@salesforce/eslint-config-lwc/recommended');
|
||||
const globals = require('globals');
|
||||
|
||||
module.exports = defineConfig([
|
||||
// Aura configuration
|
||||
{
|
||||
files: ['**/aura/**/*.js'],
|
||||
extends: [
|
||||
...auraConfig.configs.recommended,
|
||||
...auraConfig.configs.locker
|
||||
]
|
||||
},
|
||||
|
||||
// LWC configuration
|
||||
{
|
||||
files: ['**/lwc/**/*.js'],
|
||||
extends: [lwcConfig]
|
||||
},
|
||||
|
||||
// LWC configuration with override for LWC test files
|
||||
{
|
||||
files: ['**/lwc/**/*.test.js'],
|
||||
extends: [lwcConfig],
|
||||
rules: {
|
||||
'@lwc/lwc/no-unexpected-wire-adapter-usages': 'off'
|
||||
},
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.node
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// Jest mocks configuration
|
||||
{
|
||||
files: ['**/jest-mocks/**/*.js'],
|
||||
languageOptions: {
|
||||
sourceType: 'module',
|
||||
ecmaVersion: 'latest',
|
||||
globals: {
|
||||
...globals.node,
|
||||
...globals.es2021,
|
||||
...jestPlugin.environments.globals.globals
|
||||
}
|
||||
},
|
||||
plugins: {
|
||||
eslintJs
|
||||
},
|
||||
extends: ['eslintJs/recommended']
|
||||
}
|
||||
]);
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
<aura:event type="COMPONENT" description="Use For Add New Row">
|
||||
<aura:attribute name="Objecttype" type="String" description="Use For Delete Row" />
|
||||
</aura:event>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||
<apiVersion>44.0</apiVersion>
|
||||
<description>A Lightning Component Bundle</description>
|
||||
</AuraDefinitionBundle>
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<aura:application access="GLOBAL" extends="ltng:outApp">
|
||||
<aura:dependency resource="c:displaylogs"/>
|
||||
</aura:application>
|
||||
|
||||
<!--aura:application>
|
||||
|
||||
<c:FieldTable/>
|
||||
</aura:application-->
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||
<apiVersion>41.0</apiVersion>
|
||||
<description>app</description>
|
||||
</AuraDefinitionBundle>
|
||||
|
|
@ -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>
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
.THIS {
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
({
|
||||
myAction : function(component, event, helper) {
|
||||
}
|
||||
})
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
({
|
||||
helperMethod : function() {
|
||||
}
|
||||
})
|
||||
|
|
@ -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>
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
<aura:component controller="AddDeleteController" >
|
||||
<aura:attribute name="facebookURL" type="string" />
|
||||
<aura:attribute name="InstagramURL" type="string"/>
|
||||
<aura:attribute name="twitterURL" type="string"/>
|
||||
<aura:attribute name="LinkedinURL" type="string"/>
|
||||
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
|
||||
|
||||
<div class="slds-grid slds-grid_vertical-align-center slds-grid_vertical" >
|
||||
<div class="slds-col">
|
||||
<span>
|
||||
<div class="slds-col">
|
||||
<a href="{!v.facebookURL}" class = "IconClass" target="_blank"><img src="{!$Resource.FaceBook_icon}" /></a>
|
||||
<a href="{!v.InstagramURL}" class = "IconClass" target="_blank"><img src="{!$Resource.Insta_icon}" /></a>
|
||||
<a href="{!v.twitterURL}" class = "IconClass" target="_blank"><img src="{!$Resource.Twitter_icon}" /></a>
|
||||
<a href="{!v.LinkedinURL}" class = "IconClass" target="_blank"><img src="{!$Resource.LinkedIn_icon}" /></a>
|
||||
</div>
|
||||
|
||||
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="slds-grid slds-grid_vertical-align-center slds-grid_vertical" >
|
||||
<div class="slds-col">
|
||||
<span>
|
||||
<p style="width: 224px;" >
|
||||
<span >Built with</span>
|
||||
<img style="max-width: 10px;margin-left: 3px" draggable="false" class="emoji" alt="❤" src="{!$Resource.Heart}"/>
|
||||
<a href="https://hicglobalsolutions.com" target="_blank"> by HIC Global Solutions </a>
|
||||
</p>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!--div class="footer">
|
||||
|
||||
<center>
|
||||
<div class="socialMediaHandler" style="margin-top:4%;width: 11em;">
|
||||
|
||||
|
||||
<a href="{!v.facebookURL}" class = "IconClass" target="_blank"><img src="{!$Resource.FaceBook_icon}" /></a>
|
||||
<a href="{!v.InstagramURL}" class = "IconClass" target="_blank"><img src="{!$Resource.Insta_icon}" /></a>
|
||||
<a href="{!v.twitterURL}" class = "IconClass" target="_blank"><img src="{!$Resource.Twitter_icon}" /></a>
|
||||
<a href="{!v.LinkedinURL}" class = "IconClass" target="_blank"><img src="{!$Resource.LinkedIn_icon}" /></a><br/>
|
||||
|
||||
</div>
|
||||
|
||||
</center>
|
||||
|
||||
|
||||
|
||||
<div class="builtWithLove" >
|
||||
<p >
|
||||
<span >Built with</span>
|
||||
<img style="max-width: 10px;margin-left: 3px;" draggable="false" class="emoji" alt="❤" src="{!$Resource.Heart}"/>
|
||||
<a style="vertical-align: top;" href="https://hicglobalsolutions.com" target="_blank"> by HIC Global Solutions </a>
|
||||
</p>
|
||||
</div>
|
||||
</div-->
|
||||
|
||||
|
||||
|
||||
</aura:component>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||
<apiVersion>47.0</apiVersion>
|
||||
<description>A Lightning Component Bundle</description>
|
||||
</AuraDefinitionBundle>
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
.THIS .IconClass {
|
||||
background: #27ae60;
|
||||
height: 31px;
|
||||
width: 31px;
|
||||
text-align: center;
|
||||
float: left;
|
||||
border-radius: 40px;
|
||||
margin-right: 4px;
|
||||
}
|
||||
.THIS .IconClass:hover{
|
||||
|
||||
background: #f5b44b;
|
||||
|
||||
}
|
||||
.THIS .footer {
|
||||
font-size: 198%;
|
||||
margin-top: 15% ;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
||||
.THIS .footer .socialMediaHandler a img {
|
||||
|
||||
max-width: 100%;
|
||||
|
||||
height: auto;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.THIS .builtWithLove {
|
||||
|
||||
margin-top:1% !Important;
|
||||
font-size: larger;
|
||||
text-align: center;
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
<design:component >
|
||||
|
||||
</design:component>
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<svg width="120px" height="120px" viewBox="0 0 120 120" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<path d="M120,108 C120,114.6 114.6,120 108,120 L12,120 C5.4,120 0,114.6 0,108 L0,12 C0,5.4 5.4,0 12,0 L108,0 C114.6,0 120,5.4 120,12 L120,108 L120,108 Z" id="Shape" fill="#2A739E" />
|
||||
<path d="M77.7383308,20 L61.1640113,20 L44.7300055,63.2000173 L56.0543288,63.2000173 L40,99.623291 L72.7458388,54.5871812 L60.907727,54.5871812 L77.7383308,20 Z" id="Path-1" fill="#FFFFFF" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 664 B |
|
|
@ -0,0 +1,35 @@
|
|||
({
|
||||
doInit : function(component, event, helper) {
|
||||
console.log("footer doinit called");
|
||||
var getDocumentUrl = component.get('c.getWriteReviewURL');
|
||||
getDocumentUrl.setCallback(this,function(res){
|
||||
var state = res.getState();
|
||||
var returnvalue = [];
|
||||
returnvalue = JSON.parse(res.getReturnValue());
|
||||
console.log('returnvalue'+JSON.stringify(JSON.parse(res.getReturnValue())));
|
||||
if(state == 'SUCCESS'&& returnvalue != null ){
|
||||
/*component.set("v.WriteReviewURL",Mapofreturnvalue.get('AppWriteReviewURL'));
|
||||
component.set("v.facebookURL",Mapofreturnvalue.get('Facebook'));
|
||||
component.set("v.InstagramURL",Mapofreturnvalue.get('Twitter'));
|
||||
component.set("v.twitterURL",Mapofreturnvalue.get('Instagram'));
|
||||
component.set("v.LinkedinURL",Mapofreturnvalue.get('Linkedin'));*/
|
||||
|
||||
for(var item in returnvalue){
|
||||
var name = returnvalue[item]['name'];
|
||||
var url = returnvalue[item]['Url'];
|
||||
|
||||
if(name == 'Facebook'){
|
||||
component.set("v.facebookURL",url);
|
||||
}else if(name == 'Instagram'){
|
||||
component.set("v.InstagramURL",url);
|
||||
}else if(name == 'Twitter'){
|
||||
component.set("v.twitterURL",url);
|
||||
}else if(name == 'Linkedin'){
|
||||
component.set("v.LinkedinURL",url);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(getDocumentUrl);
|
||||
}
|
||||
})
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
({
|
||||
helperMethod : function() {
|
||||
|
||||
}
|
||||
})
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
({
|
||||
|
||||
// Your renderer method overrides go here
|
||||
|
||||
})
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
<aura:event type="COMPONENT" description="Event template" >
|
||||
<aura:attribute name="hasError" type="boolean" />
|
||||
</aura:event>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||
<apiVersion>47.0</apiVersion>
|
||||
<description>A Lightning Component Bundle</description>
|
||||
</AuraDefinitionBundle>
|
||||
|
|
@ -0,0 +1,365 @@
|
|||
<aura:component controller="AddDeleteController" >
|
||||
|
||||
|
||||
<aura:attribute name="OpenModel" type="boolean" default="false"/>
|
||||
<aura:registerEvent name="ParentCmpRefresh" type="c.ParentCmpRefresh" />
|
||||
<aura:attribute name="siteObj" type="Object" default="{'siteUrl':'',
|
||||
'siteguestid':
|
||||
}"/>
|
||||
<aura:attribute name="Refreshtoken" type="String" default=""/>
|
||||
<aura:attribute name="ConfigsavedsiteUrl" type="String" default=""/>
|
||||
<aura:attribute name="SiteNotifcation" type="String" default="Please Setup Site"/>
|
||||
<aura:attribute name="SiteModalIsOpen" type="boolean" default="false"/>
|
||||
<aura:attribute name="DisplayPopupButton" type="boolean" default="ture"/>
|
||||
<aura:attribute name="Spinner" type="boolean" default="false"/>
|
||||
<aura:attribute name="hasError" type="boolean" default="true"/>
|
||||
<aura:handler name="init" value="this" action="{!c.doInit}" />
|
||||
<aura:attribute name="URLsavedsuccess" type="boolean" default="false"/>
|
||||
<aura:attribute name="siteurlparent" type="String" default="blank"/>
|
||||
<aura:attribute name="isOpen" type="boolean" default="false"/>
|
||||
<aura:attribute name="siteURLList" type="list" />
|
||||
<aura:attribute name="selectedsite" type="String" />
|
||||
<aura:attribute name="errormessage" type="String" />
|
||||
<aura:attribute name="copyurlvalue" type="String" default="copy URL"/>
|
||||
<aura:attribute name="CreateRemotesiteSettingUrl" type="String" default="not"/>
|
||||
<aura:attribute name="Remotesiteexist" type="boolean" default="false"/>
|
||||
<aura:attribute name="RemotesiteURL" type="String" default="/0rp/e"/>
|
||||
<aura:attribute name="AuthenticateButton" type="boolean" default="false"/>
|
||||
<aura:attribute name ="CheckCertificate" type= "boolean" default="false"/>
|
||||
<aura:attribute name ="CheckSiteAccess" type= "boolean" default="true"/>
|
||||
<aura:attribute name ="CheckSiteExist" type= "boolean" default="false"/>
|
||||
<aura:attribute name ="Toolingremotesite" type= "boolean" default="false"/>
|
||||
<aura:attribute name="AUthenticationLink" type="String" default="/apex/hic_shopifysync__SalesforceAuthentication?viewmode="/>
|
||||
<aura:attribute name="CertificateCreateLink" type="String" default="/0P1/e"/>
|
||||
<aura:attribute name="viewmode" type="String" default=""/>
|
||||
<aura:registerEvent name="AuthenticateErorrEvent" type="c:AuthenticateErorrEvent"/>
|
||||
|
||||
<center>
|
||||
|
||||
<!--div style = "width: 23em;">
|
||||
<ui:message title="Information" severity="info" closable="false" >
|
||||
<h1 style= "float:left"><b>"Please authenticate your org <a href="/apex/hic_shopifysync__SalesforceAuthentication" target="_top" >click here</a> "</b></h1> <br></br>
|
||||
|
||||
</ui:message>
|
||||
</div-->
|
||||
<div style="font-size: x-large;">
|
||||
<img src="{!$Resource.AuthenticateConnecting}" style="width: 20%;margin-top: 2%;" height="50"/>
|
||||
<aura:if isTrue="{!and(v.CheckCertificate,and(and(v.URLsavedsuccess,and(v.CheckSiteExist,and(v.Remotesiteexist,and(or(v.Refreshtoken == undefined,v.Refreshtoken == null),v.CheckSiteAccess))))))}">
|
||||
<div>
|
||||
<p style="margin-top: 1%;margin-bottom: 2%;">
|
||||
|
||||
<b>Let's get started! please click below to initiate the process.</b><br/>
|
||||
</p>
|
||||
|
||||
<lightning:button class ="InitializeButton" variant="destructive" onclick="{!c.InitializingButtonfunction}" label="Please Authenticate" title="Brand action" ><b>Initialize</b></lightning:button>
|
||||
|
||||
</div>
|
||||
<aura:set attribute="else">
|
||||
|
||||
<fieldset id="Attentionfieldset" style="pointer-events: all;" class="slds-box slds-theme--default slds-container--small" >
|
||||
<div style="float:right">
|
||||
<img id = "mainSpinner" src="{!$Resource.DataProcessing}" style="width: 35px;display:none" height="50"/>
|
||||
<lightning:button iconName="utility:sync" class="Syncbuttonstyle" iconPosition="left" variant="destructive" label="Check Status"
|
||||
title="Check Status"
|
||||
onclick="{!c.doInit}"/>
|
||||
</div>
|
||||
|
||||
<legend class="slds-text-heading--small slds-p-vertical--medium RealtimeSyncStyle" style="margin-right: 68% !important;font-size: large;" ><lightning:icon iconName="utility:lock" />
|
||||
Attention required
|
||||
</legend>
|
||||
<table style="width: 39em;">
|
||||
<aura:renderIf isTrue="{!v.isOpen}">
|
||||
<tr style="font-size: large;">
|
||||
<td>
|
||||
<div class="slds-form-element">
|
||||
<div class="slds-form-element__control">
|
||||
<div style=" display: block;
|
||||
margin: 10px 0px;
|
||||
padding:12px;
|
||||
color: #D8000C;
|
||||
background-color: #FFD2D2;
|
||||
width: 28%;"
|
||||
>
|
||||
|
||||
<h1 > {!v.errormessage} </h1>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</aura:renderIf>
|
||||
<tr >
|
||||
|
||||
|
||||
<td>
|
||||
<div class="slds-form-element">
|
||||
<div class="slds-form-element__control">
|
||||
|
||||
<aura:renderif isTrue="{!!v.CheckSiteExist}">
|
||||
<div class="slds-checkbox">
|
||||
<abbr class="slds-required" title="required">*</abbr>
|
||||
<input type="checkbox" name="options" id="checkbox-unique-id-72" value="{!v.CheckSiteExist}" disabled="true" checked="{!v.CheckSiteExist}" />
|
||||
<label class="slds-checkbox__label" for="checkbox-unique-id-72">
|
||||
<span class="slds-checkbox_faux"></span>
|
||||
<span class="slds-form-element__label" style="font-size: large; color:#166efb;">There is no activate site in your org. Please <a href="" style="color:red;" onclick="{!c.Toolingremotesite}" >click here</a> to create new or activate site.</span>
|
||||
|
||||
</label>
|
||||
<span>
|
||||
<lightning:buttonIcon iconName="utility:info" variant="bare" onclick="{!c.siteactiveinfo}"/>
|
||||
</span>
|
||||
</div>
|
||||
<aura:set attribute="else">
|
||||
<div class="slds-checkbox" id="configsite" style = "{!if(!v.URLsavedsuccess,'','opacity: 0.6;')}">
|
||||
<abbr class="slds-required" title="required">*</abbr>
|
||||
<input type="checkbox" name="options" id="checkbox-unique-id-55" value="{!v.URLsavedsuccess}" disabled="true" checked="{!v.URLsavedsuccess}" />
|
||||
<label class="slds-checkbox__label" for="checkbox-unique-id-72">
|
||||
<span class="slds-checkbox_faux"></span>
|
||||
<span class="slds-form-element__label" style="font-size: large; color:#166efb;">Please <a href="" style="color:red;" onclick="{!if(!v.URLsavedsuccess,c.OpenSiteModal,'')}" > click here</a> for configure site.</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<!--aura:if isTrue="{!!v.siteURLList.length > 0}">
|
||||
There is no active site in your org. Please <a href="/0DM/o" >click here</a> to create new site.
|
||||
</aura:if-->
|
||||
</aura:set>
|
||||
|
||||
</aura:renderif>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<!--aura:if istrue="{!v.CheckSiteAccess}">
|
||||
<tr>
|
||||
<td>
|
||||
<div class="slds-form-element">
|
||||
<div class="slds-form-element__control">
|
||||
<div class="slds-checkbox" style="{!if(v.CheckSiteExist,'','opacity: 0.6;')}">
|
||||
<abbr class="slds-required" title="required">*</abbr>
|
||||
<input type="checkbox" name="options" id="checkbox-unique-id-72" value="{!and(v.CheckSiteAccess,v.CheckSiteExist)}" disabled="true" checked="{!and(v.CheckSiteAccess,v.CheckSiteExist)}" />
|
||||
<label class="slds-checkbox__label" for="checkbox-unique-id-72">
|
||||
<span class="slds-checkbox_faux"></span>
|
||||
<span class="slds-form-element__label" style="font-size: large; color:#166efb;" >Give access to all Package's class and page to site profile. Please <a href="" style="color:red;" onclick="{!if(v.CheckSiteExist,c.Toolingremotesite,'')}">click here</a> to give access.</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</aura:if-->
|
||||
<tr>
|
||||
<td>
|
||||
<div class="slds-form-element">
|
||||
<div class="slds-form-element__control">
|
||||
<div class="slds-checkbox" style="{!if(and(v.CheckSiteAccess,and(v.CheckSiteExist,and(!v.Remotesiteexist,v.URLsavedsuccess))),'','opacity: 0.6;')}">
|
||||
<abbr class="slds-required" title="required">*</abbr>
|
||||
<input type="checkbox" name="options" id="checkbox-unique-id-72" value="{!v.Remotesiteexist}" disabled="true" checked="{!v.Remotesiteexist}" />
|
||||
<label class="slds-checkbox__label" for="checkbox-unique-id-72">
|
||||
<span class="slds-checkbox_faux"></span>
|
||||
<span class="slds-form-element__label" style="font-size: large; color:#166efb;"> Create Remote site setting . Please <!--<a href="" onclick="{!if(and(!v.Remotesiteexist,v.URLsavedsuccess),c.CopyURl,'')}" style="color:red;"> {!v.copyurlvalue} </a> and --> <a onclick="{!if(and(v.CheckSiteAccess,and(v.CheckSiteExist,and(!v.Remotesiteexist,v.URLsavedsuccess))),c.ReDirectRemoteSiteSetting,'')}" target = "_blank" style="color:red;">click here</a> to create remote site setting.</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="slds-form-element">
|
||||
<div class="slds-form-element__control">
|
||||
<div class="slds-checkbox" style="{!if(and(v.CheckSiteAccess,and(v.CheckSiteExist,and(v.Remotesiteexist,and(!v.CheckCertificate,v.URLsavedsuccess)))),'','opacity: 0.6;')}">
|
||||
<abbr class="slds-required" title="required">*</abbr>
|
||||
<input type="checkbox" name="options" id="checkbox-unique-id-72" value="{!v.CheckCertificate}" disabled="true" checked="{!v.CheckCertificate}" />
|
||||
<label class="slds-checkbox__label" for="checkbox-unique-id-72">
|
||||
<span class="slds-checkbox_faux"></span>
|
||||
<span class="slds-form-element__label" style="font-size: large; color:#166efb;">There is no self-signed Certificate with name 'Shopify'. Please <a href="{!if(and(v.CheckSiteAccess,and(v.CheckSiteExist,and(v.Remotesiteexist,and(!v.CheckCertificate,v.URLsavedsuccess)))),v.CertificateCreateLink,'')}" target = "_blank" style="color:red;">click here</a> to create self-signed Certificate.</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</fieldset>
|
||||
|
||||
<!-- Lightning Indicator-->
|
||||
<span>
|
||||
<p style="margin-top:1%;font-size: small;"><sup><b style="color: red;">*</b></sup> Please click check status button after completion of any authentication requirement.</p>
|
||||
<br />
|
||||
</span>
|
||||
</aura:set>
|
||||
</aura:if>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<aura:renderIf isTrue="{!v.isOpen}">
|
||||
|
||||
<section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria-modal="true" aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open">
|
||||
<center>
|
||||
<div class="slds-modal__container">
|
||||
<div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1">
|
||||
<div >
|
||||
<center>
|
||||
<h2 id="modal-heading-01" class="slds-text-heading_medium slds-hyphenate">{!v.errormessage}</h2>
|
||||
</center>
|
||||
|
||||
<div id ="CancleGotosite" style="margin-top:20px">
|
||||
<lightning:button variant="neutral"
|
||||
label="Cancel"
|
||||
title="Cancel"
|
||||
onclick="{! c.SyncAuthenticatepage }"/>
|
||||
<span id="Checkstates" style="margin-left: 1em;">
|
||||
<lightning:button iconName="utility:sync" class="Syncbuttonstyle" iconPosition="left" variant="destructive" label="Check Status"
|
||||
title="Check Status"
|
||||
onclick="{!c.SyncAuthenticatepage}"/>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<br/><br/>
|
||||
</div>
|
||||
</center>
|
||||
</section>
|
||||
|
||||
<div class="slds-backdrop slds-backdrop_open"></div>
|
||||
|
||||
|
||||
</aura:renderIf>
|
||||
|
||||
<aura:if isTrue="{!v.SiteModalIsOpen}">
|
||||
|
||||
<!--###### MODAL BOX Start From Here ######-->
|
||||
<div role="dialog" tabindex="-1" aria-labelledby="header99" class="slds-modal slds-fade-in-open slds-modal_small">
|
||||
<div class="slds-modal__container">
|
||||
<!-- ###### MODAL BOX HEADER Part Start From Here ######-->
|
||||
<div class="slds-modal__header">
|
||||
<lightning:buttonIcon iconName="utility:close"
|
||||
onclick="{! c.CloseSiteModal }"
|
||||
alternativeText="close"
|
||||
variant="bare-inverse"
|
||||
class="slds-modal__close"/>
|
||||
<h2 id="header99" class="slds-text-heading--medium">Setup Site</h2>
|
||||
<br/>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<!--###### MODAL BOX BODY Part Start From Here ######-->
|
||||
<div class="slds-modal__content slds-p-around_medium">
|
||||
<!--showing 3 screens based on progress indicator steps-->
|
||||
<div style="margin-top:20px;">
|
||||
<span style="width: 57%;float: left;margin-left: 4%;">
|
||||
|
||||
<!--ui:inputSelect aura:id="beforeauthsite" required="true" class="slds-select" label=" * Select a Site URL" change="{!c.onsitechange}" value="{!v.selectedsite}">
|
||||
<ui:inputSelectOption text="" label="Select site"/>
|
||||
<aura:iteration items="{!v.siteURLList}" var="tableRow2" indexVar="index2" >
|
||||
<ui:inputSelectOption text="{!tableRow2.siteUrl}" label="{!tableRow2.siteUrl}"/>
|
||||
</aura:iteration>
|
||||
</ui:inputSelect-->
|
||||
|
||||
|
||||
<lightning:select aura:id="beforeauthsite" disabled="true" label="Select a Site URL" onchange="{!c.onsitechange}" value="{!v.selectedsite}" required="true">
|
||||
<option text="Select Site" value=""/>
|
||||
<aura:iteration items="{!v.siteURLList}" var="tableRow2" >
|
||||
<option text="{!tableRow2.siteUrl}" value="{!tableRow2.siteUrl}" />
|
||||
</aura:iteration>
|
||||
</lightning:select>
|
||||
|
||||
</span>
|
||||
<span>
|
||||
<span aura:id = "DataProceesing">
|
||||
<img src="{!$Resource.DataProcessing}" style="width: 5%;" height="50"/>
|
||||
</span>
|
||||
</span>
|
||||
<span >
|
||||
|
||||
<lightning:button aura:id = "sitesavebutton" iconName="utility:save" class="buttonstyle" iconPosition="left" variant="brand" label="Save"
|
||||
title="Save"
|
||||
disabled="false"
|
||||
onclick="{! c.savesite }" />
|
||||
|
||||
<lightning:button
|
||||
class="buttonstyle"
|
||||
iconName="utility:forward"
|
||||
iconPosition="left"
|
||||
label="Site page"
|
||||
title="Go to Site page"
|
||||
onclick="{! c.siteredirect }"/>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--###### MODAL BOX FOOTER Part Start From Here ######-->
|
||||
<div class="slds-modal__footer slds-modal__footer_directional">
|
||||
<span style="float:right;">
|
||||
<h1 style="color:red;">{!v.SiteNotifcation}</h1>
|
||||
</span>
|
||||
<span style="float:left;">
|
||||
<a href="https://youtu.be/0LihizAJGo8?si=CSvvhD7ssMmK0Ylq" target="_blank" style="color:blue;">How to setup Site ?</a>
|
||||
</span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="slds-backdrop slds-backdrop_open"></div>
|
||||
<!--###### MODAL BOX Part END Here ######-->
|
||||
</aura:if>
|
||||
<aura:if isTrue="{!v.OpenModel}">
|
||||
<div class="slds-m-around_xx-large">
|
||||
<!--Use aura:if tag to display/hide popup based on isModalOpen value-->
|
||||
|
||||
<section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria-modal="true" aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open">
|
||||
<div class="slds-modal__container">
|
||||
<header class="slds-modal__header">
|
||||
<lightning:buttonIcon iconName="utility:close"
|
||||
onclick="{! c.closeSiteactiveinfo }"
|
||||
alternativeText="close"
|
||||
variant="bare-inverse"
|
||||
class="slds-modal__close"/>
|
||||
<h2 id="modal-heading-01" class="slds-text-heading_medium slds-hyphenate"><b>How to activate site</b> <!--lightning:Icon iconName="utility:report_issue"
|
||||
alternativeText="Support"
|
||||
/--></h2>
|
||||
</header>
|
||||
<!--Modal/Popup Box Body Starts here-->
|
||||
<div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1">
|
||||
<p>
|
||||
<!-- CREATE NEW EXPENSE -->
|
||||
<div aria-labelledby="newexpenseform">
|
||||
|
||||
|
||||
<form class="slds-form--stacked">
|
||||
<img src="{!$Resource.HowtoactivatesitInfo}" class="hover-shadow" style="width: 100%;margin: 1%;" height="50%"/>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<!-- / CREATE NEW EXPENSE -->
|
||||
</p>
|
||||
</div>
|
||||
<footer class="slds-modal__footer" style="padding:0;">
|
||||
<center>
|
||||
<span>
|
||||
<a href="https://youtu.be/0LihizAJGo8?si=CSvvhD7ssMmK0Ylq" target="_blank" style="color:blue;">How to setup Site ?</a>
|
||||
</span>
|
||||
<lightning:button
|
||||
class="buttonstyle"
|
||||
iconName="utility:forward"
|
||||
iconPosition="left"
|
||||
label="Go to Site page"
|
||||
title="Go to Site page"
|
||||
onclick="{! c.siteactiveinfoPageRedirect }"/>
|
||||
</center>
|
||||
|
||||
</footer>
|
||||
</div>
|
||||
</section>
|
||||
<div class="slds-backdrop slds-backdrop_open"></div>
|
||||
</div>
|
||||
</aura:if>
|
||||
</center>
|
||||
</aura:component>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||
<apiVersion>47.0</apiVersion>
|
||||
<description>A Lightning Component Bundle</description>
|
||||
</AuraDefinitionBundle>
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
.THIS .Hidediv{
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.THIS .floatleft slds-scope slds-form-element__labe{
|
||||
float:left !important;
|
||||
}
|
||||
.THIS .InitializeButton{
|
||||
font-size: 60%;
|
||||
}
|
||||
|
||||
.THIS .buttonstyle{
|
||||
margin: 3%;
|
||||
margin-right: 0px;
|
||||
}
|
||||
|
||||
.THIS .Syncbuttonstyle{
|
||||
width: 11em;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.THIS .marginleftzero{
|
||||
margin-right: 0px;
|
||||
}
|
||||
|
|
@ -0,0 +1,192 @@
|
|||
({
|
||||
siteactiveinfoPageRedirect : function(component, event, helper){
|
||||
window.open('/0DM/o','_blank');
|
||||
},
|
||||
siteactiveinfo : function(component, event, helper){
|
||||
component.set("v.OpenModel",true);
|
||||
},
|
||||
|
||||
closeSiteactiveinfo : function(component, event, helper){
|
||||
component.set("v.OpenModel",false);
|
||||
},
|
||||
|
||||
ReDirectRemoteSiteSetting : function(component, event, helper){
|
||||
var RemotesiteUrl = component.get("v.CreateRemotesiteSettingUrl");
|
||||
if(RemotesiteUrl != null && RemotesiteUrl != '' && RemotesiteUrl !== undefined){
|
||||
window.open('/0rp/e?SiteName=HIC_Shopifymadeeasy_Site_URl&EndpointUrl='+RemotesiteUrl,'_blank');
|
||||
|
||||
}else{
|
||||
window.open('/0rp/e?SiteName=HIC_Shopifymadeeasy_Site_URl','_blank');
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
OpenSiteModal : function(component, event, helper){
|
||||
component.set("v.SiteModalIsOpen",true);
|
||||
component.find("sitesavebutton").set("v.disabled",false);
|
||||
component.find("beforeauthsite").set("v.disabled",false);
|
||||
component.set("v.SiteNotifcation","Please Setup Site");
|
||||
$A.util.addClass(component.find('DataProceesing'), 'Hidediv');
|
||||
$A.util.addClass(component.find('beforeauthsite'), 'floatleft');
|
||||
|
||||
|
||||
//$A.util.removeClass(component.find('DataProceesing'), 'Hidediv');
|
||||
// document.getElementById("DataProceesingid").style.display = "none";
|
||||
if(component.get("v.URLsavedsuccess") == true){
|
||||
component.find("sitesavebutton").set("v.iconName" , 'utility:check');
|
||||
component.find("sitesavebutton").set("v.label" , 'Saved');
|
||||
component.set("v.selectedsite",component.get("v.ConfigsavedsiteUrl"));
|
||||
component.set("v.SiteNotifcation","You can change site");
|
||||
}else{
|
||||
component.set("v.selectedsite","");
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
CloseSiteModal : function(component, event, helper){
|
||||
component.set("v.SiteModalIsOpen",false);
|
||||
},
|
||||
|
||||
|
||||
SyncAuthenticatepage: function(component, event, helper){
|
||||
component.set("v.Spinner", true);
|
||||
// $A.util.removeClass(component.find('DataProceesingMainPage'), 'Hidediv');
|
||||
// $A.util.addClass(component.find('DataProceesingMainPage'), 'Hidediv');
|
||||
/* if(component.get("v.CheckCertificate") && component.get("v.URLsavedsuccess") && component.get("v.CheckSiteExist") && component.get("v.Remotesiteexist") && component.get("v.Refreshtoken") != '' && component.get("v.Refreshtoken") !== undefined && component.get("v.Refreshtoken") != null){
|
||||
console.log('ParentCmpRefresh called');
|
||||
var ParentCmpRefresh = component.getEvent("ParentCmpRefresh");
|
||||
ParentCmpRefresh.fire();
|
||||
}else{
|
||||
var action = component.get("c.doInit");
|
||||
component.set("v.Spinner", false);
|
||||
//component.set("v.isOpen", false);
|
||||
$A.enqueueAction(action);
|
||||
}*/
|
||||
|
||||
var action = component.get("c.doInit");
|
||||
component.set("v.Spinner", false);
|
||||
//component.set("v.isOpen", false);
|
||||
$A.enqueueAction(action);
|
||||
|
||||
|
||||
|
||||
//location.reload(true);
|
||||
},
|
||||
|
||||
savesite: function(component, event, helper) {
|
||||
// for Display Model,set the "isOpen" attribute to "True"
|
||||
$A.util.removeClass(component.find('DataProceesing'), 'Hidediv');
|
||||
var siteurl = component.find("beforeauthsite").get("v.value");
|
||||
if(siteurl == null || siteurl == ''){
|
||||
component.set("v.CheckSiteAccess",false);
|
||||
//component.set("v.DisableButton",false);
|
||||
component.find("beforeauthsite").showHelpMessageIfInvalid();
|
||||
component.set("v.SiteNotifcation","Please select site");
|
||||
$A.util.addClass(component.find('DataProceesing'), 'Hidediv');
|
||||
/* var action = component.get("c.openModel");
|
||||
component.set("v.Spinner", false);
|
||||
component.set("v.DisplayPopupButton",false);
|
||||
$A.enqueueAction(action);
|
||||
setTimeout(function(){
|
||||
event.getSource().set("v.iconName" , 'utility:download');
|
||||
event.getSource().set("v.label" , 'Save');
|
||||
component.set("v.isOpen", false);
|
||||
}, 3000);*/
|
||||
}else{
|
||||
component.find("sitesavebutton").set("v.disabled",true);
|
||||
component.find("beforeauthsite").set("v.disabled",true);
|
||||
helper.checksiteaccess(component, event,true);
|
||||
}
|
||||
},
|
||||
openModel: function(component, event, helper) {
|
||||
// for Display Model,set the "isOpen" attribute to "True"
|
||||
component.set("v.isOpen", true);
|
||||
|
||||
},
|
||||
siteredirect: function(component, event, helper){
|
||||
|
||||
var siteurl = component.get('v.selectedsite');
|
||||
if(siteurl == null || siteurl == '' || siteurl == undefined){
|
||||
window.open('/0DM/o','_blank');
|
||||
return;
|
||||
}
|
||||
var sitelist = component.get("v.siteURLList");
|
||||
var siteid = '';
|
||||
for(var item in sitelist ){
|
||||
|
||||
if(sitelist[item]['siteUrl'] == siteurl ){
|
||||
siteid = sitelist[item]['id'];
|
||||
|
||||
}
|
||||
}
|
||||
if(siteid != '' && siteid !== undefined && siteurl != '' && siteurl !== undefined ){
|
||||
window.open('/'+siteid,'_blank');
|
||||
}else{
|
||||
window.open('/0DM/o','_blank');
|
||||
}
|
||||
},
|
||||
closeModel: function(component, event, helper) {
|
||||
// for Hide/Close Model,set the "isOpen" attribute to "False"
|
||||
component.set("v.isOpen", false);
|
||||
},
|
||||
onsitechange: function(component, event, helper) {
|
||||
component.find("sitesavebutton").set("v.iconName" , 'utility:save');
|
||||
component.find("sitesavebutton").set("v.label" , 'Save');
|
||||
},
|
||||
|
||||
InitializingButtonfunction: function(component, event, helper) {
|
||||
component.set("v.Spinner",true);
|
||||
helper.InitializingHelper(component,event);
|
||||
|
||||
|
||||
},
|
||||
doInit: function(component, event, helper) {
|
||||
|
||||
component.set("v.isOpen", false);
|
||||
component.set("v.Spinner", true);
|
||||
|
||||
try{
|
||||
document.getElementById("mainSpinner").style.display = "inline-block";
|
||||
document.getElementById("Attentionfieldset").style.pointerEvents = "none";
|
||||
} catch(e){
|
||||
|
||||
}
|
||||
// $A.util.removeClass(component.find('DataProceesingMainPage'), 'Hidediv');
|
||||
component.set("v.CertificateCreateLink","/0P1/e?MasterLabel=Shopify&DeveloperName=Shopify");
|
||||
var action = component.get("c.getUIThemeDescription");
|
||||
action.setCallback(this,function(res){
|
||||
var state = res.getState();
|
||||
if(state =="SUCCESS" && res.getReturnValue() != null ){
|
||||
component.set("v.viewmode",res.getReturnValue());
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(action);
|
||||
var action1 = component.get("c.returnDomainUrl");
|
||||
action1.setCallback(this,function(res1){
|
||||
var state1 = res1.getState();
|
||||
if(state1 =="SUCCESS" && res1.getReturnValue() != null && res1.getReturnValue() != ''){
|
||||
component.set("v.CreateRemotesiteSettingUrl",res1.getReturnValue());
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(action1);
|
||||
helper.CheckingRemotesitesetting(component, event);
|
||||
// helper.AuthenticateRemoteSiteCreate(component, event, helper) ;
|
||||
helper.getSiteURLList( component, event,helper );
|
||||
helper.checkingCertificate(component, event);
|
||||
//helper.CheckSitefromConfiguration(component, event, helper);
|
||||
|
||||
},
|
||||
|
||||
Toolingremotesite:function(component, event, helper) {
|
||||
helper.Toolingremotesite(component, event, helper);
|
||||
},
|
||||
|
||||
CopyURl :function(component, event, helper){
|
||||
var text = component.get("v.CreateRemotesiteSettingUrl");
|
||||
helper.copyTextHelper(component, event, text);
|
||||
},
|
||||
|
||||
RedirecttoRemotesitepage :function(component, event, helper){
|
||||
helper.RedirecttoRemotesitepage(component, event, text);
|
||||
}
|
||||
})
|
||||
|
|
@ -0,0 +1,493 @@
|
|||
({
|
||||
InitializingHelper: function(component,event){
|
||||
|
||||
var accessexist = false;
|
||||
|
||||
var siteurl1 = component.get("v.selectedsite");
|
||||
var sitelist = component.get("v.siteURLList");
|
||||
|
||||
|
||||
|
||||
var CheckSiteAccessaction = component.get("c.CheckSitefromConfiguration");
|
||||
CheckSiteAccessaction.setCallback(this,function(res){
|
||||
var state = res.getState();
|
||||
|
||||
if(state =="SUCCESS" && res.getReturnValue() != null && res.getReturnValue() != '' && res.getReturnValue() != 'false'){
|
||||
component.set("v.selectedsite",res.getReturnValue());
|
||||
component.set("v.URLsavedsuccess",true);
|
||||
|
||||
|
||||
var CheckSiteClassandPageAccess = component.get("c.CheckSiteClassandPageAccess");
|
||||
var guestuserid;
|
||||
|
||||
for(var item in sitelist ){
|
||||
|
||||
if(sitelist[item]['siteUrl'] == siteurl1 ){
|
||||
guestuserid = sitelist[item]['siteguestid'];
|
||||
}
|
||||
}
|
||||
CheckSiteClassandPageAccess.setParams({
|
||||
'Guestuserid':guestuserid
|
||||
});
|
||||
CheckSiteClassandPageAccess.setCallback(this,function(res1){
|
||||
var state2 = res1.getState();
|
||||
|
||||
if( state2 =="SUCCESS" && res1.getReturnValue() != null && (res1.getReturnValue() == true || res1.getReturnValue() == 'true')){
|
||||
component.set("v.CheckSiteAccess",true);
|
||||
component.set("v.CheckSiteExist" ,true);
|
||||
try{
|
||||
var CheckingRemoteSiteaction = component.get("c.CheckshopifycertificateandRemotesite");
|
||||
CheckingRemoteSiteaction.setParams({
|
||||
'Urltype':'remotesite'
|
||||
});
|
||||
CheckingRemoteSiteaction.setCallback(this,function(res3){
|
||||
var state3 = res3.getState();
|
||||
|
||||
|
||||
if(state3 =="SUCCESS" && (res3.getReturnValue() == true || res3.getReturnValue() == 'true' )){
|
||||
component.set("v.Remotesiteexist",true);
|
||||
|
||||
try{
|
||||
var CheckingCertifiacteactionagain = component.get("c.CheckshopifycertificateandRemotesite");
|
||||
CheckingCertifiacteactionagain.setParams({
|
||||
'Urltype':'certificate'
|
||||
});
|
||||
CheckingCertifiacteactionagain.setCallback(this,function(res4){
|
||||
var state4 = res4.getState();
|
||||
|
||||
if(state4 =="SUCCESS" && (res4.getReturnValue() == true || res4.getReturnValue() == 'true' )){
|
||||
component.set("v.CheckCertificate",true);
|
||||
this.AuthenticationSuccess(component,event);
|
||||
}
|
||||
|
||||
if(state4 =="SUCCESS" && (res4.getReturnValue() == false || res4.getReturnValue() == 'false' )){
|
||||
component.set("v.CheckCertificate",false);
|
||||
this.AuthenticationRequiredError(component,event);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$A.enqueueAction(CheckingCertifiacteactionagain);
|
||||
|
||||
}catch(e){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if(state3 =="SUCCESS" && (res3.getReturnValue() == false || res3.getReturnValue() == 'false' )){
|
||||
component.set("v.CheckCertificate",false);
|
||||
component.set("v.Remotesiteexist",false);
|
||||
this.AuthenticationRequiredError(component,event);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$A.enqueueAction(CheckingRemoteSiteaction);
|
||||
return false;
|
||||
}catch(e){
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
component.set("v.CheckCertificate",false)
|
||||
component.set("v.URLsavedsuccess",false);
|
||||
component.set("v.CheckSiteAccess",false);
|
||||
var actionDeletesitefromconfig = component.get("c.Deletesitefromconfig");
|
||||
actionDeletesitefromconfig.setCallback(this,function(resDeletesitefromconfig){
|
||||
var stateDeletesitefromconfig = resDeletesitefromconfig.getState();
|
||||
if(stateDeletesitefromconfig =="SUCCESS" && resDeletesitefromconfig.getReturnValue() != null && resDeletesitefromconfig.getReturnValue() == true){
|
||||
this.AuthenticationRequiredError(component,event);
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(actionDeletesitefromconfig);
|
||||
}
|
||||
|
||||
return accessexist;
|
||||
});
|
||||
$A.enqueueAction(CheckSiteClassandPageAccess);
|
||||
|
||||
}else{
|
||||
|
||||
this.AuthenticationRequiredError(component,event);
|
||||
component.set("v.CheckCertificate",false);
|
||||
component.set("v.URLsavedsuccess",false);
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(CheckSiteAccessaction);
|
||||
|
||||
|
||||
},
|
||||
|
||||
AuthenticationSuccess: function(component,event){
|
||||
//component.set("v.Spinner",false);
|
||||
var Authenticateaction = component.get("c.CreateAuthenticateURL");
|
||||
Authenticateaction.setCallback(this,function(res){
|
||||
var state = res.getState();
|
||||
if(state =="SUCCESS" ){
|
||||
component.set("v.AuthenticateButton",true);
|
||||
var authenticateurl = component.get('v.AUthenticationLink')+component.get('v.viewmode');
|
||||
window.open(authenticateurl,'_top');
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(Authenticateaction );
|
||||
},
|
||||
|
||||
AuthenticationRequiredError: function(component,event){
|
||||
component.set("v.Spinner",false);
|
||||
//component.set("v.CheckSiteAccess",false);
|
||||
//component.set("v.DisableButton",false);
|
||||
component.set("v.errormessage","Authenticate required error");
|
||||
var action = component.get("c.openModel");
|
||||
component.set("v.Spinner", false);
|
||||
$A.enqueueAction(action);
|
||||
},
|
||||
|
||||
|
||||
checksiteaccess: function(component,event,saved){
|
||||
var savedthis = saved;
|
||||
var accessexist = false;
|
||||
var CheckSiteAccessaction = component.get("c.CheckSiteClassandPageAccess");
|
||||
// var siteurl1 = component.find("beforeauthsite").get("v.value");
|
||||
var siteurl1 = component.get("v.selectedsite");
|
||||
if(siteurl1 == undefined || siteurl1 == null || siteurl1 == ''){
|
||||
try{
|
||||
siteurl1 = component.find("beforeauthsite").get("v.value");
|
||||
}catch(e){
|
||||
|
||||
}
|
||||
}
|
||||
var sitelist = component.get("v.siteURLList");
|
||||
var guestuserid;
|
||||
var SiteName;
|
||||
for(var item in sitelist ){
|
||||
|
||||
if(sitelist[item]['siteUrl'] == siteurl1 ){
|
||||
guestuserid = sitelist[item]['siteguestid'];
|
||||
SiteName = sitelist[item]['Name'];
|
||||
}
|
||||
}
|
||||
CheckSiteAccessaction.setParams({
|
||||
'Guestuserid':guestuserid
|
||||
});
|
||||
CheckSiteAccessaction.setCallback(this,function(res){
|
||||
var state = res.getState();
|
||||
if( state =="SUCCESS" && res.getReturnValue() != null && (res.getReturnValue() == true || res.getReturnValue() == 'true')){
|
||||
//this.goNext(component, event);
|
||||
component.set("v.Spinner", false);
|
||||
try{
|
||||
document.getElementById("mainSpinner").style.display = "none";
|
||||
document.getElementById("Attentionfieldset").style.pointerEvents = "all";
|
||||
}catch(e){
|
||||
|
||||
}
|
||||
if(savedthis == false) return;
|
||||
|
||||
var actionsaveconfig = component.get("c.savesiteurlconfig");
|
||||
actionsaveconfig.setParams({
|
||||
"siteurl": siteurl1
|
||||
});
|
||||
actionsaveconfig.setCallback(this,function(res1){
|
||||
var state1 = res1.getState();
|
||||
if(state1 =="SUCCESS" && res1.getReturnValue() != null ){
|
||||
if(res1.getReturnValue() == false || res1.getReturnValue() == 'false'){
|
||||
component.set("v.CheckSiteAccess",false);
|
||||
component.find("beforeauthsite").set("v.disabled",false);
|
||||
component.set("v.errormessage","get error while saving site");
|
||||
var action = component.get("c.openModel");
|
||||
try{
|
||||
document.getElementById("mainSpinner").style.display = "none";
|
||||
|
||||
}catch(e){
|
||||
|
||||
}
|
||||
try{
|
||||
document.getElementById("Attentionfieldset").style.pointerEvents = "all";
|
||||
}catch(e){
|
||||
|
||||
}
|
||||
component.set("v.Spinner", false);
|
||||
$A.enqueueAction(action);
|
||||
setTimeout(function(){
|
||||
event.getSource().set("v.iconName" , 'utility:save');
|
||||
event.getSource().set("v.label" , 'Save');
|
||||
component.set("v.isOpen", false);
|
||||
}, 1000);
|
||||
component.find("beforeauthsite").set("v.disabled",false);
|
||||
$A.util.addClass(component.find('DataProceesing'), 'Hidediv');
|
||||
|
||||
}else if(res1.getReturnValue() == true || res1.getReturnValue() == 'true'){
|
||||
accessexist = res1.getReturnValue();
|
||||
//component.set("v.CheckSiteAccess",false);
|
||||
component.find("beforeauthsite").set("v.disabled",true);
|
||||
component.set("v.SiteNotifcation","The site has been saved successfully.");
|
||||
$A.util.addClass(component.find('DataProceesing'), 'Hidediv');
|
||||
if(siteurl1 != null && siteurl1 != '' && siteurl1 != undefined){
|
||||
component.set("v.ConfigsavedsiteUrl",siteurl1);
|
||||
}
|
||||
// document.getElementById("Checkstates").style.display = "none";
|
||||
// document.getElementById("CancleGotosite").style.display = "none";
|
||||
try{
|
||||
document.getElementById("mainSpinner").style.display = "none";
|
||||
|
||||
}catch(e){
|
||||
|
||||
}
|
||||
try{
|
||||
document.getElementById("Attentionfieldset").style.pointerEvents = "all";
|
||||
}catch(e){
|
||||
|
||||
}
|
||||
component.set("v.Spinner", false);
|
||||
component.set("v.CheckSiteAccess",true);
|
||||
component.set("v.CheckSiteExist",true);
|
||||
component.set("v.URLsavedsuccess",true);
|
||||
component.set("v.CheckSiteExist",true);
|
||||
event.getSource().set("v.iconName" , 'utility:check');
|
||||
event.getSource().set("v.label" , 'Saved');
|
||||
|
||||
setTimeout(function(){
|
||||
//event.getSource().set("v.iconName" , 'utility:download');
|
||||
//event.getSource().set("v.label" , 'Save');
|
||||
component.set("v.SiteModalIsOpen", false);
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(actionsaveconfig);
|
||||
|
||||
}else{
|
||||
|
||||
if(component.get("v.SiteModalIsOpen") == true || component.get("v.SiteModalIsOpen") == 'true'){
|
||||
component.find("beforeauthsite").set("v.disabled",false);
|
||||
component.find("sitesavebutton").set("v.disabled",false);
|
||||
}
|
||||
|
||||
component.set("v.URLsavedsuccess",false);
|
||||
component.set("v.CheckSiteAccess",false);
|
||||
//component.set("v.DisableButton",false);
|
||||
component.set("v.SiteNotifcation",SiteName + "\'s site have no access or this is not active. Please active site or give site access");
|
||||
/*try{
|
||||
document.getElementById("mainSpinner").style.display = "none";
|
||||
}catch(e){
|
||||
|
||||
}*/
|
||||
component.set("v.Spinner", false);
|
||||
$A.util.addClass(component.find('DataProceesing'), 'Hidediv');
|
||||
try{
|
||||
document.getElementById("mainSpinner").style.display = "none";
|
||||
|
||||
}catch(e){
|
||||
|
||||
}
|
||||
try{
|
||||
document.getElementById("Attentionfieldset").style.pointerEvents = "all";
|
||||
}catch(e){
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return accessexist;
|
||||
});
|
||||
$A.enqueueAction(CheckSiteAccessaction);
|
||||
//return accessexist;
|
||||
},
|
||||
|
||||
copyTextHelper : function(component,event,text) {
|
||||
// Create an hidden input
|
||||
var hiddenInput = document.createElement("input");
|
||||
// passed text into the input
|
||||
hiddenInput.setAttribute("value", text);
|
||||
// Append the hiddenInput input to the body
|
||||
document.body.appendChild(hiddenInput);
|
||||
// select the content
|
||||
hiddenInput.select();
|
||||
// Execute the copy command
|
||||
document.execCommand("copy");
|
||||
// Remove the input from the body after copy text
|
||||
document.body.removeChild(hiddenInput);
|
||||
// store target button label value
|
||||
var orignalLabel = component.get("v.copyurlvalue")
|
||||
component.set("v.copyurlvalue",'copied');
|
||||
// set timeout to reset icon and label value after 700 milliseconds
|
||||
/*setTimeout(function(){
|
||||
component.set("v.copyurlvalue", orignalLabel);
|
||||
}, 700);*/
|
||||
|
||||
},
|
||||
CheckSitefromConfiguration: function(component, event, helper,listofsiteexits) {
|
||||
component.set("v.Spinner",true);
|
||||
var CheckSiteAccessaction = component.get("c.CheckSitefromConfiguration");
|
||||
CheckSiteAccessaction.setCallback(this,function(res){
|
||||
var state = res.getState();
|
||||
if(listofsiteexits == true && state =="SUCCESS" && res.getReturnValue() != null && res.getReturnValue() != '' && res.getReturnValue() != 'false'){
|
||||
component.set("v.selectedsite",res.getReturnValue());
|
||||
component.set("v.ConfigsavedsiteUrl",res.getReturnValue());
|
||||
try{
|
||||
document.getElementById("configsite").style.opacity = '0.6';
|
||||
}catch(e){
|
||||
|
||||
}
|
||||
|
||||
component.set("v.URLsavedsuccess",true);
|
||||
//change the field
|
||||
//component.find("sitesavebutton").set("v.iconName" , 'utility:check');
|
||||
//component.find("sitesavebutton").set("v.label" , 'Saved');
|
||||
|
||||
this.checksiteaccess(component, event,false);
|
||||
//component.set("v.Spinner",false);
|
||||
}else if( state =="SUCCESS" && res.getReturnValue() != null && res.getReturnValue() != '' && (res.getReturnValue() == 'false'|| listofsiteexits == false)){
|
||||
//component.set("v.selectedsite","");
|
||||
|
||||
component.set("v.URLsavedsuccess",false);
|
||||
|
||||
|
||||
try{
|
||||
document.getElementById("configsite").style.opacity = 'unset';
|
||||
|
||||
}catch(e){
|
||||
|
||||
}
|
||||
|
||||
try{
|
||||
document.getElementById("mainSpinner").style.display = "none";
|
||||
|
||||
|
||||
}catch(e){
|
||||
|
||||
}
|
||||
|
||||
try{
|
||||
document.getElementById("Attentionfieldset").style.pointerEvents = "all";
|
||||
}catch(e){
|
||||
|
||||
}
|
||||
component.set("v.Spinner",false);
|
||||
}
|
||||
|
||||
});
|
||||
$A.enqueueAction(CheckSiteAccessaction);
|
||||
},
|
||||
|
||||
|
||||
Toolingremotesite : function(component, event, helper) {
|
||||
var CreateToolingRemotesite = component.get("c.createToolingRemoteSiteSettings");
|
||||
CreateToolingRemotesite.setCallback(this,function(res1){
|
||||
var state1 = res1.getState();
|
||||
|
||||
if(state1 =="SUCCESS" && (res1.getReturnValue() == true || res1.getReturnValue() == 'true' )){
|
||||
component.set("v.Toolingremotesite",true);
|
||||
|
||||
}
|
||||
if(state1 =="SUCCESS" && res1.getReturnValue().includes('http') ){
|
||||
|
||||
component.set("v.CreateRemotesiteSettingUrl",res1.getReturnValue());
|
||||
|
||||
}
|
||||
window.open('/0DM/o','_blank');
|
||||
});
|
||||
$A.enqueueAction(CreateToolingRemotesite);
|
||||
},
|
||||
|
||||
checkingCertificate : function(component, event) {
|
||||
// if(component.get("v.CheckSiteExist") == false || component.get("v.CheckSiteAccess") == false) return;
|
||||
try{
|
||||
var CheckingCertifiacteaction = component.get("c.CheckshopifycertificateandRemotesite");
|
||||
CheckingCertifiacteaction.setParams({
|
||||
'Urltype':'certificate'
|
||||
});
|
||||
CheckingCertifiacteaction.setCallback(this,function(res){
|
||||
var state = res.getState();
|
||||
if(state =="SUCCESS" && (res.getReturnValue() == true || res.getReturnValue() == 'true' )){
|
||||
component.set("v.CheckCertificate",true);
|
||||
return true;
|
||||
}
|
||||
|
||||
if(state =="SUCCESS" && (res.getReturnValue() == false || res.getReturnValue() == 'false' )){
|
||||
component.set("v.CheckCertificate",false);
|
||||
var cmpEvent = component.getEvent("AuthenticateErorrEvent");
|
||||
cmpEvent.setParams({
|
||||
"hasError" : false });
|
||||
cmpEvent.fire();
|
||||
return false;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$A.enqueueAction(CheckingCertifiacteaction);
|
||||
return false;
|
||||
|
||||
}catch(e){
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
|
||||
CheckingRemotesitesetting : function(component, event) {
|
||||
|
||||
// if(component.get("v.CheckSiteExist") == false || component.get("v.CheckSiteAccess") == false) return;
|
||||
try{
|
||||
var CheckingCertifiacteaction = component.get("c.CheckshopifycertificateandRemotesite");
|
||||
CheckingCertifiacteaction.setParams({
|
||||
'Urltype':'remotesite'
|
||||
});
|
||||
CheckingCertifiacteaction.setCallback(this,function(res){
|
||||
var state = res.getState();
|
||||
if(state =="SUCCESS" && (res.getReturnValue() == true || res.getReturnValue() == 'true' )){
|
||||
component.set("v.Remotesiteexist",true);
|
||||
return true;
|
||||
}
|
||||
|
||||
if(state =="SUCCESS" && (res.getReturnValue() == false || res.getReturnValue() == 'false' )){
|
||||
component.set("v.Remotesiteexist",false);
|
||||
var cmpEvent = component.getEvent("AuthenticateErorrEvent");
|
||||
cmpEvent.setParams({
|
||||
"hasError" : false });
|
||||
cmpEvent.fire();
|
||||
return false;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$A.enqueueAction(CheckingCertifiacteaction);
|
||||
return false;
|
||||
}catch(e){
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
getSiteURLList : function( component, event,helper ) {
|
||||
|
||||
var action = component.get("c.getSiteURLs");
|
||||
|
||||
action.setCallback(this, function(response) {
|
||||
var state = response.getState();
|
||||
if (state === "SUCCESS" && response.getReturnValue() != null ) {
|
||||
component.set("v.CheckSiteExist",true);
|
||||
component.set("v.CheckSiteAccess",true);
|
||||
component.set("v.siteURLList",JSON.parse(response.getReturnValue()));
|
||||
this.CheckSitefromConfiguration(component, event, helper, true);
|
||||
}else if(state === "SUCCESS" && response.getReturnValue() == null){
|
||||
component.set("v.CheckSiteExist",false);
|
||||
this.CheckSitefromConfiguration(component, event, helper, false);
|
||||
|
||||
}
|
||||
else if (state === "INCOMPLETE") {
|
||||
// do something
|
||||
}
|
||||
else if (state === "ERROR") {
|
||||
var errors = response.getError();
|
||||
if (errors) {
|
||||
if (errors[0] && errors[0].message) {
|
||||
console.log("Error message: " +
|
||||
errors[0].message);
|
||||
}
|
||||
} else {
|
||||
console.log("Unknown error");
|
||||
}
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(action);
|
||||
},
|
||||
})
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
<aura:application extends="ltng:outApp" >
|
||||
<aura:dependency resource="c:AuthenticationPassThankyou"/>
|
||||
</aura:application>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||
<apiVersion>46.0</apiVersion>
|
||||
<description>Authentication Page lighting app.</description>
|
||||
</AuraDefinitionBundle>
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
.THIS {
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
({
|
||||
myAction : function(component, event, helper) {
|
||||
|
||||
}
|
||||
})
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
<aura:component >
|
||||
<center>
|
||||
<div style="margin: 4%;">
|
||||
<img src="{!$Resource.SendingMailTrue}" style="height: 10%; width: 12%;" height="50"/><br/>
|
||||
<div style=" word-wrap: break-word;">
|
||||
<P style="font-size: x-large;" ><b>Shopify connected</b><br/>
|
||||
Great going ! The shopify is now configured and connected ! <br/>
|
||||
</P>
|
||||
</div>
|
||||
<img src="{!$Resource.ShopifyMadeEasyLogo}" style="margin-left: 4%;" height="50"/><br/>
|
||||
<lightning:button variant="brand" label="Go back and finish the next step" title="Home" onclick="" />
|
||||
</div>
|
||||
</center>
|
||||
|
||||
</aura:component>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||
<apiVersion>46.0</apiVersion>
|
||||
<description>Authentication Pass Thank you page.</description>
|
||||
</AuraDefinitionBundle>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
({
|
||||
myAction : function(component, event, helper) {
|
||||
|
||||
}
|
||||
})
|
||||
|
|
@ -0,0 +1,611 @@
|
|||
<aura:component controller="AddDeleteController" >
|
||||
<!--ltng:require styles="{! $Resource.HIC_ShopifySync__boostrap337New + '/bootstrap-3.3.7/dist/css/bootstrap.min.css'}"
|
||||
scripts="{!join(',',
|
||||
|
||||
$Resource.HIC_ShopifySync__jquery224,
|
||||
$Resource.HIC_ShopifySync__boostrap337New + '/bootstrap-3.3.7/dist/js/bootstrap.min.js'
|
||||
|
||||
)
|
||||
}" afterScriptsLoaded="{!c.scriptsLoaded}"/-->
|
||||
<aura:handler event="c:updateStoreValue" action="{!c.doinit }"/>
|
||||
<aura:registerEvent name="CloseSpinner" type="c:CloseSpinner"/>
|
||||
<aura:attribute name = "store" type ="string" default="default"/>
|
||||
<aura:attribute name = "disableabortedbuttton" type ="Boolean" default = "false"/>
|
||||
<aura:attribute name="Abortederrormessage" type="string" default="Aborted by user or there was some system errors."/>
|
||||
<aura:attribute name="objectname" type="string" default="data"/>
|
||||
<aura:attribute name = "Batchaborted" type ="Boolean" default = "false"/>
|
||||
<aura:attribute name = "Batchabortedbox" type ="Boolean" default = "false"/>
|
||||
|
||||
|
||||
<aura:attribute name="facebookURL" type="string" />
|
||||
<aura:attribute name="InstagramURL" type="string"/>
|
||||
<aura:attribute name="twitterURL" type="string"/>
|
||||
<aura:attribute name="LinkedinURL" type="string"/>
|
||||
|
||||
<aura:handler name="init" value="this" action="{!c.doinit}"/>
|
||||
<aura:attribute name="configObj" type="object" />
|
||||
<aura:attribute name="WriteReviewURL" type="String" />
|
||||
<aura:attribute name ="emails" type="string" default=""/>
|
||||
<aura:attribute name ="setinterval" type="Integer" default="1010101010010010"/>
|
||||
|
||||
|
||||
<aura:attribute name = "ProductCount" type ="String" default = "In Queue"/>
|
||||
<aura:attribute name = "VarientCount" type ="String" default = "In Queue"/>
|
||||
<aura:attribute name = "AccountCount" type ="String" default = "In Queue"/>
|
||||
<aura:attribute name = "ContactCount" type ="String" default = "In Queue"/>
|
||||
<aura:attribute name = "OrderCount" type ="String" default = "In Queue"/>
|
||||
<aura:attribute name = "OppCount" type ="String" default = "In Queue"/>
|
||||
|
||||
<aura:attribute name="SmartCount" type="String" default ="In Queue"/>
|
||||
<aura:attribute name="CustomCount" type="String" default ="In Queue"/>
|
||||
<aura:attribute name="CollectCount" type="String" default ="In Queue"/>
|
||||
|
||||
<aura:attribute name = "LocationCount" type ="String" default = "In Queue"/>
|
||||
<aura:attribute name = "InventoryCount" type ="String" default = "In Queue"/>
|
||||
|
||||
<aura:attribute name="DraftOrderCount" type="String" default ="In Queue"/>
|
||||
|
||||
<aura:attribute name="ProgessValue" type="Integer" default ="2"/>
|
||||
|
||||
<aura:attribute name = "ProductComplete" type ="Boolean" default = "false"/>
|
||||
<aura:attribute name = "VarientComplete" type ="Boolean" default = "false"/>
|
||||
<aura:attribute name = "AccountComplete" type ="Boolean" default = "false"/>
|
||||
<aura:attribute name = "ContactComplete" type ="Boolean" default = "false"/>
|
||||
<aura:attribute name = "OrderComplete" type ="Boolean" default = "false"/>
|
||||
<aura:attribute name = "OppComplete" type ="Boolean" default = "false"/>
|
||||
|
||||
<aura:attribute name = "SamartComplete" type ="Boolean" default = "false"/>
|
||||
<aura:attribute name = "CustomComplete" type ="Boolean" default = "false"/>
|
||||
<aura:attribute name = "CollectComplete" type ="Boolean" default = "false"/>
|
||||
|
||||
|
||||
<aura:attribute name = "LocationComplete" type ="Boolean" default = "false"/>
|
||||
<aura:attribute name = "InventoryComplete" type ="Boolean" default = "false"/>
|
||||
|
||||
<aura:attribute name = "DraftOrderComplete" type ="Boolean" default = "false"/>
|
||||
|
||||
|
||||
<aura:attribute name="IsBatchProcess" type="boolean" default="false"/>
|
||||
|
||||
<aura:attribute name="ProgressMessage" type="String" default="And you are almost done !"/>
|
||||
|
||||
<aura:handler event="force:refreshView" action="{!c.doinit}" />
|
||||
|
||||
|
||||
<!--aura:attribute name="SpinnerValue" type="boolean" default="true"/-->
|
||||
|
||||
|
||||
|
||||
<center>
|
||||
<!--div class="slds-p-horizontal_medium">
|
||||
<article class="slds-card">
|
||||
<lightning:progressIndicator type="path" currentStep="Finished" >
|
||||
<lightning:progressStep label="Step 1" value="complete"/>
|
||||
<lightning:progressStep label="Step 2" value="step1"/>
|
||||
<lightning:progressStep label="Step 3" value="step2"/>
|
||||
<lightning:progressStep label="Step 4" value="step3"/>
|
||||
<lightning:progressStep label="Step 5" value="step4"/>
|
||||
<lightning:progressStep label="Step 6" value="step5"/>
|
||||
<lightning:progressStep label="Finished" value="Finished"/>
|
||||
</lightning:progressIndicator>
|
||||
</article>
|
||||
</div-->
|
||||
<div >
|
||||
<!--img src="{!$Resource.HIC_ShopifySync__ShopifyProcessingGif}" style="width: 6%;" height="50"/-->
|
||||
<div Style="font-size: x-large;margin: 1%;">
|
||||
<!--b>And you are almost done !</b><br-->
|
||||
</div>
|
||||
<!--div class="progress" style="width: 56%; ">
|
||||
<div aura:id = "progesssbar" class="progress-bar progress-bar-striped active ProgressStart" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" >
|
||||
{!v.ProgessValue}%
|
||||
</div>
|
||||
</div-->
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</center>
|
||||
<!--lightning:progressBar value="{!v.ProgessValue}" title="{!v.ProgessValue}" size="medium" /-->
|
||||
<div class="slds-float_left slds-m-around_x-small">
|
||||
<img width="70" height="70" src="https://cdn.shopify.com/assets/images/logos/shopify-bag.png" /> <b>{!v.store}</b>
|
||||
</div>
|
||||
<div style=" margin: 0 19%;font-size: x-large;">
|
||||
<div class="slds-grid slds-grid_align-spread slds-p-bottom_x-small" id="progress-bar-label-id-5">
|
||||
<span aura:id = "ProgressMessageid">{!v.ProgressMessage}</span>
|
||||
<span aria-hidden="true">
|
||||
<strong> {!v.ProgessValue}% <aura:renderif istrue ="{!v.ProgessValue == '100'}" >
|
||||
Completed
|
||||
<aura:set attribute="else">
|
||||
Complete
|
||||
</aura:set>
|
||||
</aura:renderif></strong>
|
||||
</span>
|
||||
</div>
|
||||
<div class="slds-progress-bar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="25" aria-labelledby="progress-bar-label-id-5" role="progressbar">
|
||||
<span class="slds-progress-bar__value ProgressStart" aura:id = "progesssbar" >
|
||||
<span class="slds-assistive-text">Progress: {!v.ProgessValue}%</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="slds-text-longform" style="width: 72%;margin-left: 19%;margin-top: 3%;font-size: x-large;">
|
||||
<p>
|
||||
Great going ! The app is now configured and connected ! We will send you an email at {!v.emails} once we finish the background setup.<br/>
|
||||
</p>
|
||||
<p >
|
||||
|
||||
Meanwhile you can -<br/>
|
||||
<ol >
|
||||
<li><a href="{!v.WriteReviewURL}" target="_blank">Write a review of our app on appexchange.</a></li>
|
||||
<li><a href="https://syncmadeasy.com" target="_blank">Subscribe to newsletter for the latest update.</a></li>
|
||||
<li><a href="https://tinyurl.com/l6fot6q" target="_blank">Watch funny cat video.</a> </li>
|
||||
</ol>
|
||||
</p>
|
||||
</div>
|
||||
<center>
|
||||
<!--div class="slds-m-around_medium" style= "width: 78% !Important; padding-right: 10%;padding-left: 10%;"-->
|
||||
<aura:renderif isTrue="{!!v.Batchaborted}">
|
||||
|
||||
|
||||
<div style="margin: 0 22%;" >
|
||||
<div class="slds-grid slds-gutters">
|
||||
<div class="slds-col" style="width: 50%;">
|
||||
<span>
|
||||
<div class="zoom">
|
||||
<article class="slds-card slds-card--narrow">
|
||||
<div class="slds-card__header slds-grid">
|
||||
<header class="slds-media slds-media--center slds-has-flexi-truncate">
|
||||
<div class="slds-media__figure">
|
||||
<lightning:icon style="margin-right: 10px;" iconName='standard:product' />
|
||||
</div>
|
||||
<div class="slds-media__body slds-truncate">
|
||||
|
||||
<h2>
|
||||
<span class="slds-text-heading--small"> Total Product/Variant in system</span>
|
||||
</h2>
|
||||
</div>
|
||||
</header>
|
||||
</div>
|
||||
<div class="slds-card__body slds-align--absolute-center slds-text-heading--large" style="font-size: 250%;">
|
||||
{!v.ProductCount}/{!v.VarientCount}</div>
|
||||
<div class="slds-card__footer">
|
||||
<aura:if isTrue="{!v.VarientComplete}">
|
||||
<span style= "color:green">
|
||||
Completed
|
||||
</span>
|
||||
<aura:set attribute="else">
|
||||
<aura:if isTrue="{!v.ProductCount != 'In Queue' }">
|
||||
<span style = "color:#31b1a5">
|
||||
Counting..
|
||||
</span>
|
||||
|
||||
<aura:set attribute="else">
|
||||
<span style = "color:Orange">
|
||||
Not Started Yet
|
||||
</span>
|
||||
</aura:set>
|
||||
</aura:if>
|
||||
</aura:set>
|
||||
</aura:if>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
</span>
|
||||
</div>
|
||||
<div class="slds-col" style="width: 50%;">
|
||||
<span>
|
||||
|
||||
<aura:if isTrue="{!v.configObj.HIC_ShopifySync__Person_Account__c}">
|
||||
<div class="zoom">
|
||||
<article class="slds-card slds-card--narrow">
|
||||
<div class="slds-card__header slds-grid">
|
||||
<header class="slds-media slds-media--center slds-has-flexi-truncate">
|
||||
<div class="slds-media__figure">
|
||||
<lightning:icon style="margin-right: 10px;" iconName='standard:customers' />
|
||||
</div>
|
||||
<div class="slds-media__body slds-truncate">
|
||||
|
||||
<h2>
|
||||
<span class="slds-text-heading--small"> Total Person Account in system</span>
|
||||
</h2>
|
||||
</div>
|
||||
</header>
|
||||
</div>
|
||||
<div class="slds-card__body slds-align--absolute-center slds-text-heading--large" > {!v.PersonAccountCount}</div>
|
||||
<div class="slds-card__footer">
|
||||
<aura:if isTrue="{!v.ContactComplete}">
|
||||
<span style= "color:green">
|
||||
Completed
|
||||
</span>
|
||||
<aura:set attribute="else">
|
||||
<aura:if isTrue="{!v.VarientComplete}">
|
||||
<span style = "color:#31b1a5">
|
||||
Counting..
|
||||
</span>
|
||||
<aura:set attribute="else">
|
||||
<span style = "color:Orange">
|
||||
Not Started Yet
|
||||
</span>
|
||||
</aura:set>
|
||||
</aura:if>
|
||||
</aura:set>
|
||||
</aura:if>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
<aura:set attribute="else">
|
||||
<div class="zoom">
|
||||
<article class="slds-card slds-card--narrow">
|
||||
<div class="slds-card__header slds-grid">
|
||||
<header class="slds-media slds-media--center slds-has-flexi-truncate">
|
||||
<div class="slds-media__figure">
|
||||
<lightning:icon style="margin-right: 10px;" iconName='standard:customers' />
|
||||
</div>
|
||||
<div class="slds-media__body slds-truncate">
|
||||
|
||||
<h2>
|
||||
<span class="slds-text-heading--small"> Total Account/Contact in system</span>
|
||||
</h2>
|
||||
</div>
|
||||
</header>
|
||||
</div>
|
||||
<div class="slds-card__body slds-align--absolute-center slds-text-heading--large" style="font-size: 250%;" > {!v.AccountCount}/{!v.ContactCount}</div>
|
||||
<div class="slds-card__footer">
|
||||
<aura:if isTrue="{!v.ContactComplete}">
|
||||
<span style= "color:green">
|
||||
Completed
|
||||
</span>
|
||||
<aura:set attribute="else">
|
||||
<aura:if isTrue="{!v.VarientComplete}">
|
||||
<span style = "color:#31b1a5">
|
||||
Counting..
|
||||
</span>
|
||||
<aura:set attribute="else">
|
||||
<span style = "color:Orange">
|
||||
Not Started Yet
|
||||
</span>
|
||||
</aura:set>
|
||||
</aura:if>
|
||||
</aura:set>
|
||||
</aura:if>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
</aura:set>
|
||||
</aura:if>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="slds-grid slds-gutters">
|
||||
<aura:if isTrue="{!or(v.configObj.HIC_ShopifySync__Order__c,v.configObj.HIC_ShopifySync__Opportunity__c)}">
|
||||
<div class="slds-col" style="width: 50%;">
|
||||
<span>
|
||||
<div class="zoom" style="margin-top: 2%;">
|
||||
<article class="slds-card slds-card--narrow">
|
||||
<div class="slds-card__header slds-grid">
|
||||
<header class="slds-media slds-media--center slds-has-flexi-truncate">
|
||||
<div class="slds-media__figure">
|
||||
<lightning:icon style="margin-right: 10px;" iconName='standard:orders' />
|
||||
</div>
|
||||
<div class="slds-media__body slds-truncate">
|
||||
|
||||
<h2>
|
||||
<span class="slds-text-heading--small">
|
||||
|
||||
<aura:if isTrue="{!and(v.configObj.HIC_ShopifySync__Order__c, v.configObj.HIC_ShopifySync__Opportunity__c)}">
|
||||
|
||||
Total Order/Opportunity in system
|
||||
<aura:set attribute="else">
|
||||
<aura:if isTrue="{!v.configObj.HIC_ShopifySync__Order__c}">
|
||||
Total Order in system
|
||||
<aura:set attribute="else">
|
||||
Total Opportunity in system
|
||||
</aura:set>
|
||||
</aura:if>
|
||||
</aura:set>
|
||||
</aura:if>
|
||||
</span>
|
||||
</h2>
|
||||
</div>
|
||||
</header>
|
||||
</div>
|
||||
<div class="slds-card__body slds-align--absolute-center slds-text-heading--large" style="font-size: 250%;" >
|
||||
<aura:if isTrue="{!and(v.configObj.HIC_ShopifySync__Order__c, v.configObj.HIC_ShopifySync__Opportunity__c)}">
|
||||
|
||||
{!v.OrderCount}/{!v.OppCount}
|
||||
<aura:set attribute="else">
|
||||
<aura:if isTrue="{!v.configObj.HIC_ShopifySync__Order__c}">
|
||||
{!v.OrderCount}
|
||||
<aura:set attribute="else">
|
||||
{!v.OppCount}
|
||||
</aura:set>
|
||||
</aura:if>
|
||||
</aura:set>
|
||||
</aura:if>
|
||||
|
||||
</div>
|
||||
<div class="slds-card__footer">
|
||||
<!--aura:if isTrue="{!v.OppComplete}"-->
|
||||
<aura:if isTrue="{!or(v.OppComplete,and(!v.configObj.HIC_ShopifySync__Opportunity__c,v.OrderComplete))}">
|
||||
<span style= "color:green">
|
||||
Completed
|
||||
</span>
|
||||
<aura:set attribute="else">
|
||||
<aura:if isTrue="{!v.ContactComplete}">
|
||||
<span style = "color:#31b1a5">
|
||||
Counting..
|
||||
</span>
|
||||
<aura:set attribute="else">
|
||||
<span style = "color:Orange">
|
||||
Not Started Yet
|
||||
</span>
|
||||
</aura:set>
|
||||
</aura:if>
|
||||
|
||||
</aura:set>
|
||||
</aura:if>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
|
||||
</span>
|
||||
</div>
|
||||
</aura:if>
|
||||
<aura:if isTrue="{!v.configObj.HIC_ShopifySync__Collection__c}">
|
||||
<div class="slds-col" style="width: 50%;">
|
||||
<span>
|
||||
<div class="zoom" style="margin-top: 2%;">
|
||||
<article class="slds-card slds-card--narrow">
|
||||
<div class="slds-card__header slds-grid">
|
||||
<header class="slds-media slds-media--center slds-has-flexi-truncate">
|
||||
<div class="slds-media__figure">
|
||||
<lightning:icon style="margin-right: 10px;" iconName='standard:product_required' />
|
||||
</div>
|
||||
<div class="slds-media__body slds-truncate">
|
||||
|
||||
<h2>
|
||||
<span class="slds-text-heading--small">
|
||||
|
||||
|
||||
|
||||
Total Collection in system
|
||||
|
||||
</span>
|
||||
</h2>
|
||||
</div>
|
||||
</header>
|
||||
</div>
|
||||
<div class="slds-card__body slds-align--absolute-center slds-text-heading--large" style="font-size: 250%;" >
|
||||
|
||||
|
||||
{!v.CollectCount}
|
||||
|
||||
|
||||
</div>
|
||||
<div class="slds-card__footer">
|
||||
<aura:if isTrue="{!v.CollectComplete}">
|
||||
<span style= "color:green">
|
||||
Completed
|
||||
</span>
|
||||
<aura:set attribute="else">
|
||||
<aura:if isTrue="{!or(v.OppComplete,and(!v.configObj.HIC_ShopifySync__Opportunity__c,v.OrderComplete))}">
|
||||
<span style = "color:#31b1a5">
|
||||
Counting..
|
||||
</span>
|
||||
<aura:set attribute="else">
|
||||
<span style = "color:Orange">
|
||||
Not Started Yet
|
||||
</span>
|
||||
</aura:set>
|
||||
</aura:if>
|
||||
|
||||
</aura:set>
|
||||
</aura:if>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
|
||||
</span>
|
||||
</div>
|
||||
</aura:if>
|
||||
</div>
|
||||
|
||||
<div class="slds-grid slds-gutters">
|
||||
<aura:if isTrue="{!v.configObj.HIC_ShopifySync__Inventory_Location__c}">
|
||||
<div class="slds-col" style="width: 50%;">
|
||||
<span>
|
||||
|
||||
<div class="zoom" style="margin-top: 4%;">
|
||||
<article class="slds-card slds-card--narrow">
|
||||
<div class="slds-card__header slds-grid">
|
||||
<header class="slds-media slds-media--center slds-has-flexi-truncate">
|
||||
<div class="slds-media__figure">
|
||||
<lightning:icon style="margin-right: 10px;" iconName='standard:location' />
|
||||
</div>
|
||||
<div class="slds-media__body slds-truncate">
|
||||
|
||||
<h2>
|
||||
<span class="slds-text-heading--small"> Total Location/Inventory in system</span>
|
||||
</h2>
|
||||
</div>
|
||||
</header>
|
||||
</div>
|
||||
<div class="slds-card__body slds-align--absolute-center slds-text-heading--large" style="font-size: 250%;" > {!v.LocationCount}/{!v.InventoryCount}</div>
|
||||
<div class="slds-card__footer">
|
||||
<aura:if isTrue="{!v.InventoryComplete}">
|
||||
<span style= "color:green">
|
||||
Completed
|
||||
</span>
|
||||
<aura:set attribute="else">
|
||||
<aura:if isTrue="{!v.CollectComplete}">
|
||||
<span style = "color:#31b1a5">
|
||||
Counting..
|
||||
</span>
|
||||
<aura:set attribute="else">
|
||||
<span style = "color:Orange">
|
||||
Not Started Yet
|
||||
</span>
|
||||
</aura:set>
|
||||
</aura:if>
|
||||
</aura:set>
|
||||
</aura:if>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
</span>
|
||||
</div>
|
||||
</aura:if>
|
||||
<aura:if isTrue="{!v.configObj.HIC_ShopifySync__Enable_Draft_Order__c}">
|
||||
<div class="slds-col" style="width: 50%;">
|
||||
<span>
|
||||
|
||||
<div class="zoom" style="margin-top: 4%;">
|
||||
<article class="slds-card slds-card--narrow">
|
||||
<div class="slds-card__header slds-grid">
|
||||
<header class="slds-media slds-media--center slds-has-flexi-truncate">
|
||||
<div class="slds-media__figure">
|
||||
<lightning:icon style="margin-right: 10px;" iconName='standard:return_order_line_item' />
|
||||
</div>
|
||||
<div class="slds-media__body slds-truncate">
|
||||
|
||||
<h2>
|
||||
<span class="slds-text-heading--small"> Total Draft order in system</span>
|
||||
</h2>
|
||||
</div>
|
||||
</header>
|
||||
</div>
|
||||
<div class="slds-card__body slds-align--absolute-center slds-text-heading--large" style="font-size: 250%;" > {!v.DraftOrderCount}</div>
|
||||
<div class="slds-card__footer">
|
||||
<aura:if isTrue="{!v.DraftOrderComplete}">
|
||||
<span style= "color:green">
|
||||
Completed
|
||||
</span>
|
||||
<aura:set attribute="else">
|
||||
<aura:if isTrue="{!v.InventoryComplete}">
|
||||
<span style = "color:#31b1a5">
|
||||
Counting..
|
||||
</span>
|
||||
<aura:set attribute="else">
|
||||
<span style = "color:Orange">
|
||||
Not Started Yet
|
||||
</span>
|
||||
</aura:set>
|
||||
</aura:if>
|
||||
</aura:set>
|
||||
</aura:if>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
</span>
|
||||
</div>
|
||||
</aura:if>
|
||||
</div>
|
||||
</div>
|
||||
<aura:set attribute="else">
|
||||
|
||||
<!--Use "slds-m-around_xx-large" class to add standard X-Large padding to the component-->
|
||||
<div class="slds-m-around_xx-large">
|
||||
<!--Use aura:if tag to display Model Box, on the bese of conditions. [isOpen boolean attribute] -->
|
||||
<aura:if isTrue="{!v.Batchabortedbox}">
|
||||
|
||||
<!--###### MODAL BOX Start######-->
|
||||
<section role="dialog" tabindex="-1" style="font-size: large !important;" aria-labelledby="modal-heading-01" aria-modal="true" aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open">
|
||||
<div class="slds-modal__container">
|
||||
<!-- ###### MODAL BOX HEADER Start ######-->
|
||||
<header class="slds-modal__header">
|
||||
<!--lightning:buttonIcon iconName="utility:close"
|
||||
onclick="{! c.CloseAbortbox }"
|
||||
alternativeText="close"
|
||||
variant="bare-inverse"
|
||||
class="slds-modal__close"/-->
|
||||
<h2 id="modal-heading-01" class="slds-text-heading_medium slds-hyphenate"> Oops there was error while collecting {!v.objectname}. </h2>
|
||||
</header>
|
||||
<!--###### MODAL BOX BODY Part Start######-->
|
||||
<div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1">
|
||||
<p><b>
|
||||
|
||||
<img src="{!$Resource.SendingMailFalse}" style="height: 50%; width: 12%;" height="50"/>
|
||||
<div style="margin:3%">
|
||||
<p><b>{!v.Abortederrormessage}</b><br/>
|
||||
<b>for more help contact us at </b>
|
||||
<a target="_Top" href= "http://support.syncmadeasy.com" ><b> support.syncmadeasy.com</b></a><br/>
|
||||
</p>
|
||||
</div>
|
||||
</b>
|
||||
</p>
|
||||
</div>
|
||||
<!--###### MODAL BOX FOOTER Part Start ######-->
|
||||
<footer class="slds-modal__footer">
|
||||
<lightning:button variant="neutral"
|
||||
label="Process re-again"
|
||||
title="Process re-again"
|
||||
disabled="{!v.disableabortedbuttton}"
|
||||
onclick="{! c.refreshpageandexecutebatch }"/>
|
||||
<lightning:button variant="brand"
|
||||
label="Configure re-again"
|
||||
title="Configure re-again"
|
||||
disabled="{!v.disableabortedbuttton}"
|
||||
onclick="{! c.startfromthefirstpage }"/>
|
||||
</footer>
|
||||
</div>
|
||||
</section>
|
||||
<div class="slds-backdrop slds-backdrop_open"></div>
|
||||
<!--###### MODAL BOX Part END Here ######-->
|
||||
|
||||
</aura:if>
|
||||
</div>
|
||||
|
||||
</aura:set>
|
||||
</aura:renderif>
|
||||
</center>
|
||||
|
||||
<!--center>
|
||||
<div style=" margin-left:44%; " >
|
||||
|
||||
<a href="https://www.facebook.com/shopifymadeEasy/" class = "IconClass" target="_blank"><img src="{!$Resource.FaceBook_icon}" style="" /></a>
|
||||
<a href="https://instagram.com/shopifymadeasy?igshid=1gg8zare9tm00/" class = "IconClass" target="_blank"><img src="{!$Resource.Insta_icon}" style="" /></a>
|
||||
<a href="https://twitter.com/ShopifyH/" class = "IconClass" target="_blank"><img src="{!$Resource.Twitter_icon}" style="" /></a>
|
||||
<a href="https://www.linkedin.com/company/28392928/admin/" class = "IconClass" target="_blank"><img src="{!$Resource.LinkedIn_icon}" style="" /></a><br/>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div>
|
||||
<p><br/><br/><div Style="margin-right: 53px;" >Built with <img style="max-width: 1%;height: auto;" draggable="false" class="emoji" alt="❤" src="{!$Resource.Heart}"/> <a href="https://hicglobalsolutions.com"> by HIC Global Solutions </a> </div></p>
|
||||
</div>
|
||||
</center-->
|
||||
|
||||
<div class="footer">
|
||||
|
||||
|
||||
<div class="socialMediaHandler" style="margin-top:4%;width: 11em;">
|
||||
|
||||
<!--img src="{!$Resource.HIC_ShopifySync__ShopifyMadeEasyLogo}" style="margin-top: 1%;" height="50"/-->
|
||||
<a href="{!v.facebookURL}" class = "IconClass" target="_blank"><img src="{!$Resource.FaceBook_icon}" /></a>
|
||||
<a href="{!v.InstagramURL}" class = "IconClass" target="_blank"><img src="{!$Resource.Insta_icon}" /></a>
|
||||
<a href="{!v.twitterURL}" class = "IconClass" target="_blank"><img src="{!$Resource.Twitter_icon}" /></a>
|
||||
<a href="{!v.LinkedinURL}" class = "IconClass" target="_blank"><img src="{!$Resource.LinkedIn_icon}" /></a><br/>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="builtWithLove" >
|
||||
<p >
|
||||
<span >Built with</span>
|
||||
<img style="max-width: 10px;margin-left: 3px;" draggable="false" class="emoji" alt="❤" src="{!$Resource.Heart}"/>
|
||||
<a style="vertical-align: top;" href="https://hicglobalsolutions.com" target="_blank"> by HIC Global Solutions </a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</aura:component>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||
<apiVersion>46.0</apiVersion>
|
||||
<description>Almost done Page</description>
|
||||
</AuraDefinitionBundle>
|
||||
|
|
@ -0,0 +1,145 @@
|
|||
.THIS .IconClass {
|
||||
background: #27ae60;
|
||||
height: 31px;
|
||||
width: 31px;
|
||||
text-align: center;
|
||||
float: left;
|
||||
border-radius: 40px;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.THIS .IconClass:hover{
|
||||
|
||||
background: #f5b44b;
|
||||
|
||||
}
|
||||
|
||||
|
||||
.THIS .zoom {
|
||||
transition: transform .2s;
|
||||
margin: 0 auto;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.THIS .zoom:hover {
|
||||
-webkit-text-stroke: thin;
|
||||
-ms-transform: scale(1.1); /* IE 9 */
|
||||
-webkit-transform: scale(1.5); /* Safari 3-8 */
|
||||
transform: scale(1.02);
|
||||
|
||||
}
|
||||
.THIS .progress {
|
||||
margin-bottom: 0px !important;
|
||||
}
|
||||
|
||||
.THIS .ProgressStart{
|
||||
width: 2%;
|
||||
background-color: darkcyan;
|
||||
}
|
||||
|
||||
.THIS .ProgressProduct{
|
||||
width: 5%;
|
||||
background-color: darkcyan;
|
||||
}
|
||||
|
||||
.THIS .ProgressVariant{
|
||||
width: 15%;
|
||||
background-color: darkcyan;
|
||||
}
|
||||
|
||||
.THIS .ProgressAccount{
|
||||
width: 25%;
|
||||
background-color: royalblue;
|
||||
}
|
||||
|
||||
|
||||
.THIS .ProgressContact{
|
||||
width: 32%;
|
||||
background-color: royalblue;
|
||||
}
|
||||
|
||||
|
||||
.THIS .ProgressOrder{
|
||||
width: 39%;
|
||||
background-color: darkorange;
|
||||
}
|
||||
|
||||
.THIS .ProgressOpp{
|
||||
width: 45%;
|
||||
background-color: darkorange;
|
||||
}
|
||||
|
||||
.THIS .ProgressSmart{
|
||||
width: 48%;
|
||||
background-color: darkorange;
|
||||
}
|
||||
|
||||
.THIS .ProgressCustom{
|
||||
width: 51%;
|
||||
background-color: darkorange;
|
||||
}
|
||||
|
||||
.THIS .ProgressCollect{
|
||||
width: 70%;
|
||||
background-color: darkorange;
|
||||
}
|
||||
|
||||
.THIS .ProgressLocation{
|
||||
width: 81%;
|
||||
background-color: green;
|
||||
}
|
||||
|
||||
.THIS .ProgressInventory{
|
||||
width: 89%;
|
||||
background-color: green;
|
||||
}
|
||||
|
||||
|
||||
.THIS .ProgressDraft{
|
||||
width: 95%;
|
||||
background-color: darkorange;
|
||||
}
|
||||
|
||||
.THIS .ProgressCompleted{
|
||||
width: 100%;
|
||||
background: green;
|
||||
}
|
||||
|
||||
.THIS .socialMediaHandler {
|
||||
margin-top: 5%;
|
||||
margin: 0 auto;
|
||||
width: fit-content;
|
||||
}
|
||||
|
||||
|
||||
.THIS .footer {
|
||||
font-size: 198%;
|
||||
margin-top: 15% ;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
||||
.THIS .footer .socialMediaHandler a img {
|
||||
|
||||
max-width: 100%;
|
||||
|
||||
height: auto;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.THIS .builtWithLove {
|
||||
|
||||
margin-top:1% !Important;
|
||||
font-size: larger;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.THIS .StatusCompleted{
|
||||
color:green;
|
||||
}
|
||||
|
||||
.THIS .StatusIncompleted{
|
||||
color:red;
|
||||
}
|
||||
|
|
@ -0,0 +1,205 @@
|
|||
({
|
||||
|
||||
handleUpdateStoreValue : function (component, event, helper) {
|
||||
console.log('handleUpdateStoreValue called --> ');
|
||||
var store = event.getParam("store");
|
||||
console.log('handleUpdateStoreValue called-> '+store);
|
||||
component.set("v.store",store)
|
||||
},
|
||||
|
||||
|
||||
CloseAbortbox: function(component, event, helper){
|
||||
component.set("v.ProgressMessage","There was an error while collection "+component.get("v.objectname"));
|
||||
// $A.util.addClass(component.find('ProgressMessageid'), 'StatusIncompleted');
|
||||
//component.set("v.Batchabortedbox",false);
|
||||
},
|
||||
|
||||
refreshpageandexecutebatch: function(component, event, helper){
|
||||
component.set("v.disableabortedbuttton",true);
|
||||
helper.refreshpageandexecutebatch(component, event, helper);
|
||||
},
|
||||
|
||||
|
||||
startfromthefirstpage: function(component, event, helper){
|
||||
component.set("v.disableabortedbuttton",true);
|
||||
helper.startfromthefirstpage(component, event, helper);
|
||||
},
|
||||
|
||||
scriptsLoaded : function(component, event, helper){
|
||||
},
|
||||
|
||||
doinit : function(component, event, helper) {
|
||||
setTimeout(function(){
|
||||
component.set("v.Spinner",false);
|
||||
}, 2000);
|
||||
console.log('handleUpdateStoreValue called --> ');
|
||||
var configObj = component.get("v.configObj");
|
||||
console.log('configObj');console.log(JSON.stringify(configObj));
|
||||
try{
|
||||
helper.getConfigurationData( component, event );
|
||||
var store = event.getParam("store");
|
||||
console.log('store--');console.log(store);
|
||||
if(store == 'default' || store == undefined){
|
||||
store = configObj.Name;
|
||||
}
|
||||
console.log('handleUpdateStoreValue called-> '+store);
|
||||
component.set("v.store",store)
|
||||
}catch(e){
|
||||
|
||||
}
|
||||
|
||||
//component.set("v.store",(configObj.HIC_ShopifySync__Shopify_URL__c).replaceAll('https://','').replaceAll('.myshopify.com','').replaceAll('/',''));
|
||||
console.log('doint->');
|
||||
console.log(configObj.HIC_ShopifySync__Shopify_URL__c);
|
||||
|
||||
var CloseSpinnerEventFire = $A.get("e.c:CloseSpinner");
|
||||
CloseSpinnerEventFire.setParams({
|
||||
"Spinner" : false });
|
||||
CloseSpinnerEventFire.fire();
|
||||
var getDocumentUrl = component.get('c.getWriteReviewURL');
|
||||
getDocumentUrl.setCallback(this,function(res){
|
||||
var state = res.getState();
|
||||
var returnvalue = [];
|
||||
returnvalue = JSON.parse(res.getReturnValue());
|
||||
if(state == 'SUCCESS'&& returnvalue != null ){
|
||||
/*component.set("v.WriteReviewURL",Mapofreturnvalue.get('AppWriteReviewURL'));
|
||||
component.set("v.facebookURL",Mapofreturnvalue.get('Facebook'));
|
||||
component.set("v.InstagramURL",Mapofreturnvalue.get('Twitter'));
|
||||
component.set("v.twitterURL",Mapofreturnvalue.get('Instagram'));
|
||||
component.set("v.LinkedinURL",Mapofreturnvalue.get('Linkedin'));*/
|
||||
|
||||
for(var item in returnvalue){
|
||||
var name = returnvalue[item]['name'];
|
||||
var url = returnvalue[item]['Url'];
|
||||
|
||||
if(name == 'AppWriteReviewURL'){
|
||||
component.set("v.WriteReviewURL",url);
|
||||
}else if(name == 'Facebook'){
|
||||
component.set("v.facebookURL",url);
|
||||
}else if(name == 'Instagram'){
|
||||
component.set("v.InstagramURL",url);
|
||||
}else if(name == 'Twitter'){
|
||||
component.set("v.twitterURL",url);
|
||||
}else if(name == 'Linkedin'){
|
||||
component.set("v.LinkedinURL",url);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//helper.CallBatchInfo(component, event, helper);
|
||||
|
||||
var objectName;
|
||||
var ApexClassName;
|
||||
if((component.get("v.ProductCount") == 'In Queue' || component.get("v.ProductComplete") == 'false' || component.get("v.ProductComplete") == false) && ( component.get("v.configObj.HIC_ShopifySync__Product_Sync__c") == true || component.get("v.configObj.HIC_ShopifySync__Product_Sync__c") == 'true')){
|
||||
objectName = 'Product2';
|
||||
ApexClassName = 'BatchToCreateProducts';
|
||||
}else if((component.get("v.VarientCount") == 'In Queue' || component.get("v.VarientComplete") == 'false' || component.get("v.VarientComplete") == false) && (component.get("v.configObj.HIC_ShopifySync__Product_Sync__c") == true || component.get("v.configObj.HIC_ShopifySync__Product_Sync__c") == 'true')){
|
||||
objectName = 'HIC_ShopifySync__Variant__c';
|
||||
ApexClassName = 'BatchToCreateProducts';
|
||||
}else if((component.get("v.AccountCount") == 'In Queue' || component.get("v.AccountComplete") == 'false' || component.get("v.AccountComplete") == false) && ( component.get("v.configObj.HIC_ShopifySync__Customer_Sync__c") == true || component.get("v.configObj.HIC_ShopifySync__Customer_Sync__c") == 'true')){
|
||||
objectName = 'Account';
|
||||
ApexClassName = 'FetchAccounts';
|
||||
}else if((component.get("v.ContactCount") == 'In Queue' || component.get("v.ContactComplete") == 'false' || component.get("v.ContactComplete") == false) && ( component.get("v.configObj.HIC_ShopifySync__Customer_Sync__c") == true || component.get("v.configObj.HIC_ShopifySync__Customer_Sync__c") == 'true')){
|
||||
objectName = 'Contact';
|
||||
ApexClassName = 'FetchAccounts';
|
||||
}else if((component.get("v.OrderCount") == 'In Queue' || component.get("v.OrderComplete") == 'false' || component.get("v.OrderComplete") == false) && ( component.get("v.configObj.HIC_ShopifySync__Order_Sync__c") == true || component.get("v.configObj.HIC_ShopifySync__Order_Sync__c") == 'true')){
|
||||
objectName = 'Order';
|
||||
ApexClassName = 'FetchOrders';
|
||||
}else if((component.get("v.OppCount") == 'In Queue' || component.get("v.OppComplete") == 'false' || component.get("v.OppComplete") == false) && ( component.get("v.configObj.HIC_ShopifySync__Opportunity__c") == true || component.get("v.configObj.HIC_ShopifySync__Opportunity__c") == 'true')){
|
||||
objectName = 'Opportunity';
|
||||
ApexClassName = 'FetchOrders';
|
||||
}else if((component.get("v.SmartCount") == 'In Queue' || component.get("v.SamartComplete") == 'false' || component.get("v.SamartComplete") == false) && ( component.get("v.configObj.HIC_ShopifySync__Collection__c") == true || component.get("v.configObj.HIC_ShopifySync__Collection__c") == 'true')){
|
||||
objectName = 'HIC_ShopifySync__Collection__c';
|
||||
ApexClassName = 'FetchSmartCollection_Batch';
|
||||
}else if((component.get("v.CustomCount") == 'In Queue' || component.get("v.CustomComplete") == 'false' || component.get("v.CustomComplete") == false) && ( component.get("v.configObj.HIC_ShopifySync__Collection__c") == true || component.get("v.configObj.HIC_ShopifySync__Collection__c") == 'true')){
|
||||
objectName = 'HIC_ShopifySync__Collection__c';
|
||||
ApexClassName = 'FetchCollections_Batch';
|
||||
}else if((component.get("v.CollectCount") == 'In Queue' || component.get("v.CollectComplete") == 'false' || component.get("v.CollectComplete") == false) && ( component.get("v.configObj.HIC_ShopifySync__Collection__c") == true || component.get("v.configObj.HIC_ShopifySync__Collection__c") == 'true')){
|
||||
objectName = 'HIC_ShopifySync__Collect__c';
|
||||
ApexClassName = 'FetchCollects_Batch';
|
||||
}else if((component.get("v.LocationCount") == 'In Queue' || component.get("v.LocationComplete") == 'false' || component.get("v.LocationComplete") == false) && ( component.get("v.configObj.HIC_ShopifySync__Inventory_Location_Sync__c") == true || component.get("v.configObj.HIC_ShopifySync__Inventory_Location_Sync__c") == 'true')){
|
||||
objectName = 'HIC_ShopifySync__Location__c';
|
||||
ApexClassName = 'FetchLocations_Batch';
|
||||
}else if((component.get("v.InventoryCount") == 'In Queue' || component.get("v.InventoryComplete") == 'false' || component.get("v.InventoryComplete") == false) && ( component.get("v.configObj.HIC_ShopifySync__Inventory_Location_Sync__c") == true || component.get("v.configObj.HIC_ShopifySync__Inventory_Location_Sync__c") == 'true')){
|
||||
objectName = 'HIC_ShopifySync__Inventory__c';
|
||||
ApexClassName = 'FetchInventoryItems';
|
||||
}else if((component.get("v.DraftOrderCount") == 'In Queue' || component.get("v.DraftOrderComplete") == 'false' || component.get("v.DraftOrderComplete") == false) && ( component.get("v.configObj.HIC_ShopifySync__Enable_Draft_Order__c") == true || component.get("v.configObj.HIC_ShopifySync__Enable_Draft_Order__c") == 'true')){
|
||||
objectName = 'Draftorder';
|
||||
ApexClassName = 'FetchOrders';
|
||||
}else{
|
||||
objectName = '';
|
||||
ApexClassName = '';
|
||||
}
|
||||
|
||||
console.log('v.IsBatchProcess');console.log(component.get("v.IsBatchProcess"));
|
||||
console.log('objectName');console.log(objectName);
|
||||
console.log('ApexClassName');console.log(ApexClassName);
|
||||
console.log('configObj.HIC_ShopifySync__BatchisAborted__c');console.log(component.get("v.configObj.HIC_ShopifySync__BatchisAborted__c"));
|
||||
console.log('v.Batchabortedbox');console.log(component.get("v.Batchabortedbox"));
|
||||
console.log('setinterval');console.log(component.get("v.setinterval"));
|
||||
//execute callApexMethod() again after 5 sec each
|
||||
if((component.get("v.IsBatchProcess") == 'true' || component.get("v.IsBatchProcess") == true) && objectName != '' && ApexClassName != '' && component.get("v.configObj.HIC_ShopifySync__BatchisAborted__c") == false && component.get("v.setinterval") != 1010101010010010 && component.get("v.Batchabortedbox") == false ){
|
||||
//helper.CallBatchInfo(component, event, helper);
|
||||
if(component.get("v.Batchaborted") || component.get("v.Batchabortedbox")) return;
|
||||
var setinterval = window.setInterval(
|
||||
$A.getCallback(function() {
|
||||
if(component.get("v.Batchaborted") || component.get("v.Batchabortedbox")) return;
|
||||
helper.CallBatchInfo(component, event, helper);
|
||||
}), 5000
|
||||
);
|
||||
component.set("v.setinterval",setinterval);
|
||||
|
||||
|
||||
}else if(component.get("v.configObj.HIC_ShopifySync__BatchisAborted__c") || component.get("v.Batchaborted") != false && component.get("v.Batchabortedbox") != false && component.get("v.setinterval") != 1010101010010010 ){
|
||||
component.set("v.Batchaborted",true);
|
||||
component.set("v.Batchabortedbox",true);
|
||||
}else {
|
||||
component.set('v.ProgressMessage','Background setup finished');
|
||||
|
||||
$A.util.addClass(component.find('progesssbar'), 'ProgressCompleted');
|
||||
|
||||
component.set("v.configObj.HIC_ShopifySync__Batch_Is_Processing__c",false);
|
||||
component.set("v.ProgessValue",100);
|
||||
|
||||
$A.util.addClass(component.find('ProgressMessageid'), 'StatusCompleted');
|
||||
|
||||
if(component.get("v.setinterval") != 1010101010010010){
|
||||
helper.AbortInterval(component, event, helper);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var action = component.get("c.getErrorMailList");
|
||||
action.setCallback(this,function(response){
|
||||
if(response.getState() == 'SUCCESS' && response.getReturnValue() != null){
|
||||
var listofemails = [];
|
||||
listofemails = JSON.parse(response.getReturnValue());
|
||||
var emailsoneline = '';
|
||||
for (var i = 0; i < listofemails.length; i++) {
|
||||
if(i == (listofemails.length - 2)){
|
||||
emailsoneline += listofemails[i]['Name']+' and '
|
||||
}else{
|
||||
emailsoneline += listofemails[i]['Name']+', ';
|
||||
}
|
||||
}
|
||||
emailsoneline = emailsoneline.replace(/,(\s+)?$/, '');
|
||||
|
||||
if(emailsoneline != ''){
|
||||
component.set("v.emails",emailsoneline);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(action);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
$A.enqueueAction(getDocumentUrl);
|
||||
}
|
||||
})
|
||||
|
|
@ -0,0 +1,369 @@
|
|||
({
|
||||
|
||||
refreshpageandexecutebatch: function(component, event, helper){
|
||||
var refreshpageandexecutebatch = component.get("c.syncShopify");
|
||||
refreshpageandexecutebatch.setParams({
|
||||
'store':component.get("v.store")
|
||||
})
|
||||
refreshpageandexecutebatch.setCallback(this,function(res){
|
||||
var state = res.getState();
|
||||
if(state =="SUCCESS"){
|
||||
location.reload(true);
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(refreshpageandexecutebatch );
|
||||
},
|
||||
|
||||
startfromthefirstpage: function(component, event, helper){
|
||||
var startfromthefirstpage = component.get("c.updateconfigurationpbatchprocessingfield");
|
||||
startfromthefirstpage.setParams({
|
||||
'store':component.get("v.store")
|
||||
})
|
||||
startfromthefirstpage.setCallback(this,function(res){
|
||||
var state = res.getState();
|
||||
if(state =="SUCCESS" && res.getReturnValue() == true ){
|
||||
location.reload(true);
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(startfromthefirstpage);
|
||||
},
|
||||
|
||||
CallBatchInfo : function(component, event, helper) {
|
||||
console.log('callBatchInfor-->');
|
||||
console.log(component.get("v.store"));
|
||||
if(component.get("v.Batchaborted") || component.get("v.Batchabortedbox")) return;
|
||||
try{
|
||||
|
||||
var action = component.get("c.CheckingBatchDetails");
|
||||
var objectName;
|
||||
var ApexClassName;
|
||||
var result;
|
||||
if((component.get("v.ProductCount") == 'In Queue' || component.get("v.ProductComplete") == 'false' || component.get("v.ProductComplete") == false) && ( component.get("v.configObj.HIC_ShopifySync__Product_Sync__c") == true || component.get("v.configObj.HIC_ShopifySync__Product_Sync__c") == 'true')){
|
||||
objectName = 'Product2';
|
||||
ApexClassName = 'BatchToCreateProducts';
|
||||
}else if((component.get("v.VarientCount") == 'In Queue' || component.get("v.VarientComplete") == 'false' || component.get("v.VarientComplete") == false) && (component.get("v.configObj.HIC_ShopifySync__Product_Sync__c") == true || component.get("v.configObj.HIC_ShopifySync__Product_Sync__c") == 'true')){
|
||||
objectName = 'HIC_ShopifySync__Variant__c';
|
||||
ApexClassName = 'BatchToCreateProducts';
|
||||
}else if((component.get("v.AccountCount") == 'In Queue' || component.get("v.AccountComplete") == 'false' || component.get("v.AccountComplete") == false) && ( component.get("v.configObj.HIC_ShopifySync__Customer_Sync__c") == true || component.get("v.configObj.HIC_ShopifySync__Customer_Sync__c") == 'true')){
|
||||
objectName = 'Account';
|
||||
ApexClassName = 'FetchAccounts';
|
||||
}else if((component.get("v.ContactCount") == 'In Queue' || component.get("v.ContactComplete") == 'false' || component.get("v.ContactComplete") == false) && ( component.get("v.configObj.HIC_ShopifySync__Customer_Sync__c") == true || component.get("v.configObj.HIC_ShopifySync__Customer_Sync__c") == 'true')){
|
||||
objectName = 'Contact';
|
||||
ApexClassName = 'FetchAccounts';
|
||||
}else if((component.get("v.OrderCount") == 'In Queue' || component.get("v.OrderComplete") == 'false' || component.get("v.OrderComplete") == false) && ( component.get("v.configObj.HIC_ShopifySync__Order_Sync__c") == true || component.get("v.configObj.HIC_ShopifySync__Order_Sync__c") == 'true')){
|
||||
objectName = 'Order';
|
||||
ApexClassName = 'FetchOrders';
|
||||
}else if((component.get("v.OppCount") == 'In Queue' || component.get("v.OppComplete") == 'false' || component.get("v.OppComplete") == false) && ( component.get("v.configObj.HIC_ShopifySync__Opportunity__c") == true || component.get("v.configObj.HIC_ShopifySync__Opportunity__c") == 'true')){
|
||||
objectName = 'Opportunity';
|
||||
ApexClassName = 'FetchOrders';
|
||||
}else if((component.get("v.SmartCount") == 'In Queue' || component.get("v.SamartComplete") == 'false' || component.get("v.SamartComplete") == false) && ( component.get("v.configObj.HIC_ShopifySync__Collection__c") == true || component.get("v.configObj.HIC_ShopifySync__Collection__c") == 'true')){
|
||||
objectName = 'HIC_ShopifySync__Collection__c';
|
||||
ApexClassName = 'FetchSmartCollection_Batch';
|
||||
}else if((component.get("v.CustomCount") == 'In Queue' || component.get("v.CustomComplete") == 'false' || component.get("v.CustomComplete") == false) && ( component.get("v.configObj.HIC_ShopifySync__Collection__c") == true || component.get("v.configObj.HIC_ShopifySync__Collection__c") == 'true')){
|
||||
objectName = 'HIC_ShopifySync__Collection__c';
|
||||
ApexClassName = 'FetchCollections_Batch';
|
||||
}else if((component.get("v.CollectCount") == 'In Queue' || component.get("v.CollectComplete") == 'false' || component.get("v.CollectComplete") == false) && ( component.get("v.configObj.HIC_ShopifySync__Collection__c") == true || component.get("v.configObj.HIC_ShopifySync__Collection__c") == 'true')){
|
||||
objectName = 'HIC_ShopifySync__Collect__c';
|
||||
ApexClassName = 'FetchCollects_Batch';
|
||||
}else if((component.get("v.LocationCount") == 'In Queue' || component.get("v.LocationComplete") == 'false' || component.get("v.LocationComplete") == false) && ( component.get("v.configObj.HIC_ShopifySync__Inventory_Location_Sync__c") == true || component.get("v.configObj.HIC_ShopifySync__Inventory_Location_Sync__c") == 'true')){
|
||||
objectName = 'HIC_ShopifySync__Location__c';
|
||||
ApexClassName = 'FetchLocations_Batch';
|
||||
}else if((component.get("v.InventoryCount") == 'In Queue' || component.get("v.InventoryComplete") == 'false' || component.get("v.InventoryComplete") == false) && ( component.get("v.configObj.HIC_ShopifySync__Inventory_Location_Sync__c") == true || component.get("v.configObj.HIC_ShopifySync__Inventory_Location_Sync__c") == 'true')){
|
||||
objectName = 'HIC_ShopifySync__Inventory__c';
|
||||
ApexClassName = 'FetchInventoryItems';
|
||||
}else if((component.get("v.DraftOrderCount") == 'In Queue' || component.get("v.DraftOrderComplete") == 'false' || component.get("v.DraftOrderComplete") == false) && ( component.get("v.configObj.HIC_ShopifySync__Enable_Draft_Order__c") == true || component.get("v.configObj.HIC_ShopifySync__Enable_Draft_Order__c") == 'true')){
|
||||
objectName = 'Draftorder';
|
||||
ApexClassName = 'FetchOrders';
|
||||
}else{
|
||||
objectName = '';
|
||||
ApexClassName = '';
|
||||
}
|
||||
|
||||
|
||||
action.setParams({
|
||||
'ObjectName':objectName,
|
||||
'ApexClassName':ApexClassName,
|
||||
'store':component.get("v.store")
|
||||
})
|
||||
action.setCallback(this,function(response){
|
||||
result = response.getReturnValue();
|
||||
console.log('result--> '+result);
|
||||
if(result !== 'Queue' && result !== ''){
|
||||
|
||||
if(result.includes('Aborted')){
|
||||
var Errormessage = (result.replace("Aborted","")).trim();
|
||||
if(Errormessage.includes("-job") && Errormessage.includes("aborted") ){
|
||||
Errormessage = "Aborted by user or there was some system errors."
|
||||
}
|
||||
if(objectName == 'Account'|| objectName == 'contact'){
|
||||
component.set("v.objectname","customers");
|
||||
|
||||
}else if(objectName == 'Product2'|| objectName == 'HIC_ShopifySync__Variant__c'){
|
||||
component.set("v.objectname","Products and variants");
|
||||
|
||||
}else if(objectName == 'Order'|| objectName == 'Opportunity'){
|
||||
component.set("v.objectname","order and opportunities");
|
||||
|
||||
}else if(objectName == 'HIC_ShopifySync__Collection__c'|| objectName == 'HIC_ShopifySync__Collect__c'){
|
||||
component.set("v.objectname","collections");
|
||||
|
||||
}else if(objectName == 'HIC_ShopifySync__Location__c'|| objectName == 'HIC_ShopifySync__Inventory__c'){
|
||||
component.set("v.objectname","locations and inventories");
|
||||
}
|
||||
else if(objectName == 'Draftorder'){
|
||||
component.set("v.objectname","Draft order ");
|
||||
}
|
||||
component.set("v.Abortederrormessage",Errormessage);
|
||||
component.set("v.Batchaborted",true);
|
||||
component.set("v.Batchabortedbox",true);
|
||||
// window.clearInterval(component.get("v.setinterval"));
|
||||
this.AbortIntervalBatchAborted(component, event, helper);
|
||||
}else{
|
||||
if(objectName == 'Product2' && result != null && result != '' && result.includes("Completed")){
|
||||
component.set("v.ProductCount",(result.toString()).replace('Completed',''));
|
||||
component.set("v.ProductComplete",true);
|
||||
component.set("v.ProgessValue",5);
|
||||
$A.util.addClass(component.find('progesssbar'), 'ProgressProduct');
|
||||
this.AbortInterval(component, event, helper);
|
||||
}else if(objectName == 'Product2' && result != null && result != '' && !result.includes("Completed")){
|
||||
component.set("v.ProductCount",result.toString());
|
||||
}
|
||||
|
||||
if(objectName == 'HIC_ShopifySync__Variant__c' && result != null && result != '' && result.includes("Completed")){
|
||||
component.set("v.VarientCount",(result.toString()).replace('Completed',''));
|
||||
component.set("v.VarientComplete",true);
|
||||
$A.util.addClass(component.find('progesssbar'), 'ProgressVariant');
|
||||
component.set("v.ProgessValue",17);
|
||||
this.AbortInterval(component, event, helper);
|
||||
}else if(objectName == 'HIC_ShopifySync__Variant__c' && result != null && result != '' && !result.includes("Completed")){
|
||||
component.set("v.VarientCount",result.toString());
|
||||
}
|
||||
|
||||
if(objectName == 'Account' && result != null && result != '' && result.includes("Completed")){
|
||||
component.set("v.AccountCount",(result.toString()).replace('Completed',''));
|
||||
component.set("v.AccountComplete",true);
|
||||
$A.util.addClass(component.find('progesssbar'), 'ProgressAccount');
|
||||
component.set("v.ProgessValue",25);
|
||||
this.AbortInterval(component, event, helper);
|
||||
}else if(objectName == 'Account' && result != null && result != '' && !result.includes("Completed")){
|
||||
component.set("v.AccountCount",result.toString());
|
||||
}
|
||||
|
||||
if(objectName == 'Contact' && result != null && result != '' && result.includes("Completed")){
|
||||
component.set("v.ContactCount",(result.toString()).replace('Completed',''));
|
||||
component.set("v.ContactComplete",true);
|
||||
$A.util.addClass(component.find('progesssbar'), 'ProgressContact');
|
||||
component.set("v.ProgessValue",32);
|
||||
this.AbortInterval(component, event, helper);
|
||||
}else if(objectName == 'Contact' && result != null && result != '' && !result.includes("Completed")){
|
||||
component.set("v.ContactCount",result.toString());
|
||||
}
|
||||
|
||||
if(objectName == 'Order' && result != null && result != '' && result.includes("Completed")){
|
||||
component.set("v.OrderCount",(result.toString()).replace('Completed',''));
|
||||
component.set("v.OrderComplete",true);
|
||||
$A.util.addClass(component.find('progesssbar'), 'ProgressOrder');
|
||||
component.set("v.ProgessValue",39);
|
||||
this.AbortInterval(component, event, helper);
|
||||
}else if(objectName == 'Order' && result != null && result != '' && !result.includes("Completed")){
|
||||
component.set("v.OrderCount",result.toString());
|
||||
}
|
||||
|
||||
if(objectName == 'Opportunity' && result != null && result != '' && result.includes("Completed")){
|
||||
component.set("v.OppCount",(result.toString()).replace('Completed',''));
|
||||
component.set("v.OppComplete",true);
|
||||
$A.util.addClass(component.find('progesssbar'), 'ProgressOpp');
|
||||
component.set("v.ProgessValue",45);
|
||||
this.AbortInterval(component, event, helper);
|
||||
}else if(objectName == 'Opportunity' && result != null && result != '' && !result.includes("Completed")){
|
||||
component.set("v.OppCount",result.toString());
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(objectName == 'HIC_ShopifySync__Collection__c' && ApexClassName == 'FetchSmartCollection_Batch' && result != null && result != '' && result.includes("Completed")){
|
||||
component.set("v.SmartCount",(result.toString()).replace('Completed',''));
|
||||
component.set("v.SamartComplete",true);
|
||||
$A.util.addClass(component.find('progesssbar'), 'ProgressSmart');
|
||||
component.set("v.ProgessValue",48);
|
||||
this.AbortInterval(component, event, helper);
|
||||
}else if(objectName == 'HIC_ShopifySync__Collection__c' && ApexClassName == 'FetchSmartCollection_Batch' && result != null && result != '' && !result.includes("Completed")){
|
||||
component.set("v.SmartCount",result.toString());
|
||||
}
|
||||
|
||||
if(objectName == 'HIC_ShopifySync__Collection__c' && ApexClassName == 'FetchCollections_Batch' && result != null && result != '' && result.includes("Completed")){
|
||||
component.set("v.CustomCount",(result.toString()).replace('Completed',''));
|
||||
component.set("v.CustomComplete",true);
|
||||
$A.util.addClass(component.find('progesssbar'), 'ProgressCustom');
|
||||
component.set("v.ProgessValue",51);
|
||||
this.AbortInterval(component, event, helper);
|
||||
}else if(objectName == 'HIC_ShopifySync__Collection__c' && ApexClassName == 'FetchCollections_Batch' && result != null && result != '' && !result.includes("Completed")){
|
||||
component.set("v.CustomCount",result.toString());
|
||||
}
|
||||
|
||||
if(objectName == 'HIC_ShopifySync__Collect__c' && result != null && result != '' && result.includes("Completed")){
|
||||
component.set("v.CollectCount",(result.toString()).replace('Completed',''));
|
||||
component.set("v.CollectComplete",true);
|
||||
$A.util.addClass(component.find('progesssbar'), 'ProgressCollect');
|
||||
component.set("v.ProgessValue",70);
|
||||
this.AbortInterval(component, event, helper);
|
||||
}else if(objectName == 'HIC_ShopifySync__Collection__c' && result != null && result != '' && !result.includes("Completed")){
|
||||
component.set("v.CollectCount",result.toString());
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(objectName == 'HIC_ShopifySync__Location__c' && result != null && result != '' && result.includes("Completed")){
|
||||
component.set("v.LocationCount",(result.toString()).replace('Completed',''));
|
||||
component.set("v.LocationComplete",true);
|
||||
$A.util.addClass(component.find('progesssbar'), 'ProgressLocation');
|
||||
component.set("v.ProgessValue",81);
|
||||
this.AbortInterval(component, event, helper);
|
||||
}else if(objectName == 'HIC_ShopifySync__Location__c' && result != null && result != '' && !result.includes("Completed")){
|
||||
component.set("v.LocationCount",result.toString());
|
||||
}
|
||||
|
||||
if(objectName == 'HIC_ShopifySync__Inventory__c' && result != null && result != '' && result.includes("Completed")){
|
||||
component.set("v.InventoryCount",(result.toString()).replace('Completed',''));
|
||||
component.set("v.InventoryComplete",true);
|
||||
|
||||
$A.util.addClass(component.find('progesssbar'), 'ProgressInventory');
|
||||
component.set("v.ProgessValue",89);
|
||||
this.AbortInterval(component, event, helper);
|
||||
}else if(objectName == 'HIC_ShopifySync__Inventory__c' && result != null && result != '' && !result.includes("Completed")){
|
||||
component.set("v.InventoryCount",result.toString());
|
||||
}
|
||||
|
||||
if(objectName == 'Draftorder' && result != null && result != '' && result.includes("Completed")){
|
||||
component.set("v.DraftOrderCount",(result.toString()).replace('Completed',''));
|
||||
component.set("v.DraftOrderComplete",true);
|
||||
|
||||
$A.util.addClass(component.find('progesssbar'), 'ProgressDraft');
|
||||
component.set("v.ProgessValue",95);
|
||||
}else if(objectName == 'Draftorder' && result != null && result != '' && !result.includes("Completed")){
|
||||
component.set("v.DraftOrderCount",result.toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else if(result == '' || result == undefined){
|
||||
$A.util.addClass(component.find('progesssbar'), 'ProgressCompleted');
|
||||
component.set("v.ProgessValue",100);
|
||||
component.set("v.configObj.HIC_ShopifySync__Batch_Is_Processing__c",false);
|
||||
$A.util.addClass(component.find('ProgressMessageid'), 'StatusCompleted');
|
||||
component.set('v.ProgressMessage','Background setup finished');
|
||||
this.AbortInterval(component, event, helper);
|
||||
}
|
||||
|
||||
});
|
||||
if(component.get("v.Batchaborted") == false && component.get("v.Batchabortedbox") == false){
|
||||
if((component.get("v.IsBatchProcess") == 'true' || component.get("v.IsBatchProcess") == true ) && objectName != '' && ApexClassName != '' ){
|
||||
|
||||
$A.enqueueAction(action);
|
||||
|
||||
}else{
|
||||
$A.util.addClass(component.find('progesssbar'), 'ProgressCompleted');
|
||||
component.set("v.ProgessValue",100);
|
||||
component.set("v.configObj.HIC_ShopifySync__Batch_Is_Processing__c",false);
|
||||
$A.util.addClass(component.find('ProgressMessageid'), 'StatusCompleted');
|
||||
component.set('v.ProgressMessage','Background setup finished');
|
||||
this.AbortInterval(component, event, helper);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}catch(error){
|
||||
console.log('Error Message '+ error.message + ' '+error.name );
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
|
||||
AbortIntervalBatchAborted : function(component, event, helper) {
|
||||
/* console.log('Batch Abort Called');
|
||||
var batchabortedconfigupdate = component.get("c.batchabortedconfigupdate");
|
||||
batchabortedconfigupdate.setCallback(this,function(res){
|
||||
console.log('startfromthefirstpage action called');
|
||||
var state = res.getState();
|
||||
console.log('state'+ state);
|
||||
console.log('res.getReturnValue()'+ res.getReturnValue());
|
||||
if(state =="SUCCESS" && res.getReturnValue() == true ){
|
||||
console.log('AbortIntervalBatchAborted enterd' + component.get("v.setinterval"));
|
||||
var setinterval = component.get("v.setinterval");
|
||||
console.log('setinterval');
|
||||
window.clearInterval(setinterval);
|
||||
component.set("v.setinterval",1010101010010010);
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(batchabortedconfigupdate); */
|
||||
var setinterval = component.get("v.setinterval");
|
||||
window.clearInterval(setinterval);
|
||||
component.set("v.setinterval",1010101010010010);
|
||||
},
|
||||
|
||||
AbortInterval : function(component, event, helper) {
|
||||
/*var setinterval = component.get("v.setinterval");
|
||||
component.set("v.setinterval",1010101010010010);
|
||||
window.clearInterval(setinterval); */
|
||||
|
||||
/* if( component.get("v.VarientComplete") == 'false' || component.get("v.VarientComplete") == false || component.get("v.ContactComplete") == 'false' || component.get("v.InventoryComplete") == 'false' || component.get("v.InventoryComplete") == false || component.get("v.ContactComplete") == false || component.get("v.InventoryComplete") == 'false' || component.get("v.InventoryComplete") == false || component.get("v.DraftOrderComplete") == false || component.get("v.DraftOrderComplete") == 'false' ) {
|
||||
|
||||
|
||||
}
|
||||
if( ((component.get("v.VarientComplete") == 'false' || component.get("v.VarientComplete") == false) && ( component.get("v.configObj.HIC_ShopifySync__Product_Sync__c") == true || component.get("v.configObj.HIC_ShopifySync__Product_Sync__c") == 'true') ) || (( component.get("v.ContactComplete") == 'false' || component.get("v.ContactComplete") == false ) && ( component.get("v.configObj.HIC_ShopifySync__Customer_Sync__c") == true || component.get("v.configObj.HIC_ShopifySync__Customer_Sync__c") == 'true')) || ( ( component.get("v.InventoryComplete") == 'false' || component.get("v.InventoryComplete") == false) && ( component.get("v.configObj.HIC_ShopifySync__Inventory_Location_Sync__c") == true || component.get("v.configObj.HIC_ShopifySync__Inventory_Location_Sync__c") == 'true')) || (( component.get("v.DraftOrderComplete") == false || component.get("v.DraftOrderComplete") == 'false' ) && ( component.get("v.configObj.HIC_ShopifySync__Enable_Draft_Order__c") == true || component.get("v.configObj.HIC_ShopifySync__Enable_Draft_Order__c") == 'true') ) ){
|
||||
|
||||
}*/
|
||||
if(((component.get("v.ProductCount") == 'In Queue' || component.get("v.ProductComplete") == 'false' || component.get("v.ProductComplete") == false) && ( component.get("v.configObj.HIC_ShopifySync__Product_Sync__c") == true || component.get("v.configObj.HIC_ShopifySync__Product_Sync__c") == 'true')) || ((component.get("v.VarientCount") == 'In Queue' || component.get("v.VarientComplete") == 'false' || component.get("v.VarientComplete") == false) && (component.get("v.configObj.HIC_ShopifySync__Product_Sync__c") == true || component.get("v.configObj.HIC_ShopifySync__Product_Sync__c") == 'true')) || ((component.get("v.AccountCount") == 'In Queue' || component.get("v.AccountComplete") == 'false' || component.get("v.AccountComplete") == false) && ( component.get("v.configObj.HIC_ShopifySync__Customer_Sync__c") == true || component.get("v.configObj.HIC_ShopifySync__Customer_Sync__c") == 'true')) || ((component.get("v.ContactCount") == 'In Queue' || component.get("v.ContactComplete") == 'false' || component.get("v.ContactComplete") == false) && ( component.get("v.configObj.HIC_ShopifySync__Customer_Sync__c") == true || component.get("v.configObj.HIC_ShopifySync__Customer_Sync__c") == 'true')) || ((component.get("v.OrderCount") == 'In Queue' || component.get("v.OrderComplete") == 'false' || component.get("v.OrderComplete") == false) && ( component.get("v.configObj.HIC_ShopifySync__Order_Sync__c") == true || component.get("v.configObj.HIC_ShopifySync__Order_Sync__c") == 'true')) || ((component.get("v.OppCount") == 'In Queue' || component.get("v.OppComplete") == 'false' || component.get("v.OppComplete") == false) && ( component.get("v.configObj.HIC_ShopifySync__Opportunity__c") == true || component.get("v.configObj.HIC_ShopifySync__Opportunity__c") == 'true')) || ((component.get("v.SmartCount") == 'In Queue' || component.get("v.SamartComplete") == 'false' || component.get("v.SamartComplete") == false) && ( component.get("v.configObj.HIC_ShopifySync__Collection__c") == true || component.get("v.configObj.HIC_ShopifySync__Collection__c") == 'true')) || ((component.get("v.CustomCount") == 'In Queue' || component.get("v.CustomComplete") == 'false' || component.get("v.CustomComplete") == false) && ( component.get("v.configObj.HIC_ShopifySync__Collection__c") == true || component.get("v.configObj.HIC_ShopifySync__Collection__c") == 'true')) || ((component.get("v.CollectCount") == 'In Queue' || component.get("v.CollectComplete") == 'false' || component.get("v.CollectComplete") == false) && ( component.get("v.configObj.HIC_ShopifySync__Collection__c") == true || component.get("v.configObj.HIC_ShopifySync__Collection__c") == 'true')) || ((component.get("v.LocationCount") == 'In Queue' || component.get("v.LocationComplete") == 'false' || component.get("v.LocationComplete") == false) && ( component.get("v.configObj.HIC_ShopifySync__Inventory_Location_Sync__c") == true || component.get("v.configObj.HIC_ShopifySync__Inventory_Location_Sync__c") == 'true')) || ((component.get("v.InventoryCount") == 'In Queue' || component.get("v.InventoryComplete") == 'false' || component.get("v.InventoryComplete") == false) && ( component.get("v.configObj.HIC_ShopifySync__Inventory_Location_Sync__c") == true || component.get("v.configObj.HIC_ShopifySync__Inventory_Location_Sync__c") == 'true')) || ((component.get("v.DraftOrderCount") == 'In Queue' || component.get("v.DraftOrderComplete") == 'false' || component.get("v.DraftOrderComplete") == false) && ( component.get("v.configObj.HIC_ShopifySync__Enable_Draft_Order__c") == true || component.get("v.configObj.HIC_ShopifySync__Enable_Draft_Order__c") == 'true')) ){
|
||||
var setintervalabort = component.get("v.setinterval");
|
||||
window.clearInterval(setintervalabort);
|
||||
var dointcalled = component.get("c.doinit");
|
||||
$A.enqueueAction(dointcalled);
|
||||
// $A.get('e.force:refreshView').fire();
|
||||
}else{
|
||||
$A.util.addClass(component.find('progesssbar'), 'ProgressCompleted');
|
||||
component.set("v.ProgessValue",100);
|
||||
component.set("v.configObj.HIC_ShopifySync__Batch_Is_Processing__c",false);
|
||||
$A.util.addClass(component.find('ProgressMessageid'), 'StatusCompleted');
|
||||
component.set('v.ProgressMessage','Background setup finished');
|
||||
var setintervalabort = component.get("v.setinterval");
|
||||
try{
|
||||
window.clearInterval(setintervalabort);
|
||||
component.set("v.setinterval",1010101010010010);
|
||||
}catch(e){
|
||||
console.log('error');
|
||||
console.log(e);
|
||||
}
|
||||
}
|
||||
},
|
||||
getConfigurationData : function( component, event ) {
|
||||
|
||||
var action = component.get("c.getConfigration");
|
||||
|
||||
action.setCallback(this, function(response) {
|
||||
var state = response.getState();
|
||||
if (state === "SUCCESS" && response.getReturnValue() != null ) {
|
||||
var configObj = JSON.parse( response.getReturnValue() );
|
||||
component.set("v.configObj", configObj);
|
||||
|
||||
}
|
||||
else if (state === "INCOMPLETE") {
|
||||
console.log('configuration get error');
|
||||
}
|
||||
else if (state === "ERROR") {
|
||||
var errors = response.getError();
|
||||
if (errors) {
|
||||
if (errors[0] && errors[0].message) {
|
||||
console.log("Error message: " +
|
||||
errors[0].message);
|
||||
}
|
||||
} else {
|
||||
console.log("Unknown error");
|
||||
}
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(action);
|
||||
|
||||
}
|
||||
})
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
({
|
||||
// Your renderer method overrides go here
|
||||
rerender : function(cmp, helper){
|
||||
this.superRerender();
|
||||
// do custom rerendering here
|
||||
}
|
||||
})
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
<aura:event type="APPLICATION" description="Event template" >
|
||||
<aura:attribute name="Spinner" type="boolean" default="false"/>
|
||||
</aura:event>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||
<apiVersion>47.0</apiVersion>
|
||||
<description>A Lightning Component Bundle</description>
|
||||
</AuraDefinitionBundle>
|
||||
|
|
@ -0,0 +1 @@
|
|||
<aura:event type="APPLICATION" description="Event template" />
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||
<apiVersion>47.0</apiVersion>
|
||||
<description>A Lightning Component Bundle</description>
|
||||
</AuraDefinitionBundle>
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<aura:application access="GLOBAL" extends="ltng:outApp" >
|
||||
|
||||
<aura:dependency resource="c:ShopifyHeader"/>
|
||||
<aura:dependency resource="c:ConfiguarationCmp"/>
|
||||
<c:home></c:home>
|
||||
|
||||
</aura:application>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||
<apiVersion>44.0</apiVersion>
|
||||
<description>A Lightning Component Bundle</description>
|
||||
</AuraDefinitionBundle>
|
||||
|
|
@ -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>
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
.THIS {
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg width="120px" height="120px" viewBox="0 0 120 120" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<path d="M120,108 C120,114.6 114.6,120 108,120 L12,120 C5.4,120 0,114.6 0,108 L0,12 C0,5.4 5.4,0 12,0 L108,0 C114.6,0 120,5.4 120,12 L120,108 L120,108 Z" id="Shape" fill="#2A739E"/>
|
||||
<path d="M77.7383308,20 L61.1640113,20 L44.7300055,63.2000173 L56.0543288,63.2000173 L40,99.623291 L72.7458388,54.5871812 L60.907727,54.5871812 L77.7383308,20 Z" id="Path-1" fill="#FFFFFF"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 661 B |
|
|
@ -0,0 +1,5 @@
|
|||
({
|
||||
myAction : function(component, event, helper) {
|
||||
|
||||
}
|
||||
})
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
({
|
||||
helperMethod : function() {
|
||||
|
||||
}
|
||||
})
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
({
|
||||
// Your renderer method overrides go here
|
||||
})
|
||||
|
|
@ -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>
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||
<apiVersion>41.0</apiVersion>
|
||||
<description>A Lightning Component Bundle</description>
|
||||
</AuraDefinitionBundle>
|
||||
|
|
@ -0,0 +1,262 @@
|
|||
.THIS .topText textarea {
|
||||
border-color: #0070d2;
|
||||
height:9em;
|
||||
}
|
||||
|
||||
.THIS .slds-gutters{
|
||||
margin-right: 0px !important;
|
||||
margin-left: 0px !important;
|
||||
}
|
||||
.THIS .Hidediv{
|
||||
display: none !important;
|
||||
}
|
||||
.THIS .disablediv{
|
||||
pointer-events: none !important;
|
||||
}
|
||||
|
||||
|
||||
.THIS .centered {
|
||||
top: 40%;
|
||||
left: 40%;
|
||||
margin-top: -50px;
|
||||
margin-left: -100px;
|
||||
}
|
||||
|
||||
.THIS .row > .column {
|
||||
padding: 0 8px;
|
||||
}
|
||||
|
||||
.THIS .row:after {
|
||||
content: "";
|
||||
display: table;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
/* Create four equal columns that floats next to eachother */
|
||||
.THIS .column {
|
||||
float: left;
|
||||
width: 25%;
|
||||
}
|
||||
|
||||
/* The Modal (background) */
|
||||
.THIS .modal {
|
||||
display: none;
|
||||
position: fixed;
|
||||
z-index: 1;
|
||||
padding-top: 100px;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
background-color: black;
|
||||
}
|
||||
|
||||
/* Modal Content */
|
||||
.THIS .modal-content {
|
||||
position: relative;
|
||||
background-color: #fefefe;
|
||||
margin: auto;
|
||||
padding: 0;
|
||||
width: 90%;
|
||||
max-width: 1200px;
|
||||
}
|
||||
|
||||
/* The Close Button */
|
||||
.THIS .close {
|
||||
color: white;
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 25px;
|
||||
font-size: 35px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.THIS .close:hover,
|
||||
.THIS .close:focus {
|
||||
color: #999;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* Hide the slides by default */
|
||||
.THIS .mySlides {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Next & previous buttons */
|
||||
.THIS .prev,
|
||||
.THIS .next {
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
width: auto;
|
||||
padding: 16px;
|
||||
margin-top: -50px;
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
font-size: 20px;
|
||||
transition: 0.6s ease;
|
||||
border-radius: 0 3px 3px 0;
|
||||
user-select: none;
|
||||
-webkit-user-select: none;
|
||||
}
|
||||
|
||||
/* Position the "next button" to the right */
|
||||
.THIS .next {
|
||||
right: 0;
|
||||
border-radius: 3px 0 0 3px;
|
||||
}
|
||||
|
||||
/* On hover, add a black background color with a little bit see-through */
|
||||
.THIS.prev:hover,
|
||||
.THIS.next:hover {
|
||||
background-color: rgba(0, 0, 0, 0.8);
|
||||
}
|
||||
|
||||
/* Number text (1/3 etc) */
|
||||
.THIS.numbertext {
|
||||
color: #f2f2f2;
|
||||
font-size: 12px;
|
||||
padding: 8px 12px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
/* Caption text */
|
||||
.THIS.caption-container {
|
||||
text-align: center;
|
||||
background-color: black;
|
||||
padding: 2px 16px;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.THIS img.demo {
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.THIS .active,
|
||||
.THIS .demo:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.THIS img.hover-shadow {
|
||||
transition: 0.3s;
|
||||
}
|
||||
|
||||
.THIS .hover-shadow:hover {
|
||||
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**************************/
|
||||
|
||||
.THIS fieldsetstyle{
|
||||
margin-right: 178px !important;
|
||||
}
|
||||
.THIS .iconstyles{
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.THIS .iconstyles svg{
|
||||
fill : white !important;
|
||||
background :#087ade;
|
||||
|
||||
}
|
||||
|
||||
.THIS .iconstyles2 svg{
|
||||
fill : white !important;
|
||||
background :red;
|
||||
|
||||
}
|
||||
|
||||
.THIS .RealtimeSyncStyle svg{
|
||||
height : 20px !important;
|
||||
}
|
||||
|
||||
.THIS.toggle {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.THIS .InfoStyle{
|
||||
height : 50em !important;
|
||||
|
||||
}
|
||||
|
||||
.THIS .Pricebookcsss{
|
||||
border: solid thin;
|
||||
border-color: red;
|
||||
}
|
||||
.THIS .DisplayHelptext{
|
||||
display:block !important;
|
||||
}
|
||||
|
||||
.THIS .HideHelpText{
|
||||
display:none !important;
|
||||
}
|
||||
|
||||
|
||||
.THIS .tooltip {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
margin-top: 154%;
|
||||
margin-left: 28%;
|
||||
}
|
||||
|
||||
|
||||
.THIS .Errorboxtooltip {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
margin-top: 0% !Important;
|
||||
margin-left: 0% !Important;
|
||||
}
|
||||
.THIS .Errorboxtooltip .Errorboxtooltiptext {
|
||||
word-break: break-all;
|
||||
visibility: hidden;
|
||||
width: 2000%;
|
||||
height: auto;
|
||||
background-color: #0a4558;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
border-radius: 6px;
|
||||
padding: 5px 5px;
|
||||
|
||||
/*********toottip***/
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
top: -5px;
|
||||
left: -1500%;
|
||||
}
|
||||
|
||||
|
||||
.THIS .tooltip .tooltiptext {
|
||||
word-break: break-all;
|
||||
visibility: hidden;
|
||||
width: 2000%;
|
||||
height: auto;
|
||||
background-color: #0a4558;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
border-radius: 6px;
|
||||
padding: 5px 5px;
|
||||
|
||||
/*********toottip***/
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
top: -5px;
|
||||
left: 105%;
|
||||
}
|
||||
|
||||
.THIS .Errorboxtooltip:hover .Errorboxtooltiptext {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.THIS .tooltip:hover .tooltiptext {
|
||||
visibility: visible;
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
<design:component>
|
||||
|
||||
</design:component>
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg width="120px" height="120px" viewBox="0 0 120 120" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<path d="M120,108 C120,114.6 114.6,120 108,120 L12,120 C5.4,120 0,114.6 0,108 L0,12 C0,5.4 5.4,0 12,0 L108,0 C114.6,0 120,5.4 120,12 L120,108 L120,108 Z" id="Shape" fill="#2A739E"/>
|
||||
<path d="M77.7383308,20 L61.1640113,20 L44.7300055,63.2000173 L56.0543288,63.2000173 L40,99.623291 L72.7458388,54.5871812 L60.907727,54.5871812 L77.7383308,20 Z" id="Path-1" fill="#FFFFFF"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 661 B |
|
|
@ -0,0 +1,995 @@
|
|||
({
|
||||
selectStep:function(component, event, helper) {
|
||||
var value = event.getSource().get("v.value");
|
||||
var currentStep = component.get("v.currentStep");
|
||||
var processForNewStore = component.get("v.processForNewStore");
|
||||
if(!processForNewStore && value != currentStep && currentStep != 'Finised'){
|
||||
if(value == 'Authenticate'){
|
||||
component.set("v.currentStep", "Authenticate");
|
||||
$A.createComponent("c:AuthenticateOrg" , {
|
||||
"aura:id": "AuthenticateOrg",
|
||||
"hasError": component.get("v.hasError"),
|
||||
"siteurlparent": component.get("v.configObj.HIC_ShopifySync__Salesforce_Site_URL__c"),
|
||||
"Refreshtoken": component.get("v.configObj.HIC_ShopifySync__Refresh_Token__c")},
|
||||
function(newButton, status, errorMessage){
|
||||
component.set("v.body", newButton);
|
||||
component.set("v.mainBoolean" , true );
|
||||
|
||||
});
|
||||
}
|
||||
else if(value == 'step1'){
|
||||
var action = component.get("c.selectFromHeaderStep1");
|
||||
$A.enqueueAction(action);
|
||||
}
|
||||
else if(value == 'step2'){
|
||||
var action = component.get("c.selectFromHeaderStep2");
|
||||
$A.enqueueAction(action);
|
||||
}
|
||||
if(value == 'step3'){
|
||||
var action = component.get("c.selectFromHeaderStep3");
|
||||
$A.enqueueAction(action);
|
||||
}
|
||||
else if(value == 'step4'){
|
||||
var action = component.get("c.selectFromHeaderStep4");
|
||||
$A.enqueueAction(action);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
authorizeStore:function(component, event, helper) {
|
||||
var config = component.get("v.configObj");
|
||||
//console.log($A.get("$SObjectType.CurrentUser.Email"));
|
||||
//console.log(component.get("v.UserName"));
|
||||
if(config.HIC_ShopifySync__Shopify_URL__c != null && config.HIC_ShopifySync__Salesforce_Site_URL__c){
|
||||
var url = 'https://connectmadeasy.com/token?shop_domain='+config.HIC_ShopifySync__Shopify_URL__c+'&sf_token_endpoint='+config.HIC_ShopifySync__Salesforce_Site_URL__c+'/services/apexrest/HIC_ShopifySync/AuthenticateAllApexClass&user_name='+component.get("v.UserName")+'&user_email='+$A.get("$SObjectType.CurrentUser.Email");
|
||||
//console.log('url--',url);
|
||||
window.open(url);
|
||||
component.set("v.isAuthorized", true);
|
||||
component.set("v.authDone", false);
|
||||
}
|
||||
},
|
||||
|
||||
refreshConfig:function(component, event, helper) {
|
||||
helper.checkStoreToken( component, event );
|
||||
},
|
||||
|
||||
hideModel: function(component, event, helper) {
|
||||
component.set("v.showWarning", false);
|
||||
},
|
||||
|
||||
saveDetails: function(component, event, helper) {
|
||||
component.set("v.showWarning", false);
|
||||
component.set("v.openstoreselection", true);
|
||||
},
|
||||
saveDetails2: function(component, event, helper) {
|
||||
component.set("v.showProcessing", false);
|
||||
},
|
||||
ContactSupport : function(component, event, helper) {
|
||||
try{
|
||||
var action = component.get('c.Checkemaildeliverability');
|
||||
action.setCallback(this,function(response){
|
||||
if(response.getState() =="SUCCESS" && response.getReturnValue() !=null){
|
||||
var EmailDeliverbility = response.getReturnValue();
|
||||
if(EmailDeliverbility == true || EmailDeliverbility == 'true' || EmailDeliverbility == 'true'){
|
||||
component.set("v.OpenMode2",EmailDeliverbility);
|
||||
component.set("v.ShowForm",EmailDeliverbility);
|
||||
}else{
|
||||
window.open('mailto:support@syncmadeasy.com?Subject='+component.get("v.OrgID"),'_Top');
|
||||
}
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(action);
|
||||
}catch(e){
|
||||
console.log(e);
|
||||
}
|
||||
},
|
||||
closeModel2 : function(component,event, helper){
|
||||
component.set("v.OpenMode2",false);
|
||||
|
||||
},
|
||||
|
||||
onSubmit : function(component,event, helper){
|
||||
|
||||
var valid = false;
|
||||
if(component.find('issuevalue').get("v.value") === undefined || component.find('issuevalue').get("v.value") == ''|| component.find('issuevalue').get("v.value") == null){
|
||||
component.find("issuevalue").showHelpMessageIfInvalid();
|
||||
}else{
|
||||
valid = true;
|
||||
}
|
||||
|
||||
if(valid ){
|
||||
|
||||
var action = component.get('c.SendingMailtoShopifySupport');
|
||||
action.setParams({
|
||||
"Issue":component.get("v.Issue")
|
||||
});
|
||||
action.setCallback(this,function(response){
|
||||
var returnvalue1 = response.getReturnValue();
|
||||
|
||||
if(response.getState() == 'SUCCESS' && returnvalue1 != null ){
|
||||
component.set("v.SendingMail",returnvalue1);
|
||||
component.set("v.ShowForm",false);
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(action);
|
||||
component.set("v.Issue",null);
|
||||
//component.set("v.OpenModel",false);
|
||||
}
|
||||
},
|
||||
PerformAction : function(component, event, helper) {
|
||||
|
||||
//console.log('Batch progress');
|
||||
//console.log(component.get("v.configObj.HIC_ShopifySync__Batch_Is_Processing__c"));
|
||||
var batchProcessing = component.get("v.configObj.HIC_ShopifySync__Batch_Is_Processing__c");
|
||||
if(batchProcessing){
|
||||
component.set("v.showProcessing",true);
|
||||
}else{
|
||||
component.set("v.showWarning",true);
|
||||
}
|
||||
},
|
||||
closeModal:function(component,event,helper){
|
||||
var cmpTarget = component.find('editDialog');
|
||||
var cmpBack = component.find('overlay');
|
||||
$A.util.removeClass(cmpBack,'slds-backdrop--open');
|
||||
$A.util.removeClass(cmpTarget, 'slds-fade-in-open');
|
||||
component.set('v.openstoreselection',false);
|
||||
|
||||
},
|
||||
selectastore : function(component, event, helper){
|
||||
//var sourceValue = event.getSource();
|
||||
//console.log(sourceValue);
|
||||
|
||||
var cStep = component.get("v.currentStep");
|
||||
if(cStep != 'step1'){
|
||||
component.set("v.OldPricebook" , component.get("v.configObj.HIC_ShopifySync__Salesforce_Pricebook__c") );
|
||||
component.set("v.OldCurrencyISOCode" , component.get("v.CurrencyISOCode") );
|
||||
component.set("v.currentStep", "step1");
|
||||
component.set("v.mainBoolean" , false );
|
||||
component.set("v.DisableButton" , false );
|
||||
}
|
||||
var objectValue = event.getSource().get("v.name");
|
||||
// console.log('Select Store Called--> ');
|
||||
// console.log(JSON.stringify(objectValue));
|
||||
component.set("v.configObj",objectValue);
|
||||
//component.set("v.storeConfiguration", true);
|
||||
//component.set("v.storedusername",objectValue.HIC_ShopifySync__API_Key__c);
|
||||
component.set("v.storedpassword", objectValue.HIC_ShopifySync__Private_Key_Password__c);
|
||||
component.set("v.OldPricebook",objectValue.HIC_ShopifySync__Salesforce_Pricebook__c);
|
||||
component.set("v.processForNewStore",false);
|
||||
var cmpTarget = component.find('editDialog');
|
||||
var cmpBack = component.find('overlay');
|
||||
$A.util.removeClass(cmpBack,'slds-backdrop--open');
|
||||
$A.util.removeClass(cmpTarget, 'slds-fade-in-open');
|
||||
component.set('v.openstoreselection',false);
|
||||
|
||||
/* Added UV */
|
||||
// if(component.get("v.configObj.HIC_ShopifySync__Refresh_Token__c ") != null && component.get("v.configObj.HIC_ShopifySync__Refresh_Token__c ") != '' && component.get("v.configObj.HIC_ShopifySync__Refresh_Token__c ") != undefined){
|
||||
// component.set("v.currentStep","step1");
|
||||
// }
|
||||
|
||||
// if(component.get("v.configObj.HIC_ShopifySync__Batch_Is_Processing__c") == true)
|
||||
// {
|
||||
// component.set("v.currentStep",'Finised');
|
||||
// }
|
||||
|
||||
},
|
||||
|
||||
showAvailableStores : function(component, event, helper){
|
||||
|
||||
component.set("v.updateExistingStore", true);
|
||||
},
|
||||
|
||||
addNewStore : function(component, event, helper){
|
||||
var config = component.get("v.configObj");
|
||||
config.Id = null;
|
||||
config.HIC_ShopifySync__API_Key__c = null;
|
||||
config.HIC_ShopifySync__Private_Key_Password__c = null;
|
||||
config.HIC_ShopifySync__Shopify_URL__c = null;
|
||||
config.HIC_ShopifySync__Store__c = null;
|
||||
config.Name = null;
|
||||
|
||||
//console.log(JSON.stringify(config));
|
||||
component.set("v.configObj",config);
|
||||
//component.set("v.storeConfiguration", true);
|
||||
component.set("v.processForNewStore",true);
|
||||
helper.getConfigurations( component, event );
|
||||
var cmpTarget = component.find('editDialog');
|
||||
var cmpBack = component.find('overlay');
|
||||
$A.util.removeClass(cmpBack,'slds-backdrop--open');
|
||||
$A.util.removeClass(cmpTarget, 'slds-fade-in-open');
|
||||
component.set('v.openstoreselection',false);
|
||||
var cStep = component.get("v.currentStep");
|
||||
if(cStep != 'step1'){
|
||||
component.set("v.OldPricebook" , component.get("v.configObj.HIC_ShopifySync__Salesforce_Pricebook__c") );
|
||||
component.set("v.OldCurrencyISOCode" , component.get("v.CurrencyISOCode") );
|
||||
component.set("v.currentStep", "step1");
|
||||
component.set("v.mainBoolean" , false );
|
||||
component.set("v.DisableButton" , false );
|
||||
}
|
||||
},
|
||||
removeThisStore : function(component, event, helper){
|
||||
var cmpTarget = component.find('editDialog');
|
||||
var cmpBack = component.find('overlay');
|
||||
$A.util.removeClass(cmpBack,'slds-backdrop--open');
|
||||
$A.util.removeClass(cmpTarget, 'slds-fade-in-open');
|
||||
component.set('v.openstoreselection',false);
|
||||
|
||||
var objectValue = event.getSource().get("v.name");
|
||||
//console.log('Select Store Called--> ');
|
||||
//console.log(JSON.stringify(objectValue));
|
||||
var action = component.get("c.RemoveStore");
|
||||
action.setParams({ 'store' : objectValue});
|
||||
|
||||
action.setCallback(this, function(response) {
|
||||
|
||||
//console.log('removing configuration');
|
||||
var state = response.getState();
|
||||
//console.log(state);
|
||||
//console.log(response.getReturnValue());
|
||||
//console.log(state === "SUCCESS");
|
||||
if (state === "SUCCESS" && response.getReturnValue() != null ) {
|
||||
helper.getConfigurations( component, event );
|
||||
|
||||
}
|
||||
else if (state === "INCOMPLETE") {
|
||||
|
||||
}else if (state === "ERROR") {
|
||||
var errors = response.getError();
|
||||
if (errors) {
|
||||
if (errors[0] && errors[0].message) {
|
||||
console.log("Error message: " +
|
||||
errors[0].message);
|
||||
}
|
||||
} else {
|
||||
console.log("Unknown error");
|
||||
}
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(action);
|
||||
},
|
||||
|
||||
acceptagreement : function(component, event, helper){
|
||||
|
||||
var agreecheckbox = component.find("agreement").get("v.checked");
|
||||
|
||||
if(agreecheckbox == true){
|
||||
component.find("agreedbutton").set("v.disabled",false);
|
||||
}else{
|
||||
component.find("agreedbutton").set("v.disabled",true);
|
||||
}
|
||||
},
|
||||
closeagreementform : function(component, event, helper){
|
||||
component.set("v.OpenModel",false);
|
||||
// component.set("v.GoDisableButton",false);
|
||||
},
|
||||
oncurrencychange: function(component, event, helper){
|
||||
var currentvalue = event.getSource().get("v.value");
|
||||
}
|
||||
,
|
||||
gotocertificatepage: function(component, event, helper){
|
||||
window.open('/0P1','_blank');
|
||||
},
|
||||
|
||||
CloseSpinnerValue: function(component, event, helper){
|
||||
component.set("v.Spinner",false);
|
||||
document.getElementById("divparent").style.display = "block";
|
||||
document.getElementById("divparent").scrollTop = '0';
|
||||
document.getElementById("divparent").style.pointerEvents = "all";
|
||||
},
|
||||
SyncAuthenticatepage: function(component, event, helper){
|
||||
document.getElementById("divparent").style.display = "none";
|
||||
var action = component.get("c.doInit");
|
||||
component.set("v.Spinner", false);
|
||||
|
||||
component.set("v.isOpen", false);
|
||||
|
||||
$A.enqueueAction(action);
|
||||
},
|
||||
OpenSliderPopupFirst: function(component, event, helper){
|
||||
component.set("v.slidercurrentStep",1);
|
||||
component.set("v.OpenSlider",true);
|
||||
},
|
||||
|
||||
OpenSliderPopupSecond: function(component, event, helper){
|
||||
component.set("v.slidercurrentStep",2);
|
||||
component.set("v.OpenSlider",true);
|
||||
},
|
||||
|
||||
OpenSliderPopupthird: function(component, event, helper){
|
||||
component.set("v.slidercurrentStep",3);
|
||||
component.set("v.OpenSlider",true);
|
||||
},
|
||||
|
||||
openModal: function(component, event, helper){
|
||||
document.getElementById("myModal").style.display = "block";
|
||||
},
|
||||
|
||||
siteredirect: function(component, event, helper){
|
||||
var siteurl = component.get('v.configObj.HIC_ShopifySync__Salesforce_Site_URL__c');
|
||||
var sitelist = component.get("v.siteURLList");
|
||||
var siteid = '';
|
||||
for(var item in sitelist ){
|
||||
if(sitelist[item]['siteUrl'] == siteurl ){
|
||||
siteid = sitelist[item]['id'];
|
||||
|
||||
}
|
||||
}
|
||||
if(siteid != '' && siteid !== undefined && siteurl != '' && siteurl !== undefined ){
|
||||
window.open('/'+siteid,'_blank');
|
||||
}else{
|
||||
window.open('/0DM/o','_blank');
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
AuthenticateErrorEventHandler: function(component, event, helper) {
|
||||
var hasError = event.getParam("hasError");
|
||||
component.set("v.hasError",hasError);
|
||||
},
|
||||
|
||||
|
||||
|
||||
doInit: function(component, event, helper) {
|
||||
var uNaction = component.get("c.getUserName");
|
||||
uNaction.setCallback(this, function(response){
|
||||
var state = response.getState();
|
||||
if (state === "SUCCESS") {
|
||||
component.set("v.UserName", response.getReturnValue());
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(uNaction);
|
||||
|
||||
var action = component.get("c.getOrgId");
|
||||
action.setCallback(this,function(response){
|
||||
var returnvaue = response.getReturnValue();
|
||||
if(response.getState() == 'SUCCESS' && returnvaue != ''){
|
||||
component.set("v.OrgID",returnvaue);
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(action);
|
||||
// helper.AuthenticateRemoteSiteCreate(component, event, helper) ;
|
||||
helper.getSiteURLList( component, event );
|
||||
|
||||
|
||||
//helper.CheckingCertifiacte(component, event, helper);
|
||||
// helper.CheckSiteAccess(component, event, helper);
|
||||
var action = component.get("c.getUIThemeDescription");
|
||||
action.setCallback(this,function(res){
|
||||
var state = res.getState();
|
||||
if(state =="SUCCESS" && res.getReturnValue() != null ){
|
||||
component.set("v.viewmode",res.getReturnValue());
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(action);
|
||||
|
||||
component.set("v.Spinner",true);
|
||||
//document.getElementById("divparent").style.display = "none";
|
||||
var emaiList = component.get("v.emaiList");
|
||||
emaiList.push({
|
||||
"sobjectType": "HIC_ShopifySync__Email_Addresses_to_send_error_CSV__c",
|
||||
"errormailfrmt": false
|
||||
});
|
||||
|
||||
|
||||
try{
|
||||
helper.getPricebookList( component, event );
|
||||
helper.getConfigurationData( component, event );
|
||||
helper.getConfigurations( component, event );
|
||||
helper.getEmailErrorlist(component, event);
|
||||
|
||||
}catch(error){
|
||||
console.log('error when getting config data '+error);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
scriptsLoaded : function(component, event, helper) {
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
},
|
||||
|
||||
display : function(component, event, helper) {
|
||||
helper.toggleHelper(component, event);
|
||||
},
|
||||
|
||||
displayOut : function(component, event, helper) {
|
||||
helper.toggleHelper(component, event);
|
||||
},
|
||||
|
||||
|
||||
onFocus: function(component, event, helper){
|
||||
$A.util.addClass(component.find('helptextbody'), 'aria-described');
|
||||
$A.util.removeClass(component.find('helptextbody'), 'HideHelpText');
|
||||
},
|
||||
|
||||
onblur: function(component, event, helper){
|
||||
$A.util.addClass(component.find('helptextbody'), 'HideHelpText');
|
||||
$A.util.removeClass(component.find('helptextbody'), 'DisplayHelptext');
|
||||
},
|
||||
|
||||
openModel: function(component, event, helper) {
|
||||
// for Display Model,set the "isOpen" attribute to "True"
|
||||
component.set("v.isOpen", true);
|
||||
},
|
||||
|
||||
closeModel: function(component, event, helper) {
|
||||
// for Hide/Close Model,set the "isOpen" attribute to "False"
|
||||
document.getElementById("ErrorMessage").style.display = "none";
|
||||
component.set("v.isOpen", false);
|
||||
},
|
||||
gotoURL : function (component, event, helper) {
|
||||
var urlEvent = $A.get("e.force:navigateToURL");
|
||||
urlEvent.setParams({
|
||||
"url": "/apex/SalesforceAuthentication"
|
||||
});
|
||||
urlEvent.fire();
|
||||
},
|
||||
|
||||
selectFromHeaderStep1 : function(component,event,helper){
|
||||
component.set("v.currentStep", "step1");
|
||||
component.set("v.mainBoolean" , false );
|
||||
},
|
||||
|
||||
selectFromHeaderStep2 : function(component,event,helper){
|
||||
var configObj = component.get("v.configObj");
|
||||
configObj.HIC_ShopifySync__Store__c = (configObj.HIC_ShopifySync__Shopify_URL__c).replaceAll('https://','').replace('.myshopify.com','').replace('/','');
|
||||
document.getElementById("divparent").style.display = "none";
|
||||
component.set("v.currentStep", "step2");
|
||||
$A.createComponent("c:ConfiguarationGeneral" , {
|
||||
"aura:id": "ConfiguarationGeneral",
|
||||
"Spinner" : "true",
|
||||
"storeurl" : configObj.HIC_ShopifySync__Shopify_URL__c,
|
||||
"store" : configObj.HIC_ShopifySync__Store__c },
|
||||
function(newButton, status, errorMessage){
|
||||
component.set("v.body", newButton);
|
||||
component.set("v.mainBoolean" , true );
|
||||
component.set("v.Spinner",true);
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
|
||||
|
||||
selectFromHeaderStep3 : function(component,event,helper){
|
||||
component.set("v.currentStep", "step3");
|
||||
// component.set("v.Spinner",false);
|
||||
document.getElementById("divparent").style.display = "none";
|
||||
var configObj = component.get("v.configObj");
|
||||
// console.log('Congig values');
|
||||
// console.log( (configObj.HIC_ShopifySync__Shopify_URL__c).replaceAll('https://','').replaceAll('.myshopify.com','').replaceAll('/',''));
|
||||
$A.createComponent("c:dynamicRow" , {
|
||||
"aura:id": "dynamicRow",
|
||||
"processForNewStore": component.get("v.processForNewStore"),
|
||||
"store" : (configObj.HIC_ShopifySync__Shopify_URL__c).replaceAll('https://','').replaceAll('.myshopify.com','').replaceAll('/','') },
|
||||
function(newButton, status, errorMessage){
|
||||
component.set("v.body", newButton);
|
||||
component.set("v.mainBoolean" , true );
|
||||
component.set("v.Spinner",true);
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
selectFromHeaderStep4 : function(component,event,helper){
|
||||
component.set("v.currentStep", "step4");
|
||||
document.getElementById("divparent").style.display = "none";
|
||||
var configObj = component.get("v.configObj");
|
||||
$A.createComponent("c:ConfiguarationRecordTypeMapping" , {
|
||||
"aura:id": "ConfiguarationRecordTypeMapping",
|
||||
"store" : (configObj.HIC_ShopifySync__Shopify_URL__c).replaceAll('https://','').replaceAll('.myshopify.com','').replaceAll('/','') },
|
||||
function(newButton, status, errorMessage){
|
||||
component.set("v.body", newButton);
|
||||
component.set("v.mainBoolean" , true );
|
||||
component.set("v.Spinner",true);
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
|
||||
|
||||
|
||||
// function for create new object Row in Contact List
|
||||
addNewRow: function(component, event, helper) {
|
||||
// call the comman "createObjectData" helper method for add new Object Row to List
|
||||
helper.createObjectData(component, event);
|
||||
},
|
||||
|
||||
// function for delete the row
|
||||
removeDeletedRow: function(component, event, helper) {
|
||||
// get the selected row Index for delete, from Lightning Event Attribute
|
||||
var index = event.getParam("indexVar");
|
||||
//console.log('index--> '+index);
|
||||
// get the all List (contactList attribute) and remove the Object Element Using splice method
|
||||
if(index != null && index != '' && index !== "undefined" ){
|
||||
|
||||
var AllRowsList = component.get("v.emaiList");
|
||||
AllRowsList.splice(index, 1);
|
||||
// set the contactList after remove selected row element
|
||||
component.set("v.emaiList", AllRowsList);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
gonextbutton: function(component, event, helper) {
|
||||
|
||||
var IsChanged = false;
|
||||
var WarringMessage = [];
|
||||
var oldvalueofcurrency = component.get("v.OldCurrencyISOCode");
|
||||
var currentcurrency = component.get("v.CurrencyISOCode");
|
||||
var currenctpricebook = component.get("v.configObj.HIC_ShopifySync__Salesforce_Pricebook__c")
|
||||
var oldcurrencypricebook = component.get("v.OldPricebook");
|
||||
|
||||
if(oldvalueofcurrency != currentcurrency && oldvalueofcurrency != null && oldvalueofcurrency != '' && oldvalueofcurrency != undefined){
|
||||
IsChanged = true;
|
||||
if(!WarringMessage.includes('You have changed currency.')){
|
||||
WarringMessage.push('You have changed currency.');
|
||||
}
|
||||
}else{
|
||||
|
||||
if(WarringMessage.includes('You have changed Currency.')){
|
||||
WarringMessage.pop('You have changed Currency.');
|
||||
}
|
||||
}
|
||||
|
||||
if(oldcurrencypricebook !== currenctpricebook && oldcurrencypricebook != '' & oldcurrencypricebook != null && oldcurrencypricebook != undefined){
|
||||
IsChanged = true;
|
||||
if(!WarringMessage.includes('You have changed Pricebook.')){
|
||||
WarringMessage.push('You have changed Pricebook.');
|
||||
}
|
||||
}else{
|
||||
|
||||
if(WarringMessage.includes('You have changed Pricebook.')){
|
||||
WarringMessage.pop('You have changed Pricebook.');
|
||||
}
|
||||
}
|
||||
component.set("v.IsChanged",IsChanged);
|
||||
|
||||
if( (IsChanged && component.get('v.configObj.HIC_ShopifySync__BatchRunOnce__c')) || component.get('v.configObj.HIC_ShopifySync__IsCurrencyChanged__c') ){
|
||||
|
||||
component.set("v.OpenModel",true);
|
||||
component.set("v.warrningmessage",WarringMessage);
|
||||
|
||||
}else{
|
||||
var action = component.get("c.validationCheck");
|
||||
$A.enqueueAction(action);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
validationCheck:function(component, event, helper) {
|
||||
|
||||
component.set("v.OpenModel",false);
|
||||
document.getElementById("divparent").style.pointerEvents = "none";
|
||||
component.set("v.DisableButton",true);
|
||||
component.set("v.Spinner",true);
|
||||
document.getElementById("divparent").style.display = "none";
|
||||
var valid = true;
|
||||
|
||||
|
||||
/* if(component.find('Pricebook').get("v.value") !== undefined && component.find('Pricebook').get("v.value") != '' && component.find('selectItem').get("v.value") !== undefined && component.find('selectItem').get("v.value") != ''){
|
||||
valid = true;
|
||||
}else if((component.find('Pricebook').get("v.value") === undefined || component.find('Pricebook').get("v.value") == '') && (component.find('selectItem').get("v.value") === undefined || component.find('selectItem').get("v.value") == '')){
|
||||
$A.util.addClass(component.find('Pricebook'), 'Pricebookcsss');
|
||||
$A.util.addClass(component.find('selectItem'), 'Pricebookcsss');
|
||||
}else if(component.find('Pricebook').get("v.value") === undefined || component.find('Pricebook').get("v.value") == ''){
|
||||
$A.util.addClass(component.find('Pricebook'), 'Pricebookcsss');
|
||||
}else if(component.find('selectItem').get("v.value") === undefined || component.find('selectItem').get("v.value") == ''){
|
||||
$A.util.addClass(component.find('selectItem'), 'Pricebookcsss');
|
||||
}*/
|
||||
|
||||
if(component.find('Pricebook').get("v.value") === undefined || component.find('Pricebook').get("v.value") == ''){
|
||||
valid = false;
|
||||
$A.util.addClass(component.find('Pricebook'), 'Pricebookcsss');
|
||||
}else{
|
||||
$A.util.removeClass(component.find('Pricebook'), 'Pricebookcsss');
|
||||
}
|
||||
if(component.find('selectItem').get("v.value") === undefined || component.find('selectItem').get("v.value") == ''){
|
||||
valid = false;
|
||||
$A.util.addClass(component.find('selectItem'), 'Pricebookcsss');
|
||||
}else{
|
||||
$A.util.removeClass(component.find('selectItem'), 'Pricebookcsss');
|
||||
}
|
||||
if(component.find('StoreURL').get("v.value") === undefined || component.find('StoreURL').get("v.value") == ''){
|
||||
valid = false;
|
||||
$A.util.addClass(component.find('StoreURL'), 'Pricebookcsss');
|
||||
}else{
|
||||
$A.util.removeClass(component.find('StoreURL'), 'Pricebookcsss');
|
||||
}
|
||||
/*if(component.find('Shopifyid').get("v.value") === undefined || component.find('Shopifyid').get("v.value") == ''){
|
||||
valid = false;
|
||||
$A.util.addClass(component.find('Shopifyid'), 'Pricebookcsss');
|
||||
}else{
|
||||
$A.util.removeClass(component.find('Shopifyid'), 'Pricebookcsss');
|
||||
}*/
|
||||
if(component.find('secret').get("v.value") === undefined || component.find('secret').get("v.value") == ''){
|
||||
valid = false;
|
||||
$A.util.addClass(component.find('secret'), 'Pricebookcsss');
|
||||
}else{
|
||||
$A.util.removeClass(component.find('secret'), 'Pricebookcsss');
|
||||
}
|
||||
if(!valid){
|
||||
//alert('please select pricebook and site');
|
||||
component.set("v.DisableButton",false);
|
||||
|
||||
// $A.util.addClass(component.find('ErrorMessage'), 'slds-show');
|
||||
document.getElementById("ErrorMessage").style.display = "block";
|
||||
|
||||
|
||||
/*component.find('notifLib').showNotice({
|
||||
"variant": "error",
|
||||
"header": "Something has gone wrong!",
|
||||
"message": "Unfortunately, there was a problem updating the record.",
|
||||
closeCallback: function() {
|
||||
alert('You closed the alert!');
|
||||
}
|
||||
});*/
|
||||
|
||||
var action = component.get("c.openModel");
|
||||
component.set("v.Spinner", false);
|
||||
document.getElementById("divparent").style.display = "block";
|
||||
document.getElementById("divparent").style.pointerEvents = "all";
|
||||
document.getElementById("divparent").scrollTop = '0';
|
||||
//$A.enqueueAction(action);
|
||||
}else{
|
||||
// first call the helper function in if block which will return true or false.
|
||||
// this helper function check the "first Name" will not be blank on each row.
|
||||
if (helper.validateRequired(component, event)) {
|
||||
//if (component.find("child").ErrorMaillist()) {
|
||||
// call the apex class method for save the Contact Lis=
|
||||
// with pass the contact List attribute to method param.
|
||||
var action = component.get("c.saveEmailSettings");
|
||||
action.setParams({
|
||||
"emaiList": JSON.stringify(component.get("v.emaiList"))
|
||||
});
|
||||
// set call back
|
||||
action.setCallback(this, function(response) {
|
||||
var state = response.getState();
|
||||
if (state === "SUCCESS") {
|
||||
// if response if success then reset/blank the 'contactList' Attribute
|
||||
// and call the common helper method for create a default Object Data to Contact List
|
||||
//component.set("v.emaiList", []);
|
||||
//helper.createObjectData(component, event);
|
||||
//alert('record Save');
|
||||
//goNext(component, event, helper);
|
||||
component.set("v.spinner",true);
|
||||
helper.checksiteaccess(component, event, helper);
|
||||
}
|
||||
});
|
||||
// enqueue the server side action
|
||||
$A.enqueueAction(action);
|
||||
}else{
|
||||
component.set("v.DisableButton",false);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
},
|
||||
|
||||
|
||||
checkAccess: function(component, event, helper){
|
||||
var name = event.getSource().get("v.name");
|
||||
if(component.get("v.AccessScopeError") != null && component.get("v.AccessScopeError").includes(name)){
|
||||
alert('not Access scope for this'+ name);
|
||||
}
|
||||
},
|
||||
goNext: function(component, event, helper) {
|
||||
|
||||
var cStep = component.get("v.currentStep");
|
||||
if(cStep == 'step1'){
|
||||
|
||||
var shopifyUrl = component.get("v.configObj").HIC_ShopifySync__Shopify_URL__c;
|
||||
var USER_NAME = component.get("v.configObj").HIC_ShopifySync__API_Key__c;
|
||||
var PASSWORD = component.get("v.configObj").HIC_ShopifySync__Private_Key_Password__c;
|
||||
|
||||
var action1 = component.get("c.checkCreds");
|
||||
|
||||
action1.setParams({ 'shopifyUrl' : shopifyUrl,
|
||||
'USER_NAME' : USER_NAME,
|
||||
'PASSWORD' : PASSWORD
|
||||
});
|
||||
|
||||
action1.setCallback(this, function(response) {
|
||||
var state = response.getState();
|
||||
if (state === "SUCCESS" ) {
|
||||
if(response.getReturnValue() === false){
|
||||
alert('Shopify Credentials are worng please check again');
|
||||
}else {
|
||||
var action = component.get("c.saveConfigration");
|
||||
action.setParams({ 'configObj' : JSON.stringify( component.get("v.configObj")),
|
||||
'check' : 'True'});
|
||||
|
||||
action.setCallback(this, function(response) {
|
||||
|
||||
var configObj = component.get("v.configObj");
|
||||
//console.log('configObj'+configObj.HIC_ShopifySync__Shopify_URL__c);
|
||||
//.replace('https://','').replace('.myshopify.com','').removeEnd('/')
|
||||
configObj.HIC_ShopifySync__Store__c = (configObj.HIC_ShopifySync__Shopify_URL__c).replaceAll('https://','').replace('.myshopify.com','').replace('/','');
|
||||
//console.log('Store step 1')
|
||||
// console.log(configObj.HIC_ShopifySync__Store__c);
|
||||
debugger;
|
||||
var state = response.getState();
|
||||
if (state === "SUCCESS" && response.getReturnValue() != null ) {
|
||||
document.getElementById("divparent").style.display = "none";
|
||||
component.set("v.currentStep", "step2");
|
||||
$A.createComponent("c:ConfiguarationGeneral" , {
|
||||
"aura:id": "ConfiguarationGeneral",
|
||||
"Spinner" : "true",
|
||||
"storeurl" : configObj.HIC_ShopifySync__Shopify_URL__c,
|
||||
"store" : configObj.HIC_ShopifySync__Store__c },
|
||||
function(newButton, status, errorMessage){
|
||||
component.set("v.body", newButton);
|
||||
component.set("v.mainBoolean" , true );
|
||||
component.set("v.Spinner",true);
|
||||
});
|
||||
|
||||
}
|
||||
else if (state === "INCOMPLETE") {
|
||||
|
||||
}else if (state === "ERROR") {
|
||||
var errors = response.getError();
|
||||
if (errors) {
|
||||
if (errors[0] && errors[0].message) {
|
||||
console.log("Error message: " +
|
||||
errors[0].message);
|
||||
}
|
||||
} else {
|
||||
console.log("Unknown error");
|
||||
}
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(action);
|
||||
var storename = (configObj.HIC_ShopifySync__Shopify_URL__c).replaceAll('https://','').replace('.myshopify.com','').replace('/','');
|
||||
|
||||
var pricebookId = configObj.HIC_ShopifySync__Salesforce_Pricebook__c;
|
||||
|
||||
var savePriceBookMapping = component.get("c.savePriceBookMapping");
|
||||
savePriceBookMapping.setParams({ 'storename' : storename,
|
||||
'pricebookId' : pricebookId});
|
||||
|
||||
savePriceBookMapping.setCallback(this, function(response) {
|
||||
var state = response.getState();
|
||||
if (state === "SUCCESS" && response.getReturnValue() != null ) {
|
||||
debugger;
|
||||
|
||||
|
||||
}
|
||||
else if (state === "INCOMPLETE") {
|
||||
|
||||
}else if (state === "ERROR") {
|
||||
var errors = response.getError();
|
||||
if (errors) {
|
||||
if (errors[0] && errors[0].message) {
|
||||
console.log("Error message: " +
|
||||
errors[0].message +" no. "+ errors[0].LineNumber);
|
||||
}
|
||||
} else {
|
||||
console.log("Unknown error");
|
||||
}
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(savePriceBookMapping);
|
||||
|
||||
}
|
||||
|
||||
}else{
|
||||
component.set("v.Spinner",false);
|
||||
document.getElementById("divparent").style.pointerEvents = "all";
|
||||
document.getElementById("divparent").style.display = "block";
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(action1);
|
||||
|
||||
}else if(cStep == 'step2'){
|
||||
component.set("v.currentStep", "step3");
|
||||
// component.set("v.Spinner",false);
|
||||
document.getElementById("divparent").style.display = "none";
|
||||
var configObj = component.get("v.configObj");
|
||||
// console.log('Congig values');
|
||||
// console.log( (configObj.HIC_ShopifySync__Shopify_URL__c).replaceAll('https://','').replaceAll('.myshopify.com','').replaceAll('/',''));
|
||||
$A.createComponent("c:dynamicRow" , {
|
||||
"aura:id": "dynamicRow",
|
||||
"processForNewStore": component.get("v.processForNewStore"),
|
||||
"store" : (configObj.HIC_ShopifySync__Shopify_URL__c).replaceAll('https://','').replaceAll('.myshopify.com','').replaceAll('/','') },
|
||||
function(newButton, status, errorMessage){
|
||||
component.set("v.body", newButton);
|
||||
component.set("v.mainBoolean" , true );
|
||||
component.set("v.Spinner",true);
|
||||
});
|
||||
|
||||
}else if(cStep == 'step3'){
|
||||
component.set("v.currentStep", "step4");
|
||||
// component.set("v.Spinner",false);
|
||||
document.getElementById("divparent").style.display = "none";
|
||||
var configObj = component.get("v.configObj");
|
||||
$A.createComponent("c:ConfiguarationRecordTypeMapping" , {
|
||||
"aura:id": "ConfiguarationRecordTypeMapping",
|
||||
"store" : (configObj.HIC_ShopifySync__Shopify_URL__c).replaceAll('https://','').replaceAll('.myshopify.com','').replaceAll('/','') },
|
||||
function(newButton, status, errorMessage){
|
||||
component.set("v.body", newButton);
|
||||
component.set("v.mainBoolean" , true );
|
||||
component.set("v.Spinner",true);
|
||||
});
|
||||
}else if(cStep == 'step4'){
|
||||
// component.set("v.currentStep", "step5");
|
||||
|
||||
component.set("v.Spinner",false);
|
||||
component.set("v.currentStep", "Finised");
|
||||
document.getElementById("divparent").style.pointerEvents = "all";
|
||||
document.getElementById("divparent").style.display = "block";
|
||||
/*$A.createComponent("c:configurationSetting" , {
|
||||
"aura:id": "configurationSetting" },
|
||||
function(newButton, status, errorMessage){
|
||||
console.log(status);
|
||||
console.log(errorMessage);
|
||||
component.set("v.body", newButton);
|
||||
component.set("v.mainBoolean" , true );
|
||||
|
||||
}); */
|
||||
var configObj = component.get("v.configObj");
|
||||
component.set("v.store",(configObj.HIC_ShopifySync__Shopify_URL__c).replaceAll('https://','').replaceAll('.myshopify.com','').replaceAll('/',''));
|
||||
|
||||
var SaveBatchisProsseTrueAction = component.get("c.syncShopify");
|
||||
SaveBatchisProsseTrueAction.setParams({"store": (configObj.HIC_ShopifySync__Shopify_URL__c).replaceAll('https://','').replaceAll('.myshopify.com','').replaceAll('/','') });
|
||||
SaveBatchisProsseTrueAction.setCallback(this, function(responseUpdateConfig) {
|
||||
var stateUpdateConfig = responseUpdateConfig.getState();
|
||||
if (stateUpdateConfig === "SUCCESS"){
|
||||
|
||||
/*var action = component.get("c.getConfigration");
|
||||
console.log('Store-->config');
|
||||
console.log( component.get("v.store"));
|
||||
|
||||
|
||||
|
||||
|
||||
action.setCallback(this, function(response) {
|
||||
var state = response.getState();
|
||||
if (state === "SUCCESS" && response.getReturnValue() != null ) {
|
||||
|
||||
|
||||
|
||||
var configObj = JSON.parse( response.getReturnValue() );
|
||||
component.set("v.configObj", configObj);
|
||||
|
||||
component.set("v.configObj.HIC_ShopifySync__Batch_Is_Processing__c",true);
|
||||
component.set("v.mainBoolean" , false );
|
||||
try{
|
||||
var cmpEvent = $A.get("e.c:updateStoreValue");
|
||||
cmpEvent.setParams({
|
||||
"store" : component.get("v.store") })
|
||||
cmpEvent.fire();
|
||||
}catch(e){
|
||||
console.log('error --> update store event '+e);
|
||||
}
|
||||
}
|
||||
else if (state === "INCOMPLETE") {
|
||||
console.log('configuration get error');
|
||||
}
|
||||
else if (state === "ERROR") {
|
||||
var errors = response.getError();
|
||||
if (errors) {
|
||||
if (errors[0] && errors[0].message) {
|
||||
console.log("Error message: " +
|
||||
errors[0].message);
|
||||
}
|
||||
} else {
|
||||
console.log("Unknown error");
|
||||
}
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(action);*/
|
||||
// alert('Process has started in the background.');
|
||||
component.set("v.configObj.HIC_ShopifySync__Batch_Is_Processing__c",true);
|
||||
component.set("v.mainBoolean" , false );
|
||||
try{
|
||||
var cmpEvent = $A.get("e.c:updateStoreValue");
|
||||
cmpEvent.setParams({
|
||||
"store" : component.get("v.store") })
|
||||
cmpEvent.fire();
|
||||
}catch(e){
|
||||
console.log('error --> update store event '+e);
|
||||
}
|
||||
}else{
|
||||
|
||||
// alert('We have hit some error. Please Contact Admin.');
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(SaveBatchisProsseTrueAction);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}else if(cStep == 'step5'){
|
||||
/*var action = component.get("c.getConfigration");
|
||||
|
||||
action.setCallback(this, function(response) {
|
||||
var state = response.getState();
|
||||
if (state === "SUCCESS" && response.getReturnValue() != null ) {
|
||||
var configObj = JSON.parse( response.getReturnValue() );
|
||||
component.set("v.configObj", configObj);
|
||||
component.set("v.configObj.HIC_ShopifySync__Batch_Is_Processing__c",true);
|
||||
}
|
||||
else if (state === "INCOMPLETE") {
|
||||
console.log('configuration get error');
|
||||
}
|
||||
else if (state === "ERROR") {
|
||||
var errors = response.getError();
|
||||
if (errors) {
|
||||
if (errors[0] && errors[0].message) {
|
||||
console.log("Error message: " +
|
||||
errors[0].message);
|
||||
}
|
||||
} else {
|
||||
console.log("Unknown error");
|
||||
}
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(action);
|
||||
*/
|
||||
component.set("v.configObj.HIC_ShopifySync__Batch_Is_Processing__c",true);
|
||||
// console.log('configure debugging');
|
||||
// console.log(component.get("v.configObj"));
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
|
||||
goPrev: function(component, event, helper) {
|
||||
var configObj = component.get("v.configObj");
|
||||
component.set("v.DisableButton",false);
|
||||
var cStep = component.get("v.currentStep");
|
||||
if(cStep == 'step3'){
|
||||
var configObj = component.get("v.configObj");
|
||||
component.set("v.currentStep", "step2");
|
||||
$A.createComponent("c:ConfiguarationGeneral" , {
|
||||
"aura:id": "ConfiguarationGeneral",
|
||||
"AccessScope": component.get("v.AccessScope"),
|
||||
"storeurl" : configObj.HIC_ShopifySync__Shopify_URL__c,
|
||||
"store" : configObj.HIC_ShopifySync__Store__c
|
||||
},
|
||||
function(newButton, status, errorMessage){
|
||||
|
||||
component.set("v.body", newButton);
|
||||
component.set("v.mainBoolean" , true );
|
||||
//component.set("v.configObj",JSON.stringify( component.get("v.configObj")));
|
||||
});
|
||||
|
||||
}else if(cStep == 'step4'){
|
||||
component.set("v.currentStep", "step3");
|
||||
document.getElementById("divparent").style.display = "none";
|
||||
$A.createComponent("c:dynamicRow" , {
|
||||
"aura:id": "dynamicRow",
|
||||
"store" : (configObj.HIC_ShopifySync__Shopify_URL__c).replaceAll('https://','').replaceAll('.myshopify.com','').replaceAll('/','') },
|
||||
function(newButton, status, errorMessage){
|
||||
component.set("v.body", newButton);
|
||||
component.set("v.mainBoolean" , true );
|
||||
component.set("v.Spinner",true);
|
||||
});
|
||||
|
||||
}else if(cStep == 'step2'){
|
||||
//console.log('configuration data --');
|
||||
//console.log(JSON.stringify(configObj));
|
||||
component.set("v.OldPricebook" , component.get("v.configObj.HIC_ShopifySync__Salesforce_Pricebook__c") );
|
||||
component.set("v.OldCurrencyISOCode" , component.get("v.CurrencyISOCode") );
|
||||
component.set("v.currentStep", "step1");
|
||||
component.set("v.mainBoolean" , false );
|
||||
component.set("v.configObj",configObj);
|
||||
//console.log('3 to 2');
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
onchangeOrderandOpportunity: function(component, event, helper){
|
||||
var buttonName = event.getSource().get("v.name");
|
||||
var buttonValue = event.getSource().get("v.value");
|
||||
console.log(buttonName, '--', buttonValue);
|
||||
if(buttonName == 'DraOrderSyncButton'){
|
||||
component.set("v.configObj.HIC_ShopifySync__Draft_Order_Sync__c", buttonValue);
|
||||
if(!buttonValue){
|
||||
component.set("v.configObj.HIC_ShopifySync__Enable_Draft_Order__c", buttonValue);
|
||||
}
|
||||
console.log('draft order sync', component.get("v.configObj.HIC_ShopifySync__Draft_Order_Sync__c"));
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
@ -0,0 +1,790 @@
|
|||
({
|
||||
getCurrencyISOList: function(component,event){
|
||||
var store = component.get("v.configObj.HIC_ShopifySync__Store__c");
|
||||
//console.log('store---',store);
|
||||
var action = component.get("c.getlistofCurrencyISOCode");
|
||||
action.setParams({
|
||||
"store" : store
|
||||
});
|
||||
action.setCallback(this, function(response) {
|
||||
var state = response.getState();
|
||||
if (state === "SUCCESS" && response.getReturnValue() != null ) {
|
||||
|
||||
component.set("v.CurrencyISOCode",response.getReturnValue()[0]);
|
||||
component.set("v.OldCurrencyISOCode",response.getReturnValue()[0]);
|
||||
|
||||
if(response.getReturnValue()[1] != null && response.getReturnValue()[1] != ''){
|
||||
component.set("v.CurrencyISOCodeList",JSON.parse(response.getReturnValue()[1]));
|
||||
}
|
||||
|
||||
}else if (state === "SUCCESS" && response.getReturnValue() == null) {
|
||||
component.set("v.CurrencyISOCode",'');
|
||||
component.set("v.OldCurrencyISOCode",'');
|
||||
}
|
||||
else if (state === "INCOMPLETE") {
|
||||
// do something
|
||||
}
|
||||
else if (state === "ERROR") {
|
||||
var errors = response.getError();
|
||||
if (errors) {
|
||||
if (errors[0] && errors[0].message) {
|
||||
console.log("Error message: " +
|
||||
errors[0].message);
|
||||
}
|
||||
} else {
|
||||
console.log("Unknown error");
|
||||
}
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(action);
|
||||
},
|
||||
|
||||
|
||||
|
||||
checksiteaccess: function(component,event){
|
||||
var accessexist = false;
|
||||
var CheckSiteAccessaction = component.get("c.CheckSiteClassandPageAccess");
|
||||
var siteurl = component.get('v.configObj.HIC_ShopifySync__Salesforce_Site_URL__c');
|
||||
var sitelist = component.get("v.siteURLList");
|
||||
var guestuserid;
|
||||
var SiteName;
|
||||
for(var item in sitelist ){
|
||||
if(sitelist[item]['siteUrl'] == siteurl ){
|
||||
guestuserid = sitelist[item]['siteguestid'];
|
||||
SiteName = sitelist[item]['Name'];
|
||||
}
|
||||
}
|
||||
CheckSiteAccessaction.setParams({
|
||||
'Guestuserid':guestuserid
|
||||
});
|
||||
CheckSiteAccessaction.setCallback(this,function(res){
|
||||
var state = res.getState();
|
||||
if( state =="SUCCESS" && res.getReturnValue() != null && (res.getReturnValue() == true || res.getReturnValue() == 'true')){
|
||||
|
||||
this.goNext(component, event);
|
||||
}else{
|
||||
component.set("v.CheckSiteAccess",false);
|
||||
component.set("v.DisableButton",false);
|
||||
$A.util.removeClass(component.find('CheckStatusButton'),'Hidediv');
|
||||
$A.util.addClass(component.find('CheckCertificateButton'),'Hidediv');
|
||||
component.set("v.errormessage",SiteName + "\'s site have no access or this is not active. Please active site or give site access");
|
||||
var action = component.get("c.openModel");
|
||||
component.set("v.Spinner", false);
|
||||
document.getElementById("divparent").style.pointerEvents = "all";
|
||||
document.getElementById("divparent").style.display = "block";
|
||||
$A.enqueueAction(action);
|
||||
}
|
||||
return accessexist;
|
||||
});
|
||||
$A.enqueueAction(CheckSiteAccessaction);
|
||||
//return accessexist;
|
||||
},
|
||||
|
||||
goNext: function(component, event, helper) {
|
||||
var AccessScopelist = '';
|
||||
var cStep = component.get("v.currentStep");
|
||||
// console.log('Current step--> ');
|
||||
// console.log(component.get("v.currentStep"));
|
||||
if(cStep == 'step1'){
|
||||
var storedusername = component.get("v.storedusername");
|
||||
var storedpassword = component.get("v.storedpassword");
|
||||
var USER_NAME;
|
||||
var PASSWORD;
|
||||
|
||||
USER_NAME = component.get("v.configObj").HIC_ShopifySync__API_Key__c ;
|
||||
|
||||
if((storedpassword == null || storedpassword == '' || storedpassword == undefined ) ){
|
||||
PASSWORD = component.get("v.configObj").HIC_ShopifySync__Private_Key_Password__c
|
||||
}else if( storedpassword.toLowerCase().trim() != (component.get("v.configObj").HIC_ShopifySync__Private_Key_Password__c).toLowerCase().trim()){
|
||||
PASSWORD = component.get("v.configObj").HIC_ShopifySync__Private_Key_Password__c
|
||||
}else if( storedpassword.toLowerCase().trim() == (component.get("v.configObj").HIC_ShopifySync__Private_Key_Password__c).toLowerCase().trim() ) {
|
||||
PASSWORD = component.get("v.configObj").HIC_ShopifySync__Private_Key_Password__c +'True';;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
var shopifyUrl = component.get("v.configObj").HIC_ShopifySync__Shopify_URL__c;
|
||||
|
||||
// console.log('Credentials-->');
|
||||
// console.log(USER_NAME);
|
||||
// console.log(PASSWORD);
|
||||
// console.log(shopifyUrl);
|
||||
// USER_NAME = component.get("v.configObj").HIC_ShopifySync__API_Key__c;
|
||||
// PASSWORD = component.get("v.configObj").HIC_ShopifySync__Private_Key_Password__c;
|
||||
var CreateStorURLRemoteSite = component.get("c.createRemoteSiteSettings");
|
||||
CreateStorURLRemoteSite.setParams({
|
||||
'URL':shopifyUrl
|
||||
});
|
||||
CreateStorURLRemoteSite.setCallback(this,function(res){
|
||||
var state = res.getState();
|
||||
if(state =="SUCCESS" ){
|
||||
|
||||
var action1 = component.get("c.checkCreds");
|
||||
|
||||
action1.setParams({ 'shopifyUrl' : shopifyUrl,
|
||||
'USER_NAME' : USER_NAME,
|
||||
'PASSWORD' : PASSWORD
|
||||
});
|
||||
|
||||
action1.setCallback(this, function(response) {
|
||||
var state = response.getState();
|
||||
if (state === "SUCCESS" ) {
|
||||
if(response.getReturnValue() === false){
|
||||
// alert('Shopify Credentials are worng please check again');
|
||||
component.set("v.DisableButton",false);
|
||||
var action = component.get("c.openModel");
|
||||
component.set("v.CheckSiteAccess",true);
|
||||
$A.util.addClass(component.find('CheckStatusButton'),'Hidediv');
|
||||
$A.util.removeClass(component.find('CheckCertificateButton'),'Hidediv');
|
||||
component.set("v.errormessage","Authenticate Error or please check shopify self-signed certificate");
|
||||
component.set("v.Spinner", false);
|
||||
document.getElementById("divparent").style.pointerEvents = "all";
|
||||
document.getElementById("divparent").style.display = "block";
|
||||
$A.enqueueAction(action);
|
||||
|
||||
}else{
|
||||
var actionforAccessScope = component.get("c.checkCAccesscope");
|
||||
actionforAccessScope.setStorable();
|
||||
actionforAccessScope.setParams({ 'shopifyUrl' : shopifyUrl,
|
||||
'USER_NAME' : USER_NAME,
|
||||
'PASSWORD' : PASSWORD
|
||||
});
|
||||
actionforAccessScope.setCallback(this, function(responseScope){
|
||||
var stateScope = responseScope.getState();
|
||||
if(stateScope === "SUCCESS" && responseScope.getReturnValue() != null ){
|
||||
AccessScopelist = responseScope.getReturnValue();
|
||||
//component.set(component.get("v.AccessScopeError"),responseScope.getReturnValue());
|
||||
var listAccessScopeError = [];
|
||||
var AccessScope = false;
|
||||
if(!responseScope.getReturnValue().includes('read_products')){
|
||||
AccessScope = true;
|
||||
if(!listAccessScopeError.includes('Product')){
|
||||
listAccessScopeError.push('Product');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if(component.get("v.configObj.v.configObj.HIC_ShopifySync__Collection_Sync__c") && !responseScope.getReturnValue().includes('read_products') ){
|
||||
AccessScope = true;
|
||||
//component.set("v.configObj.v.configObj.HIC_ShopifySync__Collection_Sync__c",false);
|
||||
if(!listAccessScopeError.includes('collection'))
|
||||
listAccessScopeError.push('collection');
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(component.get("v.configObj.HIC_ShopifySync__Inventory_Location_Sync__c") && ( !responseScope.getReturnValue().includes('read_inventory') || !responseScope.getReturnValue().includes('read_locations')) ){
|
||||
AccessScope = true;
|
||||
//component.set("v.configObj.HIC_ShopifySync__Inventory_Location_Sync__c",false);
|
||||
if(!listAccessScopeError.includes('Location/Inventory'))
|
||||
listAccessScopeError.push('Location/Inventory');
|
||||
|
||||
}
|
||||
if(!responseScope.getReturnValue().includes('read_customers') ){
|
||||
AccessScope = true;
|
||||
|
||||
if(!listAccessScopeError.includes('Customer'))
|
||||
listAccessScopeError.push('Customer');
|
||||
|
||||
}
|
||||
if((component.get("v.configObj.HIC_ShopifySync__Order_Sync__c") || component.get("v.configObj.HIC_ShopifySync__Opportunity_Sync__c" )) && !responseScope.getReturnValue().includes('read_orders')){
|
||||
AccessScope = true;
|
||||
//component.set("v.configObj.HIC_ShopifySync__Order_Sync__c",false);
|
||||
//component.set("v.configObj.HIC_ShopifySync__Opportunity_Sync__c",false);
|
||||
if(!listAccessScopeError.includes('Orders'))
|
||||
listAccessScopeError.push('Orders');
|
||||
|
||||
}
|
||||
if(component.get("v.configObj.HIC_ShopifySync__Draft_Order_Sync__c") && !responseScope.getReturnValue().includes('read_draft_orders')){
|
||||
AccessScope = true;
|
||||
// component.set("v.configObj.HIC_ShopifySync__Draft_Order_Sync__c",false);
|
||||
if(!listAccessScopeError.includes('Draft Orders'))
|
||||
listAccessScopeError.push('Draft Orders');
|
||||
|
||||
}
|
||||
|
||||
component.set("v.listAccessScopeError",listAccessScopeError);
|
||||
component.set("v.AccessScopeShow",AccessScope);
|
||||
component.set("v.AccessScope",responseScope.getReturnValue());
|
||||
|
||||
|
||||
if(!AccessScope){
|
||||
//component.set("v.Spinner",true);
|
||||
component.set("v.currentStep", "step2");
|
||||
|
||||
try{
|
||||
//component.set("v.configObj.HIC_ShopifySync__API_Key__c",USER_NAME);
|
||||
component.set("v.configObj.HIC_ShopifySync__Private_Key_Password__c",PASSWORD);
|
||||
var configObj = component.get("v.configObj");
|
||||
|
||||
var action = component.get("c.saveConfigration");
|
||||
// console.log( 'save config --> '+ component.get("v.configObj"));
|
||||
action.setParams({ 'configObj' : JSON.stringify( component.get("v.configObj")),
|
||||
'check' : 'True'});
|
||||
|
||||
action.setCallback(this, function(response) {
|
||||
var state = response.getState();
|
||||
if (state === "SUCCESS" && response.getReturnValue() != null ) {
|
||||
debugger;
|
||||
var storename = (component.get("v.configObj").HIC_ShopifySync__Shopify_URL__c).replaceAll('https://','').replace('.myshopify.com','').replace('/','');
|
||||
configObj.Name = storename;
|
||||
configObj.HIC_ShopifySync__Store__c = storename;
|
||||
//console.log(JSON.stringify(configObj));
|
||||
var saveCurrencyISOCodeValue = component.get("c.saveCurrencyISOCode");
|
||||
var currencyValues = '{"CurrencyISOCode":'+ JSON.stringify(component.get("v.CurrencyISOCode")) +',"IsChanged":'+ JSON.stringify(component.get("v.IsChanged")) +',"store":'+JSON.stringify(storename)+' }';
|
||||
saveCurrencyISOCodeValue.setParams({'CurrencyISOCodeValue' :currencyValues });
|
||||
saveCurrencyISOCodeValue.setCallback(this,function(ISOres){
|
||||
|
||||
var ISOState = ISOres.getState();
|
||||
if((ISOState == "SUCCESS" && ISOres.getReturnValue() == true) ){
|
||||
|
||||
this.getConfigurations( component, event );
|
||||
|
||||
var CreateRemoteSiteSettingForMainSite = component.get("c.createRemoteSiteSettings");
|
||||
CreateRemoteSiteSettingForMainSite.setParams({
|
||||
'URL':component.get('v.configObj.HIC_ShopifySync__Salesforce_Site_URL__c')
|
||||
});
|
||||
CreateRemoteSiteSettingForMainSite.setCallback(this,function(mainres){
|
||||
var mainSiteSate = mainres.getState();
|
||||
if(mainSiteSate == "SUCCESS"){
|
||||
var configObj = component.get("v.configObj");
|
||||
$A.createComponent("c:ConfiguarationGeneral" , {
|
||||
"aura:id": "ConfiguarationGeneral",
|
||||
"Spinner" : "true",
|
||||
"AccessScope": component.get("v.AccessScope"),
|
||||
"storeurl" : configObj.HIC_ShopifySync__Shopify_URL__c,
|
||||
"store" : configObj.HIC_ShopifySync__Store__c
|
||||
},
|
||||
function(newButton, status, errorMessage){
|
||||
component.set("v.mainBoolean" , true );
|
||||
component.set("v.body", newButton);
|
||||
|
||||
//component.set("v.configObj",JSON.stringify( component.get("v.configObj")));
|
||||
});
|
||||
//component.set("v.Spinner",false);
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
$A.enqueueAction(CreateRemoteSiteSettingForMainSite);
|
||||
}
|
||||
});
|
||||
|
||||
if(component.get("v.CurrencyISOCode") != null && component.get("v.CurrencyISOCode") != ''){
|
||||
$A.enqueueAction(saveCurrencyISOCodeValue);
|
||||
}else{
|
||||
var CreateRemoteSiteSettingForMainSite = component.get("c.createRemoteSiteSettings");
|
||||
CreateRemoteSiteSettingForMainSite.setParams({
|
||||
'URL':component.get('v.configObj.HIC_ShopifySync__Salesforce_Site_URL__c')
|
||||
});
|
||||
CreateRemoteSiteSettingForMainSite.setCallback(this,function(mainres){
|
||||
var mainSiteSate = mainres.getState();
|
||||
if(mainSiteSate == "SUCCESS"){
|
||||
var configObj = component.get("v.configObj");
|
||||
$A.createComponent("c:ConfiguarationGeneral" , {
|
||||
"aura:id": "ConfiguarationGeneral",
|
||||
"Spinner" : "true",
|
||||
"AccessScope": component.get("v.AccessScope"),
|
||||
"storeurl" : configObj.HIC_ShopifySync__Shopify_URL__c,
|
||||
"store" : configObj.HIC_ShopifySync__Store__c
|
||||
},
|
||||
function(newButton, status, errorMessage){
|
||||
component.set("v.mainBoolean" , true );
|
||||
component.set("v.body", newButton);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
$A.enqueueAction(CreateRemoteSiteSettingForMainSite);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//component.set("v.currentStep", "step2");
|
||||
|
||||
|
||||
}
|
||||
else if (state === "INCOMPLETE") {
|
||||
|
||||
}else if (state === "ERROR") {
|
||||
var errors = response.getError();
|
||||
if (errors) {
|
||||
if (errors[0] && errors[0].message) {
|
||||
console.log("Error message: " +
|
||||
errors[0].message +" no. "+ errors[0].LineNumber);
|
||||
}
|
||||
} else {
|
||||
console.log("Unknown error");
|
||||
}
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(action);
|
||||
var storename = (configObj.HIC_ShopifySync__Shopify_URL__c).replaceAll('https://','').replace('.myshopify.com','').replace('/','');
|
||||
|
||||
var pricebookId = configObj.HIC_ShopifySync__Salesforce_Pricebook__c;
|
||||
|
||||
var savePriceBookMapping = component.get("c.savePriceBookMapping");
|
||||
savePriceBookMapping.setParams({ 'storename' : storename,
|
||||
'pricebookId' : pricebookId});
|
||||
|
||||
savePriceBookMapping.setCallback(this, function(response) {
|
||||
var state = response.getState();
|
||||
if (state === "SUCCESS" && response.getReturnValue() != null ) {
|
||||
debugger;
|
||||
|
||||
|
||||
}
|
||||
else if (state === "INCOMPLETE") {
|
||||
|
||||
}else if (state === "ERROR") {
|
||||
var errors = response.getError();
|
||||
if (errors) {
|
||||
if (errors[0] && errors[0].message) {
|
||||
console.log("Error message: " +
|
||||
errors[0].message +" no. "+ errors[0].LineNumber);
|
||||
}
|
||||
} else {
|
||||
console.log("Unknown error");
|
||||
}
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(savePriceBookMapping);
|
||||
|
||||
}catch(error){
|
||||
Console.log('error for save custom setting' + error);
|
||||
}
|
||||
|
||||
|
||||
}else if(AccessScope){
|
||||
component.set("v.Spinner",false);
|
||||
document.getElementById("divparent").style.pointerEvents = "all";
|
||||
document.getElementById("divparent").style.display = "block";
|
||||
component.set("v.DisableButton",false);
|
||||
}
|
||||
|
||||
}
|
||||
else if (state === "INCOMPLETE") {
|
||||
|
||||
}
|
||||
else if (state === "ERROR") {
|
||||
var errors = response.getError();
|
||||
if (errors) {
|
||||
if (errors[0] && errors[0].message) {
|
||||
console.log("Error message: " +
|
||||
errors[0].message);
|
||||
}
|
||||
} else {
|
||||
console.log("Unknown error");
|
||||
}
|
||||
}else if(response.getReturnValue() == null){
|
||||
console.log("retun null");
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(actionforAccessScope);
|
||||
}
|
||||
|
||||
}
|
||||
//component.set("v.Spinner",false);
|
||||
});
|
||||
$A.enqueueAction(action1);
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(CreateStorURLRemoteSite);
|
||||
|
||||
}else if(cStep == 'step2'){
|
||||
component.set("v.currentStep", "step3");
|
||||
component.set("v.Spinner",false);
|
||||
document.getElementById("divparent").style.pointerEvents = "all";
|
||||
document.getElementById("divparent").style.display = "block";
|
||||
|
||||
$A.createComponent("c:dynamicRow" , {
|
||||
"aura:id": "dynamicRow",
|
||||
"store":component.get("v.configObj").HIC_ShopifySync__Store__c },
|
||||
function(newButton, status, errorMessage){
|
||||
component.set("v.body", newButton);
|
||||
component.set("v.mainBoolean" , true );
|
||||
|
||||
});
|
||||
|
||||
}else if(cStep == 'step3'){
|
||||
component.set("v.currentStep", "step4");
|
||||
component.set("v.Spinner",false);
|
||||
document.getElementById("divparent").style.pointerEvents = "all";
|
||||
document.getElementById("divparent").style.display = "block";
|
||||
$A.createComponent("c:ConfiguarationRecordTypeMapping" , {
|
||||
"aura:id": "ConfiguarationRecordTypeMapping" },
|
||||
function(newButton, status, errorMessage){
|
||||
component.set("v.body", newButton);
|
||||
component.set("v.mainBoolean" , true );
|
||||
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
getAccessScopeList: function(component, event, helper){
|
||||
var actionforAccessScope = component.get("c.checkCAccesscope");
|
||||
actionforAccessScope.setStorable();
|
||||
actionforAccessScope.setParams({ 'shopifyUrl' : shopifyUrl,
|
||||
'USER_NAME' : USER_NAME,
|
||||
'PASSWORD' : PASSWORD
|
||||
});
|
||||
actionforAccessScope.setCallback(this, function(responseScope){
|
||||
var stateScope = responseScope.getState();
|
||||
if(stateScope === "SUCCESS" && responseScope.getReturnValue() != null ){
|
||||
component.set(component.get("v.AccessScopeError"),responseScope.getReturnValue());
|
||||
}
|
||||
else if (state === "INCOMPLETE") {
|
||||
|
||||
}
|
||||
else if (state === "ERROR") {
|
||||
var errors = response.getError();
|
||||
if (errors) {
|
||||
if (errors[0] && errors[0].message) {
|
||||
console.log("Error message: " +
|
||||
errors[0].message);
|
||||
}
|
||||
} else {
|
||||
console.log("Unknown error");
|
||||
}
|
||||
}else if(response.getReturnValue() == null){
|
||||
console.log("retun null");
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(actionforAccessScope);
|
||||
},
|
||||
|
||||
|
||||
getEmailErrorlist: function(component, event, helper) {
|
||||
var action = component.get("c.getErrorMailList");
|
||||
action.setCallback(this, function(response) {
|
||||
var state = response.getState();
|
||||
if (state === "SUCCESS" && response.getReturnValue() != null ) {
|
||||
component.set("v.emaiList",JSON.parse(response.getReturnValue()));
|
||||
|
||||
var emaiList = component.get("v.emaiList");
|
||||
|
||||
for(var item in emaiList){
|
||||
emaiList[item]['sobjectType'] = "HIC_ShopifySync__Email_Addresses_to_send_error_CSV__c";
|
||||
emaiList[item]['errormailfrmt'] = false;
|
||||
};
|
||||
|
||||
|
||||
component.set("v.emaiList",emaiList);
|
||||
component.set("v.Spinner",false);
|
||||
document.getElementById("divparent").style.pointerEvents = "all";
|
||||
document.getElementById("divparent").style.display = "block";
|
||||
}
|
||||
else if (state === "INCOMPLETE") {
|
||||
|
||||
}
|
||||
else if (state === "ERROR") {
|
||||
var errors = response.getError();
|
||||
if (errors) {
|
||||
if (errors[0] && errors[0].message) {
|
||||
console.log("Error message: " +
|
||||
errors[0].message);
|
||||
}
|
||||
} else {
|
||||
console.log("Unknown error");
|
||||
}
|
||||
}else if(response.getReturnValue() == null){
|
||||
var defaultrow = this;
|
||||
//component.set("v.emaiList",JSON.parse(response.getReturnValue()));
|
||||
// defaultrow.createObjectData(component, event);
|
||||
var emptyEmaillist = [];
|
||||
emptyEmaillist.push({
|
||||
"sobjectType": ''
|
||||
});
|
||||
component.set("v.emaiList",emptyEmaillist);
|
||||
component.set("v.Spinner",false);
|
||||
document.getElementById("divparent").style.pointerEvents = "all";
|
||||
document.getElementById("divparent").style.display = "block";
|
||||
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(action);
|
||||
|
||||
},
|
||||
|
||||
getPricebookList : function( component, event ) {
|
||||
|
||||
var action = component.get("c.getActivePricebook");
|
||||
|
||||
action.setCallback(this, function(response) {
|
||||
var state = response.getState();
|
||||
if (state === "SUCCESS" && response.getReturnValue() != null ) {
|
||||
component.set("v.pricebookList",JSON.parse(response.getReturnValue()));
|
||||
|
||||
}
|
||||
else if (state === "INCOMPLETE") {
|
||||
// do something
|
||||
}
|
||||
else if (state === "ERROR") {
|
||||
var errors = response.getError();
|
||||
if (errors) {
|
||||
if (errors[0] && errors[0].message) {
|
||||
console.log("Error message: " +
|
||||
errors[0].message);
|
||||
}
|
||||
} else {
|
||||
console.log("Unknown error");
|
||||
}
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(action);
|
||||
},
|
||||
getSiteURLList : function( component, event ) {
|
||||
|
||||
var action = component.get("c.getSiteURLs");
|
||||
|
||||
action.setCallback(this, function(response) {
|
||||
var state = response.getState();
|
||||
if (state === "SUCCESS" && response.getReturnValue() != null ) {
|
||||
component.set("v.CheckSiteExist",true);
|
||||
component.set("v.siteURLList",JSON.parse(response.getReturnValue()));
|
||||
}
|
||||
else if (state === "INCOMPLETE") {
|
||||
// do something
|
||||
}
|
||||
else if (state === "ERROR") {
|
||||
var errors = response.getError();
|
||||
if (errors) {
|
||||
if (errors[0] && errors[0].message) {
|
||||
console.log("Error message: " +
|
||||
errors[0].message);
|
||||
}
|
||||
} else {
|
||||
console.log("Unknown error");
|
||||
}
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(action);
|
||||
},
|
||||
|
||||
getConfigurationData : function( component, event ) {
|
||||
|
||||
var action = component.get("c.getConfigration");
|
||||
|
||||
action.setCallback(this, function(response) {
|
||||
var state = response.getState();
|
||||
if (state === "SUCCESS" && response.getReturnValue() != null ) {
|
||||
var configObj = JSON.parse( response.getReturnValue() );
|
||||
component.set("v.configObj", configObj);
|
||||
// component.set("v.storedusername",configObj.HIC_ShopifySync__API_Key__c);
|
||||
// component.set("v.storedpassword", configObj.HIC_ShopifySync__Private_Key_Password__c);
|
||||
|
||||
if(component.get("v.configObj.HIC_ShopifySync__Refresh_Token__c ") != null && component.get("v.configObj.HIC_ShopifySync__Refresh_Token__c ") != '' && component.get("v.configObj.HIC_ShopifySync__Refresh_Token__c ") != undefined){
|
||||
component.set("v.currentStep","step1");
|
||||
}
|
||||
|
||||
if(component.get("v.configObj.HIC_ShopifySync__Batch_Is_Processing__c") == true)
|
||||
{
|
||||
component.set("v.currentStep",'Finised');
|
||||
}
|
||||
component.set("v.OldPricebook",component.get("v.configObj.HIC_ShopifySync__Salesforce_Pricebook__c"));
|
||||
this.getCurrencyISOList(component, event);
|
||||
}
|
||||
else if (state === "INCOMPLETE") {
|
||||
console.log('configuration get error');
|
||||
}
|
||||
else if (state === "ERROR") {
|
||||
var errors = response.getError();
|
||||
if (errors) {
|
||||
if (errors[0] && errors[0].message) {
|
||||
console.log("Error message: " +
|
||||
errors[0].message);
|
||||
}
|
||||
} else {
|
||||
console.log("Unknown error");
|
||||
}
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(action);
|
||||
|
||||
},
|
||||
|
||||
checkStoreToken : function( component, event ) {
|
||||
// console.log('shopify url',component.get("v.configObj").HIC_ShopifySync__Shopify_URL__c);
|
||||
var store = (component.get("v.configObj").HIC_ShopifySync__Shopify_URL__c).replaceAll('https://','').replace('.myshopify.com','').replace('/','').trim();
|
||||
// console.log('store-',store);
|
||||
var action = component.get("c.getConfigrationForDynamicRow");
|
||||
action.setParams({
|
||||
"store" : store
|
||||
});
|
||||
|
||||
action.setCallback(this, function(response) {
|
||||
var state = response.getState();
|
||||
// console.log('state-', state);
|
||||
if (state === "SUCCESS" && response.getReturnValue() != null ) {
|
||||
var configObj = JSON.parse( response.getReturnValue() );
|
||||
// console.log('Password-',configObj.HIC_ShopifySync__Private_Key_Password__c);
|
||||
component.set("v.configObj.HIC_ShopifySync__Private_Key_Password__c", configObj.HIC_ShopifySync__Private_Key_Password__c);
|
||||
/*component.set("v.configObj", configObj);
|
||||
// component.set("v.storedusername",configObj.HIC_ShopifySync__API_Key__c);
|
||||
// component.set("v.storedpassword", configObj.HIC_ShopifySync__Private_Key_Password__c);
|
||||
|
||||
if(component.get("v.configObj.HIC_ShopifySync__Refresh_Token__c ") != null && component.get("v.configObj.HIC_ShopifySync__Refresh_Token__c ") != '' && component.get("v.configObj.HIC_ShopifySync__Refresh_Token__c ") != undefined){
|
||||
component.set("v.currentStep","step1");
|
||||
}
|
||||
|
||||
if(component.get("v.configObj.HIC_ShopifySync__Batch_Is_Processing__c") == true)
|
||||
{
|
||||
component.set("v.currentStep",'Finised');
|
||||
}
|
||||
component.set("v.OldPricebook",component.get("v.configObj.HIC_ShopifySync__Salesforce_Pricebook__c"));
|
||||
this.getCurrencyISOList(component, event); */
|
||||
if(configObj.HIC_ShopifySync__Private_Key_Password__c != null && configObj.HIC_ShopifySync__Private_Key_Password__c != ''){
|
||||
component.set("v.authDone", true);
|
||||
component.set("v.isAuthorized", false);
|
||||
}
|
||||
}
|
||||
else if (state === "INCOMPLETE") {
|
||||
console.log('configuration get error');
|
||||
}
|
||||
else if (state === "ERROR") {
|
||||
var errors = response.getError();
|
||||
if (errors) {
|
||||
if (errors[0] && errors[0].message) {
|
||||
console.log("Error message: " +
|
||||
errors[0].message);
|
||||
}
|
||||
} else {
|
||||
console.log("Unknown error");
|
||||
}
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(action);
|
||||
|
||||
},
|
||||
|
||||
getConfigurations : function( component, event ) {
|
||||
|
||||
var action = component.get("c.getConfigrations");
|
||||
|
||||
action.setCallback(this, function(response) {
|
||||
var state = response.getState();
|
||||
//console.log('state');
|
||||
//console.log(state);
|
||||
//console.log(response.getReturnValue());
|
||||
if(response.getReturnValue() == null){
|
||||
component.set("v.configObjList", null);
|
||||
}
|
||||
if (state === "SUCCESS" && response.getReturnValue() != null ) {
|
||||
var configObjList = JSON.parse( response.getReturnValue() );
|
||||
component.set("v.configObjList", configObjList);
|
||||
//console.log('configObjList');
|
||||
//console.log(configObjList);
|
||||
/*component.set("v.storedusername",configObj.HIC_ShopifySync__API_Key__c);
|
||||
component.set("v.storedpassword", configObj.HIC_ShopifySync__Private_Key_Password__c);
|
||||
|
||||
if(component.get("v.configObj.HIC_ShopifySync__Refresh_Token__c ") != null && component.get("v.configObj.HIC_ShopifySync__Refresh_Token__c ") != '' && component.get("v.configObj.HIC_ShopifySync__Refresh_Token__c ") != undefined){
|
||||
component.set("v.currentStep","step1");
|
||||
}
|
||||
|
||||
if(component.get("v.configObj.HIC_ShopifySync__Batch_Is_Processing__c") == true)
|
||||
{
|
||||
component.set("v.currentStep",'Finised');
|
||||
}
|
||||
component.set("v.OldPricebook",component.get("v.configObj.HIC_ShopifySync__Salesforce_Pricebook__c"));*/
|
||||
|
||||
}
|
||||
else if (state === "INCOMPLETE") {
|
||||
console.log('configuration get error');
|
||||
}
|
||||
else if (state === "ERROR") {
|
||||
var errors = response.getError();
|
||||
if (errors) {
|
||||
if (errors[0] && errors[0].message) {
|
||||
console.log("Error message: " +
|
||||
errors[0].message);
|
||||
}
|
||||
} else {
|
||||
console.log("Unknown error");
|
||||
}
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(action);
|
||||
|
||||
},
|
||||
|
||||
|
||||
createObjectData: function(component, event) {
|
||||
// get the contactList from component and add(push) New Object to List
|
||||
var RowItemList = component.get("v.emaiList");
|
||||
|
||||
RowItemList.push({
|
||||
'sobjectType': 'HIC_ShopifySync__Email_Addresses_to_send_error_CSV__c',
|
||||
//'Name': '',
|
||||
//'HIC_ShopifySync__Email_Id__c ': '',
|
||||
'errormailfrmt': false
|
||||
|
||||
});
|
||||
|
||||
// set the updated list to attribute (contactList) again
|
||||
component.set("v.emaiList", RowItemList);
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
// helper function for check if email address is not null/blank/invalid on save
|
||||
validateRequired: function(component, event ,helper) {
|
||||
|
||||
/* console.log('validation Entered....');
|
||||
var isvalid = true;
|
||||
var allContactRows = component.get('v.emaiList');
|
||||
|
||||
var regExpEmailformat = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
|
||||
|
||||
allContactRows.forEach( function(ele){
|
||||
|
||||
if(ele.Name == '' || ele.Name == null || ele.Name === 'undefined' || !ele.Name.match(regExpEmailformat )){
|
||||
console.log('validation Entered....');
|
||||
ele.errormailfrmt = true;
|
||||
isvalid = false;
|
||||
component.set("v.Spinner",false);
|
||||
document.getElementById("divparent").style.pointerEvents = "all";
|
||||
document.getElementById("divparent").style.display = "block";
|
||||
|
||||
}else{
|
||||
ele.errormailfrmt = false;
|
||||
}
|
||||
});
|
||||
|
||||
console.log(allContactRows);
|
||||
component.set('v.emaiList',allContactRows);
|
||||
console.log(isvalid);
|
||||
return isvalid;*/
|
||||
|
||||
var lineItemIdList = component.find('child').length;
|
||||
var valid = true;
|
||||
if(lineItemIdList !== undefined && lineItemIdList >= 1 ){
|
||||
for(var v in component.get("v.emaiList")){
|
||||
valid = component.find('child')[v].validateData();
|
||||
}
|
||||
}else{
|
||||
valid = component.find('child').validateData();
|
||||
}
|
||||
|
||||
if(valid == false || valid == 'false' || valid == undefined){
|
||||
component.set("v.Spinner",false);
|
||||
document.getElementById("divparent").style.pointerEvents = "all";
|
||||
document.getElementById("divparent").style.display = "block";
|
||||
}
|
||||
return valid;
|
||||
|
||||
},
|
||||
|
||||
toggleHelper : function(component,event) {
|
||||
var toggleText = component.find("tooltip");
|
||||
$A.util.toggleClass(toggleText, "toggle");
|
||||
}
|
||||
|
||||
})
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
({
|
||||
|
||||
|
||||
|
||||
})
|
||||
|
|
@ -0,0 +1,189 @@
|
|||
<aura:component>
|
||||
<!-- Aura Attribute for store single Contact[standard Object] Instance
|
||||
And Store Index of Particular Instance -->
|
||||
|
||||
<aura:attribute name="isOpen" type="boolean" default="false"/>
|
||||
<aura:attribute name="ObjectListPassed" type="list" />
|
||||
<aura:attribute name="fieldDisabled" type="boolean" default="true"/>
|
||||
<aura:attribute name="objectInstance" type="object" default="{}"/>
|
||||
<aura:attribute name="configObj" type="object" default = "null" />
|
||||
<aura:attribute name="defaultFieldMappingObject" type="list"/>
|
||||
<aura:attribute name="DisplayDefaultlist" type="list"/>
|
||||
<aura:attribute name="rowIndex" type="String"/>
|
||||
<aura:attribute name="objectTableData1" type="list" />
|
||||
<aura:attribute name="objectTableData2" type="list" />
|
||||
<aura:attribute name="table2Data" type="list" />
|
||||
<aura:attribute name="Objecttype" type="String"/>
|
||||
<aura:attribute name="acountlist" type="String"/>
|
||||
<aura:attribute name="orderTableData2" type="list" />
|
||||
<aura:attribute name="flag" type="boolean" default="false"/>
|
||||
<aura:attribute name="selectedfields" type="String"/>
|
||||
<aura:attribute name="salesforcefields" type="String"/>
|
||||
<aura:attribute name="selectList" type="list" />
|
||||
<aura:attribute name="filteredList" type="list" />
|
||||
<aura:attribute name="type" type="String" />
|
||||
<aura:attribute name="selectedfieldmappingError" type="String" />
|
||||
<aura:attribute name="options" type="List" />
|
||||
<aura:attribute name="listSize" type="INTEGER" default="1"/>
|
||||
|
||||
<!-- Register 2 Lightning Event for handle add or Delete rows on Parent Component -->
|
||||
<aura:registerEvent name="DeleteRowEvt" type="c:DeleteRowEvt"/>
|
||||
<aura:registerEvent name="AddRowEvt" type="c:AddNewRowEvt"/>
|
||||
<aura:handler name="init" value="this" action="{!c.doInit}" />
|
||||
<!-- Table Row -->
|
||||
<aura:attribute name="Spinner" type="boolean" default="false"/>
|
||||
<aura:attribute name="applyandcloseerror" type="boolean" default="false"/>
|
||||
|
||||
<aura:if isTrue="{!v.Spinner}">
|
||||
<!--div class="exampleHolder">
|
||||
<lightning:spinner alternativeText="Loading" size="large" />
|
||||
</div-->
|
||||
|
||||
</aura:if>
|
||||
|
||||
|
||||
<tr class="slds-text-title_caps">
|
||||
<td>
|
||||
{!v.rowIndex + 1}
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<lightning:select name="selectItem1" disabled = "{!v.fieldDisabled}" aura:id = "shopifyfield" value="{!v.objectInstance.salesforcefields}" label="Select an item" onchange="{!c.getFilteredList}">
|
||||
<option value="">None</option>
|
||||
<aura:iteration items="{!v.table2Data}" var="tableRow" indexVar="index" >
|
||||
<option value="{!tableRow.filedApiName}">{!tableRow.filedlabel} ({!tableRow.dataType})</option>
|
||||
</aura:iteration>
|
||||
</lightning:select>
|
||||
</td>
|
||||
<td style="text-align: center;">
|
||||
|
||||
<lightning:input type="checkbox" name="Default Text" checked="{!v.objectInstance.DefaultValue}" value="{!v.objectInstance.DefaultValue}" disabled="{!!(v.objectInstance.salesforceFieldType=='STRING' || v.type=='STRING' || v.objectInstance.salesforceFieldType=='BOOLEAN' || v.type=='BOOLEAN' || v.objectInstance.salesforceFieldType=='DOUBLE' || v.type=='DOUBLE' || v.objectInstance.salesforceFieldType=='CURRENCY' || v.type=='CURRENCY' || v.objectInstance.salesforceFieldType=='URL' || v.type=='URL' || v.objectInstance.salesforceFieldType=='EMAIL' || v.type=='EMAIL' || v.objectInstance.salesforceFieldType=='DATETIME' || v.type=='DATETIME' || v.objectInstance.salesforceFieldType=='DATE' || v.type=='DATE')}" onchange="{!c.checkDefault}"/>
|
||||
</td>
|
||||
|
||||
<aura:renderIf isTrue="{!v.objectInstance.DefaultValue}">
|
||||
<td>
|
||||
<lightning:input type="{!(v.objectInstance.salesforceFieldType == 'BOOLEAN')?'checkbox':(v.objectInstance.salesforceFieldType == 'DOUBLE')?'number':(v.objectInstance.salesforceFieldType == 'CURRENCY')?'number':(v.objectInstance.salesforceFieldType == 'URL')?'url':(v.objectInstance.salesforceFieldType == 'EMAIL')?'email':(v.objectInstance.salesforceFieldType == 'DATETIME')?'datetime':(v.objectInstance.salesforceFieldType == 'DATE')?'date':(v.type == 'BOOLEAN')?'checkbox':(v.type == 'DOUBLE')?'number':(v.type == 'CURRENCY')?'number':(v.type == 'URL')?'url':(v.type == 'EMAIL')?'email':(v.type == 'DATETIME')?'datetime':(v.type == 'DATE')?'date':'text'}" name="selectItem" checked="{!v.objectInstance.selectedfields}" value="{!v.objectInstance.selectedfields}" maxlength="255" />
|
||||
</td>
|
||||
<aura:set attribute="else">
|
||||
<aura:if isTrue="{!v.objectInstance.flag}">
|
||||
<td>
|
||||
<lightning:select name="selectItem" label="Select an item" value="{!v.objectInstance.selectedfields}">
|
||||
<option value="">None</option>
|
||||
<aura:iteration items="{!v.filteredList}" var="tableRow2">
|
||||
<option value="{!tableRow2.Name}">{!tableRow2.HIC_ShopifySync__UI_Label_Name__c}</option>
|
||||
</aura:iteration>
|
||||
</lightning:select>
|
||||
</td>
|
||||
<aura:set attribute="else">
|
||||
<td>
|
||||
<div class="slds-grid" style="width: 200px;">
|
||||
<div class="slds-grid slds-has-flexi-truncate">
|
||||
<p class="slds-truncate" title="{!v.objectInstance.selectedfields}">{!v.objectInstance.selectedfields}</p>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</aura:set>
|
||||
</aura:if>
|
||||
</aura:set>
|
||||
</aura:renderIf>
|
||||
<td>
|
||||
<aura:renderif isTrue="{!and(!v.objectInstance.DefaultValue,(v.type == 'STRING' || v.type == 'TEXTAREA' || v.type == 'DOUBLE' || v.type == 'CURRENCY' || v.type == 'INTEGER'))}">
|
||||
|
||||
<ui:button class="slds-align_absolute-center" label="Select Multiple Fields" press="{!c.openmodal}" />
|
||||
|
||||
</aura:renderif>
|
||||
</td>
|
||||
<td>
|
||||
<aura:If isTrue="{!v.rowIndex + 1 == v.listSize}">
|
||||
|
||||
<a onclick="{!c.AddNewRow}">
|
||||
<lightning:icon iconName="utility:add" class="slds-icon slds-icon_small" size="small" alternativeText="add"/>
|
||||
<span class="slds-assistive-text">Add Icon</span>
|
||||
</a>
|
||||
|
||||
<aura:set attribute="else">
|
||||
<a onclick="{!c.removeRow}">
|
||||
<lightning:icon variant="error" iconName="utility:delete" class="slds-icon slds-icon_small" size="small" alternativeText="icon"/>
|
||||
<span class="slds-assistive-text">Delete Icon</span>
|
||||
</a>
|
||||
|
||||
</aura:set>
|
||||
</aura:If>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<div role="dialog" tabindex="-1" aria-labelledby="header43" aura:id="Modalbox" class="slds-modal slds-modal_large">
|
||||
|
||||
|
||||
<div class="slds-modal__container" style="width: 65%;">
|
||||
<header class="slds-modal__header">
|
||||
<h2 id="modal-heading-01" class="slds-text-heading_medium slds-hyphenate"><lightning:icon style="margin-right: 10px;" iconName='utility:multi_picklist'></lightning:icon> Select Multiple Fields</h2>
|
||||
</header>
|
||||
<div>
|
||||
<ui:inputSelect multiple="true" class="multiple" aura:id="multiPicklist" change="{!c.getFilteredList2}" >
|
||||
<aura:iteration items="{!v.filteredList}" var="tableRow2" indexVar="index2" >
|
||||
<ui:inputSelectOption text="{!tableRow2.HIC_ShopifySync__UI_Label_Name__c }" />
|
||||
</aura:iteration>
|
||||
</ui:inputSelect>
|
||||
</div>
|
||||
<!--<ui:button label="close" press="{!c.closeModal}" />-->
|
||||
<footer class="slds-modal__footer">
|
||||
|
||||
|
||||
<aura:renderIf isTrue="{!v.applyandcloseerror}">
|
||||
|
||||
<div class="slds-form-element slds-has-error" style = "float:left;">
|
||||
|
||||
<div class="slds-form-element__help" id="form-error-01">
|
||||
<lightning:icon iconName="utility:warning" alternativeText="Warning!" variant="warning"/>{!v.selectedfieldmappingError}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</aura:renderIf>
|
||||
<div>
|
||||
<lightning:button variant="neutral"
|
||||
label="Cancel"
|
||||
title="Cancel"
|
||||
onclick="{! c.cancelModal }"/>
|
||||
|
||||
|
||||
<lightning:button variant="brand"
|
||||
label="Apply and Close"
|
||||
title="Apply and Close"
|
||||
onclick="{! c.closeModal }"/>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
<div class="slds-backdrop " aura:id="Modalbackdrop"></div>
|
||||
<aura:renderIf isTrue="{!v.isOpen}">
|
||||
|
||||
<section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria-modal="true" aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open">
|
||||
<center>
|
||||
<div class="slds-modal__container">
|
||||
<div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div >
|
||||
<center>
|
||||
<h2 id="modal-heading-01" class="slds-text-heading_medium slds-hyphenate">Duplicate Field Selected</h2>
|
||||
</center>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<br/><br/>
|
||||
</div>
|
||||
</center>
|
||||
</section>
|
||||
|
||||
<div class="slds-backdrop slds-backdrop_open"></div>
|
||||
|
||||
|
||||
</aura:renderIf>
|
||||
</aura:component>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||
<apiVersion>44.0</apiVersion>
|
||||
<description>A Lightning Component Bundle</description>
|
||||
</AuraDefinitionBundle>
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
.THIS .uiInput--select{
|
||||
width: 100%;
|
||||
}
|
||||
|
|
@ -0,0 +1,431 @@
|
|||
({
|
||||
AddNewRow : function(component, event, helper){
|
||||
//fire the AddNewRowEvt Lightning Event var
|
||||
var params = {"indexVar" : component.get("v.rowIndex"),
|
||||
"Objecttype" : component.get("v.Objecttype")
|
||||
};
|
||||
|
||||
|
||||
component.getEvent("AddRowEvt").setParams({"Objecttype" : component.get("v.Objecttype") }).fire();
|
||||
// component.getEvent("AddRowEvt").setParams({"Objecttype" : JSON.stringify(params)}).fire();
|
||||
},
|
||||
|
||||
checkDefault : function(component, event, helper){
|
||||
if(component.get("v.type")=='BOOLEAN'){
|
||||
component.set("v.objectInstance.selectedfields",false);
|
||||
}else{
|
||||
component.set("v.objectInstance.selectedfields","");
|
||||
}
|
||||
component.set("v.objectInstance.flag",true);
|
||||
},
|
||||
|
||||
removeRow : function(component, event, helper){
|
||||
// fire the DeleteRowEvt Lightning Event and pass the deleted Row Index to Event parameter/attribute
|
||||
// console.log('***removeRow');
|
||||
//console.log( component.get("v.rowIndex") );
|
||||
//console.log( component.get("v.Objecttype") );
|
||||
|
||||
var params = { "indexVar" : component.get("v.rowIndex"),
|
||||
"Objecttype" : component.get("v.Objecttype") };
|
||||
|
||||
|
||||
|
||||
component.getEvent("DeleteRowEvt").setParams( { "deleteObject" : JSON.stringify(params) } ).fire();
|
||||
},
|
||||
|
||||
doInit : function(component, event, helper) {
|
||||
if(component.get("v.objectInstance.fieldDisabled") != undefined){
|
||||
component.set("v.fieldDisabled",component.get("v.objectInstance.fieldDisabled"));
|
||||
}
|
||||
if(component.get("v.objectInstance.flag") == undefined ) {
|
||||
//helper.getObjectFieldsHelper( component, event );
|
||||
var Defaultlist = component.get("v.defaultFieldMappingObject");
|
||||
var filterdlist = component.get("v.filteredList");
|
||||
var Displaydefaultlist = [];
|
||||
|
||||
/* filterdlist.forEach(function(element) {
|
||||
//console.log("****Defaultvalue ");
|
||||
//console.log(element);
|
||||
//filterdlist.forEach(function(element2) {
|
||||
//console.log("****Filteredtvalue ");
|
||||
//console.log(element);
|
||||
var getElementIndex = Defaultlist.indexOf(element);
|
||||
|
||||
if(getElementIndex != -1){
|
||||
Displaydefaultlist.push(element);
|
||||
}else{
|
||||
//component.set('v.filteredList',false);
|
||||
}
|
||||
|
||||
//})
|
||||
|
||||
})
|
||||
component.set('v.filteredList',Displaydefaultlist);*/
|
||||
//var selectedfield = component.get("v.objectInstance");
|
||||
// console.log('********objectInstance*******');
|
||||
//console.log(selectedlist);
|
||||
|
||||
helper.InsertFilteredlist(component, event, helper);
|
||||
var selectedfield = component.get("v.objectInstance.selectedfields");
|
||||
if(selectedfield=='false') component.set("v.objectInstance.selectedfields", false);
|
||||
|
||||
if(selectedfield != null && selectedfield != '' && selectedfield !== 'undefined'){
|
||||
if(selectedfield.includes(',')){
|
||||
component.set("v.objectInstance.flag", false);
|
||||
component.set("v.objectInstance.shopifyFieldName", null);
|
||||
component.set("v.objectInstance.shopifyNested", null);
|
||||
|
||||
}else{
|
||||
component.set("v.objectInstance.flag", true);
|
||||
}
|
||||
}else{
|
||||
component.set("v.objectInstance.flag", true);
|
||||
}
|
||||
|
||||
|
||||
/* var sobjectTypevalue = component.get("v.objectInstance.sobjectType");
|
||||
if(sobjectTypevalue != null && sobjectTypevalue != '' && sobjectTypevalue !== 'undefined'){
|
||||
if(sobjectTypevalue == 'Opportunity Product'){
|
||||
component.set("v.Spinner", false);
|
||||
}else{
|
||||
component.set("v.Spinner", true);
|
||||
}
|
||||
} */
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
|
||||
closeModal:function(component,event,helper){
|
||||
var nestevalue = false ;
|
||||
var singlevalue = false ;
|
||||
var nestedfield = '';
|
||||
var selectedvalue1 = component.find('multiPicklist').get('v.value').split(";");
|
||||
selectedvalue1.forEach(function(element) {
|
||||
console.log('gerfilteredList2');
|
||||
//console.log(element);
|
||||
if(element.includes('.') ){ //&& ( element.includes('default_address') || element.includes('shipping_address') ||element.includes('billing_address') )
|
||||
nestevalue = true;
|
||||
nestedfield = selectedvalue1[0].split(".")[0];
|
||||
}else{
|
||||
singlevalue = true;
|
||||
}
|
||||
})
|
||||
|
||||
if(nestevalue == true && singlevalue == true ){
|
||||
component.set("v.applyandcloseerror",true);
|
||||
component.set("v.selectedfieldmappingError"," *Please multiple select single fields or nested fields at a time.");
|
||||
|
||||
// alert('please choose single item or multiple');
|
||||
|
||||
}
|
||||
var cmpTarget = component.find('Modalbox');
|
||||
var cmpBack = component.find('Modalbackdrop');
|
||||
|
||||
//console.log('New');
|
||||
//console.log(component.find("multiPicklist"));
|
||||
// var plValue;
|
||||
//console.log(component.find("multiPicklist").get("v.value"));
|
||||
|
||||
if( !component.get("v.applyandcloseerror") && (component.find("multiPicklist").get("v.value") == null || component.find("multiPicklist").get("v.value") == '') ){
|
||||
//alert('please choose atleast one vlaue');
|
||||
component.set("v.applyandcloseerror",true);
|
||||
component.set("v.selectedfieldmappingError"," *Please select atleast one value");
|
||||
}else if(!component.get("v.applyandcloseerror")){
|
||||
var plValue = component.find("multiPicklist").get("v.value").replace(/;/g,",");
|
||||
var garphQlValues = '';
|
||||
if(plValue){
|
||||
var picklistValues = plValue.split(',');
|
||||
var filteredValues = component.get("v.filteredList");
|
||||
// console.log('@@@ FILTERED VALUES ::: '+JSON.stringify(filteredValues));
|
||||
// console.log('@@@ picklistValues VALUES ::: '+JSON.stringify(picklistValues));
|
||||
for(let value of filteredValues){
|
||||
// console.log('@@@ picklistValues value ::: '+JSON.stringify(value));
|
||||
picklistValues.forEach(function(element){
|
||||
if(element.includes('.') && element.split('.')[1] === value.HIC_ShopifySync__Field_Name__c){
|
||||
// console.log('THIS IS IF CONDITION');
|
||||
// console.log('@@@ picklistValues.includes ::: '+JSON.stringify(value));
|
||||
if(value.hasOwnProperty('HIC_ShopifySync__GQL_Field_API__c')){
|
||||
garphQlValues += value.HIC_ShopifySync__GQL_Field_API__c + ',';
|
||||
}
|
||||
|
||||
// console.log('@@@ picklistValues.includes ::: '+JSON.stringify(garphQlValues));
|
||||
}else if(element === value.HIC_ShopifySync__Field_Name__c){
|
||||
// console.log('THIS IS if else CONDITION');
|
||||
// console.log('@@@ picklistValues.includes ::: '+JSON.stringify(value));
|
||||
if(value.hasOwnProperty('HIC_ShopifySync__GQL_Field_API__c')){
|
||||
garphQlValues += value.HIC_ShopifySync__GQL_Field_API__c + ',';
|
||||
}
|
||||
|
||||
// console.log('@@@ picklistValues.includes ::: '+JSON.stringify(garphQlValues));
|
||||
}else{
|
||||
console.log('THIS IS ELSE CONDITION ::: '+element);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
garphQlValues.slice(0, -1);
|
||||
// console.log('@@@ picklistValues '+garphQlValues.slice(0, -1));
|
||||
}
|
||||
// console.log('@@@ garphQlValues '+garphQlValues.slice(0, -1));
|
||||
// component.set("v.objectInstance.selectedfields", plValue);
|
||||
component.set("v.objectInstance.graphqlfield", garphQlValues.slice(0, -1));
|
||||
// console.log('@@@@@@@@@@@@@@@@@@ THIS IS FIELD config::: '+component.get("v.objectInstance.graphqlfield"));
|
||||
component.set("v.objectInstance.shopifyFieldName", null);
|
||||
component.set("v.objectInstance.shopifyNested", null);
|
||||
component.set("v.objectInstance.flag", false);
|
||||
component.set("v.objectInstance.selectedfields", plValue);
|
||||
var shopifyfield = component.get('v.objectInstance.shopifyFieldName');
|
||||
$A.util.removeClass(cmpBack,'slds-backdrop--open');
|
||||
$A.util.removeClass(cmpTarget, 'slds-fade-in-open');
|
||||
// console.log('@@@@@@@@@@@@@@@@@@ THIS IS OBject ::: '+JSON.stringify(component.get("v.objectInstance")));
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
// console.log(plValue);
|
||||
|
||||
|
||||
|
||||
cancelModal:function(component,event,helper){
|
||||
//console.log( 'cancelModal++++' );
|
||||
var cmpTarget = component.find('Modalbox');
|
||||
var cmpBack = component.find('Modalbackdrop');
|
||||
component.set("v.applyandcloseerror",false);
|
||||
$A.util.removeClass(cmpBack,'slds-backdrop--open');
|
||||
$A.util.removeClass(cmpTarget, 'slds-fade-in-open');
|
||||
component.set("v.objectInstance.flag", true);
|
||||
component.set("v.objectInstance.selectedfields", null);
|
||||
|
||||
//component.set("v.selectedfields", plValue);
|
||||
//var selectList = component.get("v.selectedfields").split(';');
|
||||
//component.set("v.selectList", selectList);
|
||||
|
||||
//*************For Refresh the list**************//
|
||||
|
||||
// console.log( '1111-->'+component.get("v.objectInstance.salesforcefields"));
|
||||
var selectedvalue = component.get("v.objectInstance.salesforcefields");
|
||||
var dataTable2 = component.get("v.table2Data");
|
||||
var dataType = '';
|
||||
|
||||
dataTable2.forEach(function(element) {
|
||||
// console.log('*********-->'+element);
|
||||
// console.log(element);
|
||||
if( element.filedApiName == selectedvalue ){
|
||||
//dataType = element.dataType;
|
||||
//console.log('*********-->'+selectedvalue);
|
||||
//console.log(selectedvalue);
|
||||
component.set("v.type",element.dataType);
|
||||
if(element.dataType == 'STRING' || element.dataType == 'TEXTAREA' || element.dataType == 'PICKLIST' || element.dataType == 'ADDRESS' || element.dataType == 'URL' || element.dataType == 'EMAIL' || element.dataType == 'ID'){
|
||||
dataType = 'string';
|
||||
}else if(element.dataType == 'DOUBLE' || element.dataType == 'CURRENCY' || element.dataType == 'INTEGER'){
|
||||
dataType = 'number';
|
||||
}else if(element.dataType == 'DATE' || element.dataType == 'DATETIME'){
|
||||
dataType = 'datetime';
|
||||
}else if(element.dataType == 'BOOLEAN'){
|
||||
dataType = 'boolean';
|
||||
}else if( element.dataType == 'PHONE'){
|
||||
dataType = 'phone';
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
var options = component.get("v.options");
|
||||
var filterList = [];
|
||||
if( dataType != null && dataType != ''){
|
||||
var objectTableData2 = component.get("v.objectTableData2");
|
||||
//console.log('*****dataType****'+dataType);
|
||||
objectTableData2.forEach(function(element) {
|
||||
//console.log(element);
|
||||
if(dataType.toLowerCase() == 'string'){
|
||||
filterList.push( element );
|
||||
var newItem = {};
|
||||
newItem['label'] = element.UI_Label_Name__c;
|
||||
newItem['value'] = element.Name;
|
||||
options.push(newItem);
|
||||
}
|
||||
|
||||
else if( element.HIC_ShopifySync__Data_Type__c.toLowerCase() == dataType.toLowerCase() ){
|
||||
//console.log('*****element.Data_Type__c****'+element.HIC_ShopifySync__Data_Type__c);
|
||||
filterList.push( element );
|
||||
var newItem = {};
|
||||
newItem['label'] = element.HIC_ShopifySync__UI_Label_Name__c;
|
||||
newItem['value'] = element.Name;
|
||||
options.push(newItem);
|
||||
}
|
||||
});
|
||||
|
||||
//console.log( filterList );
|
||||
component.set("v.filteredList",filterList);
|
||||
//console.log( component.get("v.filteredList"));
|
||||
// console.log( filterList);
|
||||
//component.set("v.options",options);
|
||||
// console.log( component.get("v.options"));
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
openmodal:function(component,event,helper) {
|
||||
var cmpTarget = component.find('Modalbox');
|
||||
var cmpBack = component.find('Modalbackdrop');
|
||||
$A.util.addClass(cmpTarget, 'slds-fade-in-open');
|
||||
$A.util.addClass(cmpBack, 'slds-backdrop--open');
|
||||
component.set("v.applyandcloseerror",false);
|
||||
// plValue = component.find("multiPicklist").get("v.value")
|
||||
|
||||
},
|
||||
defaultMappingchange:function(component,event,helper) {
|
||||
var defaultCheck = component.get("v.objectInstance.DefaultValue");
|
||||
if(defaultCheck){
|
||||
//component.set("v.objectInstance.DefaultValue",false);
|
||||
}else{
|
||||
//component.set("v.objectInstance.DefaultValue",true);
|
||||
}
|
||||
|
||||
},
|
||||
getFilteredList:function(component,event,helper) {
|
||||
//console.log( 'getFilteredList++++' );
|
||||
//console.log( event.getSource().get("v.value") );
|
||||
|
||||
var selectedvalue = event.getSource().get("v.value");
|
||||
var dataTable2 = component.get("v.table2Data");
|
||||
var accountlist = component.get("v.ObjectListPassed");
|
||||
var duplicateListVaue = 1;
|
||||
console.log('dataTable2');
|
||||
//console.log(JSON.stringify(component.get("v.objectInstance")));
|
||||
//console.log(JSON.stringify(dataTable2));
|
||||
for(var item in accountlist){
|
||||
if(accountlist[item]['salesforcefields'] == selectedvalue ){
|
||||
duplicateListVaue = duplicateListVaue + 1;
|
||||
}
|
||||
|
||||
}
|
||||
if(duplicateListVaue >= 3){
|
||||
component.set("v.isOpen",true);
|
||||
setTimeout(function(){
|
||||
component.set("v.isOpen",false);
|
||||
event.getSource().set("v.value","");
|
||||
},2000);
|
||||
|
||||
}else{
|
||||
component.set("v.isOpen",false);
|
||||
}
|
||||
var validForm = component.find('shopifyfield').get("v.validity");
|
||||
//debugger;
|
||||
var dataType = '';
|
||||
console.log(selectedvalue);
|
||||
dataTable2.forEach(function(element) {
|
||||
if( element.filedApiName == selectedvalue ){
|
||||
console.log('element.filedApiName--');
|
||||
console.log(element.filedApiName);
|
||||
console.log(element.dataType);
|
||||
//dataType = element.dataType;
|
||||
component.set("v.type",element.dataType);
|
||||
if(element.dataType == 'STRING' || element.dataType == 'TEXTAREA' || element.dataType == 'PICKLIST' || element.dataType == 'ADDRESS' || element.dataType == 'URL' || element.dataType == 'EMAIL' || element.dataType == 'ID'){
|
||||
dataType = 'string';
|
||||
}else if(element.dataType == 'DOUBLE' || element.dataType == 'CURRENCY' || element.dataType == 'INTEGER' || element.dataType == 'PERCENT'){
|
||||
dataType = 'number';
|
||||
}else if(element.dataType == 'DATE' || element.dataType == 'DATETIME'){
|
||||
dataType = 'datetime';
|
||||
}else if(element.dataType == 'BOOLEAN'){
|
||||
dataType = 'boolean';
|
||||
}else if( element.dataType == 'PHONE'){
|
||||
dataType = 'phone';
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
var options = component.get("v.options");
|
||||
var filterList = [];
|
||||
if( dataType != null && dataType != ''){
|
||||
var objectTableData2 = component.get("v.objectTableData2");
|
||||
objectTableData2.forEach(function(element) {
|
||||
if(dataType.toLowerCase() == 'string'){
|
||||
filterList.push( element );
|
||||
var newItem = {};
|
||||
newItem['label'] = element.UI_Label_Name__c;
|
||||
newItem['value'] = element.Name;
|
||||
options.push(newItem);
|
||||
}
|
||||
|
||||
else if( element.HIC_ShopifySync__Data_Type__c.toLowerCase() == dataType.toLowerCase() ){
|
||||
filterList.push( element );
|
||||
var newItem = {};
|
||||
newItem['label'] = element.HIC_ShopifySync__UI_Label_Name__c;
|
||||
newItem['value'] = element.Name;
|
||||
options.push(newItem);
|
||||
}
|
||||
});
|
||||
|
||||
component.set("v.filteredList",filterList);
|
||||
component.set("v.options",options);
|
||||
}
|
||||
},
|
||||
getFilteredList2:function(component,event,helper) {
|
||||
var nestevalue = false ;
|
||||
var singlevalue = false ;
|
||||
var nestedfield = '';
|
||||
var selectedvalue1 = component.find('multiPicklist').get('v.value').split(";");
|
||||
selectedvalue1.forEach(function(element) {
|
||||
console.log('gerfilteredList2');
|
||||
console.log(element);
|
||||
if(element.includes('.') ){ //&& ( element.includes('default_address') || element.includes('shipping_address') ||element.includes('billing_address') )
|
||||
nestevalue = true;
|
||||
nestedfield = selectedvalue1[0].split(".")[0];
|
||||
}else{
|
||||
singlevalue = true;
|
||||
}
|
||||
})
|
||||
|
||||
if(nestevalue == true && singlevalue == true ){
|
||||
component.set("v.applyandcloseerror",true);
|
||||
component.set("v.selectedfieldmappingError"," *Please multiple select single fields or nested fields at a time.");
|
||||
|
||||
// alert('please choose single item or multiple');
|
||||
|
||||
}else{
|
||||
|
||||
var selectedvalue = component.find('multiPicklist').get('v.value');
|
||||
var filteredList = component.get("v.filteredList");
|
||||
var filterList = [];
|
||||
if(selectedvalue != '' && selectedvalue != null){
|
||||
|
||||
filteredList.forEach(function(element) {
|
||||
console.log('filter on');
|
||||
console.log(selectedvalue);
|
||||
console.log(nestedfield);
|
||||
console.log(element.HIC_ShopifySync__UI_Label_Name__c);
|
||||
/*if(selectedvalue.includes('.') && selectedvalue.includes('default_address')){
|
||||
|
||||
if( element.HIC_ShopifySync__UI_Label_Name__c.includes('.') && element.HIC_ShopifySync__UI_Label_Name__c.includes('default_address')){
|
||||
filterList.push( element );
|
||||
}
|
||||
|
||||
}else if(selectedvalue.includes('.') && selectedvalue.includes('shipping_address')){
|
||||
if( element.HIC_ShopifySync__UI_Label_Name__c.includes('.') && element.HIC_ShopifySync__UI_Label_Name__c.includes('shipping_address')){
|
||||
filterList.push( element );
|
||||
}
|
||||
|
||||
}else if(selectedvalue.includes('.') && selectedvalue.includes('billing_address')){
|
||||
if( element.HIC_ShopifySync__UI_Label_Name__c.includes('.') && element.HIC_ShopifySync__UI_Label_Name__c.includes('billing_address')){
|
||||
filterList.push( element );
|
||||
}
|
||||
|
||||
}else*/ if(selectedvalue.includes('.') && selectedvalue.includes(nestedfield)){
|
||||
if(nestedfield == element.HIC_ShopifySync__UI_Label_Name__c.split('.')[0] && element.HIC_ShopifySync__UI_Label_Name__c.includes('.') && element.HIC_ShopifySync__UI_Label_Name__c.includes(nestedfield)){
|
||||
filterList.push( element );
|
||||
}
|
||||
|
||||
}else {
|
||||
if( !element.HIC_ShopifySync__UI_Label_Name__c.includes('.')){
|
||||
filterList.push( element );
|
||||
}
|
||||
}
|
||||
});
|
||||
component.set("v.filteredList",filterList);
|
||||
component.set("v.applyandcloseerror",false);
|
||||
}
|
||||
//component.set(component.find('multiPicklist').get('v.value'),filterList);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
({
|
||||
getObjectFieldsHelper : function( component, event ) {
|
||||
|
||||
var action = component.get("c.getsObjectFields");
|
||||
|
||||
action.setCallback(this, function(response) {
|
||||
var state = response.getState();
|
||||
if (state === "SUCCESS" && response.getReturnValue() != null ) {
|
||||
component.set("v.objectTableData1",JSON.parse(response.getReturnValue()));
|
||||
}
|
||||
else if (state === "INCOMPLETE") {
|
||||
// do something
|
||||
}
|
||||
else if (state === "ERROR") {
|
||||
var errors = response.getError();
|
||||
if (errors) {
|
||||
if (errors[0] && errors[0].message) {
|
||||
console.log("Error message: " +
|
||||
errors[0].message);
|
||||
}
|
||||
} else {
|
||||
console.log("Unknown error");
|
||||
}
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(action);
|
||||
},
|
||||
InsertFilteredlist : function( component, event ) {
|
||||
var selectedvalue = component.get("v.objectInstance.salesforcefields") ;
|
||||
var dataTable2 = component.get("v.table2Data");
|
||||
var dataType = '';
|
||||
dataTable2.forEach(function(element) {
|
||||
if( element.filedApiName == selectedvalue ){
|
||||
//dataType = element.dataType;
|
||||
component.set("v.type",element.dataType);
|
||||
if(element.dataType == 'STRING' || element.dataType == 'TEXTAREA' || element.dataType == 'PICKLIST' || element.dataType == 'ADDRESS' || element.dataType == 'URL' || element.dataType == 'EMAIL' || element.dataType == 'ID'){
|
||||
dataType = 'string';
|
||||
}else if(element.dataType == 'DOUBLE' || element.dataType == 'CURRENCY' || element.dataType == 'INTEGER' || element.dataType == 'PERCENT'){
|
||||
dataType = 'number';
|
||||
}else if(element.dataType == 'DATE' || element.dataType == 'DATETIME'){
|
||||
dataType = 'datetime';
|
||||
}else if(element.dataType == 'BOOLEAN'){
|
||||
dataType = 'boolean';
|
||||
}else if( element.dataType == 'PHONE'){
|
||||
dataType = 'phone';
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
var options = component.get("v.options");
|
||||
var filterList = [];
|
||||
if( dataType != null && dataType != ''){
|
||||
var objectTableData2 = component.get("v.objectTableData2");
|
||||
objectTableData2.forEach(function(element) {
|
||||
if(dataType.toLowerCase() == 'string'){
|
||||
filterList.push( element );
|
||||
var newItem = {};
|
||||
newItem['label'] = element.UI_Label_Name__c;
|
||||
newItem['value'] = element.Name;
|
||||
options.push(newItem);
|
||||
}
|
||||
|
||||
else if( element.HIC_ShopifySync__Data_Type__c.toLowerCase() == dataType.toLowerCase() ){
|
||||
filterList.push( element );
|
||||
var newItem = {};
|
||||
newItem['label'] = element.HIC_ShopifySync__UI_Label_Name__c;
|
||||
newItem['value'] = element.Name;
|
||||
options.push(newItem);
|
||||
}
|
||||
});
|
||||
|
||||
component.set("v.filteredList",filterList);
|
||||
component.set("v.options",options);
|
||||
}
|
||||
|
||||
//var accountlist = component.get("v.accountList");
|
||||
|
||||
/*var selectedlist = JSON.stringify(component.get("v.objectInstance.shopifyFieldName"));
|
||||
var selectedlist2 = JSON.stringify(component.get("v.objectInstance.salesforcefields"));
|
||||
|
||||
if(selectedlist != "undefined"){
|
||||
//component.set("v.objectInstance.selectedfields", selectedlist);
|
||||
component.find("shopifyfield").set("v.value", selectedlist);
|
||||
}
|
||||
*/
|
||||
|
||||
},
|
||||
|
||||
})
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
({
|
||||
// Your renderer method overrides go here
|
||||
})
|
||||
|
|
@ -0,0 +1,350 @@
|
|||
<aura:component controller="AddDeleteController" >
|
||||
<!-- <ltng:require styles="/resource/SLDS0122/assets/styles/salesforce-lightning-design-system.min.css"/>-->
|
||||
|
||||
<aura:registerEvent name="CloseSpinner" type="c:CloseSpinner"/>
|
||||
<aura:attribute name="newAccount" type="Account"/>
|
||||
<aura:attribute name="accName" type="String" default=""/>
|
||||
<aura:attribute name="DointComplete" type="boolean" default="false"/>
|
||||
<aura:attribute name="orderCheck" type="boolean" />
|
||||
<aura:attribute name="opportunityCheck" type="boolean" />
|
||||
<aura:attribute name="opportunityProductCheck" type="boolean" default="true"/>
|
||||
<aura:attribute name="orderFulfillment" type="boolean" />
|
||||
<aura:attribute name="draftEnability" type="boolean" />
|
||||
<aura:attribute name="configObj" type="object" />
|
||||
<aura:attribute name="accountRecordType" type="String" />
|
||||
<aura:handler name="init" value="this" action="{!c.doInit}" />
|
||||
<aura:attribute name="listAccessScopeError" type= "list" default="['red','blue','green']"/>
|
||||
<aura:attribute name= "AccessScopeShow" type= "boolean" default = "false"/>
|
||||
<aura:attribute name="AccessScope" type= "string" />
|
||||
<aura:attribute name="OrderOppDisable" type="boolean" default="true"/>
|
||||
<aura:registerEvent name="ParentSaveButtonEvt" type="c:ParentSaveButtonEvent"/>
|
||||
<aura:registerEvent name="ParentPrevButtonEvt" type="c:ParentPrevButtonEvent"/>
|
||||
<aura:attribute name="Spinner" type="boolean" default="false"/>
|
||||
<aura:attribute name="Iscomplete" type="boolean" default="false"/>
|
||||
<aura:attribute name="IsPerson" type="boolean" default="false"/>
|
||||
<aura:attribute name="GoDisableButton" type="boolean" default="false"/>
|
||||
<aura:attribute name="PreDisableButton" type="boolean" default="false"/>
|
||||
<aura:attribute name="storeurl" type= "string" />
|
||||
<aura:attribute name = "store" type="string" default="default"/>
|
||||
|
||||
<!--loading spinner start... style=Brand Medium (blue dots)-->
|
||||
|
||||
<!-- Loading spinner end-->
|
||||
<aura:if isTrue="{!v.DointComplete}">
|
||||
<div class="slds-p-horizontal_large">
|
||||
<div class="slds-float_left slds-m-around_x-small">
|
||||
<img width="70" height="70" src="https://cdn.shopify.com/assets/images/logos/shopify-bag.png" /> <b>{!v.store}</b>
|
||||
</div>
|
||||
<table class="slds-table slds-table_cell-buffer slds-table_bordered">
|
||||
|
||||
<thead>
|
||||
<tr class="slds-line-height_reset">
|
||||
<th class="slds-text-title_caps" scope="col">
|
||||
<div class="slds-truncate" > Shopify </div>
|
||||
</th>
|
||||
<th class="slds-text-title_caps" scope="col">
|
||||
<div class="slds-truncate" > Salesforce </div>
|
||||
</th>
|
||||
</tr>
|
||||
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="slds-line-height_reset">
|
||||
<th class="slds-text-title_caps" scope="col">
|
||||
<div class="slds-text-body_regular iconstyles"><lightning:icon style="margin-right: 10px;" iconName='standard:product_required' /> Collection </div>
|
||||
</th>
|
||||
<th class="slds-text-title_caps" scope="col">
|
||||
<!-- <div class="slds-text-body_regular" >
|
||||
<ui:inputCheckbox aura:id="checkbox" label=" Collection" value="{!v.configObj.HIC_ShopifySync__Collection__c}"/>
|
||||
</div>-->
|
||||
|
||||
<div class="slds-form-element" style = " align-content: center">
|
||||
<label class="slds-checkbox_toggle slds-grid">
|
||||
<!--ui:inputCheckbox aura:id="checkbox" disabled="true" value="{!v.configObj.HIC_ShopifySync__Collection__c}" /-->
|
||||
<input type="checkbox" name="checkbox-toggle-14" value="{!v.configObj.HIC_ShopifySync__Collection__c}" disabled="true" checked = "{!v.configObj.HIC_ShopifySync__Collection__c}" aria-describedby="checkbox-toggle-14" />
|
||||
<span id="checkbox-toggle-14" class="slds-checkbox_faux_container" aria-live="assertive">
|
||||
<span class="slds-checkbox_faux"></span>
|
||||
<span class="slds-checkbox_on">Enabled</span>
|
||||
<span class="slds-checkbox_off">Disabled</span>
|
||||
</span>
|
||||
<span class="slds-form-element__label slds-m-bottom_none"> Collection </span>
|
||||
</label>
|
||||
|
||||
</div>
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
<tr class="slds-line-height_reset">
|
||||
<th class="slds-text-title_caps" scope="col">
|
||||
<div class="slds-text-body_regular iconstyles"><lightning:icon style="margin-right: 10px;" iconName='standard:location' /> Location/Inventory </div>
|
||||
</th>
|
||||
<th class="slds-text-title_caps" scope="col">
|
||||
<!--<div class="slds-text-body_regular">
|
||||
<ui:inputCheckbox aura:id="checkbox" label=" Inventory/Location" value="{!v.configObj.HIC_ShopifySync__Inventory_Location__c }"/>
|
||||
</div>-->
|
||||
<div class="slds-form-element" style = " align-content: center">
|
||||
<label class="slds-checkbox_toggle slds-grid">
|
||||
<!--ui:inputCheckbox aura:id="checkbox" value="{!v.configObj.HIC_ShopifySync__Inventory_Location__c }" /-->
|
||||
<input type="checkbox" name="checkbox-toggle-14" value="{!v.configObj.HIC_ShopifySync__Inventory_Location__c }" disabled="true" checked = "{!v.configObj.HIC_ShopifySync__Inventory_Location__c }" aria-describedby="checkbox-toggle-14" />
|
||||
<span id="checkbox-toggle-14" class="slds-checkbox_faux_container" aria-live="assertive">
|
||||
<span class="slds-checkbox_faux"></span>
|
||||
<span class="slds-checkbox_on">Enabled</span>
|
||||
<span class="slds-checkbox_off">Disabled</span>
|
||||
</span>
|
||||
<span class="slds-form-element__label slds-m-bottom_none"> Location/Inventory </span>
|
||||
</label>
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
<tr class="slds-line-height_reset">
|
||||
<th class="slds-text-title_caps" scope="col">
|
||||
<div class="slds-text-body_regular iconstyles"><lightning:icon style="margin-right: 10px;" iconName='standard:product' /> Product </div>
|
||||
</th>
|
||||
<th class="slds-text-title_caps" scope="col">
|
||||
<!-- <div class="slds-text-body_regular">
|
||||
<lightning:icon iconName="action:check" size="XXX-Small" alternativeText="Indicates approval"/>
|
||||
Product
|
||||
</div>-->
|
||||
<div class="slds-form-element" style = " align-content: center">
|
||||
<label class="slds-checkbox_toggle slds-grid">
|
||||
<input type="checkbox" name="checkbox-toggle-14" value="checkbox-toggle-14" disabled="true" checked = "true" aria-describedby="checkbox-toggle-14" />
|
||||
<span id="checkbox-toggle-14" class="slds-checkbox_faux_container" aria-live="assertive">
|
||||
<span class="slds-checkbox_faux"></span>
|
||||
<span class="slds-checkbox_on">Enabled</span>
|
||||
<span class="slds-checkbox_off">Disabled</span>
|
||||
</span>
|
||||
<span class="slds-form-element__label slds-m-bottom_none"> Product </span>
|
||||
</label>
|
||||
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
<tr class="slds-line-height_reset" >
|
||||
<th class="slds-text-title_caps" scope="col">
|
||||
<div class="slds-text-body_regular iconstyles"> <lightning:icon style="margin-right: 10px;" iconName='standard:person_account' /> Customer </div>
|
||||
</th>
|
||||
<th class="slds-text-title_caps" scope="col">
|
||||
<div class="slds-text-body_regular">
|
||||
<lightning:select aura:id="customervalue" name="selectItem" label="" value="{!v.accountRecordType}">
|
||||
<option value="Business Account">Account & Contact</option>
|
||||
<aura:if isTrue = "{!v.IsPerson}">
|
||||
<option value="Person Account">Person Account</option>
|
||||
</aura:if>
|
||||
</lightning:select>
|
||||
<!--<lightning:icon iconName="action:check" size="XX-Small" alternativeText="Indicates approval"/> Account & Contact -->
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
<tr class="slds-line-height_reset">
|
||||
<th class="slds-text-title_caps" scope="col">
|
||||
<div class="slds-text-body_regular iconstyles"> <lightning:icon style="margin-right: 10px;" iconName='standard:orders' /> Order </div>
|
||||
</th>
|
||||
<th class="slds-text-title_caps" scope="col">
|
||||
<!--<div class="slds-text-body_regular">
|
||||
<ui:inputCheckbox aura:id="checkbox" label=" Order" value="{!v.configObj.HIC_ShopifySync__Order__c}"/>
|
||||
</div>-->
|
||||
<div class="slds-form-element" style = " align-content: center">
|
||||
<label class="slds-checkbox_toggle slds-grid">
|
||||
<ui:inputCheckbox aura:id="checkbox" name="OrderButton" disabled="{!!v.OrderOppDisable}" value="{!v.configObj.HIC_ShopifySync__Order__c}" change="{!c.onchangeOrderandOpportunity}" />
|
||||
|
||||
<span id="checkbox-toggle-14" class="slds-checkbox_faux_container" aria-live="assertive">
|
||||
<span class="slds-checkbox_faux"></span>
|
||||
<span class="slds-checkbox_on">Enabled</span>
|
||||
<span class="slds-checkbox_off">Disabled</span>
|
||||
</span>
|
||||
<span class="slds-form-element__label slds-m-bottom_none"> Order </span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="slds-form-element" style = " align-content: center">
|
||||
<label class="slds-checkbox_toggle slds-grid">
|
||||
<ui:inputCheckbox aura:id="checkbox" name="OpportunityButton" disabled="{!!v.OrderOppDisable}" value="{!v.configObj.HIC_ShopifySync__Opportunity__c}" change="{!c.onchangeOrderandOpportunity}" />
|
||||
<span id="checkbox-toggle-14" class="slds-checkbox_faux_container" aria-live="assertive">
|
||||
<span class="slds-checkbox_faux"></span>
|
||||
<span class="slds-checkbox_on">Enabled</span>
|
||||
<span class="slds-checkbox_off">Disabled</span>
|
||||
</span>
|
||||
<span class="slds-form-element__label slds-m-bottom_none"> Opportunity </span>
|
||||
</label>
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
|
||||
<aura:if isTrue="{!v.configObj.HIC_ShopifySync__Order_Sync__c}">
|
||||
<tr class="slds-line-height_reset">
|
||||
<th class="slds-text-title_caps" scope="col">
|
||||
<div class="slds-text-body_regular iconstyles "><lightning:icon style="margin-right: 10px;" iconName='standard:product_item' /> Order Product </div>
|
||||
</th>
|
||||
<th class="slds-text-title_caps" scope="col">
|
||||
<!-- <div class="slds-text-body_regular">
|
||||
<lightning:icon iconName="action:check" size="XX-Small" alternativeText="Indicates approval"/> Order Item
|
||||
</div> -->
|
||||
<aura:if isTrue="{!v.configObj.HIC_ShopifySync__Order__c}">
|
||||
<div class="slds-form-element" style = " align-content: center">
|
||||
<label class="slds-checkbox_toggle slds-grid">
|
||||
<input type="checkbox" name="checkbox-toggle-14" value="checkbox-toggle-14" disabled="true" checked = "true" aria-describedby="checkbox-toggle-14" />
|
||||
<span id="checkbox-toggle-14" class="slds-checkbox_faux_container" aria-live="assertive">
|
||||
<span class="slds-checkbox_faux"></span>
|
||||
<span class="slds-checkbox_on">Enabled</span>
|
||||
<span class="slds-checkbox_off">Disabled</span>
|
||||
</span>
|
||||
<span class="slds-form-element__label slds-m-bottom_none"> Order Item </span>
|
||||
</label>
|
||||
</div>
|
||||
</aura:if>
|
||||
|
||||
<aura:if isTrue="{!v.configObj.HIC_ShopifySync__Opportunity__c}">
|
||||
<div class="slds-text-body_regular">
|
||||
<aura:if isTrue="{!v.configObj.HIC_ShopifySync__Order__c}">
|
||||
<!--<ui:inputCheckbox aura:id="checkbox" label=" Opportunity Line Item" value="{!v.configObj.HIC_ShopifySync__Opportunity_Line_Item__c}"/> -->
|
||||
<div class="slds-form-element" style = " align-content: center">
|
||||
<label class="slds-checkbox_toggle slds-grid">
|
||||
<ui:inputCheckbox aura:id="checkbox" value="{!v.configObj.HIC_ShopifySync__Opportunity_Line_Item__c}" />
|
||||
<span id="checkbox-toggle-14" class="slds-checkbox_faux_container" aria-live="assertive">
|
||||
<span class="slds-checkbox_faux"></span>
|
||||
<span class="slds-checkbox_on">Enabled</span>
|
||||
<span class="slds-checkbox_off">Disabled</span>
|
||||
</span>
|
||||
<span class="slds-form-element__label slds-m-bottom_none"> Opportunity Line Item </span>
|
||||
</label>
|
||||
</div>
|
||||
<aura:set attribute="else">
|
||||
<!--<ui:inputCheckbox aura:id="checkbox" label=" Opportunity Line Item" value="{!v.configObj.HIC_ShopifySync__Opportunity_Line_Item__c = (and(v.configObj.HIC_ShopifySync__Order__c == false, v.configObj.HIC_ShopifySync__Opportunity__c == true)?true:false)}" disabled="true"/>-->
|
||||
<div class="slds-form-element" style = " align-content: center">
|
||||
<label class="slds-checkbox_toggle slds-grid">
|
||||
<ui:inputCheckbox aura:id="checkbox" value="{!(and(v.configObj.HIC_ShopifySync__Order__c == false, v.configObj.HIC_ShopifySync__Opportunity__c == true)?true:false)}" disabled="true" change= "{!c.onCheckOpportunitylineItem}" />
|
||||
|
||||
<span id="checkbox-toggle-14" class="slds-checkbox_faux_container" aria-live="assertive">
|
||||
<span class="slds-checkbox_faux"></span>
|
||||
<span class="slds-checkbox_on">Enabled</span>
|
||||
<span class="slds-checkbox_off">Disabled</span>
|
||||
</span>
|
||||
<span class="slds-form-element__label slds-m-bottom_none"> Opportunity Line Item </span>
|
||||
</label>
|
||||
</div>
|
||||
</aura:set>
|
||||
</aura:if>
|
||||
</div>
|
||||
</aura:if>
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
</aura:if>
|
||||
|
||||
|
||||
<tr class="slds-line-height_reset">
|
||||
<th class="slds-text-title_caps" scope="col">
|
||||
<div class="slds-text-body_regular iconstyles"> <lightning:icon style="margin-right: 10px;" iconName='standard:work_order_item' /> Order's Fulfillment </div>
|
||||
</th>
|
||||
<th class="slds-text-title_caps" scope="col">
|
||||
<!-- <div class="slds-text-body_regular"> <ui:inputCheckbox aura:id="checkbox" label="" value="{!v.configObj.HIC_ShopifySync__Order_Fulfillment__c}"/> Order Fulfillment </div>-->
|
||||
<div class="slds-form-element" style = " align-content: center">
|
||||
<label class="slds-checkbox_toggle slds-grid">
|
||||
<ui:inputCheckbox aura:id="checkbox" name="Orderful" disabled="{!!v.OrderOppDisable}" value="{!v.configObj.HIC_ShopifySync__Order_Fulfillment__c}" change="{!c.onchangeOrderandOpportunity}"/>
|
||||
<!--input type="checkbox" name="checkbox-toggle-14" value="{!v.configObj.HIC_ShopifySync__Order_Fulfillment__c}" disabled="{!!v.OrderOppDisable}" checked = "{!v.configObj.HIC_ShopifySync__Order_Fulfillment__c}" aria-describedby="checkbox-toggle-14" /-->
|
||||
<span id="checkbox-toggle-14" class="slds-checkbox_faux_container" aria-live="assertive">
|
||||
<span class="slds-checkbox_faux"></span>
|
||||
<span class="slds-checkbox_on">Enabled</span>
|
||||
<span class="slds-checkbox_off">Disabled</span>
|
||||
</span>
|
||||
<span class="slds-form-element__label slds-m-bottom_none"> Order's Fulfillment </span>
|
||||
</label>
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
<tr class="slds-line-height_reset">
|
||||
<th class="slds-text-title_caps" scope="col">
|
||||
<div class="slds-text-body_regular iconstyles"><lightning:icon style="margin-right: 10px;" iconName='standard:return_order_line_item' /> Draft Order </div>
|
||||
</th>
|
||||
<th class="slds-text-title_caps" scope="col">
|
||||
<!--<div class="slds-text-body_regular"> <ui:inputCheckbox aura:id="checkbox" label="" value="{!v.configObj.HIC_ShopifySync__Enable_Draft_Order__c}"/> Order </div>-->
|
||||
<div class="slds-form-element" style = " align-content: center">
|
||||
<label class="slds-checkbox_toggle slds-grid">
|
||||
<!--ui:inputCheckbox aura:id="checkbox" value="{!v.configObj.HIC_ShopifySync__Enable_Draft_Order__c}" /-->
|
||||
<!--input type="checkbox" name="checkbox-toggle-14" value="{!v.configObj.HIC_ShopifySync__Enable_Draft_Order__c}" disabled="false" checked = "{!v.configObj.HIC_ShopifySync__Enable_Draft_Order__c}" aria-describedby="checkbox-toggle-14" /-->
|
||||
<!--ui:inputCheckbox aura:id="checkbox" value="{!(and(v.configObj.HIC_ShopifySync__Order__c == false, v.configObj.HIC_ShopifySync__Opportunity__c == true)?true:false)}" disabled="true" change= "{!c.onCheckOpportunitylineItem}" /-->
|
||||
<ui:inputCheckbox aura:id="checkbox" name="DraOrderButton" disabled="false" value="{!v.configObj.HIC_ShopifySync__Enable_Draft_Order__c}" change="{!c.onchangeOrderandOpportunity}" />
|
||||
<span id="checkbox-toggle-14" class="slds-checkbox_faux_container" aria-live="assertive">
|
||||
<span class="slds-checkbox_faux"></span>
|
||||
<span class="slds-checkbox_on">Enabled</span>
|
||||
<span class="slds-checkbox_off">Disabled</span>
|
||||
</span>
|
||||
<span class="slds-form-element__label slds-m-bottom_none"> Order </span>
|
||||
</label>
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
<aura:if isTrue="{!v.configObj.HIC_ShopifySync__Enable_Draft_Order__c}">
|
||||
<!-- <tr class="slds-line-height_reset">
|
||||
<th class="slds-text-title_caps" scope="col">
|
||||
<div class="slds-text-body_regular"> Draft Order </div>
|
||||
</th>
|
||||
<th class="slds-text-title_caps" scope="col">
|
||||
<div class="slds-text-body_regular"> <lightning:icon iconName="action:check" size="XX-Small" alternativeText="Indicates approval"/>Order </div>
|
||||
</th>
|
||||
</tr> -->
|
||||
<tr class="slds-line-height_reset">
|
||||
<th class="slds-text-title_caps" scope="col">
|
||||
<div class="slds-text-body_regular iconstyles"> <lightning:icon style="margin-right: 10px;" iconName='standard:return_order' /> Draft Order Line Item</div>
|
||||
</th>
|
||||
<th class="slds-text-title_caps" scope="col">
|
||||
<!--<div class="slds-text-body_regular"> <lightning:icon iconName="action:check" size="XX-Small" alternativeText="Indicates approval"/>Order Line Item </div> -->
|
||||
<div class="slds-form-element" style = " align-content: center">
|
||||
<label class="slds-checkbox_toggle slds-grid">
|
||||
<input type="checkbox" name="checkbox-toggle-14" value="checkbox-toggle-14" disabled="true" checked = "true" aria-describedby="checkbox-toggle-14" />
|
||||
<span id="checkbox-toggle-14" class="slds-checkbox_faux_container" aria-live="assertive">
|
||||
<span class="slds-checkbox_faux"></span>
|
||||
<span class="slds-checkbox_on">Enabled</span>
|
||||
<span class="slds-checkbox_off">Disabled</span>
|
||||
</span>
|
||||
<span class="slds-form-element__label slds-m-bottom_none"> Order Line Item </span>
|
||||
</label>
|
||||
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
</aura:if>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<center>
|
||||
<aura:if isTrue ="{!v.AccessScopeShow}" >
|
||||
<center>
|
||||
<div style = "width: 23em;">
|
||||
<ui:message title="Error" severity="error" closable="false" >
|
||||
<h1 style= "float:left"><b>This action requires merchant approval :- </b></h1> <br></br>
|
||||
<aura:iteration items="{!v.listAccessScopeError}" var="e">
|
||||
<li style= "float:left"> {!e} </li><br></br>
|
||||
</aura:iteration>
|
||||
</ui:message>
|
||||
</div>
|
||||
</center>
|
||||
</aura:if>
|
||||
<aura:if isTrue="{!v.DointComplete}">
|
||||
<div>
|
||||
<br /><br />
|
||||
<!--button class="slds-button slds-button_success" onclick="{!c.goPrev}">Go to the previous page</button-->
|
||||
<!--button class="slds-button slds-button_success" onclick="{!c.goNext}">Save & Go to the next step</button><br/-->
|
||||
<lightning:button iconName="utility:back"
|
||||
iconPosition="left"
|
||||
variant="success" label="Go to the previous page" title="Go to the previous page" disabled="{!v.PreDisableButton}" onclick="{!c.goPrev }"/>
|
||||
<lightning:button iconName="utility:forward"
|
||||
iconPosition="right"
|
||||
variant="success" label="Save & Go to the next step" title="Save & Go to the next step" disabled="{!v.GoDisableButton}" onclick="{!c.goNext }"/>
|
||||
<p style="margin-top:1%"><sup><b style="color: red;">*</b></sup> Don't worry you can change the steps later.</p>
|
||||
|
||||
<br />
|
||||
<br />
|
||||
</div>
|
||||
</aura:if>
|
||||
|
||||
|
||||
</center>
|
||||
</div>
|
||||
</aura:if>
|
||||
|
||||
</aura:component >
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||
<apiVersion>44.0</apiVersion>
|
||||
<description>A Lightning Component Bundle</description>
|
||||
</AuraDefinitionBundle>
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
.THIS input[type=checkbox]{
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
float: left;
|
||||
}
|
||||
.THIS .iconstyles{
|
||||
color : #747270 !important;
|
||||
}
|
||||
|
||||
.THIS .iconstyles svg{
|
||||
fill : white;
|
||||
background :#087ade;
|
||||
}
|
||||
|
||||
.THIS .tooltip {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
|
||||
}
|
||||
|
||||
.THIS .tooltip .tooltiptext {
|
||||
word-break: break-all;
|
||||
visibility: hidden;
|
||||
width: 2000%;
|
||||
height: auto;
|
||||
background-color: #0a4558;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
border-radius: 6px;
|
||||
padding: 5px 5px;
|
||||
|
||||
/*********toottip***/
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
top: -5px;
|
||||
left: 105%;
|
||||
}
|
||||
|
||||
.THIS .tooltip:hover .tooltiptext {
|
||||
visibility: visible;
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg width="120px" height="120px" viewBox="0 0 120 120" version="1.1" xmlns="/assets/icons/utility-sprite/svg/symbols.svg#check" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<path d="M120,108 C120,114.6 114.6,120 108,120 L12,120 C5.4,120 0,114.6 0,108 L0,12 C0,5.4 5.4,0 12,0 L108,0 C114.6,0 120,5.4 120,12 L120,108 L120,108 Z" id="Shape" fill="#2A739E"/>
|
||||
<path d="M77.7383308,20 L61.1640113,20 L44.7300055,63.2000173 L56.0543288,63.2000173 L40,99.623291 L72.7458388,54.5871812 L60.907727,54.5871812 L77.7383308,20 Z" id="Path-1" fill="#FFFFFF"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 685 B |
|
|
@ -0,0 +1,271 @@
|
|||
({
|
||||
doInit : function(component, event, helper) {
|
||||
|
||||
$A.util.removeClass(component.find("divparent"),"parent");
|
||||
console.log(">>>>>>>>>>>>>>");
|
||||
console.log(component.get("v.AccessScope"));
|
||||
console.log("<<<<<<<<<<<<<<");
|
||||
//component.set("v.Spinner",true);
|
||||
helper.getConfigurationData( component, event );
|
||||
helper.getIsPerson(component,event);
|
||||
|
||||
|
||||
|
||||
},
|
||||
|
||||
getConfigurationData : function( component, event ) {
|
||||
var ActionCheckIspersonEnabled = component.get("c.getIsPerson");
|
||||
ActionCheckIspersonEnabled.setCallback(this, function(res){
|
||||
var state = res.getState();
|
||||
console.log("state"+state);
|
||||
if(state === "SUCCESS" && res.getReturnValue() != null){
|
||||
console.log("isAccount"+res.getReturnValue());
|
||||
component.set("v.IsPerson",res.getReturnValue());
|
||||
var action = component.get("c.getGeneral");
|
||||
action.setParams({ 'store' : component.get("v.store")});
|
||||
|
||||
action.setCallback(this, function(response) {
|
||||
var state = response.getState();
|
||||
if (state === "SUCCESS" && response.getReturnValue() != null ) {
|
||||
var configObj = JSON.parse( response.getReturnValue() );
|
||||
console.log('config data');
|
||||
console.log(configObj);
|
||||
component.set("v.configObj", configObj);
|
||||
console.log('config setting');
|
||||
console.log(component.get('v.configObj.HIC_ShopifySync__Opportunity_Line_Item__c'));
|
||||
var accountandcontact = component.get('v.configObj.HIC_ShopifySync__Account_Contact__c');
|
||||
var personaccount = component.get('v.configObj.HIC_ShopifySync__Person_Account__c');
|
||||
component.set("v.DointComplete",true);
|
||||
console.log('DointComplete ',component.get("v.DointComplete"));
|
||||
if(accountandcontact){
|
||||
component.find("customervalue").set("v.value","Business Account");
|
||||
}
|
||||
if(personaccount){
|
||||
component.find("customervalue").set("v.value","Person Account");
|
||||
}
|
||||
component.set("v.DointComplete",false);
|
||||
|
||||
component.set("v.configObj.HIC_ShopifySync__Collection__c",component.get("v.configObj.HIC_ShopifySync__Collection_Sync__c"));
|
||||
if(!component.get("v.configObj.HIC_ShopifySync__Order_Sync__c")){
|
||||
component.set("v.OrderOppDisable",component.get("v.configObj.HIC_ShopifySync__Order_Sync__c"));
|
||||
}
|
||||
|
||||
|
||||
if(!component.get("v.configObj.HIC_ShopifySync__Order_Sync__c")){
|
||||
component.set("v.configObj.HIC_ShopifySync__Order_Fulfillment__c",component.get("v.configObj.HIC_ShopifySync__Order_Sync__c"));
|
||||
component.set("v.configObj.HIC_ShopifySync__Order__c",component.get("v.configObj.HIC_ShopifySync__Order_Sync__c"));
|
||||
component.set("v.configObj.HIC_ShopifySync__Opportunity__c",component.get("v.configObj.HIC_ShopifySync__Order_Sync__c"));
|
||||
}
|
||||
|
||||
|
||||
if(!component.get("v.configObj.HIC_ShopifySync__Order__c") && !component.get("v.configObj.HIC_ShopifySync__Opportunity__c") && component.get("v.configObj.HIC_ShopifySync__Order_Sync__c")){
|
||||
component.set("v.configObj.HIC_ShopifySync__Order_Fulfillment__c",false);
|
||||
component.set("v.configObj.HIC_ShopifySync__Order__c",true);
|
||||
component.set("v.configObj.HIC_ShopifySync__Opportunity__c",true);
|
||||
}
|
||||
|
||||
//component.set("v.configObj.HIC_ShopifySync__Enable_Draft_Order__c",component.get("v.configObj.HIC_ShopifySync__Draft_Order_Sync__c"));
|
||||
//component.set("v.configObj.HIC_ShopifySync__Inventory_Location__c",component.get("v.configObj.HIC_ShopifySync__Inventory_Location_Sync__c"));
|
||||
|
||||
|
||||
|
||||
// component.set("v.Spinner",false);
|
||||
}
|
||||
else if (state === "INCOMPLETE") {
|
||||
// do something
|
||||
}else if (state === "ERROR") {
|
||||
var errors = response.getError();
|
||||
if (errors) {
|
||||
if (errors[0] && errors[0].message) {
|
||||
console.log("Error message: " +
|
||||
errors[0].message);
|
||||
}
|
||||
} else {
|
||||
console.log("Unknown error");
|
||||
}
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(action);
|
||||
}
|
||||
})
|
||||
$A.enqueueAction(ActionCheckIspersonEnabled);
|
||||
|
||||
},
|
||||
|
||||
/*onchangeOrderandOpportunity: function(component, event, helper){
|
||||
console.debug(component.get("v.configObj.HIC_ShopifySync__Order__c"));
|
||||
console.debug(component.get("v.configObj.HIC_ShopifySync__Opportunity__c"));
|
||||
if(!component.get("v.configObj.HIC_ShopifySync__Order__c") && !component.get("v.configObj.HIC_ShopifySync__Opportunity__c")){
|
||||
component.set("v.configObj.HIC_ShopifySync__Order_Fulfillment__c",false);
|
||||
}
|
||||
|
||||
},*/
|
||||
|
||||
onchangeOrderandOpportunity: function(component, event, helper){
|
||||
var buttonName = event.getSource().get("v.name");
|
||||
var buttonValue = event.getSource().get("v.value");
|
||||
console.log(buttonName, '--', buttonValue);
|
||||
if(buttonName == 'OrderButton' && !buttonValue && !component.get("v.configObj.HIC_ShopifySync__Opportunity__c")){
|
||||
component.set("v.configObj.HIC_ShopifySync__Order__c",true);
|
||||
|
||||
}
|
||||
|
||||
if(buttonName == 'OpportunityButton' && !buttonValue && !component.get("v.configObj.HIC_ShopifySync__Order__c")){
|
||||
component.set("v.configObj.HIC_ShopifySync__Opportunity__c",true);
|
||||
}
|
||||
|
||||
if(buttonName == 'Orderful' && buttonValue && !component.get("v.configObj.HIC_ShopifySync__Order__c") && !component.get("v.configObj.HIC_ShopifySync__Opportunity__c")){
|
||||
component.set("v.configObj.HIC_ShopifySync__Order_Fulfillment__c",false);
|
||||
}
|
||||
|
||||
if(buttonName == 'DraOrderButton'){
|
||||
component.set("v.configObj.HIC_ShopifySync__Enable_Draft_Order__c", buttonValue);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
onCheckOrder: function(cmp, event, helper) {
|
||||
|
||||
cmp.set("v.configObj.HIC_ShopifySync__Order__c", event.target.checked);
|
||||
var configOrder = cmp.get("v.configObj.HIC_ShopifySync__Order__c");
|
||||
|
||||
|
||||
},
|
||||
|
||||
onCheckOpportunity: function(cmp, event, helper) {
|
||||
|
||||
cmp.set("v.configObj.HIC_ShopifySync__Opportunity__c", event.target.checked);
|
||||
},
|
||||
|
||||
onCheckDraftOrder: function(cmp, event, helper) {
|
||||
|
||||
cmp.set("v.configObj.HIC_ShopifySync__Enable_Draft_Order__c", event.target.checked);
|
||||
},
|
||||
onCheckOpportunitylineItem: function(cmp, event, helper) {
|
||||
|
||||
console.log(event.target.checked);
|
||||
cmp.set("v.configObj.HIC_ShopifySync__Order_Line_Item__c", event.target.checked);
|
||||
},
|
||||
goNext : function(component, event, helper) {
|
||||
console.log('>>>>>>>>>>>>>');
|
||||
component.set("v.GoDisableButton",true);
|
||||
document.getElementById("divparent").style.pointerEvents = "none";
|
||||
var configObj1 = component.get("v.configObj");
|
||||
var listAccessScopeError = [];
|
||||
var AccessScope = false;
|
||||
|
||||
if(component.get("v.AccessScope") != '' && component.get("v.AccessScope") != null){
|
||||
|
||||
/* if(component.get("v.configObj.HIC_ShopifySync__Order_Fulfillment__c") && !component.get("v.AccessScope").includes('read_fulfillments')){
|
||||
AccessScope = true;
|
||||
|
||||
if(!listAccessScopeError.includes('Order Fulfillment'))
|
||||
listAccessScopeError.push('Order Fulfillment');
|
||||
|
||||
} */
|
||||
if(component.get("v.configObj.HIC_ShopifySync__Collection__c") && !component.get("v.AccessScope").includes('read_products')){
|
||||
AccessScope = true;
|
||||
|
||||
if(!listAccessScopeError.includes('Product'))
|
||||
listAccessScopeError.push('Product');
|
||||
|
||||
}
|
||||
if(component.get("v.configObj.HIC_ShopifySync__Inventory_Location__c") && (!component.get("v.AccessScope").includes('read_inventory') || !component.get("v.AccessScope").includes('read_locations')) ){
|
||||
AccessScope = true;
|
||||
|
||||
if(!listAccessScopeError.includes('Location/Inventory'))
|
||||
listAccessScopeError.push('Location/Inventory');
|
||||
|
||||
}
|
||||
if(component.get("v.configObj.HIC_ShopifySync__Order__c") && !component.get("v.AccessScope").includes('read_orders')){
|
||||
AccessScope = true;
|
||||
|
||||
if(!listAccessScopeError.includes('Order'))
|
||||
listAccessScopeError.push('Order');
|
||||
|
||||
}
|
||||
if(component.get("v.configObj.HIC_ShopifySync__Enable_Draft_Order__c") && !component.get("v.AccessScope").includes('read_draft_orders')){
|
||||
AccessScope = true;
|
||||
|
||||
if(!listAccessScopeError.includes('Draft Order'))
|
||||
listAccessScopeError.push('Draft Order');
|
||||
|
||||
}
|
||||
|
||||
component.set("v.listAccessScopeError",listAccessScopeError);
|
||||
component.set("v.AccessScopeShow",AccessScope);
|
||||
console.log(component.get("v.AccessScopeShow"));
|
||||
console.log(component.get("v.listAccessScopeError"));
|
||||
|
||||
}
|
||||
|
||||
if(!AccessScope){
|
||||
component.set("v.Spinner",true);
|
||||
console.log("accountRecordType");
|
||||
console.log(component.get("v.accountRecordType"));
|
||||
var configObj = component.get("v.configObj");
|
||||
console.log("configObj");
|
||||
console.log(JSON.stringify(configObj));
|
||||
if(component.get("v.accountRecordType") == "Business Account"){
|
||||
configObj["HIC_ShopifySync__Account_Contact__c"] = true;
|
||||
configObj["HIC_ShopifySync__Person_Account__c"] = false;
|
||||
|
||||
}
|
||||
else if(component.get("v.accountRecordType") == "Person Account"){
|
||||
configObj["HIC_ShopifySync__Account_Contact__c"] = false;
|
||||
configObj["HIC_ShopifySync__Person_Account__c"] = true;
|
||||
configObj["HIC_ShopifySync__Default_Account__c"] = false;
|
||||
}
|
||||
console.log("configObj After");
|
||||
console.log(JSON.stringify(configObj));
|
||||
|
||||
|
||||
var action = component.get("c.saveConfigration");
|
||||
|
||||
action.setParams({ 'configObj' : JSON.stringify( component.get("v.configObj")),
|
||||
'check' : 'False'});
|
||||
|
||||
action.setCallback(this, function(response) {
|
||||
var state = response.getState();
|
||||
if (state === "SUCCESS" && response.getReturnValue() != null ) {
|
||||
document.getElementById("divparent").style.pointerEvents = "all";
|
||||
console.log(component.getEvent("ParentSaveButtonEvt").getEventType());
|
||||
component.getEvent("ParentSaveButtonEvt").fire();
|
||||
|
||||
//var appEvent = $A.get("e.HIC_Shopify:ParentSaveButtonEvt");
|
||||
//debugger;
|
||||
//appEvent.setParams({"typeSubTypeMap" : component.get("v.typeSubTypeMap")});
|
||||
//appEvent.fire();
|
||||
|
||||
console.log('**********saveConfigration************');
|
||||
console.log(response.getReturnValue());
|
||||
}
|
||||
else if (state === "INCOMPLETE") {
|
||||
|
||||
}else if (state === "ERROR") {
|
||||
var errors = response.getError();
|
||||
if (errors) {
|
||||
if (errors[0] && errors[0].message) {
|
||||
console.log("Error message: " +
|
||||
errors[0].message);
|
||||
}
|
||||
} else {
|
||||
console.log("Unknown error");
|
||||
}
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(action);
|
||||
}else{
|
||||
component.set("v.GoDisableButton",false);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
goPrev : function(component, event, helper) {
|
||||
component.set("v.PreDisableButton",true);
|
||||
console.log('**********previous************');
|
||||
component.getEvent("ParentPrevButtonEvt").fire();
|
||||
console.log('**********previous 2************');
|
||||
}
|
||||
|
||||
})
|
||||
|
|
@ -0,0 +1,107 @@
|
|||
({
|
||||
getConfigurationData : function( component, event ) {
|
||||
var ActionCheckIspersonEnabled = component.get("c.getIsPerson");
|
||||
ActionCheckIspersonEnabled.setCallback(this, function(res){
|
||||
var state = res.getState();
|
||||
console.log("state"+state);
|
||||
if(state === "SUCCESS" && res.getReturnValue() != null){
|
||||
console.log("isAccount"+res.getReturnValue());
|
||||
console.log(component.get("v.storeurl"));
|
||||
component.set("v.IsPerson",res.getReturnValue());
|
||||
var action = component.get("c.getGeneral");
|
||||
action.setParams({ 'store' : JSON.stringify(component.get("v.storeurl"))});
|
||||
action.setCallback(this, function(response) {
|
||||
var state = response.getState();
|
||||
if (state === "SUCCESS" && response.getReturnValue() != null ) {
|
||||
var configObj = JSON.parse( response.getReturnValue() );
|
||||
console.log('config data');
|
||||
console.log(configObj);
|
||||
component.set("v.configObj", configObj);
|
||||
console.log('config setting');
|
||||
console.log(component.get('v.configObj.HIC_ShopifySync__Opportunity_Line_Item__c'));
|
||||
var accountandcontact = component.get('v.configObj.HIC_ShopifySync__Account_Contact__c');
|
||||
var personaccount = component.get('v.configObj.HIC_ShopifySync__Person_Account__c');
|
||||
component.set("v.DointComplete",true);
|
||||
if(accountandcontact){
|
||||
component.find("customervalue").set("v.value","Business Account");
|
||||
}
|
||||
if(personaccount){
|
||||
component.find("customervalue").set("v.value","Person Account");
|
||||
}
|
||||
component.set("v.DointComplete",false);
|
||||
|
||||
|
||||
component.set("v.configObj.HIC_ShopifySync__Collection__c",component.get("v.configObj.HIC_ShopifySync__Collection_Sync__c"));
|
||||
if(!component.get("v.configObj.HIC_ShopifySync__Order_Sync__c")){
|
||||
component.set("v.OrderOppDisable",component.get("v.configObj.HIC_ShopifySync__Order_Sync__c"));
|
||||
}
|
||||
|
||||
|
||||
if(!component.get("v.configObj.HIC_ShopifySync__Order_Sync__c")){
|
||||
component.set("v.configObj.HIC_ShopifySync__Order_Fulfillment__c",component.get("v.configObj.HIC_ShopifySync__Order_Sync__c"));
|
||||
component.set("v.configObj.HIC_ShopifySync__Order__c",component.get("v.configObj.HIC_ShopifySync__Order_Sync__c"));
|
||||
component.set("v.configObj.HIC_ShopifySync__Opportunity__c",component.get("v.configObj.HIC_ShopifySync__Order_Sync__c"));
|
||||
}
|
||||
|
||||
|
||||
if(!component.get("v.configObj.HIC_ShopifySync__Order__c") && !component.get("v.configObj.HIC_ShopifySync__Opportunity__c") && component.get("v.configObj.HIC_ShopifySync__Order_Sync__c")){
|
||||
component.set("v.configObj.HIC_ShopifySync__Order_Fulfillment__c",false);
|
||||
component.set("v.configObj.HIC_ShopifySync__Order__c",true);
|
||||
component.set("v.configObj.HIC_ShopifySync__Opportunity__c",true);
|
||||
}
|
||||
console.log('enable order value');
|
||||
console.log(component.get("v.configObj.HIC_ShopifySync__Enable_Draft_Order__c"));
|
||||
//component.set("v.configObj.HIC_ShopifySync__Draft_Order_Sync__c",component.get("v.configObj.HIC_ShopifySync__Enable_Draft_Order__c"));
|
||||
//component.set("v.configObj.HIC_ShopifySync__Inventory_Location__c",component.get("v.configObj.HIC_ShopifySync__Inventory_Location_Sync__c"));
|
||||
console.log(component.get("v.configObj.HIC_ShopifySync__Draft_Order_Sync__c"));
|
||||
component.set("v.DointComplete",true);
|
||||
component.set("v.Spinner",false);
|
||||
|
||||
|
||||
console.log("Scroller top");
|
||||
|
||||
var CloseSpinnerEventFire = $A.get("e.c:CloseSpinner");
|
||||
CloseSpinnerEventFire.setParams({
|
||||
"Spinner" : false });
|
||||
CloseSpinnerEventFire.fire();
|
||||
console.log("CloseSpinnerEventFire fired");
|
||||
|
||||
// component.set("v.Spinner",false);
|
||||
}
|
||||
else if (state === "INCOMPLETE") {
|
||||
// do something
|
||||
}else if (state === "ERROR") {
|
||||
var errors = response.getError();
|
||||
if (errors) {
|
||||
if (errors[0] && errors[0].message) {
|
||||
console.log("Error message: " +
|
||||
errors[0].message +" no. "+ errors[0].LineNumber);
|
||||
}
|
||||
} else {
|
||||
console.log("Unknown error");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$A.enqueueAction(action);
|
||||
}
|
||||
})
|
||||
$A.enqueueAction(ActionCheckIspersonEnabled);
|
||||
|
||||
},
|
||||
getIsPerson : function(component , event){
|
||||
var ActionCheckIspersonEnabled = component.get("c.getIsPerson");
|
||||
ActionCheckIspersonEnabled.setCallback(this, function(res){
|
||||
var state = res.getState();
|
||||
console.log("state"+state);
|
||||
if(state === "SUCCESS" && res.getReturnValue() != null){
|
||||
console.log("isAccount"+res.getReturnValue());
|
||||
component.set("v.IsPerson",res.getReturnValue());
|
||||
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
$A.enqueueAction(ActionCheckIspersonEnabled);
|
||||
},
|
||||
})
|
||||
|
|
@ -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>
|
||||
|
|
@ -0,0 +1,356 @@
|
|||
<aura:component controller="AddDeleteController">
|
||||
<aura:attribute name="store" type="string" default="default"/>
|
||||
<aura:attribute name="processForNewStore" type="boolean" default="false"/>
|
||||
|
||||
<aura:attribute name="samplebuttonshow" type="boolean" default="true"/>
|
||||
<aura:attribute name="OpenSampledataModel" type="boolean" default="false"/>
|
||||
<aura:attribute name="GoDisableButton" type="boolean" default="false"/>
|
||||
<aura:attribute name="PreDisableButton" type="boolean" default="false"/>
|
||||
<aura:attribute name="dosyncDisableButton" type="boolean" default="false"/>
|
||||
<aura:attribute name="PersonAccountRecordTypeList" type="list" />
|
||||
<aura:attribute name="AccountRecordTypeList" type="list" />
|
||||
<aura:attribute name="ContactRecordTypeList" type="list" />
|
||||
<aura:attribute name="OrderRecordTypeList" type="list" />
|
||||
<aura:attribute name="DraftorderRecordTypeList" type="list" />
|
||||
<aura:attribute name="OpportunityRecordTypeList" type="list" />
|
||||
<aura:attribute name='isProcess' type="boolean" default="false" />
|
||||
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
|
||||
<!--<aura:handler event="aura:waiting" action="{!c.showSpinner}"/>
|
||||
<aura:handler event="aura:doneWaiting" action="{!c.hideSpinner}"/>-->
|
||||
<aura:attribute name="PersonAccountRecordTypeId" type="String" />
|
||||
<aura:attribute name="AccountRecordTypeId" type="String" />
|
||||
<aura:attribute name="ContactRecordTypeId" type="String" />
|
||||
<aura:attribute name="OrderRecordTypeId" type="String" />
|
||||
<aura:attribute name="DraftorderRecordTypeId" type="String" />
|
||||
<aura:attribute name="OpportunityRecordTypeId" type="String" />
|
||||
<aura:attribute name="configObj" type="object" />
|
||||
|
||||
<aura:attribute name="ShowSyncButton" type="Boolean" default = "false" />
|
||||
<aura:registerEvent name="ParentSaveButtonEvt" type="c:ParentSaveButtonEvent"/>
|
||||
<aura:registerEvent name="ParentPrevButtonEvt" type="c:ParentPrevButtonEvent"/>
|
||||
<aura:attribute name="Spinner" type="boolean" default="false"/>
|
||||
<aura:attribute name="processbatch" type="boolean" default="false"/>
|
||||
|
||||
<!--loading spinner start... style=Brand Medium (blue dots)-->
|
||||
|
||||
<!-- Loading spinner end-->
|
||||
<div class="slds-float_left slds-m-around_x-small">
|
||||
<img width="70" height="70" src="https://cdn.shopify.com/assets/images/logos/shopify-bag.png" /> <b>{!v.store}</b>
|
||||
</div>
|
||||
<div class="slds-p-horizontal_large" style="margin-top: 4em;">
|
||||
<aura:if isTrue="{!!v.isProcess}">
|
||||
<aura:if isTrue="{!!v.ShowSyncButton}" >
|
||||
|
||||
<table class="slds-table slds-table_bordered slds-table_cell-buffer">
|
||||
<tbody>
|
||||
<aura:if isTrue="{!v.configObj.HIC_ShopifySync__Person_Account__c}">
|
||||
<tr>
|
||||
<td>
|
||||
<div class="slds-form-element">
|
||||
<h1 class="slds-form-element__title">Person Account Record Type</h1>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="slds-form-element">
|
||||
<aura:if isTrue="{!v.PersonAccountRecordTypeList.length > 0}">
|
||||
<lightning:select name="selectItem" label="" value="{!v.PersonAccountRecordTypeId}">
|
||||
|
||||
<aura:iteration items="{!v.PersonAccountRecordTypeList}" var="accRecord" indexVar="index" >
|
||||
<option value="{!accRecord.Id}">{!accRecord.Name}</option>
|
||||
</aura:iteration>
|
||||
</lightning:select>
|
||||
<aura:set attribute="else">
|
||||
<p>No active account record type found</p>
|
||||
</aura:set>
|
||||
</aura:if>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</aura:if>
|
||||
<aura:if isTrue="{!v.configObj.HIC_ShopifySync__Account_Contact__c}">
|
||||
<tr>
|
||||
<td>
|
||||
<div class="slds-form-element">
|
||||
<h1 class="slds-form-element__title">Account Record Type</h1>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="slds-form-element">
|
||||
<aura:if isTrue="{!v.AccountRecordTypeList.length > 0}">
|
||||
<lightning:select name="selectItem" label="" value="{!v.AccountRecordTypeId}">
|
||||
<!--option value="">None</option-->
|
||||
<aura:iteration items="{!v.AccountRecordTypeList}" var="accRecord" indexVar="index" >
|
||||
<option value="{!accRecord.Id}">{!accRecord.Name}</option>
|
||||
</aura:iteration>
|
||||
</lightning:select>
|
||||
<aura:set attribute="else">
|
||||
<p>No active account record type found</p>
|
||||
</aura:set>
|
||||
</aura:if>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="slds-form-element">
|
||||
<h1 class="slds-form-element__title">Contact Record Type</h1>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="slds-form-element">
|
||||
<aura:if isTrue="{!v.ContactRecordTypeList.length > 0}">
|
||||
<div class="slds-form-element__control">
|
||||
<lightning:select name="selectItem" label="" value="{!v.ContactRecordTypeId}">
|
||||
<aura:iteration items="{!v.ContactRecordTypeList}" var="conRecord" indexVar="index" >
|
||||
<option value="{!conRecord.Id}">{!conRecord.Name}</option>
|
||||
</aura:iteration>
|
||||
</lightning:select>
|
||||
</div>
|
||||
<aura:set attribute="else">
|
||||
<p>No active contact record type found</p>
|
||||
</aura:set>
|
||||
</aura:if>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</aura:if>
|
||||
<aura:if isTrue="{!v.configObj.HIC_ShopifySync__Order__c}">
|
||||
<tr>
|
||||
<td>
|
||||
<div class="slds-form-element">
|
||||
<h1 class="slds-form-element__title">Order Record Type</h1>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="slds-form-element">
|
||||
<aura:if isTrue="{!v.OrderRecordTypeList.length > 0}">
|
||||
<div class="slds-form-element__control">
|
||||
<lightning:select name="selectItem" label="" value="{!v.OrderRecordTypeId}">
|
||||
<aura:iteration items="{!v.OrderRecordTypeList}" var="ordRecord" indexVar="index">
|
||||
<option value="{!ordRecord.Id}">{!ordRecord.Name}</option>
|
||||
</aura:iteration>
|
||||
</lightning:select>
|
||||
</div>
|
||||
<aura:set attribute="else">
|
||||
<p>No active order record type found</p>
|
||||
</aura:set>
|
||||
</aura:if>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</aura:if>
|
||||
<aura:if isTrue="{!v.configObj.HIC_ShopifySync__Opportunity__c}">
|
||||
<tr>
|
||||
<td>
|
||||
<div class="slds-form-element">
|
||||
<h1 class="slds-form-element__title">Opportunity Record Type</h1>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="slds-form-element">
|
||||
<aura:if isTrue="{!v.OpportunityRecordTypeList.length > 0}">
|
||||
<div class="slds-form-element__control">
|
||||
<lightning:select name="selectItem" label="" value="{!v.OpportunityRecordTypeId}">
|
||||
<aura:iteration items="{!v.OpportunityRecordTypeList}" var="oppRecord" indexVar="index">
|
||||
<option value="{!oppRecord.Id}">{!oppRecord.Name}</option>
|
||||
</aura:iteration>
|
||||
</lightning:select>
|
||||
</div>
|
||||
<aura:set attribute="else">
|
||||
<p>No active opportunity record type found</p>
|
||||
</aura:set>
|
||||
</aura:if>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</aura:if>
|
||||
<aura:if isTrue="{!v.configObj.HIC_ShopifySync__Enable_Draft_Order__c}">
|
||||
<tr>
|
||||
<td>
|
||||
<div class="slds-form-element">
|
||||
<h1 class="slds-form-element__title">Draft Order Record Type</h1>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="slds-form-element">
|
||||
<aura:if isTrue="{!v.DraftorderRecordTypeList.length > 0}">
|
||||
<div class="slds-form-element__control">
|
||||
<lightning:select name="selectItem" label="" value="{!v.DraftorderRecordTypeId}">
|
||||
<aura:iteration items="{!v.DraftorderRecordTypeList}" var="ordRecord" indexVar="index">
|
||||
<option value="{!ordRecord.Id}">{!ordRecord.Name}</option>
|
||||
</aura:iteration>
|
||||
</lightning:select>
|
||||
</div>
|
||||
<aura:set attribute="else">
|
||||
<p>No active order record type found</p>
|
||||
</aura:set>
|
||||
</aura:if>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</aura:if>
|
||||
</tbody>
|
||||
</table>
|
||||
<center style="margin-top: 9em;">
|
||||
<br/>
|
||||
<!--button class="slds-button slds-button_success" onclick="{!c.goPrev}">Go to the previous page</button>
|
||||
<button class="slds-button slds-button_success" onclick="{!c.goNext}">Save & Go to the next step</button><br/-->
|
||||
<lightning:button iconName="utility:back"
|
||||
iconPosition="left"
|
||||
variant="success" label="Go to the previous page" title="Go to the previous page" disabled="{!v.PreDisableButton}" onclick="{!c.goPrev}"/>
|
||||
<lightning:button iconName="utility:forward"
|
||||
iconPosition="right"
|
||||
variant="success" label="Save & Go to the next step" title="Save & Go to the next step" disabled="{!v.GoDisableButton}" onclick="{!c.goNext }"/>
|
||||
<p style="margin-top:1%"><sup><b style="color: red;">*</b></sup> Don't worry you can change the steps later.</p>
|
||||
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
</center>
|
||||
<aura:set attribute= "else">
|
||||
<center>
|
||||
<!--div style = "width: 23em;">
|
||||
<ui:message title="Information" severity="info" closable="false" >
|
||||
<h1 ><b>All settings will be saved after clicking on sync button!!</b></h1> <br></br>
|
||||
<button class="slds-button slds-button_brand" onclick="{!c.doSync}">Start Sync</button>
|
||||
</ui:message>
|
||||
</div-->
|
||||
<center>
|
||||
<div style="font-size: x-large;">
|
||||
<img src="{!$Resource.Configuration}" style="width: 14%;margin-top: 2%;" height="50"/>
|
||||
<p style="margin-top: 1%;margin-bottom: 2%;">
|
||||
<b>You are almost there click the button below.</b><br/>
|
||||
</p>
|
||||
<!--button style="font-size: 60%;" class="slds-button slds-button_brand" onclick="{!c.doSync}">Finished</button-->
|
||||
<lightning:button variant="success" label="Finished" title="Finished" disabled="{!v.dosyncDisableButton}" onclick="{!c.doSync}"/>
|
||||
|
||||
</div>
|
||||
</center>
|
||||
</center>
|
||||
</aura:set>
|
||||
</aura:if>
|
||||
<aura:set attribute="else">
|
||||
<!--center>
|
||||
<div style = "width: 23em;">
|
||||
<ui:message title="Information" severity="confirm" closable="false" >
|
||||
<h1 ><b> Processing in background......</b></h1> <br></br>
|
||||
</ui:message>
|
||||
</div>
|
||||
</center-->
|
||||
<!--c:BatchProcessingPage/-->
|
||||
</aura:set>
|
||||
</aura:if>
|
||||
</div>
|
||||
<aura:attribute name="OpenModel" type="boolean" default="false"/>
|
||||
<aura:if isTrue="{!v.OpenModel}">
|
||||
<div class="slds-m-around_xx-large">
|
||||
<!--Use aura:if tag to display/hide popup based on isModalOpen value-->
|
||||
<section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria-modal="true" aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open">
|
||||
<div class="slds-modal__container">
|
||||
<header class="slds-modal__header">
|
||||
<lightning:buttonIcon iconName="utility:close"
|
||||
onclick="{!c.closeagreementform }"
|
||||
alternativeText="close"
|
||||
variant="bare-inverse"
|
||||
class="slds-modal__close"/>
|
||||
<h2 id="modal-heading-01" class="slds-text-heading_medium slds-hyphenate"><b>Terms and conditions</b> <!--lightning:Icon iconName="utility:report_issue"
|
||||
alternativeText="Support"
|
||||
/--></h2>
|
||||
</header>
|
||||
<!--Modal/Popup Box Body Starts here-->
|
||||
<div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1">
|
||||
<p>
|
||||
<!-- CREATE NEW EXPENSE -->
|
||||
<div aria-labelledby="newexpenseform">
|
||||
|
||||
|
||||
<form class="slds-form--stacked">
|
||||
|
||||
|
||||
<p style="font-size:larger"><b>Attention :- </b></p>
|
||||
<aura:if isTrue="{!v.configObj.HIC_ShopifySync__BatchRunOnce__c}">
|
||||
<ul class="slds-list_dotted slds-m-top_large">
|
||||
<li>Fetching all records from shopify store.</li>
|
||||
<li>It will also update all your previous shopify records in SFDC.</li>
|
||||
|
||||
<aura:if isTrue="{!v.samplebuttonshow}">
|
||||
<li>You can click on "Import sample record" button to see store's records.</li>
|
||||
</aura:if>
|
||||
</ul>
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
<p style="font-size:larger">
|
||||
<lightning:input aura:id ="agreement" type="checkbox" label="Please indicate that you have read and agree to the Terms and Conditions and Privacy Policy" name="agreement" checked="false" onchange="{!c.acceptagreement}"/>
|
||||
</p>
|
||||
<aura:set attribute="else">
|
||||
<ul class="slds-list_dotted slds-m-top_small">
|
||||
<li>Fetching all records from shopify store.</li>
|
||||
<aura:if isTrue="{!v.samplebuttonshow}">
|
||||
<li>You can click on "Import sample record" button to see store's records.</li>
|
||||
</aura:if>
|
||||
</ul>
|
||||
</aura:set>
|
||||
</aura:if>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<!-- / CREATE NEW EXPENSE -->
|
||||
</p>
|
||||
</div>
|
||||
<footer class="slds-modal__footer">
|
||||
<center>
|
||||
<aura:if isTrue="{!v.samplebuttonshow}">
|
||||
<lightning:button
|
||||
|
||||
class="buttonstyle"
|
||||
iconName="utility:offline_cached"
|
||||
iconPosition="right"
|
||||
label="Import Sample Records"
|
||||
|
||||
title="Import Sample Records"
|
||||
onclick="{! c.OpenSampleData }"/>
|
||||
</aura:if>
|
||||
|
||||
<lightning:button variant="brand"
|
||||
aura:id = "agreedbutton"
|
||||
class="buttonstyle"
|
||||
iconName="utility:sync"
|
||||
iconPosition="right"
|
||||
label="Start Sync"
|
||||
disabled="{!v.processbatch}"
|
||||
title="Start Sync"
|
||||
onclick="{! c.fireParentEvent }"/>
|
||||
|
||||
</center>
|
||||
</footer>
|
||||
</div>
|
||||
</section>
|
||||
<div class="slds-backdrop slds-backdrop_open"></div>
|
||||
</div>
|
||||
</aura:if>
|
||||
|
||||
<aura:if isTrue="{!v.OpenSampledataModel}">
|
||||
<div class="slds-m-around_xx-large">
|
||||
<!--Use aura:if tag to display/hide popup based on isModalOpen value-->
|
||||
|
||||
<section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria-modal="true" aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open slds-modal_small">
|
||||
<div class="slds-modal__container" >
|
||||
<header class="slds-modal__header">
|
||||
<lightning:buttonIcon iconName="utility:close"
|
||||
onclick="{!c.closemodal }"
|
||||
alternativeText="close"
|
||||
variant="bare-inverse"
|
||||
class="slds-modal__close"/>
|
||||
<h2 id="modal-heading-01" class="slds-text-heading_medium slds-hyphenate"><b>Import Sample Records</b></h2>
|
||||
</header>
|
||||
<!--Modal/Popup Box Body Starts here-->
|
||||
<div class="slds-modal__content " id="modal-content-id-1" >
|
||||
<c:Displaysampledata store= "{!v.store}"/>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<div class="slds-backdrop slds-backdrop_open"></div>
|
||||
</div>
|
||||
</aura:if>
|
||||
</aura:component>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||
<apiVersion>44.0</apiVersion>
|
||||
<description>Record Type Mapping Component</description>
|
||||
</AuraDefinitionBundle>
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
.THIS {
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
<design:component>
|
||||
|
||||
</design:component>
|
||||
|
|
@ -0,0 +1,170 @@
|
|||
({
|
||||
|
||||
closemodal: function(component, event, helper){
|
||||
|
||||
component.set("v.OpenSampledataModel",false);
|
||||
component.set("v.GoDisableButton",false);
|
||||
},
|
||||
OpenSampleData: function(component, event, helper){
|
||||
|
||||
component.set("v.samplebuttonshow",false);
|
||||
component.set("v.OpenModel",false);
|
||||
component.set("v.OpenSampledataModel",true);
|
||||
},
|
||||
|
||||
closeagreementform : function(component, event, helper){
|
||||
component.set("v.OpenModel",false);
|
||||
component.set("v.GoDisableButton",false);
|
||||
},
|
||||
|
||||
|
||||
fireParentEvent : function(component, event, helper){
|
||||
|
||||
|
||||
document.getElementById("divparent").style.pointerEvents = "none";
|
||||
component.getEvent("ParentSaveButtonEvt").fire();
|
||||
|
||||
},
|
||||
|
||||
acceptagreement : function(component, event, helper){
|
||||
|
||||
var agreecheckbox = component.find("agreement").get("v.checked");
|
||||
|
||||
if(agreecheckbox == true){
|
||||
component.find("agreedbutton").set("v.disabled",false);
|
||||
}else{
|
||||
component.find("agreedbutton").set("v.disabled",true);
|
||||
}
|
||||
},
|
||||
|
||||
OpenIagreedform : function(component, event, helper){
|
||||
component.set("v.processbatch",true);
|
||||
component.set("v.OpenModel",true);
|
||||
},
|
||||
|
||||
showSpinner : function (component, event, helper) {
|
||||
component.set("v.Spinner",true);
|
||||
},
|
||||
hideSpinner : function (component, event, helper) {
|
||||
component.set("v.Spinner",false);
|
||||
},
|
||||
|
||||
|
||||
doInit: function(component, event, helper) {
|
||||
component.set("v.Spinner",true);
|
||||
helper.getConfigurationData( component, event );
|
||||
helper.getPersonAccountRecordTypeList( component, event );
|
||||
helper.getAccountRecordTypeList( component, event );
|
||||
helper.getContactRecordTypeList( component, event );
|
||||
helper.getOrderRecordTypeList( component, event );
|
||||
helper.getDraftOrderRecordTypeList( component, event );
|
||||
helper.getOpportunityRecordTypeList( component, event );
|
||||
|
||||
},
|
||||
|
||||
goNext : function(component, event, helper) {
|
||||
//var obj = component.get("v.contactList");
|
||||
document.getElementById("divparent").style.pointerEvents = "none";
|
||||
component.set("v.GoDisableButton",true);
|
||||
var action = component.get("c.saveRecordTypeMapping");
|
||||
|
||||
var PersonAccountRecordTypeId = component.get("v.PersonAccountRecordTypeId");
|
||||
var AccountRecordTypeId = component.get("v.AccountRecordTypeId");
|
||||
var ContactRecordTypeId = component.get("v.ContactRecordTypeId");
|
||||
var OrderRecordTypeId = component.get("v.OrderRecordTypeId");
|
||||
var OpportunityRecordTypeId = component.get("v.OpportunityRecordTypeId");
|
||||
var DraftorderRecordTypeId = component.get("v.DraftorderRecordTypeId");
|
||||
var store = component.get("v.store");
|
||||
PersonAccountRecordTypeId = PersonAccountRecordTypeId+','+store;
|
||||
console.log(PersonAccountRecordTypeId+store);
|
||||
console.log(AccountRecordTypeId);
|
||||
console.log(ContactRecordTypeId);
|
||||
console.log(OrderRecordTypeId);
|
||||
console.log(OpportunityRecordTypeId);
|
||||
console.log(DraftorderRecordTypeId);
|
||||
console.log(store);
|
||||
|
||||
action.setParams({'PersonAccountRecordTypeId' : PersonAccountRecordTypeId,
|
||||
'AccountRecordTypeId' : AccountRecordTypeId,
|
||||
'ContactRecordTypeId' : ContactRecordTypeId,
|
||||
'OrderRecordTypeId' : OrderRecordTypeId,
|
||||
'OpportunityRecordTypeId' : OpportunityRecordTypeId,
|
||||
'DraftorderRecordTypeId': DraftorderRecordTypeId
|
||||
});
|
||||
action.setCallback(this, function(response) {
|
||||
var state = response.getState();
|
||||
if (state === "SUCCESS" && response.getReturnValue() != null ) {
|
||||
|
||||
/* if(component.get("v.configObj.HIC_ShopifySync__BatchRunOnce__c") == true || component.get("v.configObj.HIC_ShopifySync__BatchRunOnce__c") == 'true' || component.get("v.configObj.HIC_ShopifySync__BatchRunOnce__c") == undefined ){
|
||||
document.getElementById("divparent").style.pointerEvents = "all";
|
||||
component.set("v.OpenModel",true);
|
||||
}else{
|
||||
document.getElementById("divparent").style.pointerEvents = "none";
|
||||
component.getEvent("ParentSaveButtonEvt").fire();
|
||||
}*/
|
||||
|
||||
|
||||
document.getElementById("divparent").style.pointerEvents = "all";
|
||||
component.set("v.OpenModel",true);
|
||||
//component.getEvent("ParentSaveButtonEvt").fire();
|
||||
}
|
||||
else if (state === "INCOMPLETE") {
|
||||
|
||||
|
||||
}else if (state === "ERROR") {
|
||||
var errors = response.getError();
|
||||
if (errors) {
|
||||
if (errors[0] && errors[0].message) {
|
||||
console.log("Error message: " +
|
||||
errors[0].message);
|
||||
}
|
||||
} else {
|
||||
console.log("Unknown error");
|
||||
}
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(action);
|
||||
},
|
||||
|
||||
doSync : function(component, event, helper) {
|
||||
console.log('dio Sync Called--');
|
||||
//var obj = component.get("v.contactList");
|
||||
component.set("v.dosyncDisableButton",true);
|
||||
component.set("v.isProcess",true);
|
||||
console.log('doSync--> '+component.get("c.store"));
|
||||
debugger;
|
||||
var action = component.get("c.syncShopify");
|
||||
action.setParams({'store': component.get("v.store")});
|
||||
action.setCallback(this, function(response) {
|
||||
var state = response.getState();
|
||||
if (state === "SUCCESS"){
|
||||
/* var toastEvent = $A.get("e.force:showToast");
|
||||
toastEvent.setParams({
|
||||
mode: 'sticky',
|
||||
title: "Success!",
|
||||
message: "Process has started in the background.",
|
||||
type: "success"
|
||||
});
|
||||
toastEvent.fire();*/
|
||||
// alert('Process has started in the background.');
|
||||
}else{
|
||||
/*var toastEvent = $A.get("e.force:showToast");
|
||||
toastEvent.setParams({
|
||||
mode: 'sticky',
|
||||
title: "Error!",
|
||||
message: "We have hit some error. Please Contact Admin.",
|
||||
type: "error"
|
||||
});
|
||||
toastEvent.fire();*/
|
||||
// alert('We have hit some error. Please Contact Admin.');
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(action);
|
||||
},
|
||||
|
||||
goPrev : function(component, event, helper) {
|
||||
component.set("v.PreDisableButton",true);
|
||||
component.getEvent("ParentPrevButtonEvt").fire();
|
||||
}
|
||||
|
||||
})
|
||||
|
|
@ -0,0 +1,371 @@
|
|||
({
|
||||
getConfigurationData : function( component, event ) {
|
||||
|
||||
var action = component.get("c.getGeneral");
|
||||
action.setParams({'store': component.get("v.store")});
|
||||
action.setCallback(this, function(response) {
|
||||
var state = response.getState();
|
||||
if (state === "SUCCESS" && response.getReturnValue() != null ) {
|
||||
var configObj = JSON.parse( response.getReturnValue() );
|
||||
|
||||
component.set("v.configObj", configObj);
|
||||
if(component.get("v.configObj.HIC_ShopifySync__BatchRunOnce__c") == true || component.get("v.configObj.HIC_ShopifySync__BatchRunOnce__c") == 'true' || component.get("v.configObj.HIC_ShopifySync__BatchRunOnce__c") == undefined ){
|
||||
component.set("v.processbatch",true);
|
||||
}else{
|
||||
component.set("v.processbatch",false);
|
||||
}
|
||||
|
||||
}
|
||||
else if (state === "INCOMPLETE") {
|
||||
// do something
|
||||
}else if (state === "ERROR") {
|
||||
var errors = response.getError();
|
||||
if (errors) {
|
||||
if (errors[0] && errors[0].message) {
|
||||
console.log("Error message: " +
|
||||
errors[0].message);
|
||||
}
|
||||
} else {
|
||||
console.log("Unknown error");
|
||||
}
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(action);
|
||||
|
||||
},
|
||||
getPersonAccountRecordTypeList : function(component, event, helper) {
|
||||
var action = component.get("c.getPerAccRecordTypeList");
|
||||
|
||||
action.setCallback(this, function(response) {
|
||||
var state = response.getState();
|
||||
if (state === "SUCCESS" && response.getReturnValue() != null ) {
|
||||
component.set("v.PersonAccountRecordTypeList",JSON.parse(response.getReturnValue()));
|
||||
var getRecordidation = component.get("c.getRecordTypeByName");
|
||||
getRecordidation.setParams({
|
||||
'Objectname':'PersonAccount',
|
||||
'store': component.get("v.store")
|
||||
});
|
||||
getRecordidation.setCallback(this, function(response) {
|
||||
|
||||
var state2 = response.getState();
|
||||
if (state2 === "SUCCESS" && response.getReturnValue() != null ) {
|
||||
|
||||
component.set("v.PersonAccountRecordTypeId",response.getReturnValue());
|
||||
|
||||
} else if (state2 === "INCOMPLETE") {
|
||||
// do something
|
||||
}
|
||||
else if (state === "ERROR") {
|
||||
var errors1 = response.getError();
|
||||
if (errors1) {
|
||||
if (errors1[0] && errors1[0].message) {
|
||||
console.log("Error message: " +
|
||||
errors1[0].message);
|
||||
}
|
||||
} else {
|
||||
console.log("Unknown error");
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
$A.enqueueAction(getRecordidation);
|
||||
}
|
||||
else if (state === "INCOMPLETE") {
|
||||
// do something
|
||||
}
|
||||
else if (state === "ERROR") {
|
||||
var errors = response.getError();
|
||||
if (errors) {
|
||||
if (errors[0] && errors[0].message) {
|
||||
console.log("Error message: " +
|
||||
errors[0].message);
|
||||
}
|
||||
} else {
|
||||
console.log("Unknown error");
|
||||
}
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(action);
|
||||
},
|
||||
getAccountRecordTypeList : function(component, event, helper) {
|
||||
var action = component.get("c.getAccRecordTypeList");
|
||||
|
||||
action.setCallback(this, function(response) {
|
||||
var state = response.getState();
|
||||
if (state === "SUCCESS" && response.getReturnValue() != null ) {
|
||||
component.set("v.AccountRecordTypeList",JSON.parse(response.getReturnValue()));
|
||||
var getRecordidation = component.get("c.getRecordTypeByName");
|
||||
getRecordidation.setParams({
|
||||
'Objectname':'Account',
|
||||
'store': component.get("v.store")
|
||||
});
|
||||
getRecordidation.setCallback(this, function(response) {
|
||||
|
||||
var state2 = response.getState();
|
||||
if (state2 === "SUCCESS" && response.getReturnValue() != null ) {
|
||||
component.set("v.AccountRecordTypeId",response.getReturnValue());
|
||||
|
||||
} else if (state2 === "INCOMPLETE") {
|
||||
// do something
|
||||
}
|
||||
else if (state === "ERROR") {
|
||||
var errors1 = response.getError();
|
||||
if (errors1) {
|
||||
if (errors1[0] && errors1[0].message) {
|
||||
console.log("Error message: " +
|
||||
errors1[0].message);
|
||||
}
|
||||
} else {
|
||||
console.log("Unknown error");
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
$A.enqueueAction(getRecordidation);
|
||||
}
|
||||
else if (state === "INCOMPLETE") {
|
||||
// do something
|
||||
}
|
||||
else if (state === "ERROR") {
|
||||
var errors = response.getError();
|
||||
if (errors) {
|
||||
if (errors[0] && errors[0].message) {
|
||||
console.log("Error message: " +
|
||||
errors[0].message);
|
||||
}
|
||||
} else {
|
||||
console.log("Unknown error");
|
||||
}
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(action);
|
||||
},
|
||||
getContactRecordTypeList : function(component, event, helper) {
|
||||
var action = component.get("c.getConRecordTypeList");
|
||||
|
||||
action.setCallback(this, function(response) {
|
||||
var state = response.getState();
|
||||
if (state === "SUCCESS" && response.getReturnValue() != null ) {
|
||||
component.set("v.ContactRecordTypeList",JSON.parse(response.getReturnValue()));
|
||||
var getRecordidation = component.get("c.getRecordTypeByName");
|
||||
getRecordidation.setParams({
|
||||
'Objectname':'Contact',
|
||||
'store': component.get("v.store")
|
||||
});
|
||||
getRecordidation.setCallback(this, function(response) {
|
||||
|
||||
var state2 = response.getState();
|
||||
if (state2 === "SUCCESS" && response.getReturnValue() != null ) {
|
||||
|
||||
component.set("v.ContactRecordTypeId",response.getReturnValue());
|
||||
|
||||
} else if (state2 === "INCOMPLETE") {
|
||||
// do something
|
||||
}
|
||||
else if (state === "ERROR") {
|
||||
var errors1 = response.getError();
|
||||
if (errors1) {
|
||||
if (errors1[0] && errors1[0].message) {
|
||||
console.log("Error message: " +
|
||||
errors1[0].message);
|
||||
}
|
||||
} else {
|
||||
console.log("Unknown error");
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
$A.enqueueAction(getRecordidation);
|
||||
|
||||
}
|
||||
else if (state === "INCOMPLETE") {
|
||||
// do something
|
||||
}
|
||||
else if (state === "ERROR") {
|
||||
var errors = response.getError();
|
||||
if (errors) {
|
||||
if (errors[0] && errors[0].message) {
|
||||
console.log("Error message: " +
|
||||
errors[0].message);
|
||||
}
|
||||
} else {
|
||||
console.log("Unknown error");
|
||||
}
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(action);
|
||||
},
|
||||
getOrderRecordTypeList : function(component, event, helper) {
|
||||
var action = component.get("c.getOrdRecordTypeList");
|
||||
|
||||
action.setCallback(this, function(response) {
|
||||
var state = response.getState();
|
||||
if (state === "SUCCESS" && response.getReturnValue() != null ) {
|
||||
component.set("v.OrderRecordTypeList",JSON.parse(response.getReturnValue()));
|
||||
var getRecordidation = component.get("c.getRecordTypeByName");
|
||||
getRecordidation.setParams({
|
||||
'Objectname':'Order',
|
||||
'store': component.get("v.store")
|
||||
});
|
||||
getRecordidation.setCallback(this, function(response) {
|
||||
|
||||
var state2 = response.getState();
|
||||
if (state2 === "SUCCESS" && response.getReturnValue() != null ) {
|
||||
|
||||
component.set("v.OrderRecordTypeId",response.getReturnValue());
|
||||
|
||||
} else if (state2 === "INCOMPLETE") {
|
||||
// do something
|
||||
}
|
||||
else if (state === "ERROR") {
|
||||
var errors1 = response.getError();
|
||||
if (errors1) {
|
||||
if (errors1[0] && errors1[0].message) {
|
||||
console.log("Error message: " +
|
||||
errors1[0].message);
|
||||
}
|
||||
} else {
|
||||
console.log("Unknown error");
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
$A.enqueueAction(getRecordidation);
|
||||
|
||||
}
|
||||
else if (state === "INCOMPLETE") {
|
||||
// do something
|
||||
}
|
||||
else if (state === "ERROR") {
|
||||
var errors = response.getError();
|
||||
if (errors) {
|
||||
if (errors[0] && errors[0].message) {
|
||||
console.log("Error message: " +
|
||||
errors[0].message);
|
||||
}
|
||||
} else {
|
||||
console.log("Unknown error");
|
||||
}
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(action);
|
||||
},
|
||||
getDraftOrderRecordTypeList : function(component, event, helper) {
|
||||
var action = component.get("c.getDraftOrdRecordTypeList");
|
||||
|
||||
action.setCallback(this, function(response) {
|
||||
var state = response.getState();
|
||||
if (state === "SUCCESS" && response.getReturnValue() != null ) {
|
||||
component.set("v.DraftorderRecordTypeList",JSON.parse(response.getReturnValue()));
|
||||
var getRecordidation = component.get("c.getRecordTypeByName");
|
||||
getRecordidation.setParams({
|
||||
'Objectname':'DraftOrder',
|
||||
'store': component.get("v.store")
|
||||
});
|
||||
getRecordidation.setCallback(this, function(response) {
|
||||
|
||||
var state2 = response.getState();
|
||||
if (state2 === "SUCCESS" && response.getReturnValue() != null ) {
|
||||
|
||||
component.set("v.DraftorderRecordTypeId",response.getReturnValue());
|
||||
} else if (state2 === "INCOMPLETE") {
|
||||
// do something
|
||||
}
|
||||
else if (state2 === "ERROR") {
|
||||
var errors1 = response.getError();
|
||||
if (errors1) {
|
||||
if (errors1[0] && errors1[0].message) {
|
||||
console.log("Error message: " +
|
||||
errors1[0].message);
|
||||
}
|
||||
} else {
|
||||
console.log("Unknown error");
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
$A.enqueueAction(getRecordidation);
|
||||
|
||||
}
|
||||
else if (state === "INCOMPLETE") {
|
||||
// do something
|
||||
}
|
||||
else if (state === "ERROR") {
|
||||
var errors = response.getError();
|
||||
if (errors) {
|
||||
if (errors[0] && errors[0].message) {
|
||||
console.log("Error message: " +
|
||||
errors[0].message);
|
||||
}
|
||||
} else {
|
||||
console.log("Unknown error");
|
||||
}
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(action);
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
getOpportunityRecordTypeList : function(component, event, helper) {
|
||||
var action = component.get("c.getOppRecordTypeList");
|
||||
|
||||
action.setCallback(this, function(response) {
|
||||
var state = response.getState();
|
||||
if (state === "SUCCESS" && response.getReturnValue() != null ) {
|
||||
component.set("v.OpportunityRecordTypeList",JSON.parse(response.getReturnValue()));
|
||||
var getRecordidation = component.get("c.getRecordTypeByName");
|
||||
getRecordidation.setParams({
|
||||
'Objectname':'Opportunity',
|
||||
'store': component.get("v.store")
|
||||
});
|
||||
getRecordidation.setCallback(this, function(response) {
|
||||
|
||||
var state2 = response.getState();
|
||||
if (state2 === "SUCCESS" && response.getReturnValue() != null ) {
|
||||
|
||||
component.set("v.OpportunityRecordTypeId",response.getReturnValue());
|
||||
|
||||
} else if (state2 === "INCOMPLETE") {
|
||||
// do something
|
||||
}
|
||||
else if (state === "ERROR") {
|
||||
var errors1 = response.getError();
|
||||
if (errors1) {
|
||||
if (errors1[0] && errors1[0].message) {
|
||||
console.log("Error message: " +
|
||||
errors1[0].message);
|
||||
}
|
||||
} else {
|
||||
console.log("Unknown error");
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
$A.enqueueAction(getRecordidation);
|
||||
|
||||
}
|
||||
else if (state === "INCOMPLETE") {
|
||||
// do something
|
||||
}
|
||||
else if (state === "ERROR") {
|
||||
var errors = response.getError();
|
||||
if (errors) {
|
||||
if (errors[0] && errors[0].message) {
|
||||
console.log("Error message: " +
|
||||
errors[0].message);
|
||||
}
|
||||
} else {
|
||||
console.log("Unknown error");
|
||||
}
|
||||
}
|
||||
component.set("v.Spinner",false);
|
||||
var CloseSpinnerEventFire = $A.get("e.c:CloseSpinner");
|
||||
CloseSpinnerEventFire.setParams({
|
||||
"Spinner" : false });
|
||||
CloseSpinnerEventFire.fire();
|
||||
});
|
||||
$A.enqueueAction(action);
|
||||
}
|
||||
})
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<aura:event type="COMPONENT" description="Event to remove Row" >
|
||||
<aura:attribute name="deleteObject" type="String" description="Use For Delete Row" />
|
||||
|
||||
<aura:attribute name="indexVar" type="String" description="Use For Delete Row" />
|
||||
</aura:event>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||
<apiVersion>44.0</apiVersion>
|
||||
<description>A Lightning Component Bundle</description>
|
||||
</AuraDefinitionBundle>
|
||||
|
|
@ -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>
|
||||
|
|
@ -0,0 +1,361 @@
|
|||
<aura:component controller="AddDeleteController" >
|
||||
<aura:attribute name="store" type="string" default="default"/>
|
||||
|
||||
<!--ltng:require styles="{! $Resource. datatable + '/DataTables-1.10.16/media/css/jquery.dataTables.min.css'}"
|
||||
scripts="{!join(',',
|
||||
$Resource.jquery224 ,
|
||||
$Resource.datatable + '/DataTables-1.10.16/media/js/jquery.dataTables.min.js')
|
||||
}" afterScriptsLoaded="{!c.scriptsLoaded}"/-->
|
||||
|
||||
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
|
||||
<aura:attribute name="objecttype" type="object" />
|
||||
<aura:attribute name="columns" type="List"/>
|
||||
<aura:attribute name="Intervalvalue" type="string"/>
|
||||
<aura:attribute name="listofprodutct" type="list" />
|
||||
<aura:attribute name="Listofcontact" type="list" />
|
||||
<aura:attribute name="listofcollection" type="list" />
|
||||
<aura:attribute name="listoforder" type="list" />
|
||||
<aura:attribute name="listofdarftorder" type="list" />
|
||||
<aura:attribute name="listoflocation" type="list" />
|
||||
<aura:attribute name="jsonvalue" type="string" />
|
||||
<aura:attribute name="formatText" type="object" />
|
||||
<aura:attribute name="OpenModel" type="boolean" default="false" />
|
||||
|
||||
<aura:attribute name="Doinitdone" type="boolean" default="false" />
|
||||
<aura:attribute name="jsonloading" type="boolean" default="false" />
|
||||
|
||||
<aura:if isTrue="{!v.OpenModel}">
|
||||
<div class="slds-m-around_xx-large">
|
||||
<!--Use aura:if tag to display/hide popup based on isModalOpen value-->
|
||||
|
||||
<section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria-modal="true" aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open">
|
||||
<div class="slds-modal__container">
|
||||
<header class="slds-modal__header">
|
||||
<lightning:buttonIcon iconName="utility:close"
|
||||
onclick="{!c.closemodal }"
|
||||
alternativeText="close"
|
||||
variant="bare-inverse"
|
||||
class="slds-modal__close"/>
|
||||
<h2 id="modal-heading-01" class="slds-text-heading_medium slds-hyphenate"><b>JSON Body</b></h2>
|
||||
</header>
|
||||
<!--Modal/Popup Box Body Starts here-->
|
||||
<div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1">
|
||||
<div id = "jsonid" aura:id="jsonid" style="color: rgb(63, 143, 47);" >
|
||||
<center>
|
||||
<!--div class="slds-m-around_xx-large">
|
||||
<strong>Loading.. JSON</strong>
|
||||
</!div-->
|
||||
<img src="{!$Resource.PageLoadingGif}" style="width:30%;"></img>
|
||||
</center>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="slds-modal__footer" style="padding:0;">
|
||||
<div class="slds-m-around_small" >
|
||||
<lightning:button iconName="utility:copy_to_clipboard"
|
||||
onclick="{!c.copyHardcoreText}"
|
||||
label="Copy Text to clipboard"
|
||||
aura:id="btn1"/>
|
||||
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
</section>
|
||||
<div class="slds-backdrop slds-backdrop_open"></div>
|
||||
</div>
|
||||
</aura:if>
|
||||
<aura:if isTrue="{!v.Doinitdone}">
|
||||
|
||||
|
||||
<lightning:card title="Sample Records" iconName="standard:dataset">
|
||||
<div class="slds-m-around_x-small">
|
||||
<aura:if isTrue="{!v.listofprodutct}">
|
||||
<table id="tableId" class="slds-table slds-table_bordered slds-table_cell-buffer " cellspacing="0" width="100%">
|
||||
<thead>
|
||||
<tr data-index="products" onclick="{!c.onsectionclick}">
|
||||
|
||||
<th class="Sectioncolor"><strong> Products <lightning:icon aura:id="products" class="slds-m-left_x-small iconstyles" size="small" iconName="utility:chevronright"/> </strong></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody id="products" style="display:none;">
|
||||
<td>
|
||||
|
||||
|
||||
|
||||
<table class="slds-table slds-table_bordered slds-table_cell-buffer" cellspacing="0" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Sr. No</th>
|
||||
<th>Shopify Id</th>
|
||||
<th>title</th>
|
||||
<th>Created at</th>
|
||||
<th>Modified at</th>
|
||||
<th>JSON</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<aura:iteration items="{!v.listofprodutct}" var="item" indexVar ="index">
|
||||
<tr>
|
||||
<td >{!index+1}</td>
|
||||
<td>{!item.id}</td>
|
||||
<td>{!item.title}</td>
|
||||
<td>
|
||||
<lightning:formattedDateTime value="{!item.created_at}"/>
|
||||
</td>
|
||||
<td>
|
||||
<lightning:formattedDateTime value="{!item.updated_at}"/>
|
||||
</td>
|
||||
<td><lightning:button name="JSON" label="JSON" onclick="{!c.displayJson}" value="{!item}"></lightning:button></td>
|
||||
</tr>
|
||||
</aura:iteration>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</td>
|
||||
</tbody>
|
||||
</table>
|
||||
</aura:if>
|
||||
<aura:if isTrue="{!v.Listofcontact}">
|
||||
<table id="tableId" class="slds-table slds-table_bordered slds-table_cell-buffer" cellspacing="0" width="100%">
|
||||
<thead>
|
||||
<tr data-index="contacts" onclick="{!c.onsectionclick}">
|
||||
<th class="Sectioncolor"><strong> Customers <lightning:icon aura:id="contacts" class="slds-m-left_x-small iconstyles" size="small" iconName="utility:chevronright"/> </strong></th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="contacts" style="display:none;">
|
||||
<td>
|
||||
<aura:if isTrue="{!v.Listofcontact}">
|
||||
<table class="slds-table slds-table_bordered slds-table_cell-buffer" cellspacing="0" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Sr. No</th>
|
||||
<th>Shopify Id</th>
|
||||
<th>First Name</th>
|
||||
<th>Last Name</th>
|
||||
<th>Total Orders</th>
|
||||
<th>JSON</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<aura:iteration items="{!v.Listofcontact}" var="item" indexVar ="index">
|
||||
<tr>
|
||||
<td>{!index+1}</td>
|
||||
<td>{!item.id}</td>
|
||||
<td>{!item.first_name}</td>
|
||||
<td>{!item.last_name}</td>
|
||||
<td>{!item.orders_count}</td>
|
||||
<td><lightning:button name="JSON" label="JSON" onclick="{!c.displayJson}" value="{!item}"></lightning:button></td>
|
||||
</tr>
|
||||
</aura:iteration>
|
||||
</tbody>
|
||||
</table>
|
||||
</aura:if>
|
||||
</td>
|
||||
</tbody>
|
||||
</table>
|
||||
</aura:if>
|
||||
<aura:if isTrue="{!v.listofcollection}">
|
||||
<table id="tableId" class="slds-table slds-table_bordered slds-table_cell-buffer" cellspacing="0" width="100%">
|
||||
<thead>
|
||||
<tr data-index="collection" onclick="{!c.onsectionclick}">
|
||||
<th class="Sectioncolor"><strong> Collections <lightning:icon aura:id="collection" class="slds-m-left_x-small iconstyles" size="small" iconName="utility:chevronright"/> </strong></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="collection" style="display:none;">
|
||||
<td>
|
||||
<aura:if isTrue="{!v.listofcollection}">
|
||||
<table class="slds-table slds-table_bordered slds-table_cell-buffer" cellspacing="0" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Sr. No</th>
|
||||
<th>Shopify Id</th>
|
||||
<th>Title</th>
|
||||
<th>Published at</th>
|
||||
<th>Updated at</th>
|
||||
<th>JSON</th>
|
||||
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<aura:iteration items="{!v.listofcollection}" var="item" indexVar ="index">
|
||||
<tr>
|
||||
<td>{!index+1}</td>
|
||||
<td>{!item.id}</td>
|
||||
<td>{!item.title}</td>
|
||||
<td>
|
||||
<lightning:formattedDateTime value="{!item.published_at}"/>
|
||||
</td>
|
||||
<td>
|
||||
<lightning:formattedDateTime value="{!item.updated_at}"/>
|
||||
</td>
|
||||
<td><lightning:button name="JSON" label="JSON" onclick="{!c.displayJson}" value="{!item}"></lightning:button></td>
|
||||
|
||||
</tr>
|
||||
</aura:iteration>
|
||||
</tbody>
|
||||
</table>
|
||||
</aura:if>
|
||||
</td>
|
||||
</tbody>
|
||||
</table>
|
||||
</aura:if>
|
||||
<aura:if isTrue="{!v.listoforder}">
|
||||
<table id="tableId" class="slds-table slds-table_bordered slds-table_cell-buffer" cellspacing="0" width="100%">
|
||||
<thead>
|
||||
<tr data-index="order" onclick="{!c.onsectionclick}">
|
||||
<th class="Sectioncolor"><strong> Orders <lightning:icon aura:id="order" class="slds-m-left_x-small iconstyles" size="small" iconName="utility:chevronright"/> </strong></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="order" style="display:none;" >
|
||||
<td>
|
||||
<aura:if isTrue="{!v.listoforder}">
|
||||
<table class="slds-table slds-table_bordered slds-table_cell-buffer" cellspacing="0" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Sr. No</th>
|
||||
<th>Shopify Id</th>
|
||||
<th>Order Number</th>
|
||||
<th>Total Price</th>
|
||||
<th>Total Discounts</th>
|
||||
<th>JSON</th>
|
||||
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<aura:iteration items="{!v.listoforder}" var="item" indexVar ="index">
|
||||
<tr>
|
||||
<td>{!index+1}</td>
|
||||
<td>{!item.id}</td>
|
||||
<td>{!item.order_number}</td>
|
||||
<td>{!item.total_price}</td>
|
||||
<td>{!item.total_discounts}</td>
|
||||
<td><lightning:button name="JSON" label="JSON" onclick="{!c.displayJson}" value="{!item}"></lightning:button></td>
|
||||
</tr>
|
||||
</aura:iteration>
|
||||
</tbody>
|
||||
</table>
|
||||
</aura:if>
|
||||
</td>
|
||||
</tbody>
|
||||
</table>
|
||||
</aura:if>
|
||||
<aura:if isTrue="{!v.listofdarftorder}">
|
||||
<table id="tableId" class="slds-table slds-table_bordered slds-table_cell-buffer" cellspacing="0" width="100%">
|
||||
<thead>
|
||||
<tr data-index="draftorder" onclick="{!c.onsectionclick}">
|
||||
<th class="Sectioncolor"><strong> Draft Orders <lightning:icon aura:id="draftorder" class="slds-m-left_x-small iconstyles" size="small" iconName="utility:chevronright"/> </strong></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="draftorder" style="display:none;" >
|
||||
<td>
|
||||
<aura:if isTrue="{!v.listofdarftorder}">
|
||||
<table class="slds-table slds-table_bordered slds-table_cell-buffer" cellspacing="0" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Sr. No</th>
|
||||
<th>Shopify Id</th>
|
||||
<th>Name</th>
|
||||
<th>Status</th>
|
||||
<th>Created at</th>
|
||||
<th>JSON</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<aura:iteration items="{!v.listofdarftorder}" var="item" indexVar ="index">
|
||||
<tr>
|
||||
<td>{!index+1}</td>
|
||||
<td>{!item.id}</td>
|
||||
<td>{!item.name}</td>
|
||||
<td>{!item.status}</td>
|
||||
<td>
|
||||
<lightning:formattedDateTime value="{!item.created_at}"/>
|
||||
</td>
|
||||
<td><lightning:button name="JSON" label="JSON" onclick="{!c.displayJson}" value="{!item}"></lightning:button></td>
|
||||
</tr>
|
||||
</aura:iteration>
|
||||
</tbody>
|
||||
</table>
|
||||
</aura:if>
|
||||
</td>
|
||||
</tbody>
|
||||
</table>
|
||||
</aura:if>
|
||||
<aura:if isTrue="{!v.listoflocation}">
|
||||
<table id="tableId" class="slds-table slds-table_bordered slds-table_cell-buffer" cellspacing="0" width="100%">
|
||||
<thead>
|
||||
<tr data-index="location" onclick="{!c.onsectionclick}">
|
||||
<th class="Sectioncolor"><strong> Locations <lightning:icon aura:id="location" class="slds-m-left_x-small iconstyles" size="small" iconName="utility:chevronright"/> </strong></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="location" style="display:none;">
|
||||
<td>
|
||||
<table class="slds-table slds-table_bordered slds-table_cell-buffer" cellspacing="0" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Sr. No</th>
|
||||
<th>Shopify Id</th>
|
||||
<th>Name</th>
|
||||
<th>Country</th>
|
||||
<th>Active</th>
|
||||
<th>JSON</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<aura:iteration items="{!v.listoflocation}" var="item" indexVar ="index">
|
||||
<tr>
|
||||
<td>{!index+1}</td>
|
||||
<td>{!item.id}</td>
|
||||
<td>{!item.name}</td>
|
||||
<td>{!item.country_name}</td>
|
||||
<td>{!item.active}</td>
|
||||
<td><lightning:button name="JSON" label="JSON" onclick="{!c.displayJson}" value="{!item}"></lightning:button></td>
|
||||
|
||||
|
||||
</tr>
|
||||
</aura:iteration>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tbody>
|
||||
</table>
|
||||
</aura:if>
|
||||
</div>
|
||||
</lightning:card>
|
||||
<aura:set attribute="else">
|
||||
<center>
|
||||
<div class="slds-m-around_xx-large">
|
||||
<!--strong>Loading..</strong-->
|
||||
<center>
|
||||
<!--div class="slds-m-around_xx-large">
|
||||
<strong>Loading.. JSON</strong>
|
||||
</!div-->
|
||||
<img src="{!$Resource.PageLoadingGif}" style="width: 25% !important;"></img>
|
||||
</center>
|
||||
</div>
|
||||
</center>
|
||||
</aura:set>
|
||||
</aura:if>
|
||||
<!--aura:iteration items="{!v.Listofcontact}" var="item" indexVar ="index">
|
||||
{!index+1} {!item.id} {!item.email} {!item.default_address.address1} <br/>
|
||||
</aura:iteration-->
|
||||
|
||||
<!--lightning:datatable
|
||||
keyField="id"
|
||||
data="{!v.Listofcontact}"
|
||||
columns="{!v.columns }"
|
||||
hideCheckboxColumn="true"
|
||||
showRowNumberColumn="true"
|
||||
/-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</aura:component>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||
<apiVersion>47.0</apiVersion>
|
||||
<description>A Lightning Component Bundle</description>
|
||||
</AuraDefinitionBundle>
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
.THIS .Sectioncolor {
|
||||
background-color: #27ae60 !important;
|
||||
border-bottom: ridge !important;
|
||||
color: white !important;
|
||||
}
|
||||
.THIS .iconstyles svg{
|
||||
height: 16px !important;
|
||||
fill : white !important;
|
||||
background :#27ae60 !important;
|
||||
}
|
||||
.THIS .iconstyles{
|
||||
float: left !important;
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
<design:component >
|
||||
|
||||
</design:component>
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<svg width="120px" height="120px" viewBox="0 0 120 120" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<path d="M120,108 C120,114.6 114.6,120 108,120 L12,120 C5.4,120 0,114.6 0,108 L0,12 C0,5.4 5.4,0 12,0 L108,0 C114.6,0 120,5.4 120,12 L120,108 L120,108 Z" id="Shape" fill="#2A739E" />
|
||||
<path d="M77.7383308,20 L61.1640113,20 L44.7300055,63.2000173 L56.0543288,63.2000173 L40,99.623291 L72.7458388,54.5871812 L60.907727,54.5871812 L77.7383308,20 Z" id="Path-1" fill="#FFFFFF" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 664 B |
|
|
@ -0,0 +1,110 @@
|
|||
({
|
||||
|
||||
copyHardcoreText : function(component, event, helper) {
|
||||
// get HTML hardcore value using aura:id
|
||||
//var textForCopy = component.find('jsonid').getElement().innerHTML;
|
||||
|
||||
// textForCopy = textForCopy.replace(/[&]nbsp[;]/gi," ").replace(/[<]br[^>]*[>]/gi,"\r\n");
|
||||
var textForCopy = component.get("v.jsonvalue");
|
||||
// calling common helper class to copy selected text value
|
||||
helper.copyTextHelper(component,event,textForCopy);
|
||||
},
|
||||
|
||||
displayJson: function(component, event, helper){
|
||||
|
||||
component.set("v.OpenModel",true);
|
||||
component.set("v.jsonloading",false);
|
||||
var value = event.getSource().get("v.value");
|
||||
|
||||
component.set("v.jsonvalue",JSON.stringify(value) );
|
||||
|
||||
component.set("v.Intervalvalue",setTimeout(function(){
|
||||
document.getElementById("jsonid").innerHTML = JSON.stringify(value, null, 6)
|
||||
.replace(/\n( *)/g, function (match, p1) {
|
||||
return '<br>' + ' '.repeat(p1.length);
|
||||
});
|
||||
component.set("v.jsonloading",true);
|
||||
|
||||
}, 1000));
|
||||
},
|
||||
closemodal: function(component, event, helper){
|
||||
if(component.get("v.Intervalvalue") != null && component.get("v.Intervalvalue") !== undefined && component.get("v.Intervalvalue") != '' ){
|
||||
clearTimeout(component.get("v.Intervalvalue"));
|
||||
}
|
||||
component.set("v.OpenModel",false);
|
||||
component.set("v.jsonvalue","");
|
||||
},
|
||||
|
||||
onsectionclick: function(component, event, helper){
|
||||
|
||||
var targetvalue = event.currentTarget.getAttribute("data-index").toString();
|
||||
|
||||
|
||||
if(component.find(targetvalue).get("v.iconName") == "utility:chevrondown"){
|
||||
component.find(targetvalue).set("v.iconName","utility:chevronright");
|
||||
}else{
|
||||
component.find(targetvalue).set("v.iconName","utility:chevrondown");
|
||||
}
|
||||
|
||||
if(document.getElementById(targetvalue.toString()).style.display == 'contents'){
|
||||
document.getElementById(targetvalue.toString()).style.display = 'none';
|
||||
}else{
|
||||
document.getElementById(targetvalue.toString()).style.display = 'contents';
|
||||
}
|
||||
|
||||
},
|
||||
scriptsLoaded : function(component, event, helper){
|
||||
console.log('Script loaded successfuly');
|
||||
},
|
||||
|
||||
doInit : function(component, event, helper) {
|
||||
console.log('Display Sample Data doint called--> ');
|
||||
console.log(component.get("v.store"));
|
||||
var action = component.get("c.getSampeledata");
|
||||
action.setParams({'store': component.get("v.store")});
|
||||
action.setCallback(this,function(res){
|
||||
console.log(res.getState());
|
||||
console.log(res.getReturnValue());
|
||||
var state = res.getState();
|
||||
if(state === 'SUCCESS' && res.getReturnValue() != null){
|
||||
|
||||
var returnvalue = res.getReturnValue();
|
||||
if(returnvalue[0] != null && returnvalue[0] != '' && returnvalue[0] !== undefined && returnvalue[0] != ''){
|
||||
component.set("v.listofprodutct",JSON.parse(returnvalue[0]));
|
||||
}
|
||||
|
||||
if(returnvalue[1] != null && returnvalue[1] != '' && returnvalue[1] !== undefined && returnvalue[1] != ''){
|
||||
component.set("v.Listofcontact",JSON.parse(returnvalue[1]));
|
||||
}
|
||||
if(returnvalue[2] != null && returnvalue[2] != '' && returnvalue[2] !== undefined && returnvalue[2] != ''){
|
||||
component.set("v.listofcollection",JSON.parse(returnvalue[2]));
|
||||
}
|
||||
|
||||
if(returnvalue[3] != null && returnvalue[3] != '' && returnvalue[3] !== undefined && returnvalue[3] != ''){
|
||||
component.set("v.listoforder",JSON.parse(returnvalue[3]));
|
||||
}
|
||||
if(returnvalue[4] != null && returnvalue[4] != '' && returnvalue[4] !== undefined && returnvalue[4] != ''){
|
||||
component.set("v.listofdarftorder",JSON.parse(returnvalue[4]));
|
||||
}
|
||||
if(returnvalue[5] != null && returnvalue[5] != '' && returnvalue[5] !== undefined && returnvalue[5] != ''){
|
||||
component.set("v.listoflocation",JSON.parse(returnvalue[5]));
|
||||
}
|
||||
component.set("v.Doinitdone",true);
|
||||
}else if (state === "INCOMPLETE") {
|
||||
|
||||
|
||||
}else if (state === "ERROR") {
|
||||
var errors = res.getError();
|
||||
if (errors) {
|
||||
if (errors[0] && errors[0].message) {
|
||||
console.log("Error message: " +
|
||||
errors[0].message);
|
||||
}
|
||||
} else {
|
||||
console.log("Unknown error");
|
||||
}
|
||||
}
|
||||
});
|
||||
$A.enqueueAction(action);
|
||||
}
|
||||
})
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
({
|
||||
copyTextHelper : function(component,event,text) {
|
||||
// Create an hidden input
|
||||
var hiddenInput = document.createElement("input");
|
||||
// passed text into the input
|
||||
hiddenInput.setAttribute("value", text);
|
||||
// Append the hiddenInput input to the body
|
||||
document.body.appendChild(hiddenInput);
|
||||
// select the content
|
||||
hiddenInput.select();
|
||||
// Execute the copy command
|
||||
document.execCommand("copy");
|
||||
// Remove the input from the body after copy text
|
||||
document.body.removeChild(hiddenInput);
|
||||
// store target button label value
|
||||
var orignalLabel = event.getSource().get("v.label");
|
||||
// change button icon after copy text
|
||||
event.getSource().set("v.iconName" , 'utility:check');
|
||||
// change button label with 'copied' after copy text
|
||||
event.getSource().set("v.label" , 'copied');
|
||||
|
||||
// set timeout to reset icon and label value after 700 milliseconds
|
||||
setTimeout(function(){
|
||||
event.getSource().set("v.iconName" , 'utility:copy_to_clipboard');
|
||||
event.getSource().set("v.label" , orignalLabel);
|
||||
}, 700);
|
||||
|
||||
}
|
||||
})
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
({
|
||||
|
||||
// Your renderer method overrides go here
|
||||
|
||||
})
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue