@tech4good/angular-schematics 21.5.0 → 21.7.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.
- package/CHANGELOG.md +44 -0
- package/README.md +266 -1
- package/package.json +34 -7
- package/src/component/files/__name@dasherize__/__name@dasherize__.component.spec.ts.template +4 -5
- package/src/component/files/__name@dasherize__/__name@dasherize__.component.ts.template +1 -1
- package/src/entity/files/__name@dasherize__/__name@dasherize__.mock.ts.template +16 -7
- package/src/entity/files/__name@dasherize__/__name@dasherize__.model.ts.template +13 -6
- package/src/entity/files/__name@dasherize__/__name@dasherize__.store.ts.template +18 -10
- package/src/entity/index.js +61 -49
- package/src/entity/index.js.map +1 -1
- package/src/entity/schema.json +4 -0
- package/src/guard/files/__name@dasherize__.guard.spec.ts.template +0 -1
- package/src/ng-add/files/.github/workflows/angular-github-ci.yml.template +3 -0
- package/src/ng-add/files/.gitignore.template +5 -0
- package/src/ng-add/files/analytics/datasets.js.template +206 -0
- package/src/ng-add/files/analytics/entity_sources.js.template +58 -0
- package/src/ng-add/files/analytics/entity_sources.test.js.template +57 -0
- package/src/ng-add/files/analytics/lib/api_query.js.template +87 -0
- package/src/ng-add/files/analytics/lib/api_query.test.js.template +84 -0
- package/src/ng-add/files/analytics/lib/bigquery_query_compatibility.test.js.template +53 -0
- package/src/ng-add/files/analytics/lib/dataset_schema.js.template +53 -0
- package/src/ng-add/files/analytics/lib/dataset_schema.test.js.template +34 -0
- package/src/ng-add/files/analytics/lib/entity_sync.js.template +397 -0
- package/src/ng-add/files/analytics/lib/entity_sync.test.js.template +212 -0
- package/src/ng-add/files/analytics/lib/identifier_salt.js.template +57 -0
- package/src/ng-add/files/analytics/lib/identifier_salt.test.js.template +36 -0
- package/src/ng-add/files/analytics/lib/snapshot_files.js.template +46 -0
- package/src/ng-add/files/analytics/lib/snapshot_files.test.js.template +67 -0
- package/src/ng-add/files/analytics/lib/sqlite.js.template +92 -0
- package/src/ng-add/files/analytics/lib/upload_entities.js.template +81 -0
- package/src/ng-add/files/analytics/lib/upload_entities.test.js.template +86 -0
- package/src/ng-add/files/analytics/proxy.conf.json.template +7 -0
- package/src/ng-add/files/analytics/scripts/refresh_snapshot.js.template +518 -0
- package/src/ng-add/files/analytics/scripts/start.js.template +88 -0
- package/src/ng-add/files/analytics/server/server.js.template +212 -0
- package/src/ng-add/files/angular.json.template +80 -1
- package/src/ng-add/files/bigquery/queries/active_time_by_route.sql.template +27 -8
- package/src/ng-add/files/bigquery/queries/active_user_windows.sql.template +67 -0
- package/src/ng-add/files/bigquery/queries/dashboard_route_visits.sql.template +47 -0
- package/src/ng-add/files/bigquery/queries/data_quality.sql.template +323 -0
- package/src/ng-add/files/bigquery/queries/onboarding_funnel.sql.template +512 -0
- package/src/ng-add/files/bigquery/queries/onboarding_stage_observations.sql.template +134 -0
- package/src/ng-add/files/bigquery/queries/weekly_retention_cohorts.sql.template +90 -0
- package/src/ng-add/files/bigquery/scripts/export_entities.js.template +120 -0
- package/src/ng-add/files/bigquery/scripts/init_views.js.template +57 -0
- package/src/ng-add/files/bigquery/scripts/run_query.js.template +141 -0
- package/src/ng-add/files/bigquery/views/events_flat.sql.template +27 -12
- package/src/ng-add/files/bigquery/views/logs_latest.sql.template +16 -3
- package/src/ng-add/files/docs-infra/analytics-guide.md.template +270 -25
- package/src/ng-add/files/docs-infra/analytics-workbench-guide.md.template +307 -0
- package/src/ng-add/files/docs-infra/authentication-architecture.md.template +300 -0
- package/src/ng-add/files/docs-infra/email-infrastructure.md.template +43 -0
- package/src/ng-add/files/docs-infra/firestore-index-checker.md.template +87 -0
- package/src/ng-add/files/docs-infra/infrastructure-guide.md.template +123 -38
- package/src/ng-add/files/docs-infra/load-system-architecture.md.template +15 -1
- package/src/ng-add/files/docs-infra/querying-strategy.md.template +14 -0
- package/src/ng-add/files/docs-infra/stream-system-architecture.md.template +21 -7
- package/src/ng-add/files/eslint.config.js.template +22 -3
- package/src/ng-add/files/firebase.json.template +6 -0
- package/src/ng-add/files/firestore.indexes.json.template +23 -0
- package/src/ng-add/files/firestore.rules.spec.ts.template +84 -15
- package/src/ng-add/files/firestore.rules.template +29 -17
- package/src/ng-add/files/functions/.gitignore.template +3 -0
- package/src/ng-add/files/functions/package.json.template +13 -0
- package/src/ng-add/files/functions/src/email.ts.template +23 -0
- package/src/ng-add/files/functions/src/index.ts.template +44 -0
- package/src/ng-add/files/functions/tsconfig.json.template +13 -0
- package/src/ng-add/files/jest.config.ts.template +3 -2
- package/src/ng-add/files/package.json.template +41 -16
- package/src/ng-add/files/projects/analytics/src/app/analytics-api.service.ts.template +130 -0
- package/src/ng-add/files/projects/analytics/src/app/app.component.html.template +77 -0
- package/src/ng-add/files/projects/analytics/src/app/app.component.scss.template +240 -0
- package/src/ng-add/files/projects/analytics/src/app/app.component.ts.template +96 -0
- package/src/ng-add/files/projects/analytics/src/app/app.routes.ts.template +11 -0
- package/src/ng-add/files/projects/analytics/src/app/dashboard-pages.spec.ts.template +151 -0
- package/src/ng-add/files/projects/analytics/src/app/data-quality/data-quality-page/data-quality-page.component.html.template +39 -0
- package/src/ng-add/files/projects/analytics/src/app/data-quality/data-quality-page/data-quality-page.component.scss.template +1 -0
- package/src/ng-add/files/projects/analytics/src/app/data-quality/data-quality-page/data-quality-page.component.ts.template +95 -0
- package/src/ng-add/files/projects/analytics/src/app/engagement/engagement-page/engagement-page.component.html.template +47 -0
- package/src/ng-add/files/projects/analytics/src/app/engagement/engagement-page/engagement-page.component.scss.template +1 -0
- package/src/ng-add/files/projects/analytics/src/app/engagement/engagement-page/engagement-page.component.ts.template +120 -0
- package/src/ng-add/files/projects/analytics/src/app/onboarding/onboarding-page/onboarding-page.component.html.template +40 -0
- package/src/ng-add/files/projects/analytics/src/app/onboarding/onboarding-page/onboarding-page.component.scss.template +1 -0
- package/src/ng-add/files/projects/analytics/src/app/onboarding/onboarding-page/onboarding-page.component.ts.template +98 -0
- package/src/ng-add/files/projects/analytics/src/app/overview/overview-page/overview-page.component.html.template +35 -0
- package/src/ng-add/files/projects/analytics/src/app/overview/overview-page/overview-page.component.scss.template +1 -0
- package/src/ng-add/files/projects/analytics/src/app/overview/overview-page/overview-page.component.ts.template +84 -0
- package/src/ng-add/files/projects/analytics/src/app/routes/routes-page/routes-page.component.html.template +42 -0
- package/src/ng-add/files/projects/analytics/src/app/routes/routes-page/routes-page.component.scss.template +1 -0
- package/src/ng-add/files/projects/analytics/src/app/routes/routes-page/routes-page.component.ts.template +110 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/analytics-utils.ts.template +43 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/chart-theme.ts.template +42 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/dashboard-layout.scss.template +239 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/dashboard-table/dashboard-table.component.html.template +76 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/dashboard-table/dashboard-table.component.scss.template +128 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/dashboard-table/dashboard-table.component.spec.ts.template +31 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/dashboard-table/dashboard-table.component.ts.template +153 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/funnel-chart/funnel-chart.component.html.template +16 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/funnel-chart/funnel-chart.component.scss.template +63 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/funnel-chart/funnel-chart.component.ts.template +52 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/metric-card/metric-card.component.html.template +5 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/metric-card/metric-card.component.scss.template +56 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/metric-card/metric-card.component.spec.ts.template +30 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/metric-card/metric-card.component.ts.template +15 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/quality-chart/quality-chart.component.html.template +9 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/quality-chart/quality-chart.component.scss.template +43 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/quality-chart/quality-chart.component.ts.template +62 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/route-distribution-chart/route-distribution-chart.component.html.template +9 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/route-distribution-chart/route-distribution-chart.component.scss.template +33 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/route-distribution-chart/route-distribution-chart.component.ts.template +82 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/route-traffic-chart/route-traffic-chart.component.html.template +15 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/route-traffic-chart/route-traffic-chart.component.scss.template +45 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/route-traffic-chart/route-traffic-chart.component.ts.template +55 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/status-message/status-message.component.html.template +18 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/status-message/status-message.component.scss.template +45 -0
- package/src/ng-add/files/projects/analytics/src/app/shared/status-message/status-message.component.ts.template +15 -0
- package/src/ng-add/files/projects/analytics/src/app/vega-chart/vega-chart.component.ts.template +121 -0
- package/src/ng-add/files/projects/analytics/src/index.html.template +19 -0
- package/src/ng-add/files/projects/analytics/src/main.ts.template +16 -0
- package/src/ng-add/files/projects/analytics/src/styles.scss.template +28 -0
- package/src/ng-add/files/projects/analytics/tsconfig.app.json.template +13 -0
- package/src/ng-add/files/projects/analytics/tsconfig.spec.json.template +15 -0
- package/src/ng-add/files/src/app/admin/admin-panel/admin-panel.component.html.template +3 -1
- package/src/ng-add/files/src/app/admin/admin-panel/admin-panel.component.spec.ts.template +10 -13
- package/src/ng-add/files/src/app/admin/admin-panel/admin-panel.component.ts.template +2 -0
- package/src/ng-add/files/src/app/admin/admin-panel/admin-settings/admin-settings.component.spec.ts.template +4 -5
- package/src/ng-add/files/src/app/admin/admin-panel/admin-user-list/admin-user-list.component.spec.ts.template +11 -12
- package/src/ng-add/files/src/app/admin/admin-panel/admin-user-list/admin-user-list.component.ts.template +7 -7
- package/src/ng-add/files/src/app/admin/admin-panel/admin-user-list/admin-user-table/admin-user-table.component.spec.ts.template +8 -10
- package/src/ng-add/files/src/app/admin/admin-panel/admin-user-list/admin-user-table/admin-user-table.component.ts.template +3 -2
- package/src/ng-add/files/src/app/app.component.html.template +3 -3
- package/src/ng-add/files/src/app/app.component.scss.template +1 -1
- package/src/ng-add/files/src/app/app.component.spec.ts.template +4 -5
- package/src/ng-add/files/src/app/app.component.ts.template +3 -2
- package/src/ng-add/files/src/app/app.config.ts.template +21 -15
- package/src/ng-add/files/src/app/app.routes.ts.template +6 -0
- package/src/ng-add/files/src/app/auth-routing.spec.ts.template +13 -9
- package/src/ng-add/files/src/app/core/analytics/time-analytics.service.spec.ts.template +46 -29
- package/src/ng-add/files/src/app/core/analytics/time-analytics.service.ts.template +27 -18
- package/src/ng-add/files/src/app/core/auth/auth.providers.spec.ts.template +112 -0
- package/src/ng-add/files/src/app/core/auth/auth.providers.ts.template +48 -0
- package/src/ng-add/files/src/app/core/auth/auth.service.ts.template +14 -23
- package/src/ng-add/files/src/app/core/auth/guards/require-admin.guard.spec.ts.template +27 -0
- package/src/ng-add/files/src/app/core/auth/guards/require-admin.guard.ts.template +3 -2
- package/src/ng-add/files/src/app/core/auth/guards/require-auth-and-consent.guard.ts.template +7 -2
- package/src/ng-add/files/src/app/core/firebase/data.providers.prod.ts.template +21 -0
- package/src/ng-add/files/src/app/core/firebase/data.providers.ts.template +13 -0
- package/src/ng-add/files/src/app/core/local-storage/session.service.spec.ts.template +43 -0
- package/src/ng-add/files/src/app/core/local-storage/session.service.ts.template +7 -0
- package/src/ng-add/files/src/app/core/store/app-data.spec.ts.template +76 -0
- package/src/ng-add/files/src/app/core/store/auth/auth.mock.ts.template +20 -82
- package/src/ng-add/files/src/app/core/store/auth/auth.store.spec.ts.template +217 -0
- package/src/ng-add/files/src/app/core/store/auth/auth.store.ts.template +36 -172
- package/src/ng-add/files/src/app/core/store/user/user.mock.ts.template +18 -15
- package/src/ng-add/files/src/app/core/store/user/user.model.ts.template +7 -8
- package/src/ng-add/files/src/app/core/store/user/user.store.ts.template +14 -10
- package/src/ng-add/files/src/app/core/store/user-context/user-context.mock.ts.template +20 -8
- package/src/ng-add/files/src/app/core/store/user-context/user-context.model.ts.template +5 -6
- package/src/ng-add/files/src/app/core/store/user-context/user-context.store.ts.template +14 -10
- package/src/ng-add/files/src/app/core/store/user-private/user-private.mock.ts.template +20 -7
- package/src/ng-add/files/src/app/core/store/user-private/user-private.model.ts.template +6 -6
- package/src/ng-add/files/src/app/core/store/user-private/user-private.store.ts.template +14 -10
- package/src/ng-add/files/src/app/core/testing/app-mocks.ts.template +42 -0
- package/src/ng-add/files/src/app/first-time/auth-action/auth-action.component.html.template +4 -0
- package/src/ng-add/files/src/app/first-time/auth-action/auth-action.component.scss.template +1 -0
- package/src/ng-add/files/src/app/first-time/auth-action/auth-action.component.ts.template +38 -0
- package/src/ng-add/files/src/app/first-time/consent/consent.component.html.template +2 -1
- package/src/ng-add/files/src/app/first-time/consent/consent.component.scss.template +7 -3
- package/src/ng-add/files/src/app/first-time/consent/consent.component.spec.ts.template +31 -11
- package/src/ng-add/files/src/app/first-time/consent/consent.component.ts.template +16 -1
- package/src/ng-add/files/src/app/first-time/consent/consent.guard.ts.template +5 -1
- package/src/ng-add/files/src/app/first-time/early-access/early-access.component.spec.ts.template +27 -16
- package/src/ng-add/files/src/app/first-time/early-access/early-access.component.ts.template +102 -49
- package/src/ng-add/files/src/app/first-time/early-access/early-access.guard.ts.template +5 -1
- package/src/ng-add/files/src/app/first-time/early-access/survey-form/survey-form.component.html.template +2 -1
- package/src/ng-add/files/src/app/first-time/early-access/survey-form/survey-form.component.scss.template +7 -3
- package/src/ng-add/files/src/app/first-time/early-access/survey-form/survey-form.component.spec.ts.template +20 -6
- package/src/ng-add/files/src/app/first-time/early-access/survey-form/survey-form.component.ts.template +2 -0
- package/src/ng-add/files/src/app/first-time/early-access/waitlist-view/waitlist-view.component.spec.ts.template +4 -5
- package/src/ng-add/files/src/app/first-time/email-link/email-link.component.html.template +18 -0
- package/src/ng-add/files/src/app/first-time/email-link/email-link.component.scss.template +2 -0
- package/src/ng-add/files/src/app/first-time/email-link/email-link.component.spec.ts.template +56 -0
- package/src/ng-add/files/src/app/first-time/email-link/email-link.component.ts.template +91 -0
- package/src/ng-add/files/src/app/first-time/first-time-routing.spec.ts.template +11 -7
- package/src/ng-add/files/src/app/first-time/landing/hero/hero.component.html.template +19 -7
- package/src/ng-add/files/src/app/first-time/landing/hero/hero.component.scss.template +51 -0
- package/src/ng-add/files/src/app/first-time/landing/hero/hero.component.ts.template +44 -5
- package/src/ng-add/files/src/app/first-time/landing/landing.component.html.template +2 -1
- package/src/ng-add/files/src/app/first-time/landing/landing.component.scss.template +12 -8
- package/src/ng-add/files/src/app/first-time/landing/landing.component.spec.ts.template +33 -10
- package/src/ng-add/files/src/app/first-time/landing/landing.component.ts.template +6 -19
- package/src/ng-add/files/src/app/first-time/login/login.component.html.template +58 -6
- package/src/ng-add/files/src/app/first-time/login/login.component.scss.template +151 -22
- package/src/ng-add/files/src/app/first-time/login/login.component.spec.ts.template +30 -32
- package/src/ng-add/files/src/app/first-time/login/login.component.ts.template +85 -31
- package/src/ng-add/files/src/app/first-time/onboarding/onboarding.component.spec.ts.template +4 -2
- package/src/ng-add/files/src/app/first-time/onboarding/onboarding.component.ts.template +1 -1
- package/src/ng-add/files/src/app/main/account-profile/account-profile.component.html.template +12 -0
- package/src/ng-add/files/src/app/main/account-profile/account-profile.component.scss.template +39 -0
- package/src/ng-add/files/src/app/main/account-profile/account-profile.component.spec.ts.template +68 -0
- package/src/ng-add/files/src/app/main/account-profile/account-profile.component.ts.template +20 -0
- package/src/ng-add/files/src/app/main/account-profile/delete-guest-card/delete-guest-card.component.html.template +24 -0
- package/src/ng-add/files/src/app/main/account-profile/delete-guest-card/delete-guest-card.component.scss.template +50 -0
- package/src/ng-add/files/src/app/main/account-profile/delete-guest-card/delete-guest-card.component.spec.ts.template +65 -0
- package/src/ng-add/files/src/app/main/account-profile/delete-guest-card/delete-guest-card.component.ts.template +59 -0
- package/src/ng-add/files/src/app/main/account-profile/guest-deletion-dialog.component.ts.template +51 -0
- package/src/ng-add/files/src/app/main/account-profile/profile-details-card/profile-details-card.component.html.template +50 -0
- package/src/ng-add/files/src/app/main/account-profile/profile-details-card/profile-details-card.component.scss.template +137 -0
- package/src/ng-add/files/src/app/main/account-profile/profile-details-card/profile-details-card.component.spec.ts.template +57 -0
- package/src/ng-add/files/src/app/main/account-profile/profile-details-card/profile-details-card.component.ts.template +59 -0
- package/src/ng-add/files/src/app/main/account-profile/sign-in-methods-card/sign-in-methods-card.component.html.template +133 -0
- package/src/ng-add/files/src/app/main/account-profile/sign-in-methods-card/sign-in-methods-card.component.scss.template +207 -0
- package/src/ng-add/files/src/app/main/account-profile/sign-in-methods-card/sign-in-methods-card.component.spec.ts.template +74 -0
- package/src/ng-add/files/src/app/main/account-profile/sign-in-methods-card/sign-in-methods-card.component.ts.template +130 -0
- package/src/ng-add/files/src/app/main/home/home.component.spec.ts.template +4 -5
- package/src/ng-add/files/src/app/main/home/home.component.ts.template +1 -6
- package/src/ng-add/files/src/app/shared/guest-warning-bar/guest-warning-bar.component.html.template +15 -0
- package/src/ng-add/files/src/app/shared/guest-warning-bar/guest-warning-bar.component.scss.template +79 -0
- package/src/ng-add/files/src/app/shared/guest-warning-bar/guest-warning-bar.component.spec.ts.template +59 -0
- package/src/ng-add/files/src/app/shared/guest-warning-bar/guest-warning-bar.component.ts.template +44 -0
- package/src/ng-add/files/src/app/shared/navbar/navbar.component.html.template +45 -15
- package/src/ng-add/files/src/app/shared/navbar/navbar.component.scss.template +103 -19
- package/src/ng-add/files/src/app/shared/navbar/navbar.component.spec.ts.template +73 -9
- package/src/ng-add/files/src/app/shared/navbar/navbar.component.ts.template +46 -18
- package/src/ng-add/files/src/environments/environment.prod.ts.template +1 -0
- package/src/ng-add/files/src/environments/environment.test.ts.template +1 -0
- package/src/ng-add/files/src/environments/environment.ts.template +1 -1
- package/src/ng-add/files/tsconfig.spec.json.template +3 -1
- package/src/ng-add/index.js +7 -0
- package/src/ng-add/index.js.map +1 -1
- package/src/shared/entity-registry.d.ts +8 -0
- package/src/shared/entity-registry.js +28 -0
- package/src/shared/entity-registry.js.map +1 -0
- package/tsconfig.json +2 -2
- package/.agents/skills/publish-npm/SKILL.md +0 -37
- package/.agents/skills/publish-npm/eval.yaml +0 -32
- package/.agents/skills/publish-npm/fixtures/package-v21.json.template +0 -8
- package/.husky/commit-msg +0 -1
- package/.husky/pre-commit +0 -1
- package/.t4g/agent-memory.db +0 -0
- package/src/component/index_spec.d.ts +0 -1
- package/src/component/index_spec.js +0 -68
- package/src/component/index_spec.js.map +0 -1
- package/src/entity/index_spec.d.ts +0 -1
- package/src/entity/index_spec.js +0 -153
- package/src/entity/index_spec.js.map +0 -1
- package/src/guard/index_spec.d.ts +0 -1
- package/src/guard/index_spec.js +0 -64
- package/src/guard/index_spec.js.map +0 -1
- package/src/ng-add/files/bigquery/scripts/export_entities.py.template +0 -143
- package/src/ng-add/files/bigquery/scripts/run_query.py.template +0 -167
- package/src/ng-add/files/src/app/core/firebase/cached-listeners.service.ts.template +0 -494
- package/src/ng-add/files/src/app/core/firebase/database.service.ts.template +0 -56
- package/src/ng-add/files/src/app/core/firebase/firebase.mock.service.ts.template +0 -366
- package/src/ng-add/files/src/app/core/firebase/firebase.service.ts.template +0 -342
- package/src/ng-add/files/src/app/core/firebase/simulate-load.spec.ts.template +0 -104
- package/src/ng-add/files/src/app/core/firebase/simulate-stream.spec.ts.template +0 -127
- package/src/ng-add/files/src/app/core/firebase/simulation.mock.ts.template +0 -38
- package/src/ng-add/files/src/app/core/firebase/stream-multiplexer.ts.template +0 -445
- package/src/ng-add/files/src/app/core/logging/logging.service.spec.ts.template +0 -118
- package/src/ng-add/files/src/app/core/logging/logging.service.ts.template +0 -168
- package/src/ng-add/files/src/app/core/store/app.model.ts.template +0 -21
- package/src/ng-add/files/src/app/core/store/app.store.spec.ts.template +0 -920
- package/src/ng-add/files/src/app/core/store/app.store.ts.template +0 -1317
- package/src/ng-add/files/src/app/core/store/batch-write.firebase.service.ts.template +0 -58
- package/src/ng-add/files/src/app/core/store/batch-write.mock.service.ts.template +0 -105
- package/src/ng-add/files/src/app/core/store/batch-write.service.ts.template +0 -126
- package/src/ng-add/files/src/app/shared/redeployment-warning/redeployment-warning.component.html.template +0 -9
- package/src/ng-add/files/src/app/shared/redeployment-warning/redeployment-warning.component.scss.template +0 -46
- package/src/ng-add/files/src/app/shared/redeployment-warning/redeployment-warning.component.spec.ts.template +0 -69
- package/src/ng-add/files/src/app/shared/redeployment-warning/redeployment-warning.component.ts.template +0 -39
- package/src/ng-add/files/src/app/shared/redeployment-warning/redeployment-warning.service.spec.ts.template +0 -122
- package/src/ng-add/files/src/app/shared/redeployment-warning/redeployment-warning.service.ts.template +0 -88
|
@@ -37,6 +37,18 @@
|
|
|
37
37
|
margin-bottom: 40px;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
.cta-actions {
|
|
41
|
+
display: flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
justify-content: center;
|
|
44
|
+
gap: 16px;
|
|
45
|
+
flex-wrap: wrap;
|
|
46
|
+
|
|
47
|
+
@media (min-width: 900px) {
|
|
48
|
+
justify-content: flex-start;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
40
52
|
.cta-button {
|
|
41
53
|
background-color: #0E7490;
|
|
42
54
|
color: #FFFFFF;
|
|
@@ -51,6 +63,7 @@
|
|
|
51
63
|
display: inline-flex;
|
|
52
64
|
align-items: center;
|
|
53
65
|
gap: 8px;
|
|
66
|
+
text-decoration: none;
|
|
54
67
|
|
|
55
68
|
&:hover:not(:disabled) {
|
|
56
69
|
background-color: #155E75;
|
|
@@ -73,6 +86,35 @@
|
|
|
73
86
|
stroke: #FFFFFF !important;
|
|
74
87
|
}
|
|
75
88
|
}
|
|
89
|
+
|
|
90
|
+
.try-guest {
|
|
91
|
+
display: inline-flex;
|
|
92
|
+
align-items: center;
|
|
93
|
+
gap: 8px;
|
|
94
|
+
margin: 0;
|
|
95
|
+
padding: 12px 16px;
|
|
96
|
+
border: 1px solid transparent;
|
|
97
|
+
border-radius: 8px;
|
|
98
|
+
background: transparent;
|
|
99
|
+
color: #0e7490;
|
|
100
|
+
cursor: pointer;
|
|
101
|
+
font: inherit;
|
|
102
|
+
font-weight: 600;
|
|
103
|
+
|
|
104
|
+
&:hover:not(:disabled) {
|
|
105
|
+
background-color: rgba(14, 116, 144, 0.08);
|
|
106
|
+
color: #155e75;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
&:disabled {
|
|
110
|
+
opacity: 0.65;
|
|
111
|
+
cursor: wait;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.spinner-icon {
|
|
115
|
+
animation: spin 0.8s linear infinite;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
76
118
|
}
|
|
77
119
|
|
|
78
120
|
.hero-visual {
|
|
@@ -90,3 +132,12 @@
|
|
|
90
132
|
}
|
|
91
133
|
}
|
|
92
134
|
}
|
|
135
|
+
|
|
136
|
+
@keyframes spin {
|
|
137
|
+
from {
|
|
138
|
+
transform: rotate(0deg);
|
|
139
|
+
}
|
|
140
|
+
to {
|
|
141
|
+
transform: rotate(360deg);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
@@ -1,20 +1,59 @@
|
|
|
1
|
-
import { Component, ChangeDetectionStrategy,
|
|
2
|
-
import {
|
|
1
|
+
import { Component, ChangeDetectionStrategy, inject, input, signal } from '@angular/core';
|
|
2
|
+
import { Router } from '@angular/router';
|
|
3
3
|
import { RotatingQuotesComponent } from '../rotating-quotes/rotating-quotes.component';
|
|
4
|
+
import { AuthStore } from 'src/app/core/store/auth/auth.store';
|
|
5
|
+
import { TimeAnalyticsService } from 'src/app/core/analytics/time-analytics.service';
|
|
4
6
|
|
|
5
7
|
@Component({
|
|
6
8
|
selector: 'app-hero',
|
|
7
9
|
templateUrl: './hero.component.html',
|
|
8
10
|
styleUrl: './hero.component.scss',
|
|
9
11
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
10
|
-
imports: [RotatingQuotesComponent
|
|
12
|
+
imports: [RotatingQuotesComponent],
|
|
11
13
|
})
|
|
12
14
|
export class HeroComponent {
|
|
15
|
+
private readonly authStore = inject(AuthStore);
|
|
16
|
+
private readonly router = inject(Router);
|
|
17
|
+
private readonly analytics = inject(TimeAnalyticsService);
|
|
18
|
+
|
|
13
19
|
readonly sentences = [
|
|
14
20
|
'First generic placeholder quote.',
|
|
15
21
|
'Second generic placeholder quote.',
|
|
16
22
|
'Third generic placeholder quote.',
|
|
17
23
|
];
|
|
18
|
-
|
|
19
|
-
|
|
24
|
+
showGuestLogin = input<boolean>(true);
|
|
25
|
+
|
|
26
|
+
readonly isGuestLoading = signal(false);
|
|
27
|
+
|
|
28
|
+
onGetStarted(event: Event) {
|
|
29
|
+
event.preventDefault();
|
|
30
|
+
setTimeout(() => {
|
|
31
|
+
this.router.navigate(['/login']);
|
|
32
|
+
}, 0);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async tryWithoutLoggingIn() {
|
|
36
|
+
if (this.isGuestLoading()) return;
|
|
37
|
+
this.isGuestLoading.set(true);
|
|
38
|
+
this.analytics.trackInteraction('onboarding', 'auth_attempt', {
|
|
39
|
+
method: 'guest',
|
|
40
|
+
});
|
|
41
|
+
try {
|
|
42
|
+
await this.authStore.loginAnonymously();
|
|
43
|
+
this.analytics.trackInteraction('onboarding', 'auth_result', {
|
|
44
|
+
method: 'guest',
|
|
45
|
+
outcome: 'success',
|
|
46
|
+
authenticatedUserId: this.authStore.user()?.__id,
|
|
47
|
+
accessState: this.authStore.user()?.accessState,
|
|
48
|
+
});
|
|
49
|
+
await this.router.navigate(['/home']);
|
|
50
|
+
} catch (error) {
|
|
51
|
+
console.error('[HeroComponent] Guest login failed:', error);
|
|
52
|
+
this.analytics.trackInteraction('onboarding', 'auth_result', {
|
|
53
|
+
method: 'guest',
|
|
54
|
+
outcome: 'error',
|
|
55
|
+
});
|
|
56
|
+
this.isGuestLoading.set(false);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
20
59
|
}
|
|
@@ -1,15 +1,19 @@
|
|
|
1
|
+
@use 'variables' as *;
|
|
2
|
+
|
|
1
3
|
:host {
|
|
2
4
|
display: block;
|
|
3
5
|
font-family: 'Inter', sans-serif;
|
|
4
6
|
color: #303030;
|
|
5
7
|
line-height: 1.6;
|
|
8
|
+
min-height: 100vh;
|
|
9
|
+
background: $bg-primary;
|
|
10
|
+
}
|
|
6
11
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
12
|
+
.landing-container {
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
align-items: center;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
min-height: calc(100vh - 70px);
|
|
18
|
+
width: 100%;
|
|
15
19
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { render, screen } from '@testing-library/angular';
|
|
2
2
|
import userEvent from '@testing-library/user-event';
|
|
3
3
|
import { Provider } from '@angular/core';
|
|
4
|
+
import { provideRouter, Router } from '@angular/router';
|
|
4
5
|
|
|
5
6
|
import { LandingComponent } from './landing.component';
|
|
6
7
|
import { AuthStore } from 'src/app/core/store/auth/auth.store';
|
|
7
8
|
import { AuthMockDB } from 'src/app/core/store/auth/auth.mock';
|
|
9
|
+
import { TimeAnalyticsService } from 'src/app/core/analytics/time-analytics.service';
|
|
8
10
|
|
|
9
11
|
/** Sets up the testing environment for LandingComponent using render. */
|
|
10
12
|
async function setup(providers: Provider[] = []) {
|
|
@@ -12,7 +14,12 @@ async function setup(providers: Provider[] = []) {
|
|
|
12
14
|
|
|
13
15
|
const view = await render(LandingComponent, {
|
|
14
16
|
providers: [
|
|
17
|
+
provideRouter([
|
|
18
|
+
{ path: 'login', component: LandingComponent },
|
|
19
|
+
{ path: 'home', component: LandingComponent },
|
|
20
|
+
]),
|
|
15
21
|
{ provide: AuthStore, useClass: AuthMockDB },
|
|
22
|
+
{ provide: TimeAnalyticsService, useValue: { trackInteraction: jest.fn() } },
|
|
16
23
|
...providers,
|
|
17
24
|
],
|
|
18
25
|
});
|
|
@@ -20,26 +27,42 @@ async function setup(providers: Provider[] = []) {
|
|
|
20
27
|
return {
|
|
21
28
|
user,
|
|
22
29
|
fixture: view.fixture,
|
|
30
|
+
component: view.fixture.componentInstance,
|
|
23
31
|
authStore: view.fixture.debugElement.injector.get(AuthStore),
|
|
24
32
|
};
|
|
25
33
|
}
|
|
26
34
|
|
|
27
35
|
describe('LandingComponent', () => {
|
|
28
|
-
it('should render
|
|
29
|
-
const { user,
|
|
36
|
+
it('should render landing title and navigate to /login when Get Started is clicked', async () => {
|
|
37
|
+
const { user, fixture } = await setup();
|
|
30
38
|
|
|
31
|
-
// Verify title is rendered
|
|
32
39
|
expect(screen.getByRole('heading', { name: /Your Value Proposition Here/i })).toBeVisible();
|
|
33
40
|
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
// Click the Sign Up CTA button
|
|
38
|
-
const ctaBtn = screen.getByRole('button', { name: /Sign Up to Join/i });
|
|
41
|
+
const navigateSpy = jest.spyOn(fixture.debugElement.injector.get(Router), 'navigate');
|
|
42
|
+
const ctaBtn = screen.getByRole('link', { name: /Get started/i });
|
|
39
43
|
await user.click(ctaBtn);
|
|
40
44
|
|
|
41
|
-
expect(
|
|
45
|
+
expect(navigateSpy).toHaveBeenCalledWith(['/login']);
|
|
46
|
+
navigateSpy.mockRestore();
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it('should hide guest login button when showGuestLogin is false (hasWaitlist = true)', async () => {
|
|
50
|
+
const { component, fixture } = await setup();
|
|
51
|
+
component.showGuestLogin.set(false);
|
|
52
|
+
fixture.detectChanges();
|
|
53
|
+
expect(screen.queryByRole('button', { name: /try without logging in/i })).toBeNull();
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it('should show guest login button and sign in anonymously when showGuestLogin is true (hasWaitlist = false)', async () => {
|
|
57
|
+
const { user, fixture, component, authStore } = await setup();
|
|
58
|
+
component.showGuestLogin.set(true);
|
|
59
|
+
fixture.detectChanges();
|
|
60
|
+
|
|
61
|
+
const guestSpy = jest.spyOn(authStore, 'loginAnonymously');
|
|
62
|
+
const guestBtn = screen.getByRole('button', { name: /try without logging in/i });
|
|
63
|
+
expect(guestBtn).toBeVisible();
|
|
42
64
|
|
|
43
|
-
|
|
65
|
+
await user.click(guestBtn);
|
|
66
|
+
expect(guestSpy).toHaveBeenCalled();
|
|
44
67
|
});
|
|
45
68
|
});
|
|
@@ -1,37 +1,24 @@
|
|
|
1
|
-
import { Component, ChangeDetectionStrategy, inject, Signal,
|
|
1
|
+
import { Component, ChangeDetectionStrategy, inject, Signal, signal } from '@angular/core';
|
|
2
2
|
|
|
3
3
|
import { User } from 'src/app/core/store/user/user.model';
|
|
4
4
|
import { AuthStore } from 'src/app/core/store/auth/auth.store';
|
|
5
|
+
import { NavbarComponent } from 'src/app/shared/navbar/navbar.component';
|
|
5
6
|
import { HeroComponent } from './hero/hero.component';
|
|
7
|
+
import { environment } from 'src/environments/environment';
|
|
6
8
|
|
|
7
9
|
@Component({
|
|
8
10
|
selector: 'app-landing',
|
|
9
11
|
templateUrl: './landing.component.html',
|
|
10
12
|
styleUrl: './landing.component.scss',
|
|
11
13
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
12
|
-
imports: [HeroComponent],
|
|
14
|
+
imports: [NavbarComponent, HeroComponent],
|
|
13
15
|
})
|
|
14
16
|
export class LandingComponent {
|
|
15
17
|
readonly authStore = inject(AuthStore);
|
|
16
18
|
|
|
17
|
-
// --------------- INPUTS AND OUTPUTS ------------------
|
|
18
|
-
|
|
19
19
|
/** The current signed in user. */
|
|
20
20
|
currentUser: Signal<User> = this.authStore.user;
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
// --------------- EVENT HANDLING ----------------------
|
|
25
|
-
|
|
26
|
-
/** Login the user. */
|
|
27
|
-
login() {
|
|
28
|
-
this.authStore.login('google.com');
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// --------------- OTHER -------------------------------
|
|
32
|
-
|
|
33
|
-
constructor(
|
|
34
|
-
private injector: Injector,
|
|
35
|
-
) {
|
|
36
|
-
}
|
|
22
|
+
/** Whether guest login link is shown (only when environment.hasWaitlist is false). */
|
|
23
|
+
readonly showGuestLogin = signal(!environment.hasWaitlist);
|
|
37
24
|
}
|
|
@@ -1,10 +1,62 @@
|
|
|
1
1
|
<div class="login-container">
|
|
2
|
-
@if (
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
@if (!sentEmail()) {
|
|
3
|
+
<div class="login-card">
|
|
4
|
+
<h1>Welcome to <%= classify(project) %></h1>
|
|
5
|
+
<p>Sign in or create your account with a secure magic link.</p>
|
|
6
|
+
|
|
7
|
+
<form (submit)="sendMagicLink(); $event.preventDefault()">
|
|
8
|
+
<mat-form-field appearance="outline" class="full-width">
|
|
9
|
+
<mat-label>Email</mat-label>
|
|
10
|
+
<input matInput type="email" placeholder="Email*" [formField]="form.email" autocomplete="email" />
|
|
11
|
+
@if (form.email().touched() && form.email().invalid()) {
|
|
12
|
+
<mat-error>Please enter a valid email address</mat-error>
|
|
13
|
+
}
|
|
14
|
+
</mat-form-field>
|
|
15
|
+
|
|
16
|
+
<button mat-raised-button color="primary" class="btn-continue" type="submit" [disabled]="isLoading()">
|
|
17
|
+
@if (isSendingMagicLink()) {
|
|
18
|
+
<mat-spinner diameter="20" />
|
|
19
|
+
} @else {
|
|
20
|
+
<span>Send me a magic link</span>
|
|
21
|
+
}
|
|
22
|
+
</button>
|
|
23
|
+
</form>
|
|
24
|
+
|
|
25
|
+
<div class="divider"><span>or</span></div>
|
|
26
|
+
|
|
27
|
+
<button mat-stroked-button type="button" class="btn-google" (click)="signInWithGoogle()" [disabled]="isLoading()">
|
|
28
|
+
@if (isSigningInGoogle()) {
|
|
29
|
+
<mat-spinner diameter="18" class="google-spinner" />
|
|
30
|
+
<span>Signing in...</span>
|
|
31
|
+
} @else {
|
|
32
|
+
<svg viewBox="0 0 24 24" width="18" height="18" aria-hidden="true">
|
|
33
|
+
<path fill="#4285F4" d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"/>
|
|
34
|
+
<path fill="#34A853" d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"/>
|
|
35
|
+
<path fill="#FBBC05" d="M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.06H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.94l2.85-2.22.81-.63z"/>
|
|
36
|
+
<path fill="#EA4335" d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.06l3.66 2.84c.87-2.6 3.3-4.52 6.16-4.52z"/>
|
|
37
|
+
</svg>
|
|
38
|
+
<span>Continue with Google</span>
|
|
39
|
+
}
|
|
40
|
+
</button>
|
|
41
|
+
|
|
42
|
+
@if (message()) {
|
|
43
|
+
<div class="invalid" role="alert">{{ message() }}</div>
|
|
44
|
+
}
|
|
45
|
+
</div>
|
|
6
46
|
} @else {
|
|
7
|
-
<
|
|
8
|
-
|
|
47
|
+
<div class="message-container">
|
|
48
|
+
<div class="image-wrapper">
|
|
49
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 24 24" fill="none" stroke="#22c55e" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
50
|
+
<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path>
|
|
51
|
+
<polyline points="22 4 12 14.01 9 11.01"></polyline>
|
|
52
|
+
</svg>
|
|
53
|
+
</div>
|
|
54
|
+
<h2 class="title">Magic Link Sent</h2>
|
|
55
|
+
<p class="description">
|
|
56
|
+
An email has been sent to <strong>{{ loginModel().email }}</strong>. Please click the link in the email to sign in.
|
|
57
|
+
<br/><br/>
|
|
58
|
+
Don't see the email? Check your spam or junk folder.
|
|
59
|
+
</p>
|
|
60
|
+
</div>
|
|
9
61
|
}
|
|
10
62
|
</div>
|
|
@@ -1,29 +1,158 @@
|
|
|
1
|
+
@use 'variables' as *;
|
|
2
|
+
|
|
1
3
|
.login-container {
|
|
2
|
-
max-width: 430px;
|
|
3
|
-
padding: 40px 0;
|
|
4
4
|
display: flex;
|
|
5
|
-
flex-direction: column;
|
|
6
|
-
align-items: center;
|
|
7
5
|
justify-content: center;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
background: #
|
|
6
|
+
align-items: center;
|
|
7
|
+
min-height: 100vh;
|
|
8
|
+
padding: 0 20px;
|
|
9
|
+
background: $bg-primary;
|
|
10
|
+
|
|
11
|
+
.login-card {
|
|
12
|
+
padding: 36px 32px;
|
|
13
|
+
width: 100%;
|
|
14
|
+
max-width: 400px;
|
|
15
|
+
background-color: #fff;
|
|
16
|
+
border-radius: 8px;
|
|
17
|
+
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
|
|
18
|
+
text-align: center;
|
|
19
|
+
|
|
20
|
+
h1 {
|
|
21
|
+
margin: 0 0 8px;
|
|
22
|
+
color: #1e1b4b;
|
|
23
|
+
font-size: 22px;
|
|
24
|
+
font-weight: 600;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
p {
|
|
28
|
+
margin: 0 0 28px;
|
|
29
|
+
color: #757575;
|
|
30
|
+
font-size: 15px;
|
|
31
|
+
line-height: 1.4;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
mat-form-field.full-width {
|
|
35
|
+
width: 100%;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.invalid {
|
|
39
|
+
display: block;
|
|
40
|
+
width: 100%;
|
|
41
|
+
margin-top: 12px;
|
|
42
|
+
color: rgb(235, 87, 87);
|
|
43
|
+
font-size: 0.95rem;
|
|
44
|
+
text-align: center;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.btn-continue {
|
|
48
|
+
display: flex;
|
|
49
|
+
align-items: center;
|
|
50
|
+
justify-content: center;
|
|
51
|
+
width: 100%;
|
|
52
|
+
height: 44px;
|
|
53
|
+
margin-top: 18px;
|
|
54
|
+
padding: 12px;
|
|
55
|
+
border: 0;
|
|
56
|
+
border-radius: 20px;
|
|
57
|
+
background-color: #0062d2;
|
|
58
|
+
color: #fff;
|
|
59
|
+
cursor: pointer;
|
|
60
|
+
font-size: 1rem;
|
|
61
|
+
|
|
62
|
+
&:disabled {
|
|
63
|
+
background-color: #e0e0e0;
|
|
64
|
+
color: #9e9e9e;
|
|
65
|
+
cursor: not-allowed;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
::ng-deep mat-spinner circle {
|
|
69
|
+
stroke: #fff !important;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.divider {
|
|
74
|
+
display: flex;
|
|
75
|
+
align-items: center;
|
|
76
|
+
gap: 12px;
|
|
77
|
+
margin: 20px 0;
|
|
78
|
+
color: #757575;
|
|
79
|
+
font-size: 14px;
|
|
80
|
+
|
|
81
|
+
&::before,
|
|
82
|
+
&::after {
|
|
83
|
+
flex: 1;
|
|
84
|
+
border-top: 1px solid #ddd;
|
|
85
|
+
content: '';
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.btn-google {
|
|
90
|
+
display: flex;
|
|
91
|
+
align-items: center;
|
|
92
|
+
justify-content: center;
|
|
93
|
+
width: 100%;
|
|
94
|
+
height: 44px;
|
|
95
|
+
border: 1px solid #757575;
|
|
96
|
+
border-radius: 20px;
|
|
97
|
+
background-color: #fff;
|
|
98
|
+
color: #0062d2;
|
|
99
|
+
cursor: pointer;
|
|
100
|
+
font-size: 14px;
|
|
101
|
+
font-weight: 500;
|
|
102
|
+
|
|
103
|
+
::ng-deep .mdc-button__label {
|
|
104
|
+
display: inline-flex !important;
|
|
105
|
+
align-items: center !important;
|
|
106
|
+
justify-content: center !important;
|
|
107
|
+
gap: 10px !important;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
svg {
|
|
111
|
+
display: block;
|
|
112
|
+
flex-shrink: 0;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
::ng-deep mat-spinner.google-spinner circle {
|
|
116
|
+
stroke: #0062d2 !important;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
&:disabled {
|
|
120
|
+
opacity: 0.6;
|
|
121
|
+
cursor: not-allowed;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
&:hover:not(:disabled) {
|
|
125
|
+
background-color: rgba(0, 98, 210, 0.04);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
18
128
|
}
|
|
19
129
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
background: #
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
130
|
+
.message-container {
|
|
131
|
+
max-width: 380px;
|
|
132
|
+
padding: 32px 24px;
|
|
133
|
+
border-radius: 8px;
|
|
134
|
+
background-color: #fff;
|
|
135
|
+
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
|
|
136
|
+
text-align: center;
|
|
137
|
+
|
|
138
|
+
.image-wrapper {
|
|
139
|
+
display: flex;
|
|
140
|
+
justify-content: center;
|
|
141
|
+
margin-bottom: 15px;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.title {
|
|
145
|
+
margin: 0 0 8px;
|
|
146
|
+
color: rgb(55, 53, 47);
|
|
147
|
+
font-size: 22px;
|
|
148
|
+
font-weight: 500;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.description {
|
|
152
|
+
margin-bottom: 20px;
|
|
153
|
+
color: rgba(55, 53, 47, 0.65);
|
|
154
|
+
font-size: 15px;
|
|
155
|
+
line-height: 1.4;
|
|
156
|
+
}
|
|
28
157
|
}
|
|
29
158
|
}
|
|
@@ -1,57 +1,55 @@
|
|
|
1
|
+
import { provideRouter } from '@angular/router';
|
|
1
2
|
import { render, screen } from '@testing-library/angular';
|
|
2
3
|
import userEvent from '@testing-library/user-event';
|
|
3
4
|
import { Provider } from '@angular/core';
|
|
4
|
-
|
|
5
5
|
import { LoginComponent } from './login.component';
|
|
6
6
|
import { AuthStore } from 'src/app/core/store/auth/auth.store';
|
|
7
|
-
import { AuthMockDB
|
|
8
|
-
import {
|
|
7
|
+
import { AuthMockDB } from 'src/app/core/store/auth/auth.mock';
|
|
8
|
+
import { TimeAnalyticsService } from 'src/app/core/analytics/time-analytics.service';
|
|
9
|
+
import { AccessState } from 'src/app/core/store/user/user.model';
|
|
9
10
|
|
|
10
|
-
/** Sets up the testing environment for LoginComponent using render. */
|
|
11
11
|
async function setup(providers: Provider[] = []) {
|
|
12
12
|
const user = userEvent.setup();
|
|
13
|
-
|
|
13
|
+
const analytics = { trackInteraction: jest.fn() };
|
|
14
14
|
const view = await render(LoginComponent, {
|
|
15
|
-
imports: [],
|
|
16
15
|
providers: [
|
|
16
|
+
provideRouter([]),
|
|
17
17
|
{ provide: AuthStore, useClass: AuthMockDB },
|
|
18
|
+
{ provide: TimeAnalyticsService, useValue: analytics },
|
|
18
19
|
...providers,
|
|
19
20
|
],
|
|
20
21
|
});
|
|
21
|
-
|
|
22
22
|
return {
|
|
23
23
|
user,
|
|
24
|
-
fixture: view.fixture,
|
|
25
24
|
authStore: view.fixture.debugElement.injector.get(AuthStore),
|
|
25
|
+
analytics: view.fixture.debugElement.injector.get(TimeAnalyticsService),
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
describe('LoginComponent', () => {
|
|
30
|
-
it('
|
|
31
|
-
const { user, authStore } = await setup();
|
|
32
|
-
|
|
33
|
-
expect(screen.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
expect(
|
|
40
|
-
|
|
30
|
+
it('offers an email magic link first and Google beneath it', async () => {
|
|
31
|
+
const { user, authStore, analytics } = await setup();
|
|
32
|
+
expect(screen.getByRole('button', { name: /send me a magic link/i })).toBeVisible();
|
|
33
|
+
expect(screen.getByRole('button', { name: /continue with google/i })).toBeVisible();
|
|
34
|
+
expect(screen.queryByLabelText('Password')).not.toBeInTheDocument();
|
|
35
|
+
|
|
36
|
+
const googleSpy = jest.spyOn(authStore, 'signInWithGoogle');
|
|
37
|
+
await user.click(screen.getByRole('button', { name: /continue with google/i }));
|
|
38
|
+
expect(googleSpy).toHaveBeenCalled();
|
|
39
|
+
expect(analytics.trackInteraction).toHaveBeenCalledWith('onboarding', 'auth_result', {
|
|
40
|
+
method: 'google',
|
|
41
|
+
outcome: 'success',
|
|
42
|
+
authenticatedUserId: '1',
|
|
43
|
+
accessState: AccessState.DONE,
|
|
44
|
+
});
|
|
41
45
|
});
|
|
42
46
|
|
|
43
|
-
it('
|
|
44
|
-
const { user, authStore } = await setup(
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
expect(
|
|
49
|
-
|
|
50
|
-
expect(logoutBtn).toBeVisible();
|
|
51
|
-
|
|
52
|
-
const logoutSpy = jest.spyOn(authStore, 'logout');
|
|
53
|
-
await user.click(logoutBtn);
|
|
54
|
-
expect(logoutSpy).toHaveBeenCalledWith({ doNotRoute: true });
|
|
55
|
-
logoutSpy.mockRestore();
|
|
47
|
+
it('sends a magic link and confirms the destination email', async () => {
|
|
48
|
+
const { user, authStore } = await setup();
|
|
49
|
+
const emailLinkSpy = jest.spyOn(authStore, 'sendEmailSignInLink');
|
|
50
|
+
await user.type(screen.getByLabelText('Email'), 'learner@example.com');
|
|
51
|
+
await user.click(screen.getByRole('button', { name: /send me a magic link/i }));
|
|
52
|
+
expect(emailLinkSpy).toHaveBeenCalledWith('learner@example.com');
|
|
53
|
+
expect(screen.getByRole('heading', { name: /magic link sent/i })).toBeVisible();
|
|
56
54
|
});
|
|
57
55
|
});
|