@tech4good/angular-schematics 17.0.4 → 18.0.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 (220) hide show
  1. package/README.md +8 -0
  2. package/package.json +4 -4
  3. package/src/collection.json +0 -16
  4. package/src/component/files/__name@dasherize__/__name@dasherize__.component.ts.template +22 -8
  5. package/src/component/index.js +2 -45
  6. package/src/component/index.js.map +1 -1
  7. package/src/component/schema.json +0 -5
  8. package/src/entity/files/__name@dasherize__/__name@dasherize__.mock.ts.template +12 -0
  9. package/src/entity/files/__name@dasherize__/__name@dasherize__.model.ts.template +1 -0
  10. package/src/entity/files/__name@dasherize__/__name@dasherize__.store.ts.template +41 -0
  11. package/src/entity/index.js +29 -50
  12. package/src/entity/index.js.map +1 -1
  13. package/src/init/files/.firebaserc.template +8 -0
  14. package/src/init/files/README.md.template +6 -6
  15. package/src/init/files/angular.json.template +18 -11
  16. package/src/init/files/package.json.template +29 -30
  17. package/src/init/files/src/app/admin/{waitlist/waitlist.animations.ts.template → admin-panel/admin-panel.animations.ts.template} +1 -1
  18. package/src/init/files/src/app/admin/{waitlist/waitlist.component.html.template → admin-panel/admin-panel.component.html.template} +3 -3
  19. package/src/init/files/src/app/admin/{waitlist/waitlist.component.scss.template → admin-panel/admin-panel.component.scss.template} +1 -1
  20. package/src/init/files/src/app/admin/admin-panel/admin-panel.component.spec.ts.template +25 -0
  21. package/src/init/files/src/app/admin/admin-panel/admin-panel.component.ts.template +99 -0
  22. package/src/init/files/src/app/app.component.html.template +1 -0
  23. package/src/init/files/src/app/app.component.ts.template +14 -8
  24. package/src/init/files/src/app/app.config.ts.template +63 -0
  25. package/src/init/files/src/app/app.routes.ts.template +32 -0
  26. package/src/init/files/src/app/core/analytics/log.service.ts.template +122 -89
  27. package/src/init/files/src/app/core/analytics/time-analytics.service.ts.template +9 -17
  28. package/src/init/files/src/app/core/auth/auth.guard.ts.template +25 -22
  29. package/src/init/files/src/app/core/firebase/cached-listeners.service.ts.template +291 -0
  30. package/src/init/files/src/app/core/firebase/database.service.ts.template +56 -0
  31. package/src/init/files/src/app/core/firebase/firebase.mock.service.ts.template +276 -0
  32. package/src/init/files/src/app/core/firebase/firebase.service.ts.template +265 -215
  33. package/src/init/files/src/app/core/local-storage/session.service.ts.template +3 -4
  34. package/src/init/files/src/app/core/store/app.model.ts.template +19 -0
  35. package/src/init/files/src/app/core/store/app.store.ts.template +1074 -0
  36. package/src/init/files/src/app/core/store/auth/auth.mock.ts.template +20 -0
  37. package/src/init/files/src/app/core/store/auth/auth.store.ts.template +136 -0
  38. package/src/init/files/src/app/core/store/batch-write.firebase.service.ts.template +58 -0
  39. package/src/init/files/src/app/core/store/batch-write.mock.service.ts.template +105 -0
  40. package/src/init/files/src/app/core/store/batch-write.service.ts.template +126 -0
  41. package/src/init/files/src/app/core/store/user/user.mock.ts.template +24 -0
  42. package/src/init/files/src/app/core/store/user/user.model.ts.template +1 -1
  43. package/src/init/files/src/app/core/store/user/user.store.ts.template +41 -0
  44. package/src/init/files/src/app/core/store/user-context/user-context.mock.ts.template +24 -0
  45. package/src/init/files/src/app/core/store/user-context/user-context.model.ts.template +1 -0
  46. package/src/init/files/src/app/core/store/user-context/user-context.store.ts.template +41 -0
  47. package/src/init/files/src/app/core/utils/rand.utils.ts.template +13 -0
  48. package/src/init/files/src/app/{onboarding → first-time}/consent/consent.component.html.template +8 -13
  49. package/src/init/files/src/app/first-time/consent/consent.component.ts.template +90 -0
  50. package/src/init/files/src/app/first-time/early-access/early-access.animations.ts.template +4 -0
  51. package/src/init/files/src/app/first-time/early-access/early-access.component.html.template +69 -0
  52. package/src/init/files/src/app/{onboarding/waiting/waiting.component.scss.template → first-time/early-access/early-access.component.scss.template} +1 -1
  53. package/src/init/files/src/app/first-time/early-access/early-access.component.spec.ts.template +25 -0
  54. package/src/init/files/src/app/first-time/early-access/early-access.component.ts.template +194 -0
  55. package/src/init/files/src/app/first-time/early-access/early-access.model.ts.template +7 -0
  56. package/src/init/files/src/app/{general → first-time}/landing/landing.component.html.template +1 -1
  57. package/src/init/files/src/app/first-time/landing/landing.component.ts.template +44 -0
  58. package/src/init/files/src/app/first-time/login/login.component.html.template +10 -0
  59. package/src/init/files/src/app/first-time/login/login.component.ts.template +45 -0
  60. package/src/init/files/src/app/first-time/onboarding/onboarding.animations.ts.template +4 -0
  61. package/src/init/files/src/app/first-time/onboarding/onboarding.component.html.template +2 -0
  62. package/src/init/files/src/app/first-time/onboarding/onboarding.component.scss.template +5 -0
  63. package/src/init/files/src/app/{admin/waitlist/waitlist.component.spec.ts.template → first-time/onboarding/onboarding.component.spec.ts.template} +6 -6
  64. package/src/init/files/src/app/first-time/onboarding/onboarding.component.ts.template +41 -0
  65. package/src/init/files/src/app/main/home/home.component.html.template +5 -0
  66. package/src/init/files/src/app/main/home/home.component.ts.template +51 -0
  67. package/src/init/files/src/app/shared/navbar/navbar.component.html.template +15 -0
  68. package/src/init/files/src/app/shared/navbar/navbar.component.scss.template +43 -0
  69. package/src/init/files/src/app/shared/navbar/navbar.component.spec.ts.template +25 -0
  70. package/src/init/files/src/app/shared/navbar/navbar.component.ts.template +40 -0
  71. package/src/init/files/src/app/shared/redeployment-warning/redeployment-warning.component.html.template +9 -0
  72. package/src/init/files/src/app/shared/{components/redeployment-warning → redeployment-warning}/redeployment-warning.component.ts.template +17 -6
  73. package/src/init/files/src/app/shared/{components/redeployment-warning → redeployment-warning}/redeployment-warning.service.ts.template +2 -2
  74. package/src/init/files/src/assets/images/close-x.svg +3 -0
  75. package/src/init/files/src/environments/environment.ts.template +1 -0
  76. package/src/init/files/src/index.html.template +1 -1
  77. package/src/init/files/tsconfig.json.template +0 -1
  78. package/src/container/files/__name@dasherize__/+state/__name@dasherize__.actions.ts.template +0 -26
  79. package/src/container/files/__name@dasherize__/+state/__name@dasherize__.effects.ts.template +0 -48
  80. package/src/container/files/__name@dasherize__/+state/__name@dasherize__.model.ts.template +0 -0
  81. package/src/container/files/__name@dasherize__/+state/__name@dasherize__.selectors.ts.template +0 -20
  82. package/src/container/files/__name@dasherize__/+state/__name@dasherize__.state.ts.template +0 -13
  83. package/src/container/files/__name@dasherize__/__name@dasherize__.animations.ts.template +0 -4
  84. package/src/container/files/__name@dasherize__/__name@dasherize__.component.html.template +0 -3
  85. package/src/container/files/__name@dasherize__/__name@dasherize__.component.scss.template +0 -5
  86. package/src/container/files/__name@dasherize__/__name@dasherize__.component.spec.ts.template +0 -25
  87. package/src/container/files/__name@dasherize__/__name@dasherize__.component.ts.template +0 -90
  88. package/src/container/index.d.ts +0 -2
  89. package/src/container/index.js +0 -127
  90. package/src/container/index.js.map +0 -1
  91. package/src/container/index_spec.d.ts +0 -1
  92. package/src/container/index_spec.js +0 -23
  93. package/src/container/index_spec.js.map +0 -1
  94. package/src/container/schema.json +0 -50
  95. package/src/entity/files/__name@dasherize__/__name@dasherize__.actions.ts.template +0 -249
  96. package/src/entity/files/__name@dasherize__/__name@dasherize__.effects.ts.template +0 -131
  97. package/src/entity/files/__name@dasherize__/__name@dasherize__.reducer.spec.ts.template +0 -13
  98. package/src/entity/files/__name@dasherize__/__name@dasherize__.reducer.ts.template +0 -51
  99. package/src/entity/files/__name@dasherize__/__name@dasherize__.service.ts.template +0 -50
  100. package/src/entity-in-example/files/__name@dasherize__/__name@dasherize__.actions.ts.template +0 -270
  101. package/src/entity-in-example/files/__name@dasherize__/__name@dasherize__.effects.ts.template +0 -131
  102. package/src/entity-in-example/files/__name@dasherize__/__name@dasherize__.model.ts.template +0 -3
  103. package/src/entity-in-example/files/__name@dasherize__/__name@dasherize__.reducer.spec.ts.template +0 -13
  104. package/src/entity-in-example/files/__name@dasherize__/__name@dasherize__.reducer.ts.template +0 -51
  105. package/src/entity-in-example/files/__name@dasherize__/__name@dasherize__.service.ts.template +0 -50
  106. package/src/entity-in-example/index.d.ts +0 -2
  107. package/src/entity-in-example/index.js +0 -141
  108. package/src/entity-in-example/index.js.map +0 -1
  109. package/src/entity-in-example/index_spec.d.ts +0 -1
  110. package/src/entity-in-example/index_spec.js +0 -23
  111. package/src/entity-in-example/index_spec.js.map +0 -1
  112. package/src/entity-in-example/schema.json +0 -45
  113. package/src/init/files/CHANGELOG.md.template +0 -10
  114. package/src/init/files/src/app/admin/admin-routing.module.ts.template +0 -17
  115. package/src/init/files/src/app/admin/admin.module.spec.ts.template +0 -13
  116. package/src/init/files/src/app/admin/admin.module.ts.template +0 -28
  117. package/src/init/files/src/app/admin/waitlist/+state/waitlist.actions.ts.template +0 -23
  118. package/src/init/files/src/app/admin/waitlist/+state/waitlist.effects.ts.template +0 -50
  119. package/src/init/files/src/app/admin/waitlist/+state/waitlist.model.ts.template +0 -0
  120. package/src/init/files/src/app/admin/waitlist/+state/waitlist.selectors.ts.template +0 -39
  121. package/src/init/files/src/app/admin/waitlist/+state/waitlist.state.ts.template +0 -13
  122. package/src/init/files/src/app/admin/waitlist/waitlist.component.ts.template +0 -141
  123. package/src/init/files/src/app/app-routing.module.ts.template +0 -26
  124. package/src/init/files/src/app/app.module.ts.template +0 -34
  125. package/src/init/files/src/app/core/core.module.ts.template +0 -75
  126. package/src/init/files/src/app/core/setup/firebase-setup.ts.template +0 -25
  127. package/src/init/files/src/app/core/setup/module-import-guard.ts.template +0 -5
  128. package/src/init/files/src/app/core/snackbar/snackbar.actions.ts.template +0 -24
  129. package/src/init/files/src/app/core/snackbar/snackbar.effects.ts.template +0 -41
  130. package/src/init/files/src/app/core/store/app-state/app-state.actions.ts.template +0 -249
  131. package/src/init/files/src/app/core/store/app-state/app-state.effects.ts.template +0 -131
  132. package/src/init/files/src/app/core/store/app-state/app-state.model.ts.template +0 -8
  133. package/src/init/files/src/app/core/store/app-state/app-state.reducer.spec.ts.template +0 -13
  134. package/src/init/files/src/app/core/store/app-state/app-state.reducer.ts.template +0 -51
  135. package/src/init/files/src/app/core/store/app-state/app-state.service.ts.template +0 -50
  136. package/src/init/files/src/app/core/store/app.actions.ts.template +0 -92
  137. package/src/init/files/src/app/core/store/app.effects.ts.template +0 -175
  138. package/src/init/files/src/app/core/store/app.reducer.ts.template +0 -36
  139. package/src/init/files/src/app/core/store/app.selectors.ts.template +0 -42
  140. package/src/init/files/src/app/core/store/auth/auth.actions.ts.template +0 -77
  141. package/src/init/files/src/app/core/store/auth/auth.effects.ts.template +0 -163
  142. package/src/init/files/src/app/core/store/auth/auth.reducer.spec.ts.template +0 -13
  143. package/src/init/files/src/app/core/store/auth/auth.reducer.ts.template +0 -26
  144. package/src/init/files/src/app/core/store/auth/auth.selectors.ts.template +0 -25
  145. package/src/init/files/src/app/core/store/cached-load-connections.service.ts.template +0 -405
  146. package/src/init/files/src/app/core/store/cached-selectors.service.ts.template +0 -376
  147. package/src/init/files/src/app/core/store/effects.helpers.ts.template +0 -66
  148. package/src/init/files/src/app/core/store/user/user.actions.ts.template +0 -248
  149. package/src/init/files/src/app/core/store/user/user.effects.ts.template +0 -148
  150. package/src/init/files/src/app/core/store/user/user.reducer.spec.ts.template +0 -13
  151. package/src/init/files/src/app/core/store/user/user.reducer.ts.template +0 -50
  152. package/src/init/files/src/app/core/store/user/user.service.ts.template +0 -50
  153. package/src/init/files/src/app/core/store/user-context/user-context.actions.ts.template +0 -248
  154. package/src/init/files/src/app/core/store/user-context/user-context.effects.ts.template +0 -131
  155. package/src/init/files/src/app/core/store/user-context/user-context.reducer.spec.ts.template +0 -13
  156. package/src/init/files/src/app/core/store/user-context/user-context.reducer.ts.template +0 -51
  157. package/src/init/files/src/app/core/store/user-context/user-context.service.ts.template +0 -50
  158. package/src/init/files/src/app/core/utils/string-case.utils.ts.template +0 -96
  159. package/src/init/files/src/app/general/general-routing.module.ts.template +0 -25
  160. package/src/init/files/src/app/general/general.module.spec.ts.template +0 -13
  161. package/src/init/files/src/app/general/general.module.ts.template +0 -36
  162. package/src/init/files/src/app/general/home/+state/home.actions.ts.template +0 -26
  163. package/src/init/files/src/app/general/home/+state/home.effects.ts.template +0 -48
  164. package/src/init/files/src/app/general/home/+state/home.model.ts.template +0 -0
  165. package/src/init/files/src/app/general/home/+state/home.selectors.ts.template +0 -20
  166. package/src/init/files/src/app/general/home/+state/home.state.ts.template +0 -13
  167. package/src/init/files/src/app/general/home/home.component.html.template +0 -5
  168. package/src/init/files/src/app/general/home/home.component.ts.template +0 -88
  169. package/src/init/files/src/app/general/landing/+state/landing.actions.ts.template +0 -26
  170. package/src/init/files/src/app/general/landing/+state/landing.effects.ts.template +0 -48
  171. package/src/init/files/src/app/general/landing/+state/landing.model.ts.template +0 -0
  172. package/src/init/files/src/app/general/landing/+state/landing.selectors.ts.template +0 -20
  173. package/src/init/files/src/app/general/landing/+state/landing.state.ts.template +0 -13
  174. package/src/init/files/src/app/general/landing/landing.component.ts.template +0 -98
  175. package/src/init/files/src/app/general/login/login.component.html.template +0 -11
  176. package/src/init/files/src/app/general/login/login.component.ts.template +0 -80
  177. package/src/init/files/src/app/onboarding/consent/+state/consent.actions.ts.template +0 -23
  178. package/src/init/files/src/app/onboarding/consent/+state/consent.effects.ts.template +0 -47
  179. package/src/init/files/src/app/onboarding/consent/+state/consent.model.ts.template +0 -0
  180. package/src/init/files/src/app/onboarding/consent/+state/consent.selectors.ts.template +0 -20
  181. package/src/init/files/src/app/onboarding/consent/+state/consent.state.ts.template +0 -13
  182. package/src/init/files/src/app/onboarding/consent/consent.component.ts.template +0 -151
  183. package/src/init/files/src/app/onboarding/onboarding-routing.module.ts.template +0 -19
  184. package/src/init/files/src/app/onboarding/onboarding.module.spec.ts.template +0 -13
  185. package/src/init/files/src/app/onboarding/onboarding.module.ts.template +0 -32
  186. package/src/init/files/src/app/onboarding/waiting/+state/waiting.actions.ts.template +0 -26
  187. package/src/init/files/src/app/onboarding/waiting/+state/waiting.effects.ts.template +0 -52
  188. package/src/init/files/src/app/onboarding/waiting/+state/waiting.model.ts.template +0 -9
  189. package/src/init/files/src/app/onboarding/waiting/+state/waiting.selectors.ts.template +0 -42
  190. package/src/init/files/src/app/onboarding/waiting/+state/waiting.state.ts.template +0 -13
  191. package/src/init/files/src/app/onboarding/waiting/waiting.animations.ts.template +0 -4
  192. package/src/init/files/src/app/onboarding/waiting/waiting.component.html.template +0 -57
  193. package/src/init/files/src/app/onboarding/waiting/waiting.component.spec.ts.template +0 -25
  194. package/src/init/files/src/app/onboarding/waiting/waiting.component.ts.template +0 -281
  195. package/src/init/files/src/app/shared/components/redeployment-warning/redeployment-warning.component.html.template +0 -10
  196. package/src/init/files/src/app/shared/shared.module.ts.template +0 -87
  197. package/src/init/files/src/main.ts.template +0 -12
  198. package/src/module/files/__name@dasherize__/__name@dasherize__-routing.module.ts.template +0 -15
  199. package/src/module/files/__name@dasherize__/__name@dasherize__.module.spec.ts.template +0 -13
  200. package/src/module/files/__name@dasherize__/__name@dasherize__.module.ts.template +0 -24
  201. package/src/module/index.d.ts +0 -2
  202. package/src/module/index.js +0 -97
  203. package/src/module/index.js.map +0 -1
  204. package/src/module/index_spec.d.ts +0 -1
  205. package/src/module/index_spec.js +0 -23
  206. package/src/module/index_spec.js.map +0 -1
  207. package/src/module/schema.json +0 -38
  208. /package/src/init/files/src/app/{onboarding → first-time}/consent/consent.animations.ts.template +0 -0
  209. /package/src/init/files/src/app/{onboarding → first-time}/consent/consent.component.scss.template +0 -0
  210. /package/src/init/files/src/app/{onboarding → first-time}/consent/consent.component.spec.ts.template +0 -0
  211. /package/src/init/files/src/app/{general → first-time}/landing/landing.animations.ts.template +0 -0
  212. /package/src/init/files/src/app/{general → first-time}/landing/landing.component.scss.template +0 -0
  213. /package/src/init/files/src/app/{general → first-time}/landing/landing.component.spec.ts.template +0 -0
  214. /package/src/init/files/src/app/{general → first-time}/login/login.component.scss.template +0 -0
  215. /package/src/init/files/src/app/{general → first-time}/login/login.component.spec.ts.template +0 -0
  216. /package/src/init/files/src/app/{general → main}/home/home.animations.ts.template +0 -0
  217. /package/src/init/files/src/app/{general → main}/home/home.component.scss.template +0 -0
  218. /package/src/init/files/src/app/{general → main}/home/home.component.spec.ts.template +0 -0
  219. /package/src/init/files/src/app/shared/{components/redeployment-warning → redeployment-warning}/redeployment-warning.component.scss.template +0 -0
  220. /package/src/init/files/src/app/shared/{components/redeployment-warning → redeployment-warning}/redeployment-warning.component.spec.ts.template +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2DAIoC;AAEpC,+DAA0E;AAC1E,yEAAmG;AACnG,uEAAmE;AACnE,qEAAuF;AACvF,+CAA+C;AAE/C,iEAAyE;AAEzE,SAAS,UAAU,CAAC,OAAY;IAC9B,OAAO,CAAC,IAAU,EAAE,OAAyB,EAAE,EAAE;QAE/C,MAAM,cAAc,GAAG,cAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACtD,MAAM,aAAa,GAAG,cAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACrD,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,cAAc,KAAK,aAAa,EAAE,CAAC,CAAC;QAElE,0BAA0B;QAC1B,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;QACtC,MAAM,cAAc,GAAG,IAAA,gCAAa,EAAC,IAAI,EAAE,cAAc,CAAC,CAAC;QAC3D,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,cAAc,EAAE,CAAC,CAAC;QAErD,MAAM,iBAAiB,GACrB,IAAI,OAAO,CAAC,IAAI,GAAG;YACnB,cAAO,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,GAAG;YACrC,cAAO,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC;QAC/C,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,sBAAsB,iBAAiB,EAAE,CAAC,CAAC;QAC/D,MAAM,iBAAiB,GAAG,IAAA,+BAAiB,EAAC,cAAc,EAAE,iBAAiB,CAAC,CAAC;QAC/E,OAAO,CAAC,MAAM,CAAC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,IAAI,KAAK,SAAS,EAAE;YAC9B,OAAO,CAAC,IAAI,GAAG,IAAA,4BAAgB,EAAC,OAAO,CAAC,CAAC;SAC1C;QAED,OAAO,CAAC,MAAM,GAAG,IAAA,mCAAqB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAEtD,MAAM,UAAU,GAAG,IAAA,sBAAS,EAAC,OAAO,CAAC,IAAc,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;QACnE,OAAO,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC;QAC/B,OAAO,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC;QAE/B,MAAM,cAAc,GAAG,IAAA,kBAAK,EAAC,IAAA,gBAAG,EAAC,SAAS,CAAC,EAAE;YAC3C,IAAA,2BAAc,kCACT,cAAO,GACP,OAAO,EACV;YACF,IAAA,iBAAI,EAAC,UAAU,CAAC,IAAI,CAAC;SACtB,CAAC,CAAC;QAEH,OAAO,IAAA,kBAAK,EAAC;YACX,UAAU,CAAC,OAAO,CAAC;YACnB,IAAA,sBAAS,EAAC,cAAc,CAAC;SAC1B,CAAC,CAAC;IACL,CAAC,CAAA,CAAC;AACJ,CAAC;AAvCD,wBAuCC"}
@@ -1 +0,0 @@
1
- export {};
@@ -1,23 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const schematics_1 = require("@angular-devkit/schematics");
13
- const testing_1 = require("@angular-devkit/schematics/testing");
14
- const path = require("path");
15
- const collectionPath = path.join(__dirname, '../collection.json');
16
- describe('entity', () => {
17
- it('works', () => __awaiter(void 0, void 0, void 0, function* () {
18
- const runner = new testing_1.SchematicTestRunner('schematics', collectionPath);
19
- const tree = yield runner.runSchematic('entity', {}, schematics_1.Tree.empty());
20
- expect(tree.files).toEqual([]);
21
- }));
22
- });
23
- //# sourceMappingURL=index_spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index_spec.js","sourceRoot":"","sources":["index_spec.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,2DAAkD;AAClD,gEAAyE;AACzE,6BAA6B;AAG7B,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;AAGlE,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE;IACtB,EAAE,CAAC,OAAO,EAAE,GAAS,EAAE;QACrB,MAAM,MAAM,GAAG,IAAI,6BAAmB,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;QACrE,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,EAAE,EAAE,iBAAI,CAAC,KAAK,EAAE,CAAC,CAAC;QAEnE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACjC,CAAC,CAAA,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,45 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/schema",
3
- "$id": "EntitySchema",
4
- "title": "Entity Schema",
5
- "type": "object",
6
- "description": "Creates a new entity in the default project.",
7
- "properties": {
8
- "index": {
9
- "type": "number",
10
- "default": 1
11
- },
12
- "path": {
13
- "type": "string",
14
- "format": "path",
15
- "description": "The path at which to create the entity file, relative to the current workspace. Should typically be within /src/app/core/store.",
16
- "visible": false,
17
- "$default": {
18
- "$source": "workingDirectory"
19
- }
20
- },
21
- "project": {
22
- "type": "string",
23
- "description": "The name of the project.",
24
- "$default": {
25
- "$source": "projectName"
26
- }
27
- },
28
- "name": {
29
- "type": "string",
30
- "description": "The name of the entity.",
31
- "$default": {
32
- "$source": "argv",
33
- "index": 0
34
- },
35
- "x-prompt": "What name would you like to use for the entity?"
36
- },
37
- "inDirectory": {
38
- "type": "boolean",
39
- "x-prompt": "Are you currently in the directory where you want to generate the entity? (typically directly in src/app/core/store)"
40
- }
41
- },
42
- "required": [
43
- "name"
44
- ]
45
- }
@@ -1,10 +0,0 @@
1
- Update this manually once the project is generated and update it as changes are made to the repository.
2
-
3
- <a name="13.0.0-0"></a>
4
- # 13.0.0-0 (YYYY-MM-DD)
5
- ### <%= classify(project) %>
6
- | Commit | Type | Description |
7
- | -- | -- | -- |
8
- | [commit-hash](commit-url) | fix | **module:** commit message ([#pr](pr-url)) |
9
-
10
- <!-- CHANGELOG SPLIT MARKER -->
@@ -1,17 +0,0 @@
1
- import { NgModule } from '@angular/core';
2
- import { Routes, RouterModule } from '@angular/router';
3
- import { AuthGuard } from '../core/auth/auth.guard';
4
-
5
- // Containers
6
- import { WaitlistComponent } from './waitlist/waitlist.component';
7
-
8
- const routes: Routes = [
9
- { path: '', redirectTo: '/landing', pathMatch: 'full' },
10
- { path: 'waitlist', component: WaitlistComponent, canActivate: [AuthGuard] },
11
- ];
12
-
13
- @NgModule({
14
- imports: [RouterModule.forChild(routes)],
15
- exports: [RouterModule],
16
- })
17
- export class AdminRoutingModule { }
@@ -1,13 +0,0 @@
1
- import { AdminModule } from './admin.module';
2
-
3
- describe('AdminModule', () => {
4
- let adminModule: AdminModule;
5
-
6
- beforeEach(() => {
7
- adminModule = new AdminModule();
8
- });
9
-
10
- it('should create an instance', () => {
11
- expect(adminModule).toBeTruthy();
12
- });
13
- });
@@ -1,28 +0,0 @@
1
- import { NgModule } from '@angular/core';
2
- import { CommonModule } from '@angular/common';
3
- import { EffectsModule } from '@ngrx/effects';
4
- import { SharedModule } from '../shared/shared.module';
5
- import { AdminRoutingModule } from './admin-routing.module';
6
-
7
- // Containers
8
- import { WaitlistComponent } from './waitlist/waitlist.component';
9
- import { WaitlistEffects } from './waitlist/+state/waitlist.effects';
10
-
11
- // Components
12
-
13
- @NgModule({
14
- imports: [
15
- CommonModule,
16
- SharedModule,
17
- AdminRoutingModule,
18
- EffectsModule.forFeature([
19
- WaitlistEffects,
20
- ]),
21
- ],
22
- declarations: [
23
- // Containers
24
- WaitlistComponent,
25
- // Components
26
- ],
27
- })
28
- export class AdminModule { }
@@ -1,23 +0,0 @@
1
- import { Action } from '@ngrx/store';
2
-
3
- export enum WaitlistActionTypes {
4
- LOAD_DATA = '[Waitlist] load data',
5
- CLEANUP = '[Waitlist] cleanup',
6
- }
7
-
8
- /** Action for loading required DB data. */
9
- export class LoadData implements Action {
10
- readonly type = WaitlistActionTypes.LOAD_DATA;
11
-
12
- constructor(public containerId: string) { }
13
- }
14
-
15
- /** Action for cleaning up loading subscriptions. */
16
- export class Cleanup implements Action {
17
- readonly type = WaitlistActionTypes.CLEANUP;
18
- constructor(public containerId: string) { }
19
- }
20
-
21
- export type WaitlistActions =
22
- LoadData |
23
- Cleanup;
@@ -1,50 +0,0 @@
1
- import { Injectable } from '@angular/core';
2
- import { Action } from '@ngrx/store';
3
- import { Actions, createEffect, ofType } from '@ngrx/effects';
4
-
5
- import { of, Observable } from 'rxjs';
6
- import { mergeMap, tap, map } from 'rxjs/operators';
7
-
8
- import { select, Store } from '@ngrx/store';
9
- import * as fromStore from '../../../core/store/app.reducer';
10
- import { FirebaseService } from '../../../core/firebase/firebase.service';
11
- import { EffectsHelpers } from '../../../core/store/effects.helpers';
12
- import { WaitlistState } from './waitlist.state';
13
-
14
- import { ActionFlow, RouterNavigate, LoadAction, Unsubscribe } from '../../../core/store/app.actions';
15
- import { WaitlistActionTypes, Cleanup, LoadData } from './waitlist.actions';
16
- import { AccessState } from '../../../core/store/user/user.model';
17
- import { StreamUser } from '../../../core/store/user/user.actions';
18
-
19
- @Injectable()
20
- export class WaitlistEffects {
21
- /** Load data from Firebase. */
22
- loadData$: Observable<Action> = createEffect(
23
- () => this.actions$.pipe(
24
- ofType<LoadData>(WaitlistActionTypes.LOAD_DATA),
25
- mergeMap((action: LoadData) => {
26
- const loadId = action.containerId;
27
-
28
- return [
29
- new StreamUser([], {}, loadId),
30
- ];
31
- }),
32
- ),
33
- );
34
-
35
- /** Unsubscribe connections from Firebase. */
36
- cleanup$: Observable<Action> = createEffect(
37
- () => this.actions$.pipe(
38
- ofType<Cleanup>(WaitlistActionTypes.CLEANUP),
39
- map((action: Cleanup) => new Unsubscribe(action.containerId)),
40
- ),
41
- );
42
-
43
- constructor(
44
- private actions$: Actions,
45
- private store: Store<fromStore.State>,
46
- private state: WaitlistState,
47
- private db: FirebaseService,
48
- private eh: EffectsHelpers,
49
- ) {}
50
- }
@@ -1,39 +0,0 @@
1
- import { Injectable } from '@angular/core';
2
- import { Store, select } from '@ngrx/store';
3
- import * as fromStore from '../../../core/store/app.reducer';
4
- import { EntitySelectorService } from '../../../core/store/app.selectors';
5
-
6
- import { Observable, of, combineLatest } from 'rxjs';
7
- import { bufferTime, distinctUntilChanged, shareReplay, mergeMap, filter, switchMap, map } from 'rxjs/operators';
8
- import { User, AccessState } from '../../../core/store/user/user.model';
9
-
10
- @Injectable({
11
- providedIn: 'root',
12
- })
13
- export class WaitlistSelectors {
14
- constructor(
15
- private slRx: EntitySelectorService,
16
- ) { }
17
-
18
- /** selector for getting waiting users. */
19
- selectWaitingUsers(cId: string): Observable<User[]> {
20
- return this.slRx.selectUsers([], cId).pipe(
21
- map((users) => {
22
- users.sort((a, b) => {
23
- if (a.accessState > b.accessState) {
24
- return 1;
25
- } else if (a.accessState < b.accessState) {
26
- return -1;
27
- } else {
28
- return 0;
29
- }
30
- });
31
- return users;
32
- }),
33
- );
34
- }
35
-
36
- cleanup(cId: string) {
37
- this.slRx.release(cId);
38
- }
39
- }
@@ -1,13 +0,0 @@
1
- import { Injectable } from '@angular/core';
2
-
3
- import { BehaviorSubject } from 'rxjs';
4
-
5
- @Injectable({
6
- providedIn: 'root',
7
- })
8
- export class WaitlistState {
9
- // --------------- LOCAL UI STATE ----------------------
10
-
11
- constructor(
12
- ) { }
13
- }
@@ -1,141 +0,0 @@
1
- import { Component, OnInit, OnDestroy, ChangeDetectionStrategy } from '@angular/core';
2
- import { WaitlistAnimations } from './waitlist.animations';
3
- import { ParamMap, ActivatedRoute } from '@angular/router';
4
- import { Store, select } from '@ngrx/store';
5
- import * as fromStore from '../../core/store/app.reducer';
6
- import * as fromAuth from '../../core/store/auth/auth.reducer';
7
- import { FirebaseService } from '../../core/firebase/firebase.service';
8
- import { Observable, Subject, BehaviorSubject, combineLatest } from 'rxjs';
9
- import { withLatestFrom, take, takeUntil } from 'rxjs/operators';
10
-
11
- import { WaitlistState } from './+state/waitlist.state';
12
- import { WaitlistSelectors } from './+state/waitlist.selectors';
13
-
14
- import { LoadData, Cleanup } from './+state/waitlist.actions';
15
- import { ActionFlow, RouterNavigate, ActionSet } from '../../core/store/app.actions';
16
-
17
- import { User, AccessState } from '../../core/store/user/user.model';
18
- import { ShowSnackbar } from '../../core/snackbar/snackbar.actions';
19
- import { UpdateUser, UserActionTypes } from '../../core/store/user/user.actions';
20
-
21
- // If you add other columns, update this, e.g. AccessState | string | boolean;
22
- type UpdateValueTypes = AccessState;
23
-
24
- @Component({
25
- selector: 'app-waitlist',
26
- templateUrl: './waitlist.component.html',
27
- styleUrls: ['./waitlist.component.scss'],
28
- changeDetection: ChangeDetectionStrategy.OnPush,
29
- animations: WaitlistAnimations,
30
- })
31
- export class WaitlistComponent implements OnInit, OnDestroy {
32
- // --------------- ROUTE PARAMS & CURRENT USER ---------
33
-
34
-
35
- // --------------- LOCAL AND GLOBAL STATE --------------
36
-
37
- /** Access options for menu sorted alphabetically. */
38
- accessOptions: AccessState[] = Object.keys(AccessState)
39
- .map((k) => AccessState[k] as AccessState)
40
- .sort((a, b) => {
41
- if (a > b) {
42
- return 1;
43
- } else if (a < b) {
44
- return -1;
45
- } else {
46
- return 0;
47
- }
48
- });
49
-
50
- /** Columns to display in the table */
51
- displayedColumns = ['userName', 'accessState'];
52
-
53
- // --------------- DB ENTITY DATA ----------------------
54
-
55
- /** Container id for selectors and loading. */
56
- containerId: string = this.db.createId();
57
-
58
- /** Get array of all waiting users. */
59
- waitingUsers$: Observable<User[]> = this.selectors.selectWaitingUsers(this.containerId);
60
-
61
- // --------------- DATA BINDING ------------------------
62
-
63
-
64
- // --------------- EVENT BINDING -----------------------
65
-
66
- /** Event stream for updating user accessState. */
67
- updateState$: Subject<{ user: User, key: string, value: UpdateValueTypes }> = new Subject<{ user: User, key: string, value: UpdateValueTypes }>();
68
-
69
-
70
- // --------------- HELPER FUNCTIONS AND OTHER ----------
71
-
72
- /** Unsubscribe observable for subscriptions. */
73
- unsubscribe$: Subject<void> = new Subject();
74
-
75
- constructor(
76
- private state: WaitlistState,
77
- private route: ActivatedRoute,
78
- private selectors: WaitlistSelectors,
79
- private store: Store<fromStore.State>,
80
- private db: FirebaseService,
81
- ) {
82
- }
83
-
84
- ngOnInit() {
85
- // --------------- EVENT HANDLING ----------------------
86
-
87
- this.updateState$.pipe(
88
- takeUntil(this.unsubscribe$),
89
- ).subscribe(({ user, key, value }) => {
90
- const data = {};
91
- data[key] = value;
92
- const actionSets: ActionSet[] = [{
93
- action: new UpdateUser(user.__id, {
94
- ...data,
95
- }, this.containerId),
96
- responseActionTypes: {
97
- success: UserActionTypes.UPDATE_SUCCESS,
98
- failure: UserActionTypes.UPDATE_FAIL,
99
- },
100
- }];
101
-
102
- this.store.dispatch(
103
- new ActionFlow({
104
- actionSets,
105
- successActionFn: (actionSetResponses) => {
106
- return [
107
- new ShowSnackbar({
108
- message: `Set ${user.name}'s ${key} to ${value}`,
109
- config: { duration: 3000 },
110
- }),
111
- ];
112
- },
113
- failActionFn: (actionSetResponses) => {
114
- return [
115
- new ShowSnackbar({
116
- message: 'Failed to submit response',
117
- config: { duration: 3000 },
118
- }),
119
- ];
120
- },
121
- }),
122
- );
123
- });
124
-
125
-
126
- // --------------- LOAD DATA ---------------------------
127
-
128
- // Once everything is set up, load the data for the role.
129
- this.store.dispatch( new LoadData(this.containerId) );
130
- }
131
-
132
- ngOnDestroy() {
133
- // Unsubscribe subscriptions.
134
- this.unsubscribe$.next();
135
- this.unsubscribe$.complete();
136
-
137
- // Unsubscribe from firebase connection from load and free up memoized selector values.
138
- this.store.dispatch( new Cleanup(this.containerId) );
139
- this.selectors.cleanup(this.containerId);
140
- }
141
- }
@@ -1,26 +0,0 @@
1
- import { NgModule } from '@angular/core';
2
- import { Routes, RouterModule, PreloadAllModules } from '@angular/router';
3
- import { AuthGuard } from './core/auth/auth.guard';
4
-
5
- // Containers
6
- import { LoginComponent } from './general/login/login.component';
7
- import { LandingComponent } from './general/landing/landing.component';
8
-
9
- // Our general approach is to load the GeneralModule eagerly and everything lazily (but with preloading)
10
- const appRoutes: Routes = [
11
- { path: 'admin', loadChildren: () => import('./admin/admin.module').then((mod) => mod.AdminModule) },
12
- { path: 'onboarding', loadChildren: () => import('./onboarding/onboarding.module').then((mod) => mod.OnboardingModule) },
13
- { path: '', component: LandingComponent, canActivate: [AuthGuard] },
14
- { path: '**', redirectTo: '', pathMatch: 'full' },
15
- ];
16
-
17
- @NgModule({
18
- imports: [
19
- RouterModule.forRoot(appRoutes, {
20
- useHash: true,
21
- preloadingStrategy: PreloadAllModules,
22
- }),
23
- ],
24
- exports: [RouterModule],
25
- })
26
- export class AppRoutingModule { }
@@ -1,34 +0,0 @@
1
- import { BrowserModule } from '@angular/platform-browser';
2
- import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
3
- import { NgModule } from '@angular/core';
4
-
5
- import { AppComponent } from './app.component';
6
- import { AppRoutingModule } from './app-routing.module';
7
-
8
- // General Modules
9
- import { CoreModule } from './core/core.module';
10
- import { SharedModule } from './shared/shared.module';
11
-
12
- // Feature Modules
13
- import { GeneralModule } from './general/general.module';
14
-
15
- @NgModule({
16
- declarations: [
17
- AppComponent,
18
- ],
19
- imports: [
20
- BrowserModule,
21
- BrowserAnimationsModule,
22
- CoreModule,
23
- SharedModule,
24
- // Feature Modules
25
- GeneralModule,
26
- // Routing Module
27
- AppRoutingModule,
28
- ],
29
- providers: [],
30
- bootstrap: [
31
- AppComponent,
32
- ],
33
- })
34
- export class AppModule { }
@@ -1,75 +0,0 @@
1
- import { NgModule, Optional, SkipSelf, NgZone, PLATFORM_ID } from '@angular/core';
2
- import { CommonModule } from '@angular/common';
3
- import { RouterModule } from '@angular/router';
4
- import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
5
- import { throwIfAlreadyLoaded } from './setup/module-import-guard';
6
-
7
- import { environment } from '../../environments/environment';
8
-
9
- // Firebase
10
- import { AngularFireModule } from '@angular/fire/compat';
11
- import { AngularFirestoreModule } from '@angular/fire/compat/firestore';
12
- import { AngularFireAuthModule } from '@angular/fire/compat/auth';
13
- import { MainAngularFirestore, LoggingAngularFirestore, MainAngularFirestoreFactory, LoggingAngularFirestoreFactory } from './setup/firebase-setup';
14
-
15
- // NgRx
16
- import { StoreModule } from '@ngrx/store';
17
- import { reducers, metaReducers } from './store/app.reducer';
18
- import { StoreDevtoolsModule } from '@ngrx/store-devtools';
19
- import { StoreRouterConnectingModule, RouterState } from '@ngrx/router-store';
20
- import { EffectsModule } from '@ngrx/effects';
21
- import { AppEffects } from './store/app.effects';
22
-
23
- // Auth
24
- import { AuthEffects } from './store/auth/auth.effects';
25
-
26
- // Entity Effects
27
- import { AppStateEffects } from './store/app-state/app-state.effects';
28
- import { UserContextEffects } from './store/user-context/user-context.effects';
29
- import { UserEffects } from './store/user/user.effects';
30
-
31
- // Service Effects
32
- import { SnackbarEffects } from './snackbar/snackbar.effects';
33
-
34
- @NgModule({
35
- imports: [
36
- CommonModule,
37
- RouterModule,
38
- BrowserAnimationsModule,
39
- AngularFireModule.initializeApp(environment.firebase),
40
- AngularFirestoreModule,
41
- AngularFireAuthModule,
42
- StoreModule.forRoot(reducers, {
43
- metaReducers,
44
- runtimeChecks: {
45
- strictActionImmutability: false,
46
- },
47
- }),
48
- StoreRouterConnectingModule.forRoot({ routerState: RouterState.Minimal }),
49
- StoreDevtoolsModule.instrument({
50
- maxAge: 25, // Retains last 25 states
51
- logOnly: environment.production, // Restrict extension to log-only mode
52
- }),
53
- EffectsModule.forRoot([
54
- AppEffects,
55
- AuthEffects,
56
- // Service Effects
57
- SnackbarEffects,
58
- // Entity Effects
59
- AppStateEffects,
60
- UserContextEffects,
61
- UserEffects,
62
- ]),
63
- ],
64
- declarations: [],
65
- exports: [],
66
- providers: [
67
- { provide: MainAngularFirestore, deps: [PLATFORM_ID, NgZone], useFactory: MainAngularFirestoreFactory },
68
- { provide: LoggingAngularFirestore, deps: [PLATFORM_ID, NgZone], useFactory: LoggingAngularFirestoreFactory },
69
- ],
70
- })
71
- export class CoreModule {
72
- constructor(@Optional() @SkipSelf() parentModule: CoreModule) {
73
- throwIfAlreadyLoaded(parentModule, 'CoreModule');
74
- }
75
- }
@@ -1,25 +0,0 @@
1
- import { Injectable, NgZone } from '@angular/core';
2
- import { AngularFirestore } from '@angular/fire/compat/firestore';
3
- import { ɵAngularFireSchedulers } from '@angular/fire';
4
- import { AppCheckInstances } from '@angular/fire/app-check';
5
- import { AngularFireAuth } from '@angular/fire/compat/auth';
6
- import { environment } from '../../../environments/environment';
7
-
8
- @Injectable()
9
- export class MainAngularFirestore extends AngularFirestore { }
10
-
11
- @Injectable()
12
- export class LoggingAngularFirestore extends AngularFirestore { }
13
-
14
- export function MainAngularFirestoreFactory(platformId: Record<string, unknown>, zone: NgZone): MainAngularFirestore {
15
- const schedulers = new ɵAngularFireSchedulers(zone);
16
- const auth = new AngularFireAuth(environment.firebase, 'mainAuth', platformId, zone, schedulers, null, null, null, null, null, null, new AppCheckInstances());
17
-
18
- return new MainAngularFirestore(environment.firebase, 'main', true, {}, platformId, zone, schedulers, {}, null, auth, null, null, null, null, null, null, new AppCheckInstances());
19
- }
20
-
21
- export function LoggingAngularFirestoreFactory(platformId: Record<string, unknown>, zone: NgZone): LoggingAngularFirestore {
22
- const schedulers = new ɵAngularFireSchedulers(zone);
23
- const auth = new AngularFireAuth(environment.firebase, 'loggingAuth', platformId, zone, schedulers, null, null, null, null, null, null, new AppCheckInstances());
24
- return new LoggingAngularFirestore(environment.firebaseLogs, 'logging', true, {}, platformId, zone, schedulers, {}, null, auth, null, null, null, null, null, null, new AppCheckInstances());
25
- }
@@ -1,5 +0,0 @@
1
- export function throwIfAlreadyLoaded(parentModule: any, moduleName: string) {
2
- if (parentModule) {
3
- throw new Error(`${moduleName} has already been loaded. Import Core modules in the AppModule only.`);
4
- }
5
- }
@@ -1,24 +0,0 @@
1
- import { Action } from '@ngrx/store';
2
- import { MatSnackBarConfig, MatSnackBarRef } from '@angular/material/snack-bar';
3
-
4
- export enum SnackbarActionTypes {
5
- SHOW_MESSAGE = '[Snackbar] show snackbar message',
6
- }
7
-
8
- /** If there is a component, will use openFromComponent. Otherwise, will use message. At least one of component or message needs to be provided. */
9
- export class ShowSnackbar implements Action {
10
- readonly type = SnackbarActionTypes.SHOW_MESSAGE;
11
- constructor(
12
- public payload: {
13
- component?: any,
14
- message?: string,
15
- action?: string,
16
- config?: MatSnackBarConfig<any>,
17
- onAction?: (snackBarRef: MatSnackBarRef<any>) => any,
18
- },
19
- public correlationId?: string,
20
- ) {}
21
- }
22
-
23
- export type SnackbarActions =
24
- ShowSnackbar;