Skip to content

Commit

Permalink
fieat(openalex): Simpify UX
Browse files Browse the repository at this point in the history
  • Loading branch information
annelhote committed Jan 8, 2025
1 parent b41084c commit b8941b3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ export default function SendFeedbackButton({ className, corrections, resetCorrec
<TextInput
label="Please indicate your email. Only an encrypted version of your email will be public."
onChange={(e) => setUserEmail(e.target.value)}
onKeyDown={(e) => {
if (e.key === 'Enter' && corrections.length > 0 && validEmail) {
sendFeedback();
}
}}
required
type="email"
/>
Expand Down
11 changes: 8 additions & 3 deletions client/src/pages/openalex-affiliations/results/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -612,12 +612,17 @@ export default function Affiliations() {
<Row verticalAlign="bottom">
<Col>
<TextInput
messageType={rorMessageType}
hint='Enter a valid ROR id and "check" it with ROR API'
label="ROR"
message={rorMessage}
messageType={rorMessageType}
onChange={(e) => setRor(e.target.value)}
onKeyDown={(e) => {
if (e.key === 'Enter' && ror.length > 0) {
getCleanRor();
}
}}
value={ror}
label="ROR"
hint='Enter a valid ROR id and "check" it with ROR API'
/>
</Col>
<Col md="3">
Expand Down
1 change: 1 addition & 0 deletions client/src/pages/openalex-affiliations/search.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const { VITE_APP_TAG_LIMIT } = import.meta.env;
const START_YEAR = 2010;
// Generate an array of objects with all years from START_YEAR
const years = [...Array(new Date().getFullYear() - START_YEAR + 1).keys()]
.sort((a, b) => b - a)
.map((year) => (year + START_YEAR).toString())
.map((year) => ({ label: year, value: year }));

Expand Down

0 comments on commit b8941b3

Please sign in to comment.