Skip to content

Commit

Permalink
ARR: add custom home page to show the preprints (#2072)
Browse files Browse the repository at this point in the history
* add custom home page to show the preprints

* Update homepageWebfield.js

---------

Co-authored-by: celestemartinez <[email protected]>
  • Loading branch information
melisabok and celestemartinez authored Apr 3, 2024
1 parent 6712289 commit 0e34fb8
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 1 deletion.
13 changes: 13 additions & 0 deletions openreview/arr/arr.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import csv
import json
import os
from json import tool
import datetime
from io import StringIO
Expand Down Expand Up @@ -327,6 +328,18 @@ def expire_invitation(self, invitation_id):

def setup(self, program_chair_ids=[], publication_chairs_ids=[]):
setup_value = self.venue.setup(program_chair_ids, publication_chairs_ids)

with open(os.path.join(os.path.dirname(__file__), 'webfield/homepageWebfield.js')) as f:
content = f.read()
self.client.post_group_edit(
invitation=self.get_meta_invitation_id(),
signatures=[self.venue_id],
group=openreview.api.Group(
id=self.venue_id,
web=content
)
)

setup_arr_invitations(self.invitation_builder)
return setup_value

Expand Down
45 changes: 45 additions & 0 deletions openreview/arr/webfield/homepageWebfield.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Webfield component
const tabs = [{
name: 'Your Consoles',
type: 'consoles'
}]

tabs.push({
name: 'Anonymous Pre-prints',
query: {
'content.venueid': domain.content.submission_venue_id?.value
},
options: {
postQuery: {
'readers': 'everyone'
},
hideWhenEmpty: true,
pageSize: 1000
}
})

tabs.push({
name: 'Recent Activity',
type: 'activity'
})

return {
component: 'VenueHomepage',
version: 1,
properties: {
header: {
title: domain.content.title?.value,
subtitle: domain.content.subtitle?.value,
website: domain.content.website?.value,
contact: domain.content.contact?.value,
location: domain.content.location.value,
instructions: domain.content.instructions.value,
date: domain.content.start_date.value,
deadline: domain.content.date.value
},
submissionId: domain.content.submission_id?.value,
parentGroupId: domain.parent,
tabs: tabs
}
}

13 changes: 12 additions & 1 deletion tests/test_arr_venue_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -1715,7 +1715,7 @@ def test_submissions(self, client, openreview_client, helpers, test_client):
f'aclweb.org/ACL/ARR/2023/August/Submission{submission.number}/-/Blind_Submission_License_Agreement'
).duedate == None

def test_post_submission(self, client, openreview_client, helpers, test_client):
def test_post_submission(self, client, openreview_client, helpers, test_client, request_page, selenium):

pc_client=openreview.Client(username='[email protected]', password=helpers.strong_password)
request_form=pc_client.get_notes(invitation='openreview.net/Support/-/Request_Form')[1]
Expand Down Expand Up @@ -1825,6 +1825,17 @@ def test_post_submission(self, client, openreview_client, helpers, test_client):

helpers.await_queue_edit(openreview_client, 'aclweb.org/ACL/ARR/2023/August/-/Preprint_Release_Submission-0-1', count=1)

request_page(selenium, 'http://localhost:3030/group?id=aclweb.org/ACL/ARR/2023/August', None, wait_for_element='header')

tabs = selenium.find_element(By.CLASS_NAME, 'nav-tabs').find_elements(By.TAG_NAME, 'li')
assert len(tabs) == 2
assert tabs[0].text == 'Anonymous Pre-prints'
assert tabs[1].text == 'Recent Activity'

notes = selenium.find_element(By.ID, 'anonymous-pre-prints').find_elements(By.CLASS_NAME, 'note')
assert len(notes) == 50
assert notes[0].find_element(By.TAG_NAME, 'h4').text == 'Paper title 100'

submissions = pc_client_v2.get_notes(invitation='aclweb.org/ACL/ARR/2023/August/-/Submission', sort='number:asc')

assert submissions[0].readers == ['aclweb.org/ACL/ARR/2023/August',
Expand Down

0 comments on commit 0e34fb8

Please sign in to comment.