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: public to home moderation #107

Merged
merged 7 commits into from
Nov 28, 2023

Conversation

anatawa12
Copy link
Collaborator

@anatawa12 anatawa12 commented Nov 28, 2023

What

fix: #78

Why

Additional info (optional)

Checklist

  • Read the contribution guide
  • Test working in a local environment
  • (If needed) Add story of storybook
  • (If needed) Update CHANGELOG.md
  • (If possible) Add tests

Copy link

github-actions bot commented Nov 28, 2023

このPRによるapi.jsonの差分

差分はこちら
--- base
+++ head
@@ -10067,6 +10067,172 @@
         }
       }
     },
+    "/admin/note-public-to-home": {
+      "post": {
+        "operationId": "admin/note-public-to-home",
+        "summary": "admin/note-public-to-home",
+        "description": "No description provided.\n\n**Credential required**: *Yes*",
+        "externalDocs": {
+          "description": "Source code",
+          "url": "https://github.com/misskey-dev/misskey/blob/develop/packages/backend/src/server/api/endpoints/admin/note-public-to-home.ts"
+        },
+        "tags": [
+          "admin"
+        ],
+        "security": [
+          {
+            "ApiKeyAuth": []
+          }
+        ],
+        "requestBody": {
+          "required": true,
+          "content": {
+            "application/json": {
+              "schema": {
+                "type": "object",
+                "properties": {
+                  "noteId": {
+                    "type": "string",
+                    "format": "misskey:id"
+                  }
+                },
+                "required": [
+                  "noteId"
+                ]
+              }
+            }
+          }
+        },
+        "responses": {
+          "204": {
+            "description": "OK (without any results)"
+          },
+          "400": {
+            "description": "Client error",
+            "content": {
+              "application/json": {
+                "schema": {
+                  "$ref": "#/components/schemas/Error"
+                },
+                "examples": {
+                  "NOTE_NOT_FOUND": {
+                    "value": {
+                      "error": {
+                        "message": "Note not found.",
+                        "code": "NOTE_NOT_FOUND",
+                        "id": "b107f543-27fb-4bac-9549-9bbb64d95e85"
+                      }
+                    }
+                  },
+                  "NOTE_NOT_PUBLIC": {
+                    "value": {
+                      "error": {
+                        "message": "Note is not public",
+                        "code": "NOTE_NOT_PUBLIC",
+                        "id": "561e3371-6ef1-457b-8fdc-736a6e914782"
+                      }
+                    }
+                  },
+                  "INVALID_PARAM": {
+                    "value": {
+                      "error": {
+                        "message": "Invalid param.",
+                        "code": "INVALID_PARAM",
+                        "id": "3d81ceae-475f-4600-b2a8-2bc116157532"
+                      }
+                    }
+                  }
+                }
+              }
+            }
+          },
+          "401": {
+            "description": "Authentication error",
+            "content": {
+              "application/json": {
+                "schema": {
+                  "$ref": "#/components/schemas/Error"
+                },
+                "examples": {
+                  "CREDENTIAL_REQUIRED": {
+                    "value": {
+                      "error": {
+                        "message": "Credential required.",
+                        "code": "CREDENTIAL_REQUIRED",
+                        "id": "1384574d-a912-4b81-8601-c7b1c4085df1"
+                      }
+                    }
+                  }
+                }
+              }
+            }
+          },
+          "403": {
+            "description": "Forbidden error",
+            "content": {
+              "application/json": {
+                "schema": {
+                  "$ref": "#/components/schemas/Error"
+                },
+                "examples": {
+                  "AUTHENTICATION_FAILED": {
+                    "value": {
+                      "error": {
+                        "message": "Authentication failed. Please ensure your token is correct.",
+                        "code": "AUTHENTICATION_FAILED",
+                        "id": "b0a7f5f8-dc2f-4171-b91f-de88ad238e14"
+                      }
+                    }
+                  }
+                }
+              }
+            }
+          },
+          "418": {
+            "description": "I'm Ai",
+            "content": {
+              "application/json": {
+                "schema": {
+                  "$ref": "#/components/schemas/Error"
+                },
+                "examples": {
+                  "I_AM_AI": {
+                    "value": {
+                      "error": {
+                        "message": "You sent a request to Ai-chan, Misskey's showgirl, instead of the server.",
+                        "code": "I_AM_AI",
+                        "id": "60c46cd1-f23a-46b1-bebe-5d2b73951a84"
+                      }
+                    }
+                  }
+                }
+              }
+            }
+          },
+          "500": {
+            "description": "Internal server error",
+            "content": {
+              "application/json": {
+                "schema": {
+                  "$ref": "#/components/schemas/Error"
+                },
+                "examples": {
+                  "INTERNAL_ERROR": {
+                    "value": {
+                      "error": {
+                        "message": "Internal error occurred. Please contact us if the error persists.",
+                        "code": "INTERNAL_ERROR",
+                        "id": "5d37dbcb-891e-41ca-a3d6-e690c97775ac"
+                      }
+                    }
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    },
     "/admin/resolve-abuse-user-report": {
       "post": {
         "operationId": "admin/resolve-abuse-user-report",

Get diff files from Workflow Page

@anatawa12 anatawa12 force-pushed the public-to-home-moderation branch from a2085f1 to 31a0d2c Compare November 28, 2023 07:45
@anatawa12
Copy link
Collaborator Author

APIだけはできてる。GUIどうしようか

@anatawa12
Copy link
Collaborator Author

@Sayamame-beans UIどうしたらいいと思う?

@Sayamame-beans
Copy link

UIは…ノートメニュー(削除と同じ)で良いんじゃないかな
ちなみに、(APIの実装まだ見てないのですが)変更出来る人は本人+モデレーター権限を想定してて、でもパブリックに戻す機能は想定外+用意してないので本人は出来ない方がややこしくないのかもしれない…?などと今悩んでます

@anatawa12
Copy link
Collaborator Author

本人できるようにするならリプライ適用必須じゃない?

@Sayamame-beans
Copy link

あ~、そうなるのかな…? (あんまり考えてなかったんですけど、削除はcascadeだしって考えると確かに適用されないと不自然ですかね…)
じゃあモデレーターだけで

@anatawa12 anatawa12 changed the title feat: initial commit for public to home moderation feat: home moderation Nov 28, 2023
@anatawa12 anatawa12 changed the title feat: home moderation feat: public to home moderation Nov 28, 2023
@anatawa12 anatawa12 marked this pull request as ready for review November 28, 2023 08:51
@Sayamame-beans
Copy link

Sayamame-beans commented Nov 28, 2023

fix: #78
require: update changelog

Copy link

@Sayamame-beans Sayamame-beans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

細かいノート削除の部分はよく分からないけど良さそうなのでヨシ!

@anatawa12 anatawa12 merged commit 7779c76 into niri-la:develop Nov 28, 2023
18 checks passed
@anatawa12 anatawa12 deleted the public-to-home-moderation branch November 28, 2023 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants