Skip to content

Commit 3c42fba

Browse files
authored
ODP-380 (#620)
1 parent b0ff795 commit 3c42fba

File tree

6 files changed

+55
-56
lines changed

6 files changed

+55
-56
lines changed

deployment/frontend/src/components/applications/ApplicationSearch.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ export default function ApplicationSearch({
2424
onSubmit={(e) => console.log(e)}
2525
className="w-full px-8 xxl:px-0 max-w-8xl mx-auto"
2626
>
27+
<div className="w-full max-w-[819px] xxl:pl-8 2xl:px-0 ">
28+
<h1 className="text-[40px] leading-[48px] font-acumin font-semibold text-white mb-[25px]">
29+
Applications
30+
</h1>
31+
</div>
2732
<div className="relative flex w-full max-w-[819px] items-start justify-start gap-x-6 xxl:pl-8 2xl:px-0">
2833
<input
2934
onChange={(e) => setQuery(e.target.value)}

deployment/frontend/src/components/applications/DatasetApplication.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default function DatasetApplication({ application }: { application: Appli
2121

2222
return (
2323
<section>
24-
<div className="font-['Acumin Pro SemiCondensed'] text-2xl font-semibold text-black truncate whitespace-normal">
24+
<div className="font-['Acumin Pro SemiCondensed'] text-2xl font-semibold text-black truncate whitespace-normal mb-6">
2525
Datasets associated with {application.title ?? application.name}{' '}
2626
{isLoading ? <Spinner /> : `(${data?.count})`}
2727
</div>

deployment/frontend/src/components/applications/Hero.tsx

Lines changed: 43 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ import { Application, GroupTree, GroupsmDetails } from '@/schema/ckan.schema'
77
import Link from 'next/link'
88
import { useSession } from 'next-auth/react'
99
import { api } from '@/utils/api'
10+
import {
11+
ArrowTurnLeftUpIcon,
12+
ArrowUpRightIcon,
13+
} from '@heroicons/react/24/solid'
1014

1115
export function Hero({ application }: { application: Application }) {
1216
const { data: session } = useSession()
@@ -23,71 +27,61 @@ export function Hero({ application }: { application: Application }) {
2327
}`}
2428
className="object-cover"
2529
/>
26-
<div className="absolute bottom-0 z-10 flex lg:h-[68px] lg:w-56 px-4 py-4 items-center justify-center rounded-t-[3px] bg-white">
30+
<div className="absolute bottom-0 z-10 flex lg:h-[68px] lg:w-60 px-4 py-4 items-center justify-center rounded-t-[3px] bg-white">
2731
<Link
2832
href="/application"
29-
className="inline-flex items-center justify-center ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-amber-400 text-stone-900 font-bold font-acumin hover:bg-yellow-500 h-11 px-6 py-4 rounded-[3px] text-base"
33+
className="whitespace-nowrap inline-flex items-center justify-center ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-amber-400 text-stone-900 font-bold font-acumin hover:bg-yellow-500 h-11 px-6 py-4 rounded-[3px] text-base"
3034
>
3135
<ChevronLeftIcon className="mb-1 lg:mr-1 h-6 w-6" />
3236
<span>See all applications</span>
3337
</Link>
3438
</div>
3539
</div>
36-
<div className="flex flex-col gap-y-1 px-4 py-6 lg:col-span-3">
40+
<div className="flex flex-col justify-center gap-y-1 px-4 py-6 lg:col-span-3">
3741
<div className="text-[33px] font-bold text-black">
3842
{application.title}
3943
</div>
40-
<div className="max-w-[578.85px] text-lg font-light text-black">
41-
{application?.description}
42-
</div>
44+
<p className="max-w-[578.85px] text-lg font-light text-black">
45+
{application?.description}{' '}
46+
<a
47+
href={application.contact_url}
48+
target="_blank"
49+
rel="noreferrer"
50+
className="underline "
51+
>
52+
Contact the {application.title ?? application.name} Team
53+
</a>
54+
</p>
4355
<div className="flex items-center gap-3">
4456
<div className="text-base font-light text-black">
45-
{application.package_count} Dataset(s)
57+
{application.package_count} associated dataset
58+
{application.package_count > 1 ? 's' : ''}
4659
</div>
4760
</div>
48-
<CopyLink />
61+
<div className="flex items-center gap-3">
62+
<Button className="mt-3">
63+
<a
64+
href={application.homepage_url}
65+
target="_blank"
66+
rel="noreferrer"
67+
className="flex items-center gap-1"
68+
>
69+
Open Application{' '}
70+
<ArrowUpRightIcon className="h-5 w-5" />
71+
</a>
72+
</Button>
73+
<Button className="mt-3" variant="outline">
74+
<a
75+
href={application.help_url}
76+
target="_blank"
77+
rel="noreferrer"
78+
className="flex items-center gap-1"
79+
>
80+
Visit Guide <ArrowUpRightIcon className="h-5 w-5" />
81+
</a>
82+
</Button>
83+
</div>
4984
</div>
5085
</div>
5186
)
5287
}
53-
54-
function CopyLink() {
55-
const [clicked, setClicked] = useState(false)
56-
return (
57-
<>
58-
{!clicked ? (
59-
<Button
60-
onClick={async () => {
61-
await navigator.clipboard.writeText(
62-
window.location.href
63-
)
64-
setClicked(!clicked)
65-
setTimeout(() => {
66-
setClicked(false)
67-
}, 3000)
68-
}}
69-
variant="outline"
70-
className="mr-auto mt-3"
71-
>
72-
Share application
73-
</Button>
74-
) : (
75-
<button
76-
onClick={() => setClicked(!clicked)}
77-
className="mt-3 flex h-auto max-w-[578px] gap-2 rounded-sm border border-amber-400 px-5 py-3"
78-
>
79-
<ClipboardDocumentIcon className="h-6 w-6 text-gray-800" />
80-
<div className="max-w-[30rem]">
81-
<p className="text-start text-sm font-semibold text-black">
82-
Link copied to clipboard
83-
</p>
84-
<p className="text-start text-sm font-light">
85-
Make sure that the users who you are sharing the
86-
collection with, have permissions to see it.
87-
</p>
88-
</div>
89-
</button>
90-
)}
91-
</>
92-
)
93-
}

deployment/frontend/src/pages/applications/[applicationName].tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ export async function getServerSideProps(
4646
},
4747
}
4848
} catch (e) {
49-
console.log('FAILED TO GET APP', e)
5049
return {
5150
props: {},
5251
redirect: {

deployment/frontend/src/pages/index.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ export default function Home(
173173
{({ selected }) => (
174174
<div
175175
className={classNames(
176-
'text-black text-2xl font-medium font-acumin',
176+
'text-black text-2xl font-medium font-acumin cursor-pointer',
177177
selected
178178
? 'text-[#32864b] underline underline-offset-8'
179179
: ''
@@ -188,7 +188,7 @@ export default function Home(
188188
{({ selected }) => (
189189
<div
190190
className={classNames(
191-
'text-black text-2xl font-medium font-acumin',
191+
'text-black text-2xl font-medium font-acumin cursor-pointer',
192192
selected
193193
? 'text-[#32864b] underline underline-offset-8'
194194
: ''
@@ -229,7 +229,7 @@ export default function Home(
229229
{({ selected }) => (
230230
<div
231231
className={classNames(
232-
'text-black text-2xl font-medium font-acumin',
232+
'text-black text-2xl font-medium font-acumin cursor-pointer',
233233
selected
234234
? 'text-[#32864b] underline underline-offset-8'
235235
: ''
@@ -243,7 +243,7 @@ export default function Home(
243243
{({ selected }) => (
244244
<div
245245
className={classNames(
246-
'text-black text-2xl font-medium font-acumin',
246+
'text-black text-2xl font-medium font-acumin cursor-pointer',
247247
selected
248248
? 'text-[#32864b] underline underline-offset-8'
249249
: ''
@@ -257,7 +257,7 @@ export default function Home(
257257
{({ selected }) => (
258258
<div
259259
className={classNames(
260-
'text-black text-2xl font-medium font-acumin',
260+
'text-black text-2xl font-medium font-acumin cursor-pointer',
261261
selected
262262
? 'text-[#32864b] underline underline-offset-8'
263263
: ''

deployment/frontend/src/schema/ckan.schema.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ export type Application = Group & {
196196
image_url: string
197197
image_display_url: string
198198
help_url: string
199+
homepage_url: string
199200
contact_url: string
200201
packages?: Array<Dataset>
201202
package_count: number

0 commit comments

Comments
 (0)