SyncMadeEasy/force-app/main/default/aura/BatchProcessingPage/BatchProcessingPage.cmp

611 lines
39 KiB
Plaintext

<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" /> &nbsp; &nbsp; <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>