Skip to content
This repository has been archived by the owner on Aug 6, 2024. It is now read-only.

Commit

Permalink
Merge pull request #89 from hifis-net/88-update_v1.11.1
Browse files Browse the repository at this point in the history
88 update v1.11.1
  • Loading branch information
cmeessen authored Nov 23, 2022
2 parents a587d58 + 4f114a3 commit 04601fb
Show file tree
Hide file tree
Showing 13 changed files with 467 additions and 133 deletions.
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,5 @@ keywords:
- Software Impact
- Software Reuse
license: Apache-2.0
version: v1.11.0
date-released: '2022-11-15'
version: v1.11.1
date-released: '2022-11-18'
8 changes: 7 additions & 1 deletion database/100-create-api-views.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1171,7 +1171,13 @@ $$
BEGIN
SELECT count(id) FROM software INTO software_cnt;
SELECT count(id) FROM project INTO project_cnt;
SELECT count(id) FROM organisation WHERE parent IS NULL INTO organisation_cnt;
SELECT
count(id) AS organisation_cnt
FROM
organisations_overview(true)
WHERE
organisations_overview.parent IS NULL AND organisations_overview.score>0
INTO organisation_cnt;
SELECT count(display_name) FROM unique_contributors() INTO contributor_cnt;
SELECT count(mention) FROM mention_for_software INTO software_mention_cnt;
END
Expand Down
8 changes: 4 additions & 4 deletions frontend/components/AppFooter/ContactEmail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import Mail from '@mui/icons-material/Mail'
export default function ContactEmail({email}:{email?:string}) {
if (email) {
return (
<div>
<div className="mt-4 text-lg">Questions or comments?</div>
<div className="mt-8">
{/* <div className="mt-4 text-lg">Questions or comments?</div> */}
<a href={`mailto:${email}`}
className="flex mt-2 text-primary hover:text-primary-content"
className="flex text-primary hover:text-primary-content"
>
<Mail className="mr-2"/> {email}
<Mail className="mr-2"/> {email}
</a>
</div>
)
Expand Down
3 changes: 1 addition & 2 deletions frontend/components/AppFooter/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ export default function AppFooter () {
<div className="grid grid-cols-1 gap-8 px-4 md:grid-cols-[2fr,1fr] lg:container lg:mx-auto">
<div className="pt-8 md:py-8">
<p className="text-lg">
The Research Software Directory aims to promote the impact,
the exchange and re-use of research software.
The Research Software Directory promotes the impact, re-use and citation of research software.
</p>

<ContactEmail email={host?.email} />
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/GlobalSearchAutocomplete/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export default function GlobalSearchAutocomplete(props: Props) {
setOpen(false)
}}>
<div
className={`${props.className} relative z-10 flex w-full xl:w-52 xl:max-w-[320px] focus-within:w-full duration-700`}>
className={`${props.className} relative z-10 flex w-full xl:w-[14.5rem] xl:max-w-[20rem] focus-within:w-full duration-700`}>
<div className="absolute top-[14px] left-3 pointer-events-none">
{/* Search Icon */}
<svg width="16" height="16" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
Expand All @@ -138,7 +138,7 @@ export default function GlobalSearchAutocomplete(props: Props) {
</svg>
</div>
<input className="px-2 pl-8 py-2 bg-transparent rounded-sm border border-white border-opacity-50 focus:outline-0 w-full focus:bg-white focus:text-black duration-200"
placeholder="Search or jump to..."
placeholder="Search in RSD or jump to..."
autoComplete="off"
value={inputValue}
onChange={handleChange}
Expand Down
164 changes: 164 additions & 0 deletions frontend/components/home/rsd/OrganisationSignUp.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
// SPDX-FileCopyrightText: 2022 Dusan Mijatovic (dv4all)
// SPDX-FileCopyrightText: 2022 dv4all
//
// SPDX-License-Identifier: Apache-2.0

import {useState} from 'react'
import useTheme from '@mui/material/styles/useTheme'
import useMediaQuery from '@mui/material/useMediaQuery'
import Dialog from '@mui/material/Dialog'
import MailOutlineOutlined from '@mui/icons-material/MailOutlineOutlined'

import {config,organisationSignUp} from './config'
import useRsdSettings from '~/config/useRsdSettings'
import {useForm} from 'react-hook-form'

type SignUpOrganisation = {
name: string,
organisation: string,
role: string,
description: string
}

const inputClasses='mb-4 placeholder:text-gray-500 outline-0 p-2 w-full text-sm bg-transparent text-white border border-gray-600 rounded-sm'

export default function OrganisationSignUp({minWidth = '9rem'}:{minWidth:string}) {
const theme = useTheme()
const fullScreen = useMediaQuery(theme.breakpoints.down('sm'))
const {host} = useRsdSettings()
const [open, setOpen] = useState(false)

const {register, watch, reset} = useForm<SignUpOrganisation>({
mode: 'onChange',
defaultValues: {
name:'',
organisation: '',
role:'',
description: ''
}
})

const [name,organisation,role,description] = watch(['name','organisation','role','description'])

// console.group('Organisation Sing Up')
// console.log('name...', name)
// console.log('organisation...', organisation)
// console.log('description...', description)
// console.groupEnd()

function mailBody(): string | undefined {
return encodeURIComponent(`Hi RSD team,
I would like to add my organisation to RSD!
-------------------------
Name: ${name}
Organisation: ${organisation}
Professional role: ${role}
-------------------------
${description}
`)
}

function closeAndReset() {
setOpen(false)
// reset form after all processes settled
// we need to wait for mailBody function
setTimeout(() => {
reset()
},0)
}

return (
<>
<button
aria-describedby="Sign up button"
onClick={()=>setOpen(true)}
>
<div className="relative group">
<div
className="absolute -inset-1 bg-gradient-to-r from-purple-600 to-pink-600 rounded-lg blur opacity-25 group-hover:opacity-100 transition duration-1000 group-hover:duration-300"/>
<div
className="flex gap-3 text-black relative px-8 py-3 bg-white ring-1 ring-gray-900/5 rounded leading-none items-center justify-center space-x-2"
style={{
minWidth
}}
>
<span className="space-y-2 text-xl font-medium whitespace-nowrap">
{config.button.register.label}
</span>
</div>
</div>
</button>
<Dialog
fullScreen={fullScreen}
open={open}
onClose={()=>setOpen(false)}
aria-labelledby="responsive-dialog-title"
>
<div className="h-full w-full bg-[#232323] p-6">
<div className="mx-auto">
<div className="text-white text-xl mb-4">
{config.button.register.label}
</div>
<div className="text-sm text-[#B7B7B7] pb-4">
You can find more information about registering your organisation in our <u><a href="https://research-software-directory.github.io/documentation/register-organization.html" target="_blank" rel="noreferrer">documentation</a></u>.
</div>
{/* INPUTS */}
<input type="text"
autoFocus={true}
autoComplete="off"
className={inputClasses}
placeholder={organisationSignUp.name.label}
{...register('name')}
/>
<input type="text"
autoComplete="off"
className={inputClasses}
placeholder={organisationSignUp.organisation.label}
{...register('organisation')}
/>
<input type="text"
autoComplete="off"
className={inputClasses}
placeholder={organisationSignUp.role.label}
{...register('role')}
/>
<textarea
rows={5}
className={inputClasses}
placeholder={organisationSignUp.description.label}
{...register('description')}
>
</textarea>
{/* NOTIFICATIONS */}
<div className="text-sm text-[#B7B7B7] pb-4">
{organisationSignUp.notification[0]} <br/>
{organisationSignUp.notification[1]}
</div>
{/* NAVIGATION */}
<div className="flex justify-end items-center gap-4 my-2">
<button
className="text-sm text-white border border-gray-500 text-opacity-60 rounded px-4 py-1 hover:opacity-90 active:opacity-95"
onClick={closeAndReset}>
Cancel
</button>
<a
role="button"
type="submit"
onClick={closeAndReset}
className="text-sm text-white hover:text-white bg-primary px-4 py-1 rounded hover:opacity-90 active:opacity-95"
target="_blank"
rel="noreferrer"
href={`mailto:${host.email}?subject=${encodeURIComponent(config.button.register.label)}&body=${mailBody()}`}
>
<MailOutlineOutlined/> Create email *
</a>
</div>
</div>
</div>
</Dialog>
</>
)
}
Loading

0 comments on commit 04601fb

Please sign in to comment.