diff --git a/openreview/arr/arr.py b/openreview/arr/arr.py index 30b3f3f01..b30e1f935 100644 --- a/openreview/arr/arr.py +++ b/openreview/arr/arr.py @@ -1,5 +1,6 @@ import csv import json +import os from json import tool import datetime from io import StringIO @@ -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 diff --git a/openreview/arr/webfield/homepageWebfield.js b/openreview/arr/webfield/homepageWebfield.js new file mode 100644 index 000000000..971b903be --- /dev/null +++ b/openreview/arr/webfield/homepageWebfield.js @@ -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 + } + } + diff --git a/tests/test_arr_venue_v2.py b/tests/test_arr_venue_v2.py index 8184a437f..7eee4adf9 100644 --- a/tests/test_arr_venue_v2.py +++ b/tests/test_arr_venue_v2.py @@ -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='pc@aclrollingreview.org', password=helpers.strong_password) request_form=pc_client.get_notes(invitation='openreview.net/Support/-/Request_Form')[1] @@ -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',