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

相互リンク機能の追加 #319

Merged
merged 13 commits into from
Aug 15, 2024
Merged

Conversation

kozakura913
Copy link
Collaborator

@kozakura913 kozakura913 commented Aug 14, 2024

Checklist

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

(cherry picked from commit b6a5a36eaa66883e9306c782b71cb08f80cb12bc)
# Conflicts:
#	locales/index.d.ts
#	locales/ja-JP.yml
#	packages/backend/src/core/CoreModule.ts
#	packages/backend/src/core/entities/UserEntityService.ts
#	packages/backend/src/models/RepositoryModule.ts
#	packages/backend/src/models/_.ts
#	packages/backend/src/models/json-schema/user.ts
#	packages/backend/src/server/api/endpoints/i/update.ts
#	packages/backend/src/types.ts
#	packages/cherrypick-js/etc/cherrypick-js.api.md
#	packages/cherrypick-js/src/autogen/endpoint.ts
#	packages/cherrypick-js/src/autogen/entities.ts
#	packages/cherrypick-js/src/consts.ts
#	packages/frontend/src/pages/admin-user.vue
#	packages/frontend/src/pages/user/home.vue
#	packages/frontend/src/pages/user/index.timeline.vue

Co-authored-by: まっちゃてぃー。 <[email protected]>
(cherry picked from commit 5a9d8a556440452bdf803c323b93098e7c716a54)
# Conflicts:
#	locales/ja-JP.yml
#	packages/backend/src/core/CoreModule.ts
#	packages/backend/src/core/RoleService.ts
#	packages/backend/src/core/entities/UserEntityService.ts
#	packages/backend/src/models/RepositoryModule.ts
#	packages/backend/src/models/_.ts
#	packages/backend/src/models/json-schema/role.ts
#	packages/backend/src/types.ts
#	packages/backend/test/e2e/users.ts
#	packages/cherrypick-js/etc/cherrypick-js.api.md
#	packages/cherrypick-js/src/autogen/endpoint.ts
#	packages/cherrypick-js/src/autogen/entities.ts
#	packages/cherrypick-js/src/autogen/types.ts
#	packages/cherrypick-js/src/consts.ts
#	packages/frontend/src/const.ts
#	packages/frontend/src/pages/admin-user.vue
#	packages/frontend/src/pages/user/home.vue
#	packages/frontend/src/pages/user/index.timeline.vue

Co-authored-by: まっちゃてぃー。 <[email protected]>
Copy link

codecov bot commented Aug 14, 2024

Codecov Report

Attention: Patch coverage is 40.44750% with 346 lines in your changes missing coverage. Please review.

Project coverage is 40.52%. Comparing base (950d232) to head (44be14b).
Report is 14 commits behind head on develop.

Files Patch % Lines
packages/frontend/src/pages/settings/profile.vue 0.00% 153 Missing ⚠️
...kages/backend/src/server/api/endpoints/i/update.ts 46.66% 40 Missing ⚠️
packages/frontend/src/pages/admin/roles.editor.vue 0.00% 38 Missing ⚠️
...end/src/core/activitypub/models/ApPersonService.ts 32.60% 31 Missing ⚠️
...rver/api/endpoints/admin/unset-user-mutual-link.ts 53.33% 28 Missing ⚠️
.../backend/src/core/activitypub/ApRendererService.ts 0.00% 19 Missing ⚠️
packages/frontend/src/pages/admin-user.vue 0.00% 15 Missing ⚠️
packages/frontend/src/pages/admin/roles.vue 0.00% 14 Missing ⚠️
packages/backend/src/server/api/endpoint-base.ts 36.36% 7 Missing ⚠️
...ackages/frontend/src/pages/user/index.timeline.vue 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           develop     #319       +/-   ##
============================================
- Coverage    62.71%   40.52%   -22.19%     
============================================
  Files          876     1659      +783     
  Lines       105699   222335   +116636     
  Branches      2639     3775     +1136     
============================================
+ Hits         66285    90103    +23818     
- Misses       39351   131584    +92233     
- Partials        63      648      +585     

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

Copy link
Contributor

github-actions bot commented Aug 14, 2024

이 PR에 의한 api.json 차이

차이점은 여기에서 볼 수 있음
--- base
+++ head
@@ -6011,6 +6011,154 @@
         }
       }
     },
+    "/admin/unset-user-mutual-link": {
+      "post": {
+        "operationId": "admin___unset-user-mutual-link",
+        "summary": "admin/unset-user-mutual-link",
+        "description": "No description provided.\n\n**Credential required**: *Yes* / **Permission**: *write:admin:unset-user-mutual-link*",
+        "externalDocs": {
+          "description": "Source code",
+          "url": "https://github.com/kokonect-link/cherrypick/blob/develop/packages/backend/src/server/api/endpoints/admin/unset-user-mutual-link.ts"
+        },
+        "tags": [
+          "admin"
+        ],
+        "security": [
+          {
+            "bearerAuth": []
+          }
+        ],
+        "requestBody": {
+          "required": true,
+          "content": {
+            "application/json": {
+              "schema": {
+                "type": "object",
+                "properties": {
+                  "userId": {
+                    "type": "string",
+                    "format": "misskey:id"
+                  }
+                },
+                "required": [
+                  "userId"
+                ]
+              }
+            }
+          }
+        },
+        "responses": {
+          "204": {
+            "description": "OK (without any results)"
+          },
+          "400": {
+            "description": "Client error",
+            "content": {
+              "application/json": {
+                "schema": {
+                  "$ref": "#/components/schemas/Error"
+                },
+                "examples": {
+                  "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, CherryPick'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/drive/clean-remote-files": {
       "post": {
         "operationId": "admin___drive___clean-remote-files",
@@ -50583,6 +50731,49 @@
                     "items": {
                       "type": "string"
                     }
+                  },
+                  "mutualLinkSections": {
+                    "type": "array",
+                    "items": {
+                      "type": "object",
+                      "properties": {
+                        "name": {
+                          "type": [
+                            "string",
+                            "null"
+                          ]
+                        },
+                        "mutualLinks": {
+                          "type": "array",
+                          "items": {
+                            "type": "object",
+                            "properties": {
+                              "url": {
+                                "type": "string",
+                                "format": "url"
+                              },
+                              "fileId": {
+                                "type": "string",
+                                "format": "misskey:id"
+                              },
+                              "description": {
+                                "type": [
+                                  "string",
+                                  "null"
+                                ]
+                              }
+                            },
+                            "required": [
+                              "url",
+                              "fileId"
+                            ]
+                          }
+                        }
+                      },
+                      "required": [
+                        "mutualLinks"
+                      ]
+                    }
                   }
                 }
               }
@@ -50618,6 +50809,15 @@
                       }
                     }
                   },
+                  "NO_SUCH_FILE": {
+                    "value": {
+                      "error": {
+                        "message": "No such file.",
+                        "code": "NO_SUCH_FILE",
+                        "id": "e0f0d3c7-e704-4314-a0b5-04286d69a65c"
+                      }
+                    }
+                  },
                   "NO_SUCH_BANNER": {
                     "value": {
                       "error": {
@@ -50636,6 +50836,15 @@
                       }
                     }
                   },
+                  "FILE_NOT_AN_IMAGE": {
+                    "value": {
+                      "error": {
+                        "message": "The specified file is not an image.",
+                        "code": "FILE_NOT_AN_IMAGE",
+                        "id": "2851568b-5ad1-4031-bf0d-5320afebf3a9"
+                      }
+                    }
+                  },
                   "BANNER_NOT_AN_IMAGE": {
                     "value": {
                       "error": {
@@ -81807,6 +82016,9 @@
                 },
                 "displayOrder": {
                   "type": "number"
+                },
+                "behavior": {
+                  "type": "string"
                 }
               },
               "required": [
@@ -82044,6 +82256,59 @@
           "moderationNote": {
             "type": "string"
           },
+          "mutualLinkSections": {
+            "type": "array",
+            "items": {
+              "type": "object",
+              "properties": {
+                "name": {
+                  "type": [
+                    "string",
+                    "null"
+                  ]
+                },
+                "mutualLinks": {
+                  "type": "array",
+                  "items": {
+                    "type": "object",
+                    "properties": {
+                      "id": {
+                        "type": "string",
+                        "format": "misskey:id"
+                      },
+                      "url": {
+                        "type": "string"
+                      },
+                      "fileId": {
+                        "type": "string",
+                        "format": "misskey:id"
+                      },
+                      "description": {
+                        "type": [
+                          "string",
+                          "null"
+                        ]
+                      },
+                      "imgSrc": {
+                        "type": "string"
+                      }
+                    },
+                    "required": [
+                      "id",
+                      "url",
+                      "fileId",
+                      "description",
+                      "imgSrc"
+                    ]
+                  }
+                }
+              },
+              "required": [
+                "name",
+                "mutualLinks"
+              ]
+            }
+          },
           "isFollowing": {
             "type": "boolean"
           },
@@ -82112,7 +82377,8 @@
           "usePasswordLessLogin",
           "securityKeys",
           "roles",
-          "memo"
+          "memo",
+          "mutualLinkSections"
         ]
       },
       "MeDetailedOnly": {
@@ -86189,6 +86455,12 @@
           },
           "canEditNote": {
             "type": "boolean"
+          },
+          "mutualLinkSectionLimit": {
+            "type": "integer"
+          },
+          "mutualLinkLimit": {
+            "type": "integer"
           }
         },
         "required": [
@@ -86220,7 +86492,9 @@
           "rateLimitFactor",
           "avatarDecorationLimit",
           "fileSizeLimit",
-          "canEditNote"
+          "canEditNote",
+          "mutualLinkSectionLimit",
+          "mutualLinkLimit"
         ]
       },
       "ReversiGameLite": {

Get diff files from Workflow Page

@kozakura913 kozakura913 added this to the yojo0.6.0 milestone Aug 14, 2024
(cherry picked from commit 90be6317e6cd39e82bc0b1a108fe490f0fb772a9)
# Conflicts:
#	locales/en-US.yml
#	locales/ko-KR.yml

Co-authored-by: まっちゃとーにゅ <[email protected]>
@kozakura913 kozakura913 marked this pull request as ready for review August 14, 2024 16:38
Copy link
Collaborator

@penginn-net penginn-net left a comment

Choose a reason for hiding this comment

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

CHANGELOG書いて

# Conflicts:
#	packages/frontend/src/components/MkLink.vue
Copy link

sonarcloud bot commented Aug 14, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
3 Security Hotspots
13.2% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

@kozakura913 kozakura913 merged commit 1695e17 into yojo-art:develop Aug 15, 2024
25 of 30 checks passed
@kozakura913 kozakura913 mentioned this pull request Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants