diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2023-03-13 17:52:24 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2023-03-13 17:52:24 +0900 |
| commit | 5d1ccb9bdcbe3949a52f0b6f2b057a53b6652579 (patch) | |
| tree | d77f06e5a2fc9e574b4b295b11a47aa996e6984d /packages/frontend | |
| parent | feat: sensitive word (diff) | |
| download | misskey-5d1ccb9bdcbe3949a52f0b6f2b057a53b6652579.tar.gz misskey-5d1ccb9bdcbe3949a52f0b6f2b057a53b6652579.tar.bz2 misskey-5d1ccb9bdcbe3949a52f0b6f2b057a53b6652579.zip | |
enhance: make configurable to whether notes search available by role
Resolve #10318
Diffstat (limited to 'packages/frontend')
| -rw-r--r-- | packages/frontend/src/const.ts | 1 | ||||
| -rw-r--r-- | packages/frontend/src/pages/admin/roles.editor.vue | 20 | ||||
| -rw-r--r-- | packages/frontend/src/pages/admin/roles.vue | 28 |
3 files changed, 30 insertions, 19 deletions
diff --git a/packages/frontend/src/const.ts b/packages/frontend/src/const.ts index 46ebc7d6a3..1d1b8fcea4 100644 --- a/packages/frontend/src/const.ts +++ b/packages/frontend/src/const.ts @@ -53,6 +53,7 @@ export const ROLE_POLICIES = [ 'canPublicNote', 'canInvite', 'canManageCustomEmojis', + 'canSearchNotes', 'canHideAds', 'driveCapacityMb', 'pinLimit', diff --git a/packages/frontend/src/pages/admin/roles.editor.vue b/packages/frontend/src/pages/admin/roles.editor.vue index 408bbc6460..873ff02feb 100644 --- a/packages/frontend/src/pages/admin/roles.editor.vue +++ b/packages/frontend/src/pages/admin/roles.editor.vue @@ -187,6 +187,26 @@ </div> </MkFolder> + <MkFolder v-if="matchQuery([i18n.ts._role._options.canSearchNotes, 'canSearchNotes'])"> + <template #label>{{ i18n.ts._role._options.canSearchNotes }}</template> + <template #suffix> + <span v-if="role.policies.canSearchNotes.useDefault" :class="$style.useDefaultLabel">{{ i18n.ts._role.useBaseValue }}</span> + <span v-else>{{ role.policies.canSearchNotes.value ? i18n.ts.yes : i18n.ts.no }}</span> + <span :class="$style.priorityIndicator"><i :class="getPriorityIcon(role.policies.canSearchNotes)"></i></span> + </template> + <div class="_gaps"> + <MkSwitch v-model="role.policies.canSearchNotes.useDefault" :readonly="readonly"> + <template #label>{{ i18n.ts._role.useBaseValue }}</template> + </MkSwitch> + <MkSwitch v-model="role.policies.canSearchNotes.value" :disabled="role.policies.canSearchNotes.useDefault" :readonly="readonly"> + <template #label>{{ i18n.ts.enable }}</template> + </MkSwitch> + <MkRange v-model="role.policies.canSearchNotes.priority" :min="0" :max="2" :step="1" easing :text-converter="(v) => v === 0 ? i18n.ts._role._priority.low : v === 1 ? i18n.ts._role._priority.middle : v === 2 ? i18n.ts._role._priority.high : ''"> + <template #label>{{ i18n.ts._role.priority }}</template> + </MkRange> + </div> + </MkFolder> + <MkFolder v-if="matchQuery([i18n.ts._role._options.driveCapacity, 'driveCapacityMb'])"> <template #label>{{ i18n.ts._role._options.driveCapacity }}</template> <template #suffix> diff --git a/packages/frontend/src/pages/admin/roles.vue b/packages/frontend/src/pages/admin/roles.vue index 25d8f3ad6e..351a44bec0 100644 --- a/packages/frontend/src/pages/admin/roles.vue +++ b/packages/frontend/src/pages/admin/roles.vue @@ -56,6 +56,14 @@ </MkFolder> <MkFolder> + <template #label>{{ i18n.ts._role._options.canSearchNotes }}</template> + <template #suffix>{{ policies.canSearchNotes ? i18n.ts.yes : i18n.ts.no }}</template> + <MkSwitch v-model="policies.canSearchNotes"> + <template #label>{{ i18n.ts.enable }}</template> + </MkSwitch> + </MkFolder> + + <MkFolder> <template #label>{{ i18n.ts._role._options.driveCapacity }}</template> <template #suffix>{{ policies.driveCapacityMb }}MB</template> <MkInput v-model="policies.driveCapacityMb" type="number"> @@ -167,25 +175,7 @@ import { definePageMetadata } from '@/scripts/page-metadata'; import { instance } from '@/instance'; import { useRouter } from '@/router'; import MkFoldableSection from '@/components/MkFoldableSection.vue'; - -const ROLE_POLICIES = [ - 'gtlAvailable', - 'ltlAvailable', - 'canPublicNote', - 'canInvite', - 'canManageCustomEmojis', - 'canHideAds', - 'driveCapacityMb', - 'pinLimit', - 'antennaLimit', - 'wordMuteLimit', - 'webhookLimit', - 'clipLimit', - 'noteEachClipsLimit', - 'userListLimit', - 'userEachUserListsLimit', - 'rateLimitFactor', -] as const; +import { ROLE_POLICIES } from '@/const'; const router = useRouter(); |