Skip to content

Commit

Permalink
Empty state UX tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chadokruse committed Nov 22, 2024
1 parent e1b9c44 commit 7da3701
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 6 deletions.
8 changes: 7 additions & 1 deletion apps/web/src/lib/components/profiles/Profile.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,13 @@
<div
class="shadow-blur relative flex min-w-0 flex-auto flex-col overflow-hidden rounded-2xl border-0 bg-white bg-clip-border bg-center p-4"
>
<FoundationHeader {organization_name} {profile} {formattedTaxPeriodEnd} />
<FoundationHeader
{organization_name}
{profile}
{formattedTaxPeriodEnd}
eobmfRecognizedExempt={profile.eobmf_recognized_exempt}
grantCount={profile.grant_count}
/>
</div>

<!-- Placeholder wrapper -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@
isStaffed: boolean;
hasWebsite: boolean;
hasRecentGrants: boolean;
grantCount: number;
}
let { noUnsolicited, isStaffed, hasWebsite, hasRecentGrants }: Props = $props();
let { noUnsolicited, isStaffed, hasWebsite, hasRecentGrants, grantCount }: Props = $props();
</script>

<dl class="grid grid-cols-1 overflow-hidden rounded-lg bg-white p-2">
<dd class="flex flex-row items-center justify-center text-2xl font-bold text-slate-700">
<!-- Solicitation Status -->
<div class="m-1 inline rounded p-2 {!noUnsolicited ? 'bg-green-500' : 'bg-yellow-500'}">
<div class="m-1 inline rounded p-2 {!noUnsolicited ? 'bg-green-500' : 'bg-yellow-500'} {grantCount < 2 ? 'bg-slate-200' : ''}">
{#if !noUnsolicited}
<LockOpen variation="solid" class="h-4 w-4 text-white" aria-hidden="true" />
{:else}
Expand All @@ -36,7 +37,7 @@
</div>

<!-- Grantmaking Status -->
<div class="m-1 inline rounded p-2 {hasRecentGrants ? 'bg-green-500' : 'bg-yellow-500'}">
<div class="m-1 inline rounded p-2 {hasRecentGrants ? 'bg-green-500' : 'bg-yellow-500'} {grantCount < 2 ? 'bg-slate-200' : ''}">
<CurrencyDollar variation="solid" class="h-4 w-4 text-white" aria-hidden="true" />
<span class="sr-only">Has Recent Grants {hasRecentGrants ? 'Available' : 'Not Available'}</span>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { copy } from 'svelte-copy';
import toast from 'svelte-french-toast';
import Dot from '$lib/components/shared/icons/Dot.svelte';
import { tooltip } from '$utils/tooltip';

Check warning on line 6 in apps/web/src/lib/components/profiles/header/FoundationHeader.svelte

View workflow job for this annotation

GitHub Actions / Deploy to Cloudflare

'tooltip' is defined but never used
import LetterAvatar from '$lib/components/shared/avatars/LetterAvatar.svelte';
import { formatEin } from '@repo/shared/functions/formatters/ein';
import { formatTaxPeriodDate, isOutdatedISOString } from '@repo/shared/functions/formatters/dates';
Expand All @@ -13,9 +14,11 @@
organization_name: GrantmakersExtractedDataObj['organization_name'];
profile: GrantmakersExtractedDataObj;
formattedTaxPeriodEnd: string;
eobmfRecognizedExempt: boolean;
grantCount: number;
}
let { organization_name, profile, formattedTaxPeriodEnd }: Props = $props();
let { organization_name, profile, formattedTaxPeriodEnd, eobmfRecognizedExempt, grantCount }: Props = $props();
let {
is_likely_staffed: isStaffed,
Expand Down Expand Up @@ -67,7 +70,9 @@
</div>
</div>

<Approachability {noUnsolicited} {isStaffed} {hasWebsite} {hasRecentGrants} />
{#if eobmfRecognizedExempt}
<Approachability {noUnsolicited} {isStaffed} {hasWebsite} {hasRecentGrants} {grantCount} />
{/if}

<!-- Right side of box: metadata -->
<div class="ml-4 grid w-full grid-cols-2 gap-x-2 gap-y-1 text-right md:ml-2 md:mt-0 md:w-auto md:gap-x-4">
Expand Down
33 changes: 33 additions & 0 deletions shared/utils/url-checker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { writeFile } from 'node:fs/promises';

async function checkUrl(url) {
try {
await fetch(url, {
method: 'HEAD',
redirect: 'follow',
});
return { url, working: true };
} catch {
return { url, working: false };
}
}

async function main() {
const urls = [
'http://youthexplosion4christ.com/',
'https://youthexplosion4christ.com/',
// Your URLs here
];

const results = await Promise.all(urls.map(checkUrl));

const deadLinks = results.filter((r) => !r.working).map((r) => r.url);

// await writeFile('dead-links.json', JSON.stringify(deadLinks, null, 2));
console.log(`Found ${deadLinks.length} dead links`);
console.log(JSON.stringify(deadLinks));
}

main().catch((error) => {
console.error(error);
});

0 comments on commit 7da3701

Please sign in to comment.