Skip to content

Commit 92df6d6

Browse files
authored
Merge pull request #264 from dedis/mock-update-hintbutton-aelalamy
BUGFIX : Change the mock data to make it work with hint button + Minor Display Issue
2 parents 643b7b2 + 97e0a64 commit 92df6d6

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

web/frontend/src/mocks/mockData.ts

+11
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ const mockForm1: any = {
4343
MaxN: 2,
4444
MinN: 1,
4545
Choices: ['tomato', 'salad', 'onion'],
46+
Hint: '',
4647
},
4748
],
4849
Ranks: [
@@ -52,6 +53,7 @@ const mockForm1: any = {
5253
MaxN: 3,
5354
MinN: 3,
5455
Choices: ['BC', 'SV', 'Parmentier'],
56+
Hint: '',
5557
},
5658
],
5759
},
@@ -64,13 +66,15 @@ const mockForm1: any = {
6466
MaxN: 1,
6567
MinN: 1,
6668
Choices: ['1', '2', '3', '4', '5'],
69+
Hint: '',
6770
},
6871
{
6972
Title: 'How did you find the teaching ?',
7073
ID: (0x41e2).toString(),
7174
MaxN: 1,
7275
MinN: 1,
7376
Choices: ['bad', 'normal', 'good'],
77+
Hint: 'Be honest. This is anonymous anyway',
7478
},
7579
],
7680
Texts: [
@@ -82,6 +86,7 @@ const mockForm1: any = {
8286
MinN: 1,
8387
Regex: '',
8488
Choices: ['TA1', 'TA2'],
89+
Hint: '',
8590
},
8691
],
8792
},
@@ -129,6 +134,7 @@ const mockForm2: any = {
129134
MaxN: 1,
130135
MinN: 1,
131136
Choices: ['1', '2', '3', '4', '5'],
137+
Hint: '',
132138
},
133139
],
134140
Texts: [
@@ -140,6 +146,7 @@ const mockForm2: any = {
140146
MinN: 2,
141147
Choices: ['TA1', 'TA2'],
142148
Regex: '^[A-Z][a-z]+$',
149+
Hint: '',
143150
},
144151
],
145152

@@ -157,6 +164,7 @@ const mockForm2: any = {
157164
MaxN: 3,
158165
MinN: 0,
159166
Choices: ['tomato', 'salad', 'onion', 'falafel'],
167+
Hint: '',
160168
},
161169
],
162170

@@ -167,13 +175,15 @@ const mockForm2: any = {
167175
MaxN: 4,
168176
MinN: 1,
169177
Choices: ['Esplanade', 'Giacometti', 'Arcadie', 'Montreux Jazz Cafe'],
178+
Hint: '',
170179
},
171180
{
172181
Title: 'IN or SC ?',
173182
ID: (0xbeef).toString(),
174183
MaxN: 2,
175184
MinN: 1,
176185
Choices: ['IN', 'SC'],
186+
Hint: 'The right answer is IN ;-)',
177187
},
178188
],
179189
Texts: [],
@@ -200,6 +210,7 @@ const mockForm3: any = {
200210
MaxLength: 50,
201211
Regex: '',
202212
Choices: ['Firstname', 'Main 🍕', 'Drink 🧃', 'Dessert 🍰'],
213+
Hint: 'If you change opinion call me before 11:30 a.m.',
203214
},
204215
],
205216
Subjects: [],

web/frontend/src/pages/ballot/components/Rank.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ const Rank: FC<RankProps> = ({ rank, answers }) => {
8383
<div>
8484
<h3 className="text-lg break-words text-gray-600 w-96">{rank.Title}</h3>
8585
</div>
86-
<div>
86+
<div className="text-right">
8787
<HintButton text={rank.Hint} />
8888
</div>
8989
</div>

web/frontend/src/pages/ballot/components/Select.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ const Select: FC<SelectProps> = ({ select, answers, setAnswers }) => {
8080
<div>
8181
<h3 className="text-lg break-words text-gray-600 w-96">{select.Title}</h3>
8282
</div>
83-
<div>
83+
<div className="text-right">
8484
<HintButton text={select.Hint} />
8585
</div>
8686
</div>

web/frontend/src/pages/ballot/components/Text.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ const Text: FC<TextProps> = ({ text, answers, setAnswers }) => {
103103
<div>
104104
<h3 className="text-lg break-words text-gray-600 w-96">{text.Title}</h3>
105105
</div>
106-
<div>
106+
<div className="text-right">
107107
<HintButton text={text.Hint} />
108108
</div>
109109
</div>

0 commit comments

Comments
 (0)