-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from SFDO-Community/feature/dray/create-disbur…
…sements Adding "Create Bulk Disbursements" Quick Action component to Funding Request. This adds a Lightning component to allow users to schedule payments for funding requests.
- Loading branch information
Showing
15 changed files
with
764 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,3 +20,4 @@ log.html | |
output.xml | ||
report.html | ||
selenium-screenshot*.png | ||
.cci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
<aura:component controller="disbursementsCreateController" implements="force:lightningQuickActionWithoutHeader,force:hasRecordId"> | ||
|
||
<lightning:notificationsLibrary aura:id="notifLib"/> | ||
|
||
<!-- Init --> | ||
<aura:handler name="init" value="{!this}" | ||
action="{!c.doInit}"/> | ||
|
||
<!-- Default model set in helper --> | ||
<aura:attribute type="Map" name="model" /> | ||
|
||
<div class="wrap"> | ||
|
||
<!-- Header --> | ||
<h2 class="slds-text-heading_medium slds-hyphenate slds-m-bottom--large">Schedule Disbursements</h2> | ||
|
||
<div class="slds-section slds-is-open"> | ||
|
||
<!-- Funding Request Data --> | ||
<h3 class="slds-section__title slds-theme_shade"> | ||
<span class="slds-truncate slds-p-horizontal_small" title="Basics">Funding Request Information</span> | ||
</h3> | ||
<div class="slds-section__content"> | ||
<div class="slds-grid slds-grid_pull-padded-medium slds-m-bottom_large"> | ||
|
||
<div class="slds-p-horizontal_medium slds-size_1-of-2 slds-region_narrow"> | ||
<dl class="slds-dl_inline slds-wrap"> | ||
<dt class="slds-dl_inline__label slds-text-color_weak slds-truncate">Contact:</dt> | ||
<dd class="slds-dl_inline__detail slds-truncate">{!v.model.request.contactName}</dd> | ||
<dt class="slds-dl_inline__label slds-text-color_weak slds-truncate">Awarded Amount:</dt> | ||
<dd class="slds-dl_inline__detail slds-truncate"> | ||
<lightning:formattedNumber style="currency" value="{!v.model.request.awardedAmount}"/> | ||
</dd> | ||
</dl> | ||
</div> | ||
|
||
<div class="slds-p-horizontal_medium slds-size_1-of-2 slds-region_narrow"> | ||
<dl class="slds-dl_inline slds-wrap"> | ||
<dt class="slds-dl_inline__label slds-text-color_weak slds-truncate">Total Disbursed:</dt> | ||
<dd class="slds-dl_inline__detail slds-truncate"> | ||
<lightning:formattedNumber style="currency" value="{!v.model.request.totalDisbursed}"/> | ||
</dd> | ||
<dt class="slds-dl_inline__label slds-text-color_weak slds-truncate">Amount Remaining:</dt> | ||
<dd class="slds-dl_inline__detail slds-truncate"> | ||
<lightning:formattedNumber style="currency" value="{!v.model.request.totalRemaining}"/> | ||
</dd> | ||
</dl> | ||
</div> | ||
</div> | ||
<div class="slds-grid slds-grid_pull-padded-medium slds-p-left_large slds-p-right_large"> | ||
|
||
</div> | ||
</div> | ||
|
||
<!-- UI Messages --> | ||
<aura:if isTrue="{!not(empty(v.model.uiMessages))}"> | ||
<aura:iteration items="{!v.model.uiMessages}" var="m"> | ||
<ui:message title="{!m.title}" | ||
severity="{!m.severity}" | ||
closable="{!m.closeable}"> | ||
{!m.message} | ||
</ui:message> | ||
</aura:iteration> | ||
</aura:if> | ||
|
||
</div> | ||
|
||
<div class="slds-section slds-is-open"> | ||
<h3 class="slds-section__title slds-theme_shade"> | ||
<span class="slds-truncate slds-p-horizontal_small" title="Basics">Calculate Disbursements</span> | ||
</h3> | ||
<div class="slds-section__content"> | ||
|
||
<div class="slds-grid slds-grid_pull-padded-medium"> | ||
|
||
<div class="slds-p-horizontal_medium slds-size_1-of-2"> | ||
<lightning:input name="paymentCount" label="Number of Disbursements" type="number" value="{!v.model.formData.paymentCount}"/> | ||
</div> | ||
|
||
<div class="slds-p-horizontal_medium slds-size_1-of-2"> | ||
<lightning:input label="First Date" name="firstDate" type="date" value="{!v.model.formData.firstDate}"/> | ||
</div> | ||
</div> | ||
|
||
<div class="slds-grid slds-grid_pull-padded-medium"> | ||
|
||
<div class="slds-p-horizontal_medium slds-size_1-of-2 slds-grid"> | ||
<lightning:input type="number" name="intervalCount" label="Interval" value="{!v.model.formData.intervalCount}" class="slds-size_1-of-3 slds-p-right_small"/> | ||
|
||
<lightning:select label="Period" name="intervalType" value="{!v.model.formData.intervalType}" class="slds-size_2-of-3 "> | ||
<aura:iteration items="{!v.model.formDefaults.intervalTypes}" var="o"> | ||
<option text="{!o}"></option> | ||
</aura:iteration> | ||
</lightning:select> | ||
</div> | ||
|
||
<div class="slds-p-horizontal_medium slds-size_1-of-2"> | ||
<lightning:input type="number" label="Amount" | ||
step="0.01" | ||
name="paymentTotal" | ||
value="{!v.model.formData.paymentTotal}" | ||
max="{!v.model.request.totalRemaining}" | ||
onblur="{!c.inputBlur}" | ||
/> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
</div> | ||
|
||
<div class="slds-section slds-is-open"> | ||
<div class="slds-section__content"> | ||
|
||
<div class="slds-grid slds-grid_pull-padded-medium"> | ||
|
||
<div class="slds-p-horizontal_medium slds-size_1-of-1 "> | ||
<lightning:button name="calculate" type="button" | ||
onclick="{!c.calculate}" | ||
label="Calculate" | ||
class="slds-align_absolute-center" | ||
disabled="{!not(empty(v.model.uiMessages))}" | ||
/> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
</div> | ||
|
||
<!-- Disbursement Review Table --> | ||
<aura:if isTrue="{!not(empty(v.model.disbursements))}"> | ||
<div class="slds-section slds-is-open"> | ||
<div class="slds-section__content"> | ||
<lightning:datatable | ||
keyField="id" | ||
data="{! v.model.disbursements }" | ||
columns="{! v.model.formDefaults.columns }" | ||
hideCheckboxColumn="true" | ||
oncellchange="{!c.handleRowChange}" | ||
aura:id="disbursementTable" | ||
/> | ||
</div> | ||
</div> | ||
|
||
<!-- Footer --> | ||
<div class="slds-section slds-is-open slds-text-align--center slds-m-top--medium"> | ||
<lightning:button label="Cancel" variant="neutral" onclick="{!c.handleCancel}" /> | ||
<lightning:button label="Save" variant="brand" onclick="{!c.handleSave}" disabled="{!empty(v.model.disbursements)}"/> | ||
</div> | ||
</aura:if> | ||
</div> | ||
</aura:component> |
5 changes: 5 additions & 0 deletions
5
src/aura/disbursementsCreate/disbursementsCreate.cmp-meta.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<apiVersion>43.0</apiVersion> | ||
<description>A Lightning Component Bundle</description> | ||
</AuraDefinitionBundle> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.THIS {} | ||
|
||
.THIS.wrap { | ||
position: relative; | ||
display: block; | ||
width: 100%; | ||
min-width: 550px; | ||
} |
32 changes: 32 additions & 0 deletions
32
src/aura/disbursementsCreate/disbursementsCreateController.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
({ | ||
doInit: function (cmp, event, helper) { | ||
helper.init(cmp); | ||
}, | ||
|
||
calculate: function (cmp, event, helper) { | ||
helper.calcDisp(cmp); | ||
}, | ||
|
||
handleRowChange: function (cmp, event, helper) { | ||
var draftValues = event.getParam('draftValues'); | ||
|
||
// Edits to be saved immediately to the in-memory disbursement | ||
helper.setDispursementProperty(cmp, draftValues[0]); | ||
|
||
// Since we live edit the pending disbursements, we'll clear the drafts | ||
cmp.find('disbursementTable').set('v.draftValues', null); | ||
}, | ||
|
||
handleSave: function (cmp, event, helper) { | ||
helper.saveDisps(cmp); | ||
}, | ||
|
||
inputBlur: function (cmp, event, helper) { | ||
helper.validate(cmp); | ||
}, | ||
|
||
handleCancel: function () { | ||
$A.get("e.force:closeQuickAction").fire(); | ||
}, | ||
|
||
}) |
Oops, something went wrong.