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

350 lines
27 KiB
Plaintext

<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" /> &nbsp; &nbsp; <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"> &nbsp; &nbsp;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"> &nbsp; &nbsp;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"> &nbsp; &nbsp;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 &amp; 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 &amp; 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"> &nbsp; &nbsp;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"> &nbsp; &nbsp;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"> &nbsp; &nbsp;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"> &nbsp; &nbsp;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"> &nbsp; &nbsp;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"> &nbsp; &nbsp;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"> &nbsp; &nbsp;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"> &nbsp; &nbsp;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 &amp; 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 &amp; Go to the next step" title="Save &amp; 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 >