-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
新着ノートをサウンドで通知する機能をdeck UIに追加 (#13867)
* feat(deck-ui): implement note notification * chore: remove notify in antenna * docs(changelog): 新着ノートをサウンドで通知する機能をdeck UIに追加 * fix: type error in test * lint: key order * fix: remove notify column * test: remove test for notify * chore: make sound selectable * fix: add license header * fix: add license header again * Unnecessary await Co-authored-by: かっこかり <[email protected]> * ファイルを選択してください -> ファイルが選択されていません * fix: i18n忘れ * fix: i18n忘れ * pleaseSelectFile > fileNotSelected --------- Co-authored-by: syuilo <[email protected]> Co-authored-by: かっこかり <[email protected]>
- Loading branch information
1 parent
d7982e4
commit 4579be0
Showing
26 changed files
with
341 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
packages/backend/migration/1716450883149-RemoveAntennaNotify.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
* SPDX-FileCopyrightText: syuilo and misskey-project | ||
* SPDX-License-Identifier: AGPL-3.0-only | ||
*/ | ||
|
||
export class RemoveAntennaNotify1716450883149 { | ||
name = 'RemoveAntennaNotify1716450883149' | ||
|
||
async up(queryRunner) { | ||
await queryRunner.query(`ALTER TABLE "antenna" DROP COLUMN "notify"`); | ||
} | ||
|
||
async down(queryRunner) { | ||
await queryRunner.query(`ALTER TABLE "antenna" ADD "notify" boolean NOT NULL`); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<!-- | ||
SPDX-FileCopyrightText: syuilo and misskey-project | ||
SPDX-License-Identifier: AGPL-3.0-only | ||
--> | ||
|
||
<template> | ||
<div> | ||
<MkButton inline rounded primary @click="selectButton($event)">{{ i18n.ts.selectFile }}</MkButton> | ||
<div :class="['_nowrap', !fileName && $style.fileNotSelected]">{{ friendlyFileName }}</div> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import * as Misskey from 'misskey-js'; | ||
import { computed, ref } from 'vue'; | ||
import { i18n } from '@/i18n.js'; | ||
import MkButton from '@/components/MkButton.vue'; | ||
import { selectFile } from '@/scripts/select-file.js'; | ||
import { misskeyApi } from '@/scripts/misskey-api.js'; | ||
|
||
const props = defineProps<{ | ||
fileId?: string | null; | ||
validate?: (file: Misskey.entities.DriveFile) => Promise<boolean>; | ||
}>(); | ||
|
||
const emit = defineEmits<{ | ||
(ev: 'update', result: Misskey.entities.DriveFile): void; | ||
}>(); | ||
|
||
const fileUrl = ref(''); | ||
const fileName = ref<string>(''); | ||
|
||
const friendlyFileName = computed<string>(() => { | ||
if (fileName.value) { | ||
return fileName.value; | ||
} | ||
if (fileUrl.value) { | ||
return fileUrl.value; | ||
} | ||
|
||
return i18n.ts.fileNotSelected; | ||
}); | ||
|
||
if (props.fileId) { | ||
misskeyApi('drive/files/show', { | ||
fileId: props.fileId, | ||
}).then((apiRes) => { | ||
fileName.value = apiRes.name; | ||
fileUrl.value = apiRes.url; | ||
}); | ||
} | ||
|
||
function selectButton(ev: MouseEvent) { | ||
selectFile(ev.currentTarget ?? ev.target).then(async (file) => { | ||
if (!file) return; | ||
if (props.validate && !await props.validate(file)) return; | ||
|
||
emit('update', file); | ||
fileName.value = file.name; | ||
fileUrl.value = file.url; | ||
}); | ||
} | ||
|
||
</script> | ||
|
||
<style module> | ||
.fileNotSelected { | ||
font-weight: 700; | ||
color: var(--infoWarnFg); | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.