Skip to content

Commit

Permalink
Merge pull request #37 from penginn-0/fix-2024-0325-1
Browse files Browse the repository at this point in the history
Fix:Searchfile/missinglocale
  • Loading branch information
1673beta authored Mar 27, 2024
2 parents 869c610 + 4101d42 commit c7c1d67
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 2 deletions.
3 changes: 3 additions & 0 deletions locales/ja-JP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1800,6 +1800,9 @@ _achievements:
_setNameToNoriDev:
title: "神様コンプレックス(CherryPick)"
description: "名前を noridev に設定した"
_setNameToYojo:
title: "ロリータコンプレックス"
description: "名前を 幼女 に設定した"
_passedSinceAccountCreated1:
title: "一周年"
description: "アカウント作成から1年経過した"
Expand Down
7 changes: 7 additions & 0 deletions packages/backend/src/core/SearchService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,13 @@ export class SearchService {
}
}

if (opts.fileOption) {
if (opts.fileOption === 'file-only') {
query.andWhere('note.fileIds != \'{}\'');
} else if (opts.fileOption === 'no-file') {
query.andWhere('note.fileIds = :fIds', { fIds: '{}' });
}
}
this.queryService.generateVisibilityQuery(query, me);
if (me) this.queryService.generateMutedUserQuery(query, me);
if (me) this.queryService.generateBlockedUserQuery(query, me);
Expand Down
1 change: 1 addition & 0 deletions packages/frontend/src/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export const ROLE_POLICIES = [
'canManageCustomEmojis',
'canManageAvatarDecorations',
'canSearchNotes',
'canAdvancedSearchNotes',
'canUseTranslator',
'canHideAds',
'driveCapacityMb',
Expand Down
10 changes: 9 additions & 1 deletion packages/frontend/src/pages/admin/roles.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,15 @@ SPDX-License-Identifier: AGPL-3.0-only
</MkSwitch>
</MkFolder>

<MkFolder v-if="matchQuery([i18n.ts._role._options.canUseTranslator, 'canSearchNotes'])">
<MkFolder v-if="matchQuery([i18n.ts._role._options.canAdvancedSearchNotes, 'canAdvancedSearchNotes'])">
<template #label>{{ i18n.ts._role._options.canAdvancedSearchNotes }}</template>
<template #suffix>{{ policies.canAdvancedSearchNotes ? i18n.ts.yes : i18n.ts.no }}</template>
<MkSwitch v-model="policies.canAdvancedSearchNotes">
<template #label>{{ i18n.ts.enable }}</template>
</MkSwitch>
</MkFolder>

<MkFolder v-if="matchQuery([i18n.ts._role._options.canUseTranslator, 'canUseTranslator'])">
<template #label>{{ i18n.ts._role._options.canUseTranslator }}</template>
<template #suffix>{{ policies.canUseTranslator ? i18n.ts.yes : i18n.ts.no }}</template>
<MkSwitch v-model="policies.canUseTranslator">
Expand Down
1 change: 0 additions & 1 deletion packages/frontend/src/pages/search.note.vue
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ async function search() {
query: searchQuery.value,
userId: user.value ? user.value.id : null,
origin: searchOrigin.value,
fileOption: isfileOnly.value,
},
};
Expand Down

0 comments on commit c7c1d67

Please sign in to comment.