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

enhance: ノート編集の際のノート作成画面を改善 #11947

Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@

-->

## 2023.x.x (unreleased)
### Note
- 編集機能は、連合時にサーバー間で不整合が起きる可能性があるため、一時的に連合なしのノートでのみ行えるようになっています(#11944)。
編集の連合が実装され次第、この処置は解除します。

## 2023.9.3
### General
- Enhance: ノートの翻訳機能の利用可否をロールで設定可能に
Expand Down
10 changes: 10 additions & 0 deletions packages/backend/src/server/api/endpoints/notes/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,16 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
throw new ApiError(meta.errors.noSuchNote);
}

//[TEMPORARY WORKAROUND] BELOW is TEMPORARY WORKAROUND / BE SURE TO REMOVE IT WHEN #11944 IS SOLVED
if (!note.localOnly) {
throw new ApiError({
message: 'Editing of notes that are not local only is temporarily unavailable. See #11944 for details.',
code: 'FEDARATED_NOTE_EDITING_TEMPORARILY_UNAVAILABLE',
id: 'a94142d4-3ead-4f65-a684-c1ba427c51b5',
});
}
//[TEMPORARY WORKAROUND] AVOVE is TEMPORARY WORKAROUND / BE SURE TO REMOVE IT WHEN #11944 IS SOLVED

await this.notesRepository.update({ id: note.id }, {
updatedAt: new Date(),
cw: ps.cw,
Expand Down
3 changes: 2 additions & 1 deletion packages/frontend/src/scripts/get-note-menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,8 @@ export function getNoteMenu(props: {
),
...(appearNote.userId === $i.id || $i.isModerator || $i.isAdmin ? [
null,
appearNote.userId === $i.id && $i.policies.canEditNote ? {
//[TEMPORARY WORKAROUND] appearNote.localOnly is TEMPORARY WORKAROUND / BE SURE TO REMOVE IT WHEN #11944 IS SOLVED
(appearNote.userId === $i.id && $i.policies.canEditNote && appearNote.localOnly) ? {
icon: 'ti ti-edit',
text: i18n.ts.edit,
action: edit,
Expand Down
Loading