From 4337a8b3081b2da6a8d143c4c2890ba0ef7ba1f9 Mon Sep 17 00:00:00 2001 From: dakkar Date: Fri, 12 Apr 2024 16:12:00 +0100 Subject: fix a bunch of ti icons also fix some mistyped `ph-push-pin-slash` Thanks Marie for noticing! --- packages/frontend/src/scripts/get-note-menu.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'packages/frontend/src/scripts/get-note-menu.ts') diff --git a/packages/frontend/src/scripts/get-note-menu.ts b/packages/frontend/src/scripts/get-note-menu.ts index 40359a88bb..b988510238 100644 --- a/packages/frontend/src/scripts/get-note-menu.ts +++ b/packages/frontend/src/scripts/get-note-menu.ts @@ -347,7 +347,7 @@ export function getNoteMenu(props: { action: () => toggleThreadMute(true), }), appearNote.userId === $i.id ? ($i.pinnedNoteIds ?? []).includes(appearNote.id) ? { - icon: 'ph-push-pin ph-bold ph-lgned-off', + icon: 'ph-push-pin-slash ph-bold ph-lg', text: i18n.ts.unpin, action: () => togglePin(false), } : { @@ -386,7 +386,7 @@ export function getNoteMenu(props: { { type: 'divider' }, { type: 'parent' as const, - icon: 'ti ti-device-tv', + icon: 'ph-television ph-bold ph-lg', text: i18n.ts.channel, children: async () => { const channelChildMenu = [] as MenuItem[]; @@ -395,7 +395,7 @@ export function getNoteMenu(props: { if (channel.pinnedNoteIds.includes(appearNote.id)) { channelChildMenu.push({ - icon: 'ti ti-pinned-off', + icon: 'ph-push-pin-slash ph-bold ph-lg', text: i18n.ts.unpin, action: () => os.apiWithDialog('channels/update', { channelId: appearNote.channel!.id, @@ -404,7 +404,7 @@ export function getNoteMenu(props: { }); } else { channelChildMenu.push({ - icon: 'ti ti-pin', + icon: 'ph-push-pin ph-bold ph-lg', text: i18n.ts.pin, action: () => os.apiWithDialog('channels/update', { channelId: appearNote.channel!.id, @@ -527,7 +527,7 @@ export function getRenoteMenu(props: { if (appearNote.channel) { channelRenoteItems.push(...[{ text: i18n.ts.inChannelRenote, - icon: 'ti ti-repeat', + icon: 'ph ph-repeat', action: () => { const el = props.renoteButton.value; if (el) { @@ -548,7 +548,7 @@ export function getRenoteMenu(props: { }, }, { text: i18n.ts.inChannelQuote, - icon: 'ti ti-quote', + icon: 'ph ph-quotes', action: () => { if (!props.mock) { os.post({ @@ -563,7 +563,7 @@ export function getRenoteMenu(props: { if (!appearNote.channel || appearNote.channel.allowRenoteToExternal) { normalRenoteItems.push(...[{ text: i18n.ts.renote, - icon: 'ti ti-repeat', + icon: 'ph ph-repeat', action: () => { const el = props.renoteButton.value; if (el) { @@ -594,7 +594,7 @@ export function getRenoteMenu(props: { }, }, (props.mock) ? undefined : { text: i18n.ts.quote, - icon: 'ti ti-quote', + icon: 'ph ph-quotes', action: () => { os.post({ renote: appearNote, -- cgit v1.2.3-freya From bba3097765317cbf95d09627961b5b5dce16a972 Mon Sep 17 00:00:00 2001 From: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Sun, 14 Apr 2024 21:30:24 +0900 Subject: enhance: クリップのノート数を表示するように (#13686) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * enhance: クリップのノート数を表示できるように * Update Changelog --- CHANGELOG.md | 1 + locales/index.d.ts | 4 ++ locales/ja-JP.yml | 1 + .../backend/src/core/entities/ClipEntityService.ts | 6 ++- packages/backend/src/models/json-schema/clip.ts | 4 ++ packages/frontend/src/components/MkClipPreview.vue | 52 +++++++++++++++------- packages/frontend/src/pages/clip.vue | 13 ++++-- packages/frontend/src/pages/my-clips/index.vue | 10 ++--- packages/frontend/src/pages/note.vue | 4 +- packages/frontend/src/scripts/get-note-menu.ts | 36 +++++++++++++-- packages/misskey-js/src/autogen/types.ts | 1 + 11 files changed, 99 insertions(+), 33 deletions(-) (limited to 'packages/frontend/src/scripts/get-note-menu.ts') diff --git a/CHANGELOG.md b/CHANGELOG.md index 47e8e0cf19..a238d99a06 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - Enhance: URLプレビューの有効化・無効化を設定できるように #13569 - Enhance: アンテナでBotによるノートを除外できるように (Cherry-picked from https://github.com/MisskeyIO/misskey/pull/545) +- Enhance: クリップのノート数を表示するように - Fix: Play作成時に設定した公開範囲が機能していない問題を修正 ### Client diff --git a/locales/index.d.ts b/locales/index.d.ts index d6875c0868..cbea39f1cd 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -4944,6 +4944,10 @@ export interface Locale extends ILocale { * この設定をオフにすると、アップロード時にファイル名が自動でランダム文字列に置き換えられます。 */ "keepOriginalFilenameDescription": string; + /** + * 説明文はありません + */ + "noDescription": string; "_bubbleGame": { /** * 遊び方 diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 0b581a01e3..4ab2f5adb0 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1232,6 +1232,7 @@ launchApp: "アプリを起動" useNativeUIForVideoAudioPlayer: "動画・音声の再生にブラウザのUIを使用する" keepOriginalFilename: "オリジナルのファイル名を保持" keepOriginalFilenameDescription: "この設定をオフにすると、アップロード時にファイル名が自動でランダム文字列に置き換えられます。" +noDescription: "説明文はありません" _bubbleGame: howToPlay: "遊び方" diff --git a/packages/backend/src/core/entities/ClipEntityService.ts b/packages/backend/src/core/entities/ClipEntityService.ts index 26fcd6714d..ce49c3458c 100644 --- a/packages/backend/src/core/entities/ClipEntityService.ts +++ b/packages/backend/src/core/entities/ClipEntityService.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; -import type { ClipFavoritesRepository, ClipsRepository, MiUser } from '@/models/_.js'; +import type { ClipNotesRepository, ClipFavoritesRepository, ClipsRepository, MiUser } from '@/models/_.js'; import { awaitAll } from '@/misc/prelude/await-all.js'; import type { Packed } from '@/misc/json-schema.js'; import type { } from '@/models/Blocking.js'; @@ -20,6 +20,9 @@ export class ClipEntityService { @Inject(DI.clipsRepository) private clipsRepository: ClipsRepository, + @Inject(DI.clipNotesRepository) + private clipNotesRepository: ClipNotesRepository, + @Inject(DI.clipFavoritesRepository) private clipFavoritesRepository: ClipFavoritesRepository, @@ -47,6 +50,7 @@ export class ClipEntityService { isPublic: clip.isPublic, favoritedCount: await this.clipFavoritesRepository.countBy({ clipId: clip.id }), isFavorited: meId ? await this.clipFavoritesRepository.exists({ where: { clipId: clip.id, userId: meId } }) : undefined, + notesCount: meId ? await this.clipNotesRepository.countBy({ clipId: clip.id }) : undefined, }); } diff --git a/packages/backend/src/models/json-schema/clip.ts b/packages/backend/src/models/json-schema/clip.ts index ca4886c978..c4e7055cd8 100644 --- a/packages/backend/src/models/json-schema/clip.ts +++ b/packages/backend/src/models/json-schema/clip.ts @@ -52,5 +52,9 @@ export const packedClipSchema = { type: 'boolean', optional: true, nullable: false, }, + notesCount: { + type: 'integer', + optional: true, nullable: false, + }, }, } as const; diff --git a/packages/frontend/src/components/MkClipPreview.vue b/packages/frontend/src/components/MkClipPreview.vue index c51ad4356d..6299a28e9f 100644 --- a/packages/frontend/src/components/MkClipPreview.vue +++ b/packages/frontend/src/components/MkClipPreview.vue @@ -4,37 +4,59 @@ SPDX-License-Identifier: AGPL-3.0-only -->