From 898e2f9f60465dafeb35bfb6711609839334fade Mon Sep 17 00:00:00 2001 From: f0x Date: Wed, 6 Nov 2024 14:10:29 +0100 Subject: [PATCH] fix interaction-requests urls, router --- internal/typeutils/internaltofrontend_test.go | 2 +- internal/typeutils/util.go | 4 +-- .../views/user/interactions/index.tsx | 28 +++++++++++++++- web/source/settings/views/user/menu.tsx | 4 +-- web/source/settings/views/user/router.tsx | 33 +++---------------- 5 files changed, 37 insertions(+), 34 deletions(-) diff --git a/internal/typeutils/internaltofrontend_test.go b/internal/typeutils/internaltofrontend_test.go index 6c318e851..c685c519f 100644 --- a/internal/typeutils/internaltofrontend_test.go +++ b/internal/typeutils/internaltofrontend_test.go @@ -1780,7 +1780,7 @@ func (suite *InternalToFrontendTestSuite) TestStatusToAPIStatusPendingApproval() "muted": false, "bookmarked": false, "pinned": false, - "content": "

Hi @1happyturtle, can I reply?


ℹ️ Note from localhost:8080: This reply is pending your approval. You can quickly accept it by liking, boosting or replying to it. You can also accept or reject it at the following link: http://localhost:8080/settings/user/interaction_requests/01J5QVXCCEATJYSXM9H6MZT4JR.

", + "content": "

Hi @1happyturtle, can I reply?


ℹ️ Note from localhost:8080: This reply is pending your approval. You can quickly accept it by liking, boosting or replying to it. You can also accept or reject it at the following link: http://localhost:8080/settings/user/interaction-requests/01J5QVXCCEATJYSXM9H6MZT4JR.

", "reblog": null, "application": { "name": "superseriousbusiness", diff --git a/internal/typeutils/util.go b/internal/typeutils/util.go index 1747dbdcd..f84f01b09 100644 --- a/internal/typeutils/util.go +++ b/internal/typeutils/util.go @@ -214,8 +214,8 @@ func (c *Converter) pendingReplyNote( // Build the settings panel URL at which the user // can view + approve/reject the interaction request. // - // Eg., https://example.org/settings/user/interaction_requests/01J5QVXCCEATJYSXM9H6MZT4JR - settingsURL = proto + "://" + host + "/settings/user/interaction_requests/" + intReq.ID + // Eg., https://example.org/settings/user/interaction-requests/01J5QVXCCEATJYSXM9H6MZT4JR + settingsURL = proto + "://" + host + "/settings/user/interaction-requests/" + intReq.ID ) var note strings.Builder diff --git a/web/source/settings/views/user/interactions/index.tsx b/web/source/settings/views/user/interactions/index.tsx index ec3cd016b..5c2abfea7 100644 --- a/web/source/settings/views/user/interactions/index.tsx +++ b/web/source/settings/views/user/interactions/index.tsx @@ -18,9 +18,13 @@ */ import React from "react"; + +import { Redirect, Route, Router, Switch } from "wouter"; +import { BaseUrlContext, useBaseUrl } from "../../../lib/navigation/util"; +import InteractionRequestDetail from "./detail"; import InteractionRequestsSearchForm from "./search"; -export default function InteractionRequests() { +function InteractionRequests() { return (
@@ -34,3 +38,25 @@ export default function InteractionRequests() {
); } + +/** + * - /settings/users/interaction-requests/search + * - /settings/users/interaction-requests/{reqId} + */ +export default function InteractionRequestsRouter() { + const parentUrl = useBaseUrl(); + const thisBase = "/interaction-requests"; + const absBase = parentUrl + thisBase; + + return ( + + + + + + + + + + ); +} diff --git a/web/source/settings/views/user/menu.tsx b/web/source/settings/views/user/menu.tsx index 85734ae52..777e3b7b4 100644 --- a/web/source/settings/views/user/menu.tsx +++ b/web/source/settings/views/user/menu.tsx @@ -26,7 +26,7 @@ import React from "react"; * - /settings/user/emailpassword * - /settings/user/migration */ -export default function UserMenu() { +export default function UserMenu() { return ( - - + + ); -} - -/** - * - /settings/users/interaction_requests/search - * - /settings/users/interaction_requests/{reqId} - */ -function InteractionRequestsRouter() { - const parentUrl = useBaseUrl(); - const thisBase = "/interaction_requests"; - const absBase = parentUrl + thisBase; - - return ( - - - - - - - - - - ); -} +} \ No newline at end of file