add warning for role conditions that are dependent on remote data

This commit is contained in:
Hazelnoot 2025-05-09 20:06:33 -04:00
parent 40a73bfcbe
commit 7f3dc6066d
3 changed files with 20 additions and 0 deletions

4
locales/index.d.ts vendored
View file

@ -7722,6 +7722,10 @@ export interface Locale extends ILocale {
*/ */
"remoteFollowingMoreThanOrEq": string; "remoteFollowingMoreThanOrEq": string;
}; };
/**
* This condition may be incorrect for remote users.
*/
"remoteDataWarning": string;
}; };
"_sensitiveMediaDetection": { "_sensitiveMediaDetection": {
/** /**

View file

@ -97,6 +97,11 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkSwitch v-if="type === 'isFromInstance'" v-model="v.subdomains"> <MkSwitch v-if="type === 'isFromInstance'" v-model="v.subdomains">
<template #label>{{ i18n.ts._role._condition.isFromInstanceSubdomains }}</template> <template #label>{{ i18n.ts._role._condition.isFromInstanceSubdomains }}</template>
</MkSwitch> </MkSwitch>
<div v-if="['remoteFollowersLessThanOrEq', 'remoteFollowersMoreThanOrEq', 'remoteFollowingLessThanOrEq', 'remoteFollowingMoreThanOrEq'].includes(type)" :class="$style.warningBanner">
<i class="ti ti-alert-triangle"></i>
{{ i18n.ts._role.remoteDataWarning }}
</div>
</div> </div>
</template> </template>
@ -205,4 +210,14 @@ function removeSelf() {
border-color: var(--MI_THEME-accent); border-color: var(--MI_THEME-accent);
} }
} }
.warningBanner {
color: var(--MI_THEME-warn);
width: 100%;
padding: 0 6px;
> i {
margin-right: 4px;
}
}
</style> </style>

View file

@ -253,6 +253,7 @@ _role:
remoteFollowersMoreThanOrEq: "Has X or more remote followers" remoteFollowersMoreThanOrEq: "Has X or more remote followers"
remoteFollowingLessThanOrEq: "Follows X or fewer remote accounts" remoteFollowingLessThanOrEq: "Follows X or fewer remote accounts"
remoteFollowingMoreThanOrEq: "Follows X or more remote accounts" remoteFollowingMoreThanOrEq: "Follows X or more remote accounts"
remoteDataWarning: "This condition may be incorrect for remote users."
_emailUnavailable: _emailUnavailable:
banned: "This email address is banned" banned: "This email address is banned"
_signup: _signup: