diff --git a/deployment/frontend/src/components/Search.tsx b/deployment/frontend/src/components/Search.tsx index 043454ae6..7f39b6212 100644 --- a/deployment/frontend/src/components/Search.tsx +++ b/deployment/frontend/src/components/Search.tsx @@ -105,14 +105,18 @@ export default function Search({ -
+
{!isSearch || watch('search') != filters?.find((f) => f.key == 'search')?.value ? ( - ) : ( diff --git a/deployment/frontend/src/components/_shared/DownloadPopup.tsx b/deployment/frontend/src/components/_shared/DownloadPopup.tsx index a3cba8d29..be9a1ab13 100644 --- a/deployment/frontend/src/components/_shared/DownloadPopup.tsx +++ b/deployment/frontend/src/components/_shared/DownloadPopup.tsx @@ -305,8 +305,8 @@ export function DownloadPopup({ />
diff --git a/deployment/frontend/src/components/_shared/SimpleSelect.tsx b/deployment/frontend/src/components/_shared/SimpleSelect.tsx index beee6ae0d..883237bca 100644 --- a/deployment/frontend/src/components/_shared/SimpleSelect.tsx +++ b/deployment/frontend/src/components/_shared/SimpleSelect.tsx @@ -19,7 +19,7 @@ export interface Option { interface SimpleSelectProps { options: PathValue & Option>[] - placeholder: string + placeholder?: string className?: string maxWidth?: string formObj?: UseFormReturn @@ -71,7 +71,8 @@ export default function SimpleSelect({ id={id} className={classNames( 'relative text-left block w-full rounded-md border-0 px-5 py-3 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:border-b-2 focus:border-blue-800 focus:bg-slate-100 focus:ring-0 focus:ring-offset-0 sm:text-sm sm:leading-6', - className ?? '' + className ?? '', + !placeholder ? 'min-h-[2.5rem]' : '' )} >
-
+ +
setQuery(e.target.value)} value={query} name="search" - placeholder="Search applications" + placeholder={`Search applications`} aria-label="search" - className="h-14 rounded-sm block w-full border-0 px-5 py-2 text-gray-900 shadow-wri-small ring-1 ring-inset ring-gray-300 placeholder:text-gray-900 placeholder:text-base border-b-2 border-blue-800 focus:bg-slate-100 focus:ring-0 focus:ring-offset-0 sm:text-sm sm:leading-6" + className="h-full block w-full border-0 px-5 py-2 text-[#000000] shadow-wri-small rounded-tr-[3px] rounded-br-[3px] placeholder:text-gray-900 placeholder:text-base focus:bg-slate-100 focus:ring-0 focus:ring-offset-0 sm:text-sm sm:leading-6 leading-[19.2px] rounded-tl-[3px] rounded-bl-[3px] border-r-0" /> - {isLoading ? ( - - ) : ( - - )} +
+ {isLoading ? ( + + ) : ( + + )} +
diff --git a/deployment/frontend/src/components/applications/Hero.tsx b/deployment/frontend/src/components/applications/Hero.tsx index 7971cb027..09430077d 100644 --- a/deployment/frontend/src/components/applications/Hero.tsx +++ b/deployment/frontend/src/components/applications/Hero.tsx @@ -29,7 +29,7 @@ export function Hero({ application }: { application: Application }) { />
diff --git a/deployment/frontend/src/components/dashboard/datasets/admin/TopicsSelect.tsx b/deployment/frontend/src/components/dashboard/datasets/admin/TopicsSelect.tsx index fceb970af..07351fa1a 100644 --- a/deployment/frontend/src/components/dashboard/datasets/admin/TopicsSelect.tsx +++ b/deployment/frontend/src/components/dashboard/datasets/admin/TopicsSelect.tsx @@ -114,6 +114,10 @@ function TopicsInner({ }) .flat() + function getTopicByName(topicName: string) { + return flattenedTopicHierarchy.find((topic) => topic.name === topicName) + } + function BuildHierarchy( topic: TopicHierarchy, level: number @@ -188,7 +192,7 @@ function TopicsInner({ @@ -243,6 +243,9 @@ export function Hero() {

{ + if (data.search === '') { + return router.push('/search') + } router.push({ pathname: '/search', query: `search=%5B%7B%22title%22%3A%22Search%22%2C%22key%22%3A%22search%22%2C%22label%22%3A%22${encodeURIComponent( @@ -257,14 +260,16 @@ export function Hero() { - + + className="px-8 py-4 text-[26px] font-semibold font-acumin leading-[29.25px] text-black bg-wri-gold rounded-tr-[3px] rounded-br-[3px] h-[66px] w-full max-w-[149px] border-l-0 border-y-0" + > + Search +
diff --git a/deployment/frontend/src/components/search/FilteredSearchLayout.tsx b/deployment/frontend/src/components/search/FilteredSearchLayout.tsx index 06aad5d31..a8ff147cb 100755 --- a/deployment/frontend/src/components/search/FilteredSearchLayout.tsx +++ b/deployment/frontend/src/components/search/FilteredSearchLayout.tsx @@ -477,7 +477,7 @@ export default function FilteredSearchLayout({ <>
- {filters.map((f) => ( -
-
- {f.title}: {f.label} -
- -
- ))} + if (setFacetSelectedCount) + setFacetSelectedCount((prev) => { + const newFacetSelectedCount = { + ...prev, + } + //@ts-ignore + newFacetSelectedCount[f.key] -= 1 + return newFacetSelectedCount + }) + + if (setValue) + setValue((prev) => { + return prev.filter( + (value) => value !== f.label + ) + }) + }} + > + + +
+ ))}
{filters.length ? ( )} - diff --git a/deployment/frontend/src/pages/applications/index.tsx b/deployment/frontend/src/pages/applications/index.tsx index 8073c5fec..5a28931ed 100644 --- a/deployment/frontend/src/pages/applications/index.tsx +++ b/deployment/frontend/src/pages/applications/index.tsx @@ -28,7 +28,9 @@ export async function getServerSideProps(context: GetServerSidePropsContext) { ctx: { session }, transformer: superjson, }) - await Promise.all([await helpers.applications.getAllApplications.prefetch()]) + await Promise.all([ + await helpers.applications.getAllApplications.prefetch(), + ]) return { props: { @@ -93,7 +95,9 @@ export default function ApplicationsPage( })) } - const links = [{ label: 'Applications', url: '/applications', current: true }] + const links = [ + { label: 'Applications', url: '/applications', current: true }, + ] return ( <> +
+
+
+

+ This page lets you explore all the data associated with + a specific WRI application or data product. +

+
+
{isLoading ? ( ) : ( diff --git a/deployment/frontend/src/pages/index.tsx b/deployment/frontend/src/pages/index.tsx index 03b967fdb..e63323d01 100644 --- a/deployment/frontend/src/pages/index.tsx +++ b/deployment/frontend/src/pages/index.tsx @@ -323,7 +323,7 @@ export default function Home( ) : (
1000) { + throw new Error('Input too long') + } + str = str.replace(/^\s+|\s+$/g, '') // trim + str = str.toLowerCase() + // remove accents, swap ñ for n, etc - var from = "àáäâèéëêìíïîòóöôùúüûñç·/_,:;"; - var to = "aaaaeeeeiiiioooouuuunc------"; - for (var i=0, l=from.length ; i