Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions framework/auth/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def _reset_password_get(auth, uid=None, token=None, institutional=False):
}
raise HTTPError(http_status.HTTP_400_BAD_REQUEST, data=error_data)

# override routes.py login_url to redirect to myprojects
# override routes.py login_url to redirect to my-projects
service_url = web_url_for('my_projects', _absolute=True)

return {
Expand Down Expand Up @@ -174,7 +174,7 @@ def forgot_password_get(auth):
if auth.logged_in:
return auth_logout(redirect_url=request.url)

#overriding the routes.py sign in url to redirect to the myprojects after login
#overriding the routes.py sign in url to redirect to the my-projects after login
context = {}
context['login_url'] = web_url_for('my_projects', _absolute=True)

Expand Down Expand Up @@ -410,7 +410,7 @@ def auth_login(auth):
if campaign and logged out, go to campaign register page (with next_url if presents)
if next_url and logged in, go to next url
if next_url and logged out, go to cas login page with current request url as service parameter
if none, go to `/myprojects` which is decorated by `@must_be_logged_in`
if none, go to `/my-projects` which is decorated by `@must_be_logged_in`

:param auth: the auth context
:return: redirects
Expand All @@ -437,7 +437,7 @@ def auth_register(auth):
if next_url and logged in, go to next url
if next_url and logged out, go to cas login page with current request url as service parameter
if next_url and logout flag, log user out first and then go to the next_url
if none, go to `/myprojects` which is decorated by `@must_be_logged_in`
if none, go to `/my-projects` which is decorated by `@must_be_logged_in`

:param auth: the auth context
:return: land, redirect or `auth_logout`
Expand Down Expand Up @@ -999,7 +999,7 @@ def resend_confirmation_post(auth):
try:
send_confirm_email(user, clean_email, renew=True)
except KeyError:
# already confirmed, redirect to myprojects
# already confirmed, redirect to my-projects
status_message = f'This email {clean_email} has already been confirmed.'
kind = 'warning'
user.email_last_sent = timezone.now()
Expand Down
6 changes: 3 additions & 3 deletions osf/management/commands/metrics_backfill_pageviews.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ def main(source, dry_run=False, resume_from=None):
# page.info.protocol + page.info.domain => _source.platform_iri # "http://localhost:5000/",
# visitor.session => _source.session_id # "fcae918a3b6a19641bd0087f84083f0d57982d8c93ab821c405561d1b5c7b305",
# user.id => _source.user_is_authenticated # true,
# page.url => _source.pageview_info.page_url # "http://localhost:5000/myprojects/",
# page.url => _source.pageview_info.page_url # "http://localhost:5000/my-projects/",
# page.title => _source.pageview_info.page_title # "OSF | My Projects",
# referrer.url => _source.pageview_info.referer_url # "http://localhost:5000/csab4/analytics",
# page.meta.routeName => _source.pageview_info.route_name # "OsfWebRenderer.my_projects",
# time.utc.hour_of_day => _source.pageview_info.hour_of_day # 4,
# page.info.path => _source.pageview_info.page_path # "/myprojects",
# page.info.path => _source.pageview_info.page_path # "/my-projects",
# referrer.info.domain => _source.pageview_info.referer_domain # "localhost:5000"
# page.meta.public => _source.item_public # true,
# node.id => _source.item_guid # "ry7dn",
Expand Down Expand Up @@ -85,7 +85,7 @@ def populate_action_labels(something_wonderful, row):

if row['page.info.path']:
path_parts = row['page.info.path'].split('/')
if len(path_parts) == 1 and path_parts[0] not in ('myprojects', 'goodbye', 'login'):
if len(path_parts) == 1 and path_parts[0] not in ('my-projects', 'goodbye', 'login'):
labels.append('view')
elif path_parts[1] in ('wiki'):
labels.append('view')
Expand Down
2 changes: 1 addition & 1 deletion tests/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def test_confirm_email(self):
res = self.app.resolve_redirect(res)

assert res.status_code == 302
assert '/myprojects/' == urlparse(res.location).path
assert '/my-projects/' == urlparse(res.location).path
# assert len(get_session()['status']) == 1

def test_get_user_by_id(self):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_project_contributor_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ def test_private_project_remove_self_not_admin(self):
)
self.project.reload()
assert res.status_code == 200
assert res.json['redirectUrl'] == '/myprojects/'
assert res.json['redirectUrl'] == '/my-projects/'
assert self.user2._id not in self.project.contributors

def test_public_project_remove_self_not_admin(self):
Expand Down
10 changes: 5 additions & 5 deletions tests/test_webtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def test_can_see_profile_url(self):
res = self.app.get(self.user.url, follow_redirects=True)
assert self.user.url in res.text

# `GET /login/` without parameters is redirected to `/myprojects/` page which has `@must_be_logged_in` decorator
# `GET /login/` without parameters is redirected to `/my-projects/` page which has `@must_be_logged_in` decorator
# if user is not logged in, she/he is further redirected to CAS login page
def test_is_redirected_to_cas_if_not_logged_in_at_login_page(self):
res = self.app.resolve_redirect(self.app.get('/login/'))
Expand All @@ -90,7 +90,7 @@ def test_is_redirected_to_cas_if_not_logged_in_at_login_page(self):
def test_is_redirected_to_myprojects_if_already_logged_in_at_login_page(self):
res = self.app.get('/login/', auth=self.user.auth)
assert res.status_code == 302
assert 'myprojects' in res.headers.get('Location')
assert 'my-projects' in res.headers.get('Location')

def test_register_page(self):
res = self.app.get('/register/')
Expand All @@ -99,14 +99,14 @@ def test_register_page(self):
def test_is_redirected_to_myprojects_if_already_logged_in_at_register_page(self):
res = self.app.get('/register/', auth=self.user.auth)
assert res.status_code == 302
assert 'myprojects' in res.headers.get('Location')
assert 'my-projects' in res.headers.get('Location')

def test_sees_projects_in_her_dashboard(self):
# the user already has a project
project = ProjectFactory(creator=self.user)
project.add_contributor(self.user)
project.save()
res = self.app.get('/myprojects/', auth=self.user.auth)
res = self.app.get('/my-projects/', auth=self.user.auth)
assert 'Projects' in res.text # Projects heading

def test_does_not_see_osffiles_in_user_addon_settings(self):
Expand All @@ -124,7 +124,7 @@ def test_sees_osffiles_in_project_addon_settings(self):

def test_sees_correct_title_on_dashboard(self):
# User goes to dashboard
res = self.app.get('/myprojects/', auth=self.auth, follow_redirects=True)
res = self.app.get('/my-projects/', auth=self.auth, follow_redirects=True)
title = res.html.title.string
assert 'OSF | My Projects' == title

Expand Down
2 changes: 1 addition & 1 deletion website/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ def make_url_map(app):
notemplate
),
Rule(
'/myprojects/',
'/my-projects/',
'get',
website_views.my_projects,
OsfWebRenderer('my_projects.mako', trust=False)
Expand Down
6 changes: 3 additions & 3 deletions website/static/js/myProjects.js
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ var MyProjects = {
*/
self.setFilterHistory = function(index) {
// if not on the myprojects version of this page, don't change state (e.g., institutions)
if (window.location.href.indexOf('/myprojects') === -1 ) {
if (window.location.href.indexOf('/my-projects') === -1 ) {
return;
}
var filter;
Expand All @@ -585,15 +585,15 @@ var MyProjects = {
}
// Uses replaceState instead of pushState because back buttons will not reset the filter on back without forcing a page refresh
// A bug in history causes titles not to change despite setting them here.
window.history.replaceState({setFilter: index}, 'OSF | ' + filter.title, '/myprojects/' + filter.name);
window.history.replaceState({setFilter: index}, 'OSF | ' + filter.title, '/my-projects/' + filter.name);
};

/**
* Sets the initial filter based on href
*/
self.getFilterIndex = function() {
// if not on the myprojects version of this page, don't change state (e.g., institutions)
if (window.location.href.indexOf('/myprojects') === -1 ) {
if (window.location.href.indexOf('/my-projects') === -1 ) {
return 0;
}
// Cast to string undefined => "undefined" to handle upper/lower case anchors
Expand Down
4 changes: 2 additions & 2 deletions website/templates/collection_submission_cancel.html.mako
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
% if collection_provider:
<a href="${collections_link}">${collection_provider_name}</a>
% else:
<a href="${domain + 'myprojects/'}">${collection_provider_name}</a>
<a href="${domain + 'my-projects/'}">${collection_provider_name}</a>
% endif

was canceled. If you wish to be associated with the collection, you will need to request to be added again.
Expand All @@ -20,7 +20,7 @@
% if collection_provider:
<a href="${collections_link}">${collection_provider_name}</a>
% else:
<a href="${domain + 'myprojects/'}">${collection_provider_name}</a>
<a href="${domain + 'my-projects/'}">${collection_provider_name}</a>
% endif
If you wish to be associated with the collection, an admin will need to request addition again.
% endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
% if collection_provider:
<a href="${domain + 'collections/' + collection_provider__id}">${collection_provider_name}</a>
% else:
<a href="${domain + 'myprojects/'}">${collection_provider_name}</a>
<a href="${domain + 'my-projects/'}">${collection_provider_name}</a>
% endif
. If you wish to be associated with the collection, you will need to request addition to the collection again.
% else:
Expand All @@ -20,7 +20,7 @@
% if collection_provider:
<a href="${collections_link}">${collection_provider_name}</a>
% else:
<a href="${domain + 'myprojects/'}">${collection_provider_name}</a>
<a href="${domain + 'my-projects/'}">${collection_provider_name}</a>
% endif
It will need to be re-submitted to be included in the collection again.
% endif
Expand Down
4 changes: 2 additions & 2 deletions website/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,11 @@ def paginate(items, total, page, size):


def index():
return redirect('/myprojects/')
return redirect('/my-projects/')


def dashboard():
return redirect('/myprojects/')
return redirect('/my-projects/')


def reproducibility():
Expand Down
Loading