From bcbf5ce3bc30e53ed05308c72b3315f57456c168 Mon Sep 17 00:00:00 2001 From: Igor Bubelov Date: Wed, 13 Mar 2024 19:51:14 +0700 Subject: [PATCH] Add help links --- src/components/IssueCell.svelte | 9 +++++++++ src/components/IssuesTable.svelte | 21 ++++++++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/components/IssueCell.svelte b/src/components/IssueCell.svelte index 4e06e42..fc03c2f 100644 --- a/src/components/IssueCell.svelte +++ b/src/components/IssueCell.svelte @@ -29,4 +29,13 @@ > Edit +{:else if id === 'helpLink' && value} + + How to fix? + {/if} diff --git a/src/components/IssuesTable.svelte b/src/components/IssuesTable.svelte index 82fdfad..e29475a 100644 --- a/src/components/IssuesTable.svelte +++ b/src/components/IssuesTable.svelte @@ -34,6 +34,7 @@ type: string; viewLink: string; editLink: string; + helpLink: string | undefined; }; let table: Readable> | undefined; @@ -75,7 +76,18 @@ const viewLink = id[0] + '/' + id[1]; const editLink = id[0] + '=' + id[1]; - return { icon, name, type, viewLink, editLink }; + let helpLink: string | undefined; + + switch (issue.description) { + case 'Out of date': + case 'Not verified': + helpLink = 'https://wiki.btcmap.org/general/outdated'; + break; + default: + helpLink = undefined; + } + + return { icon, name, type, viewLink, editLink, helpLink }; }); const columns: ColumnDef[] = [ @@ -100,6 +112,13 @@ cell: (info) => flexRender(IssueCell, { id: 'type', value: info.getValue() }), enableGlobalFilter: false }, + { + accessorKey: 'helpLink', + header: '', + cell: (info) => flexRender(IssueCell, { id: 'helpLink', value: info.getValue() }), + enableSorting: false, + enableGlobalFilter: false + }, { accessorKey: 'viewLink', header: '',