Skip to content

Commit 20b32ca

Browse files
authored
Added player email (#65)
* Added player email * Bumped proejct version and dependencies * Version tool update
1 parent b7e24d0 commit 20b32ca

File tree

10 files changed

+705
-627
lines changed

10 files changed

+705
-627
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,13 @@ cd quiz-host-app</pre>
103103
<td>SF_USERNAME</td>
104104
<td>Your Salesforce username.</td>
105105
</tr>
106+
<tr>
107+
<td>COLLECT_PLAYER_EMAILS</td>
108+
<td>Whether app should collect player emails (true/false).</td>
109+
</tr>
106110
</table>
107111
</li>
108-
<li>Generate a minified URL for the Heroku player app using <a target="_blank" href="https://bit.do/">this service</a> (I suggest a custom link for greater readability).</li>
112+
<li>Generate a minified URL for the Heroku player app using <a target="_blank" href="https://bit.do/">this service</a> or another URL shortener (opt for a custom link for greater readability).</li>
109113
<li>In your Salesforce org, go to <b>Setup &gt; Remote Site Settings</b> and add the complete player app URL (not the minified URL).</li>
110114
<li>Go to <b>Setup &gt; Custom Metadata Types</b> and add a <b>Quiz Settings</b> record. Set it up with these values:
111115
<table>

bin/set-project-version.js

Lines changed: 0 additions & 27 deletions
This file was deleted.

bin/set-project-version.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
SCRIPT_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
3+
cd $SCRIPT_PATH
4+
5+
version="l"
6+
if [ "$#" -eq 1 ]; then
7+
version="$1"
8+
else
9+
echo "Missing project version argument"
10+
exit -1
11+
fi
12+
13+
sed -E -i '' -e "s|\"version\": \"[0-9]+\.[0-9]+\.[0-9]+\",|\"version\": \"$version\",|" ../package.json && \
14+
sed -E -i '' -e "s|HOST_APP_VERSION = '[0-9]+\.[0-9]+\.[0-9]+';|HOST_APP_VERSION = '$version';|" ../src/main/default/lwc/gameApp/gameApp.js && \
15+
npm install
16+
17+
EXIT_CODE="$?"
18+
19+
# Check exit code
20+
echo ""
21+
if [ "$EXIT_CODE" -eq 0 ]; then
22+
echo "Version set to $version"
23+
else
24+
echo "Failed to set version $version"
25+
fi
26+
exit $EXIT_CODE

package-lock.json

Lines changed: 533 additions & 586 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sfdx-quiz",
3-
"version": "1.2.0",
3+
"version": "1.3.0",
44
"private": true,
55
"description": "Lightning Web Component Quiz App on a Salesforce Org",
66
"engines": {
@@ -18,15 +18,14 @@
1818
"postinstall": "node bin/check-version.js"
1919
},
2020
"devDependencies": {
21-
"@salesforce/eslint-config-lwc": "^0.5.0",
21+
"@salesforce/eslint-config-lwc": "^0.6.0",
2222
"@salesforce/sfdx-lwc-jest": "^0.7.1",
23-
"eslint": "^6.8.0",
23+
"eslint": "^7.0.0",
2424
"husky": "^4.2.5",
25-
"lint-staged": "^10.1.3",
26-
"prettier": "^2.0.4",
27-
"prettier-plugin-apex": "^1.3.0",
28-
"semver": "^7.3.2",
29-
"replace-in-file": "^5.0.2"
25+
"lint-staged": "^10.2.2",
26+
"prettier": "^2.0.5",
27+
"prettier-plugin-apex": "^1.4.0",
28+
"semver": "^7.3.2"
3029
},
3130
"husky": {
3231
"hooks": {

src/main/default/layouts/Quiz_Player__c-Player Layout.layout-meta.xml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,22 @@
1212
</layoutItems>
1313
<layoutItems>
1414
<behavior>Edit</behavior>
15-
<field>Score__c</field>
15+
<field>Email__c</field>
1616
</layoutItems>
1717
<layoutItems>
1818
<behavior>Edit</behavior>
19-
<field>Ranking__c</field>
19+
<field>Score__c</field>
2020
</layoutItems>
2121
</layoutColumns>
2222
<layoutColumns>
2323
<layoutItems>
2424
<behavior>Edit</behavior>
2525
<field>OwnerId</field>
2626
</layoutItems>
27+
<layoutItems>
28+
<behavior>Edit</behavior>
29+
<field>Ranking__c</field>
30+
</layoutItems>
2731
</layoutColumns>
2832
<style>TwoColumnsTopToBottom</style>
2933
</layoutSections>
@@ -47,9 +51,10 @@
4751
<style>TwoColumnsTopToBottom</style>
4852
</layoutSections>
4953
<layoutSections>
50-
<customLabel>false</customLabel>
54+
<customLabel>true</customLabel>
5155
<detailHeading>false</detailHeading>
5256
<editHeading>true</editHeading>
57+
<label>Custom Links</label>
5358
<layoutColumns/>
5459
<layoutColumns/>
5560
<layoutColumns/>
@@ -64,4 +69,10 @@
6469
<showInteractionLogPanel>false</showInteractionLogPanel>
6570
<showRunAssignmentRulesCheckbox>false</showRunAssignmentRulesCheckbox>
6671
<showSubmitAndAttachButton>false</showSubmitAndAttachButton>
72+
<summaryLayout>
73+
<masterLabel>00h3N000000rFUI</masterLabel>
74+
<sizeX>4</sizeX>
75+
<sizeY>0</sizeY>
76+
<summaryLayoutStyle>Default</summaryLayoutStyle>
77+
</summaryLayout>
6778
</Layout>

src/main/default/lwc/gameApp/gameApp.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default class GameApp extends LightningElement {
1414
@track isNextButtonDisabled = true;
1515
@track currentQuestion;
1616

17-
HOST_APP_VERSION = '1.2.0';
17+
HOST_APP_VERSION = '1.3.0';
1818

1919
@wire(getQuizSettings)
2020
wiredQuizSettings({ error, data }) {
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
3+
<fullName>Email__c</fullName>
4+
<externalId>false</externalId>
5+
<label>Email</label>
6+
<required>false</required>
7+
<trackTrending>false</trackTrending>
8+
<type>Email</type>
9+
<unique>false</unique>
10+
</CustomField>

src/main/default/objects/Quiz_Question__c/Quiz_Question__c.object-meta.xml

Lines changed: 104 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,40 +4,140 @@
44
<actionName>Accept</actionName>
55
<type>Default</type>
66
</actionOverrides>
7+
<actionOverrides>
8+
<actionName>Accept</actionName>
9+
<formFactor>Large</formFactor>
10+
<type>Default</type>
11+
</actionOverrides>
12+
<actionOverrides>
13+
<actionName>Accept</actionName>
14+
<formFactor>Small</formFactor>
15+
<type>Default</type>
16+
</actionOverrides>
17+
<actionOverrides>
18+
<actionName>CancelEdit</actionName>
19+
<type>Default</type>
20+
</actionOverrides>
21+
<actionOverrides>
22+
<actionName>CancelEdit</actionName>
23+
<formFactor>Large</formFactor>
24+
<type>Default</type>
25+
</actionOverrides>
726
<actionOverrides>
827
<actionName>CancelEdit</actionName>
28+
<formFactor>Small</formFactor>
29+
<type>Default</type>
30+
</actionOverrides>
31+
<actionOverrides>
32+
<actionName>Clone</actionName>
933
<type>Default</type>
1034
</actionOverrides>
1135
<actionOverrides>
1236
<actionName>Clone</actionName>
37+
<formFactor>Large</formFactor>
38+
<type>Default</type>
39+
</actionOverrides>
40+
<actionOverrides>
41+
<actionName>Clone</actionName>
42+
<formFactor>Small</formFactor>
43+
<type>Default</type>
44+
</actionOverrides>
45+
<actionOverrides>
46+
<actionName>Delete</actionName>
47+
<type>Default</type>
48+
</actionOverrides>
49+
<actionOverrides>
50+
<actionName>Delete</actionName>
51+
<formFactor>Large</formFactor>
1352
<type>Default</type>
1453
</actionOverrides>
1554
<actionOverrides>
1655
<actionName>Delete</actionName>
56+
<formFactor>Small</formFactor>
57+
<type>Default</type>
58+
</actionOverrides>
59+
<actionOverrides>
60+
<actionName>Edit</actionName>
61+
<type>Default</type>
62+
</actionOverrides>
63+
<actionOverrides>
64+
<actionName>Edit</actionName>
65+
<formFactor>Large</formFactor>
1766
<type>Default</type>
1867
</actionOverrides>
1968
<actionOverrides>
2069
<actionName>Edit</actionName>
70+
<formFactor>Small</formFactor>
2171
<type>Default</type>
2272
</actionOverrides>
2373
<actionOverrides>
2474
<actionName>List</actionName>
2575
<type>Default</type>
2676
</actionOverrides>
77+
<actionOverrides>
78+
<actionName>List</actionName>
79+
<formFactor>Large</formFactor>
80+
<type>Default</type>
81+
</actionOverrides>
82+
<actionOverrides>
83+
<actionName>List</actionName>
84+
<formFactor>Small</formFactor>
85+
<type>Default</type>
86+
</actionOverrides>
87+
<actionOverrides>
88+
<actionName>New</actionName>
89+
<type>Default</type>
90+
</actionOverrides>
91+
<actionOverrides>
92+
<actionName>New</actionName>
93+
<formFactor>Large</formFactor>
94+
<type>Default</type>
95+
</actionOverrides>
2796
<actionOverrides>
2897
<actionName>New</actionName>
98+
<formFactor>Small</formFactor>
99+
<type>Default</type>
100+
</actionOverrides>
101+
<actionOverrides>
102+
<actionName>SaveEdit</actionName>
29103
<type>Default</type>
30104
</actionOverrides>
31105
<actionOverrides>
32106
<actionName>SaveEdit</actionName>
107+
<formFactor>Large</formFactor>
108+
<type>Default</type>
109+
</actionOverrides>
110+
<actionOverrides>
111+
<actionName>SaveEdit</actionName>
112+
<formFactor>Small</formFactor>
113+
<type>Default</type>
114+
</actionOverrides>
115+
<actionOverrides>
116+
<actionName>Tab</actionName>
117+
<type>Default</type>
118+
</actionOverrides>
119+
<actionOverrides>
120+
<actionName>Tab</actionName>
121+
<formFactor>Large</formFactor>
33122
<type>Default</type>
34123
</actionOverrides>
35124
<actionOverrides>
36125
<actionName>Tab</actionName>
126+
<formFactor>Small</formFactor>
127+
<type>Default</type>
128+
</actionOverrides>
129+
<actionOverrides>
130+
<actionName>View</actionName>
131+
<type>Default</type>
132+
</actionOverrides>
133+
<actionOverrides>
134+
<actionName>View</actionName>
135+
<formFactor>Large</formFactor>
37136
<type>Default</type>
38137
</actionOverrides>
39138
<actionOverrides>
40139
<actionName>View</actionName>
140+
<formFactor>Small</formFactor>
41141
<type>Default</type>
42142
</actionOverrides>
43143
<allowInChatterGroups>false</allowInChatterGroups>
@@ -52,14 +152,17 @@
52152
<enableSearch>true</enableSearch>
53153
<enableSharing>true</enableSharing>
54154
<enableStreamingApi>true</enableStreamingApi>
155+
<externalSharingModel>Private</externalSharingModel>
55156
<label>Quiz Question</label>
56157
<nameField>
57158
<displayFormat>Q-{0000}</displayFormat>
58159
<label>Question Id</label>
59160
<type>AutoNumber</type>
60161
</nameField>
61162
<pluralLabel>Quiz Questions</pluralLabel>
62-
<searchLayouts/>
163+
<searchLayouts>
164+
<searchResultsAdditionalFields>Label__c</searchResultsAdditionalFields>
165+
</searchLayouts>
63166
<sharingModel>ReadWrite</sharingModel>
64167
<visibility>Public</visibility>
65168
</CustomObject>

src/main/default/permissionsets/Quiz_Host.permissionset-meta.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
<field>Quiz_Answer__c.Timestamp__c</field>
2020
<readable>true</readable>
2121
</fieldPermissions>
22+
<fieldPermissions>
23+
<editable>true</editable>
24+
<field>Quiz_Player__c.Email__c</field>
25+
<readable>true</readable>
26+
</fieldPermissions>
2227
<fieldPermissions>
2328
<editable>true</editable>
2429
<field>Quiz_Player__c.Ranking__c</field>

0 commit comments

Comments
 (0)