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: 通報の強化 #14704

Merged
merged 9 commits into from
Oct 5, 2024
Merged

feat: 通報の強化 #14704

merged 9 commits into from
Oct 5, 2024

Conversation

syuilo
Copy link
Member

@syuilo syuilo commented Oct 5, 2024

What

Resolve #14689
Resolve #14691
Resolve #11747

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

@github-actions github-actions bot added packages/frontend Client side specific issue/PR packages/backend Server side specific issue/PR packages/misskey-js packages/backend:test labels Oct 5, 2024
Copy link

codecov bot commented Oct 5, 2024

Codecov Report

Attention: Patch coverage is 48.51190% with 173 lines in your changes missing coverage. Please review.

Project coverage is 41.40%. Comparing base (d8bf1ff) to head (a1e1e92).
Report is 4 commits behind head on develop.

Files with missing lines Patch % Lines
packages/frontend/src/components/MkAbuseReport.vue 0.00% 60 Missing ⚠️
packages/backend/src/core/AbuseReportService.ts 11.11% 56 Missing ⚠️
...er/api/endpoints/admin/update-abuse-user-report.ts 70.68% 17 Missing ⚠️
...r/api/endpoints/admin/forward-abuse-user-report.ts 72.72% 15 Missing ⚠️
packages/frontend/src/pages/admin/abuses.vue 0.00% 10 Missing ⚠️
...ackages/frontend/src/pages/admin/modlog.ModLog.vue 0.00% 5 Missing ⚠️
packages/frontend/src/store.ts 0.00% 4 Missing ⚠️
.../src/core/entities/AbuseUserReportEntityService.ts 0.00% 2 Missing ⚠️
packages/frontend/src/pages/admin-user.vue 0.00% 2 Missing ⚠️
...r/api/endpoints/admin/resolve-abuse-user-report.ts 50.00% 1 Missing ⚠️
... and 1 more
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #14704      +/-   ##
===========================================
+ Coverage    39.64%   41.40%   +1.76%     
===========================================
  Files         1548     1555       +7     
  Lines       194523   200630    +6107     
  Branches      3600     2585    -1015     
===========================================
+ Hits         77110    83079    +5969     
- Misses      116814   116985     +171     
+ Partials       599      566      -33     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

github-actions bot commented Oct 5, 2024

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

差分はこちら
--- base
+++ head
@@ -11230,9 +11230,16 @@
                     "type": "string",
                     "format": "misskey:id"
                   },
-                  "forward": {
-                    "type": "boolean",
-                    "default": false
+                  "resolvedAs": {
+                    "type": [
+                      "string",
+                      "null"
+                    ],
+                    "enum": [
+                      "accept",
+                      "reject",
+                      null
+                    ]
                   }
                 },
                 "required": [
@@ -11263,6 +11270,327 @@
                         "kind": "server",
                         "httpStatusCode": 404
                       }
+                    }
+                  },
+                  "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/forward-abuse-user-report": {
+      "post": {
+        "operationId": "admin___forward-abuse-user-report",
+        "summary": "admin/forward-abuse-user-report",
+        "description": "No description provided.\n\n**Credential required**: *Yes* / **Permission**: *write:admin:resolve-abuse-user-report*",
+        "externalDocs": {
+          "description": "Source code",
+          "url": "https:/misskey-dev/misskey/blob/develop/packages/backend/src/server/api/endpoints/admin/forward-abuse-user-report.ts"
+        },
+        "tags": [
+          "admin"
+        ],
+        "security": [
+          {
+            "bearerAuth": []
+          }
+        ],
+        "requestBody": {
+          "required": true,
+          "content": {
+            "application/json": {
+              "schema": {
+                "type": "object",
+                "properties": {
+                  "reportId": {
+                    "type": "string",
+                    "format": "misskey:id"
+                  }
+                },
+                "required": [
+                  "reportId"
+                ]
+              }
+            }
+          }
+        },
+        "responses": {
+          "204": {
+            "description": "OK (without any results)"
+          },
+          "400": {
+            "description": "Client error",
+            "content": {
+              "application/json": {
+                "schema": {
+                  "$ref": "#/components/schemas/Error"
+                },
+                "examples": {
+                  "NO_SUCH_ABUSE_REPORT": {
+                    "value": {
+                      "error": {
+                        "message": "No such abuse report.",
+                        "code": "NO_SUCH_ABUSE_REPORT",
+                        "id": "8763e21b-d9bc-40be-acf6-54c1a6986493",
+                        "kind": "server",
+                        "httpStatusCode": 404
+                      }
+                    }
+                  },
+                  "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/update-abuse-user-report": {
+      "post": {
+        "operationId": "admin___update-abuse-user-report",
+        "summary": "admin/update-abuse-user-report",
+        "description": "No description provided.\n\n**Credential required**: *Yes* / **Permission**: *write:admin:resolve-abuse-user-report*",
+        "externalDocs": {
+          "description": "Source code",
+          "url": "https:/misskey-dev/misskey/blob/develop/packages/backend/src/server/api/endpoints/admin/update-abuse-user-report.ts"
+        },
+        "tags": [
+          "admin"
+        ],
+        "security": [
+          {
+            "bearerAuth": []
+          }
+        ],
+        "requestBody": {
+          "required": true,
+          "content": {
+            "application/json": {
+              "schema": {
+                "type": "object",
+                "properties": {
+                  "reportId": {
+                    "type": "string",
+                    "format": "misskey:id"
+                  },
+                  "moderationNote": {
+                    "type": "string"
+                  }
+                },
+                "required": [
+                  "reportId"
+                ]
+              }
+            }
+          }
+        },
+        "responses": {
+          "204": {
+            "description": "OK (without any results)"
+          },
+          "400": {
+            "description": "Client error",
+            "content": {
+              "application/json": {
+                "schema": {
+                  "$ref": "#/components/schemas/Error"
+                },
+                "examples": {
+                  "NO_SUCH_ABUSE_REPORT": {
+                    "value": {
+                      "error": {
+                        "message": "No such abuse report.",
+                        "code": "NO_SUCH_ABUSE_REPORT",
+                        "id": "15f51cf5-46d1-4b1d-a618-b35bcbed0662",
+                        "kind": "server",
+                        "httpStatusCode": 404
+                      }
                     }
                   },
                   "INVALID_PARAM": {

Get diff files from Workflow Page

@syuilo syuilo marked this pull request as ready for review October 5, 2024 03:22
@syuilo
Copy link
Member Author

syuilo commented Oct 5, 2024

マージするか

@kakkokari-gtyih
Copy link
Contributor

是認と否認がわかりにくいかも(逆の意味として解釈されるかもしれない)

@syuilo
Copy link
Member Author

syuilo commented Oct 5, 2024

ほむん

@syuilo
Copy link
Member Author

syuilo commented Oct 5, 2024

まあ✅と❌あるから分かるんじゃないかしら

@kakkokari-gtyih
Copy link
Contributor

kakkokari-gtyih commented Oct 5, 2024

ちなみにこれ是認と否認で挙動に差ある?(単純に聞きたいだけ)

@syuilo
Copy link
Member Author

syuilo commented Oct 5, 2024

no

@syuilo
Copy link
Member Author

syuilo commented Oct 5, 2024

そこら辺の説明をどこかでしたいけど場所がなさそうだからMisskey Hubかしらね

@kakkokari-gtyih
Copy link
Contributor

そこら辺の説明をどこかでしたいけど場所がなさそうだからMisskey Hubかしらね

転送の横の「?」ボタンみたいに説明をツールチップで出せるのでもいいかなと思ったけど全ボタンにツールチップがあるのはそれはそれで変なのでまあそうするのがいいのかも
(もしくはMkInfoを置いてそこにちょっと説明書きを添えるか)

@syuilo
Copy link
Member Author

syuilo commented Oct 5, 2024

ほむん
image

@syuilo
Copy link
Member Author

syuilo commented Oct 5, 2024

マージするか

@syuilo syuilo merged commit d8cb730 into develop Oct 5, 2024
21 checks passed
@syuilo syuilo deleted the refine-abuse-report branch October 5, 2024 07:20
@syuilo
Copy link
Member Author

syuilo commented Oct 5, 2024

🙏🏻

@tamaina
Copy link
Contributor

tamaina commented Oct 8, 2024

転送どこいった?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packages/backend:test packages/backend Server side specific issue/PR packages/frontend Client side specific issue/PR packages/misskey-js
Projects
None yet
3 participants