Skip to content

Commit b71b4aa

Browse files
committed
better receipt table
1 parent 1b0d584 commit b71b4aa

File tree

3 files changed

+21
-32
lines changed

3 files changed

+21
-32
lines changed

src/monthly-giving-circle.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import './presentational/button-style';
1212
export type anUpdate = {
1313
message: string;
1414
status: 'success' | 'fail';
15+
donationId: string;
1516
};
1617

1718
@customElement('iaux-monthly-giving-circle')
@@ -34,11 +35,7 @@ export class MonthlyGivingCircle extends LitElement {
3435
return this.querySelector('iaux-mgc-receipts') as IauxMgcReceipts;
3536
}
3637

37-
updateReceived(update: {
38-
message: string;
39-
status: 'success' | 'fail';
40-
donationId: string;
41-
}) {
38+
updateReceived(update: anUpdate) {
4239
this.receiptListElement.emailSent({
4340
id: update.donationId,
4441
emailStatus: update.status,
@@ -62,7 +59,6 @@ export class MonthlyGivingCircle extends LitElement {
6259
}
6360

6461
protected render() {
65-
console.log('***', this.viewToDisplay, this.receipts);
6662
if (this.viewToDisplay === 'receipts') {
6763
return html`
6864
<iaux-mgc-title titleStyle="default">

src/receipts.ts

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,18 @@ export class IauxMgcReceipts extends LitElement {
6363
const day = splitDate[2];
6464

6565
const monthMap: { [key: number]: string } = {
66-
1: 'January',
67-
2: 'February',
68-
3: 'March',
69-
4: 'April',
70-
5: 'May',
71-
6: 'June',
72-
7: 'July',
73-
8: 'August',
74-
9: 'September',
75-
10: 'October',
76-
11: 'November',
77-
12: 'December',
66+
1: 'JAN',
67+
2: 'FEB',
68+
3: 'MAR',
69+
4: 'APR',
70+
5: 'MAY',
71+
6: 'JUN',
72+
7: 'JUL',
73+
8: 'AUG',
74+
9: 'SEP',
75+
10: 'OCT',
76+
11: 'NOV',
77+
12: 'DEC',
7878
};
7979

8080
const displayMonth = monthMap[month];
@@ -112,9 +112,9 @@ export class IauxMgcReceipts extends LitElement {
112112
emailStatusMessageToDisplay(donationSentStatus: donationEmailStatus): string {
113113
switch (donationSentStatus.emailStatus) {
114114
case 'success':
115-
return '✓ Email receipt sent';
115+
return '✓ Sent';
116116
case 'fail':
117-
return '✖ Email receipt failed';
117+
return '✖ Failed';
118118
default:
119119
return '';
120120
}
@@ -139,7 +139,6 @@ export class IauxMgcReceipts extends LitElement {
139139
<tr>
140140
<th class="date">Date</th>
141141
<th class="amount">Amount</th>
142-
<th class="status">Status</th>
143142
<th class="action">Action</th>
144143
</tr>
145144
${this.receipts.length
@@ -168,9 +167,6 @@ export class IauxMgcReceipts extends LitElement {
168167
${this.donationAmountFormatted(donation.amount)}
169168
</div>
170169
</td>
171-
<td class="status">
172-
<div class="donation-status">${donation.status}</div>
173-
</td>
174170
<td>
175171
<div class="request-receipt">
176172
<iaux-button-style
@@ -225,13 +221,10 @@ export class IauxMgcReceipts extends LitElement {
225221
}
226222
227223
th.date {
228-
width: 110px;
224+
width: 55px;
229225
}
230226
th.amount {
231-
width: 80px;
232-
}
233-
th.status {
234-
width: 70px;
227+
width: 55px;
235228
}
236229
th.action {
237230
width: 200px;
@@ -246,14 +239,14 @@ export class IauxMgcReceipts extends LitElement {
246239
align-content: center;
247240
justify-content: flex-start;
248241
align-items: center;
249-
gap: 20px;
242+
gap: 10px;
250243
}
251244
252245
.sent-status.success,
253246
.sent-status.fail {
254247
padding: 5px;
255248
background: rgb(238, 253, 238);
256-
width: 135px;
249+
width: 55px;
257250
min-height: 20px;
258251
}
259252
.sent-status.success {

test/monthly-giving-circle.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ describe('IauxMonthlyGivingCircle', () => {
3131
);
3232
});
3333

34-
describe('Receipts', () => {
34+
describe('Receipts View - CTA & onclick display:', () => {
3535
it('Displays receipts CTA when receipts are available', async () => {
3636
const el = await fixture<MonthlyGivingCircle>(
3737
html`<iaux-monthly-giving-circle

0 commit comments

Comments
 (0)