Skip to content

Commit 58f195f

Browse files
committed
Merge branch 'develop' of github.com:HabitRPG/habitica into develop
2 parents 8690484 + 4cc689e commit 58f195f

File tree

6 files changed

+77
-36
lines changed

6 files changed

+77
-36
lines changed

website/client/src/components/header/banners/privacy.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ export default {
9898
) {
9999
this.hidden = true;
100100
}
101+
this.$root.$on('privacy-complete', () => {
102+
this.close();
103+
});
101104
},
102105
methods: {
103106
close () {

website/client/src/components/settings/privacyModal.vue

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
<label class="mb-0">
2222
{{ $t('performanceAnalytics') }}
2323
</label>
24-
<toggle-switch />
24+
<toggle-switch
25+
v-model="privacyConsent"
26+
/>
2527
</div>
2628
<small>
2729
{{ $t('usedForSupport') }}
@@ -44,13 +46,22 @@
4446
</small>
4547
</div>
4648
<div class="d-flex flex-column text-center">
47-
<button class="btn btn-primary mb-2">
49+
<button
50+
class="btn btn-primary mb-2"
51+
@click="consent(true)"
52+
>
4853
{{ $t('acceptAllCookies') }}
4954
</button>
50-
<button class="btn btn-secondary mb-2">
55+
<button
56+
class="btn btn-primary mb-2"
57+
@click="consent(false)"
58+
>
5159
{{ $t('denyNonEssentialCookies') }}
5260
</button>
53-
<button class="btn btn-secondary mb-3">
61+
<button
62+
class="btn btn-secondary mb-3"
63+
@click="consent(privacyConsent)"
64+
>
5465
{{ $t('savePreferences') }}
5566
</button>
5667
<a
@@ -92,7 +103,17 @@ export default {
92103
closeX,
93104
ToggleSwitch,
94105
},
106+
data () {
107+
return {
108+
privacyConsent: true,
109+
};
110+
},
95111
methods: {
112+
consent (decision) {
113+
localStorage.setItem('analyticsConsent', decision);
114+
this.$root.$emit('privacy-complete');
115+
this.close();
116+
},
96117
close () {
97118
this.$root.$emit('bv::hide::modal', 'privacy-preferences');
98119
},

website/client/src/components/static/terms.vue

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
Our Service is provided by HabitRPG, Inc. ("HabitRPG"). By accepting these Terms of Service and our Privacy Policy located at: <a
1111
href="https://habitica.com/static/privacy"
1212
target="_blank"
13-
>https://habitica.com/static/privacy</a> (collectively, the "Agreement"), using our website, Habitica.com, or our other features or services (collectively, “the Services”, or otherwise manifesting your assent to the Agreement, you acknowledge that you have read, understood, and agree to be legally bound by the Agreement. If you do not agree to (or cannot comply with) the Agreement, you are not permitted to access or use the Service. By accepting or agreeing to this Agreement on behalf of a company or other legal entity, you represent and warrant that you have the authority to bind that company or other legal entity to the Agreement and, in such event, "you" and "your" will refer and apply to that company or other legal entity. You further represent and warrant that your assent to this Agreement constitutes an electronic signature as defined by the Electronic Signatures in Global and National Commerce Act (“E-Sign”) and the Uniform Electronic Transactions Act (“UETA”) and that you have formed, executed, entered into, and accepted the terms of and otherwise authenticated the Agreement and acknowledged and agreed that the Agreement is an electronic record for purposes of E- Sign, UETA, and the Uniform Computer Information Transactions Act and, as such, is completely valid, has legal effect, is enforceable, and is binding on, and non- refutable by, you and/or any entity on whose behalf you are acting.
13+
>https://habitica.com/static/privacy</a> (collectively, the "Agreement"), using our website, Habitica.com, or our other features or services (collectively, “the Services”), or otherwise manifesting your assent to the Agreement, you acknowledge that you have read, understood, and agree to be legally bound by the Agreement. If you do not agree to (or cannot comply with) the Agreement, you are not permitted to access or use the Service. By accepting or agreeing to this Agreement on behalf of a company or other legal entity, you represent and warrant that you have the authority to bind that company or other legal entity to the Agreement and, in such event, "you" and "your" will refer and apply to that company or other legal entity. You further represent and warrant that your assent to this Agreement constitutes an electronic signature as defined by the Electronic Signatures in Global and National Commerce Act (“E-Sign”) and the Uniform Electronic Transactions Act (“UETA”) and that you have formed, executed, entered into, and accepted the terms of and otherwise authenticated the Agreement and acknowledged and agreed that the Agreement is an electronic record for purposes of E- Sign, UETA, and the Uniform Computer Information Transactions Act and, as such, is completely valid, has legal effect, is enforceable, and is binding on, and non- refutable by, you and/or any entity on whose behalf you are acting.
1414
</p>
1515
<p class="strong">
1616
THE SECTIONS BELOW TITLED "BINDING ARBITRATION' AND "CLASS ACTION WAIVER" CONTAIN A BINDING ARBITRATION AGREEMENT AND CLASS ACTION WAIVER. THEY AFFECT YOUR LEGAL RIGHTS. PLEASE READ THEM CAREFULLY.
@@ -68,7 +68,7 @@
6868
Outside the above explicitly allowed use cases, you may not use our trademarks, service marks, trade names, logos, domain names, taglines, or trade dress without a signed written contract with us granting you a license to do so.
6969
</p>
7070

71-
<h2>Modifying and Termination of Service</h2>
71+
<h2>Modification and Termination of Service</h2>
7272
<p>
7373
HabitRPG reserves the right, in its sole discretion, to add, modify, or remove functionalities or features from the Service, and improve, change and/or update the Service. We may also suspend or terminate the Service at any time, with or without notice to you.
7474
</p>
@@ -81,7 +81,9 @@
8181
<li>Doing so would be in the best interests of our community, the Service, or the rights of a third party.</li>
8282
</ul>
8383
<p>
84-
If your account is terminated, you will no longer have access to it, including to any of the associated data or Content. You will not be entitled to any refunds and we will have no liability to you. We also reserve the right to terminate any other accounts you may have created, as well as access to any other HabitRPG Service (also without refunds or liability to you).
84+
If your account is terminated, you will no longer have access to it, including to any of the associated data or Content. We also reserve the right to terminate any other accounts you may have created, as well as access to any other HabitRPG Service.
85+
</p>
86+
<p>
8587
You understand and agree that using the Service comes with the risk that your account may be terminated or suspended at our discretion and at any time. Please keep this risk in mind and comport yourself appropriately.
8688
</p>
8789

@@ -156,7 +158,7 @@
156158
BY PURCHASING PREMIUM YOU EXPRESSLY UNDERSTAND AND AGREE TO OUR REFUND POLICY:
157159
</p>
158160
<p>
159-
WITHIN THIRTY (30) DAYS OF YOUR PREMIUM PAYMENT DATE AS SHOWN ON YOUR PAYMENT BILL, YOU CAN REQUEST A FULL REFUND BY CONTACTING US AT <a href="mailto:[email protected]">[email protected]</a>. AFTER THIRTY (30) DAYS OF YOUR PREMIUM PAYMENT DATE, ANY PAYMENT REFUND IS SOLELY SUBJECT TO OUR DISCRETION. THE REFUND SHALL BE YOUR SOLE AND EXCLUSIVE REMEDY.
161+
YOU CAN REQUEST A REFUND OF YOUR MOST RECENT PAYMENT TO US BY CONTACTING US AT <a href='mailto:[email protected]'>[email protected]</a>. THE AMOUNT OF YOUR REFUND, IF ANY, WILL BE BASED ON (1) THE AMOUNT OF YOUR PURCHASED BUT UNUSED SUBSCRIPTION BENEFITS AND (2) THE TERMS IMPOSED ON US BY OUR PAYMENT PROCESSING VENDORS (E.G., WITH RESPECT TO THE DURATION OF THE REFUND PERIOD).
160162
</p>
161163
<p>
162164
FOR ANY CUSTOMER WHO PURCHASED PREMIUM IN APPLE INC.'s APP STORE ("APP STORE"), PLEASE CONTACT APPLE INC.'s SUPPORT TEAM: <a

website/client/src/libs/analytics.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ export function track (properties, options = {}) {
8080
// Track events on the server by default
8181
if (trackOnClient === true) {
8282
amplitude.getInstance().logEvent(properties.eventAction, properties);
83-
window.gtag('event', properties.eventAction, properties);
83+
if (window.gtag) {
84+
window.gtag('event', properties.eventAction, properties);
85+
}
8486
} else {
8587
const store = getStore();
8688
store.dispatch('analytics:trackEvent', properties);
@@ -94,7 +96,9 @@ export function updateUser (properties = {}) {
9496
// Use nextTick to avoid blocking the UI
9597
Vue.nextTick(() => {
9698
_gatherUserStats(properties);
97-
window.gtag('set', 'user_properties', properties);
99+
if (window.gtag) {
100+
window.gtag('set', 'user_properties', properties);
101+
}
98102
forEach(properties, (value, key) => {
99103
const identify = new amplitude.Identify().set(key, value);
100104
amplitude.getInstance().identify(identify);
@@ -106,8 +110,9 @@ export async function setup () {
106110
const user = _getConsentedUser();
107111
if (!user) return;
108112
await Vue.loadScript(`https://www.googletagmanager.com/gtag/js?id=${GA_ID}`);
109-
if (DEBUG_ENABLED || !IS_PRODUCTION) {
110-
window.gtag('config', GA_ID, { debug_mode: true });
111-
}
113+
window.gtag('config', GA_ID, {
114+
debug_mode: DEBUG_ENABLED || !IS_PRODUCTION,
115+
user_id: user._id,
116+
});
112117
amplitude.getInstance().init(AMPLITUDE_KEY);
113118
}

website/client/src/pages/settings/siteDataRows/privacyPreferencesRow.vue

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -29,39 +29,45 @@
2929
</h3>
3030
<p
3131
v-once
32-
class="gray-50"
32+
class="gray-50 mb-4"
3333
v-html="$t('privacySettingsOverview') + ' ' + $t('learnMorePrivacy')"
3434
>
3535
</p>
3636
<div
3737
class="d-flex justify-content-center"
3838
>
3939
<div class="w-66">
40-
<div class="mb-28p">
41-
<div
42-
class="d-flex justify-content-between align-items-center"
43-
>
44-
<div class="settings-label w-50"> {{ $t('strictlyNecessary') }}</div>
45-
<div class="settings-label mini green-10"> {{ $t('alwaysActive') }}</div>
46-
</div>
47-
<small class="gray-100">
48-
{{ $t('requiredToRun') }}
49-
</small>
50-
</div>
5140
<div
52-
class="d-flex justify-content-between align-items-center"
41+
class="d-flex justify-content-between align-items-center mb-1"
5342
>
54-
<div class="settings-label w-50"> {{ $t('performanceAnalytics') }}</div>
43+
<label class="settings-label w-50 mb-0">
44+
{{ $t('performanceAnalytics') }}
45+
</label>
5546
<toggle-switch
47+
class="mb-auto"
5648
v-model="user.preferences.analyticsConsent"
5749
@change="prefToggled()"
5850
/>
5951
</div>
60-
<div class="mb-4">
61-
<small class="gray-100">
52+
<div class="mb-28p">
53+
<small class="gray-50">
6254
{{ $t('usedForSupport') }}
6355
</small>
6456
</div>
57+
<div
58+
class="d-flex justify-content-between align-items-center mb-1"
59+
>
60+
<label class="settings-label w-50 mb-0">
61+
{{ $t('strictlyNecessary') }}
62+
</label>
63+
<toggle-switch
64+
:checked="true"
65+
:disabled="true"
66+
/>
67+
</div>
68+
<small class="gray-50">
69+
{{ $t('requiredToRun') }}
70+
</small>
6571
<save-cancel-buttons
6672
class="mb-4"
6773
:disable-save="!mixinData.inlineSettingMixin.sharedState.inlineSettingUnsavedValues"
@@ -81,17 +87,16 @@
8187
width: fit-content;
8288
}
8389
84-
.mb-28p {
85-
margin-bottom: 28px;
90+
small {
91+
line-height: 1.33;
8692
}
8793
88-
.settings-label.mini {
89-
font-size: 12px;
90-
text-align: right;
94+
.mb-28p {
95+
margin-bottom: 28px;
9196
}
9297
93-
small {
94-
line-height: 1.33;
98+
.popover-box {
99+
margin-top: 1px;
95100
}
96101
97102
.w-66 {

website/client/src/store/actions/auth.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import axios from 'axios';
22
import { authAsCredentialsState, LOCALSTORAGE_AUTH_KEY } from '@/libs/auth';
33

4+
const GA_ID = import.meta.env.GA_ID;
5+
46
function saveLocalDataAuth (store, apiId, apiToken) {
57
const credentialsObj = {
68
auth: {
@@ -121,6 +123,9 @@ export async function appleAuth (store, params) {
121123
export function logout (store, options = {}) {
122124
localStorage.clear();
123125
sessionStorage.clear();
126+
if (window.gtag) {
127+
window.gtag('config', GA_ID, { user_id: null });
128+
}
124129
const query = options.redirectToLogin === true ? '?redirectToLogin=true' : '';
125130
window.location.href = `/logout-server${query}`;
126131
}

0 commit comments

Comments
 (0)