Skip to content
This repository was archived by the owner on Feb 23, 2026. It is now read-only.

Commit 4774311

Browse files
committed
ポイント送信ポリシーを追加
1 parent 45a6de0 commit 4774311

File tree

6 files changed

+36
-1
lines changed

6 files changed

+36
-1
lines changed

locales/index.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7357,6 +7357,10 @@ export interface Locale extends ILocale {
73577357
* ログインボーナスの付与
73587358
*/
73597359
"loginBonusGrantEnabled": string;
7360+
/**
7361+
* ポイントの送信
7362+
*/
7363+
"canSendPoints": string;
73607364
/**
73617365
* 絵文字ピッカーのプロファイルの上限数(最大5)
73627366
*/

locales/ja-JP.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1900,6 +1900,7 @@ _role:
19001900
_options:
19011901
gtlAvailable: "グローバルタイムラインの閲覧"
19021902
loginBonusGrantEnabled: "ログインボーナスの付与"
1903+
canSendPoints: "ポイントの送信"
19031904
emojiPickerProfileLimit: "絵文字ピッカーのプロファイルの上限数(最大5)"
19041905
ltlAvailable: "ローカルタイムラインの閲覧"
19051906
canPublicNote: "パブリック投稿の許可"

packages/backend/src/core/RoleService.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export type RolePolicies = {
6565
listPinnedLimit: number;
6666
localTimelineAnyLimit: number;
6767
loginBonusGrantEnabled: boolean;
68+
canSendPoints: boolean;
6869
canImportAntennas: boolean;
6970
canImportBlocking: boolean;
7071
canImportFollowing: boolean;
@@ -111,6 +112,7 @@ export const DEFAULT_POLICIES: RolePolicies = {
111112
listPinnedLimit: 2,
112113
localTimelineAnyLimit: 3,
113114
loginBonusGrantEnabled: true,
115+
canSendPoints: false,
114116
};
115117

116118
@Injectable()
@@ -423,6 +425,7 @@ export class RoleService implements OnApplicationShutdown, OnModuleInit {
423425
listPinnedLimit: calc('listPinnedLimit', vs => Math.max(...vs)),
424426
localTimelineAnyLimit: calc('localTimelineAnyLimit', vs => Math.max(...vs)),
425427
loginBonusGrantEnabled: calc('loginBonusGrantEnabled', vs => vs.some(v => v === true)),
428+
canSendPoints: calc('canSendPoints', vs => vs.some(v => v === true)),
426429
};
427430
}
428431

packages/frontend-shared/js/const.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ export const ROLE_POLICIES = [
109109
'listPinnedLimit',
110110
'localTimelineAnyLimit',
111111
'loginBonusGrantEnabled',
112+
'canSendPoints',
112113
'canImportAntennas',
113114
'canImportBlocking',
114115
'canImportFollowing',

packages/frontend/src/pages/admin/roles.editor.vue

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ SPDX-License-Identifier: AGPL-3.0-only
427427
</MkRange>
428428
</div>
429429
</MkFolder>
430-
<MkFolder v-if="matchQuery([i18n.ts._role._options.loginBonusGrantEnabled, 'loginBonusGrantEnabled'])">
430+
<MkFolder v-if="matchQuery([i18n.ts._role._options.loginBonusGrantEnabled, 'loginBonusGrantEnabled'])" class="_margin">
431431
<template #label>{{ i18n.ts._role._options.loginBonusGrantEnabled }}</template>
432432
<template #suffix>
433433
<span v-if="role.policies.loginBonusGrantEnabled.useDefault" :class="$style.useDefaultLabel">{{ i18n.ts._role.useBaseValue }}</span>
@@ -446,6 +446,25 @@ SPDX-License-Identifier: AGPL-3.0-only
446446
</MkRange>
447447
</div>
448448
</MkFolder>
449+
<MkFolder v-if="matchQuery([i18n.ts._role._options.canSendPoints, 'canSendPoints'])" class="_margin">
450+
<template #label>{{ i18n.ts._role._options.canSendPoints }}</template>
451+
<template #suffix>
452+
<span v-if="role.policies.canSendPoints.useDefault" :class="$style.useDefaultLabel">{{ i18n.ts._role.useBaseValue }}</span>
453+
<span v-else>{{ role.policies.canSendPoints.value ? i18n.ts.yes : i18n.ts.no }}</span>
454+
<span :class="$style.priorityIndicator"><i :class="getPriorityIcon(role.policies.canSendPoints)"></i></span>
455+
</template>
456+
<div class="_gaps">
457+
<MkSwitch v-model="role.policies.canSendPoints.useDefault" :readonly="readonly">
458+
<template #label>{{ i18n.ts._role.useBaseValue }}</template>
459+
</MkSwitch>
460+
<MkSwitch v-model="role.policies.canSendPoints.value" :disabled="role.policies.canSendPoints.useDefault" :readonly="readonly">
461+
<template #label>{{ i18n.ts.enable }}</template>
462+
</MkSwitch>
463+
<MkRange v-model="role.policies.canSendPoints.priority" :min="0" :max="2" :step="1" easing :textConverter="(v) => v === 0 ? i18n.ts._role._priority.low : v === 1 ? i18n.ts._role._priority.middle : v === 2 ? i18n.ts._role._priority.high : ''">
464+
<template #label>{{ i18n.ts._role.priority }}</template>
465+
</MkRange>
466+
</div>
467+
</MkFolder>
449468
</MkFoldableSection>
450469
<MkFoldableSection>
451470
<template #header>{{ i18n.ts.drive }}, {{ i18n.ts.files }}</template>

packages/frontend/src/pages/admin/roles.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,13 @@ SPDX-License-Identifier: AGPL-3.0-only
165165
<template #label>{{ i18n.ts.enable }}</template>
166166
</MkSwitch>
167167
</MkFolder>
168+
<MkFolder v-if="matchQuery([i18n.ts._role._options.canSendPoints, 'canSendPoints'])" class="_margin">
169+
<template #label>{{ i18n.ts._role._options.canSendPoints }}</template>
170+
<template #suffix>{{ policies.canSendPoints ? i18n.ts.yes : i18n.ts.no }}</template>
171+
<MkSwitch v-model="policies.canSendPoints">
172+
<template #label>{{ i18n.ts.enable }}</template>
173+
</MkSwitch>
174+
</MkFolder>
168175
</MkFoldableSection>
169176
<MkFoldableSection>
170177
<template #header>カスタム絵文字系</template>

0 commit comments

Comments
 (0)