diff --git a/src/components/IssueCell.svelte b/src/components/IssueCell.svelte index 4e06e42..d63ef51 100644 --- a/src/components/IssueCell.svelte +++ b/src/components/IssueCell.svelte @@ -1,7 +1,7 @@ @@ -29,4 +29,13 @@ > Edit +{:else if id === 'helpLink' && value} + + Help + {/if} diff --git a/src/components/IssueIcon.svelte b/src/components/IssueIcon.svelte index 4091ccd..b04db21 100644 --- a/src/components/IssueIcon.svelte +++ b/src/components/IssueIcon.svelte @@ -4,7 +4,7 @@ export let icon: IssueIcon | string; -
+
{#if icon === 'fa-calendar-days'} > | undefined; @@ -74,8 +75,9 @@ const id = issue.merchantId.split(':'); const viewLink = id[0] + '/' + id[1]; const editLink = id[0] + '=' + id[1]; + const helpLink = getIssueHelpLink(issue.type); - return { icon, name, type, viewLink, editLink }; + return { icon, name, type, viewLink, editLink, helpLink }; }); const columns: ColumnDef[] = [ @@ -113,6 +115,13 @@ cell: (info) => flexRender(IssueCell, { id: 'editLink', value: info.getValue() }), enableSorting: false, enableGlobalFilter: false + }, + { + accessorKey: 'helpLink', + header: '', + cell: (info) => flexRender(IssueCell, { id: 'helpLink', value: info.getValue() }), + enableSorting: false, + enableGlobalFilter: false } ]; diff --git a/src/components/TaggingIssues.svelte b/src/components/TaggingIssues.svelte index ee740ce..d382f22 100644 --- a/src/components/TaggingIssues.svelte +++ b/src/components/TaggingIssues.svelte @@ -1,7 +1,7 @@

{issue.description}

+ {#if getIssueHelpLink(issue.type)} + + Help + + {/if}
{/each} {:else} diff --git a/src/lib/utils.ts b/src/lib/utils.ts index 8af56f5..4f756b6 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -131,6 +131,22 @@ export const getIssueIcon = (type: IssueType): IssueIcon => { } }; +export const getIssueHelpLink = (type: IssueType) => { + switch (type) { + case 'out_of_date': + case 'out_of_date_soon': + case 'not_verified': + return 'https://wiki.btcmap.org/general/outdated'; + case 'date_format': + return 'https://wiki.btcmap.org/general/tagging-instructions#verified-tags---more-information'; + case 'misspelled_tag': + return 'https://wiki.btcmap.org/general/tagging-instructions#required-tags'; + case 'missing_icon': + default: + return undefined; + } +}; + export const isEven = (number: number) => { return number % 2 === 0; };