189 lines
10 KiB
Plaintext
189 lines
10 KiB
Plaintext
<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> |