Skip to content

Commit 0e86992

Browse files
committed
prettier formatting
1 parent 74a3598 commit 0e86992

File tree

87 files changed

+497
-1809
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+497
-1809
lines changed

Diff for: bin/check-version.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ const pjson = require('../package.json');
33

44
const version = pjson.engines.node;
55
if (!semver.satisfies(process.version, version)) {
6-
console.log(
7-
`\n\nRequired node version ${version} not satisfied with current version ${process.version}.\n\n`
8-
);
6+
console.log(`\n\nRequired node version ${version} not satisfied with current version ${process.version}.\n\n`);
97
process.exit(1);
108
}

Diff for: dummy-data/courses/plan.json

+2-10
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,7 @@
2121
"sobject": "CourseRegistration__c",
2222
"saveRefs": false,
2323
"resolveRefs": true,
24-
"files": [
25-
"CourseRegistrations_con1.json",
26-
"CourseRegistrations_con2.json",
27-
"CourseRegistrations_con3.json"
28-
]
24+
"files": ["CourseRegistrations_con1.json", "CourseRegistrations_con2.json", "CourseRegistrations_con3.json"]
2925
},
3026
{
3127
"sobject": "EmailTemplate",
@@ -37,10 +33,6 @@
3733
"sobject": "EmailQueue__c",
3834
"saveRefs": true,
3935
"resolveRefs": true,
40-
"files": [
41-
"EmailQueue_error.json",
42-
"EmailQueue_sent.json",
43-
"EmailQueue_queued.json"
44-
]
36+
"files": ["EmailQueue_error.json", "EmailQueue_sent.json", "EmailQueue_queued.json"]
4537
}
4638
]

Diff for: force-app/components/courseInvitation/classes/CourseInvitationController.cls

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
public with sharing class CourseInvitationController {
22
@AuraEnabled
3-
public static List<CourseRegistration__c> createCourseRegistrations(
4-
Id courseId,
5-
List<Contact> contacts
6-
) {
3+
public static List<CourseRegistration__c> createCourseRegistrations(Id courseId, List<Contact> contacts) {
74
if (contacts.size() == 0 || courseId == null) {
85
throw new AuraException('');
96
}

Diff for: force-app/components/courseInvitation/classes/CourseInvitationControllerTest.cls

+22-98
Original file line numberDiff line numberDiff line change
@@ -23,54 +23,26 @@ private without sharing class CourseInvitationControllerTest {
2323
EmailConfirmationModalModelTest.jsonData,
2424
List<EmailConfirmationModalModel>.class
2525
);
26-
List<Contact> contacts = EmailConfirmationModalHelper.fetchOrCreateContacts(
27-
recipients
28-
);
26+
List<Contact> contacts = EmailConfirmationModalHelper.fetchOrCreateContacts(recipients);
2927

3028
System.assertEquals(3, contacts.size(), 'three contacts should exist');
3129

32-
List<CourseRegistration__c> registrations = [
33-
SELECT Id
34-
FROM CourseRegistration__c
35-
];
36-
System.assertEquals(
37-
0,
38-
registrations.size(),
39-
'no registrations before test'
40-
);
30+
List<CourseRegistration__c> registrations = [SELECT Id FROM CourseRegistration__c];
31+
System.assertEquals(0, registrations.size(), 'no registrations before test');
4132

4233
Test.StartTest();
43-
CourseInvitationController.createCourseRegistrations(
44-
course.Id,
45-
contacts
46-
);
34+
CourseInvitationController.createCourseRegistrations(course.Id, contacts);
4735
Test.StopTest();
4836

4937
registrations = [SELECT Id FROM CourseRegistration__c];
50-
System.assertEquals(
51-
3,
52-
registrations.size(),
53-
'three registrations after test'
54-
);
38+
System.assertEquals(3, registrations.size(), 'three registrations after test');
5539
}
5640

5741
@isTest
5842
private static void testCreateCourseRegistrations_allRegistrationsExists() {
59-
Contact c1 = new Contact(
60-
LastName = 'test',
61-
email = '[email protected]',
62-
TAG_Informed__c = true
63-
);
64-
Contact c2 = new Contact(
65-
LastName = 'test',
66-
email = '[email protected]',
67-
TAG_Informed__c = true
68-
);
69-
Contact c3 = new Contact(
70-
LastName = 'test',
71-
email = '[email protected]',
72-
TAG_Informed__c = true
73-
);
43+
Contact c1 = new Contact(LastName = 'test', email = '[email protected]', TAG_Informed__c = true);
44+
Contact c2 = new Contact(LastName = 'test', email = '[email protected]', TAG_Informed__c = true);
45+
Contact c3 = new Contact(LastName = 'test', email = '[email protected]', TAG_Informed__c = true);
7446
insert new List<Contact>{ c1, c2, c3 };
7547

7648
DateTime d = Date.today().addDays(1);
@@ -105,43 +77,23 @@ private without sharing class CourseInvitationControllerTest {
10577
EmailConfirmationModalModelTest.jsonData,
10678
List<EmailConfirmationModalModel>.class
10779
);
108-
List<Contact> contacts = EmailConfirmationModalHelper.fetchOrCreateContacts(
109-
recipients
110-
);
80+
List<Contact> contacts = EmailConfirmationModalHelper.fetchOrCreateContacts(recipients);
11181

11282
System.assertEquals(3, contacts.size(), 'three contacts should exist');
11383

114-
List<CourseRegistration__c> registrations = [
115-
SELECT Id
116-
FROM CourseRegistration__c
117-
];
118-
System.assertEquals(
119-
3,
120-
registrations.size(),
121-
'three registrations before test'
122-
);
84+
List<CourseRegistration__c> registrations = [SELECT Id FROM CourseRegistration__c];
85+
System.assertEquals(3, registrations.size(), 'three registrations before test');
12386

12487
Test.StartTest();
125-
registrations = CourseInvitationController.createCourseRegistrations(
126-
course.Id,
127-
contacts
128-
);
88+
registrations = CourseInvitationController.createCourseRegistrations(course.Id, contacts);
12989
Test.StopTest();
13090

131-
System.assertEquals(
132-
3,
133-
registrations.size(),
134-
'three registrations return in function'
135-
);
91+
System.assertEquals(3, registrations.size(), 'three registrations return in function');
13692
}
13793

13894
@isTest
13995
private static void testCreateCourseRegistrations_alreadyExists() {
140-
Contact con = new Contact(
141-
LastName = 'test',
142-
email = '[email protected]',
143-
TAG_Informed__c = true
144-
);
96+
Contact con = new Contact(LastName = 'test', email = '[email protected]', TAG_Informed__c = true);
14597
insert con;
14698
DateTime d = Date.today().addDays(1);
14799
Course__c course = new Course__c(
@@ -165,49 +117,21 @@ private without sharing class CourseInvitationControllerTest {
165117
EmailConfirmationModalModelTest.jsonData,
166118
List<EmailConfirmationModalModel>.class
167119
);
168-
List<Contact> contacts = EmailConfirmationModalHelper.fetchOrCreateContacts(
169-
recipients
170-
);
120+
List<Contact> contacts = EmailConfirmationModalHelper.fetchOrCreateContacts(recipients);
171121

172122
System.assertEquals(3, contacts.size(), 'three contacts should exist');
173123

174-
List<CourseRegistration__c> registrations = [
175-
SELECT Id
176-
FROM CourseRegistration__c
177-
];
178-
System.assertEquals(
179-
1,
180-
registrations.size(),
181-
'one registration before test'
182-
);
124+
List<CourseRegistration__c> registrations = [SELECT Id FROM CourseRegistration__c];
125+
System.assertEquals(1, registrations.size(), 'one registration before test');
183126

184127
Test.StartTest();
185-
CourseInvitationController.createCourseRegistrations(
186-
course.Id,
187-
contacts
188-
);
128+
CourseInvitationController.createCourseRegistrations(course.Id, contacts);
189129
Test.StopTest();
190130

191-
registrations = [
192-
SELECT Id
193-
FROM CourseRegistration__c
194-
WHERE Status__c = 'Invitert'
195-
];
196-
System.assertEquals(
197-
2,
198-
registrations.size(),
199-
'two invited registrations after test'
200-
);
131+
registrations = [SELECT Id FROM CourseRegistration__c WHERE Status__c = 'Invitert'];
132+
System.assertEquals(2, registrations.size(), 'two invited registrations after test');
201133

202-
registrations = [
203-
SELECT Id
204-
FROM CourseRegistration__c
205-
WHERE Status__c = 'Påmeldt'
206-
];
207-
System.assertEquals(
208-
1,
209-
registrations.size(),
210-
'one attending registrations after test'
211-
);
134+
registrations = [SELECT Id FROM CourseRegistration__c WHERE Status__c = 'Påmeldt'];
135+
System.assertEquals(1, registrations.size(), 'one attending registrations after test');
212136
}
213137
}

Diff for: force-app/components/courseInvitation/labels/CourseInvitation.labels-meta.xml

+4-8
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,14 @@
3939
<fullName>CourseInvitation_pressEnterToAdd</fullName>
4040
<language>en_US</language>
4141
<protected>false</protected>
42-
<shortDescription
43-
>[CourseInvitation] Press enter to add</shortDescription>
42+
<shortDescription>[CourseInvitation] Press enter to add</shortDescription>
4443
<value>Press enter to add</value>
4544
</labels>
4645
<labels>
4746
<fullName>CourseInvitation_goToConfirmation</fullName>
4847
<language>en_US</language>
4948
<protected>false</protected>
50-
<shortDescription
51-
>[CourseInvitation] Go to confirmation</shortDescription>
49+
<shortDescription>[CourseInvitation] Go to confirmation</shortDescription>
5250
<value>Confirm</value>
5351
</labels>
5452
<labels>
@@ -90,16 +88,14 @@
9088
<fullName>CourseInvitation_success</fullName>
9189
<language>en_US</language>
9290
<protected>false</protected>
93-
<shortDescription
94-
>[CourseInvitation] Successfully sent invitations</shortDescription>
91+
<shortDescription>[CourseInvitation] Successfully sent invitations</shortDescription>
9592
<value>Successfully sent invitations</value>
9693
</labels>
9794
<labels>
9895
<fullName>CourseInvitation_error</fullName>
9996
<language>en_US</language>
10097
<protected>false</protected>
101-
<shortDescription
102-
>[CourseInvitation] Successfully sent invitations</shortDescription>
98+
<shortDescription>[CourseInvitation] Successfully sent invitations</shortDescription>
10399
<value>Error</value>
104100
</labels>
105101
<labels>

Diff for: force-app/components/courseInvitation/lwc/courseInvitation/courseInvitation.html

+13-59
Original file line numberDiff line numberDiff line change
@@ -12,38 +12,20 @@
1212
>
1313
</c-email-confirmation-modal>
1414
<!-- GDPR CHECKBOX -->
15-
<c-gdpr-checkbox-modal
16-
if:true={showGdpr}
17-
oncancel={gdprCancel}
18-
onaccept={gdprAccept}
19-
>
20-
</c-gdpr-checkbox-modal>
15+
<c-gdpr-checkbox-modal if:true={showGdpr} oncancel={gdprCancel} onaccept={gdprAccept}> </c-gdpr-checkbox-modal>
2116
<!-- IMPORT USER -->
22-
<c-import-users-modal
23-
if:true={showImport}
24-
oncancel={importCancel}
25-
onsuccess={importSuccess}
26-
>
17+
<c-import-users-modal if:true={showImport} oncancel={importCancel} onsuccess={importSuccess}>
2718
</c-import-users-modal>
2819
<!-- #################################### -->
2920
<!-- ############### CARD ############### -->
3021
<!-- #################################### -->
31-
<lightning-card
32-
variant="Narrow"
33-
title={labels.title}
34-
icon-name="standard:email_chatter"
35-
>
22+
<lightning-card variant="Narrow" title={labels.title} icon-name="standard:email_chatter">
3623
<!-- #################################### -->
3724
<!-- ########## ACTION BUTTONS ########## -->
3825
<!-- #################################### -->
3926
<lightning-button-group slot="actions">
4027
<!-- IMPORT -->
41-
<lightning-button
42-
label={labels.importBtn}
43-
onclick={startImport}
44-
if:false={emailSent}
45-
>
46-
</lightning-button>
28+
<lightning-button label={labels.importBtn} onclick={startImport} if:false={emailSent}> </lightning-button>
4729

4830
<!-- CONFIRM -->
4931
<lightning-button
@@ -55,19 +37,13 @@
5537
>
5638
</lightning-button>
5739
<!-- CLOSE CONFIRM -->
58-
<lightning-button
59-
label={labels.close}
60-
onclick={restart}
61-
if:true={emailSent}
62-
>
63-
</lightning-button>
40+
<lightning-button label={labels.close} onclick={restart} if:true={emailSent}> </lightning-button>
6441
</lightning-button-group>
6542
<!-- #################################### -->
6643
<!-- ############# SPINNER ############## -->
6744
<!-- #################################### -->
6845
<div if:true={loading} style="position: relative; min-height: 10em">
69-
<lightning-spinner alternative-text="Loading" size="large">
70-
</lightning-spinner>
46+
<lightning-spinner alternative-text="Loading" size="large"> </lightning-spinner>
7147
</div>
7248

7349
<div class="slds-p-horizontal_medium" if:false={emailSent}>
@@ -83,11 +59,7 @@
8359
class="slds-m-vertical_medium slds-p-left_xx-small slds-p-top_xx-small slds-p-bottom_xxx-small"
8460
if:true={hasRecipients}
8561
>
86-
<lightning-pill-container
87-
items={recipients}
88-
onitemremove={removePill}
89-
>
90-
</lightning-pill-container>
62+
<lightning-pill-container items={recipients} onitemremove={removePill}> </lightning-pill-container>
9163
</div>
9264

9365
<!-- #################################### -->
@@ -126,22 +98,14 @@
12698
<!-- #################################### -->
12799
<!-- ####### ADD RECIPIENT BUTTON ####### -->
128100
<!-- #################################### -->
129-
<lightning-layout
130-
vertical-align="center"
131-
class="slds-p-top_small slds-p-bottom_x-small"
132-
>
101+
<lightning-layout vertical-align="center" class="slds-p-top_small slds-p-bottom_x-small">
133102
<lightning-layout-item flexibility="grow">
134-
<div
135-
class="slds-text-color_weak slds-text-body_small slds-p-right_small slds-float_right"
136-
>
103+
<div class="slds-text-color_weak slds-text-body_small slds-p-right_small slds-float_right">
137104
{labels.pressEnterToAdd}
138105
</div>
139106
</lightning-layout-item>
140107
<lightning-layout-item>
141-
<button
142-
class="slds-button slds-button_outline-brand slds-float_right"
143-
onclick={addEmail}
144-
>
108+
<button class="slds-button slds-button_outline-brand slds-float_right" onclick={addEmail}>
145109
{labels.addRecipient}
146110
</button>
147111
</lightning-layout-item>
@@ -151,10 +115,7 @@
151115
<!-- #################################### -->
152116
<!-- ############## SUCCESS ############# -->
153117
<!-- #################################### -->
154-
<div
155-
class="slds-var-p-top_x-small slds-var-p-bottom_medium slds-p-horizontal_medium"
156-
if:true={emailSent}
157-
>
118+
<div class="slds-var-p-top_x-small slds-var-p-bottom_medium slds-p-horizontal_medium" if:true={emailSent}>
158119
<span class="slds-align_absolute-center slds-m-bottom_small">
159120
<lightning-icon
160121
icon-name="utility:success"
@@ -163,21 +124,14 @@
163124
size="x-small"
164125
title={labels.emailSent}
165126
></lightning-icon>
166-
<div class="slds-p-left_small slds-text-heading_medium">
167-
{labels.contactsCreated}
168-
</div>
127+
<div class="slds-p-left_small slds-text-heading_medium">{labels.contactsCreated}</div>
169128
</span>
170129

171130
<!-- #################################### -->
172131
<!-- ############# INVITEES ############# -->
173132
<!-- #################################### -->
174133
<lightning-layout horizontal-align="center" multiple-rows>
175-
<template
176-
if:true={contacts}
177-
for:each={contacts}
178-
for:item="con"
179-
for:index="index"
180-
>
134+
<template if:true={contacts} for:each={contacts} for:item="con" for:index="index">
181135
<lightning-layout-item
182136
class="slds-m-right_xx-small slds-m-top_medium"
183137
key={con.Id}

0 commit comments

Comments
 (0)