mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-10-25 19:23:03 +02:00
Updates & Fixes: Fix Orb of Rebirth bug, update blocked player ToS message, Fix redundant disabled styling (#15494)
* add new frontend files * Add UI for managing blockers * correctly reset local data after creating blocker * Tweak wording * Add UI for managing blockers * restructure admin pages * add blocker to block emails from registration * lint fixes * Await genericPurchase completion before page reload to prevent request cancellation. Also adds defensive check for undefined error.response in axios interceptor to prevent "t.response undefined" errors. * Fix shop tabs overflow off screen at certain zoom levels Fix quest cards get cut off on small screens Fix pop-up windows extend past screen edges on mobile * Update ToS error message - Updated account suspension message from "This account, User ID..." to "Your account @[username] has been blocked..." - Modified server auth middleware to pass username parameter when throwing account suspended error -Modified auth utils loginRes function to include username in suspended account error - Updated client bannedAccountModal component to pass username (empty string if unavailable) - Updated login test to expect username in account suspended message * lint fix * Responsive Layout for Equipment Containers - Added responsive CSS for mobile (<768px) and tablet (769px-1024px) - Implemented flex-wrap layout that automatically stacks items in rows of 4 on smaller * remove redundant disabled styles in task modals The .disabled class conflicting with existing disabled state implementations * Revert "Merge branch 'fiz/item-container-scaling' into qa/bat" This reverts commit4f28bfaad4, reversing changes made to477dd6328a. * fix(blockers): duplicated code from rebase * fix(admin): revert accidental change from rebase * move !error.response to correct level !error.response before any attempt to access error.response.status * chore(github): split responsiveness to #15514 --------- Co-authored-by: Phillip Thelen <phillip@habitica.com> Co-authored-by: Kalista Payne <kalista@habitica.com>
This commit is contained in:
@@ -44,7 +44,7 @@ describe('POST /user/auth/local/login', () => {
|
||||
})).to.eventually.be.rejected.and.eql({
|
||||
code: 401,
|
||||
error: 'NotAuthorized',
|
||||
message: t('accountSuspended', { communityManagerEmail: nconf.get('EMAILS_COMMUNITY_MANAGER_EMAIL'), userId: user._id }),
|
||||
message: t('accountSuspended', { communityManagerEmail: nconf.get('EMAILS_COMMUNITY_MANAGER_EMAIL'), userId: user._id, username: user.auth.local.username }),
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -203,6 +203,9 @@ export default {
|
||||
|
||||
return response;
|
||||
}, error => { // Set up Error interceptors
|
||||
if (!error.response) {
|
||||
return Promise.reject(error);
|
||||
}
|
||||
if (error.response.status >= 400) {
|
||||
const isBanned = this.checkForBannedUser(error);
|
||||
if (isBanned === true) return null; // eslint-disable-line consistent-return
|
||||
|
||||
@@ -43,9 +43,11 @@ export default {
|
||||
const AUTH_SETTINGS = localStorage.getItem(LOCALSTORAGE_AUTH_KEY);
|
||||
const parseSettings = JSON.parse(AUTH_SETTINGS);
|
||||
const userId = parseSettings ? parseSettings.auth.apiId : '';
|
||||
const username = this.$store?.state?.user?.data?.auth?.local?.username || '';
|
||||
|
||||
return this.$t('accountSuspended', {
|
||||
userId,
|
||||
username,
|
||||
communityManagerEmail: COMMUNITY_MANAGER_EMAIL,
|
||||
});
|
||||
},
|
||||
|
||||
@@ -851,7 +851,7 @@ export default {
|
||||
return;
|
||||
}
|
||||
if (this.genericPurchase) {
|
||||
this.makeGenericPurchase(this.item, 'buyModal', this.selectedAmountToBuy);
|
||||
await this.makeGenericPurchase(this.item, 'buyModal', this.selectedAmountToBuy);
|
||||
await this.purchased(this.item.text);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
</button>
|
||||
<button
|
||||
class="btn btn-secondary d-flex align-items-center justify-content-center"
|
||||
:class="{disabled: !canSave}"
|
||||
:class="{'btn-disabled': !canSave}"
|
||||
type="button"
|
||||
@click="submit()"
|
||||
>
|
||||
@@ -162,13 +162,13 @@
|
||||
>
|
||||
<div
|
||||
class="habit-option-icon svg-icon no-transition"
|
||||
:class="task.up ? '' : 'disabled'"
|
||||
:class="task.up ? '' : 'icon-disabled'"
|
||||
v-html="icons.positive"
|
||||
></div>
|
||||
</div>
|
||||
<div
|
||||
class="habit-option-label no-transition"
|
||||
:class="task.up ? cssClass('icon') : 'disabled'"
|
||||
:class="task.up ? cssClass('icon') : 'label-disabled'"
|
||||
>
|
||||
{{ $t('positive') }}
|
||||
</div>
|
||||
@@ -188,13 +188,13 @@
|
||||
>
|
||||
<div
|
||||
class="habit-option-icon no-transition svg-icon negative mx-auto"
|
||||
:class="task.down ? '' : 'disabled'"
|
||||
:class="task.down ? '' : 'icon-disabled'"
|
||||
v-html="icons.negative"
|
||||
></div>
|
||||
</div>
|
||||
<div
|
||||
class="habit-option-label no-transition"
|
||||
:class="task.down ? cssClass('icon') : 'disabled'"
|
||||
:class="task.down ? cssClass('icon') : 'label-disabled'"
|
||||
>
|
||||
{{ $t('negative') }}
|
||||
</div>
|
||||
@@ -592,7 +592,7 @@
|
||||
<button
|
||||
class="btn btn-primary btn-footer
|
||||
d-flex align-items-center justify-content-center"
|
||||
:class="{disabled: !canSave}"
|
||||
:class="{'btn-disabled': !canSave}"
|
||||
type="button"
|
||||
@click="submit()"
|
||||
>
|
||||
@@ -881,12 +881,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
.disabled {
|
||||
.btn-disabled {
|
||||
background-color: $white;
|
||||
border: 2px solid transparent;
|
||||
color: $gray-200;
|
||||
line-height: 1.714;
|
||||
box-shadow: 0px 1px 3px 0px rgba(26, 24, 29, 0.12), 0px 1px 2px 0px rgba(26, 24, 29, 0.24);
|
||||
cursor: not-allowed;
|
||||
opacity: 0.6;
|
||||
|
||||
&:focus {
|
||||
background-color: $white;
|
||||
@@ -948,7 +950,7 @@
|
||||
height: 10px;
|
||||
color: $white;
|
||||
|
||||
&.disabled {
|
||||
&.icon-disabled {
|
||||
color: $gray-200;
|
||||
}
|
||||
|
||||
@@ -962,7 +964,7 @@
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
|
||||
&.disabled {
|
||||
&.label-disabled {
|
||||
color: $gray-100;
|
||||
font-weight: normal;
|
||||
}
|
||||
@@ -1018,7 +1020,7 @@
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.disabled .input-group-text {
|
||||
.input-group-outer.disabled .input-group-text {
|
||||
color: $gray-200;
|
||||
}
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@
|
||||
.toggle-switch-inner:before {
|
||||
content: "";
|
||||
padding-left: 10px;
|
||||
background-color: $green-10;
|
||||
background-color: $green-50;
|
||||
}
|
||||
|
||||
.toggle-switch-inner:after {
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
"passwordReset": "If we have your email or username on file, instructions for setting a new password have been sent to your email.",
|
||||
"invalidLoginCredentialsLong": "Your email, username, or password are incorrect. Please try again or use \"Forgot Password.\"",
|
||||
"invalidCredentials": "There is no account that uses those credentials.",
|
||||
"accountSuspended": "This account, User ID \"<%= userId %>\", has been blocked for breaking the Community Guidelines (https://habitica.com/static/community-guidelines) or Terms of Service (https://habitica.com/static/terms). For details or to ask to be unblocked, please email our Community Manager at <%= communityManagerEmail %> or ask your parent or guardian to email them. Please include your @Username in the email.",
|
||||
"accountSuspended": "Your account @<%= username %> has been blocked. For additional information, or to request an appeal, email admin@habitica.com with your Habitica username or User ID.",
|
||||
"accountSuspendedTitle": "Account has been suspended",
|
||||
"unsupportedNetwork": "This network is not currently supported.",
|
||||
"cantDetachSocial": "Account lacks another authentication method; can't detach this authentication method.",
|
||||
|
||||
@@ -17,7 +17,11 @@ export function loginRes (user, req, res) {
|
||||
if (user.auth.blocked) {
|
||||
throw new NotAuthorized(res.t(
|
||||
'accountSuspended',
|
||||
{ communityManagerEmail: COMMUNITY_MANAGER_EMAIL, userId: user._id },
|
||||
{
|
||||
communityManagerEmail: COMMUNITY_MANAGER_EMAIL,
|
||||
userId: user._id,
|
||||
username: user.auth.local.username,
|
||||
},
|
||||
));
|
||||
}
|
||||
const urlPath = url.parse(req.url).pathname;
|
||||
|
||||
@@ -100,6 +100,7 @@ export function authWithHeaders (options = {}) {
|
||||
throw new NotAuthorized(common.i18n.t('accountSuspended', {
|
||||
communityManagerEmail: COMMUNITY_MANAGER_EMAIL,
|
||||
userId: user._id,
|
||||
username: user.auth.local.username,
|
||||
}, language));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user