mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-11-24 10:15:47 +03:00
fix interaction-requests urls, router
This commit is contained in:
parent
884e03b4c1
commit
898e2f9f60
5 changed files with 37 additions and 34 deletions
|
@ -1780,7 +1780,7 @@ func (suite *InternalToFrontendTestSuite) TestStatusToAPIStatusPendingApproval()
|
|||
"muted": false,
|
||||
"bookmarked": false,
|
||||
"pinned": false,
|
||||
"content": "<p>Hi <span class=\"h-card\"><a href=\"http://localhost:8080/@1happyturtle\" class=\"u-url mention\" rel=\"nofollow noreferrer noopener\" target=\"_blank\">@<span>1happyturtle</span></a></span>, can I reply?</p><hr><p><i lang=\"en\">ℹ️ 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: <a href=\"http://localhost:8080/settings/user/interaction_requests/01J5QVXCCEATJYSXM9H6MZT4JR\" rel=\"noreferrer noopener nofollow\" target=\"_blank\">http://localhost:8080/settings/user/interaction_requests/01J5QVXCCEATJYSXM9H6MZT4JR</a>.</i></p>",
|
||||
"content": "<p>Hi <span class=\"h-card\"><a href=\"http://localhost:8080/@1happyturtle\" class=\"u-url mention\" rel=\"nofollow noreferrer noopener\" target=\"_blank\">@<span>1happyturtle</span></a></span>, can I reply?</p><hr><p><i lang=\"en\">ℹ️ 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: <a href=\"http://localhost:8080/settings/user/interaction-requests/01J5QVXCCEATJYSXM9H6MZT4JR\" rel=\"noreferrer noopener nofollow\" target=\"_blank\">http://localhost:8080/settings/user/interaction-requests/01J5QVXCCEATJYSXM9H6MZT4JR</a>.</i></p>",
|
||||
"reblog": null,
|
||||
"application": {
|
||||
"name": "superseriousbusiness",
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 (
|
||||
<div className="interaction-requests-view">
|
||||
<div className="form-section-docs">
|
||||
|
@ -34,3 +38,25 @@ export default function InteractionRequests() {
|
|||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* - /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 (
|
||||
<BaseUrlContext.Provider value={absBase}>
|
||||
<Router base={thisBase}>
|
||||
<Switch>
|
||||
<Route path="/search" component={InteractionRequests} />
|
||||
<Route path="/:reqId" component={InteractionRequestDetail} />
|
||||
<Redirect to="/search" />
|
||||
</Switch>
|
||||
</Router>
|
||||
</BaseUrlContext.Provider>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ export default function UserMenu() {
|
|||
/>
|
||||
<MenuItem
|
||||
name="Interaction Requests"
|
||||
itemUrl="interaction_requests"
|
||||
itemUrl="interaction-requests"
|
||||
icon="fa-commenting-o"
|
||||
/>
|
||||
<MenuItem
|
||||
|
|
|
@ -26,8 +26,7 @@ import UserMigration from "./migration";
|
|||
import PostSettings from "./posts";
|
||||
import EmailPassword from "./emailpassword";
|
||||
import ExportImport from "./export-import";
|
||||
import InteractionRequests from "./interactions";
|
||||
import InteractionRequestDetail from "./interactions/detail";
|
||||
import InteractionRequestsRouter from "./interactions";
|
||||
|
||||
/**
|
||||
* - /settings/user/profile
|
||||
|
@ -35,7 +34,7 @@ import InteractionRequestDetail from "./interactions/detail";
|
|||
* - /settings/user/emailpassword
|
||||
* - /settings/user/migration
|
||||
* - /settings/user/export-import
|
||||
* - /settings/users/interaction_requests
|
||||
* - /settings/users/interaction-requests
|
||||
*/
|
||||
export default function UserRouter() {
|
||||
const baseUrl = useBaseUrl();
|
||||
|
@ -52,33 +51,11 @@ export default function UserRouter() {
|
|||
<Route path="/emailpassword" component={EmailPassword} />
|
||||
<Route path="/migration" component={UserMigration} />
|
||||
<Route path="/export-import" component={ExportImport} />
|
||||
<InteractionRequestsRouter />
|
||||
<Route><Redirect to="/profile" /></Route>
|
||||
<Route path="/interaction-requests/*?" component={InteractionRequestsRouter} />
|
||||
<Redirect to="/profile" />
|
||||
</Switch>
|
||||
</ErrorBoundary>
|
||||
</Router>
|
||||
</BaseUrlContext.Provider>
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* - /settings/users/interaction_requests/search
|
||||
* - /settings/users/interaction_requests/{reqId}
|
||||
*/
|
||||
function InteractionRequestsRouter() {
|
||||
const parentUrl = useBaseUrl();
|
||||
const thisBase = "/interaction_requests";
|
||||
const absBase = parentUrl + thisBase;
|
||||
|
||||
return (
|
||||
<BaseUrlContext.Provider value={absBase}>
|
||||
<Router base={thisBase}>
|
||||
<Switch>
|
||||
<Route path="/search" component={InteractionRequests} />
|
||||
<Route path="/:reqId" component={InteractionRequestDetail} />
|
||||
<Route><Redirect to="/search"/></Route>
|
||||
</Switch>
|
||||
</Router>
|
||||
</BaseUrlContext.Provider>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue