Skip to content

Commit

Permalink
Add help links
Browse files Browse the repository at this point in the history
  • Loading branch information
bubelov committed Mar 13, 2024
1 parent 2a59d8f commit bcbf5ce
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/components/IssueCell.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,13 @@
>
Edit
</a>
{:else if id === 'helpLink' && value}
<a
href={value}
target="_blank"
rel="noreferrer"
class="text-link transition-colors hover:text-hover"
>
How to fix?
</a>
{/if}
21 changes: 20 additions & 1 deletion src/components/IssuesTable.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
type: string;
viewLink: string;
editLink: string;
helpLink: string | undefined;
};
let table: Readable<Table<IssueFormatted>> | undefined;
Expand Down Expand Up @@ -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<IssueFormatted>[] = [
Expand All @@ -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: '',
Expand Down

0 comments on commit bcbf5ce

Please sign in to comment.