Skip to content

Commit

Permalink
searchbility => searchableBy
Browse files Browse the repository at this point in the history
  • Loading branch information
penginn-net committed Oct 24, 2024
1 parent b1f33ea commit a4eeff2
Show file tree
Hide file tree
Showing 12 changed files with 76 additions and 76 deletions.
4 changes: 2 additions & 2 deletions locales/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ export interface Locale extends ILocale {
/**
* 検索可能範囲を記憶する
*/
"rememberNoteSearchbility": string;
"rememberNotesearchableBy": string;
/**
* 添付取り消し
*/
Expand Down Expand Up @@ -12039,7 +12039,7 @@ export interface Locale extends ILocale {
*/
"confirm": string;
};
"_searchbility": {
"_searchableBy": {
/**
* 検索可能範囲
*/
Expand Down
4 changes: 2 additions & 2 deletions locales/ja-JP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ overwriteFromPinnedEmojisForReaction: "リアクション設定から上書き
overwriteFromPinnedEmojis: "全般設定から上書きする"
reactionSettingDescription2: "ドラッグして並び替え、クリックして削除、+を押して追加します。"
rememberNoteVisibility: "公開範囲を記憶する"
rememberNoteSearchbility: "検索可能範囲を記憶する"
rememberNotesearchableBy: "検索可能範囲を記憶する"
attachCancel: "添付取り消し"
deleteFile: "ファイルを削除"
markAsSensitive: "センシティブとして設定"
Expand Down Expand Up @@ -3217,7 +3217,7 @@ _renoteConfirm:
title: "このノートはリノートしたばかりです"
caption: "リノートしますか?"
confirm: 'リノートする'
_searchbility:
_searchableBy:
tooltip: "検索可能範囲"
canSearch: "が検索できます"
public: "すべてのユーザー"
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/core/AdvancedSearchService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,7 @@ export class AdvancedSearchService {
query: osFilter,
sort: [{ createdAt: { order: 'desc' } }],
},
_source: me ? ['userId', 'visibility', 'visibleUserIds', 'referenceUserId', 'searchbility'] : ['userId', 'visibility'],
_source: me ? ['userId', 'visibility', 'visibleUserIds', 'referenceUserId', 'searchableBy'] : ['userId', 'visibility'],
size: pagination.limit,
} as any;

Expand Down
2 changes: 1 addition & 1 deletion packages/cherrypick-js/etc/cherrypick-js.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2679,7 +2679,7 @@ type NotesCreateResponse = operations['notes___create']['responses']['200']['con
type NotesDeleteRequest = operations['notes___delete']['requestBody']['content']['application/json'];

// @public (undocumented)
export const noteSearchbility: readonly ["public", "followersAndReacted", "reactedOnly", "private"];
export const notesearchableBy: readonly ["public", "followersAndReacted", "reactedOnly", "private"];

// @public (undocumented)
type NotesEventsSearchRequest = operations['notes___events___search']['requestBody']['content']['application/json'];
Expand Down
2 changes: 1 addition & 1 deletion packages/cherrypick-js/src/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const followingVisibilities = ['public', 'followers', 'private'] as const

export const followersVisibilities = ['public', 'followers', 'private'] as const;

export const noteSearchbility = ['public', 'followersAndReacted', 'reactedOnly', 'private'] as const;
export const notesearchableBy = ['public', 'followersAndReacted', 'reactedOnly', 'private'] as const;

export const permissions = [
'read:account',
Expand Down
2 changes: 1 addition & 1 deletion packages/cherrypick-js/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const followingVisibilities = consts.followingVisibilities;
export const followersVisibilities = consts.followersVisibilities;
export const moderationLogTypes = consts.moderationLogTypes;
export const reversiUpdateKeys = consts.reversiUpdateKeys;
export const noteSearchbility = consts.noteSearchbility;
export const notesearchableBy = consts.notesearchableBy;

// api extractor not supported yet
//export * as api from './api.js';
Expand Down
24 changes: 12 additions & 12 deletions packages/frontend/src/components/CPSearchbilityPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,37 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkModal ref="modal" v-slot="{ type }" :zPriority="'high'" :src="src" @click="modal?.close()" @closed="emit('closed')" @esc="modal?.close()">
<div :class="{ [$style.root]: true, [$style.asDrawer]: type === 'drawer', _popup: !defaultStore.state.useBlurEffect || !defaultStore.state.useBlurEffectForModal || !defaultStore.state.removeModalBgColorForBlur, _popupAcrylic: defaultStore.state.useBlurEffect && defaultStore.state.useBlurEffectForModal && defaultStore.state.removeModalBgColorForBlur }">
<div :class="[$style.label, $style.item]">
{{ i18n.ts._searchbility.tooltip }}
{{ i18n.ts._searchableBy.tooltip }}
</div>
<button key="public" class="_button" :class="[$style.item, { [$style.active]: v === 'public' }]" data-index="1" @click="choose('public')">
<div :class="$style.icon"><i class="ti ti-world-search"></i></div>
<div :class="$style.body">
<span :class="$style.itemTitle">{{ i18n.ts._searchbility.public }}</span>
<span :class="$style.itemTitle">{{ i18n.ts._searchableBy.public }}</span>
</div>
</button>
<button key="followersAndReacted" class="_button" :class="[$style.item, { [$style.active]: v === 'followersAndReacted' }]" data-index="2" @click="choose('followersAndReacted')">
<div :class="$style.icon"><i class="ti ti-user-search"></i></div>
<div :class="$style.body">
<span :class="$style.itemTitle">{{ i18n.ts._searchbility.followersAndReacted }}</span>
<span :class="$style.itemTitle">{{ i18n.ts._searchableBy.followersAndReacted }}</span>
</div>
</button>
<button key="reactedOnly" class="_button" :class="[$style.item, { [$style.active]: v === 'reactedOnly' }]" data-index="3" @click="choose('reactedOnly')">
<div :class="$style.icon"><i class="ti ti-lock-search"></i></div>
<div :class="$style.body">
<span :class="$style.itemTitle">{{ i18n.ts._searchbility.reactedOnly }}</span>
<span :class="$style.itemTitle">{{ i18n.ts._searchableBy.reactedOnly }}</span>
</div>
</button>
<button key="private" class="_button" :class="[$style.item, { [$style.active]: v === 'private' }]" data-index="4" @click="choose('private')">
<div :class="$style.icon"><i class="ti ti-mail-search"></i></div>
<div :class="$style.body">
<span :class="$style.itemTitle">{{ i18n.ts._searchbility.private }}</span>
<span :class="$style.itemTitle">{{ i18n.ts._searchableBy.private }}</span>
</div>
</button>

<MkDivider style="margin: 5px 0;"/>

<div :class="$style.item">
<MkSwitch v-model="rememberNoteSearchbility">{{ i18n.ts.rememberNoteSearchbility }}</MkSwitch>
<MkSwitch v-model="rememberNotesearchableBy">{{ i18n.ts.rememberNotesearchableBy }}</MkSwitch>
</div>
</div>
</MkModal>
Expand All @@ -55,23 +55,23 @@ import { defaultStore } from '@/store.js';
const modal = shallowRef<InstanceType<typeof MkModal>>();

const props = withDefaults(defineProps<{
currentSearchbility: typeof Misskey.noteSearchbility[number];
currentsearchableBy: typeof Misskey.notesearchableBy[number];
src?: HTMLElement;
}>(), {
});

const emit = defineEmits<{
(ev: 'changeSearchbility', v: typeof Misskey.noteSearchbility[number]): void;
(ev: 'changesearchableBy', v: typeof Misskey.notesearchableBy[number]): void;
(ev: 'closed'): void;
}>();

const rememberNoteSearchbility = computed(defaultStore.makeGetterSetter('rememberNoteSearchbility'));
const rememberNotesearchableBy = computed(defaultStore.makeGetterSetter('rememberNotesearchableBy'));

const v = ref(props.currentSearchbility);
const v = ref(props.currentsearchableBy);

function choose(searchbility: typeof Misskey.noteSearchbility[number]): void {
function choose(searchableBy: typeof Misskey.notesearchableBy[number]): void {
v.value =searchableBy ;
emit('changeSearchbility',searchableBy );
emit('changesearchableBy',searchableBy );
nextTick(() => {
if (modal.value) modal.value.close();
});
Expand Down
34 changes: 17 additions & 17 deletions packages/frontend/src/components/MkPostForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ SPDX-License-Identifier: AGPL-3.0-only
<span v-if="visibility === 'specified'"><i class="ti ti-mail"></i></span>
<span :class="$style.headerRightButtonText">{{ i18n.ts._visibility[visibility] }}</span>
</button>
<button v-if="channel == null" ref="searchbilityButton" v-click-anime v-tooltip="i18n.ts._searchbility.tooltip" :class="['_button', $style.headerRightItem, $style.visibility]" @click="setSearchbility">
<span v-if="searchbility === 'public'"><i class="ti ti-world-search"></i></span>
<span v-if="searchbility === 'followersAndReacted'"><i class="ti ti-user-search"></i></span>
<span v-if="searchbility === 'reactedOnly'"><i class="ti ti-lock-search"></i></span>
<span v-if="searchbility === 'private'"><i class="ti ti-mail-search"></i></span>
<span :class="$style.headerRightButtonText">{{ i18n.ts._searchbility[searchbility] }}</span>
<button v-if="channel == null" ref="searchableByButton" v-click-anime v-tooltip="i18n.ts._searchableBy.tooltip" :class="['_button', $style.headerRightItem, $style.visibility]" @click="setsearchableBy">
<span v-if="searchableBy === 'public'"><i class="ti ti-world-search"></i></span>
<span v-if="searchableBy === 'followersAndReacted'"><i class="ti ti-user-search"></i></span>
<span v-if="searchableBy === 'reactedOnly'"><i class="ti ti-lock-search"></i></span>
<span v-if="searchableBy === 'private'"><i class="ti ti-mail-search"></i></span>
<span :class="$style.headerRightButtonText">{{ i18n.ts._searchableBy[searchableBy] }}</span>
</button>
<button v-else class="_button" :class="[$style.headerRightItem, $style.visibility]" disabled>
<span><i class="ti ti-device-tv"></i></span>
Expand Down Expand Up @@ -188,7 +188,7 @@ const textareaEl = shallowRef<HTMLTextAreaElement | null>(null);
const cwInputEl = shallowRef<HTMLInputElement | null>(null);
const hashtagsInputEl = shallowRef<HTMLInputElement | null>(null);
const visibilityButton = shallowRef<HTMLElement>();
constsearchableBy Button = shallowRef<HTMLElement>();
const searchableByButton = shallowRef<HTMLElement>();

const posting = ref(false);
const posted = ref(false);
Expand All @@ -213,7 +213,7 @@ const showAddMfmFunction = ref(defaultStore.state.enableQuickAddMfmFunction);
watch(showAddMfmFunction, () => defaultStore.set('enableQuickAddMfmFunction', showAddMfmFunction.value));
const cw = ref<string | null>(props.initialCw ?? null);
const visibility = ref(props.initialVisibility ?? (defaultStore.state.rememberNoteVisibility ? defaultStore.state.visibility : defaultStore.state.defaultNoteVisibility));
constsearchableBy = ref(defaultStore.state.rememberNoteSearchbility ? defaultStore.state.searchbility : defaultStore.state.defaultNoteSearchbility);
const searchableBy = ref(defaultStore.state.rememberNotesearchableBy ? defaultStore.state.searchableBy : defaultStore.state.defaultNotesearchableBy);
const visibleUsers = ref<Misskey.entities.UserDetailed[]>([]);
if (props.initialVisibleUsers) {
props.initialVisibleUsers.forEach(u => pushVisibleUser(u));
Expand Down Expand Up @@ -529,15 +529,15 @@ function setVisibility() {
});
}

function setSearchbility() {
const { dispose } = os.popup(defineAsyncComponent(() => import('@/components/CPSearchbilityPicker.vue')), {
currentSearchbility:searchableBy .value,
function setsearchableBy() {
const { dispose } = os.popup(defineAsyncComponent(() => import('@/components/CPsearchableByPicker.vue')), {
currentsearchableBy:searchableBy .value,
src:searchableBy Button.value,
}, {
changeSearchbility: v => {
searchbility.value = v;
if (defaultStore.state.rememberNoteSearchbility) {
defaultStore.set('searchbility',searchableBy .value);
changesearchableBy: v => {
searchableBy.value = v;
if (defaultStore.state.rememberNotesearchableBy) {
defaultStore.set('searchableBy',searchableBy .value);
}
},
closed: () => dispose(),
Expand Down Expand Up @@ -1059,7 +1059,7 @@ onMounted(() => {
cw.value = draft.data.cw;
disableRightClick.value = draft.data.disableRightClick;
visibility.value = draft.data.visibility;
searchbility.value = draft.data.searchbility;
searchableBy.value = draft.data.searchableBy;
files.value = (draft.data.files || []).filter(draftFile => draftFile);
if (draft.data.poll) {
poll.value = draft.data.poll;
Expand All @@ -1084,7 +1084,7 @@ onMounted(() => {
useCw.value = init.cw != null;
cw.value = init.cw ?? null;
visibility.value = init.visibility;
searchbility.value = init.searchbility;
searchableBy.value = init.searchableBy;
files.value = init.files ?? [];
if (init.isSchedule) {
schedule.value = {
Expand Down
34 changes: 17 additions & 17 deletions packages/frontend/src/components/MkPostFormSimple.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ SPDX-License-Identifier: AGPL-3.0-only
<span :class="$style.headerRightButtonText">{{ i18n.ts._visibility[visibility] }}</span>
</button>

<button v-if="channel == null" ref="searchbilityButton" v-click-anime v-tooltip="i18n.ts._searchbility.tooltip" :class="['_button', $style.headerRightItem, $style.visibility]" @click="setSearchbility">
<span v-if="searchbility === 'public'"><i class="ti ti-world-search"></i></span>
<span v-if="searchbility === 'followersAndReacted'"><i class="ti ti-user-search"></i></span>
<span v-if="searchbility === 'reactedOnly'"><i class="ti ti-lock-search"></i></span>
<span v-if="searchbility === 'private'"><i class="ti ti-mail-search"></i></span>
<span :class="$style.headerRightButtonText">{{ i18n.ts._searchbility[searchbility] }}</span>
<button v-if="channel == null" ref="searchableByButton" v-click-anime v-tooltip="i18n.ts._searchableBy.tooltip" :class="['_button', $style.headerRightItem, $style.visibility]" @click="setsearchableBy">
<span v-if="searchableBy === 'public'"><i class="ti ti-world-search"></i></span>
<span v-if="searchableBy === 'followersAndReacted'"><i class="ti ti-user-search"></i></span>
<span v-if="searchableBy === 'reactedOnly'"><i class="ti ti-lock-search"></i></span>
<span v-if="searchableBy === 'private'"><i class="ti ti-mail-search"></i></span>
<span :class="$style.headerRightButtonText">{{ i18n.ts._searchableBy[searchableBy] }}</span>
</button>
<button v-else class="_button" :class="[$style.headerRightItem, $style.visibility]" disabled>
<span><i class="ti ti-device-tv"></i></span>
Expand Down Expand Up @@ -201,7 +201,7 @@ const textareaEl = shallowRef<HTMLTextAreaElement | null>(null);
const cwInputEl = shallowRef<HTMLInputElement | null>(null);
const hashtagsInputEl = shallowRef<HTMLInputElement | null>(null);
const visibilityButton = shallowRef<HTMLElement | null>(null);
constsearchableBy Button = shallowRef<HTMLElement | null>();
const searchableBy Button = shallowRef<HTMLElement | null>();

const showForm = ref(false);

Expand All @@ -225,7 +225,7 @@ const showAddMfmFunction = ref(defaultStore.state.enableQuickAddMfmFunction);
watch(showAddMfmFunction, () => defaultStore.set('enableQuickAddMfmFunction', showAddMfmFunction.value));
const cw = ref<string | null>(props.initialCw ?? null);
const visibility = ref(props.initialVisibility ?? (defaultStore.state.rememberNoteVisibility ? defaultStore.state.visibility : defaultStore.state.defaultNoteVisibility) as typeof Misskey.noteVisibilities[number]);
constsearchableBy = ref(defaultStore.state.rememberNoteSearchbility ? defaultStore.state.searchbility : defaultStore.state.defaultNoteSearchbility);
const searchableBy = ref(defaultStore.state.rememberNotesearchableBy ? defaultStore.state.searchableBy : defaultStore.state.defaultNotesearchableBy);
const visibleUsers = ref<Misskey.entities.UserDetailed[]>([]);
if (props.initialVisibleUsers) {
props.initialVisibleUsers.forEach(u => pushVisibleUser(u));
Expand Down Expand Up @@ -505,15 +505,15 @@ function setVisibility() {
});
}

function setSearchbility() {
const { dispose } = os.popup(defineAsyncComponent(() => import('@/components/CPSearchbilityPicker.vue')), {
currentSearchbility:searchableBy .value,
function setsearchableBy() {
const { dispose } = os.popup(defineAsyncComponent(() => import('@/components/CPsearchableByPicker.vue')), {
currentsearchableBy:searchableBy .value,
src:searchableBy Button.value,
}, {
changeSearchbility: v => {
searchbility.value = v;
if (defaultStore.state.rememberNoteSearchbility) {
defaultStore.set('searchbility',searchableBy .value);
changesearchableBy: v => {
searchableBy.value = v;
if (defaultStore.state.rememberNotesearchableBy) {
defaultStore.set('searchableBy',searchableBy .value);
}
},
closed: () => dispose(),
Expand Down Expand Up @@ -1071,7 +1071,7 @@ onMounted(() => {
cw.value = draft.data.cw;
disableRightClick.value = draft.data.disableRightClick;
visibility.value = draft.data.visibility;
searchbility.value = draft.data.searchbility;
searchableBy.value = draft.data.searchableBy;
files.value = (draft.data.files || []).filter(draftFile => draftFile);
if (draft.data.poll) {
poll.value = draft.data.poll;
Expand All @@ -1096,7 +1096,7 @@ onMounted(() => {
useCw.value = init.cw != null;
cw.value = init.cw ?? null;
visibility.value = init.visibility;
searchbility.value = init.searchbility;
searchableBy.value = init.searchableBy;
files.value = init.files ?? [];
if (init.poll) {
poll.value = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ SPDX-License-Identifier: AGPL-3.0-only
<template #icon><i class="ti ti-search"></i></template>
<div class="_gaps_m">
<MkSelect v-model="searchableBy">
<option value="public">{{ i18n.ts._searchbility.public }}</option>
<option value="followersAndReacted">{{ i18n.ts._searchbility.followersAndReacted }}</option>
<option value="reactedOnly">{{ i18n.ts._searchbility.reactedOnly }}</option>
<option value="private">{{ i18n.ts._searchbility.private }}</option>
<option value="public">{{ i18n.ts._searchableBy.public }}</option>
<option value="followersAndReacted">{{ i18n.ts._searchableBy.followersAndReacted }}</option>
<option value="reactedOnly">{{ i18n.ts._searchableBy.reactedOnly }}</option>
<option value="private">{{ i18n.ts._searchableBy.private }}</option>
</MkSelect>
<MkInfo>{{ i18n.ts.makeSearchableByDescription }}</MkInfo>
</div>
Expand Down
Loading

0 comments on commit a4eeff2

Please sign in to comment.