Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat:AdvancedSearch/Fix:Reaction Viewer #6

Merged
merged 63 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
c7a5a07
Merge pull request #28 from 1673beta/develop
1673beta Mar 23, 2024
388542d
fix: Reaction Viewer
1673beta Mar 24, 2024
918eecc
feat: Files Only Search Option
1673beta Mar 24, 2024
7113343
Merge branch 'engawa' into kokonect-link-develop-alpha
1673beta Mar 24, 2024
8de3b52
feat: Files Only Search Option
1673beta Mar 24, 2024
0b8be29
missinglocale
penginn-net Mar 25, 2024
c816b21
fix:frontend
penginn-net Mar 25, 2024
ccdaded
Merge branch 'kokonect-link-develop-alpha' into develop
1673beta Mar 25, 2024
ebcbac6
Merge pull request #36 from penginn-0/develop
1673beta Mar 25, 2024
4b3a69d
fix: missing endpoint
1673beta Mar 25, 2024
addb71e
feat: custom achievement
1673beta Mar 25, 2024
7a6dbd4
fix: file search
1673beta Mar 25, 2024
869c610
fix
1673beta Mar 25, 2024
f716825
[WIP]feat: advanced search
1673beta Mar 27, 2024
4c3b2f8
[WIP]: advanced-search
1673beta Mar 30, 2024
89ff3ce
[WIP]feat: Direct Message Searching
1673beta Apr 14, 2024
45c1a61
delete: 不要なコンポーネントを削除
1673beta Apr 14, 2024
7ec8542
fix: 日時指定をトグルボタンで切り替えるのが不要なので削除
1673beta Apr 14, 2024
8f0cbcd
fix: 検索が壊れていたのを修正
1673beta Apr 16, 2024
96e83f0
ロケール追加
penginn-net Apr 16, 2024
8e689de
fix: ロケール追加忘れてたのを修正
1673beta Apr 16, 2024
cbdd359
fix(backend): なんか壊れてたのを修正
1673beta Apr 16, 2024
195fe7d
フロントエンド調整
penginn-net Apr 16, 2024
4e808c0
ロケール
penginn-net Apr 16, 2024
84152d9
ロケールコメント
penginn-net Apr 16, 2024
65aa3af
Revert "フロントエンド調整"
1673beta Apr 17, 2024
f344957
fix: 高度な検索が使えない際にオプションがすべて使えなくなる問題を修正
1673beta Apr 21, 2024
f8c8751
fix: RoleEditorで編集できないのを修正
1673beta Apr 21, 2024
48aa233
Merge branch 'develop' into advanced-search
1673beta Apr 21, 2024
28f3913
cherrypick-jsの更新
Apr 25, 2024
63981c7
fix(frontend): Formslotを使うことで整理
May 7, 2024
b8b8eef
[WIP] feat(backend): OpenSearchに対応
May 7, 2024
ca87542
feat: OpenSearchで高度な検索オプションに対応
May 7, 2024
690fbb6
fix(backend): Moduleに登録してなかった凡ミスを修正
May 7, 2024
40924c4
fix(frontend): Formslot to FormSection
May 8, 2024
ab233ef
余白とか
May 9, 2024
72ad68f
fix: betweenDateが不要なので削除
May 9, 2024
23bd4a5
fix(backend): betweenDatesを削除&クエリを直接叩くように
May 11, 2024
d81bfa8
fix: example.ymlに追加したのを忘れてたのをcommit
May 11, 2024
192b220
paramsにパラメータを渡してなかったのを修正
May 11, 2024
cc17a60
fix(frontend): Paginationが正しくない
May 11, 2024
cb38c64
delete: 日付指定検索を削除
May 11, 2024
2685eae
fix(backend): excludeが無効時に検索が正しく機能しないのを修正
May 17, 2024
655f6ed
fix(frontend): 微調整
May 17, 2024
a115632
fix(cherrypick-js): types
May 17, 2024
839aea3
高度な検索の説明変更
penginn-net May 17, 2024
082a13c
fix: package.jsonのpnpmバージョンを更新
May 17, 2024
98f92be
fix: reaction viewer
May 17, 2024
0923062
Merge branch 'advanced-search' of https://github.com/yojo-art/cherryp…
May 17, 2024
6f1cab5
fix: pnpm-lockfile
1673beta May 17, 2024
c2444a9
Update en-US.yml
penginn-net May 17, 2024
adfc620
fix(frontend): ボタンの位置がなんか変だったのを修正
May 18, 2024
4157788
fix: locale
May 18, 2024
1525778
fix: delete search-file
May 18, 2024
0ee23fc
APIの概要を追加
penginn-net May 18, 2024
6ecf772
APIの説明を追加
penginn-net May 18, 2024
b1d2e27
APIドキュメントの追加
penginn-net May 19, 2024
ab3486a
間違えて消したのを戻す
penginn-net May 19, 2024
ae2c1e7
ロケールをAPIドキュメントに寄せる
penginn-net May 19, 2024
595f3bc
CHANGELOG
May 20, 2024
9f295cd
Merge branch 'advanced-search' of https://github.com/yojo-art/cherryp…
May 20, 2024
6769b21
fix: locale
May 20, 2024
4a4b4a7
CHANGELOG
May 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .config/example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ dbReplications: false
# user:
# pass:

# You can use PGroonga when enabled.
#pgroonga: false

# ┌─────────────────────┐
#───┘ Redis configuration └─────────────────────────────────────

Expand Down Expand Up @@ -186,6 +189,22 @@ redis:
# index: ''
# scope: local


# ┌───────────────────────────┐
#───┘ OpenSearch configuration └─────────────────────────────

# You can use OpenSearch when you enabled AdvancedSearch.
# THIS DOES NOT WORK BECAUSE OF WIP

#opensearch:
# host: localhost
# port: 9200
# user: ''
# pass: ''
# ssl: false
# index: ''
# dictName: ''

# ┌───────────────┐
#───┘ ID generation └───────────────────────────────────────────

Expand Down
15 changes: 14 additions & 1 deletion CHANGELOG_engawa.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
## engawa-x.x.x (unreleased)
## x.x.x (unreleased)

### Release Date

Expand All @@ -15,6 +15,19 @@
### Misc

-->
## 0.3.1

### Release Date

### General
- feat: 高度な検索機能の追加
- PGroongaやOpenSearchを利用できるようになります

### Client
- fix: 投稿にされたリアクションが正常に表示されない問題

### Server

## 0.3.0

### Release Date
Expand Down
17 changes: 17 additions & 0 deletions locales/en-US.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2837,3 +2837,20 @@ _imageCompressionMode:
noResizeCompress: "Compression without resize"
resizeCompressLossy: "Resize and lossy compression"
noResizeCompressLossy: "Lossy compression without resize"

_advancedSearch:
_fileOption:
title: "File attachment status"
fileAttachedOnly: "with file"
noFile: "No file"
combined: "both"
_searchOption:
toggleNsfw: "Exclude CW"
toggleReply: "Exclude Reply"
toggleDate: "Specify date and time"
toggleAdvancedSearch: "Enable Advanced Search"
_specifyDate:
startDate: "From"
endDate: "Until"
_description:
other: "Other settings"
76 changes: 67 additions & 9 deletions locales/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7328,6 +7328,10 @@ export interface Locale extends ILocale {
* ノート検索の利用
*/
"canSearchNotes": string;
/**
* 高度な検索の利用
*/
"canAdvancedSearchNotes": string;
/**
* 翻訳機能の利用
*/
Expand Down Expand Up @@ -7878,7 +7882,7 @@ export interface Locale extends ILocale {
*/
"blockCode": string;
/**
* 複数行のプログラムなどのコードをブロックでシンタックスハイライトします。
* 複数行のプログラムなどのコードをブロックでシンタックスハイライトします。いくつかの言語を指定するとその言語に合わせたシンタックスハイライトになります。
*/
"blockCodeDescription": string;
/**
Expand Down Expand Up @@ -8105,14 +8109,14 @@ export interface Locale extends ILocale {
* 文字の上にルビを表示します。
*/
"rubyDescription": string;
/**
* ボーダー
*/
"border": string;
/**
* 内容を枠線で囲みます
*/
"borderDescription": string;
/**
* ボーダー
*/
"border": string;
/**
* 内容を枠線で囲むことができます
*/
"borderDescription": string;
};
"_instanceTicker": {
/**
Expand Down Expand Up @@ -11026,6 +11030,60 @@ export interface Locale extends ILocale {
*/
"noResizeCompressLossy": string;
};
"_advancedSearch": {
"_fileOption": {
/**
* ファイルの添付状態
*/
"title": string;
/**
* あり
*/
"fileAttachedOnly": string;
/**
* なし
*/
"noFile": string;
/**
* 全て
*/
"combined": string;
};
"_searchOption": {
/**
* CW付きを除外する
*/
"toggleNsfw": string;
/**
* リプライを除外する
*/
"toggleReply": string;
/**
* 日時を指定する
*/
"toggleDate": string;
/**
* 高度な検索を有効にする
*/
"toggleAdvancedSearch": string;
};
"_specifyDate": {
/**
* から
*/
"startDate": string;
/**
* まで
*/
"endDate": string;
};
"_description": {
/**
* その他
*/
"other": string;
}
};
}
declare const locales: {
[lang: string]: Locale;
Expand Down
18 changes: 18 additions & 0 deletions locales/ja-JP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1899,6 +1899,7 @@ _role:
descriptionOfRateLimitFactor: "小さいほど制限が緩和され、大きいほど制限が強化されます。"
canHideAds: "広告の非表示"
canSearchNotes: "ノート検索の利用"
canAdvancedSearchNotes: "高度な検索の利用"
canUseTranslator: "翻訳機能の利用"
avatarDecorationLimit: "アイコンデコレーションの最大取付個数"
_condition:
Expand Down Expand Up @@ -2935,3 +2936,20 @@ _imageCompressionMode:
noResizeCompress: "縮小せず再圧縮する"
resizeCompressLossy: "縮小して非可逆圧縮する"
noResizeCompressLossy: "縮小せず非可逆圧縮する"

_advancedSearch:
_fileOption:
title: "ファイルの添付状態"
fileAttachedOnly: "あり"
noFile: "なし"
combined: "全て"
_searchOption:
toggleNsfw: "CW付きを除外する"
toggleReply: "リプライを除外する"
toggleDate: "日時を指定する"
toggleAdvancedSearch: "高度な検索を有効にする"
_specifyDate:
startDate: "から"
endDate: "まで"
_description:
other: "その他の設定"
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"type": "git",
"url": "https://github.com/kokonect-link/cherrypick.git"
},
"packageManager": "pnpm@8.15.1",
"packageManager": "pnpm@9.1.1+sha256.9551e803dcb7a1839fdf5416153a844060c7bce013218ce823410532504ac10b",
"workspaces": [
"packages/frontend",
"packages/backend",
Expand Down
1 change: 1 addition & 0 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
"@nestjs/common": "10.2.10",
"@nestjs/core": "10.2.10",
"@nestjs/testing": "10.2.10",
"@opensearch-project/opensearch": "^2.7.0",
"@peertube/http-signature": "1.7.0",
"@simplewebauthn/server": "9.0.2",
"@sinonjs/fake-timers": "11.2.2",
Expand Down
28 changes: 26 additions & 2 deletions packages/backend/src/GlobalModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { Global, Inject, Module } from '@nestjs/common';
import * as Redis from 'ioredis';
import { DataSource } from 'typeorm';
import { MeiliSearch } from 'meilisearch';
import { Client as OpenSearch } from '@opensearch-project/opensearch';
import { Logging } from '@google-cloud/logging';
import { DI } from './di-symbols.js';
import { Config, loadConfig } from './config.js';
Expand Down Expand Up @@ -45,6 +46,29 @@ const $meilisearch: Provider = {
inject: [DI.config],
};

const $opensearch: Provider = {
provide: DI.opensearch,
useFactory: (config: Config) => {
if (config.opensearch) {
return new OpenSearch({
nodes: {
url: new URL(`${config.opensearch.ssl ? 'https' : 'http'}://${config.opensearch.host}:${config.opensearch.port}`),
ssl: {
rejectUnauthorized: config.opensearch.rejectUnauthorized,
},
},
auth: {
username: config.opensearch.user,
password: config.opensearch.pass,
},
});
} else {
return null;
}
},
inject: [DI.config],
};

const $cloudLogging: Provider = {
provide: DI.cloudLogging,
useFactory: (config: Config) => {
Expand Down Expand Up @@ -109,8 +133,8 @@ const $redisForJobQueue: Provider = {
@Global()
@Module({
imports: [RepositoryModule],
providers: [$config, $db, $meilisearch, $cloudLogging, $redis, $redisForPub, $redisForSub, $redisForTimelines, $redisForJobQueue],
exports: [$config, $db, $meilisearch, $cloudLogging, $redis, $redisForPub, $redisForSub, $redisForTimelines, $redisForJobQueue, RepositoryModule],
providers: [$config, $db, $meilisearch, $opensearch, $cloudLogging, $redis, $redisForPub, $redisForSub, $redisForTimelines, $redisForJobQueue],
exports: [$config, $db, $meilisearch, $opensearch, $cloudLogging, $redis, $redisForPub, $redisForSub, $redisForTimelines, $redisForJobQueue, RepositoryModule],
})
export class GlobalModule implements OnApplicationShutdown {
constructor(
Expand Down
22 changes: 22 additions & 0 deletions packages/backend/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ type Source = {
user: string;
pass: string;
}[];
pgroonga?: boolean;
redis: RedisOptionsSource;
redisForPubsub?: RedisOptionsSource;
redisForJobQueue?: RedisOptionsSource;
Expand All @@ -56,6 +57,15 @@ type Source = {
index: string;
scope?: 'local' | 'global' | string[];
};
opensearch?: {
host: string;
port: string;
user: string;
pass: string;
ssl?: boolean;
rejectUnauthorized?: boolean;
index: string;
} | undefined;

publishTarballInsteadOfProvideRepositoryUrl?: boolean;

Expand Down Expand Up @@ -126,6 +136,7 @@ export type Config = {
user: string;
pass: string;
}[] | undefined;
pgroonga: boolean | undefined;
meilisearch: {
host: string;
port: string;
Expand All @@ -134,6 +145,15 @@ export type Config = {
index: string;
scope?: 'local' | 'global' | string[];
} | undefined;
opensearch: {
host: string;
port: string;
user: string;
pass: string;
ssl?: boolean;
rejectUnauthorized?: boolean;
index: string;
} | undefined;
proxy: string | undefined;
proxySmtp: string | undefined;
proxyBypassHosts: string[] | undefined;
Expand Down Expand Up @@ -248,7 +268,9 @@ export function loadConfig(): Config {
db: config.db,
dbReplications: config.dbReplications,
dbSlaves: config.dbSlaves,
pgroonga: config.pgroonga,
meilisearch: config.meilisearch,
opensearch: config.opensearch,
redis,
redisForPubsub: config.redisForPubsub ? convertRedisOptions(config.redisForPubsub, host) : redis,
redisForJobQueue: config.redisForJobQueue ? convertRedisOptions(config.redisForJobQueue, host) : redis,
Expand Down
1 change: 1 addition & 0 deletions packages/backend/src/core/AchievementService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export const ACHIEVEMENT_TYPES = [
'justPlainLucky',
'setNameToSyuilo',
'setNameToNoriDev',
'setNameToYojo',
'cookieClicked',
'brainDiver',
'smashTestNotificationButton',
Expand Down
Loading
Loading