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

Commit 5e3b81e

Browse files
committed
Merge tag 'v1.9.0' into 77-update_1.9.0
2 parents 06b2d4e + d3a764e commit 5e3b81e

24 files changed

+213
-96
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.8.0
79-
date-released: '2022-10-14'
78+
version: v1.9.0
79+
date-released: '2022-10-28'

data-generation/main.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ function generateMentions(amountExtra = 10) {
3737
'thesis',
3838
'videoRecording',
3939
'webpage',
40+
'workshop',
4041
'other',
4142
];
4243

@@ -55,6 +56,7 @@ function generateMentions(amountExtra = 10) {
5556
image_url: null,
5657
mention_type: faker.helpers.arrayElement(mentionTypes),
5758
source: 'faker',
59+
note: faker.helpers.maybe(() => faker.company.catchPhrase(), 0.3) ?? null
5860
});
5961
}
6062

@@ -70,6 +72,7 @@ function generateMentions(amountExtra = 10) {
7072
image_url: null,
7173
mention_type: faker.helpers.arrayElement(mentionTypes),
7274
source: 'faker',
75+
note: faker.helpers.maybe(() => faker.company.catchPhrase(), 0.3) ?? null
7376
});
7477
}
7578

database/008-create-mention-table.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ CREATE TYPE mention_type AS ENUM (
2222
'thesis',
2323
'videoRecording',
2424
'webpage',
25+
'workshop',
2526
'other'
2627
);
2728

@@ -37,6 +38,7 @@ CREATE TABLE mention (
3738
image_url VARCHAR(500) CHECK (image_url ~ '^https?://'),
3839
mention_type mention_type NOT NULL,
3940
source VARCHAR(50) NOT NULL,
41+
note VARCHAR(500),
4042
scraped_at TIMESTAMPTZ,
4143
created_at TIMESTAMPTZ NOT NULL,
4244
updated_at TIMESTAMPTZ NOT NULL

frontend/components/cookies/CookieConsentMatomo.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ export default function CookieConsentMatomo({matomo, route}: CookieConsentMatomo
5252
className="fixed bottom-0 right-0 animated animatedFadeInUp fadeInUp"
5353
data-testid="cookie-consent-matomo"
5454
>
55-
<div className="container mx-auto px-20 ">
56-
<div className="border border-b-base-content border-t-4 border-x-4 border-b-0 w-96 bg-white shadow-lg p-6 rounded-tr-3xl">
55+
<div className="container mx-auto sm:px-20">
56+
<div className="border border-b-base-content border-t-4 border-x-4 border-b-0 bg-white shadow-lg p-6 rounded-tr-3xl sm:w-96">
5757
<div className="w-16 mx-auto relative mb-3">
5858
<CookieTwoToneIcon className="scale-[2] mb-3" color="primary" fontSize="large"/>
5959
</div>

frontend/components/layout/TagChip.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ export default function TagChip({label, title}:
1010
title={title ? title : label}
1111
label={label}
1212
sx={{
13-
marginBottom: '1rem',
14-
marginRight: '0.5rem',
1513
maxWidth: '21rem',
1614
borderRadius: '0.125rem',
1715
textTransform: 'capitalize'
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import Chip from '@mui/material/Chip'
2+
import SearchIcon from '@mui/icons-material/Search'
3+
import Link from 'next/link'
4+
5+
export default function TagChipFilter({url, label, title}:
6+
{ label: string, url:string ,title?: string }) {
7+
8+
if (!label) return null
9+
10+
return (
11+
<Link
12+
href={url}
13+
passHref
14+
>
15+
<a>
16+
<Chip
17+
title={`Click to filter for ${title ? title : label}`}
18+
label={label}
19+
icon={<SearchIcon />}
20+
clickable
21+
sx={{
22+
maxWidth: '21rem',
23+
borderRadius: '0.125rem',
24+
textTransform: 'capitalize',
25+
'& .MuiChip-icon': {
26+
order: 1,
27+
margin:'0rem 0.5rem 0rem 0rem',
28+
height: '1.125rem',
29+
width: '1.125rem'
30+
}
31+
}}
32+
/>
33+
</a>
34+
</Link>
35+
)
36+
}

frontend/components/mention/EditMentionModal.tsx

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// SPDX-FileCopyrightText: 2022 Christian Meeßen (GFZ) <[email protected]>
2-
// SPDX-FileCopyrightText: 2022 Helmholtz Centre Potsdam - GFZ German Research Centre for Geosciences
32
// SPDX-FileCopyrightText: 2022 Dusan Mijatovic (dv4all)
3+
// SPDX-FileCopyrightText: 2022 Ewan Cahen (Netherlands eScience Center) <[email protected]>
4+
// SPDX-FileCopyrightText: 2022 Helmholtz Centre Potsdam - GFZ German Research Centre for Geosciences
5+
// SPDX-FileCopyrightText: 2022 Netherlands eScience Center
46
// SPDX-FileCopyrightText: 2022 dv4all
57
//
68
// SPDX-License-Identifier: Apache-2.0
@@ -213,22 +215,37 @@ export default function EditMentionModal({open, onCancel, onSubmit, item, pos, t
213215
}}
214216
rules={config.url.validation}
215217
/>
216-
<div className="py-2"></div>
217218
{formData.mention_type === 'highlight' ?
218-
<ControlledTextField
219-
control={control}
220-
options={{
221-
name: 'image_url',
222-
label: config.image_url.label,
223-
useNull: true,
224-
defaultValue: formData?.image_url,
225-
helperTextMessage: config.image_url.help,
226-
helperTextCnt: `${formData?.image_url?.length || 0}/${config.image_url.validation.maxLength.value}`
227-
}}
228-
rules={config.image_url.validation}
229-
/>
219+
<>
220+
<div className="py-2"></div>
221+
<ControlledTextField
222+
control={control}
223+
options={{
224+
name: 'image_url',
225+
label: config.image_url.label,
226+
useNull: true,
227+
defaultValue: formData?.image_url,
228+
helperTextMessage: config.image_url.help,
229+
helperTextCnt: `${formData?.image_url?.length || 0}/${config.image_url.validation.maxLength.value}`
230+
}}
231+
rules={config.image_url.validation}
232+
/>
233+
</>
230234
:null
231235
}
236+
<div className="py-2"></div>
237+
<ControlledTextField
238+
control={control}
239+
options={{
240+
name: 'note',
241+
label: config.note.label,
242+
useNull: true,
243+
defaultValue: formData?.note,
244+
helperTextMessage: config.note.help,
245+
helperTextCnt: `${formData?.note?.length || 0}/${config.note.validation.maxLength.value}`,
246+
}}
247+
rules={config.note.validation}
248+
/>
232249
<Alert severity="warning" sx={{marginTop: '1.5rem'}}>
233250
{/* <AlertTitle sx={{fontWeight: 500}}>Validate entered information</AlertTitle> */}
234251
Please double check the data because this entry <strong>cannot be edited after it has been created</strong>.

frontend/components/mention/MentionItemBase.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {ReactNode} from 'react'
88
import {MentionItemProps} from '~/types/Mention'
99
import MentionAuthors from './MentionAuthors'
1010
import MentionDoi from './MentionDoi'
11+
import MentionNote from './MentionNote'
1112
import MentionPublisherItem from './MentionPublisherItem'
1213

1314
export type MentionItemRole = 'list'|'find'|'view'
@@ -69,6 +70,7 @@ export default function MentionItemBase({item,pos,nav,type,role='find'}:MentionI
6970
className="text-sm"
7071
role={role}
7172
/>
73+
<MentionNote note={item.note} />
7274
</article>
7375
)
7476
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
export default function MentionNote({note}: { note: string | null }) {
3+
if (note) {
4+
return <div className="mt-2 text-sm opacity-60">{note}</div>
5+
}
6+
return null
7+
}

frontend/components/mention/MentionViewItem.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import MentionAuthors from './MentionAuthors'
1111
import MentionPublisherItem from './MentionPublisherItem'
1212
import MentionDoi from './MentionDoi'
1313
import {MentionTitle} from './MentionItemBase'
14+
import MentionNote from './MentionNote'
1415

1516
export default function MentionViewItem({item, pos}: {item: MentionItemProps, pos:number}) {
1617

@@ -39,6 +40,7 @@ export default function MentionViewItem({item, pos}: {item: MentionItemProps, po
3940
doi={item?.doi}
4041
className="text-sm"
4142
/>
43+
<MentionNote note={item.note} />
4244
</div>
4345
<div className="flex justify-center items-center">
4446
{item?.url ? <LinkIcon /> : null}

0 commit comments

Comments
 (0)