@tech4good/angular-schematics 17.0.4 → 18.0.1

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 (223) 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/.eslintrc.json.template +1 -1
  14. package/src/init/files/.firebaserc.template +8 -0
  15. package/src/init/files/.github/workflows/angular-github-ci.yml.template +1 -1
  16. package/src/init/files/README.md.template +13 -10
  17. package/src/init/files/angular.json.template +18 -11
  18. package/src/init/files/package.json.template +29 -30
  19. package/src/init/files/src/app/admin/{waitlist/waitlist.animations.ts.template → admin-panel/admin-panel.animations.ts.template} +1 -1
  20. package/src/init/files/src/app/admin/{waitlist/waitlist.component.html.template → admin-panel/admin-panel.component.html.template} +3 -3
  21. package/src/init/files/src/app/admin/{waitlist/waitlist.component.scss.template → admin-panel/admin-panel.component.scss.template} +1 -1
  22. package/src/init/files/src/app/admin/admin-panel/admin-panel.component.spec.ts.template +25 -0
  23. package/src/init/files/src/app/admin/admin-panel/admin-panel.component.ts.template +99 -0
  24. package/src/init/files/src/app/app.component.ts.template +12 -8
  25. package/src/init/files/src/app/app.config.ts.template +65 -0
  26. package/src/init/files/src/app/app.routes.ts.template +32 -0
  27. package/src/init/files/src/app/core/analytics/log.service.ts.template +122 -89
  28. package/src/init/files/src/app/core/analytics/time-analytics.service.ts.template +9 -17
  29. package/src/init/files/src/app/core/auth/auth.guard.ts.template +26 -23
  30. package/src/init/files/src/app/core/firebase/cached-listeners.service.ts.template +291 -0
  31. package/src/init/files/src/app/core/firebase/database.service.ts.template +56 -0
  32. package/src/init/files/src/app/core/firebase/firebase.mock.service.ts.template +276 -0
  33. package/src/init/files/src/app/core/firebase/firebase.service.ts.template +265 -215
  34. package/src/init/files/src/app/core/local-storage/session.service.ts.template +3 -4
  35. package/src/init/files/src/app/core/store/app.model.ts.template +19 -0
  36. package/src/init/files/src/app/core/store/app.store.ts.template +1074 -0
  37. package/src/init/files/src/app/core/store/auth/auth.mock.ts.template +20 -0
  38. package/src/init/files/src/app/core/store/auth/auth.store.ts.template +136 -0
  39. package/src/init/files/src/app/core/store/batch-write.firebase.service.ts.template +58 -0
  40. package/src/init/files/src/app/core/store/batch-write.mock.service.ts.template +105 -0
  41. package/src/init/files/src/app/core/store/batch-write.service.ts.template +126 -0
  42. package/src/init/files/src/app/core/store/user/user.mock.ts.template +24 -0
  43. package/src/init/files/src/app/core/store/user/user.model.ts.template +3 -6
  44. package/src/init/files/src/app/core/store/user/user.store.ts.template +41 -0
  45. package/src/init/files/src/app/core/store/user-context/user-context.mock.ts.template +24 -0
  46. package/src/init/files/src/app/core/store/user-context/user-context.model.ts.template +1 -0
  47. package/src/init/files/src/app/core/store/user-context/user-context.store.ts.template +41 -0
  48. package/src/init/files/src/app/core/utils/rand.utils.ts.template +13 -0
  49. package/src/init/files/src/app/{onboarding → first-time}/consent/consent.component.html.template +10 -14
  50. package/src/init/files/src/app/{onboarding → first-time}/consent/consent.component.scss.template +2 -2
  51. package/src/init/files/src/app/first-time/consent/consent.component.ts.template +95 -0
  52. package/src/init/files/src/app/first-time/early-access/early-access.animations.ts.template +4 -0
  53. package/src/init/files/src/app/first-time/early-access/early-access.component.html.template +65 -0
  54. package/src/init/files/src/app/{onboarding/waiting/waiting.component.scss.template → first-time/early-access/early-access.component.scss.template} +10 -3
  55. package/src/init/files/src/app/first-time/early-access/early-access.component.spec.ts.template +25 -0
  56. package/src/init/files/src/app/first-time/early-access/early-access.component.ts.template +254 -0
  57. package/src/init/files/src/app/first-time/early-access/early-access.model.ts.template +7 -0
  58. package/src/init/files/src/app/{general → first-time}/landing/landing.component.html.template +1 -1
  59. package/src/init/files/src/app/first-time/landing/landing.component.ts.template +44 -0
  60. package/src/init/files/src/app/first-time/login/login.component.html.template +10 -0
  61. package/src/init/files/src/app/first-time/login/login.component.ts.template +45 -0
  62. package/src/init/files/src/app/first-time/onboarding/onboarding.animations.ts.template +4 -0
  63. package/src/init/files/src/app/first-time/onboarding/onboarding.component.html.template +2 -0
  64. package/src/init/files/src/app/first-time/onboarding/onboarding.component.scss.template +5 -0
  65. package/src/init/files/src/app/{admin/waitlist/waitlist.component.spec.ts.template → first-time/onboarding/onboarding.component.spec.ts.template} +6 -6
  66. package/src/init/files/src/app/first-time/onboarding/onboarding.component.ts.template +41 -0
  67. package/src/init/files/src/app/main/home/home.component.html.template +6 -0
  68. package/src/init/files/src/app/{general → main}/home/home.component.scss.template +1 -0
  69. package/src/init/files/src/app/main/home/home.component.ts.template +55 -0
  70. package/src/init/files/src/app/shared/navbar/navbar.component.html.template +15 -0
  71. package/src/init/files/src/app/shared/navbar/navbar.component.scss.template +41 -0
  72. package/src/init/files/src/app/shared/navbar/navbar.component.spec.ts.template +25 -0
  73. package/src/init/files/src/app/shared/navbar/navbar.component.ts.template +40 -0
  74. package/src/init/files/src/app/shared/redeployment-warning/redeployment-warning.component.html.template +9 -0
  75. package/src/init/files/src/app/shared/{components/redeployment-warning → redeployment-warning}/redeployment-warning.component.ts.template +17 -6
  76. package/src/init/files/src/app/shared/{components/redeployment-warning → redeployment-warning}/redeployment-warning.service.ts.template +2 -2
  77. package/src/init/files/src/assets/images/close-x.svg +3 -0
  78. package/src/init/files/src/environments/environment.prod.ts.template +6 -2
  79. package/src/init/files/src/environments/environment.ts.template +4 -2
  80. package/src/init/files/src/index.html.template +1 -1
  81. package/src/init/files/src/styles.scss.template +4 -0
  82. package/src/init/files/tsconfig.json.template +0 -1
  83. package/src/container/files/__name@dasherize__/+state/__name@dasherize__.actions.ts.template +0 -26
  84. package/src/container/files/__name@dasherize__/+state/__name@dasherize__.effects.ts.template +0 -48
  85. package/src/container/files/__name@dasherize__/+state/__name@dasherize__.model.ts.template +0 -0
  86. package/src/container/files/__name@dasherize__/+state/__name@dasherize__.selectors.ts.template +0 -20
  87. package/src/container/files/__name@dasherize__/+state/__name@dasherize__.state.ts.template +0 -13
  88. package/src/container/files/__name@dasherize__/__name@dasherize__.animations.ts.template +0 -4
  89. package/src/container/files/__name@dasherize__/__name@dasherize__.component.html.template +0 -3
  90. package/src/container/files/__name@dasherize__/__name@dasherize__.component.scss.template +0 -5
  91. package/src/container/files/__name@dasherize__/__name@dasherize__.component.spec.ts.template +0 -25
  92. package/src/container/files/__name@dasherize__/__name@dasherize__.component.ts.template +0 -90
  93. package/src/container/index.d.ts +0 -2
  94. package/src/container/index.js +0 -127
  95. package/src/container/index.js.map +0 -1
  96. package/src/container/index_spec.d.ts +0 -1
  97. package/src/container/index_spec.js +0 -23
  98. package/src/container/index_spec.js.map +0 -1
  99. package/src/container/schema.json +0 -50
  100. package/src/entity/files/__name@dasherize__/__name@dasherize__.actions.ts.template +0 -249
  101. package/src/entity/files/__name@dasherize__/__name@dasherize__.effects.ts.template +0 -131
  102. package/src/entity/files/__name@dasherize__/__name@dasherize__.reducer.spec.ts.template +0 -13
  103. package/src/entity/files/__name@dasherize__/__name@dasherize__.reducer.ts.template +0 -51
  104. package/src/entity/files/__name@dasherize__/__name@dasherize__.service.ts.template +0 -50
  105. package/src/entity-in-example/files/__name@dasherize__/__name@dasherize__.actions.ts.template +0 -270
  106. package/src/entity-in-example/files/__name@dasherize__/__name@dasherize__.effects.ts.template +0 -131
  107. package/src/entity-in-example/files/__name@dasherize__/__name@dasherize__.model.ts.template +0 -3
  108. package/src/entity-in-example/files/__name@dasherize__/__name@dasherize__.reducer.spec.ts.template +0 -13
  109. package/src/entity-in-example/files/__name@dasherize__/__name@dasherize__.reducer.ts.template +0 -51
  110. package/src/entity-in-example/files/__name@dasherize__/__name@dasherize__.service.ts.template +0 -50
  111. package/src/entity-in-example/index.d.ts +0 -2
  112. package/src/entity-in-example/index.js +0 -141
  113. package/src/entity-in-example/index.js.map +0 -1
  114. package/src/entity-in-example/index_spec.d.ts +0 -1
  115. package/src/entity-in-example/index_spec.js +0 -23
  116. package/src/entity-in-example/index_spec.js.map +0 -1
  117. package/src/entity-in-example/schema.json +0 -45
  118. package/src/init/files/CHANGELOG.md.template +0 -10
  119. package/src/init/files/src/app/admin/admin-routing.module.ts.template +0 -17
  120. package/src/init/files/src/app/admin/admin.module.spec.ts.template +0 -13
  121. package/src/init/files/src/app/admin/admin.module.ts.template +0 -28
  122. package/src/init/files/src/app/admin/waitlist/+state/waitlist.actions.ts.template +0 -23
  123. package/src/init/files/src/app/admin/waitlist/+state/waitlist.effects.ts.template +0 -50
  124. package/src/init/files/src/app/admin/waitlist/+state/waitlist.model.ts.template +0 -0
  125. package/src/init/files/src/app/admin/waitlist/+state/waitlist.selectors.ts.template +0 -39
  126. package/src/init/files/src/app/admin/waitlist/+state/waitlist.state.ts.template +0 -13
  127. package/src/init/files/src/app/admin/waitlist/waitlist.component.ts.template +0 -141
  128. package/src/init/files/src/app/app-routing.module.ts.template +0 -26
  129. package/src/init/files/src/app/app.module.ts.template +0 -34
  130. package/src/init/files/src/app/core/core.module.ts.template +0 -75
  131. package/src/init/files/src/app/core/setup/firebase-setup.ts.template +0 -25
  132. package/src/init/files/src/app/core/setup/module-import-guard.ts.template +0 -5
  133. package/src/init/files/src/app/core/snackbar/snackbar.actions.ts.template +0 -24
  134. package/src/init/files/src/app/core/snackbar/snackbar.effects.ts.template +0 -41
  135. package/src/init/files/src/app/core/store/app-state/app-state.actions.ts.template +0 -249
  136. package/src/init/files/src/app/core/store/app-state/app-state.effects.ts.template +0 -131
  137. package/src/init/files/src/app/core/store/app-state/app-state.model.ts.template +0 -8
  138. package/src/init/files/src/app/core/store/app-state/app-state.reducer.spec.ts.template +0 -13
  139. package/src/init/files/src/app/core/store/app-state/app-state.reducer.ts.template +0 -51
  140. package/src/init/files/src/app/core/store/app-state/app-state.service.ts.template +0 -50
  141. package/src/init/files/src/app/core/store/app.actions.ts.template +0 -92
  142. package/src/init/files/src/app/core/store/app.effects.ts.template +0 -175
  143. package/src/init/files/src/app/core/store/app.reducer.ts.template +0 -36
  144. package/src/init/files/src/app/core/store/app.selectors.ts.template +0 -42
  145. package/src/init/files/src/app/core/store/auth/auth.actions.ts.template +0 -77
  146. package/src/init/files/src/app/core/store/auth/auth.effects.ts.template +0 -163
  147. package/src/init/files/src/app/core/store/auth/auth.reducer.spec.ts.template +0 -13
  148. package/src/init/files/src/app/core/store/auth/auth.reducer.ts.template +0 -26
  149. package/src/init/files/src/app/core/store/auth/auth.selectors.ts.template +0 -25
  150. package/src/init/files/src/app/core/store/cached-load-connections.service.ts.template +0 -405
  151. package/src/init/files/src/app/core/store/cached-selectors.service.ts.template +0 -376
  152. package/src/init/files/src/app/core/store/effects.helpers.ts.template +0 -66
  153. package/src/init/files/src/app/core/store/user/user.actions.ts.template +0 -248
  154. package/src/init/files/src/app/core/store/user/user.effects.ts.template +0 -148
  155. package/src/init/files/src/app/core/store/user/user.reducer.spec.ts.template +0 -13
  156. package/src/init/files/src/app/core/store/user/user.reducer.ts.template +0 -50
  157. package/src/init/files/src/app/core/store/user/user.service.ts.template +0 -50
  158. package/src/init/files/src/app/core/store/user-context/user-context.actions.ts.template +0 -248
  159. package/src/init/files/src/app/core/store/user-context/user-context.effects.ts.template +0 -131
  160. package/src/init/files/src/app/core/store/user-context/user-context.reducer.spec.ts.template +0 -13
  161. package/src/init/files/src/app/core/store/user-context/user-context.reducer.ts.template +0 -51
  162. package/src/init/files/src/app/core/store/user-context/user-context.service.ts.template +0 -50
  163. package/src/init/files/src/app/core/utils/string-case.utils.ts.template +0 -96
  164. package/src/init/files/src/app/general/general-routing.module.ts.template +0 -25
  165. package/src/init/files/src/app/general/general.module.spec.ts.template +0 -13
  166. package/src/init/files/src/app/general/general.module.ts.template +0 -36
  167. package/src/init/files/src/app/general/home/+state/home.actions.ts.template +0 -26
  168. package/src/init/files/src/app/general/home/+state/home.effects.ts.template +0 -48
  169. package/src/init/files/src/app/general/home/+state/home.model.ts.template +0 -0
  170. package/src/init/files/src/app/general/home/+state/home.selectors.ts.template +0 -20
  171. package/src/init/files/src/app/general/home/+state/home.state.ts.template +0 -13
  172. package/src/init/files/src/app/general/home/home.component.html.template +0 -5
  173. package/src/init/files/src/app/general/home/home.component.ts.template +0 -88
  174. package/src/init/files/src/app/general/landing/+state/landing.actions.ts.template +0 -26
  175. package/src/init/files/src/app/general/landing/+state/landing.effects.ts.template +0 -48
  176. package/src/init/files/src/app/general/landing/+state/landing.model.ts.template +0 -0
  177. package/src/init/files/src/app/general/landing/+state/landing.selectors.ts.template +0 -20
  178. package/src/init/files/src/app/general/landing/+state/landing.state.ts.template +0 -13
  179. package/src/init/files/src/app/general/landing/landing.component.ts.template +0 -98
  180. package/src/init/files/src/app/general/login/login.component.html.template +0 -11
  181. package/src/init/files/src/app/general/login/login.component.ts.template +0 -80
  182. package/src/init/files/src/app/onboarding/consent/+state/consent.actions.ts.template +0 -23
  183. package/src/init/files/src/app/onboarding/consent/+state/consent.effects.ts.template +0 -47
  184. package/src/init/files/src/app/onboarding/consent/+state/consent.model.ts.template +0 -0
  185. package/src/init/files/src/app/onboarding/consent/+state/consent.selectors.ts.template +0 -20
  186. package/src/init/files/src/app/onboarding/consent/+state/consent.state.ts.template +0 -13
  187. package/src/init/files/src/app/onboarding/consent/consent.component.ts.template +0 -151
  188. package/src/init/files/src/app/onboarding/onboarding-routing.module.ts.template +0 -19
  189. package/src/init/files/src/app/onboarding/onboarding.module.spec.ts.template +0 -13
  190. package/src/init/files/src/app/onboarding/onboarding.module.ts.template +0 -32
  191. package/src/init/files/src/app/onboarding/waiting/+state/waiting.actions.ts.template +0 -26
  192. package/src/init/files/src/app/onboarding/waiting/+state/waiting.effects.ts.template +0 -52
  193. package/src/init/files/src/app/onboarding/waiting/+state/waiting.model.ts.template +0 -9
  194. package/src/init/files/src/app/onboarding/waiting/+state/waiting.selectors.ts.template +0 -42
  195. package/src/init/files/src/app/onboarding/waiting/+state/waiting.state.ts.template +0 -13
  196. package/src/init/files/src/app/onboarding/waiting/waiting.animations.ts.template +0 -4
  197. package/src/init/files/src/app/onboarding/waiting/waiting.component.html.template +0 -57
  198. package/src/init/files/src/app/onboarding/waiting/waiting.component.spec.ts.template +0 -25
  199. package/src/init/files/src/app/onboarding/waiting/waiting.component.ts.template +0 -281
  200. package/src/init/files/src/app/shared/components/redeployment-warning/redeployment-warning.component.html.template +0 -10
  201. package/src/init/files/src/app/shared/shared.module.ts.template +0 -87
  202. package/src/init/files/src/main.ts.template +0 -12
  203. package/src/module/files/__name@dasherize__/__name@dasherize__-routing.module.ts.template +0 -15
  204. package/src/module/files/__name@dasherize__/__name@dasherize__.module.spec.ts.template +0 -13
  205. package/src/module/files/__name@dasherize__/__name@dasherize__.module.ts.template +0 -24
  206. package/src/module/index.d.ts +0 -2
  207. package/src/module/index.js +0 -97
  208. package/src/module/index.js.map +0 -1
  209. package/src/module/index_spec.d.ts +0 -1
  210. package/src/module/index_spec.js +0 -23
  211. package/src/module/index_spec.js.map +0 -1
  212. package/src/module/schema.json +0 -38
  213. /package/src/init/files/src/app/{onboarding → first-time}/consent/consent.animations.ts.template +0 -0
  214. /package/src/init/files/src/app/{onboarding → first-time}/consent/consent.component.spec.ts.template +0 -0
  215. /package/src/init/files/src/app/{general → first-time}/landing/landing.animations.ts.template +0 -0
  216. /package/src/init/files/src/app/{general → first-time}/landing/landing.component.scss.template +0 -0
  217. /package/src/init/files/src/app/{general → first-time}/landing/landing.component.spec.ts.template +0 -0
  218. /package/src/init/files/src/app/{general → first-time}/login/login.component.scss.template +0 -0
  219. /package/src/init/files/src/app/{general → first-time}/login/login.component.spec.ts.template +0 -0
  220. /package/src/init/files/src/app/{general → main}/home/home.animations.ts.template +0 -0
  221. /package/src/init/files/src/app/{general → main}/home/home.component.spec.ts.template +0 -0
  222. /package/src/init/files/src/app/shared/{components/redeployment-warning → redeployment-warning}/redeployment-warning.component.scss.template +0 -0
  223. /package/src/init/files/src/app/shared/{components/redeployment-warning → redeployment-warning}/redeployment-warning.component.spec.ts.template +0 -0
@@ -0,0 +1,41 @@
1
+ import { Component, OnInit, ChangeDetectionStrategy, input, output, inject, WritableSignal, Signal, signal, computed, Inject, Injector } from '@angular/core';
2
+ import { OnboardingAnimations } from './onboarding.animations';
3
+ import { User } from 'src/app/core/store/user/user.model';
4
+ import { AuthStore } from 'src/app/core/store/auth/auth.store';
5
+ import { BatchWriteService, BATCH_WRITE_SERVICE } from 'src/app/core/store/batch-write.service';
6
+
7
+ @Component({
8
+ selector: 'app-onboarding',
9
+ templateUrl: './onboarding.component.html',
10
+ styleUrls: ['./onboarding.component.scss'],
11
+ changeDetection: ChangeDetectionStrategy.OnPush,
12
+ standalone: true,
13
+ animations: OnboardingAnimations,
14
+ })
15
+ export class OnboardingComponent implements OnInit {
16
+ authStore = inject(AuthStore);
17
+
18
+ // --------------- INPUTS AND OUTPUTS ------------------
19
+
20
+ /** The currently signed in user. */
21
+ currentUser: Signal<User> = this.authStore.user;
22
+
23
+ // --------------- LOCAL UI STATE ----------------------
24
+
25
+ // --------------- COMPUTED DATA -----------------------
26
+
27
+ // --------------- EVENT HANDLING ----------------------
28
+
29
+ // --------------- OTHER -------------------------------
30
+
31
+ constructor(
32
+ private injector: Injector,
33
+ @Inject(BATCH_WRITE_SERVICE) private batch: BatchWriteService,
34
+ ) {
35
+ }
36
+
37
+ // --------------- LOAD AND CLEANUP --------------------
38
+
39
+ ngOnInit() {
40
+ }
41
+ }
@@ -0,0 +1,6 @@
1
+ <app-navbar></app-navbar>
2
+ <div class="home-container">
3
+ @if (currentUser()) {
4
+ {{ currentUser().name }}
5
+ }
6
+ </div>
@@ -1,5 +1,6 @@
1
1
  :host {
2
2
  display: block;
3
3
  .home-container {
4
+ height: calc(100% - 70px);
4
5
  }
5
6
  }
@@ -0,0 +1,55 @@
1
+ import { Component, OnInit, ChangeDetectionStrategy, input, output, inject, WritableSignal, Signal, signal, computed, Inject, Injector } from '@angular/core';
2
+ import { HomeAnimations } from './home.animations';
3
+ import { User } from 'src/app/core/store/user/user.model';
4
+ import { AuthStore } from 'src/app/core/store/auth/auth.store';
5
+ import { BatchWriteService, BATCH_WRITE_SERVICE } from 'src/app/core/store/batch-write.service';
6
+ import { NavbarComponent } from 'src/app/shared/navbar/navbar.component';
7
+
8
+ @Component({
9
+ selector: 'app-home',
10
+ templateUrl: './home.component.html',
11
+ styleUrls: ['./home.component.scss'],
12
+ changeDetection: ChangeDetectionStrategy.OnPush,
13
+ standalone: true,
14
+ animations: HomeAnimations,
15
+ imports: [
16
+ NavbarComponent,
17
+ ]
18
+ })
19
+ export class HomeComponent implements OnInit {
20
+ authStore = inject(AuthStore);
21
+
22
+ // --------------- INPUTS AND OUTPUTS ------------------
23
+
24
+ /** The currently signed in user. */
25
+ currentUser: Signal<User> = this.authStore.user;
26
+
27
+ // --------------- LOCAL UI STATE ----------------------
28
+
29
+ // --------------- COMPUTED DATA -----------------------
30
+
31
+ // --------------- EVENT HANDLING ----------------------
32
+
33
+ /** Login the user. */
34
+ login() {
35
+ this.authStore.login('google.com', { doNotRoute: true });
36
+ }
37
+
38
+ /** Logout the user. */
39
+ logout() {
40
+ this.authStore.logout({ doNotRoute: true });
41
+ }
42
+
43
+ // --------------- OTHER -------------------------------
44
+
45
+ constructor(
46
+ private injector: Injector,
47
+ @Inject(BATCH_WRITE_SERVICE) private batch: BatchWriteService,
48
+ ) {
49
+ }
50
+
51
+ // --------------- LOAD AND CLEANUP --------------------
52
+
53
+ ngOnInit() {
54
+ }
55
+ }
@@ -0,0 +1,15 @@
1
+ <div class="navbar-container">
2
+ <!--<img class="logo" src="assets/images/logo.svg">-->
3
+ @if (currentUser()) {
4
+ <div class="user-setting-section">
5
+ <img class="profile-pic" [src]= 'currentUser().photoURL' [matMenuTriggerFor]="menu" #menuTrigger/>
6
+ <mat-menu #menu="matMenu">
7
+ <div class="logout" (click)="logout()">
8
+ <span>
9
+ Logout
10
+ </span>
11
+ </div>
12
+ </mat-menu>
13
+ </div>
14
+ }
15
+ </div>
@@ -0,0 +1,41 @@
1
+ .navbar-container {
2
+ height: 70px;
3
+ width: 100%;
4
+ background: #FFFFFF;
5
+ box-shadow: -4px 3px 10px rgba(200, 224, 212, 0.25);
6
+ display: flex;
7
+ flex-direction: row;
8
+ align-items: center; // Center items vertically
9
+ padding: 8px 16px; // Add padding to the container
10
+
11
+ .logo {
12
+ width: 46px;
13
+ height: 46px;
14
+ cursor: pointer;
15
+ margin-right: 16px; // Add margin between logo and user section
16
+ }
17
+
18
+ .user-setting-section {
19
+ margin-left: auto; // Push to the right
20
+ display: flex;
21
+ align-items: center; // Center items vertically
22
+ color: #2DBDB1;
23
+ .profile-pic{
24
+ height: 46px;
25
+ width: 46px;
26
+ border-radius: 50%;
27
+ cursor: pointer;
28
+ }
29
+ }
30
+ }
31
+
32
+ // material target, can't be nested
33
+ .logout {
34
+ display: flex;
35
+ align-items: center;
36
+ font-size: 16px;
37
+ font-weight: 400;
38
+ cursor: pointer;
39
+ padding: 10px;
40
+ }
41
+
@@ -0,0 +1,25 @@
1
+ import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { NavbarComponent } from './navbar.component';
4
+
5
+ describe('NavbarComponent', () => {
6
+ let component: NavbarComponent;
7
+ let fixture: ComponentFixture<NavbarComponent>;
8
+
9
+ beforeEach(waitForAsync(() => {
10
+ TestBed.configureTestingModule({
11
+ imports: [NavbarComponent],
12
+ })
13
+ .compileComponents();
14
+ }));
15
+
16
+ beforeEach(() => {
17
+ fixture = TestBed.createComponent(NavbarComponent);
18
+ component = fixture.componentInstance;
19
+ fixture.detectChanges();
20
+ });
21
+
22
+ it('should create', () => {
23
+ expect(component).toBeTruthy();
24
+ });
25
+ });
@@ -0,0 +1,40 @@
1
+ import { inject, Component, OnInit, ChangeDetectionStrategy, Input, Output, EventEmitter, Signal } from '@angular/core';
2
+ import { User } from 'src/app/core/store/user/user.model';
3
+ import { AuthStore } from 'src/app/core/store/auth/auth.store';
4
+ import { MatMenuTrigger, MatMenu } from '@angular/material/menu';
5
+
6
+ @Component({
7
+ selector: 'app-navbar',
8
+ templateUrl: './navbar.component.html',
9
+ styleUrls: ['./navbar.component.scss'],
10
+ changeDetection: ChangeDetectionStrategy.OnPush,
11
+ standalone: true,
12
+ imports: [MatMenuTrigger, MatMenu],
13
+ })
14
+ export class NavbarComponent implements OnInit {
15
+ readonly authStore = inject(AuthStore);
16
+
17
+ // --------------- INPUTS AND OUTPUTS ------------------
18
+
19
+ /** The current signed in user. */
20
+ currentUser: Signal<User> = this.authStore.user;
21
+
22
+ // --------------- LOCAL UI STATE ----------------------
23
+
24
+ // --------------- COMPUTED DATA -----------------------
25
+
26
+ // --------------- EVENT HANDLING ----------------------
27
+
28
+ /** Logout. */
29
+ logout() {
30
+ this.authStore.logout();
31
+ }
32
+
33
+ // --------------- OTHER -------------------------------
34
+
35
+ constructor() {
36
+ }
37
+
38
+ ngOnInit(): void {
39
+ }
40
+ }
@@ -0,0 +1,9 @@
1
+ @if (showRedeploymentWarning) {
2
+ <div class="warning-container">
3
+ <div class="header">
4
+ <div class="title">This version is out of date!</div>
5
+ <img (click)="close()" src="/assets/img/close-x.svg" />
6
+ </div>
7
+ <button (click)="update()" class="update">Update Now</button>
8
+ </div>
9
+ }
@@ -5,17 +5,18 @@ import { DetectRedeploymentService } from './redeployment-warning.service';
5
5
  selector: 'app-redeployment-warning',
6
6
  templateUrl: './redeployment-warning.component.html',
7
7
  styleUrls: ['./redeployment-warning.component.scss'],
8
+ standalone: true,
8
9
  })
9
10
  export class RedeploymentWarningComponent implements OnInit {
11
+ // --------------- INPUTS AND OUTPUTS ------------------
12
+
13
+ // --------------- LOCAL UI STATE ----------------------
14
+
10
15
  showRedeploymentWarning: boolean = false;
11
16
 
12
- constructor(public detectRedeployment: DetectRedeploymentService) {}
17
+ // --------------- COMPUTED DATA -----------------------
13
18
 
14
- ngOnInit() {
15
- this.detectRedeployment.redeployed().subscribe(() => {
16
- this.showRedeploymentWarning = true;
17
- });
18
- }
19
+ // --------------- EVENT HANDLING ----------------------
19
20
 
20
21
  /** Triggers a refresh. */
21
22
  update() {
@@ -26,4 +27,14 @@ export class RedeploymentWarningComponent implements OnInit {
26
27
  close() {
27
28
  this.showRedeploymentWarning = false;
28
29
  }
30
+
31
+ // --------------- OTHER -------------------------------
32
+
33
+ constructor(public detectRedeployment: DetectRedeploymentService) {}
34
+
35
+ ngOnInit() {
36
+ this.detectRedeployment.redeployed().subscribe(() => {
37
+ this.showRedeploymentWarning = true;
38
+ });
39
+ }
29
40
  }
@@ -15,7 +15,7 @@ export class DetectRedeploymentService {
15
15
  /** Sets redeployed$ and returns it. */
16
16
  public init() {
17
17
  // Matches the filename of the main javascript file, which contains the hash in the name
18
- const regexp = /main[-a-z0-9]*\.([a-f0-9]*)\.js/;
18
+ const regexp = /main[-a-zA-Z0-9]*\.js/;
19
19
 
20
20
  const observable: ConnectableObservable<void> = interval(2 * 60 * 1000) // every 2 minutes
21
21
  .pipe(
@@ -30,7 +30,7 @@ export class DetectRedeploymentService {
30
30
  // No biggie, we'll just do nothing.
31
31
  return null;
32
32
  } else {
33
- return m[1];
33
+ return m[0];
34
34
  }
35
35
  }),
36
36
  filter((val) => !!val),
@@ -0,0 +1,3 @@
1
+ <svg width="12" height="11" viewBox="0 0 8 7" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M4.29816 3.11482L3.89258 3.48439L4.29816 3.85397L6.98425 6.30163L6.91547 6.3643L6.61163 6.08744L4.16057 3.85394L3.82382 3.54708L3.48705 3.85393L0.731908 6.36431L0.663132 6.30164L3.34943 3.85398L3.75504 3.48441L3.34945 3.11482L0.663181 0.666989L0.732086 0.604227L3.48702 3.11483L3.82379 3.42173L4.16057 3.11484L6.91547 0.604478L6.98425 0.667152L6.74922 0.881321L4.29816 3.11482ZM0.530277 6.54803C0.530385 6.54793 0.530492 6.54783 0.530599 6.54774L0.530292 6.54802L0.530277 6.54803Z" fill="#6D6D6D" stroke="#6D6D6D" />
3
+ </svg>
@@ -1,5 +1,9 @@
1
1
  export const environment = {
2
2
  production: true,
3
- firebase: {}, // REPLACE WITH CONFIG
4
- firebaseLogs: {}, // REPLACE WITH CONFIG
3
+ firebase: {
4
+ // REPLACE WITH CONFIG
5
+ },
6
+ firebaseLogs: {
7
+ // REPLACE WITH CONFIG
8
+ },
5
9
  };
@@ -4,8 +4,10 @@
4
4
 
5
5
  export const environment = {
6
6
  production: false,
7
- firebase: {}, // REPLACE WITH CONFIG
8
- firebaseLogs: {}, // REPLACE WITH CONFIG
7
+ mockDB: true,
8
+ firebase: {
9
+ // REPLACE WITH CONFIG
10
+ },
9
11
  };
10
12
 
11
13
  /*
@@ -10,7 +10,7 @@
10
10
  <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
11
11
  <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
12
12
  </head>
13
- <body class="mat-typography">
13
+ <body>
14
14
  <app-root></app-root>
15
15
  </body>
16
16
  </html>
@@ -11,3 +11,7 @@ html, body, app-root {
11
11
  *, *:before, *:after {
12
12
  box-sizing: inherit;
13
13
  }
14
+
15
+ body {
16
+ background-color: #F2FFFE;
17
+ }
@@ -13,7 +13,6 @@
13
13
  "esModuleInterop": true,
14
14
  "sourceMap": true,
15
15
  "declaration": false,
16
- "downlevelIteration": true,
17
16
  "experimentalDecorators": true,
18
17
  "moduleResolution": "node",
19
18
  "importHelpers": true,
@@ -1,26 +0,0 @@
1
- import { Action } from '@ngrx/store';
2
- import { User } from '../<%= containerToCorePath %>/store/user/user.model';
3
-
4
- export enum <%= classify(name) %>ActionTypes {
5
- LOAD_DATA = '[<%= classify(name) %>] load data',
6
- CLEANUP = '[<%= classify(name) %>] cleanup',
7
- }
8
-
9
- /** Action for loading required DB data. */
10
- export class LoadData implements Action {
11
- readonly type = <%= classify(name) %>ActionTypes.LOAD_DATA;
12
-
13
- constructor(public payload: {
14
- currentUser: User,
15
- }, public correlationId: string) { }
16
- }
17
-
18
- /** Action for cleaning up loading subscriptions. */
19
- export class Cleanup implements Action {
20
- readonly type = <%= classify(name) %>ActionTypes.CLEANUP;
21
- constructor(public correlationId: string) { }
22
- }
23
-
24
- export type <%= classify(name) %>Actions =
25
- LoadData |
26
- Cleanup;
@@ -1,48 +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 '../<%= containerToCorePath %>/store/app.reducer';
10
- import { FirebaseService } from '../<%= containerToCorePath %>/firebase/firebase.service';
11
- import { EffectsHelpers } from '../<%= containerToCorePath %>/store/effects.helpers';
12
- import { <%= classify(name) %>State } from './<%= dasherize(name) %>.state';
13
-
14
- import { ActionFlow, RouterNavigate, LoadAction, Unsubscribe } from '../<%= containerToCorePath %>/store/app.actions';
15
- import { <%= classify(name) %>ActionTypes, Cleanup, LoadData } from './<%= dasherize(name) %>.actions';
16
-
17
- @Injectable()
18
- export class <%= classify(name) %>Effects {
19
- /** Load data from Firebase. */
20
- loadData$: Observable<Action> = createEffect(
21
- () => this.actions$.pipe(
22
- ofType<LoadData>(<%= classify(name) %>ActionTypes.LOAD_DATA),
23
- mergeMap((action: LoadData) => {
24
- const loadId = action.correlationId;
25
- const currentUser = action.payload.currentUser;
26
-
27
- return [
28
- ];
29
- }),
30
- ),
31
- );
32
-
33
- /** Unsubscribe connections from Firebase. */
34
- cleanup$: Observable<Action> = createEffect(
35
- () => this.actions$.pipe(
36
- ofType<Cleanup>(<%= classify(name) %>ActionTypes.CLEANUP),
37
- map((action: Cleanup) => new Unsubscribe(action.correlationId)),
38
- ),
39
- );
40
-
41
- constructor(
42
- private actions$: Actions,
43
- private store: Store<fromStore.State>,
44
- private state: <%= classify(name) %>State,
45
- private db: FirebaseService,
46
- private eh: EffectsHelpers,
47
- ) {}
48
- }
@@ -1,20 +0,0 @@
1
- import { Injectable } from '@angular/core';
2
- import { Store, select } from '@ngrx/store';
3
- import * as fromStore from '../<%= containerToCorePath %>/store/app.reducer';
4
- import { EntitySelectorService } from '../<%= containerToCorePath %>/store/app.selectors';
5
-
6
- import { Observable, of, combineLatest } from 'rxjs';
7
- import { bufferTime, distinctUntilChanged, shareReplay, mergeMap, filter, switchMap, map } from 'rxjs/operators';
8
-
9
- @Injectable({
10
- providedIn: 'root',
11
- })
12
- export class <%= classify(name) %>Selectors {
13
- constructor(
14
- private slRx: EntitySelectorService,
15
- ) { }
16
-
17
- cleanup(cId: string) {
18
- this.slRx.release(cId);
19
- }
20
- }
@@ -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 <%= classify(name) %>State {
9
- // --------------- LOCAL UI STATE ----------------------
10
-
11
- constructor(
12
- ) { }
13
- }
@@ -1,4 +0,0 @@
1
- import { trigger, group, query, animateChild, state, style, animate, transition } from '@angular/animations';
2
-
3
- export const <%= classify(name) %>Animations = [
4
- ];
@@ -1,3 +0,0 @@
1
- <div class="<%= dasherize(name) %>-container">
2
- <%= dasherize(name) %> works!
3
- </div>
@@ -1,5 +0,0 @@
1
- :host {
2
- display: block;
3
- .<%= dasherize(name) %>-container {
4
- }
5
- }
@@ -1,25 +0,0 @@
1
- import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';
4
-
5
- describe('<%= classify(name) %>Component', () => {
6
- let component: <%= classify(name) %>Component;
7
- let fixture: ComponentFixture<<%= classify(name) %>Component>;
8
-
9
- beforeEach(waitForAsync(() => {
10
- TestBed.configureTestingModule({
11
- declarations: [<%= classify(name) %>Component],
12
- })
13
- .compileComponents();
14
- }));
15
-
16
- beforeEach(() => {
17
- fixture = TestBed.createComponent(<%= classify(name) %>Component);
18
- component = fixture.componentInstance;
19
- fixture.detectChanges();
20
- });
21
-
22
- it('should create', () => {
23
- expect(component).toBeTruthy();
24
- });
25
- });
@@ -1,90 +0,0 @@
1
- import { Component, OnInit, OnDestroy, ChangeDetectionStrategy } from '@angular/core';
2
- import { <%= classify(name) %>Animations } from './<%= dasherize(name) %>.animations';
3
- import { ParamMap, ActivatedRoute } from '@angular/router';
4
- import { Store, select } from '@ngrx/store';
5
- import * as fromStore from '<%= containerToCorePath %>/store/app.reducer';
6
- import * as fromAuth from '<%= containerToCorePath %>/store/auth/auth.reducer';
7
- import { FirebaseService } from '<%= containerToCorePath %>/firebase/firebase.service';
8
- import { Observable, Subject, BehaviorSubject, combineLatest } from 'rxjs';
9
- import { withLatestFrom, filter, take, takeUntil } from 'rxjs/operators';
10
-
11
- import { <%= classify(name) %>State } from './+state/<%= dasherize(name) %>.state';
12
- import { <%= classify(name) %>Selectors } from './+state/<%= dasherize(name) %>.selectors';
13
-
14
- import { LoadData, Cleanup } from './+state/<%= dasherize(name) %>.actions';
15
- import { RouterNavigate } from '<%= containerToCorePath %>/store/app.actions';
16
-
17
- import { User } from '<%= containerToCorePath %>/store/user/user.model';
18
-
19
- @Component({
20
- selector: 'app-<%= dasherize(name) %>',
21
- templateUrl: './<%= dasherize(name) %>.component.html',
22
- styleUrls: ['./<%= dasherize(name) %>.component.scss'],
23
- changeDetection: ChangeDetectionStrategy.OnPush,
24
- animations: <%= classify(name) %>Animations,
25
- })
26
- export class <%= classify(name) %>Component implements OnInit, OnDestroy {
27
- // --------------- ROUTE PARAMS & CURRENT USER ---------
28
-
29
- // TODO: Delete this block of code if you don't need the currentUser (and make sure
30
- // to remove it from LoadData too
31
- /** The currently signed in user. */
32
- currentUser$: Observable<User> = this.store.pipe(
33
- select(fromAuth.selectUser),
34
- filter((user) => user !== null), // null indicates LoadAuth hasn't been processed
35
- );
36
-
37
- // --------------- LOCAL AND GLOBAL STATE --------------
38
-
39
-
40
- // --------------- DB ENTITY DATA ----------------------
41
-
42
- /** Container id for selectors and loading. */
43
- containerId: string = this.db.createId();
44
-
45
- // --------------- DATA BINDING ------------------------
46
-
47
-
48
- // --------------- EVENT BINDING -----------------------
49
-
50
-
51
- // --------------- HELPER FUNCTIONS AND OTHER ----------
52
-
53
- /** Unsubscribe observable for subscriptions. */
54
- unsubscribe$: Subject<void> = new Subject();
55
-
56
- constructor(
57
- private state: <%= classify(name) %>State,
58
- private route: ActivatedRoute,
59
- private selectors: <%= classify(name) %>Selectors,
60
- private store: Store<fromStore.State>,
61
- private db: FirebaseService,
62
- ) {
63
- }
64
-
65
- ngOnInit() {
66
- // --------------- EVENT HANDLING ----------------------
67
-
68
-
69
- // --------------- LOAD DATA ---------------------------
70
-
71
- // Once everything is set up, load the data for the role.
72
- this.currentUser$.pipe(
73
- takeUntil(this.unsubscribe$),
74
- ).subscribe((currentUser) => {
75
- this.store.dispatch( new LoadData({
76
- currentUser,
77
- }, this.containerId) );
78
- });
79
- }
80
-
81
- ngOnDestroy() {
82
- // Unsubscribe subscriptions.
83
- this.unsubscribe$.next();
84
- this.unsubscribe$.complete();
85
-
86
- // Unsubscribe from firebase connection from load and free up memoized selector values.
87
- this.store.dispatch( new Cleanup(this.containerId) );
88
- this.selectors.cleanup(this.containerId);
89
- }
90
- }
@@ -1,2 +0,0 @@
1
- import { Rule } from '@angular-devkit/schematics';
2
- export declare function container(options: any): Rule;