Skip to content

Commit

Permalink
Merge pull request #503 from rdmorganiser/dev
Browse files Browse the repository at this point in the history
RDMO 1.8.1
  • Loading branch information
triole authored May 25, 2022
2 parents 7841cb9 + 81321e3 commit 56c5448
Show file tree
Hide file tree
Showing 14 changed files with 782 additions and 23 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## RDMO 1.8.1 (May 25, 2022)

* Fix a bug on the "show all projects on site" view
* Fix a bug with the slider in the interview
* Fix a when selecting and deselecting a checkbox in the interview
* Fix exception when no user matched filter criteria
* Add keycloak logo to be used with allauth
* Add email and phone to VALUE_TYPE_CHOICES
* Various minor fixes

## RDMO 1.8.0 (Mar 07, 2022)

* Add Project Export Provider to perform import and export from and to webservices
Expand Down
6 changes: 6 additions & 0 deletions docs/dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ The testing data can be imported using:
```bash
python manage.py loaddata ../rdmo/testing/fixtures/*
```
To update the testing data fixtures based on the current database, each of the RDMO apps with new data needs to be dumped using the following command.
As an example, the views and projects app contain new data:
```bash
python manage.py dumpdata --indent 4 -o ../rdmo/testing/fixtures/views.json views
python manage.py dumpdata --indent 4 -o ../rdmo/testing/fixtures/projects.json projects
```

The test upload files are initialized using:

Expand Down
711 changes: 711 additions & 0 deletions rdmo/accounts/static/accounts/img/keycloak_logo_200px.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@
<img src="{% static 'accounts/img/orcid-signin.png' %}" alt="ORCID sign in" />
</a>
</li>
{% elif provider.id == 'keycloak' %}
<li class="socialaccount_provider_break">
<a title="{{ provider.name }}" class="socialaccount_provider {{ provider.id }}"
href="{% provider_login_url provider.id process=process scope=scope auth_params=auth_params %}">
<img src="{% static 'accounts/img/keycloak_logo_200px.svg' %}" alt="Keycloak sign in" />
</a>
</li>
{% else %}
<li>
<a title="{{provider.name}}" class="socialaccount_provider {{provider.id}}"
Expand Down
4 changes: 4 additions & 0 deletions rdmo/core/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
VALUE_TYPE_BOOLEAN = 'boolean'
VALUE_TYPE_DATETIME = 'datetime'
VALUE_TYPE_OPTIONS = 'option'
VALUE_TYPE_EMAIL = 'email'
VALUE_TYPE_PHONE = 'phone'
VALUE_TYPE_FILE = 'file'
VALUE_TYPE_CHOICES = (
(VALUE_TYPE_TEXT, _('Text')),
Expand All @@ -15,6 +17,8 @@
(VALUE_TYPE_FLOAT, _('Float')),
(VALUE_TYPE_BOOLEAN, _('Boolean')),
(VALUE_TYPE_DATETIME, _('Datetime')),
(VALUE_TYPE_EMAIL, _('Email')),
(VALUE_TYPE_PHONE, _('Phone')),
(VALUE_TYPE_OPTIONS, _('Option')),
(VALUE_TYPE_FILE, _('File'))
)
Expand Down
13 changes: 7 additions & 6 deletions rdmo/core/management/commands/find_spam_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@ def add_arguments(self, parser):
)

def save_csv(self, data, filename):
data_file = open(filename, 'w')
csv_writer = csv.writer(data_file)
csv_writer.writerow(list(data[0].keys()))
for user in data:
csv_writer.writerow(user.values())
print('List written to ' + filename)
if len(data) > 0:
data_file = open(filename, 'w')
csv_writer = csv.writer(data_file)
csv_writer.writerow(list(data[0].keys()))
for user in data:
csv_writer.writerow(user.values())
print('List written to ' + filename)

def print_file(self, filename):
f = open(filename, 'r')
Expand Down
15 changes: 8 additions & 7 deletions rdmo/core/management/commands/find_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@ def add_arguments(self, parser):
)

def save_csv(self, data, filename):
data_file = open(filename, 'w')
csv_writer = csv.writer(data_file)
csv_writer.writerow(list(data[0].keys()))
for user in data:
csv_writer.writerow(user.values())
print('List written to ' + filename)
if len(data) > 0:
data_file = open(filename, 'w')
csv_writer = csv.writer(data_file)
csv_writer.writerow(list(data[0].keys()))
for user in data:
csv_writer.writerow(user.values())
print('List written to ' + filename)

def print_file(self, filename):
f = open(filename, 'r')
Expand Down Expand Up @@ -102,7 +103,7 @@ def handle(self, *args, **options):
found_users = self.find_users(options)

print(
'Matching filter the: %d %.2f%%'
'Matching the filter: %d %.2f%%'
% (
len(found_users),
(100/no_total_users)*len(found_users)
Expand Down
17 changes: 17 additions & 0 deletions rdmo/core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,23 @@
'path': 'css/bootstrap.min.css',
'sri': 'sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu',
}
],
'font': [
{
'path': 'fonts/glyphicons-halflings-regular.eot'
},
{
'path': 'fonts/glyphicons-halflings-regular.woff'
},
{
'path': 'fonts/glyphicons-halflings-regular.woff2'
},
{
'path': 'fonts/glyphicons-halflings-regular.ttf'
},
{
'path': 'fonts/glyphicons-halflings-regular.svg'
}
]
},
'bootstrap-datepicker': {
Expand Down
2 changes: 1 addition & 1 deletion rdmo/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ def markdown2html(markdown_string):
html = markdown(force_str(markdown_string))
html = re.sub(
r'\[(.*?)\]\{(.*?)\}',
'<span data-toggle="tooltip" data-placement="bottom" data-html="true" title="\2">\1</span>',
r'<span data-toggle="tooltip" data-placement="bottom" data-html="true" title="\2">\1</span>',
html
)
return html
Expand Down
7 changes: 4 additions & 3 deletions rdmo/core/xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,10 @@ def get_ns_map(treenode):


def get_uri(treenode, ns_map):
ns_tag = get_ns_tag('dc:uri', ns_map)
if ns_tag is not None:
return treenode.attrib.get(ns_tag)
if treenode is not None:
ns_tag = get_ns_tag('dc:uri', ns_map)
if ns_tag is not None:
return treenode.attrib.get(ns_tag)


def strip_ns(tag, ns_map):
Expand Down
2 changes: 1 addition & 1 deletion rdmo/projects/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def get_questions(self, catalog):

questions = {}
for question in queryset:
if question.attribute.uri not in questions:
if question.attribute and question.attribute.uri not in questions:
questions[question.attribute.uri] = question
return questions

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,7 @@ angular.module('project_questions')
id: value.id,
project: service.project.id
}, function() {
delete(value.id);
value.changed = false;
}).$promise;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
ng-attr-id="id_{$ question.attribute $}_{$ valueset.set_prefix $}_{$ valueset.set_index $}_{$ $index $}"
ng-model="value.text"
ng-disabled="service.project.read_only"
ng-change="service.changed(value, true)"
ng-mouseup="service.changed(value, true)"
ng-class="{'default-value': service.isDefaultValue(question, value)}"/>
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions rdmo/questions/templates/questions/catalogs.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ <h1>{% trans 'Questions' %}</h1>
<strong>{% trans 'Sites for this catalog' %}</strong>
</div>
<div class="col-sm-9">
<ul>
<li ng-show="service.catalog.length"
<ul>
<li ng-show="service.catalog.sites.length > 0 && service.catalog.sites.length < service.sites.length"
ng-repeat="site in service.catalog.sites">
{$ site.name $}
</li>
<li ng-hide="service.catalog.length">
{% trans 'all Sites' %}
<li ng-show="service.catalog.sites.length == 0 || service.catalog.sites.length == service.sites.length">
{% trans 'All sites' %}
</li>
</ul>
</div>
Expand Down

0 comments on commit 56c5448

Please sign in to comment.