Compare commits

...

5 commits

Author SHA1 Message Date
f0x 70f6b85a21 bump node:18 Docker containers to node:20 2024-11-06 16:13:11 +01:00
f0x 4a2c712b3d template formatting 2024-11-06 15:52:08 +01:00
f0x 7f4d9b689a turn all eslint errors into warnings for now 2024-11-06 14:21:01 +01:00
f0x 898e2f9f60 fix interaction-requests urls, router 2024-11-06 14:10:29 +01:00
f0x 884e03b4c1 fix html elements used for logout account-card 2024-11-06 14:04:35 +01:00
48 changed files with 1100 additions and 1094 deletions

View file

@ -57,7 +57,7 @@ steps:
- pull_request
- name: web-setup
image: node:18-alpine
image: node:20-alpine
volumes:
- name: yarn_cache
path: /tmp/cache
@ -72,7 +72,7 @@ steps:
- pull_request
- name: web-lint
image: node:18-alpine
image: node:20-alpine
commands:
- yarn --cwd ./web/source lint
depends_on:
@ -83,7 +83,7 @@ steps:
- pull_request
- name: web-build
image: node:18-alpine
image: node:20-alpine
commands:
- yarn --cwd ./web/source build
depends_on:
@ -224,5 +224,3 @@ steps:
---
kind: signature
hmac: 1b89e3a538fbca72eb9a0b398cd82f09a774ba3649013e19d36012eda327e83f
...

View file

@ -3,6 +3,9 @@
"go.lintFlags": [
"--fast"
],
"go.testEnvVars": {
"WAZERO_COMPILATION_CACHE": "~/.cache/wazero"
},
"gopls": {
"analyses": {
"composites": false
@ -19,5 +22,9 @@
],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}
},
"html.format.wrapLineLength": 0,
"html.format.wrapAttributes": "preserve",
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
}

View file

@ -19,7 +19,7 @@ WORKDIR /go/src/github.com/superseriousbusiness/gotosocial
RUN /go/bin/swagger generate spec -o /go/src/github.com/superseriousbusiness/gotosocial/swagger.yaml --scan-models
# stage 2: generate the web/assets/dist bundles
FROM --platform=${BUILDPLATFORM} node:18-alpine AS bundler
FROM --platform=${BUILDPLATFORM} node:20-alpine AS bundler
COPY web web
RUN yarn --cwd ./web/source install && \

View file

@ -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",

View file

@ -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

View file

@ -29,7 +29,8 @@ module.exports = [
}
},
plugins: {
"license-header": require("eslint-plugin-license-header")
"license-header": require("eslint-plugin-license-header"),
"only-warn": require("eslint-plugin-only-warn")
},
rules: {
"license-header/header": ["error", __dirname + "/.license-header.js"]

View file

@ -47,7 +47,7 @@
"@babel/preset-typescript": "^7.24.1",
"@browserify/envify": "^6.0.0",
"@browserify/uglifyify": "^6.0.0",
"@f0x52/eslint-config": "^2.0.9",
"@f0x52/eslint-config": "^2.0.11",
"@types/html-to-text": "^9.0.4",
"@types/is-valid-domain": "^0.0.2",
"@types/papaparse": "^5.3.9",
@ -62,6 +62,7 @@
"css-extract": "^2.0.0",
"eslint": "^9.14.0",
"eslint-plugin-license-header": "^0.6.0",
"eslint-plugin-only-warn": "^1.1.0",
"factor-bundle": "^2.5.0",
"icssify": "^2.0.0",
"postcss": "^8.4.18",

View file

@ -39,9 +39,9 @@ export default function UserLogoutCard() {
return (
<div className="account-card">
<img className="avatar" src={profile.avatar} alt="" />
<h3 className="text-cutoff">{profile.display_name?.length > 0 ? profile.display_name : profile.acct}</h3>
<b className="text-cutoff">{profile.display_name.length > 0 ? profile.display_name : profile.acct}</b>
<span className="text-cutoff">@{profile.username}@{instance?.account_domain}</span>
<a onClick={logoutQuery} href="#" aria-label="Log out" title="Log out" className="logout">
<a onClick={() => void logoutQuery()} href="#" aria-label="Log out" title="Log out" className="logout">
<i className="fa fa-fw fa-sign-out" aria-hidden="true" />
</a>
</div>

View file

@ -188,7 +188,7 @@ const extended = gtsApi.injectEndpoints({
return { data: null };
},
}),
logout: build.mutation({
logout: build.mutation<null, void>({
queryFn: (_arg, api) => {
api.dispatch(oauthRemove());
return { data: null };

View file

@ -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>
);
}

View file

@ -45,7 +45,7 @@ export default function UserMenu() {
/>
<MenuItem
name="Interaction Requests"
itemUrl="interaction_requests"
itemUrl="interaction-requests"
icon="fa-commenting-o"
/>
<MenuItem

View file

@ -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>
);
}

View file

@ -1345,10 +1345,10 @@
dependencies:
levn "^0.4.1"
"@f0x52/eslint-config@^2.0.9":
version "2.0.9"
resolved "https://registry.yarnpkg.com/@f0x52/eslint-config/-/eslint-config-2.0.9.tgz#96320799d6c1ecaabd663091a796a765ca075869"
integrity sha512-4XiXUe6wMm5btpMBXpkB90W6aSl4EtuUSmswc9LtsByTvmYQ4+dn0zXoRh2WkWzvZx/VHFIxqu73BMeHHzBDxg==
"@f0x52/eslint-config@^2.0.11":
version "2.0.11"
resolved "https://registry.yarnpkg.com/@f0x52/eslint-config/-/eslint-config-2.0.11.tgz#a8f1cdc057344b6fa61794b7bea437f0b6e269c5"
integrity sha512-QsNeb3uQ/CR5XNKbI98ThchD2vj4IjMh8oEMoFQiB7ae51NCUruSQiE91hq4IvvXGZy4li61loavO4avbm6DJA==
dependencies:
"@eslint/js" "^9.11.0"
"@stylistic/eslint-plugin" "^2.8.0"
@ -3541,6 +3541,11 @@ eslint-plugin-license-header@^0.6.0:
dependencies:
requireindex "^1.2.0"
eslint-plugin-only-warn@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-only-warn/-/eslint-plugin-only-warn-1.1.0.tgz#c6ddc37ddc4e72c121f07be565fcb7b6671fe78a"
integrity sha512-2tktqUAT+Q3hCAU0iSf4xAN1k9zOpjK5WO8104mB0rT/dGhOa09582HN5HlbxNbPRZ0THV7nLGvzugcNOSjzfA==
eslint-scope@^8.2.0:
version "8.2.0"
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-8.2.0.tgz#377aa6f1cb5dc7592cfd0b7f892fd0cf352ce442"

View file

@ -23,10 +23,13 @@ Someone has submitted a new account sign-up to your instance.
They provided the following details:
Email address: {{ .SignupEmail }}
Username: {{ .SignupUsername }}
Email address:
{{ .SignupEmail }}
Username:
{{ .SignupUsername }}
{{- if .SignupReason }}
Reason: {{ .SignupReason }}
Reason:
{{ .SignupReason }}
{{- end }}
To view the sign-up, paste the following link into your browser: {{ .SignupURL }}

View file

@ -26,8 +26,7 @@
href="{{ .URL }}"
class="nounderline"
rel="nofollow noreferrer noopener"
target="_blank"
>
target="_blank">
@{{ .Username }}
</a>
</b>
@ -82,8 +81,7 @@
{{- with . }}
<div
class="media photoswipe-gallery odd single avatar-image-wrapper"
role="group"
>
role="group">
<a
class="photoswipe-slide"
href="{{- .account.Avatar -}}"
@ -92,18 +90,15 @@
data-pswp-height="{{- template "avatarHeight" . -}}px"
data-cropped="true"
alt="{{- template "avatarAlt" . -}}"
title="{{- template "avatarAlt" . -}}"
>
title="{{- template "avatarAlt" . -}}">
<picture
aria-hidden="true"
>
aria-hidden="true">
{{- if .account.AvatarAttachment }}
<source
class="avatar"
srcset="{{- .account.AvatarStatic -}}"
type="{{- .account.AvatarAttachment.PreviewMIMEType -}}"
media="(prefers-reduced-motion: reduce)"
/>
media="(prefers-reduced-motion: reduce)" />
{{- end }}
<img
class="avatar"
@ -111,8 +106,7 @@
alt="{{- template "avatarAlt" . -}}"
title="{{- template "avatarAlt" . -}}"
width="{{- template "avatarWidth" . -}}"
height="{{- template "avatarHeight" . -}}"
/>
height="{{- template "avatarHeight" . -}}" />
</picture>
</a>
</div>
@ -132,14 +126,12 @@
<source
srcset="{{- .account.HeaderStatic -}}"
type="{{- .account.HeaderAttachment.PreviewMIMEType -}}"
media="(prefers-reduced-motion: reduce)"
/>
media="(prefers-reduced-motion: reduce)" />
{{- end }}
<img
src="{{- .account.Header -}}"
alt="{{- template "headerAlt" . -}}"
title="{{- template "headerAlt" . -}}"
/>
title="{{- template "headerAlt" . -}}" />
</picture>
</div>
<div class="basic-info">
@ -163,8 +155,7 @@
<div
class="bot-legend-wrapper"
aria-hidden="true"
title="This is a bot account."
>
title="This is a bot account.">
<i class="bot-icon fa fa-microchip"></i>
<span class="bot-legend">bot</span>
</div>
@ -221,8 +212,7 @@
{{- range .pinned_statuses }}
<article
class="status expanded"
{{- includeAttr "status_attributes.tmpl" . | indentAttr 6 }}
>
{{- includeAttr "status_attributes.tmpl" . | indentAttr 6 }}>
{{- include "status.tmpl" . | indent 6 }}
</article>
{{- end }}
@ -245,8 +235,7 @@
{{- range .statuses }}
<article
class="status expanded"
{{- includeAttr "status_attributes.tmpl" . | indentAttr 6 }}
>
{{- includeAttr "status_attributes.tmpl" . | indentAttr 6 }}>
{{- include "status.tmpl" . | indent 6 }}
</article>
{{- end }}

View file

@ -90,8 +90,7 @@ media photoswipe-gallery {{ (len .) | oddOrEven }} {{ if eq (len .) 1 }}single{{
{{- if .Description }}
alt="{{- $media.Description -}}"
title="{{- $media.Description -}}"
{{- end }}
>
{{- end }}>
<source type="{{- $media.MIMEType -}}" src="{{- $media.URL -}}" />
</video>
{{- else if eq .Type "audio" }}