From 0c3e60b6a5cdc2801da607803e9db28668e75f84 Mon Sep 17 00:00:00 2001 From: Finlay Birnie Date: Mon, 9 Dec 2024 09:56:52 +0000 Subject: [PATCH 1/6] replace research culture report copy with ARI copy --- ui/src/components/Nav/index.tsx | 4 -- ui/src/pages/index.tsx | 67 +++++++++++++++------------------ 2 files changed, 30 insertions(+), 41 deletions(-) diff --git a/ui/src/components/Nav/index.tsx b/ui/src/components/Nav/index.tsx index 9a0c0ad49..2b3f62059 100644 --- a/ui/src/components/Nav/index.tsx +++ b/ui/src/components/Nav/index.tsx @@ -71,10 +71,6 @@ const Nav: React.FC = (): React.ReactElement => { label: 'Learn More', value: Config.urls.about.path }, - { - label: 'Research Culture Report', - value: Config.urls.researchCultureReport.path - }, { label: 'News and Updates', value: Config.urls.blog.path diff --git a/ui/src/pages/index.tsx b/ui/src/pages/index.tsx index 5c0e1a0c4..9431dd42a 100644 --- a/ui/src/pages/index.tsx +++ b/ui/src/pages/index.tsx @@ -6,6 +6,7 @@ import * as Config from '@/config'; import * as Types from '@/types'; const Home: Types.NextPage = (props): React.ReactElement => { + const buttonClasses = 'px-4 py-1 rounded-lg'; return ( <> @@ -33,55 +34,47 @@ const Home: Types.NextPage = (props): React.ReactElement => { community to build upon it.

- - - Learn more - - - + - - Author Guide - - - - + - - Find Publications - - + title="Find Publications" + variant="block" + />

- Research Culture Report + UK Government Areas of Research Interest

- Researchers at the University of Bristol have recently conducted an investigation into the - current state of the research culture. They found academic researchers demoralised by a culture - that disincentivises sharing and collaboration, encourages questionable research practices, and - increases the risk of bias. These findings underline the need for a platform such as Octopus. - Their results are detailed in the report "A snapshot of the academic research culture in - 2023 and how it might be improved". + Octopus is now populated with research problems derived from Areas of Research Interest + published by UK Government departments. To view these, click on the button below. Publishing a + Rationale/Hypothesis linked to one of these Research Problems will give the option of passing + your details to the relevant government department. We hope this helps collaboration between + government and researchers.

- - - Learn more - - +
From a3e09fc827d82aab7a6fca0e52ca03687c2cb1c1 Mon Sep 17 00:00:00 2001 From: Finlay Birnie Date: Tue, 10 Dec 2024 13:36:58 +0000 Subject: [PATCH 2/6] change link destination to organisation search --- ui/src/pages/index.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ui/src/pages/index.tsx b/ui/src/pages/index.tsx index 6e713784a..5d6e0dc1e 100644 --- a/ui/src/pages/index.tsx +++ b/ui/src/pages/index.tsx @@ -69,9 +69,7 @@ const Home: Types.NextPage = (props): React.ReactElement => { From cd5e3d0f571b4ab6d7c229f9a894fdf8e4937905 Mon Sep 17 00:00:00 2001 From: Finlay Birnie Date: Wed, 11 Dec 2024 09:31:46 +0000 Subject: [PATCH 3/6] forward ref to search input --- ui/src/components/SearchPage/index.tsx | 405 +++++++++++---------- ui/src/pages/search/publications/index.tsx | 1 + 2 files changed, 205 insertions(+), 201 deletions(-) diff --git a/ui/src/components/SearchPage/index.tsx b/ui/src/components/SearchPage/index.tsx index 67ce52444..0d8295440 100644 --- a/ui/src/components/SearchPage/index.tsx +++ b/ui/src/components/SearchPage/index.tsx @@ -33,217 +33,220 @@ type Props = { } ); -const SearchPage: React.FC = (props: Props): React.ReactElement => { - const router = Router.useRouter(); +const SearchPage = React.forwardRef( + (props: Props, searchInputRef: React.ForwardedRef): React.ReactElement => { + const router = Router.useRouter(); - const upperPageBound = props.limit + props.offset > props.total ? props.total : props.limit + props.offset; + const upperPageBound = props.limit + props.offset > props.total ? props.total : props.limit + props.offset; - return ( - <> -
- -
-
-
-
- Search options + return ( + <> +
+ +
+
+
+
+ Search options - + - -
-
- -
-
- {props.filters && ( - - )} -
-
- {props.error ? props.error : `${props.total} result${props.total !== 1 ? 's' : ''}`} -
- {props.error ? ( - - ) : ( - - {!props.error && !props.results.length && !props.isValidating && ( - + + Showing + + + +
+
+ +
+
+ {props.filters && ( + + )} +
+
+ {props.error ? props.error : `${props.total} result${props.total !== 1 ? 's' : ''}`} +
+ {props.error ? ( + + ) : ( + + {!props.error && !props.results.length && !props.isValidating && ( + + )} - {props.results.length && ( - <> -
- {props.results.map((result, index: number) => { - let classes = ''; + {props.results.length && ( + <> +
+ {props.results.map((result, index: number) => { + let classes = ''; - if (index === 0) { - classes += 'rounded-t'; - } + if (index === 0) { + classes += 'rounded-t'; + } - if (index === props.results.length - 1) { - classes += '!border-b-transparent !rounded-b'; - } + if (index === props.results.length - 1) { + classes += '!border-b-transparent !rounded-b'; + } - return props.searchType === 'publication-versions' ? ( - - ) : props.searchType === 'authors' || - props.searchType === 'organisations' ? ( - - ) : props.searchType == 'topics' ? ( - - ) : ( - <> - ); - })} -
+ return props.searchType === 'publication-versions' ? ( + + ) : props.searchType === 'authors' || + props.searchType === 'organisations' ? ( + + ) : props.searchType == 'topics' ? ( + + ) : ( + <> + ); + })} +
- {!props.isValidating && !!props.results.length && ( - -
- { - props.setOffset(props.offset - props.limit); - Helpers.scrollTopSmooth(); - }} - disabled={props.offset === 0} - title="Previous" - /> - { - props.setOffset(props.offset + props.limit); - Helpers.scrollTopSmooth(); - }} - disabled={props.limit + props.offset >= props.total} - title="Next" - /> -
- - Showing {props.offset + 1} - {upperPageBound} of {props.total} - -
- )} - - )} -
- )} -
-
- - ); -}; +
+ { + props.setOffset(props.offset - props.limit); + Helpers.scrollTopSmooth(); + }} + disabled={props.offset === 0} + title="Previous" + /> + { + props.setOffset(props.offset + props.limit); + Helpers.scrollTopSmooth(); + }} + disabled={props.limit + props.offset >= props.total} + title="Next" + /> +
+ + Showing {props.offset + 1} - {upperPageBound} of {props.total} + + + )} + + )} + + )} + +
+ + ); + } +); export default SearchPage; diff --git a/ui/src/pages/search/publications/index.tsx b/ui/src/pages/search/publications/index.tsx index c6be78d0a..66afb2093 100644 --- a/ui/src/pages/search/publications/index.tsx +++ b/ui/src/pages/search/publications/index.tsx @@ -462,6 +462,7 @@ const Publications: Types.NextPage = (props): React.ReactElement => { limit={limit} offset={offset} query={query} + ref={searchInputRef} resetFilters={resetFilters} results={response?.data || []} searchType="publication-versions" From d67b43374ddaa38b3abe625d85ffbeb8d5ab96a8 Mon Sep 17 00:00:00 2001 From: Finlay Birnie Date: Wed, 11 Dec 2024 09:32:04 +0000 Subject: [PATCH 4/6] make timeout match api gateway --- api/serverless.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/serverless.yml b/api/serverless.yml index fe9122995..de138dbf3 100644 --- a/api/serverless.yml +++ b/api/serverless.yml @@ -10,7 +10,7 @@ provider: name: aws architecture: arm64 deploymentMethod: direct - timeout: 30 + timeout: 29 runtime: nodejs20.x region: eu-west-1 stage: ${opt:stage} From 3b2303e84f620f947c20f75d388f47391ad715fc Mon Sep 17 00:00:00 2001 From: Finlay Birnie Date: Wed, 11 Dec 2024 09:32:55 +0000 Subject: [PATCH 5/6] ignore self signed certificates generated by nextjs https option --- ui/.gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/.gitignore b/ui/.gitignore index 866c56985..8c4eda61c 100644 --- a/ui/.gitignore +++ b/ui/.gitignore @@ -41,3 +41,6 @@ yarn-error.log* # playwright .env + +# Self-signed certificates from nextJS https flag +certificates \ No newline at end of file From 8be8da15ccafb1957c11c620713ac1c50be31a04 Mon Sep 17 00:00:00 2001 From: Finlay Birnie Date: Wed, 11 Dec 2024 09:41:37 +0000 Subject: [PATCH 6/6] SearchPage component now needs a displayname --- ui/src/components/SearchPage/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/src/components/SearchPage/index.tsx b/ui/src/components/SearchPage/index.tsx index 0d8295440..a288a0b35 100644 --- a/ui/src/components/SearchPage/index.tsx +++ b/ui/src/components/SearchPage/index.tsx @@ -248,5 +248,6 @@ const SearchPage = React.forwardRef( ); } ); +SearchPage.displayName = 'SearchPage'; export default SearchPage;