Skip to content

Commit 37a04e6

Browse files
committed
Merge branch 'release/0.108.0'
2 parents fe69121 + 341df45 commit 37a04e6

File tree

82 files changed

+1971
-614
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+1971
-614
lines changed

CHANGELOG

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,35 @@
22
Changelog
33
*********
44

5+
0.108.0 (2017-05-08)
6+
====================
7+
- [My Projects] Icon for Uncategorized disappears when project/component is highlighted
8+
- Comment pane should not appear in anonymous view-only links
9+
- Moving multiple GitHub files into folder fails
10+
- Incorrect heading text is displayed in copy or move "taking longer than expected" message
11+
- Files added to OSF Storage display incorrect time stamps
12+
- Update Social Links to ImpactStory
13+
- & in file name causes registration to fail
14+
- Prereg banner on Dashboard misbehaves on mobile and requires hard refresh to show correct color
15+
- Retractions should show the date retracted in the metadata
16+
- Update Default to Collapsed Preview Pane on My Projects Page
17+
- Add Search by User Name and Search by Email to Admin App
18+
- Finish user serialization
19+
- Add Banner to Private Project That Has Preprint
20+
- Generate Account Confirmation + Password reset Links in Admin App
21+
- Redirect osf.io/explore (and osf.io/explore/activity) to osf.io/activity
22+
- Better way to surface registration form
23+
- Improve wording on move/replace file modal
24+
- Change Default Language on Wiki without Content
25+
- Update Language when there are no components on a project
26+
- Change text prompt if no tags applied
27+
- Change Project Description Prompt text
28+
- Change No License Prompt Text
29+
- Improve Language for Non-Admins on Registrations Tab
30+
- Add timestamp to APIv2 file versions
31+
- Make wiki versioning more clear to users
32+
33+
534
0.107.0 (2017-04-28)
635
====================
736

README-docker-compose.md

Lines changed: 42 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -185,15 +185,15 @@ Ubuntu: Skip install of docker-sync, fswatch, and unison. instead...
185185

186186
- Once the requirements have all been installed, you can start the OSF in the background with
187187

188-
```
188+
```bash
189189
$ docker-sync start
190190
# Wait until you see "Nothing to do: replicas have not changed since last sync."
191191
$ docker-compose up -d assets admin_assets mfr wb fakecas sharejs worker web api admin preprints registries
192192
```
193193

194194
- To view the logs for a given container:
195195

196-
```
196+
```bash
197197
$ docker-compose logs -f --tail 100 web
198198
```
199199

@@ -233,12 +233,12 @@ import ipdb; ipdb.set_trace()
233233

234234
You should run the `web` and/or `api` container (depending on which codebase the breakpoint is in) using:
235235

236-
```
236+
```bash
237237
# Kill the already-running web container
238-
docker-compose kill web
238+
$ docker-compose kill web
239239
240240
# Run a web container. App logs and breakpoints will show up here.
241-
docker-compose run --service-ports web
241+
$ docker-compose run --service-ports web
242242
```
243243

244244
**IMPORTANT: While attached to the running app, CTRL-c will stop the container.** To detach from the container and leave it running, **use CTRL-p CTRL-q**. Use `docker attach` to re-attach to the container, passing the *container-name* (which you can get from `docker-compose ps`), e.g. `docker attach osf_web_run_1`.
@@ -286,6 +286,36 @@ Delete a container _(does not remove volumes)_:
286286
List containers and status:
287287
- `$ docker-compose ps`
288288

289+
### Backing up your database
290+
In certain cases, you may wish to remove all docker container images, but preserve a copy of the database used by your
291+
local OSF instance. For example, this is helpful if you have test data that you would like to use after
292+
resetting docker. To back up your database, follow the following sequence of commands:
293+
294+
1. Install Postgres on your local machine, outside of docker. (eg `brew install postgres`) To avoid migrations, the
295+
version you install must match the one used by the docker container.
296+
([as of this writing](https://github.com/CenterForOpenScience/osf.io/blob/ce1702cbc95eb7777e5aaf650658a9966f0e6b0c/docker-compose.yml#L53), Postgres 9.6)
297+
2. Start postgres locally. This must be on a different port than the one used by [docker postgres](https://github.com/CenterForOpenScience/osf.io/blob/ce1702cbc95eb7777e5aaf650658a9966f0e6b0c/docker-compose.yml#L61).
298+
Eg, `pg_ctl -D /usr/local/var/postgres start -o "-p 5433"`
299+
3. Verify that the postgres docker container is running (`docker-compose up -d postgres`)
300+
4. Tell your local (non-docker) version of postgres to connect to (and back up) data from the instance in docker
301+
(defaults to port 5432):
302+
`pg_dump --username postgres --compress 9 --create --clean --format d --jobs 4 --host localhost --file ~/Desktop/osf_backup osf`
303+
304+
(shorthand: `pg_dump -U postgres -Z 9 -C --c -Fd --j 4 -h localhost --f ~/Desktop/osf_backup osf`)
305+
306+
307+
#### Restoring your database
308+
To restore a local copy of your database for use inside docker, make sure to start both local and dockerized postgres
309+
(as shown above). For best results, start from a clean postgres container with no other data. (see below for
310+
instructions on dropping postgres data volumes)
311+
312+
When ready, run the restore command from a local terminal:
313+
```bash
314+
$ pg_restore --username postgres --clean --dbname osf --format d --jobs 4 --host localhost ~/Desktop/osf_backup
315+
```
316+
317+
(shorthand) `pg_restore -U postgres -c -d osf -Fd -j 4 -h localhost ~/Desktop/osf_backup`
318+
289319
## Cleanup & Docker Reset
290320

291321
Resetting the Environment:
@@ -303,15 +333,15 @@ Delete a persistent storage volume:
303333
## Updating
304334

305335
```bash
306-
git stash # if you have any changes that need to be stashed
307-
git pull upstream develop # (replace upstream with the name of your remote)
308-
git stash pop # unstash changes
336+
$ git stash # if you have any changes that need to be stashed
337+
$ git pull upstream develop # (replace upstream with the name of your remote)
338+
$ git stash pop # unstash changes
309339
# If you get an out of space error
310-
docker image prune
340+
$ docker image prune
311341
# Pull latest images
312-
docker-compose pull
342+
$ docker-compose pull
313343
314-
docker-compose up requirements mfr_requirements wb_requirements
344+
$ docker-compose up requirements mfr_requirements wb_requirements
315345
# Run db migrations
316-
docker-compose run --rm web python manage.py migrate
346+
$ docker-compose run --rm web python manage.py migrate
317347
```

addons/github/apps.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ def github_hgrid_data(node_settings, auth, **kwargs):
3232
except NotFoundError:
3333
logger.error('Could not access GitHub repo')
3434
return None
35+
except GitHubError:
36+
return
3537
if repo.private:
3638
return None
3739

addons/github/models.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,10 @@ def short_url(self):
180180
@property
181181
def is_private(self):
182182
connection = GitHubClient(external_account=self.external_account)
183-
return connection.repo(user=self.user, repo=self.repo).private
183+
try:
184+
return connection.repo(user=self.user, repo=self.repo).private
185+
except GitHubError:
186+
return
184187

185188
# TODO: Delete me and replace with serialize_settings / Knockout
186189
def to_json(self, user):

addons/wiki/static/wikiPage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ function ViewWidget(visible, version, viewText, rendered, contentURL, allowMathj
8686
request.done(function (resp) {
8787
if(self.visible()) {
8888
var $markdownElement = $('#wikiViewRender');
89-
var rawContent = resp.wiki_content || '*No wiki content*';
89+
var rawContent = resp.wiki_content || '*Add important information, links, or images here to describe your project.*';
9090
if (resp.rendered_before_update) {
9191
// Use old md renderer. Don't mathjaxify
9292
self.allowMathjaxification(false);

addons/wiki/templates/edit.mako

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
## Use full page width
99
<%def name="container_class()">container-xxl</%def>
1010

11-
% if (user['can_comment'] or node['has_comments']):
11+
% if (user['can_comment'] or node['has_comments']) and not node['anonymous']:
1212
<%include file="include/comment_pane_template.mako"/>
1313
% endif
1414

@@ -83,6 +83,8 @@
8383

8484
<div class="pull-right">
8585
<!-- Version Picker -->
86+
<span>Wiki Version:</span>
87+
<div style="display: inline-block">
8688
<select class="form-control" data-bind="value:viewVersion" id="viewVersionSelect">
8789
% if user['can_edit_wiki_body']:
8890
<option value="preview" ${'selected' if version_settings['view'] == 'preview' else ''}>Preview</option>
@@ -98,7 +100,7 @@
98100
% endfor
99101
% endif
100102
</select>
101-
103+
</div>
102104
</div>
103105

104106
</div>
@@ -110,7 +112,7 @@
110112
% if wiki_content:
111113
${wiki_content}
112114
% else:
113-
<p><em>No wiki content</em></p>
115+
<p class="text-muted"><em>Add important information, links, or images here to describe your project.</em></p>
114116
% endif
115117
</div>
116118
</div>

addons/wiki/templates/wiki_widget.mako

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
% if wiki_content:
55
${wiki_content}
66
% else:
7-
<p><em>No wiki content</em></p>
7+
<p class="text-muted"><em>Add important information, links, or images here to describe your project.</em></p>
88
% endif
99
</div>
1010

addons/wiki/tests/test_wiki.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ def test_project_dashboard_shows_no_wiki_content_text(self):
341341
project = ProjectFactory(creator=self.user)
342342
url = project.web_url_for('view_project')
343343
res = self.app.get(url, auth=self.user.auth)
344-
assert_in('No wiki content', res)
344+
assert_in('Add important information, links, or images here to describe your project.', res)
345345

346346
def test_project_dashboard_wiki_wname_get_shows_non_ascii_characters(self):
347347
# Regression test for:

admin/base/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def get(self, request, *args, **kwargs):
4848
AttributeError(
4949
'{} with id "{}" not found.'.format(
5050
self.context_object_name.title(),
51-
kwargs.get('spam_id')
51+
kwargs.get('guid')
5252
)
5353
)
5454
)

admin/pre_reg/views.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,9 @@ class CommentUpdateView(PermissionRequiredMixin, UpdateView):
201201
permission_required = ('osf.view_prereg', 'osf.administer_prereg')
202202
raise_exception = True
203203

204+
def get_object(self, *args, **kwargs):
205+
return DraftRegistration.load(self.kwargs.get('draft_pk'))
206+
204207
def post(self, request, *args, **kwargs):
205208
try:
206209
data = json.loads(request.body).get('schema_data', {})

admin/preprints/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class PreprintFormView(PermissionRequiredMixin, GuidFormView):
2020
"""
2121
template_name = 'preprints/search.html'
2222
object_type = 'preprint'
23-
permission_required = 'osf.view_node'
23+
permission_required = 'osf.view_preprintservice'
2424
raise_exception = True
2525

2626
@property

admin/static/css/base.css

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
p input {
2+
padding: 5px 5px 5px 5px;
3+
margin-left: 10px;
4+
width: 80%;
5+
}
6+
7+
p select {
8+
padding: 5px 5px 5px 5px;
9+
margin-left: 10px;
10+
width: 80%;
11+
}
12+
13+
p textarea {
14+
padding: 5px 5px 5px 5px;
15+
margin-left: 10px;
16+
width: 80%;
17+
}
18+
19+
form p label {
20+
width: 10%;
21+
}

admin/templates/users/get_link.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<div class="modal-header">
2+
<button type="button" class="close" data-dismiss="modal">x</button>
3+
<h3>{{ title }} for user {{ username }}</h3>
4+
</div>
5+
<div class="modal-body">
6+
{% if user_link %}
7+
<p>{{ user_link }}</p>
8+
{% endif %}
9+
{% if node_claim_links %}
10+
<ul>
11+
{% for link in node_claim_links %}
12+
<li>{{ link }}</li>
13+
{% endfor %}
14+
</ul>
15+
{% endif %}
16+
</div>
17+
<div class="modal-footer">
18+
<button type="button" class="btn btn-default"
19+
data-dismiss="modal">
20+
Cancel
21+
</button>
22+
</div>

admin/templates/users/list.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{% extends 'base.html' %}
2+
{% load static %}
3+
{% block title %}
4+
<title>User Search Results</title>
5+
{% endblock title %}
6+
{% block content %}
7+
{% include 'users/user_list.html' %}
8+
9+
{% if not users|length %}
10+
<h3>No results found</h3>
11+
{% endif %}
12+
{% endblock content %}

admin/templates/users/search.html

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{% extends 'base.html' %}
22
{% load static %}
33
{% load node_extras %}
4+
{% block top_includes %}
5+
<link rel="stylesheet" type="text/css" href="/static/css/base.css" />
6+
{% endblock %}
47
{% block title %}
58
<title>User Search</title>
69
{% endblock title %}
@@ -10,33 +13,26 @@
1013
<h3>User Search</h3>
1114
</div>
1215
<div class="row">
13-
<form action="{% url 'users:search' %}" method="post">
14-
{% csrf_token %}
15-
{% if form.errors %}
16-
<div class="alert alert-danger">{{ form.errors }}</div>
17-
{% endif %}
18-
<div class="form-group">
19-
<label for="guid">User GUID:</label>
20-
{{ form.guid }}
21-
</div>
22-
<div class="form-group">
23-
<label for="name">User name:</label>
24-
<input type="text" id="name" disabled/>
25-
</div>
26-
<div class="form-group">
27-
<label for="email">User email:</label>
28-
<input type="text" id="email" disabled/>
29-
</div>
30-
<input type="submit" class="btn btn-primary" value="Submit" />
31-
</form>
16+
<div class="col-md-6">
17+
<form action="{% url 'users:search' %}" method="post">
18+
{% csrf_token %}
19+
{{ form.as_p }}
20+
<input type="submit" class="btn btn-primary" value="Submit" />
21+
</form>
22+
</div>
3223
</div>
3324
<div class="row">
34-
<h3>User Workshop Follow-up</h3>
25+
<div class="col-md-12">
26+
<h3>User Workshop Follow-up</h3>
27+
</div>
3528
</div>
3629
<div class="row">
37-
<a href="{% url 'users:workshop' %}" class="btn btn-default">
38-
Go
39-
</a>
30+
<div class="col-md-12">
31+
<a href="{% url 'users:workshop' %}" class="btn btn-default">
32+
Go
33+
</a>
34+
35+
</div>
4036
</div>
4137
</div>
4238
{% endblock content %}

0 commit comments

Comments
 (0)