@almadar/std 14.8.0 → 14.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/behaviors/registry/app/organisms/std-api-gateway.orb +1167 -4114
  2. package/behaviors/registry/app/organisms/std-booking-system.orb +2627 -4281
  3. package/behaviors/registry/app/organisms/std-cicd-pipeline.orb +1313 -3724
  4. package/behaviors/registry/app/organisms/std-cms.orb +1658 -4903
  5. package/behaviors/registry/app/organisms/std-coding-academy.orb +686 -1238
  6. package/behaviors/registry/app/organisms/std-crm.orb +1778 -5995
  7. package/behaviors/registry/app/organisms/std-devops-dashboard.orb +1918 -5539
  8. package/behaviors/registry/app/organisms/std-finance-tracker.orb +1064 -3721
  9. package/behaviors/registry/app/organisms/std-healthcare.orb +2810 -7215
  10. package/behaviors/registry/app/organisms/std-helpdesk.orb +1065 -4161
  11. package/behaviors/registry/app/organisms/std-hr-portal.orb +2300 -6322
  12. package/behaviors/registry/app/organisms/std-iot-dashboard.orb +1582 -3721
  13. package/behaviors/registry/app/organisms/std-lms.orb +1885 -3952
  14. package/behaviors/registry/app/organisms/std-project-manager.orb +1226 -5123
  15. package/behaviors/registry/app/organisms/std-realtime-chat.orb +1147 -3794
  16. package/behaviors/registry/app/organisms/std-social-feed.orb +1044 -1728
  17. package/behaviors/registry/app/organisms/std-trading-dashboard.orb +1208 -3186
  18. package/behaviors/registry/core/atoms/std-graphs.orb +40 -41
  19. package/behaviors/registry/core/atoms/std-stats.orb +131 -110
  20. package/behaviors/registry/service/atoms/std-service-custom-bearer.orb +351 -345
  21. package/behaviors/registry/service/atoms/std-service-email.orb +334 -328
  22. package/behaviors/registry/service/atoms/std-service-github.orb +308 -365
  23. package/behaviors/registry/service/atoms/std-service-llm.orb +329 -437
  24. package/behaviors/registry/service/atoms/std-service-oauth.orb +261 -564
  25. package/behaviors/registry/service/atoms/std-service-redis.orb +299 -405
  26. package/behaviors/registry/service/atoms/std-service-storage.orb +293 -505
  27. package/behaviors/registry/service/atoms/std-service-twilio.orb +315 -393
  28. package/behaviors/registry/service/atoms/std-service-youtube.orb +266 -547
  29. package/dist/behaviors/registry/app/organisms/std-api-gateway.orb +1167 -4114
  30. package/dist/behaviors/registry/app/organisms/std-booking-system.orb +2627 -4281
  31. package/dist/behaviors/registry/app/organisms/std-cicd-pipeline.orb +1313 -3724
  32. package/dist/behaviors/registry/app/organisms/std-cms.orb +1658 -4903
  33. package/dist/behaviors/registry/app/organisms/std-coding-academy.orb +686 -1238
  34. package/dist/behaviors/registry/app/organisms/std-crm.orb +1778 -5995
  35. package/dist/behaviors/registry/app/organisms/std-devops-dashboard.orb +1918 -5539
  36. package/dist/behaviors/registry/app/organisms/std-finance-tracker.orb +1064 -3721
  37. package/dist/behaviors/registry/app/organisms/std-healthcare.orb +2810 -7215
  38. package/dist/behaviors/registry/app/organisms/std-helpdesk.orb +1065 -4161
  39. package/dist/behaviors/registry/app/organisms/std-hr-portal.orb +2300 -6322
  40. package/dist/behaviors/registry/app/organisms/std-iot-dashboard.orb +1582 -3721
  41. package/dist/behaviors/registry/app/organisms/std-lms.orb +1885 -3952
  42. package/dist/behaviors/registry/app/organisms/std-project-manager.orb +1226 -5123
  43. package/dist/behaviors/registry/app/organisms/std-realtime-chat.orb +1147 -3794
  44. package/dist/behaviors/registry/app/organisms/std-social-feed.orb +1044 -1728
  45. package/dist/behaviors/registry/app/organisms/std-trading-dashboard.orb +1208 -3186
  46. package/dist/behaviors/registry/core/atoms/std-graphs.orb +40 -41
  47. package/dist/behaviors/registry/core/atoms/std-stats.orb +131 -110
  48. package/dist/behaviors/registry/service/atoms/std-service-custom-bearer.orb +351 -345
  49. package/dist/behaviors/registry/service/atoms/std-service-email.orb +334 -328
  50. package/dist/behaviors/registry/service/atoms/std-service-github.orb +308 -365
  51. package/dist/behaviors/registry/service/atoms/std-service-llm.orb +329 -437
  52. package/dist/behaviors/registry/service/atoms/std-service-oauth.orb +261 -564
  53. package/dist/behaviors/registry/service/atoms/std-service-redis.orb +299 -405
  54. package/dist/behaviors/registry/service/atoms/std-service-storage.orb +293 -505
  55. package/dist/behaviors/registry/service/atoms/std-service-twilio.orb +315 -393
  56. package/dist/behaviors/registry/service/atoms/std-service-youtube.orb +266 -547
  57. package/package.json +1 -1
@@ -1,10 +1,20 @@
1
1
  {
2
2
  "name": "std-coding-academy",
3
- "version": "1.0.0",
4
- "description": "Coding academy: sequence/build/event programming challenges with student progress.",
3
+ "version": "2.0.0",
4
+ "description": "Coding academy: sequence/build/event programming challenges (game-shell) plus a student progress dashboard.",
5
5
  "orbitals": [
6
6
  {
7
7
  "name": "SeqChallengeOrbital",
8
+ "uses": [
9
+ {
10
+ "from": "std/behaviors/std-service-youtube",
11
+ "as": "YouTube"
12
+ },
13
+ {
14
+ "from": "std/behaviors/std-service-storage",
15
+ "as": "Storage"
16
+ }
17
+ ],
8
18
  "entity": {
9
19
  "name": "SeqChallenge",
10
20
  "persistence": "runtime",
@@ -38,6 +48,11 @@
38
48
  "name": "level",
39
49
  "type": "number",
40
50
  "default": 1.0
51
+ },
52
+ {
53
+ "name": "videoId",
54
+ "type": "string",
55
+ "default": ""
41
56
  }
42
57
  ]
43
58
  },
@@ -77,6 +92,10 @@
77
92
  {
78
93
  "name": "level",
79
94
  "type": "number"
95
+ },
96
+ {
97
+ "name": "videoId",
98
+ "type": "string"
80
99
  }
81
100
  ]
82
101
  },
@@ -155,6 +174,10 @@
155
174
  {
156
175
  "name": "level",
157
176
  "type": "number"
177
+ },
178
+ {
179
+ "name": "videoId",
180
+ "type": "string"
158
181
  }
159
182
  ]
160
183
  },
@@ -199,22 +222,22 @@
199
222
  "render-ui",
200
223
  "main",
201
224
  {
202
- "type": "game-shell",
203
225
  "appName": "Coding Academy",
204
226
  "showTopBar": true,
205
227
  "children": [
206
228
  {
229
+ "type": "game-menu",
230
+ "title": "Sequencer Challenge",
207
231
  "menuItems": [
208
232
  {
209
- "event": "START",
233
+ "label": "Start",
210
234
  "variant": "primary",
211
- "label": "Start"
235
+ "event": "START"
212
236
  }
213
- ],
214
- "title": "Sequencer Challenge",
215
- "type": "game-menu"
237
+ ]
216
238
  }
217
- ]
239
+ ],
240
+ "type": "game-shell"
218
241
  }
219
242
  ]
220
243
  ]
@@ -228,16 +251,15 @@
228
251
  "render-ui",
229
252
  "main",
230
253
  {
231
- "appName": "Coding Academy",
254
+ "showTopBar": true,
232
255
  "type": "game-shell",
256
+ "appName": "Coding Academy",
233
257
  "children": [
234
258
  {
235
- "type": "stack",
236
259
  "direction": "vertical",
237
260
  "gap": "md",
238
261
  "children": [
239
262
  {
240
- "type": "game-hud",
241
263
  "stats": [
242
264
  {
243
265
  "value": "@entity.score",
@@ -247,17 +269,19 @@
247
269
  "label": "Level",
248
270
  "value": "@entity.level"
249
271
  }
250
- ]
272
+ ],
273
+ "type": "game-hud"
251
274
  },
275
+ "@trait.SeqLessonVideo",
252
276
  {
253
277
  "type": "sequencer-board",
254
- "entity": "SeqChallenge",
255
- "completeEvent": "COMPLETE"
278
+ "completeEvent": "COMPLETE",
279
+ "entity": "SeqChallenge"
256
280
  }
257
- ]
281
+ ],
282
+ "type": "stack"
258
283
  }
259
- ],
260
- "showTopBar": true
284
+ ]
261
285
  }
262
286
  ]
263
287
  ]
@@ -277,21 +301,21 @@
277
301
  "main",
278
302
  {
279
303
  "showTopBar": true,
304
+ "appName": "Coding Academy",
305
+ "type": "game-shell",
280
306
  "children": [
281
307
  {
282
- "title": "Well Done!",
283
308
  "menuItems": [
284
309
  {
285
- "label": "Play Again",
310
+ "event": "RESTART",
286
311
  "variant": "primary",
287
- "event": "RESTART"
312
+ "label": "Play Again"
288
313
  }
289
314
  ],
315
+ "title": "Well Done!",
290
316
  "type": "game-over-screen"
291
317
  }
292
- ],
293
- "appName": "Coding Academy",
294
- "type": "game-shell"
318
+ ]
295
319
  }
296
320
  ]
297
321
  ]
@@ -305,22 +329,22 @@
305
329
  "render-ui",
306
330
  "main",
307
331
  {
308
- "appName": "Coding Academy",
309
- "showTopBar": true,
310
332
  "type": "game-shell",
311
333
  "children": [
312
334
  {
313
335
  "title": "Sequencer Challenge",
314
- "type": "game-menu",
315
336
  "menuItems": [
316
337
  {
317
- "label": "Start",
318
338
  "event": "START",
319
- "variant": "primary"
339
+ "variant": "primary",
340
+ "label": "Start"
320
341
  }
321
- ]
342
+ ],
343
+ "type": "game-menu"
322
344
  }
323
- ]
345
+ ],
346
+ "appName": "Coding Academy",
347
+ "showTopBar": true
324
348
  }
325
349
  ]
326
350
  ]
@@ -328,6 +352,170 @@
328
352
  ]
329
353
  },
330
354
  "scope": "collection"
355
+ },
356
+ {
357
+ "ref": "YouTube.traits.ServiceYoutubeYoutube",
358
+ "name": "SeqLessonVideo",
359
+ "config": {
360
+ "uiTrait": "@trait.SeqLessonPlayer",
361
+ "videoId": "@entity.videoId",
362
+ "autoplay": false,
363
+ "controls": true
364
+ }
365
+ },
366
+ {
367
+ "name": "SeqLessonPlayer",
368
+ "category": "interaction",
369
+ "stateMachine": {
370
+ "states": [
371
+ {
372
+ "name": "ready",
373
+ "isInitial": true
374
+ }
375
+ ],
376
+ "events": [
377
+ {
378
+ "key": "INIT",
379
+ "name": "Initialize"
380
+ }
381
+ ],
382
+ "transitions": [
383
+ {
384
+ "from": "ready",
385
+ "to": "ready",
386
+ "event": "INIT",
387
+ "effects": [
388
+ [
389
+ "render-ui",
390
+ "main",
391
+ {
392
+ "children": [
393
+ {
394
+ "gap": "sm",
395
+ "children": [
396
+ {
397
+ "type": "icon",
398
+ "name": "video"
399
+ },
400
+ {
401
+ "type": "typography",
402
+ "variant": "caption",
403
+ "content": "Lesson video",
404
+ "color": "muted"
405
+ },
406
+ {
407
+ "type": "typography",
408
+ "content": "@config.videoId",
409
+ "variant": "body"
410
+ }
411
+ ],
412
+ "direction": "vertical",
413
+ "type": "stack",
414
+ "align": "center"
415
+ }
416
+ ],
417
+ "type": "card"
418
+ }
419
+ ]
420
+ ]
421
+ }
422
+ ]
423
+ },
424
+ "scope": "instance"
425
+ },
426
+ {
427
+ "ref": "Storage.traits.ServiceStorageStorage",
428
+ "name": "SeqProgressStorage",
429
+ "config": {
430
+ "uiTrait": "@trait.SeqProgressForm",
431
+ "bucket": "coding-academy-progress",
432
+ "acl": "private",
433
+ "maxSize": 102400.0,
434
+ "allowedMimeTypes": [
435
+ "application/json"
436
+ ]
437
+ },
438
+ "listens": [
439
+ {
440
+ "event": "UPLOAD",
441
+ "triggers": "UPLOAD",
442
+ "source": {
443
+ "kind": "trait",
444
+ "trait": "SeqProgressForm"
445
+ }
446
+ }
447
+ ]
448
+ },
449
+ {
450
+ "name": "SeqProgressForm",
451
+ "category": "interaction",
452
+ "emits": [
453
+ {
454
+ "event": "UPLOAD",
455
+ "scope": "external",
456
+ "payloadSchema": [
457
+ {
458
+ "name": "source",
459
+ "type": "string"
460
+ },
461
+ {
462
+ "name": "file",
463
+ "type": "string"
464
+ }
465
+ ]
466
+ }
467
+ ],
468
+ "stateMachine": {
469
+ "states": [
470
+ {
471
+ "name": "ready",
472
+ "isInitial": true
473
+ }
474
+ ],
475
+ "events": [
476
+ {
477
+ "key": "INIT",
478
+ "name": "Initialize"
479
+ },
480
+ {
481
+ "key": "UPLOAD",
482
+ "name": "Upload"
483
+ }
484
+ ],
485
+ "transitions": [
486
+ {
487
+ "from": "ready",
488
+ "to": "ready",
489
+ "event": "INIT",
490
+ "effects": [
491
+ [
492
+ "render-ui",
493
+ "main",
494
+ {
495
+ "gap": "sm",
496
+ "children": [
497
+ {
498
+ "name": "save",
499
+ "type": "icon"
500
+ },
501
+ {
502
+ "type": "button",
503
+ "label": "Save Progress",
504
+ "variant": "ghost",
505
+ "action": "UPLOAD",
506
+ "icon": "save"
507
+ }
508
+ ],
509
+ "direction": "horizontal",
510
+ "type": "stack",
511
+ "align": "center"
512
+ }
513
+ ]
514
+ ]
515
+ }
516
+ ]
517
+ },
518
+ "scope": "instance"
331
519
  }
332
520
  ],
333
521
  "pages": [
@@ -337,6 +525,18 @@
337
525
  "traits": [
338
526
  {
339
527
  "ref": "SeqChallengeSequencerGame"
528
+ },
529
+ {
530
+ "ref": "SeqLessonVideo"
531
+ },
532
+ {
533
+ "ref": "SeqLessonPlayer"
534
+ },
535
+ {
536
+ "ref": "SeqProgressStorage"
537
+ },
538
+ {
539
+ "ref": "SeqProgressForm"
340
540
  }
341
541
  ]
342
542
  }
@@ -529,8 +729,8 @@
529
729
  "BuildChallenge",
530
730
  {
531
731
  "emit": {
532
- "success": "BuildChallengeLoaded",
533
- "failure": "BuildChallengeLoadFailed"
732
+ "failure": "BuildChallengeLoadFailed",
733
+ "success": "BuildChallengeLoaded"
534
734
  }
535
735
  }
536
736
  ],
@@ -540,20 +740,20 @@
540
740
  {
541
741
  "showTopBar": true,
542
742
  "type": "game-shell",
543
- "appName": "Coding Academy",
544
743
  "children": [
545
744
  {
546
745
  "type": "game-menu",
547
746
  "title": "Builder Challenge",
548
747
  "menuItems": [
549
748
  {
550
- "label": "Start",
551
749
  "event": "START",
552
- "variant": "primary"
750
+ "variant": "primary",
751
+ "label": "Start"
553
752
  }
554
753
  ]
555
754
  }
556
- ]
755
+ ],
756
+ "appName": "Coding Academy"
557
757
  }
558
758
  ]
559
759
  ]
@@ -567,18 +767,19 @@
567
767
  "render-ui",
568
768
  "main",
569
769
  {
770
+ "type": "game-shell",
570
771
  "children": [
571
772
  {
572
773
  "children": [
573
774
  {
574
775
  "stats": [
575
776
  {
576
- "label": "Score",
577
- "value": "@entity.score"
777
+ "value": "@entity.score",
778
+ "label": "Score"
578
779
  },
579
780
  {
580
- "label": "Level",
581
- "value": "@entity.level"
781
+ "value": "@entity.level",
782
+ "label": "Level"
582
783
  }
583
784
  ],
584
785
  "type": "game-hud"
@@ -589,14 +790,13 @@
589
790
  "type": "builder-board"
590
791
  }
591
792
  ],
592
- "gap": "md",
793
+ "type": "stack",
593
794
  "direction": "vertical",
594
- "type": "stack"
795
+ "gap": "md"
595
796
  }
596
797
  ],
597
- "showTopBar": true,
598
798
  "appName": "Coding Academy",
599
- "type": "game-shell"
799
+ "showTopBar": true
600
800
  }
601
801
  ]
602
802
  ]
@@ -615,22 +815,22 @@
615
815
  "render-ui",
616
816
  "main",
617
817
  {
818
+ "showTopBar": true,
618
819
  "type": "game-shell",
820
+ "appName": "Coding Academy",
619
821
  "children": [
620
822
  {
823
+ "type": "game-over-screen",
621
824
  "title": "Well Done!",
622
825
  "menuItems": [
623
826
  {
624
- "event": "RESTART",
827
+ "variant": "primary",
625
828
  "label": "Play Again",
626
- "variant": "primary"
829
+ "event": "RESTART"
627
830
  }
628
- ],
629
- "type": "game-over-screen"
831
+ ]
630
832
  }
631
- ],
632
- "showTopBar": true,
633
- "appName": "Coding Academy"
833
+ ]
634
834
  }
635
835
  ]
636
836
  ]
@@ -651,15 +851,15 @@
651
851
  "menuItems": [
652
852
  {
653
853
  "label": "Start",
654
- "event": "START",
655
- "variant": "primary"
854
+ "variant": "primary",
855
+ "event": "START"
656
856
  }
657
857
  ]
658
858
  }
659
859
  ],
660
- "appName": "Coding Academy",
661
860
  "showTopBar": true,
662
- "type": "game-shell"
861
+ "type": "game-shell",
862
+ "appName": "Coding Academy"
663
863
  }
664
864
  ]
665
865
  ]
@@ -877,22 +1077,22 @@
877
1077
  "render-ui",
878
1078
  "main",
879
1079
  {
1080
+ "type": "game-shell",
880
1081
  "children": [
881
1082
  {
882
1083
  "title": "Event Handler Challenge",
883
- "type": "game-menu",
884
1084
  "menuItems": [
885
1085
  {
886
1086
  "label": "Start",
887
1087
  "event": "START",
888
1088
  "variant": "primary"
889
1089
  }
890
- ]
1090
+ ],
1091
+ "type": "game-menu"
891
1092
  }
892
1093
  ],
893
- "appName": "Coding Academy",
894
- "type": "game-shell",
895
- "showTopBar": true
1094
+ "showTopBar": true,
1095
+ "appName": "Coding Academy"
896
1096
  }
897
1097
  ]
898
1098
  ]
@@ -910,26 +1110,26 @@
910
1110
  "children": [
911
1111
  {
912
1112
  "gap": "md",
913
- "direction": "vertical",
914
1113
  "type": "stack",
1114
+ "direction": "vertical",
915
1115
  "children": [
916
1116
  {
917
- "type": "game-hud",
918
1117
  "stats": [
919
1118
  {
920
- "label": "Score",
921
- "value": "@entity.score"
1119
+ "value": "@entity.score",
1120
+ "label": "Score"
922
1121
  },
923
1122
  {
924
- "label": "Level",
925
- "value": "@entity.level"
1123
+ "value": "@entity.level",
1124
+ "label": "Level"
926
1125
  }
927
- ]
1126
+ ],
1127
+ "type": "game-hud"
928
1128
  },
929
1129
  {
930
- "completeEvent": "COMPLETE",
1130
+ "type": "event-handler-board",
931
1131
  "entity": "EventChallenge",
932
- "type": "event-handler-board"
1132
+ "completeEvent": "COMPLETE"
933
1133
  }
934
1134
  ]
935
1135
  }
@@ -954,22 +1154,22 @@
954
1154
  "render-ui",
955
1155
  "main",
956
1156
  {
957
- "appName": "Coding Academy",
958
- "type": "game-shell",
959
1157
  "showTopBar": true,
1158
+ "type": "game-shell",
960
1159
  "children": [
961
1160
  {
962
1161
  "menuItems": [
963
1162
  {
1163
+ "label": "Play Again",
964
1164
  "variant": "primary",
965
- "event": "RESTART",
966
- "label": "Play Again"
1165
+ "event": "RESTART"
967
1166
  }
968
1167
  ],
969
1168
  "type": "game-over-screen",
970
1169
  "title": "Well Done!"
971
1170
  }
972
- ]
1171
+ ],
1172
+ "appName": "Coding Academy"
973
1173
  }
974
1174
  ]
975
1175
  ]
@@ -983,22 +1183,22 @@
983
1183
  "render-ui",
984
1184
  "main",
985
1185
  {
986
- "appName": "Coding Academy",
987
1186
  "children": [
988
1187
  {
989
1188
  "type": "game-menu",
990
1189
  "title": "Event Handler Challenge",
991
1190
  "menuItems": [
992
1191
  {
993
- "label": "Start",
994
1192
  "event": "START",
995
- "variant": "primary"
1193
+ "variant": "primary",
1194
+ "label": "Start"
996
1195
  }
997
1196
  ]
998
1197
  }
999
1198
  ],
1000
1199
  "showTopBar": true,
1001
- "type": "game-shell"
1200
+ "type": "game-shell",
1201
+ "appName": "Coding Academy"
1002
1202
  }
1003
1203
  ]
1004
1204
  ]
@@ -1022,9 +1222,28 @@
1022
1222
  },
1023
1223
  {
1024
1224
  "name": "StudentProgressOrbital",
1225
+ "uses": [
1226
+ {
1227
+ "from": "std/behaviors/std-app-layout",
1228
+ "as": "AppShell"
1229
+ },
1230
+ {
1231
+ "from": "std/behaviors/std-browse",
1232
+ "as": "Browse"
1233
+ },
1234
+ {
1235
+ "from": "std/behaviors/std-stats",
1236
+ "as": "Stats"
1237
+ },
1238
+ {
1239
+ "from": "std/behaviors/std-graphs",
1240
+ "as": "Graphs"
1241
+ }
1242
+ ],
1025
1243
  "entity": {
1026
1244
  "name": "StudentProgress",
1027
- "persistence": "runtime",
1245
+ "collection": "studentprogresses",
1246
+ "persistence": "persistent",
1028
1247
  "fields": [
1029
1248
  {
1030
1249
  "name": "id",
@@ -1032,80 +1251,111 @@
1032
1251
  "required": true
1033
1252
  },
1034
1253
  {
1035
- "name": "totalLessons",
1036
- "type": "number"
1254
+ "name": "student",
1255
+ "type": "string",
1256
+ "default": ""
1037
1257
  },
1038
1258
  {
1039
- "name": "completedLessons",
1040
- "type": "number"
1259
+ "name": "lessonsCompleted",
1260
+ "type": "number",
1261
+ "default": 0.0
1041
1262
  },
1042
1263
  {
1043
- "name": "averageScore",
1044
- "type": "number"
1264
+ "name": "avgScore",
1265
+ "type": "number",
1266
+ "default": 0.0
1045
1267
  },
1046
1268
  {
1047
1269
  "name": "streak",
1048
- "type": "number"
1270
+ "type": "number",
1271
+ "default": 0.0
1272
+ },
1273
+ {
1274
+ "name": "totalTimeMinutes",
1275
+ "type": "number",
1276
+ "default": 0.0
1277
+ },
1278
+ {
1279
+ "name": "progressPct",
1280
+ "type": "number",
1281
+ "default": 0.0
1282
+ },
1283
+ {
1284
+ "name": "day",
1285
+ "type": "string",
1286
+ "default": ""
1287
+ },
1288
+ {
1289
+ "name": "lastActiveAt",
1290
+ "type": "string",
1291
+ "default": ""
1049
1292
  }
1050
1293
  ]
1051
1294
  },
1052
1295
  "traits": [
1053
1296
  {
1054
- "name": "StudentProgressDisplay",
1297
+ "ref": "AppShell.traits.AppLayout",
1298
+ "name": "StudentProgressAppLayout",
1299
+ "config": {
1300
+ "appName": "Coding Academy",
1301
+ "searchEvent": "STUDENT_PROGRESS_SEARCH",
1302
+ "notifications": [],
1303
+ "notificationClickEvent": "STUDENT_PROGRESS_NOTIFICATIONS_OPEN",
1304
+ "contentTrait": "@trait.StudentProgressCatalog",
1305
+ "navItems": [
1306
+ {
1307
+ "label": "Sequencer",
1308
+ "icon": "list-ordered",
1309
+ "href": "/sequencer"
1310
+ },
1311
+ {
1312
+ "icon": "wrench",
1313
+ "href": "/builder",
1314
+ "label": "Builder"
1315
+ },
1316
+ {
1317
+ "href": "/events",
1318
+ "icon": "zap",
1319
+ "label": "Events"
1320
+ },
1321
+ {
1322
+ "label": "Progress",
1323
+ "href": "/progress",
1324
+ "icon": "trending-up"
1325
+ }
1326
+ ]
1327
+ },
1328
+ "events": {
1329
+ "SEARCH": "STUDENT_PROGRESS_SEARCH",
1330
+ "NOTIFY_CLICK": "STUDENT_PROGRESS_NOTIFICATIONS_OPEN"
1331
+ }
1332
+ },
1333
+ {
1334
+ "name": "StudentProgressCatalog",
1055
1335
  "category": "interaction",
1056
- "linkedEntity": "StudentProgress",
1057
- "emits": [
1336
+ "listens": [
1058
1337
  {
1059
- "event": "StudentProgressLoaded",
1060
- "description": "Fired when StudentProgress finishes loading",
1061
- "scope": "internal",
1062
- "payloadSchema": [
1063
- {
1064
- "name": "id",
1065
- "type": "string",
1066
- "required": true
1067
- },
1068
- {
1069
- "name": "totalLessons",
1070
- "type": "number"
1071
- },
1072
- {
1073
- "name": "completedLessons",
1074
- "type": "number"
1075
- },
1076
- {
1077
- "name": "averageScore",
1078
- "type": "number"
1079
- },
1080
- {
1081
- "name": "streak",
1082
- "type": "number"
1083
- }
1084
- ]
1338
+ "event": "STUDENT_PROGRESS_SEARCH",
1339
+ "triggers": "STUDENT_PROGRESS_SEARCH",
1340
+ "source": {
1341
+ "kind": "trait",
1342
+ "trait": "StudentProgressAppLayout"
1343
+ }
1085
1344
  },
1086
1345
  {
1087
- "event": "StudentProgressLoadFailed",
1088
- "description": "Fired when StudentProgress fails to load",
1089
- "scope": "internal",
1090
- "payloadSchema": [
1091
- {
1092
- "name": "message",
1093
- "type": "string"
1094
- }
1095
- ]
1346
+ "event": "STUDENT_PROGRESS_NOTIFICATIONS_OPEN",
1347
+ "triggers": "STUDENT_PROGRESS_NOTIFICATIONS_OPEN",
1348
+ "source": {
1349
+ "kind": "trait",
1350
+ "trait": "StudentProgressAppLayout"
1351
+ }
1096
1352
  }
1097
1353
  ],
1098
1354
  "stateMachine": {
1099
1355
  "states": [
1100
1356
  {
1101
- "name": "loading",
1357
+ "name": "composing",
1102
1358
  "isInitial": true
1103
- },
1104
- {
1105
- "name": "displaying"
1106
- },
1107
- {
1108
- "name": "refreshing"
1109
1359
  }
1110
1360
  ],
1111
1361
  "events": [
@@ -1114,50 +1364,21 @@
1114
1364
  "name": "Initialize"
1115
1365
  },
1116
1366
  {
1117
- "key": "LOADED",
1118
- "name": "Loaded"
1119
- },
1120
- {
1121
- "key": "REFRESH",
1122
- "name": "Refresh"
1123
- },
1124
- {
1125
- "key": "REFRESHED",
1126
- "name": "Refreshed"
1127
- },
1128
- {
1129
- "key": "StudentProgressLoaded",
1130
- "name": "StudentProgress loaded",
1367
+ "key": "STUDENT_PROGRESS_SEARCH",
1368
+ "name": "Student Progress Search",
1131
1369
  "payloadSchema": [
1132
1370
  {
1133
- "name": "id",
1134
- "type": "string",
1135
- "required": true
1136
- },
1137
- {
1138
- "name": "totalLessons",
1139
- "type": "number"
1140
- },
1141
- {
1142
- "name": "completedLessons",
1143
- "type": "number"
1144
- },
1145
- {
1146
- "name": "averageScore",
1147
- "type": "number"
1148
- },
1149
- {
1150
- "name": "streak",
1151
- "type": "number"
1371
+ "name": "value",
1372
+ "type": "string"
1152
1373
  }
1153
1374
  ]
1154
1375
  },
1155
1376
  {
1156
- "key": "StudentProgressLoadFailed",
1157
- "name": "StudentProgress load failed",
1377
+ "key": "STUDENT_PROGRESS_NOTIFICATIONS_OPEN",
1378
+ "name": "Student Progress Notifications Open",
1158
1379
  "payloadSchema": [
1159
1380
  {
1160
- "name": "message",
1381
+ "name": "id",
1161
1382
  "type": "string"
1162
1383
  }
1163
1384
  ]
@@ -1165,1123 +1386,335 @@
1165
1386
  ],
1166
1387
  "transitions": [
1167
1388
  {
1168
- "from": "loading",
1169
- "to": "displaying",
1389
+ "from": "composing",
1390
+ "to": "composing",
1170
1391
  "event": "INIT",
1171
1392
  "effects": [
1172
- [
1173
- "set",
1174
- "@entity.averageScore",
1175
- 0.0
1176
- ],
1177
- [
1178
- "set",
1179
- "@entity.completedLessons",
1180
- 0.0
1181
- ],
1182
- [
1183
- "set",
1184
- "@entity.streak",
1185
- 0.0
1186
- ],
1187
- [
1188
- "set",
1189
- "@entity.totalLessons",
1190
- 0.0
1191
- ],
1192
- [
1193
- "fetch",
1194
- "StudentProgress",
1195
- {
1196
- "emit": {
1197
- "success": "StudentProgressLoaded",
1198
- "failure": "StudentProgressLoadFailed"
1199
- }
1200
- }
1201
- ],
1202
1393
  [
1203
1394
  "render-ui",
1204
1395
  "main",
1205
1396
  {
1206
- "appName": "Coding Academy",
1207
- "type": "game-shell",
1208
1397
  "children": [
1209
1398
  {
1210
- "type": "scaled-diagram",
1399
+ "type": "stack",
1400
+ "direction": "horizontal",
1401
+ "justify": "between",
1402
+ "gap": "md",
1403
+ "align": "center",
1211
1404
  "children": [
1212
1405
  {
1213
- "direction": "vertical",
1214
- "gap": "lg",
1406
+ "direction": "horizontal",
1407
+ "align": "center",
1408
+ "type": "stack",
1215
1409
  "children": [
1216
1410
  {
1217
- "type": "breadcrumb",
1218
- "items": [
1219
- {
1220
- "label": "Home",
1221
- "href": "/"
1222
- },
1223
- {
1224
- "label": "Progress"
1225
- }
1226
- ]
1227
- },
1228
- {
1229
- "type": "stack",
1230
- "justify": "between",
1231
- "gap": "md",
1232
- "direction": "horizontal",
1233
- "children": [
1234
- {
1235
- "children": [
1236
- {
1237
- "name": "trending-up",
1238
- "type": "icon"
1239
- },
1240
- {
1241
- "content": "Progress",
1242
- "type": "typography",
1243
- "variant": "h2"
1244
- }
1245
- ],
1246
- "type": "stack",
1247
- "direction": "horizontal",
1248
- "gap": "md"
1249
- },
1250
- {
1251
- "type": "button",
1252
- "label": "Refresh",
1253
- "variant": "secondary",
1254
- "icon": "refresh-cw",
1255
- "action": "REFRESH"
1256
- }
1257
- ]
1258
- },
1259
- {
1260
- "type": "divider"
1261
- },
1262
- {
1263
- "padding": "md",
1264
- "type": "box",
1265
- "children": [
1266
- {
1267
- "type": "simple-grid",
1268
- "cols": 3.0,
1269
- "children": [
1270
- {
1271
- "label": "TotalLessons",
1272
- "type": "stat-display",
1273
- "value": "@entity.totalLessons"
1274
- },
1275
- {
1276
- "type": "stat-display",
1277
- "label": "CompletedLessons",
1278
- "value": "@entity.completedLessons"
1279
- },
1280
- {
1281
- "type": "stat-display",
1282
- "label": "AverageScore",
1283
- "value": "@entity.averageScore"
1284
- },
1285
- {
1286
- "label": "Streak",
1287
- "type": "stat-display",
1288
- "value": "@entity.streak"
1289
- }
1290
- ]
1291
- }
1292
- ]
1293
- },
1294
- {
1295
- "type": "divider"
1296
- },
1297
- {
1298
- "type": "grid",
1299
- "gap": "md",
1300
- "cols": 2.0,
1301
- "children": [
1302
- {
1303
- "type": "card",
1304
- "children": [
1305
- {
1306
- "type": "typography",
1307
- "variant": "caption",
1308
- "content": "Chart View"
1309
- }
1310
- ]
1311
- },
1312
- {
1313
- "type": "card",
1314
- "children": [
1315
- {
1316
- "type": "typography",
1317
- "variant": "caption",
1318
- "content": "Graph View"
1319
- }
1320
- ]
1321
- }
1322
- ]
1323
- },
1324
- {
1325
- "type": "line-chart",
1326
- "data": [
1327
- {
1328
- "date": "Jan",
1329
- "value": 12.0
1330
- },
1331
- {
1332
- "date": "Feb",
1333
- "value": 19.0
1334
- },
1335
- {
1336
- "date": "Mar",
1337
- "value": 15.0
1338
- },
1339
- {
1340
- "value": 25.0,
1341
- "date": "Apr"
1342
- },
1343
- {
1344
- "date": "May",
1345
- "value": 22.0
1346
- },
1347
- {
1348
- "date": "Jun",
1349
- "value": 30.0
1350
- }
1351
- ]
1411
+ "type": "icon",
1412
+ "name": "trending-up"
1352
1413
  },
1353
1414
  {
1354
- "items": [
1355
- {
1356
- "color": "primary",
1357
- "label": "Current"
1358
- },
1359
- {
1360
- "label": "Previous",
1361
- "color": "muted"
1362
- }
1363
- ],
1364
- "type": "chart-legend"
1365
- },
1366
- {
1367
- "type": "graph-view",
1368
- "height": 200.0,
1369
- "edges": [
1370
- {
1371
- "source": "a",
1372
- "target": "b"
1373
- },
1374
- {
1375
- "target": "c",
1376
- "source": "b"
1377
- }
1378
- ],
1379
- "width": 400.0,
1380
- "nodes": [
1381
- {
1382
- "id": "a",
1383
- "label": "Start"
1384
- },
1385
- {
1386
- "id": "b",
1387
- "label": "Process"
1388
- },
1389
- {
1390
- "label": "End",
1391
- "id": "c"
1392
- }
1393
- ]
1415
+ "type": "typography",
1416
+ "variant": "h2",
1417
+ "content": "Progress"
1394
1418
  }
1395
1419
  ],
1396
- "type": "stack"
1420
+ "gap": "sm"
1397
1421
  }
1398
1422
  ]
1399
- }
1423
+ },
1424
+ {
1425
+ "type": "divider"
1426
+ },
1427
+ "@trait.StudentProgressStats",
1428
+ "@trait.StudentProgressGraphs",
1429
+ {
1430
+ "type": "divider"
1431
+ },
1432
+ "@trait.StudentProgressBrowseList"
1400
1433
  ],
1401
- "showTopBar": true
1434
+ "type": "stack",
1435
+ "gap": "lg",
1436
+ "direction": "vertical"
1402
1437
  }
1403
1438
  ]
1404
1439
  ]
1405
1440
  },
1406
1441
  {
1407
- "from": "loading",
1408
- "to": "displaying",
1409
- "event": "LOADED",
1442
+ "from": "composing",
1443
+ "to": "composing",
1444
+ "event": "STUDENT_PROGRESS_SEARCH"
1445
+ },
1446
+ {
1447
+ "from": "composing",
1448
+ "to": "composing",
1449
+ "event": "STUDENT_PROGRESS_NOTIFICATIONS_OPEN",
1410
1450
  "effects": [
1411
- [
1412
- "fetch",
1413
- "StudentProgress",
1414
- {
1415
- "emit": {
1416
- "failure": "StudentProgressLoadFailed",
1417
- "success": "StudentProgressLoaded"
1418
- }
1419
- }
1420
- ],
1421
1451
  [
1422
1452
  "render-ui",
1423
1453
  "main",
1424
1454
  {
1425
- "type": "game-shell",
1426
- "appName": "Coding Academy",
1455
+ "className": "py-8",
1427
1456
  "children": [
1428
1457
  {
1429
- "type": "scaled-diagram",
1430
- "children": [
1431
- {
1432
- "children": [
1433
- {
1434
- "type": "breadcrumb",
1435
- "items": [
1436
- {
1437
- "href": "/",
1438
- "label": "Home"
1439
- },
1440
- {
1441
- "label": "Progress"
1442
- }
1443
- ]
1444
- },
1445
- {
1446
- "type": "stack",
1447
- "direction": "horizontal",
1448
- "justify": "between",
1449
- "children": [
1450
- {
1451
- "direction": "horizontal",
1452
- "gap": "md",
1453
- "type": "stack",
1454
- "children": [
1455
- {
1456
- "type": "icon",
1457
- "name": "trending-up"
1458
- },
1459
- {
1460
- "type": "typography",
1461
- "variant": "h2",
1462
- "content": "Progress"
1463
- }
1464
- ]
1465
- },
1466
- {
1467
- "label": "Refresh",
1468
- "action": "REFRESH",
1469
- "icon": "refresh-cw",
1470
- "variant": "secondary",
1471
- "type": "button"
1472
- }
1473
- ],
1474
- "gap": "md"
1475
- },
1476
- {
1477
- "type": "divider"
1478
- },
1479
- {
1480
- "padding": "md",
1481
- "type": "box",
1482
- "children": [
1483
- {
1484
- "type": "simple-grid",
1485
- "cols": 3.0,
1486
- "children": [
1487
- {
1488
- "label": "TotalLessons",
1489
- "value": "@entity.totalLessons",
1490
- "type": "stat-display"
1491
- },
1492
- {
1493
- "type": "stat-display",
1494
- "label": "CompletedLessons",
1495
- "value": "@entity.completedLessons"
1496
- },
1497
- {
1498
- "value": "@entity.averageScore",
1499
- "type": "stat-display",
1500
- "label": "AverageScore"
1501
- },
1502
- {
1503
- "label": "Streak",
1504
- "type": "stat-display",
1505
- "value": "@entity.streak"
1506
- }
1507
- ]
1508
- }
1509
- ]
1510
- },
1511
- {
1512
- "type": "divider"
1513
- },
1514
- {
1515
- "type": "grid",
1516
- "children": [
1517
- {
1518
- "children": [
1519
- {
1520
- "content": "Chart View",
1521
- "variant": "caption",
1522
- "type": "typography"
1523
- }
1524
- ],
1525
- "type": "card"
1526
- },
1527
- {
1528
- "children": [
1529
- {
1530
- "variant": "caption",
1531
- "content": "Graph View",
1532
- "type": "typography"
1533
- }
1534
- ],
1535
- "type": "card"
1536
- }
1537
- ],
1538
- "gap": "md",
1539
- "cols": 2.0
1540
- },
1541
- {
1542
- "type": "line-chart",
1543
- "data": [
1544
- {
1545
- "date": "Jan",
1546
- "value": 12.0
1547
- },
1548
- {
1549
- "date": "Feb",
1550
- "value": 19.0
1551
- },
1552
- {
1553
- "date": "Mar",
1554
- "value": 15.0
1555
- },
1556
- {
1557
- "value": 25.0,
1558
- "date": "Apr"
1559
- },
1560
- {
1561
- "value": 22.0,
1562
- "date": "May"
1563
- },
1564
- {
1565
- "date": "Jun",
1566
- "value": 30.0
1567
- }
1568
- ]
1569
- },
1570
- {
1571
- "type": "chart-legend",
1572
- "items": [
1573
- {
1574
- "label": "Current",
1575
- "color": "primary"
1576
- },
1577
- {
1578
- "color": "muted",
1579
- "label": "Previous"
1580
- }
1581
- ]
1582
- },
1583
- {
1584
- "width": 400.0,
1585
- "edges": [
1586
- {
1587
- "target": "b",
1588
- "source": "a"
1589
- },
1590
- {
1591
- "target": "c",
1592
- "source": "b"
1593
- }
1594
- ],
1595
- "height": 200.0,
1596
- "nodes": [
1597
- {
1598
- "id": "a",
1599
- "label": "Start"
1600
- },
1601
- {
1602
- "id": "b",
1603
- "label": "Process"
1604
- },
1605
- {
1606
- "label": "End",
1607
- "id": "c"
1608
- }
1609
- ],
1610
- "type": "graph-view"
1611
- }
1612
- ],
1613
- "type": "stack",
1614
- "direction": "vertical",
1615
- "gap": "lg"
1616
- }
1617
- ]
1458
+ "type": "icon",
1459
+ "name": "bell"
1460
+ },
1461
+ {
1462
+ "content": "No notifications",
1463
+ "type": "typography",
1464
+ "variant": "h3"
1465
+ },
1466
+ {
1467
+ "variant": "caption",
1468
+ "type": "typography",
1469
+ "color": "muted",
1470
+ "content": "You're all caught up."
1471
+ },
1472
+ {
1473
+ "variant": "ghost",
1474
+ "action": "INIT",
1475
+ "label": "Back to progress",
1476
+ "type": "button"
1618
1477
  }
1619
1478
  ],
1620
- "showTopBar": true
1479
+ "type": "stack",
1480
+ "direction": "vertical",
1481
+ "gap": "md",
1482
+ "align": "center"
1621
1483
  }
1622
1484
  ]
1623
1485
  ]
1486
+ }
1487
+ ]
1488
+ },
1489
+ "scope": "instance"
1490
+ },
1491
+ {
1492
+ "ref": "Stats.traits.StatsItemStats",
1493
+ "name": "StudentProgressStats",
1494
+ "config": {
1495
+ "title": "Student Progress",
1496
+ "metrics": [
1497
+ {
1498
+ "field": "lessonsCompleted",
1499
+ "icon": "check-circle",
1500
+ "label": "Lessons Completed",
1501
+ "format": "number",
1502
+ "variant": "success",
1503
+ "aggregation": "sum"
1624
1504
  },
1625
1505
  {
1626
- "from": "displaying",
1627
- "to": "displaying",
1628
- "event": "INIT",
1629
- "effects": [
1630
- [
1631
- "fetch",
1632
- "StudentProgress",
1633
- {
1634
- "emit": {
1635
- "failure": "StudentProgressLoadFailed",
1636
- "success": "StudentProgressLoaded"
1637
- }
1638
- }
1639
- ],
1640
- [
1641
- "render-ui",
1642
- "main",
1643
- {
1644
- "appName": "Coding Academy",
1645
- "type": "game-shell",
1646
- "showTopBar": true,
1647
- "children": [
1648
- {
1649
- "children": [
1650
- {
1651
- "children": [
1652
- {
1653
- "type": "breadcrumb",
1654
- "items": [
1655
- {
1656
- "label": "Home",
1657
- "href": "/"
1658
- },
1659
- {
1660
- "label": "Progress"
1661
- }
1662
- ]
1663
- },
1664
- {
1665
- "children": [
1666
- {
1667
- "gap": "md",
1668
- "children": [
1669
- {
1670
- "type": "icon",
1671
- "name": "trending-up"
1672
- },
1673
- {
1674
- "type": "typography",
1675
- "variant": "h2",
1676
- "content": "Progress"
1677
- }
1678
- ],
1679
- "direction": "horizontal",
1680
- "type": "stack"
1681
- },
1682
- {
1683
- "type": "button",
1684
- "icon": "refresh-cw",
1685
- "action": "REFRESH",
1686
- "variant": "secondary",
1687
- "label": "Refresh"
1688
- }
1689
- ],
1690
- "type": "stack",
1691
- "direction": "horizontal",
1692
- "gap": "md",
1693
- "justify": "between"
1694
- },
1695
- {
1696
- "type": "divider"
1697
- },
1698
- {
1699
- "padding": "md",
1700
- "children": [
1701
- {
1702
- "cols": 3.0,
1703
- "children": [
1704
- {
1705
- "type": "stat-display",
1706
- "label": "TotalLessons",
1707
- "value": "@entity.totalLessons"
1708
- },
1709
- {
1710
- "label": "CompletedLessons",
1711
- "type": "stat-display",
1712
- "value": "@entity.completedLessons"
1713
- },
1714
- {
1715
- "type": "stat-display",
1716
- "value": "@entity.averageScore",
1717
- "label": "AverageScore"
1718
- },
1719
- {
1720
- "type": "stat-display",
1721
- "value": "@entity.streak",
1722
- "label": "Streak"
1723
- }
1724
- ],
1725
- "type": "simple-grid"
1726
- }
1727
- ],
1728
- "type": "box"
1729
- },
1730
- {
1731
- "type": "divider"
1732
- },
1733
- {
1734
- "gap": "md",
1735
- "children": [
1736
- {
1737
- "children": [
1738
- {
1739
- "variant": "caption",
1740
- "type": "typography",
1741
- "content": "Chart View"
1742
- }
1743
- ],
1744
- "type": "card"
1745
- },
1746
- {
1747
- "type": "card",
1748
- "children": [
1749
- {
1750
- "type": "typography",
1751
- "variant": "caption",
1752
- "content": "Graph View"
1753
- }
1754
- ]
1755
- }
1756
- ],
1757
- "cols": 2.0,
1758
- "type": "grid"
1759
- },
1760
- {
1761
- "type": "line-chart",
1762
- "data": [
1763
- {
1764
- "date": "Jan",
1765
- "value": 12.0
1766
- },
1767
- {
1768
- "date": "Feb",
1769
- "value": 19.0
1770
- },
1771
- {
1772
- "value": 15.0,
1773
- "date": "Mar"
1774
- },
1775
- {
1776
- "date": "Apr",
1777
- "value": 25.0
1778
- },
1779
- {
1780
- "date": "May",
1781
- "value": 22.0
1782
- },
1783
- {
1784
- "value": 30.0,
1785
- "date": "Jun"
1786
- }
1787
- ]
1788
- },
1789
- {
1790
- "items": [
1791
- {
1792
- "color": "primary",
1793
- "label": "Current"
1794
- },
1795
- {
1796
- "color": "muted",
1797
- "label": "Previous"
1798
- }
1799
- ],
1800
- "type": "chart-legend"
1801
- },
1802
- {
1803
- "width": 400.0,
1804
- "height": 200.0,
1805
- "nodes": [
1806
- {
1807
- "id": "a",
1808
- "label": "Start"
1809
- },
1810
- {
1811
- "label": "Process",
1812
- "id": "b"
1813
- },
1814
- {
1815
- "id": "c",
1816
- "label": "End"
1817
- }
1818
- ],
1819
- "edges": [
1820
- {
1821
- "source": "a",
1822
- "target": "b"
1823
- },
1824
- {
1825
- "target": "c",
1826
- "source": "b"
1827
- }
1828
- ],
1829
- "type": "graph-view"
1830
- }
1831
- ],
1832
- "type": "stack",
1833
- "gap": "lg",
1834
- "direction": "vertical"
1835
- }
1836
- ],
1837
- "type": "scaled-diagram"
1838
- }
1839
- ]
1840
- }
1841
- ]
1506
+ "label": "Average Score",
1507
+ "format": "number",
1508
+ "icon": "star",
1509
+ "variant": "primary",
1510
+ "field": "avgScore",
1511
+ "aggregation": "avg"
1512
+ },
1513
+ {
1514
+ "field": "streak",
1515
+ "label": "Streak",
1516
+ "aggregation": "max",
1517
+ "icon": "flame",
1518
+ "variant": "warning",
1519
+ "format": "number",
1520
+ "suffix": "d"
1521
+ },
1522
+ {
1523
+ "variant": "info",
1524
+ "format": "number",
1525
+ "suffix": "m",
1526
+ "aggregation": "sum",
1527
+ "label": "Total Time",
1528
+ "field": "totalTimeMinutes",
1529
+ "icon": "clock"
1530
+ }
1531
+ ]
1532
+ },
1533
+ "listens": [
1534
+ {
1535
+ "event": "BrowseItemLoaded",
1536
+ "triggers": "ITEMS_LOADED",
1537
+ "source": {
1538
+ "kind": "trait",
1539
+ "trait": "StudentProgressBrowseList"
1540
+ }
1541
+ }
1542
+ ]
1543
+ },
1544
+ {
1545
+ "ref": "Graphs.traits.GraphItemGraph",
1546
+ "name": "StudentProgressGraphs",
1547
+ "config": {
1548
+ "title": "Progress over time",
1549
+ "subtitle": "Daily progress %",
1550
+ "height": 280.0,
1551
+ "dateField": "day",
1552
+ "chartType": "line",
1553
+ "showLegend": true,
1554
+ "valueField": "progressPct"
1555
+ },
1556
+ "listens": [
1557
+ {
1558
+ "event": "BrowseItemLoaded",
1559
+ "triggers": "ITEMS_LOADED",
1560
+ "source": {
1561
+ "kind": "trait",
1562
+ "trait": "StudentProgressBrowseList"
1563
+ }
1564
+ }
1565
+ ]
1566
+ },
1567
+ {
1568
+ "ref": "Browse.traits.BrowseItemBrowse",
1569
+ "name": "StudentProgressBrowseList",
1570
+ "linkedEntity": "StudentProgress",
1571
+ "config": {
1572
+ "fields": [
1573
+ {
1574
+ "name": "student",
1575
+ "label": "Student",
1576
+ "variant": "h4",
1577
+ "icon": "user"
1578
+ },
1579
+ {
1580
+ "variant": "body",
1581
+ "name": "lessonsCompleted",
1582
+ "label": "Lessons Completed"
1583
+ },
1584
+ {
1585
+ "name": "avgScore",
1586
+ "variant": "badge",
1587
+ "label": "Avg Score"
1588
+ },
1589
+ {
1590
+ "name": "streak",
1591
+ "suffix": "d",
1592
+ "label": "Streak",
1593
+ "variant": "body"
1594
+ },
1595
+ {
1596
+ "label": "Last Active",
1597
+ "variant": "caption",
1598
+ "format": "date",
1599
+ "name": "lastActiveAt"
1600
+ }
1601
+ ],
1602
+ "itemActions": [],
1603
+ "gap": "sm",
1604
+ "cols": 1.0
1605
+ }
1606
+ },
1607
+ {
1608
+ "name": "StudentProgressItemSink",
1609
+ "category": "lifecycle",
1610
+ "listens": [
1611
+ {
1612
+ "event": "VIEW",
1613
+ "triggers": "VIEW",
1614
+ "source": {
1615
+ "kind": "trait",
1616
+ "trait": "StudentProgressBrowseList"
1617
+ }
1618
+ },
1619
+ {
1620
+ "event": "EDIT",
1621
+ "triggers": "EDIT",
1622
+ "source": {
1623
+ "kind": "trait",
1624
+ "trait": "StudentProgressBrowseList"
1625
+ }
1626
+ },
1627
+ {
1628
+ "event": "DELETE",
1629
+ "triggers": "DELETE",
1630
+ "source": {
1631
+ "kind": "trait",
1632
+ "trait": "StudentProgressBrowseList"
1633
+ }
1634
+ }
1635
+ ],
1636
+ "stateMachine": {
1637
+ "states": [
1638
+ {
1639
+ "name": "idle",
1640
+ "isInitial": true
1641
+ }
1642
+ ],
1643
+ "events": [
1644
+ {
1645
+ "key": "INIT",
1646
+ "name": "Initialize"
1647
+ },
1648
+ {
1649
+ "key": "VIEW",
1650
+ "name": "View",
1651
+ "payloadSchema": [
1652
+ {
1653
+ "name": "id",
1654
+ "type": "string",
1655
+ "required": true
1656
+ },
1657
+ {
1658
+ "name": "row",
1659
+ "type": "StudentProgress"
1660
+ }
1842
1661
  ]
1843
1662
  },
1844
1663
  {
1845
- "from": "displaying",
1846
- "to": "refreshing",
1847
- "event": "REFRESH",
1848
- "effects": [
1849
- [
1850
- "fetch",
1851
- "StudentProgress",
1852
- {
1853
- "emit": {
1854
- "success": "StudentProgressLoaded",
1855
- "failure": "StudentProgressLoadFailed"
1856
- }
1857
- }
1858
- ],
1859
- [
1860
- "render-ui",
1861
- "main",
1862
- {
1863
- "showTopBar": true,
1864
- "children": [
1865
- {
1866
- "type": "scaled-diagram",
1867
- "children": [
1868
- {
1869
- "direction": "vertical",
1870
- "type": "stack",
1871
- "children": [
1872
- {
1873
- "items": [
1874
- {
1875
- "label": "Home",
1876
- "href": "/"
1877
- },
1878
- {
1879
- "label": "Progress"
1880
- }
1881
- ],
1882
- "type": "breadcrumb"
1883
- },
1884
- {
1885
- "type": "stack",
1886
- "children": [
1887
- {
1888
- "direction": "horizontal",
1889
- "children": [
1890
- {
1891
- "name": "trending-up",
1892
- "type": "icon"
1893
- },
1894
- {
1895
- "variant": "h2",
1896
- "type": "typography",
1897
- "content": "Progress"
1898
- }
1899
- ],
1900
- "gap": "md",
1901
- "type": "stack"
1902
- },
1903
- {
1904
- "type": "button",
1905
- "label": "Refresh",
1906
- "variant": "secondary",
1907
- "action": "REFRESH",
1908
- "icon": "refresh-cw"
1909
- }
1910
- ],
1911
- "gap": "md",
1912
- "direction": "horizontal",
1913
- "justify": "between"
1914
- },
1915
- {
1916
- "type": "divider"
1917
- },
1918
- {
1919
- "type": "box",
1920
- "padding": "md",
1921
- "children": [
1922
- {
1923
- "type": "simple-grid",
1924
- "children": [
1925
- {
1926
- "type": "stat-display",
1927
- "label": "TotalLessons",
1928
- "value": "@entity.totalLessons"
1929
- },
1930
- {
1931
- "value": "@entity.completedLessons",
1932
- "type": "stat-display",
1933
- "label": "CompletedLessons"
1934
- },
1935
- {
1936
- "label": "AverageScore",
1937
- "type": "stat-display",
1938
- "value": "@entity.averageScore"
1939
- },
1940
- {
1941
- "type": "stat-display",
1942
- "label": "Streak",
1943
- "value": "@entity.streak"
1944
- }
1945
- ],
1946
- "cols": 3.0
1947
- }
1948
- ]
1949
- },
1950
- {
1951
- "type": "divider"
1952
- },
1953
- {
1954
- "children": [
1955
- {
1956
- "type": "card",
1957
- "children": [
1958
- {
1959
- "content": "Chart View",
1960
- "type": "typography",
1961
- "variant": "caption"
1962
- }
1963
- ]
1964
- },
1965
- {
1966
- "children": [
1967
- {
1968
- "content": "Graph View",
1969
- "variant": "caption",
1970
- "type": "typography"
1971
- }
1972
- ],
1973
- "type": "card"
1974
- }
1975
- ],
1976
- "cols": 2.0,
1977
- "gap": "md",
1978
- "type": "grid"
1979
- },
1980
- {
1981
- "type": "line-chart",
1982
- "data": [
1983
- {
1984
- "date": "Jan",
1985
- "value": 12.0
1986
- },
1987
- {
1988
- "date": "Feb",
1989
- "value": 19.0
1990
- },
1991
- {
1992
- "value": 15.0,
1993
- "date": "Mar"
1994
- },
1995
- {
1996
- "value": 25.0,
1997
- "date": "Apr"
1998
- },
1999
- {
2000
- "value": 22.0,
2001
- "date": "May"
2002
- },
2003
- {
2004
- "value": 30.0,
2005
- "date": "Jun"
2006
- }
2007
- ]
2008
- },
2009
- {
2010
- "type": "chart-legend",
2011
- "items": [
2012
- {
2013
- "label": "Current",
2014
- "color": "primary"
2015
- },
2016
- {
2017
- "label": "Previous",
2018
- "color": "muted"
2019
- }
2020
- ]
2021
- },
2022
- {
2023
- "width": 400.0,
2024
- "height": 200.0,
2025
- "nodes": [
2026
- {
2027
- "id": "a",
2028
- "label": "Start"
2029
- },
2030
- {
2031
- "id": "b",
2032
- "label": "Process"
2033
- },
2034
- {
2035
- "id": "c",
2036
- "label": "End"
2037
- }
2038
- ],
2039
- "type": "graph-view",
2040
- "edges": [
2041
- {
2042
- "source": "a",
2043
- "target": "b"
2044
- },
2045
- {
2046
- "source": "b",
2047
- "target": "c"
2048
- }
2049
- ]
2050
- }
2051
- ],
2052
- "gap": "lg"
2053
- }
2054
- ]
2055
- }
2056
- ],
2057
- "appName": "Coding Academy",
2058
- "type": "game-shell"
2059
- }
2060
- ]
1664
+ "key": "EDIT",
1665
+ "name": "Edit",
1666
+ "payloadSchema": [
1667
+ {
1668
+ "name": "id",
1669
+ "type": "string",
1670
+ "required": true
1671
+ },
1672
+ {
1673
+ "name": "row",
1674
+ "type": "StudentProgress"
1675
+ }
2061
1676
  ]
2062
1677
  },
2063
1678
  {
2064
- "from": "refreshing",
2065
- "to": "displaying",
2066
- "event": "REFRESHED",
2067
- "effects": [
2068
- [
2069
- "fetch",
2070
- "StudentProgress",
2071
- {
2072
- "emit": {
2073
- "success": "StudentProgressLoaded",
2074
- "failure": "StudentProgressLoadFailed"
2075
- }
2076
- }
2077
- ],
2078
- [
2079
- "render-ui",
2080
- "main",
2081
- {
2082
- "type": "game-shell",
2083
- "showTopBar": true,
2084
- "children": [
2085
- {
2086
- "type": "scaled-diagram",
2087
- "children": [
2088
- {
2089
- "children": [
2090
- {
2091
- "items": [
2092
- {
2093
- "label": "Home",
2094
- "href": "/"
2095
- },
2096
- {
2097
- "label": "Progress"
2098
- }
2099
- ],
2100
- "type": "breadcrumb"
2101
- },
2102
- {
2103
- "direction": "horizontal",
2104
- "justify": "between",
2105
- "children": [
2106
- {
2107
- "direction": "horizontal",
2108
- "children": [
2109
- {
2110
- "type": "icon",
2111
- "name": "trending-up"
2112
- },
2113
- {
2114
- "type": "typography",
2115
- "content": "Progress",
2116
- "variant": "h2"
2117
- }
2118
- ],
2119
- "type": "stack",
2120
- "gap": "md"
2121
- },
2122
- {
2123
- "action": "REFRESH",
2124
- "variant": "secondary",
2125
- "icon": "refresh-cw",
2126
- "type": "button",
2127
- "label": "Refresh"
2128
- }
2129
- ],
2130
- "gap": "md",
2131
- "type": "stack"
2132
- },
2133
- {
2134
- "type": "divider"
2135
- },
2136
- {
2137
- "children": [
2138
- {
2139
- "type": "simple-grid",
2140
- "cols": 3.0,
2141
- "children": [
2142
- {
2143
- "value": "@entity.totalLessons",
2144
- "label": "TotalLessons",
2145
- "type": "stat-display"
2146
- },
2147
- {
2148
- "type": "stat-display",
2149
- "label": "CompletedLessons",
2150
- "value": "@entity.completedLessons"
2151
- },
2152
- {
2153
- "label": "AverageScore",
2154
- "value": "@entity.averageScore",
2155
- "type": "stat-display"
2156
- },
2157
- {
2158
- "type": "stat-display",
2159
- "value": "@entity.streak",
2160
- "label": "Streak"
2161
- }
2162
- ]
2163
- }
2164
- ],
2165
- "type": "box",
2166
- "padding": "md"
2167
- },
2168
- {
2169
- "type": "divider"
2170
- },
2171
- {
2172
- "cols": 2.0,
2173
- "type": "grid",
2174
- "gap": "md",
2175
- "children": [
2176
- {
2177
- "children": [
2178
- {
2179
- "type": "typography",
2180
- "content": "Chart View",
2181
- "variant": "caption"
2182
- }
2183
- ],
2184
- "type": "card"
2185
- },
2186
- {
2187
- "type": "card",
2188
- "children": [
2189
- {
2190
- "content": "Graph View",
2191
- "variant": "caption",
2192
- "type": "typography"
2193
- }
2194
- ]
2195
- }
2196
- ]
2197
- },
2198
- {
2199
- "type": "line-chart",
2200
- "data": [
2201
- {
2202
- "value": 12.0,
2203
- "date": "Jan"
2204
- },
2205
- {
2206
- "value": 19.0,
2207
- "date": "Feb"
2208
- },
2209
- {
2210
- "date": "Mar",
2211
- "value": 15.0
2212
- },
2213
- {
2214
- "date": "Apr",
2215
- "value": 25.0
2216
- },
2217
- {
2218
- "date": "May",
2219
- "value": 22.0
2220
- },
2221
- {
2222
- "date": "Jun",
2223
- "value": 30.0
2224
- }
2225
- ]
2226
- },
2227
- {
2228
- "type": "chart-legend",
2229
- "items": [
2230
- {
2231
- "color": "primary",
2232
- "label": "Current"
2233
- },
2234
- {
2235
- "color": "muted",
2236
- "label": "Previous"
2237
- }
2238
- ]
2239
- },
2240
- {
2241
- "nodes": [
2242
- {
2243
- "id": "a",
2244
- "label": "Start"
2245
- },
2246
- {
2247
- "id": "b",
2248
- "label": "Process"
2249
- },
2250
- {
2251
- "label": "End",
2252
- "id": "c"
2253
- }
2254
- ],
2255
- "width": 400.0,
2256
- "height": 200.0,
2257
- "edges": [
2258
- {
2259
- "source": "a",
2260
- "target": "b"
2261
- },
2262
- {
2263
- "source": "b",
2264
- "target": "c"
2265
- }
2266
- ],
2267
- "type": "graph-view"
2268
- }
2269
- ],
2270
- "gap": "lg",
2271
- "type": "stack",
2272
- "direction": "vertical"
2273
- }
2274
- ]
2275
- }
2276
- ],
2277
- "appName": "Coding Academy"
2278
- }
2279
- ]
1679
+ "key": "DELETE",
1680
+ "name": "Delete",
1681
+ "payloadSchema": [
1682
+ {
1683
+ "name": "id",
1684
+ "type": "string",
1685
+ "required": true
1686
+ },
1687
+ {
1688
+ "name": "row",
1689
+ "type": "StudentProgress"
1690
+ }
2280
1691
  ]
2281
1692
  }
1693
+ ],
1694
+ "transitions": [
1695
+ {
1696
+ "from": "idle",
1697
+ "to": "idle",
1698
+ "event": "INIT"
1699
+ },
1700
+ {
1701
+ "from": "idle",
1702
+ "to": "idle",
1703
+ "event": "VIEW"
1704
+ },
1705
+ {
1706
+ "from": "idle",
1707
+ "to": "idle",
1708
+ "event": "EDIT"
1709
+ },
1710
+ {
1711
+ "from": "idle",
1712
+ "to": "idle",
1713
+ "event": "DELETE"
1714
+ }
2282
1715
  ]
2283
1716
  },
2284
- "scope": "collection"
1717
+ "scope": "instance"
2285
1718
  }
2286
1719
  ],
2287
1720
  "pages": [
@@ -2290,7 +1723,22 @@
2290
1723
  "path": "/progress",
2291
1724
  "traits": [
2292
1725
  {
2293
- "ref": "StudentProgressDisplay"
1726
+ "ref": "StudentProgressAppLayout"
1727
+ },
1728
+ {
1729
+ "ref": "StudentProgressCatalog"
1730
+ },
1731
+ {
1732
+ "ref": "StudentProgressStats"
1733
+ },
1734
+ {
1735
+ "ref": "StudentProgressGraphs"
1736
+ },
1737
+ {
1738
+ "ref": "StudentProgressBrowseList"
1739
+ },
1740
+ {
1741
+ "ref": "StudentProgressItemSink"
2294
1742
  }
2295
1743
  ]
2296
1744
  }