@tech4good/angular-schematics 21.4.0 → 21.6.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 +33 -0
- package/package.json +1 -1
- package/src/entity/files/__name@dasherize__/__name@dasherize__.mock.ts.template +2 -1
- package/src/entity/files/__name@dasherize__/__name@dasherize__.model.ts.template +2 -1
- package/src/entity/index.js +57 -0
- package/src/entity/index.js.map +1 -1
- package/src/entity/schema.json +4 -0
- package/src/ng-add/files/.firebaserc.template +2 -1
- package/src/ng-add/files/.gitignore.template +2 -0
- package/src/ng-add/files/bigquery/queries/active_time_by_route.sql.template +34 -0
- package/src/ng-add/files/bigquery/scripts/export_entities.py.template +143 -0
- package/src/ng-add/files/bigquery/scripts/run_query.py.template +167 -0
- package/src/ng-add/files/bigquery/views/events_flat.sql.template +60 -0
- package/src/ng-add/files/bigquery/views/logs_latest.sql.template +34 -0
- package/src/ng-add/files/docs-infra/analytics-guide.md.template +170 -0
- package/src/ng-add/files/docs-infra/authentication-architecture.md.template +270 -0
- package/src/ng-add/files/docs-infra/infrastructure-guide.md.template +16 -10
- package/src/ng-add/files/firebase.json.template +6 -0
- package/src/ng-add/files/firebase.logs.json.template +5 -0
- package/src/ng-add/files/firestore.indexes.json.template +112 -0
- package/src/ng-add/files/firestore.logs.rules.spec.ts.template +100 -0
- package/src/ng-add/files/firestore.logs.rules.template +8 -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 +12 -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 +1 -1
- package/src/ng-add/files/package.json.template +7 -4
- 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 +6 -8
- package/src/ng-add/files/src/app/admin/admin-panel/admin-panel.component.ts.template +2 -0
- package/src/ng-add/files/src/app/app.component.html.template +2 -2
- package/src/ng-add/files/src/app/app.component.ts.template +2 -0
- 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 +9 -4
- package/src/ng-add/files/src/app/core/analytics/log.service.ts.template +26 -4
- package/src/ng-add/files/src/app/core/analytics/time-analytics.service.spec.ts.template +145 -2
- package/src/ng-add/files/src/app/core/analytics/time-analytics.service.ts.template +355 -149
- package/src/ng-add/files/src/app/core/auth/auth.service.ts.template +6 -1
- package/src/ng-add/files/src/app/core/auth/guards/require-admin.guard.spec.ts.template +38 -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 +10 -3
- package/src/ng-add/files/src/app/core/firebase/cached-listeners.service.ts.template +11 -5
- package/src/ng-add/files/src/app/core/firebase/database.service.ts.template +34 -17
- package/src/ng-add/files/src/app/core/firebase/email-link-context.service.spec.ts.template +59 -0
- package/src/ng-add/files/src/app/core/firebase/email-link-context.service.ts.template +147 -0
- package/src/ng-add/files/src/app/core/firebase/firebase.mock.service.ts.template +104 -17
- package/src/ng-add/files/src/app/core/firebase/firebase.service.spec.ts.template +116 -0
- package/src/ng-add/files/src/app/core/firebase/firebase.service.ts.template +367 -70
- package/src/ng-add/files/src/app/core/store/app.store.ts.template +4 -1
- package/src/ng-add/files/src/app/core/store/auth/auth.mock.ts.template +52 -66
- package/src/ng-add/files/src/app/core/store/auth/auth.store.spec.ts.template +127 -0
- package/src/ng-add/files/src/app/core/store/auth/auth.store.ts.template +216 -147
- package/src/ng-add/files/src/app/core/store/user/user.mock.ts.template +2 -4
- package/src/ng-add/files/src/app/core/store/user/user.model.ts.template +1 -1
- package/src/ng-add/files/src/app/core/store/user-private/user-private.model.ts.template +1 -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 +172 -48
- package/src/ng-add/files/src/app/first-time/consent/consent.component.scss.template +31 -0
- package/src/ng-add/files/src/app/first-time/consent/consent.component.spec.ts.template +31 -3
- package/src/ng-add/files/src/app/first-time/consent/consent.component.ts.template +12 -11
- package/src/ng-add/files/src/app/first-time/consent/consent.guard.ts.template +5 -7
- package/src/ng-add/files/src/app/first-time/early-access/early-access.component.spec.ts.template +12 -1
- package/src/ng-add/files/src/app/first-time/early-access/early-access.component.ts.template +93 -48
- package/src/ng-add/files/src/app/first-time/early-access/early-access.guard.ts.template +12 -2
- 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 +40 -0
- package/src/ng-add/files/src/app/first-time/email-link/email-link.component.ts.template +76 -0
- package/src/ng-add/files/src/app/first-time/first-time-routing.spec.ts.template +14 -8
- 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 +29 -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 +31 -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 +18 -38
- package/src/ng-add/files/src/app/first-time/login/login.component.ts.template +59 -31
- 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.ts.template +0 -5
- 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/index_spec.d.ts +1 -0
- package/src/ng-add/index_spec.js +108 -0
- package/src/ng-add/index_spec.js.map +1 -0
- package/tsconfig.json +2 -2
|
@@ -53,14 +53,12 @@ export const USER_DB: User[] = [
|
|
|
53
53
|
{
|
|
54
54
|
__id: '1',
|
|
55
55
|
name: 'User A',
|
|
56
|
-
photoURL: 'http://loremflickr.com/100/100?lock=1',
|
|
57
56
|
isAdmin: true,
|
|
58
|
-
consented:
|
|
59
|
-
accessState: AccessState.
|
|
57
|
+
consented: true,
|
|
58
|
+
accessState: AccessState.DONE,
|
|
60
59
|
_createdAt: Timestamp.now(),
|
|
61
60
|
_updatedAt: Timestamp.now(),
|
|
62
61
|
_deleted: false,
|
|
63
62
|
},
|
|
64
63
|
...MOCK_USER_LIST,
|
|
65
64
|
];
|
|
66
|
-
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.auth-action { max-width: 430px; margin: 80px auto; text-align: center; display: grid; justify-items: center; gap: 16px; }
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, inject, OnInit, signal } from '@angular/core';
|
|
2
|
+
import { ActivatedRoute, Router } from '@angular/router';
|
|
3
|
+
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Endpoint view for handling Firebase Auth email action redirects (`/auth/action`).
|
|
7
|
+
*
|
|
8
|
+
* Configured in Firebase Console as the default action handler. Receives URL query parameters
|
|
9
|
+
* (such as `mode=signIn` and action codes) and forwards valid email link sign-in flows to `/email-link`.
|
|
10
|
+
*/
|
|
11
|
+
@Component({
|
|
12
|
+
selector: 'app-auth-action',
|
|
13
|
+
templateUrl: './auth-action.component.html',
|
|
14
|
+
styleUrl: './auth-action.component.scss',
|
|
15
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
16
|
+
imports: [MatProgressSpinnerModule],
|
|
17
|
+
})
|
|
18
|
+
export class AuthActionComponent implements OnInit {
|
|
19
|
+
private readonly route = inject(ActivatedRoute);
|
|
20
|
+
private readonly router = inject(Router);
|
|
21
|
+
|
|
22
|
+
/** Status message displayed to the user while processing the email action callback. */
|
|
23
|
+
readonly message = signal('Completing your secure email action…');
|
|
24
|
+
|
|
25
|
+
async ngOnInit(): Promise<void> {
|
|
26
|
+
const params = this.route.snapshot.queryParams;
|
|
27
|
+
const mode = params['mode'];
|
|
28
|
+
try {
|
|
29
|
+
if (mode === 'signIn') {
|
|
30
|
+
await this.router.navigate(['/email-link'], { queryParams: params });
|
|
31
|
+
} else {
|
|
32
|
+
this.message.set('This email action is not valid or has expired.');
|
|
33
|
+
}
|
|
34
|
+
} catch {
|
|
35
|
+
this.message.set('This email action is not valid or has expired. Request a new email and try again.');
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -1,57 +1,181 @@
|
|
|
1
1
|
<app-navbar></app-navbar>
|
|
2
2
|
<main class="consent-container">
|
|
3
|
-
<h1>
|
|
3
|
+
<h1>Terms of Service, Privacy Policy, and Research Consent</h1>
|
|
4
4
|
<div class="separator"></div>
|
|
5
5
|
|
|
6
|
-
<p>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
<p>
|
|
7
|
+
{{ appName }} is a platform that {{ shortProdDesc }}. It is also an experimental platform run by
|
|
8
|
+
{{ organizationName }} for studying {{ shortResearchDesc }}.
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<p>
|
|
12
|
+
This document outlines the Terms of Service, Privacy Policy, and Research Consent for using
|
|
13
|
+
{{ appName }}. {{ appName }} receives your information through our website and from our partners
|
|
14
|
+
and other third parties for the purpose of delivering services, improving them, and conducting
|
|
15
|
+
research. For example, you send us information when you sign into {{ appName }} with {{ authAppName }}.
|
|
16
|
+
By using any of our Services, you agree to the collection, transfer, manipulation, storage,
|
|
17
|
+
disclosure, and other uses of your information as described in this document.
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
<h2>1. Terms of Service</h2>
|
|
21
|
+
|
|
22
|
+
<p class="substep">
|
|
23
|
+
<b>Acceptable Use</b>: You agree to use {{ appName }} solely for lawful educational, learning,
|
|
24
|
+
and platform interaction purposes. You agree not to reverse engineer, disrupt, tamper with, or
|
|
25
|
+
gain unauthorized access to any platform systems, servers, or user accounts.
|
|
26
|
+
</p>
|
|
27
|
+
|
|
28
|
+
<p class="substep">
|
|
29
|
+
<b>Disclaimer of Warranties</b>: {{ appName }} is provided on an "AS IS" and "AS AVAILABLE" basis.
|
|
30
|
+
While we strive for high service quality, {{ organizationName }} and its contributors make no express
|
|
31
|
+
or implied warranties regarding platform uptime, error-free operation, or specific learning
|
|
32
|
+
outcomes.
|
|
33
|
+
</p>
|
|
34
|
+
|
|
35
|
+
<p class="substep">
|
|
36
|
+
<b>Limitation of Liability</b>: To the maximum extent permitted by applicable law, {{ organizationName }}
|
|
37
|
+
and its creators, maintainers, or partners shall not be liable for any direct, indirect, incidental,
|
|
38
|
+
or consequential damages arising from your use of or inability to use the platform.
|
|
39
|
+
</p>
|
|
40
|
+
|
|
41
|
+
<p class="substep">
|
|
42
|
+
<b>Intellectual Property and Content</b>: All platform code, branding, graphics, and instructional
|
|
43
|
+
materials are owned by or licensed to {{ organizationName }}. User contributions and feedback are used
|
|
44
|
+
to operate and improve the platform and associated research projects.
|
|
45
|
+
</p>
|
|
46
|
+
|
|
47
|
+
<p class="substep">
|
|
48
|
+
<b>Account Termination</b>: We reserve the right to suspend or terminate user accounts that
|
|
49
|
+
violate these Terms of Service or engage in abusive, security-impacting, or unauthorized behavior.
|
|
50
|
+
</p>
|
|
51
|
+
|
|
52
|
+
<h2>2. Privacy Policy</h2>
|
|
53
|
+
|
|
54
|
+
<p class="substep">
|
|
55
|
+
<b>Basic Account Information</b>: When you create or reconfigure a {{ appName }} account, you
|
|
56
|
+
provide some personal information, such as your name and email address.
|
|
57
|
+
</p>
|
|
58
|
+
|
|
59
|
+
<p class="substep">
|
|
60
|
+
<b>Additional Information</b>: We may use your email address to send you notifications for the
|
|
61
|
+
projects you are participating in. If we do, you will be able to unsubscribe through your
|
|
62
|
+
account settings or by following the instructions contained within email notifications. If you
|
|
63
|
+
email us, we may keep your message, email address and contact information to respond to your
|
|
64
|
+
request. If you connect your {{ appName }} account to your account on another service, the other
|
|
65
|
+
service may send us your registration or profile information on that service and other
|
|
66
|
+
information that you authorize. Providing the additional information described in this section
|
|
67
|
+
is entirely optional.
|
|
68
|
+
</p>
|
|
69
|
+
|
|
70
|
+
<p class="substep">
|
|
71
|
+
<b>Service Usage Data</b>: Our Services are primarily designed to {{ usageDataProductDesc }}.
|
|
72
|
+
</p>
|
|
73
|
+
|
|
74
|
+
<p class="substep">
|
|
75
|
+
<b>Cookies & Analytics</b>: Like many websites, we use cookies and similar technologies to collect
|
|
76
|
+
additional website usage data to improve our Services and to conduct research to learn
|
|
77
|
+
{{ usageDataResearchDesc }}. A cookie is a small data file that is transferred to your
|
|
78
|
+
computer's hard disk. {{ appName }} may use both session cookies and persistent cookies to
|
|
79
|
+
better understand how you interact with our Services, to monitor aggregate usage by our users
|
|
80
|
+
and web traffic routing on our Services, and to customize and improve our Services. Most
|
|
81
|
+
Internet browsers automatically accept cookies. You can instruct your browser, by changing its
|
|
82
|
+
settings, to stop accepting cookies or to prompt you before accepting a cookie from the websites
|
|
83
|
+
you visit. However, some Services may not function properly if you disable cookies.
|
|
84
|
+
</p>
|
|
85
|
+
|
|
86
|
+
<p class="substep">
|
|
87
|
+
<b>Third-Party Sub-processors</b>: We do not sell, trade, or rent your personal information.
|
|
88
|
+
We share data only with trusted infrastructure and service providers (such as Google Cloud / Firebase
|
|
89
|
+
for hosting, database storage, and authentication) that assist us in operating the platform, subject
|
|
90
|
+
to strict confidentiality agreements.
|
|
91
|
+
</p>
|
|
92
|
+
|
|
93
|
+
<p class="substep">
|
|
94
|
+
<b>Data Retention & Erasure</b>: We retain your account data for as long as your account remains active.
|
|
95
|
+
You have the right to access, modify, or request deletion of your personal information at any time.
|
|
96
|
+
Upon receiving an account or data deletion request, we will delete or anonymize your personal data
|
|
97
|
+
within 30 days.
|
|
98
|
+
</p>
|
|
99
|
+
|
|
100
|
+
<p class="substep">
|
|
101
|
+
<b>Law and Harm</b>: Notwithstanding anything to the contrary in this Policy, we may preserve or
|
|
102
|
+
disclose your information if we believe that it is reasonably necessary to comply with a law,
|
|
103
|
+
regulation or legal request; to protect the safety of any person; to address fraud, security or
|
|
104
|
+
technical issues; or to protect {{ appName }}'s rights or property.
|
|
105
|
+
</p>
|
|
106
|
+
|
|
107
|
+
<h2>3. Research Study Information</h2>
|
|
108
|
+
|
|
109
|
+
<p>
|
|
110
|
+
This platform also incorporates research studies approved under UCSC IRB Study
|
|
111
|
+
{{ protocolNumber }} titled "{{ protocolTitle }}".
|
|
112
|
+
</p>
|
|
13
113
|
|
|
14
114
|
<p class="substep"><b>What will you do in the study</b>: {{ studyDoingDesc }}.</p>
|
|
15
|
-
|
|
16
|
-
<p class="substep"><b>Risks or discomforts</b>: While researchers follow procedures to maintain your confidentiality, as with any internet activity, we cannot guarantee confidentiality of interception of data sent via the Internet by any third parties, so there is a risk that your information could be accidentally disclosed. However, we do not see foreseeable risks even if information is accidentally disclosed.</p>
|
|
17
|
-
|
|
18
|
-
<p class="substep"><b>Benefits and costs</b>: There are no costs to you for participation. You may benefit by using the platform {{ benefitsDesc }}, but we do not guarantee that any benefits will occur.</p>
|
|
19
|
-
|
|
20
|
-
<p class="substep"><b>Voluntary participation</b>: All participation is voluntary and you may choose to discontinue use of the platform at any time.</p>
|
|
21
|
-
|
|
22
|
-
<p class="substep"><b>Rights and concerns</b>: If you have questions about this research study, please contact {{ investigatorInfo }} or the faculty member supervising this research {{ facultyInfo }}. If you have any questions regarding your rights as a research participant, please contact the University of California Santa Cruz, Office of Research Compliance Administration at 831-459-1473 or orca@ucsc.edu.</p>
|
|
23
|
-
|
|
24
|
-
<h2>Information Collection and Use</h2>
|
|
25
|
-
|
|
26
|
-
<p class="substep"><b>Basic Account Information</b>: When you create or reconfigure a {{ appName }} account, you provide some personal information, such as your name and email address.</p>
|
|
27
|
-
|
|
28
|
-
<p class="substep"><b>Additional Information</b>: We may use your email address to send you notifications for the projects you are participating in. If we do, you will be able to unsubscribe through your account settings or by following the instructions contained within email notifications. If you email us, we may keep your message, email address and contact information to respond to your request. If you connect your {{ appName }} account to your account on another service, the other service may send us your registration or profile information on that service and other information that you authorize. Providing the additional information described in this section is entirely optional.</p>
|
|
29
|
-
|
|
30
|
-
<p class="substep"><b>Service Usage Data</b>: Our Services are primarily designed to {{ usageDataProductDesc }}.</p>
|
|
31
|
-
|
|
32
|
-
<p class="substep"><b>Cookies</b>: Like many websites, we use cookies and similar technologies to collect additional website usage data to improve our Services and to conduct research to learn {{ usageDataResearchDesc }}. A cookie is a small data file that is transferred to your computer's hard disk. {{ appName }} may use both session cookies and persistent cookies to better understand how you interact with our Services, to monitor aggregate usage by our users and web traffic routing on our Services, and to customize and improve our Services. Most Internet browsers automatically accept cookies. You can instruct your browser, by changing its settings, to stop accepting cookies or to prompt you before accepting a cookie from the websites you visit. However, some Services may not function properly if you disable cookies.</p>
|
|
33
|
-
|
|
34
|
-
<h2>Information Sharing and Disclosure</h2>
|
|
35
|
-
|
|
36
|
-
<p class="substep"><b>Transfer of information</b>: We do not sell, trade, or otherwise transfer to outside parties your personally identifiable information. This does not include trusted third parties who assist us in operating our website, conducting research, or servicing you, so long as those parties agree to keep this information confidential. Additionally, parties given access to research data will also be IRB approved.</p>
|
|
37
|
-
|
|
38
|
-
<p class="substep"><b>Law and Harm</b>: Notwithstanding anything to the contrary in this Policy, we may preserve or disclose your information if we believe that it is reasonably necessary to comply with a law, regulation or legal request; to protect the safety of any person; to address fraud, security or technical issues; or to protect {{ appName }}'s rights or property. However, nothing in this Privacy Policy is intended to limit any legal defenses or objections that you may have to a third party’s, including a government’s, request to disclose your information.</p>
|
|
39
|
-
|
|
40
|
-
<h2>Modifying Your Personal Information</h2>
|
|
41
|
-
|
|
42
|
-
<p>If you are a registered user of our Services, we provide you with tools and account settings to access or modify the personal information you provided to us and associated with your account.</p>
|
|
43
|
-
|
|
44
|
-
<h2>Changes to This Policy</h2>
|
|
45
|
-
|
|
46
|
-
<p>We may revise this Privacy Policy from time to time. The most current version of the policy will govern our use of your information and will be at <a routerLink="/consent">{{ consentUrl }}</a>. If we make a change to this policy that, in our sole discretion, is material, we will notify you via an email to the email address associated with your account. By continuing to access or use the Services after those changes become effective, you agree to be bound by the revised Privacy Policy.</p>
|
|
47
115
|
|
|
48
|
-
<
|
|
49
|
-
<
|
|
50
|
-
|
|
116
|
+
<p class="substep">
|
|
117
|
+
<b>Risks or discomforts</b>: While researchers follow procedures to maintain your
|
|
118
|
+
confidentiality, as with any internet activity, we cannot guarantee confidentiality of
|
|
119
|
+
interception of data sent via the Internet by any third parties, so there is a risk that your
|
|
120
|
+
information could be accidentally disclosed. However, we do not see foreseeable risks even if
|
|
121
|
+
information is accidentally disclosed.
|
|
122
|
+
</p>
|
|
123
|
+
|
|
124
|
+
<p class="substep">
|
|
125
|
+
<b>Benefits and costs</b>: There are no costs to you for participation. You may benefit by using
|
|
126
|
+
the platform {{ benefitsDesc }}, but we do not guarantee that any benefits will occur.
|
|
127
|
+
</p>
|
|
128
|
+
|
|
129
|
+
<p class="substep">
|
|
130
|
+
<b>Voluntary participation</b>: All research participation is voluntary and you may choose to
|
|
131
|
+
discontinue use of the platform at any time.
|
|
132
|
+
</p>
|
|
133
|
+
|
|
134
|
+
<p class="substep">
|
|
135
|
+
<b>Rights and concerns</b>: If you have questions about this research study, please contact
|
|
136
|
+
{{ investigatorInfo }} at <a href="mailto:{{ investigatorEmail }}">{{ investigatorEmail }}</a> or
|
|
137
|
+
the faculty member supervising this research {{ facultyInfo }}. If you have any questions regarding
|
|
138
|
+
your rights as a research participant, please contact the University of California Santa Cruz, Office
|
|
139
|
+
of Research Compliance Administration at 831-459-1473 or <a href="mailto:orca@ucsc.edu">orca@ucsc.edu</a>.
|
|
140
|
+
</p>
|
|
141
|
+
|
|
142
|
+
<h2>4. Modifying Your Personal Information</h2>
|
|
143
|
+
|
|
144
|
+
<p>
|
|
145
|
+
If you are a registered user of our Services, we provide you with tools and account settings to
|
|
146
|
+
access or modify the personal information you provided to us and associated with your account.
|
|
147
|
+
</p>
|
|
148
|
+
|
|
149
|
+
<h2>5. Changes to This Policy</h2>
|
|
150
|
+
|
|
151
|
+
<p>
|
|
152
|
+
We may revise this document from time to time. The most current version will govern our use of
|
|
153
|
+
your information and terms of platform access, and will be available at
|
|
154
|
+
<a routerLink="/consent">{{ consentUrl }}</a>. If we make a change that, in our sole discretion,
|
|
155
|
+
is material, we will notify you via an email to the email address associated with your account.
|
|
156
|
+
By continuing to access or use the Services after those changes become effective, you agree to be
|
|
157
|
+
bound by the revised Terms of Service, Privacy Policy, and Research Consent.
|
|
158
|
+
</p>
|
|
159
|
+
|
|
160
|
+
@if (currentUser()?.consented) {
|
|
161
|
+
<div class="already-consented-banner">
|
|
162
|
+
<span class="check-icon">✓</span>
|
|
163
|
+
<div class="banner-title">You have already agreed to the terms and consented to participate.</div>
|
|
51
164
|
</div>
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
<
|
|
55
|
-
|
|
56
|
-
|
|
165
|
+
} @else {
|
|
166
|
+
<form [formRoot]="consentForm">
|
|
167
|
+
<div class="agree-container">
|
|
168
|
+
<mat-checkbox [color]="'primary'" [formField]="consentForm.checked"
|
|
169
|
+
><span style="white-space: normal" class="permission-text"
|
|
170
|
+
>I have read and understood the above, agree to the Terms of Service and Privacy Policy, and
|
|
171
|
+
consent to participate in the research study.</span
|
|
172
|
+
></mat-checkbox
|
|
173
|
+
>
|
|
174
|
+
</div>
|
|
175
|
+
<button type="submit" class="btn continue-btn" [disabled]="!consentForm.checked().value()">
|
|
176
|
+
Accept and Continue
|
|
177
|
+
<img src="https://icongr.am/feather/arrow-right.svg?size=20&color=B2B6C7" />
|
|
178
|
+
</button>
|
|
179
|
+
</form>
|
|
180
|
+
}
|
|
57
181
|
</main>
|
|
@@ -74,4 +74,35 @@
|
|
|
74
74
|
cursor: pointer;
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
+
|
|
78
|
+
.already-consented-banner {
|
|
79
|
+
display: flex;
|
|
80
|
+
align-items: center;
|
|
81
|
+
gap: 16px;
|
|
82
|
+
margin-top: 2em;
|
|
83
|
+
padding: 20px 24px;
|
|
84
|
+
background-color: #f0faf0;
|
|
85
|
+
border: 1px solid #c3e6c3;
|
|
86
|
+
border-radius: 8px;
|
|
87
|
+
|
|
88
|
+
.check-icon {
|
|
89
|
+
flex-shrink: 0;
|
|
90
|
+
display: flex;
|
|
91
|
+
align-items: center;
|
|
92
|
+
justify-content: center;
|
|
93
|
+
width: 28px;
|
|
94
|
+
height: 28px;
|
|
95
|
+
border-radius: 50%;
|
|
96
|
+
background-color: #4caf50;
|
|
97
|
+
color: white;
|
|
98
|
+
font-size: 16px;
|
|
99
|
+
font-weight: bold;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.banner-title {
|
|
103
|
+
font-weight: 600;
|
|
104
|
+
font-size: 1.05em;
|
|
105
|
+
color: #2e7d32;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
77
108
|
}
|
|
@@ -25,10 +25,16 @@ async function setup(providers: Provider[] = [], seededUsers: any[] = []) {
|
|
|
25
25
|
};
|
|
26
26
|
const routerMock = {
|
|
27
27
|
navigate: jest.fn().mockReturnValue(Promise.resolve(true)),
|
|
28
|
+
navigateByUrl: jest.fn().mockReturnValue(Promise.resolve(true)),
|
|
28
29
|
routerState: { snapshot: {} },
|
|
29
30
|
};
|
|
30
31
|
const activatedRouteMock = {
|
|
31
|
-
snapshot: {
|
|
32
|
+
snapshot: {
|
|
33
|
+
queryParamMap: {
|
|
34
|
+
get: jest.fn().mockReturnValue(null),
|
|
35
|
+
},
|
|
36
|
+
queryParams: {},
|
|
37
|
+
},
|
|
32
38
|
};
|
|
33
39
|
|
|
34
40
|
const view = await render(ConsentComponent, {
|
|
@@ -68,7 +74,7 @@ describe('ConsentComponent', () => {
|
|
|
68
74
|
it('should render consent title and research study information', async () => {
|
|
69
75
|
await setup();
|
|
70
76
|
|
|
71
|
-
expect(screen.getByRole('heading', { level: 1, name: /
|
|
77
|
+
expect(screen.getByRole('heading', { level: 1, name: /Terms of Service, Privacy Policy, and Research Consent/i })).toBeVisible();
|
|
72
78
|
expect(screen.getByText(/What will you do in the study/i)).toBeVisible();
|
|
73
79
|
expect(screen.getByRole('button', { name: /Accept and Continue/i })).toBeDisabled();
|
|
74
80
|
});
|
|
@@ -105,9 +111,31 @@ describe('ConsentComponent', () => {
|
|
|
105
111
|
});
|
|
106
112
|
|
|
107
113
|
await waitFor(() => {
|
|
108
|
-
expect(navigateSpy).toHaveBeenCalledWith(['/home']);
|
|
114
|
+
expect(navigateSpy).toHaveBeenCalledWith(['/home'], { queryParams: {} });
|
|
109
115
|
});
|
|
110
116
|
|
|
111
117
|
updateSpy.mockRestore();
|
|
112
118
|
});
|
|
119
|
+
|
|
120
|
+
describe('Already Consented User', () => {
|
|
121
|
+
beforeEach(() => {
|
|
122
|
+
USER_DB[0].accessState = AccessState.DONE;
|
|
123
|
+
USER_DB[0].consented = true;
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
it('should show the "already consented" banner instead of the form', async () => {
|
|
127
|
+
await setup([], [USER_DB[0]]);
|
|
128
|
+
|
|
129
|
+
expect(screen.getByText(/You have already agreed to the terms/i)).toBeVisible();
|
|
130
|
+
expect(screen.queryByRole('checkbox')).toBeNull();
|
|
131
|
+
expect(screen.queryByRole('button', { name: /Accept and Continue/i })).toBeNull();
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
it('should still display the consent page content for reading', async () => {
|
|
135
|
+
await setup([], [USER_DB[0]]);
|
|
136
|
+
|
|
137
|
+
expect(screen.getByRole('heading', { level: 1, name: /Terms of Service, Privacy Policy, and Research Consent/i })).toBeVisible();
|
|
138
|
+
expect(screen.getByText(/What will you do in the study/i)).toBeVisible();
|
|
139
|
+
});
|
|
140
|
+
});
|
|
113
141
|
});
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Component, OnInit, ChangeDetectionStrategy, input, output, inject, WritableSignal, Signal, signal, computed, effect, Inject, Injector } from '@angular/core';
|
|
2
2
|
import { Router, RouterLink, ActivatedRoute } from '@angular/router';
|
|
3
3
|
import { User, AccessState } from 'src/app/core/store/user/user.model';
|
|
4
|
-
import { handleAccess } from './consent.guard';
|
|
5
4
|
import { Location } from '@angular/common';
|
|
6
5
|
import { AuthStore } from 'src/app/core/store/auth/auth.store';
|
|
7
6
|
import { UserStore } from 'src/app/core/store/user/user.store';
|
|
@@ -41,6 +40,7 @@ export class ConsentComponent implements OnInit {
|
|
|
41
40
|
|
|
42
41
|
/** Constants for onboarding templates. */
|
|
43
42
|
appName = 'APP_NAME [Causeway]';
|
|
43
|
+
organizationName = 'ORGANIZATION_NAME [the Tech4Good Lab]';
|
|
44
44
|
shortProdDesc = 'PROD_DESC [provides users with opportunities to learn coding in real-world settings while contributing to non-profit causes]';
|
|
45
45
|
shortResearchDesc = 'RESEARCH_DESC [how to scale opportunities for experiential learning and support collaboration around social causes]';
|
|
46
46
|
authAppName = 'AUTH_APP_NAME [Google]';
|
|
@@ -50,7 +50,8 @@ export class ConsentComponent implements OnInit {
|
|
|
50
50
|
usageDataResearchDesc = 'USAGE_DATA_RESEARCH [how to better support experiential learning online]';
|
|
51
51
|
studyDoingDesc = 'STUDY_DOING [When you participate in our study, you will use our platform to learn web development and contribute code to a platform. You will also fill out a survey on your experience, and optionally, participate in a follow-up interview]';
|
|
52
52
|
benefitsDesc = 'STUDY_BENEFITS [to learn web development and contribute to a project you care about]';
|
|
53
|
-
investigatorInfo = 'INVESTIGATOR_INFO [FirstName LastName, co-Principal Investigator
|
|
53
|
+
investigatorInfo = 'INVESTIGATOR_INFO [FirstName LastName, co-Principal Investigator]';
|
|
54
|
+
investigatorEmail = 'INVESTIGATOR_EMAIL [email@ucsc.edu]';
|
|
54
55
|
facultyInfo = 'FACULTY_INFO [David T. Lee, dlee105@ucsc.edu]';
|
|
55
56
|
|
|
56
57
|
/** Form model */
|
|
@@ -92,7 +93,14 @@ export class ConsentComponent implements OnInit {
|
|
|
92
93
|
accessState: AccessState.DONE,
|
|
93
94
|
consented: true,
|
|
94
95
|
});
|
|
95
|
-
|
|
96
|
+
|
|
97
|
+
// Navigate to returnUrl or /home directly after successful submit
|
|
98
|
+
const returnUrl = this.route.snapshot.queryParamMap?.get('returnUrl');
|
|
99
|
+
if (returnUrl) {
|
|
100
|
+
await this.router.navigateByUrl(returnUrl);
|
|
101
|
+
} else {
|
|
102
|
+
await this.router.navigate(['/home'], { queryParams: this.route.snapshot.queryParams });
|
|
103
|
+
}
|
|
96
104
|
} catch (e) {
|
|
97
105
|
console.error(e);
|
|
98
106
|
this.snackBar.open('Failed to update consent status', '', { duration: 3000 });
|
|
@@ -107,14 +115,7 @@ export class ConsentComponent implements OnInit {
|
|
|
107
115
|
private snackBar: MatSnackBar,
|
|
108
116
|
private location: Location,
|
|
109
117
|
@Inject(BATCH_WRITE_SERVICE) private batch: BatchWriteService,
|
|
110
|
-
) {
|
|
111
|
-
// Redirect users who have progressed past the consent stage
|
|
112
|
-
// (i.e. neither submitting consent nor waiting) to the main app.
|
|
113
|
-
effect(() => {
|
|
114
|
-
const user = this.currentUser();
|
|
115
|
-
handleAccess(user, this.router, this.route.snapshot, this.router.routerState.snapshot);
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
+
) {}
|
|
118
119
|
|
|
119
120
|
// --------------- LOAD AND CLEANUP --------------------
|
|
120
121
|
|
|
@@ -4,6 +4,7 @@ import { map } from 'rxjs/operators';
|
|
|
4
4
|
import { AuthService } from '../../core/auth/auth.service';
|
|
5
5
|
import { User, AccessState } from '../../core/store/user/user.model';
|
|
6
6
|
import { hasAdminOverride } from '../../core/auth/guards/admin-override';
|
|
7
|
+
import { environment } from 'src/environments/environment';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Single guard logic for the consent page that checks two conditions:
|
|
@@ -20,22 +21,19 @@ export function handleAccess(
|
|
|
20
21
|
router: Router,
|
|
21
22
|
route: ActivatedRouteSnapshot,
|
|
22
23
|
state: RouterStateSnapshot,
|
|
24
|
+
hasWaitlist: boolean = environment.hasWaitlist,
|
|
23
25
|
): boolean {
|
|
24
26
|
if (hasAdminOverride(user, state.url)) return true;
|
|
25
27
|
|
|
26
28
|
// Check 1: Has the user cleared the waitlist?
|
|
27
|
-
const waitingStates =
|
|
29
|
+
const waitingStates = hasWaitlist ?
|
|
30
|
+
[AccessState.SUBMIT_INTEREST, AccessState.WAITING] :
|
|
31
|
+
[AccessState.SUBMIT_INTEREST];
|
|
28
32
|
if (user && waitingStates.includes(user.accessState)) {
|
|
29
33
|
router.navigate(['/early-access'], { queryParams: route.queryParams });
|
|
30
34
|
return false;
|
|
31
35
|
}
|
|
32
36
|
|
|
33
|
-
// Check 2: Does the user still need to consent?
|
|
34
|
-
if (user && user.accessState === AccessState.DONE && user.consented) {
|
|
35
|
-
router.navigate(['/home'], { queryParams: route.queryParams });
|
|
36
|
-
return false;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
37
|
return true;
|
|
40
38
|
}
|
|
41
39
|
|
package/src/ng-add/files/src/app/first-time/early-access/early-access.component.spec.ts.template
CHANGED
|
@@ -57,6 +57,7 @@ async function setup(providers: Provider[] = [], seededUsers: any[] = []) {
|
|
|
57
57
|
routerMock,
|
|
58
58
|
snackBarMock,
|
|
59
59
|
batchWriteMock: view.fixture.debugElement.injector.get(BATCH_WRITE_SERVICE) as any,
|
|
60
|
+
authStore: view.fixture.debugElement.injector.get(AuthStore),
|
|
60
61
|
};
|
|
61
62
|
}
|
|
62
63
|
|
|
@@ -74,6 +75,14 @@ describe('EarlyAccessComponent', () => {
|
|
|
74
75
|
expect(screen.getByRole('button', { name: /Submit/i })).toBeDisabled();
|
|
75
76
|
});
|
|
76
77
|
|
|
78
|
+
it('should safely clear the page when the authenticated user is removed during account deletion', async () => {
|
|
79
|
+
const { authStore, fixture } = await setup();
|
|
80
|
+
|
|
81
|
+
await authStore.deleteAnonymousAccount();
|
|
82
|
+
expect(() => fixture.detectChanges()).not.toThrow();
|
|
83
|
+
expect(screen.queryByText(/Please help us understand/i)).not.toBeInTheDocument();
|
|
84
|
+
});
|
|
85
|
+
|
|
77
86
|
it('should enforce minLength validators on survey inputs', async () => {
|
|
78
87
|
const { user } = await setup();
|
|
79
88
|
|
|
@@ -100,7 +109,7 @@ describe('EarlyAccessComponent', () => {
|
|
|
100
109
|
});
|
|
101
110
|
|
|
102
111
|
it('should perform batch write and update accessState and user context on submit', async () => {
|
|
103
|
-
const { user, batchWriteMock, snackBarMock } = await setup();
|
|
112
|
+
const { user, batchWriteMock, snackBarMock, routerMock } = await setup();
|
|
104
113
|
|
|
105
114
|
const writeSpy = jest.spyOn(batchWriteMock, 'batchWrite');
|
|
106
115
|
|
|
@@ -133,11 +142,13 @@ describe('EarlyAccessComponent', () => {
|
|
|
133
142
|
expect(updateCall).toBeDefined();
|
|
134
143
|
const changes = updateCall[1];
|
|
135
144
|
expect(changes.joinedWaitlistAt).toBeInstanceOf(Timestamp);
|
|
145
|
+
expect(changes.accessState).toBe(AccessState.CONSENT);
|
|
136
146
|
|
|
137
147
|
// Verify success notification shown with Undo action
|
|
138
148
|
await waitFor(() => {
|
|
139
149
|
expect(snackBarMock.open).toHaveBeenCalledWith('Submitted interest form!', 'Undo', expect.any(Object));
|
|
140
150
|
});
|
|
151
|
+
expect(routerMock.navigate).toHaveBeenCalledWith(['/consent'], { queryParams: undefined });
|
|
141
152
|
|
|
142
153
|
writeSpy.mockRestore();
|
|
143
154
|
});
|