Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions src/core/issue.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const base = {
apiDocs: "https://api.gandi.net/docs/",
why: "My domain lives there.",
extra: "",
willing: false,
};

describe("pluginRequestUrl", () => {
Expand Down Expand Up @@ -46,13 +45,4 @@ describe("pluginRequestUrl", () => {
expect(provider.searchParams.get("auth")).toBe("plain text");
expect(retriever.searchParams.get("details")).toBe("plain text");
});

test("adds the willingness to the reason", () => {
const url = new URL(
pluginRequestUrl("provider", { ...base, willing: true }),
);
expect(url.searchParams.get("why")).toBe(
"My domain lives there.\n\nI'd be willing to write and test this plugin myself.",
);
});
});
9 changes: 1 addition & 8 deletions src/core/issue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export interface PluginRequest {
why: string;
/** The last field of the form: how the API authenticates, or what a retriever answers with. */
extra: string;
willing: boolean;
}

const newIssue = "https://github.com/dnspatch/dnspatch/issues/new";
Expand All @@ -34,18 +33,12 @@ const titlePrefix: Record<RequestKind, string> = {
*/
export function pluginRequestUrl(kind: RequestKind, r: PluginRequest): string {
const service = r.service.trim();
const why = [
r.why.trim(),
r.willing ? "I'd be willing to write and test this plugin myself." : "",
]
.filter(Boolean)
.join("\n\n");
const params = new URLSearchParams({
template: `${kind}_request.yml`,
title: `${titlePrefix[kind]}: ${service}`,
service,
"api-docs": r.apiDocs.trim(),
why,
why: r.why.trim(),
});
const extra = r.extra.trim();
if (extra) params.set(extraField[kind], extra);
Expand Down
2 changes: 0 additions & 2 deletions src/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ const ru = {
noNotifierService: "Название сервиса или протокола",
noNotifierDocs: "Ссылка на документацию",
noNotifierAuth: "Как к нему подключаются (необязательно)",
noPluginWilling: "Готов(а) сам(а) написать и проверить этот плагин",
noPluginNote:
"Форма откроется на GitHub уже заполненной. Там её можно поправить и отправить; для этого нужен аккаунт GitHub.",
noPluginSubmit: "Открыть заявку на GitHub",
Expand Down Expand Up @@ -256,7 +255,6 @@ const en: Record<Key, string> = {
noNotifierService: "Service or protocol name",
noNotifierDocs: "Link to the documentation",
noNotifierAuth: "How a client connects to it (optional)",
noPluginWilling: "I'd be willing to write and test this plugin myself",
noPluginNote:
"The form opens on GitHub already filled in. You can edit and submit it there; that needs a GitHub account.",
noPluginSubmit: "Open the request on GitHub",
Expand Down
11 changes: 0 additions & 11 deletions src/tools/config/MissingPlugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ export function MissingPlugin({ kind }: { kind: RequestKind }) {
const [apiDocs, setApiDocs] = useState("");
const [why, setWhy] = useState("");
const [extra, setExtra] = useState("");
const [willing, setWilling] = useState(false);

useBackdropClose(dialog);

Expand All @@ -60,7 +59,6 @@ export function MissingPlugin({ kind }: { kind: RequestKind }) {
apiDocs,
why,
extra,
willing,
});
window.open(url, "_blank", "noopener");
dialog.current?.close();
Expand Down Expand Up @@ -137,15 +135,6 @@ export function MissingPlugin({ kind }: { kind: RequestKind }) {
onInput={(e) => setExtra(e.currentTarget.value)}
/>

<label class="check">
<input
type="checkbox"
checked={willing}
onChange={(e) => setWilling(e.currentTarget.checked)}
/>
<span>{t("noPluginWilling")}</span>
</label>

<p class="hint">{t("noPluginNote")}</p>
<button type="submit" class="primary">
{t("noPluginSubmit")}
Expand Down
Loading