@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.
- package/README.md +8 -0
- package/package.json +4 -4
- package/src/collection.json +0 -16
- package/src/component/files/__name@dasherize__/__name@dasherize__.component.ts.template +22 -8
- package/src/component/index.js +2 -45
- package/src/component/index.js.map +1 -1
- package/src/component/schema.json +0 -5
- package/src/entity/files/__name@dasherize__/__name@dasherize__.mock.ts.template +12 -0
- package/src/entity/files/__name@dasherize__/__name@dasherize__.model.ts.template +1 -0
- package/src/entity/files/__name@dasherize__/__name@dasherize__.store.ts.template +41 -0
- package/src/entity/index.js +29 -50
- package/src/entity/index.js.map +1 -1
- package/src/init/files/.eslintrc.json.template +1 -1
- package/src/init/files/.firebaserc.template +8 -0
- package/src/init/files/.github/workflows/angular-github-ci.yml.template +1 -1
- package/src/init/files/README.md.template +13 -10
- package/src/init/files/angular.json.template +18 -11
- package/src/init/files/package.json.template +29 -30
- package/src/init/files/src/app/admin/{waitlist/waitlist.animations.ts.template → admin-panel/admin-panel.animations.ts.template} +1 -1
- package/src/init/files/src/app/admin/{waitlist/waitlist.component.html.template → admin-panel/admin-panel.component.html.template} +3 -3
- package/src/init/files/src/app/admin/{waitlist/waitlist.component.scss.template → admin-panel/admin-panel.component.scss.template} +1 -1
- package/src/init/files/src/app/admin/admin-panel/admin-panel.component.spec.ts.template +25 -0
- package/src/init/files/src/app/admin/admin-panel/admin-panel.component.ts.template +99 -0
- package/src/init/files/src/app/app.component.ts.template +12 -8
- package/src/init/files/src/app/app.config.ts.template +65 -0
- package/src/init/files/src/app/app.routes.ts.template +32 -0
- package/src/init/files/src/app/core/analytics/log.service.ts.template +122 -89
- package/src/init/files/src/app/core/analytics/time-analytics.service.ts.template +9 -17
- package/src/init/files/src/app/core/auth/auth.guard.ts.template +26 -23
- package/src/init/files/src/app/core/firebase/cached-listeners.service.ts.template +291 -0
- package/src/init/files/src/app/core/firebase/database.service.ts.template +56 -0
- package/src/init/files/src/app/core/firebase/firebase.mock.service.ts.template +276 -0
- package/src/init/files/src/app/core/firebase/firebase.service.ts.template +265 -215
- package/src/init/files/src/app/core/local-storage/session.service.ts.template +3 -4
- package/src/init/files/src/app/core/store/app.model.ts.template +19 -0
- package/src/init/files/src/app/core/store/app.store.ts.template +1074 -0
- package/src/init/files/src/app/core/store/auth/auth.mock.ts.template +20 -0
- package/src/init/files/src/app/core/store/auth/auth.store.ts.template +136 -0
- package/src/init/files/src/app/core/store/batch-write.firebase.service.ts.template +58 -0
- package/src/init/files/src/app/core/store/batch-write.mock.service.ts.template +105 -0
- package/src/init/files/src/app/core/store/batch-write.service.ts.template +126 -0
- package/src/init/files/src/app/core/store/user/user.mock.ts.template +24 -0
- package/src/init/files/src/app/core/store/user/user.model.ts.template +3 -6
- package/src/init/files/src/app/core/store/user/user.store.ts.template +41 -0
- package/src/init/files/src/app/core/store/user-context/user-context.mock.ts.template +24 -0
- package/src/init/files/src/app/core/store/user-context/user-context.model.ts.template +1 -0
- package/src/init/files/src/app/core/store/user-context/user-context.store.ts.template +41 -0
- package/src/init/files/src/app/core/utils/rand.utils.ts.template +13 -0
- package/src/init/files/src/app/{onboarding → first-time}/consent/consent.component.html.template +10 -14
- package/src/init/files/src/app/{onboarding → first-time}/consent/consent.component.scss.template +2 -2
- package/src/init/files/src/app/first-time/consent/consent.component.ts.template +95 -0
- package/src/init/files/src/app/first-time/early-access/early-access.animations.ts.template +4 -0
- package/src/init/files/src/app/first-time/early-access/early-access.component.html.template +65 -0
- package/src/init/files/src/app/{onboarding/waiting/waiting.component.scss.template → first-time/early-access/early-access.component.scss.template} +10 -3
- package/src/init/files/src/app/first-time/early-access/early-access.component.spec.ts.template +25 -0
- package/src/init/files/src/app/first-time/early-access/early-access.component.ts.template +254 -0
- package/src/init/files/src/app/first-time/early-access/early-access.model.ts.template +7 -0
- package/src/init/files/src/app/{general → first-time}/landing/landing.component.html.template +1 -1
- package/src/init/files/src/app/first-time/landing/landing.component.ts.template +44 -0
- package/src/init/files/src/app/first-time/login/login.component.html.template +10 -0
- package/src/init/files/src/app/first-time/login/login.component.ts.template +45 -0
- package/src/init/files/src/app/first-time/onboarding/onboarding.animations.ts.template +4 -0
- package/src/init/files/src/app/first-time/onboarding/onboarding.component.html.template +2 -0
- package/src/init/files/src/app/first-time/onboarding/onboarding.component.scss.template +5 -0
- package/src/init/files/src/app/{admin/waitlist/waitlist.component.spec.ts.template → first-time/onboarding/onboarding.component.spec.ts.template} +6 -6
- package/src/init/files/src/app/first-time/onboarding/onboarding.component.ts.template +41 -0
- package/src/init/files/src/app/main/home/home.component.html.template +6 -0
- package/src/init/files/src/app/{general → main}/home/home.component.scss.template +1 -0
- package/src/init/files/src/app/main/home/home.component.ts.template +55 -0
- package/src/init/files/src/app/shared/navbar/navbar.component.html.template +15 -0
- package/src/init/files/src/app/shared/navbar/navbar.component.scss.template +41 -0
- package/src/init/files/src/app/shared/navbar/navbar.component.spec.ts.template +25 -0
- package/src/init/files/src/app/shared/navbar/navbar.component.ts.template +40 -0
- package/src/init/files/src/app/shared/redeployment-warning/redeployment-warning.component.html.template +9 -0
- package/src/init/files/src/app/shared/{components/redeployment-warning → redeployment-warning}/redeployment-warning.component.ts.template +17 -6
- package/src/init/files/src/app/shared/{components/redeployment-warning → redeployment-warning}/redeployment-warning.service.ts.template +2 -2
- package/src/init/files/src/assets/images/close-x.svg +3 -0
- package/src/init/files/src/environments/environment.prod.ts.template +6 -2
- package/src/init/files/src/environments/environment.ts.template +4 -2
- package/src/init/files/src/index.html.template +1 -1
- package/src/init/files/src/styles.scss.template +4 -0
- package/src/init/files/tsconfig.json.template +0 -1
- package/src/container/files/__name@dasherize__/+state/__name@dasherize__.actions.ts.template +0 -26
- package/src/container/files/__name@dasherize__/+state/__name@dasherize__.effects.ts.template +0 -48
- package/src/container/files/__name@dasherize__/+state/__name@dasherize__.model.ts.template +0 -0
- package/src/container/files/__name@dasherize__/+state/__name@dasherize__.selectors.ts.template +0 -20
- package/src/container/files/__name@dasherize__/+state/__name@dasherize__.state.ts.template +0 -13
- package/src/container/files/__name@dasherize__/__name@dasherize__.animations.ts.template +0 -4
- package/src/container/files/__name@dasherize__/__name@dasherize__.component.html.template +0 -3
- package/src/container/files/__name@dasherize__/__name@dasherize__.component.scss.template +0 -5
- package/src/container/files/__name@dasherize__/__name@dasherize__.component.spec.ts.template +0 -25
- package/src/container/files/__name@dasherize__/__name@dasherize__.component.ts.template +0 -90
- package/src/container/index.d.ts +0 -2
- package/src/container/index.js +0 -127
- package/src/container/index.js.map +0 -1
- package/src/container/index_spec.d.ts +0 -1
- package/src/container/index_spec.js +0 -23
- package/src/container/index_spec.js.map +0 -1
- package/src/container/schema.json +0 -50
- package/src/entity/files/__name@dasherize__/__name@dasherize__.actions.ts.template +0 -249
- package/src/entity/files/__name@dasherize__/__name@dasherize__.effects.ts.template +0 -131
- package/src/entity/files/__name@dasherize__/__name@dasherize__.reducer.spec.ts.template +0 -13
- package/src/entity/files/__name@dasherize__/__name@dasherize__.reducer.ts.template +0 -51
- package/src/entity/files/__name@dasherize__/__name@dasherize__.service.ts.template +0 -50
- package/src/entity-in-example/files/__name@dasherize__/__name@dasherize__.actions.ts.template +0 -270
- package/src/entity-in-example/files/__name@dasherize__/__name@dasherize__.effects.ts.template +0 -131
- package/src/entity-in-example/files/__name@dasherize__/__name@dasherize__.model.ts.template +0 -3
- package/src/entity-in-example/files/__name@dasherize__/__name@dasherize__.reducer.spec.ts.template +0 -13
- package/src/entity-in-example/files/__name@dasherize__/__name@dasherize__.reducer.ts.template +0 -51
- package/src/entity-in-example/files/__name@dasherize__/__name@dasherize__.service.ts.template +0 -50
- package/src/entity-in-example/index.d.ts +0 -2
- package/src/entity-in-example/index.js +0 -141
- package/src/entity-in-example/index.js.map +0 -1
- package/src/entity-in-example/index_spec.d.ts +0 -1
- package/src/entity-in-example/index_spec.js +0 -23
- package/src/entity-in-example/index_spec.js.map +0 -1
- package/src/entity-in-example/schema.json +0 -45
- package/src/init/files/CHANGELOG.md.template +0 -10
- package/src/init/files/src/app/admin/admin-routing.module.ts.template +0 -17
- package/src/init/files/src/app/admin/admin.module.spec.ts.template +0 -13
- package/src/init/files/src/app/admin/admin.module.ts.template +0 -28
- package/src/init/files/src/app/admin/waitlist/+state/waitlist.actions.ts.template +0 -23
- package/src/init/files/src/app/admin/waitlist/+state/waitlist.effects.ts.template +0 -50
- package/src/init/files/src/app/admin/waitlist/+state/waitlist.model.ts.template +0 -0
- package/src/init/files/src/app/admin/waitlist/+state/waitlist.selectors.ts.template +0 -39
- package/src/init/files/src/app/admin/waitlist/+state/waitlist.state.ts.template +0 -13
- package/src/init/files/src/app/admin/waitlist/waitlist.component.ts.template +0 -141
- package/src/init/files/src/app/app-routing.module.ts.template +0 -26
- package/src/init/files/src/app/app.module.ts.template +0 -34
- package/src/init/files/src/app/core/core.module.ts.template +0 -75
- package/src/init/files/src/app/core/setup/firebase-setup.ts.template +0 -25
- package/src/init/files/src/app/core/setup/module-import-guard.ts.template +0 -5
- package/src/init/files/src/app/core/snackbar/snackbar.actions.ts.template +0 -24
- package/src/init/files/src/app/core/snackbar/snackbar.effects.ts.template +0 -41
- package/src/init/files/src/app/core/store/app-state/app-state.actions.ts.template +0 -249
- package/src/init/files/src/app/core/store/app-state/app-state.effects.ts.template +0 -131
- package/src/init/files/src/app/core/store/app-state/app-state.model.ts.template +0 -8
- package/src/init/files/src/app/core/store/app-state/app-state.reducer.spec.ts.template +0 -13
- package/src/init/files/src/app/core/store/app-state/app-state.reducer.ts.template +0 -51
- package/src/init/files/src/app/core/store/app-state/app-state.service.ts.template +0 -50
- package/src/init/files/src/app/core/store/app.actions.ts.template +0 -92
- package/src/init/files/src/app/core/store/app.effects.ts.template +0 -175
- package/src/init/files/src/app/core/store/app.reducer.ts.template +0 -36
- package/src/init/files/src/app/core/store/app.selectors.ts.template +0 -42
- package/src/init/files/src/app/core/store/auth/auth.actions.ts.template +0 -77
- package/src/init/files/src/app/core/store/auth/auth.effects.ts.template +0 -163
- package/src/init/files/src/app/core/store/auth/auth.reducer.spec.ts.template +0 -13
- package/src/init/files/src/app/core/store/auth/auth.reducer.ts.template +0 -26
- package/src/init/files/src/app/core/store/auth/auth.selectors.ts.template +0 -25
- package/src/init/files/src/app/core/store/cached-load-connections.service.ts.template +0 -405
- package/src/init/files/src/app/core/store/cached-selectors.service.ts.template +0 -376
- package/src/init/files/src/app/core/store/effects.helpers.ts.template +0 -66
- package/src/init/files/src/app/core/store/user/user.actions.ts.template +0 -248
- package/src/init/files/src/app/core/store/user/user.effects.ts.template +0 -148
- package/src/init/files/src/app/core/store/user/user.reducer.spec.ts.template +0 -13
- package/src/init/files/src/app/core/store/user/user.reducer.ts.template +0 -50
- package/src/init/files/src/app/core/store/user/user.service.ts.template +0 -50
- package/src/init/files/src/app/core/store/user-context/user-context.actions.ts.template +0 -248
- package/src/init/files/src/app/core/store/user-context/user-context.effects.ts.template +0 -131
- package/src/init/files/src/app/core/store/user-context/user-context.reducer.spec.ts.template +0 -13
- package/src/init/files/src/app/core/store/user-context/user-context.reducer.ts.template +0 -51
- package/src/init/files/src/app/core/store/user-context/user-context.service.ts.template +0 -50
- package/src/init/files/src/app/core/utils/string-case.utils.ts.template +0 -96
- package/src/init/files/src/app/general/general-routing.module.ts.template +0 -25
- package/src/init/files/src/app/general/general.module.spec.ts.template +0 -13
- package/src/init/files/src/app/general/general.module.ts.template +0 -36
- package/src/init/files/src/app/general/home/+state/home.actions.ts.template +0 -26
- package/src/init/files/src/app/general/home/+state/home.effects.ts.template +0 -48
- package/src/init/files/src/app/general/home/+state/home.model.ts.template +0 -0
- package/src/init/files/src/app/general/home/+state/home.selectors.ts.template +0 -20
- package/src/init/files/src/app/general/home/+state/home.state.ts.template +0 -13
- package/src/init/files/src/app/general/home/home.component.html.template +0 -5
- package/src/init/files/src/app/general/home/home.component.ts.template +0 -88
- package/src/init/files/src/app/general/landing/+state/landing.actions.ts.template +0 -26
- package/src/init/files/src/app/general/landing/+state/landing.effects.ts.template +0 -48
- package/src/init/files/src/app/general/landing/+state/landing.model.ts.template +0 -0
- package/src/init/files/src/app/general/landing/+state/landing.selectors.ts.template +0 -20
- package/src/init/files/src/app/general/landing/+state/landing.state.ts.template +0 -13
- package/src/init/files/src/app/general/landing/landing.component.ts.template +0 -98
- package/src/init/files/src/app/general/login/login.component.html.template +0 -11
- package/src/init/files/src/app/general/login/login.component.ts.template +0 -80
- package/src/init/files/src/app/onboarding/consent/+state/consent.actions.ts.template +0 -23
- package/src/init/files/src/app/onboarding/consent/+state/consent.effects.ts.template +0 -47
- package/src/init/files/src/app/onboarding/consent/+state/consent.model.ts.template +0 -0
- package/src/init/files/src/app/onboarding/consent/+state/consent.selectors.ts.template +0 -20
- package/src/init/files/src/app/onboarding/consent/+state/consent.state.ts.template +0 -13
- package/src/init/files/src/app/onboarding/consent/consent.component.ts.template +0 -151
- package/src/init/files/src/app/onboarding/onboarding-routing.module.ts.template +0 -19
- package/src/init/files/src/app/onboarding/onboarding.module.spec.ts.template +0 -13
- package/src/init/files/src/app/onboarding/onboarding.module.ts.template +0 -32
- package/src/init/files/src/app/onboarding/waiting/+state/waiting.actions.ts.template +0 -26
- package/src/init/files/src/app/onboarding/waiting/+state/waiting.effects.ts.template +0 -52
- package/src/init/files/src/app/onboarding/waiting/+state/waiting.model.ts.template +0 -9
- package/src/init/files/src/app/onboarding/waiting/+state/waiting.selectors.ts.template +0 -42
- package/src/init/files/src/app/onboarding/waiting/+state/waiting.state.ts.template +0 -13
- package/src/init/files/src/app/onboarding/waiting/waiting.animations.ts.template +0 -4
- package/src/init/files/src/app/onboarding/waiting/waiting.component.html.template +0 -57
- package/src/init/files/src/app/onboarding/waiting/waiting.component.spec.ts.template +0 -25
- package/src/init/files/src/app/onboarding/waiting/waiting.component.ts.template +0 -281
- package/src/init/files/src/app/shared/components/redeployment-warning/redeployment-warning.component.html.template +0 -10
- package/src/init/files/src/app/shared/shared.module.ts.template +0 -87
- package/src/init/files/src/main.ts.template +0 -12
- package/src/module/files/__name@dasherize__/__name@dasherize__-routing.module.ts.template +0 -15
- package/src/module/files/__name@dasherize__/__name@dasherize__.module.spec.ts.template +0 -13
- package/src/module/files/__name@dasherize__/__name@dasherize__.module.ts.template +0 -24
- package/src/module/index.d.ts +0 -2
- package/src/module/index.js +0 -97
- package/src/module/index.js.map +0 -1
- package/src/module/index_spec.d.ts +0 -1
- package/src/module/index_spec.js +0 -23
- package/src/module/index_spec.js.map +0 -1
- package/src/module/schema.json +0 -38
- /package/src/init/files/src/app/{onboarding → first-time}/consent/consent.animations.ts.template +0 -0
- /package/src/init/files/src/app/{onboarding → first-time}/consent/consent.component.spec.ts.template +0 -0
- /package/src/init/files/src/app/{general → first-time}/landing/landing.animations.ts.template +0 -0
- /package/src/init/files/src/app/{general → first-time}/landing/landing.component.scss.template +0 -0
- /package/src/init/files/src/app/{general → first-time}/landing/landing.component.spec.ts.template +0 -0
- /package/src/init/files/src/app/{general → first-time}/login/login.component.scss.template +0 -0
- /package/src/init/files/src/app/{general → first-time}/login/login.component.spec.ts.template +0 -0
- /package/src/init/files/src/app/{general → main}/home/home.animations.ts.template +0 -0
- /package/src/init/files/src/app/{general → main}/home/home.component.spec.ts.template +0 -0
- /package/src/init/files/src/app/shared/{components/redeployment-warning → redeployment-warning}/redeployment-warning.component.scss.template +0 -0
- /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,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
|
-
|
|
17
|
+
// --------------- COMPUTED DATA -----------------------
|
|
13
18
|
|
|
14
|
-
|
|
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-
|
|
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[
|
|
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>
|
|
@@ -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
|
|
13
|
+
<body>
|
|
14
14
|
<app-root></app-root>
|
|
15
15
|
</body>
|
|
16
16
|
</html>
|
package/src/container/files/__name@dasherize__/+state/__name@dasherize__.actions.ts.template
DELETED
|
@@ -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;
|
package/src/container/files/__name@dasherize__/+state/__name@dasherize__.effects.ts.template
DELETED
|
@@ -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
|
-
}
|
|
File without changes
|
package/src/container/files/__name@dasherize__/+state/__name@dasherize__.selectors.ts.template
DELETED
|
@@ -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
|
-
}
|
package/src/container/files/__name@dasherize__/__name@dasherize__.component.spec.ts.template
DELETED
|
@@ -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
|
-
}
|
package/src/container/index.d.ts
DELETED