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

Commit 04601fb

Browse files
authored
Merge pull request #89 from hifis-net/88-update_v1.11.1
88 update v1.11.1
2 parents a587d58 + 4f114a3 commit 04601fb

File tree

13 files changed

+467
-133
lines changed

13 files changed

+467
-133
lines changed

CITATION.cff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,5 +75,5 @@ keywords:
7575
- Software Impact
7676
- Software Reuse
7777
license: Apache-2.0
78-
version: v1.11.0
79-
date-released: '2022-11-15'
78+
version: v1.11.1
79+
date-released: '2022-11-18'

database/100-create-api-views.sql

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1171,7 +1171,13 @@ $$
11711171
BEGIN
11721172
SELECT count(id) FROM software INTO software_cnt;
11731173
SELECT count(id) FROM project INTO project_cnt;
1174-
SELECT count(id) FROM organisation WHERE parent IS NULL INTO organisation_cnt;
1174+
SELECT
1175+
count(id) AS organisation_cnt
1176+
FROM
1177+
organisations_overview(true)
1178+
WHERE
1179+
organisations_overview.parent IS NULL AND organisations_overview.score>0
1180+
INTO organisation_cnt;
11751181
SELECT count(display_name) FROM unique_contributors() INTO contributor_cnt;
11761182
SELECT count(mention) FROM mention_for_software INTO software_mention_cnt;
11771183
END

frontend/components/AppFooter/ContactEmail.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ import Mail from '@mui/icons-material/Mail'
88
export default function ContactEmail({email}:{email?:string}) {
99
if (email) {
1010
return (
11-
<div>
12-
<div className="mt-4 text-lg">Questions or comments?</div>
11+
<div className="mt-8">
12+
{/* <div className="mt-4 text-lg">Questions or comments?</div> */}
1313
<a href={`mailto:${email}`}
14-
className="flex mt-2 text-primary hover:text-primary-content"
14+
className="flex text-primary hover:text-primary-content"
1515
>
16-
<Mail className="mr-2"/> {email}
16+
<Mail className="mr-2"/> {email}
1717
</a>
1818
</div>
1919
)

frontend/components/AppFooter/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ export default function AppFooter () {
2121
<div className="grid grid-cols-1 gap-8 px-4 md:grid-cols-[2fr,1fr] lg:container lg:mx-auto">
2222
<div className="pt-8 md:py-8">
2323
<p className="text-lg">
24-
The Research Software Directory aims to promote the impact,
25-
the exchange and re-use of research software.
24+
The Research Software Directory promotes the impact, re-use and citation of research software.
2625
</p>
2726

2827
<ContactEmail email={host?.email} />

frontend/components/GlobalSearchAutocomplete/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export default function GlobalSearchAutocomplete(props: Props) {
128128
setOpen(false)
129129
}}>
130130
<div
131-
className={`${props.className} relative z-10 flex w-full xl:w-52 xl:max-w-[320px] focus-within:w-full duration-700`}>
131+
className={`${props.className} relative z-10 flex w-full xl:w-[14.5rem] xl:max-w-[20rem] focus-within:w-full duration-700`}>
132132
<div className="absolute top-[14px] left-3 pointer-events-none">
133133
{/* Search Icon */}
134134
<svg width="16" height="16" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
@@ -138,7 +138,7 @@ export default function GlobalSearchAutocomplete(props: Props) {
138138
</svg>
139139
</div>
140140
<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"
141-
placeholder="Search or jump to..."
141+
placeholder="Search in RSD or jump to..."
142142
autoComplete="off"
143143
value={inputValue}
144144
onChange={handleChange}
Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
// SPDX-FileCopyrightText: 2022 Dusan Mijatovic (dv4all)
2+
// SPDX-FileCopyrightText: 2022 dv4all
3+
//
4+
// SPDX-License-Identifier: Apache-2.0
5+
6+
import {useState} from 'react'
7+
import useTheme from '@mui/material/styles/useTheme'
8+
import useMediaQuery from '@mui/material/useMediaQuery'
9+
import Dialog from '@mui/material/Dialog'
10+
import MailOutlineOutlined from '@mui/icons-material/MailOutlineOutlined'
11+
12+
import {config,organisationSignUp} from './config'
13+
import useRsdSettings from '~/config/useRsdSettings'
14+
import {useForm} from 'react-hook-form'
15+
16+
type SignUpOrganisation = {
17+
name: string,
18+
organisation: string,
19+
role: string,
20+
description: string
21+
}
22+
23+
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'
24+
25+
export default function OrganisationSignUp({minWidth = '9rem'}:{minWidth:string}) {
26+
const theme = useTheme()
27+
const fullScreen = useMediaQuery(theme.breakpoints.down('sm'))
28+
const {host} = useRsdSettings()
29+
const [open, setOpen] = useState(false)
30+
31+
const {register, watch, reset} = useForm<SignUpOrganisation>({
32+
mode: 'onChange',
33+
defaultValues: {
34+
name:'',
35+
organisation: '',
36+
role:'',
37+
description: ''
38+
}
39+
})
40+
41+
const [name,organisation,role,description] = watch(['name','organisation','role','description'])
42+
43+
// console.group('Organisation Sing Up')
44+
// console.log('name...', name)
45+
// console.log('organisation...', organisation)
46+
// console.log('description...', description)
47+
// console.groupEnd()
48+
49+
function mailBody(): string | undefined {
50+
return encodeURIComponent(`Hi RSD team,
51+
52+
I would like to add my organisation to RSD!
53+
54+
-------------------------
55+
Name: ${name}
56+
Organisation: ${organisation}
57+
Professional role: ${role}
58+
-------------------------
59+
60+
${description}
61+
`)
62+
}
63+
64+
function closeAndReset() {
65+
setOpen(false)
66+
// reset form after all processes settled
67+
// we need to wait for mailBody function
68+
setTimeout(() => {
69+
reset()
70+
},0)
71+
}
72+
73+
return (
74+
<>
75+
<button
76+
aria-describedby="Sign up button"
77+
onClick={()=>setOpen(true)}
78+
>
79+
<div className="relative group">
80+
<div
81+
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"/>
82+
<div
83+
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"
84+
style={{
85+
minWidth
86+
}}
87+
>
88+
<span className="space-y-2 text-xl font-medium whitespace-nowrap">
89+
{config.button.register.label}
90+
</span>
91+
</div>
92+
</div>
93+
</button>
94+
<Dialog
95+
fullScreen={fullScreen}
96+
open={open}
97+
onClose={()=>setOpen(false)}
98+
aria-labelledby="responsive-dialog-title"
99+
>
100+
<div className="h-full w-full bg-[#232323] p-6">
101+
<div className="mx-auto">
102+
<div className="text-white text-xl mb-4">
103+
{config.button.register.label}
104+
</div>
105+
<div className="text-sm text-[#B7B7B7] pb-4">
106+
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>.
107+
</div>
108+
{/* INPUTS */}
109+
<input type="text"
110+
autoFocus={true}
111+
autoComplete="off"
112+
className={inputClasses}
113+
placeholder={organisationSignUp.name.label}
114+
{...register('name')}
115+
/>
116+
<input type="text"
117+
autoComplete="off"
118+
className={inputClasses}
119+
placeholder={organisationSignUp.organisation.label}
120+
{...register('organisation')}
121+
/>
122+
<input type="text"
123+
autoComplete="off"
124+
className={inputClasses}
125+
placeholder={organisationSignUp.role.label}
126+
{...register('role')}
127+
/>
128+
<textarea
129+
rows={5}
130+
className={inputClasses}
131+
placeholder={organisationSignUp.description.label}
132+
{...register('description')}
133+
>
134+
</textarea>
135+
{/* NOTIFICATIONS */}
136+
<div className="text-sm text-[#B7B7B7] pb-4">
137+
{organisationSignUp.notification[0]} <br/>
138+
{organisationSignUp.notification[1]}
139+
</div>
140+
{/* NAVIGATION */}
141+
<div className="flex justify-end items-center gap-4 my-2">
142+
<button
143+
className="text-sm text-white border border-gray-500 text-opacity-60 rounded px-4 py-1 hover:opacity-90 active:opacity-95"
144+
onClick={closeAndReset}>
145+
Cancel
146+
</button>
147+
<a
148+
role="button"
149+
type="submit"
150+
onClick={closeAndReset}
151+
className="text-sm text-white hover:text-white bg-primary px-4 py-1 rounded hover:opacity-90 active:opacity-95"
152+
target="_blank"
153+
rel="noreferrer"
154+
href={`mailto:${host.email}?subject=${encodeURIComponent(config.button.register.label)}&body=${mailBody()}`}
155+
>
156+
<MailOutlineOutlined/> Create email *
157+
</a>
158+
</div>
159+
</div>
160+
</div>
161+
</Dialog>
162+
</>
163+
)
164+
}

0 commit comments

Comments
 (0)