Skip to content

Commit

Permalink
feat: home page without counts and news
Browse files Browse the repository at this point in the history
test: fix home page tests
chore: fix meta description for project and organisation pages
  • Loading branch information
dmijatovic committed Jul 5, 2024
1 parent a20f8af commit b5d941e
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 176 deletions.
11 changes: 2 additions & 9 deletions frontend/__tests__/Home.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,10 @@ describe('pages/index.tsx', () => {
expect(page).toBeInTheDocument()
})

it('renders counts on KIN Home page', () => {
it('renders Our Programs section on KIN Home page', () => {
render(WrappedComponentWithProps(Home,{props}))
// software_cnt
// const software = screen.getByText(`${props.counts.software_cnt} Software`)
// expect(software).toBeInTheDocument()
// project_cnt
const project = screen.getByText(`${props.counts.project_cnt} Projects`)
const project = screen.getByText('Our Programs')
expect(project).toBeInTheDocument()
// organisation_cnt
const organisation = screen.getByText(`${props.counts.organisation_cnt} Organisations`)
expect(organisation).toBeInTheDocument()
})

// it('renders Helmholtz Home page when host=helmholtz', () => {
Expand Down
5 changes: 2 additions & 3 deletions frontend/components/AppFooter/OrganisationLogo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ export default function OrganisationLogo({host}: { host: RsdHost }) {
const {name,logo_url,website}=host
return (
<div className="flex items-center">
<a href={website} target="_blank"
className="h-[4rem] w-[16rem]" rel="noreferrer">
<a href={website} target="_blank" rel="noreferrer">
<LogoAvatar
name={name}
src={logo_url}
Expand All @@ -27,7 +26,7 @@ export default function OrganisationLogo({host}: { host: RsdHost }) {
const {name,logo_url}=host
return (
<div className="flex items-center">
<span className="h-[4rem] w-[16rem]">
<span>
<LogoAvatar
name={name}
src={logo_url}
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/AppFooter/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function AppFooter () {
</p>
<ContactEmail email={host?.email} headers={host?.emailHeaders} />
{/* <div className="py-4"></div> */}
<div className="bg-base-100 w-[20rem] p-4 rounded-md mt-4">
<div className="bg-base-100 w-[24rem] p-4 rounded-md mt-4">
<OrganisationLogo host={host} />
</div>

Expand Down
42 changes: 0 additions & 42 deletions frontend/components/home/kin/StatsSection.tsx

This file was deleted.

72 changes: 0 additions & 72 deletions frontend/components/home/kin/TopNewsSection.tsx

This file was deleted.

39 changes: 1 addition & 38 deletions frontend/components/home/kin/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,14 @@ import 'aos/dist/aos.css'

import AppHeader from '~/components/AppHeader'
import AppFooter from '~/components/AppFooter'
import {TopNewsProps} from '~/components/news/apiNews'
import Arc from '~/components/home/rsd/arc.svg'
import StatsSection from './StatsSection'
import JumboBanner from './JumboBanner'
import TopNewsSection from './TopNewsSection'
import HomepageDivider from './HomepageDivider'
import AboutUsSection from './AboutUsSection'
import OurProgramsSection from './OurProgramsSection'


import ContributeSection from './ContributeSection'

export type RsdHomeProps = {
software_cnt: number,
open_software_cnt: number,
project_cnt: number,
organisation_cnt: number,
contributor_cnt: number,
software_mention_cnt: number,
news: TopNewsProps[]
}

export default function RsdHome({
project_cnt, organisation_cnt,
contributor_cnt, software_mention_cnt,news
}: RsdHomeProps) {
export default function RsdHome() {
// Initialize AOS library
useEffect(() => {
AOS.init({offset: 16})
Expand All @@ -52,23 +34,9 @@ export default function RsdHome({
{/* Jumbo Banner */}
<JumboBanner />

{/* KIN stats */}
<StatsSection
project_cnt={project_cnt}
organisation_cnt={organisation_cnt}
contributor_cnt={contributor_cnt}
software_mention_cnt={software_mention_cnt}
/>

<div className="bg-base-800">
{/* Arc separator */}
<Arc className="w-full text-base-100 dark:text-base-900 -translate-y-1"></Arc>
{/* Get started section */}
{/* <GetStartedSection /> */}
{/* Top news items, ONLY if there are some */}
<TopNewsSection news={news} />
{/* Divider */}
<HomepageDivider />
{/* Our Programs Section */}
<OurProgramsSection />
{/* Divider */}
Expand All @@ -79,11 +47,6 @@ export default function RsdHome({
<HomepageDivider />
{/* About us section */}
<AboutUsSection />
{/* Divider */}
{/* <HomepageDivider /> */}
{/* Logos */}
{/* <LogoSection /> */}
{/* Footer */}
<div className="mt-20"></div>
<AppFooter />
</div >
Expand Down
4 changes: 2 additions & 2 deletions frontend/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export type HomeProps = {
}

const pageTitle = `Home | ${app.title}`
const pageDesc = 'The Research Project Directory is designed to show the impact research software has on research and society. We stimulate the reuse of research software and encourage proper citation of research software to ensure researchers and RSEs get credit for their work.'
const pageDesc = 'KIN connects, broadens, deepens, and unlocks knowledge for transitions towards a climate-neutral and climate-resilient society.'

export default function Home({counts,news}: HomeProps) {
const {host} = useRsdSettings()
Expand All @@ -42,7 +42,7 @@ export default function Home({counts,news}: HomeProps) {
/>
{/* canonical url meta tag */}
<CanonicalUrl/>
<KinRpdHome {...counts} news={news} />
<KinRpdHome />
</>
)
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/pages/organisations/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type OrganisationsOverviewPageProps = {
}

const pageTitle = `Organisations | ${app.title}`
const pageDesc = 'List of organizations involved in the development of research software.'
const pageDesc = 'List of organizations involved in KIN projects.'

export default function OrganisationsOverviewPage({
organisations = [], count, page, rows, search
Expand Down
2 changes: 1 addition & 1 deletion frontend/pages/projects/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export type ProjectOverviewPageProps = {
}

const pageTitle = `Projects | ${app.title}`
const pageDesc = 'The list of research projects in the Research Software Directory.'
const pageDesc = 'The list of research projects in the KIN RPD.'

export default function ProjectsOverviewPage({
search, order,
Expand Down
9 changes: 2 additions & 7 deletions frontend/public/data/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "kin-rpd",
"emailHeaders": [],
"logo_url": "/images/logo-KIN.svg",
"website": "https://hetkin.nl",
"website": "https://hetkin.nl/en/home-en/",
"feedback": {
"enabled": true,
"url": "[email protected]",
Expand Down Expand Up @@ -31,14 +31,9 @@
"target": "_blank"
},
{
"label": "Het KIN website",
"label": "Het KIN",
"url": "https://hetkin.nl/",
"target": "_blank"
},
{
"label": "News",
"url": "/news",
"target": "_self"
}
],
"theme": {
Expand Down

0 comments on commit b5d941e

Please sign in to comment.