Skip to content

Commit

Permalink
Merge branch 'master' into feature/extract-console-tab
Browse files Browse the repository at this point in the history
  • Loading branch information
xkopenreview authored Dec 19, 2024
2 parents 101686b + 1afa0ad commit 71f178a
Show file tree
Hide file tree
Showing 15 changed files with 62 additions and 345 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ jobs:
cache-dependency-path: |
openreview-api/package-lock.json
openreview-web/package-lock.json
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Setup openreview-py
run: |
cd openreview-py
Expand Down
31 changes: 19 additions & 12 deletions components/profile/EmailsSection.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ const EmailsSection = ({
updateEmails,
institutionDomains,
isNewProfile,
loadProfile,
}) => {
const router = useRouter()

Expand All @@ -78,7 +79,7 @@ const EmailsSection = ({
let emailCopy = { ...email }
if (email.key === action.data.key) {
emailCopy = action.data
if (action.setVerifyVisible) emailCopy.verifyVisible = action.data.visibleValue
emailCopy.verifyVisible = false
}
return emailCopy
})
Expand All @@ -98,7 +99,7 @@ const EmailsSection = ({
const emailCopy = { ...email }
if (email.key === action.data.key) {
emailCopy.confirmed = true
if (action.setVerifyVisible) emailCopy.verifyVisible = action.data.visibleValue
emailCopy.verifyVisible = false
}
return emailCopy
})
Expand All @@ -120,7 +121,7 @@ const EmailsSection = ({
return emailCopy
})
}

if (action.reset) return action.data
return state
}
// eslint-disable-next-line max-len
Expand All @@ -134,8 +135,7 @@ const EmailsSection = ({
const handleAddEmail = () => {
setEmails({
addNewEmail: true,
setVerifyVisible: true,
data: { email: '', key: nanoid(), isValid: true, visibleValue: false },
data: { email: '', key: nanoid(), isValid: true },
})
}

Expand All @@ -145,16 +145,14 @@ const EmailsSection = ({
const isValid = isValidEmail(targetValue.toLowerCase())
setEmails({
updateEmail: true,
setVerifyVisible: true,
data: { ...existingEmailObj, key, email: targetValue, isValid, visibleValue: false },
data: { ...existingEmailObj, key, email: targetValue, isValid },
})
}

const handleRemoveEmail = (key) => {
setEmails({
removeEmail: true,
setVerifyVisible: true,
data: { key, visibleValue: false },
data: { key },
})
}

Expand Down Expand Up @@ -192,16 +190,25 @@ const EmailsSection = ({
const newEmail = emails?.find((p) => p.key === key)?.email?.toLowerCase()
const token = emails?.find((p) => p.key === key)?.verificationToken ?? ''
const payload = { email: newEmail, token }
let verifyResult
try {
if (isNewProfile) {
await api.put(`/activatelink/${router.query.token}`, payload, { accessToken })
} else {
await api.put('/activatelink', payload, { accessToken })
verifyResult = await api.put('/activatelink', payload, { accessToken })
}
if (verifyResult?.id) {
const updatedProfile = await loadProfile()
setEmails({
reset: true,
data:
updatedProfile?.emails?.map((p) => ({ ...p, key: nanoid(), isValid: true })) ?? [],
})
return promptMessage(`${newEmail} has been verified`)
}
setEmails({
setVerifyVisible: true,
setConfirmed: true,
data: { key, visibleValue: false },
data: { key },
})
if (isInstitutionEmail(newEmail, institutionDomains)) setHasInstitutionEmail(true)
return promptMessage(`${newEmail} has been verified`)
Expand Down
2 changes: 2 additions & 0 deletions components/profile/ProfileEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default function ProfileEditor({
loading,
isNewProfile,
saveProfileErrors,
loadProfile,
}) {
const profileReducer = (state, action) => {
if (action.type === 'reset') return action.data
Expand Down Expand Up @@ -487,6 +488,7 @@ export default function ProfileEditor({
updateEmails={(emails) => setProfile({ type: 'emails', data: emails })}
institutionDomains={institutionDomains}
isNewProfile={isNewProfile}
loadProfile={loadProfile}
/>
</ProfileSection>
)
Expand Down
2 changes: 1 addition & 1 deletion components/profile/ProfileSection.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export default function ProfileSection({ title, instructions, children }) {
return (
<section>
<h4>{title}</h4>
<p className="instructions">{instructions}</p>
<div className="instructions">{instructions}</div>

{children}
</section>
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "openreview-web",
"version": "1.13.6",
"version": "1.13.8",
"private": true,
"scripts": {
"dev": "next dev --port $NEXT_PORT",
Expand Down
6 changes: 6 additions & 0 deletions pages/about.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ const About = () => (

<div className="row">
<div className="col-xs-12 col-md-10 col-md-offset-1">
<p>
OpenReview project is now a 501(c)(3) organization under the name OpenReview Foundation.
</p>
<p>
For inquiries, please contact <a href="mailto:[email protected]">[email protected]</a> or <a href="mailto:[email protected]">[email protected]</a>.
</p>
<p>
OpenReview aims to promote openness in scientific communication, particularly the
peer review process, by providing a flexible cloud-based web interface and underlying
Expand Down
96 changes: 0 additions & 96 deletions pages/confirm.js

This file was deleted.

6 changes: 4 additions & 2 deletions pages/profile/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ export default function ProfileEdit({ appContext }) {
if (profiles?.length > 0) {
const formattedProfile = formatProfileData(profiles[0], true)
setProfile(formattedProfile)
} else {
setError({ statusCode: 404, message: 'Profile not found' })
return formattedProfile
}
setError({ statusCode: 404, message: 'Profile not found' })
} catch (apiError) {
setError({ statusCode: apiError.status, message: apiError.message })
}
return null
}

const unlinkPublication = async (profileId, noteId) => {
Expand Down Expand Up @@ -178,6 +179,7 @@ export default function ProfileEdit({ appContext }) {
cancelHandler={() => router.push('/profile').then(() => window.scrollTo(0, 0))}
loading={loading}
saveProfileErrors={saveProfileErrors}
loadProfile={loadProfile}
/>
</div>
)
Expand Down
103 changes: 0 additions & 103 deletions pages/profile/merge.js

This file was deleted.

1 change: 0 additions & 1 deletion styles/pages.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,3 @@
@import 'pages/tasks';
@import 'pages/venue';
@import 'pages/venues';
@import 'pages/confirm';
Loading

0 comments on commit 71f178a

Please sign in to comment.