Skip to content

Commit

Permalink
Merge branch 'dev' into 'master'
Browse files Browse the repository at this point in the history
merge v0.7.1 release

See merge request CUBI_Engineering/CUBI_Data_Mgmt/sodar_core!103
  • Loading branch information
mikkonie committed Dec 18, 2019
2 parents 2a012c9 + 9b539ca commit 019e50e
Show file tree
Hide file tree
Showing 64 changed files with 921 additions and 442 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,6 @@ flamegraph.pl

# Celery
celerybeat-schedule

# Vscode
.vscode/*
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ python:
- "3.6"

env:
- CHROME_DRIVER_VERSION="77.0.3865.40"
- CHROME_DRIVER_VERSION="79.0.3945.36"

before_install:
- sudo apt-get update -qq
Expand All @@ -16,7 +16,7 @@ before_install:
addons:
apt:
sources:
- sourceline: "ppa:jonathonf/python-3.6"
- sourceline: "ppa:deadsnakes/ppa"
packages:
- python3.6
- python3.6-dev
Expand Down
59 changes: 59 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,65 @@ Changelog for the **SODAR Core** Django app package. Loosely follows the
Note that the issue IDs here refer to ones in the private CUBI GitLab.


v0.7.1 (2019-12-18)
===================

Added
-----

- **General**
- Include CHANGELOG in documentation (#379)
- **Projectroles**
- ``widget_attrs`` parameter for project and user settings (#404)
- Remote project member management link for target projects (#382)
- Current user in ``get_project_list_value()`` arguments (#413)
- Display category owner in page header (#414)
- Configuring UI test settings via Django settings or ``TestUIBase`` vars (#417)
- Initial support for deploying site in kiosk mode (#406)
- Optional disabling of default CDN Javascript and CSS includes (#418)
- Defining custom global JS/CSS includes in Django settings (#418)

Changed
-------

- **General**
- Change "Breaking Changes" doc into "Major Changes" (#201)
- Refactor and rename ownership transfer classes and template
- Use RTD theme in documentation (#384)
- Upgrade to Chromedriver v79
- **Adminalerts**
- Rename ``INACTIVE`` alert state in UI (#396)
- Rename URL name and pattern for activation API view (#378)
- Improve alert detail page layout (#385)
- **Projectroles**
- Improve unsupported browser warning (#405)
- Move project list description into tooltip (#388)
- **Siteinfo**
- Improve page title and heading (#402)
- **Sodarcache**
- Clarify management command logging (#403)
- **Timeline**
- Improve extra data status tab legend (#380)

Fixed
-----

- **General**
- PPA used for Python 3.6 installs no longer available (#416)
- **Filesfolders**
- Invalid HTML in project list extra columns
- **Projectroles**
- Dismissing login error alert in ``login.html`` not working (#377)
- Current owner queries incorrectly filtered in ``RoleAssignmentOwnerTransferView`` (#393)
- Hardcoded project type display name in sent emails (#398)
- Silent failing of invalid app setting type in plugin definition (#390)
- Exception raised by hidden sidebar in sidebar height calculation (#407)
- Crash in ``get_default_setting()`` if default JSON value was not set (#389)
- Owner widget hidden in category update view (#394)
- Project list extra column header alignment not set (#412)
- ``get_project_list_value()`` template tag displaying "None" on null value (#411)


v0.7.0 (2019-10-09)
===================

Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ installation is forthcoming.

.. code-block:: console
pip install -e git+https://github.com/bihealth/sodar_core.git@v0.7.0#egg=django-sodar-core
pip install -e git+https://github.com/bihealth/sodar_core.git@v0.7.1#egg=django-sodar-core
Please note that This package installs a collection Django apps to
be used in a Django web site project. See
Expand Down
26 changes: 12 additions & 14 deletions adminalerts/templates/adminalerts/alert_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,20 @@

{% block projectroles %}

<div class="container-fluid sodar-subtitle-container">
<div class="row sodar-subtitle-container">
<h2><i class="fa fa-exclamation-triangle"></i> Admin Alert</h2>
<a role="button" class="btn btn-secondary ml-auto pull-right"
href="{{ request.session.real_referer }}">
<i class="fa fa-arrow-circle-left"></i> Back
</a>
</div>

<div class="container-fluid sodar-page-container">
<div class="card" id="sodar-aa-alert-list">
<div class="card-body">
<dl class="row">
<div class="card-body px-0">
<dl class="row pb-0">
<dt class="col-md-2">Message</dt>
<dd class="col-md-10">{{ object.message }}</dd>
<dd class="col-md-10"><strong>{{ object.message }}</strong></dd>
<dt class="col-md-2">Created</dt>
<dd class="col-md-10">{{ object.date_created|date:'Y-m-d H:i' }}</dd>
<dt class="col-md-2">Expires</dt>
Expand All @@ -30,8 +34,10 @@ <h2><i class="fa fa-exclamation-triangle"></i> Admin Alert</h2>
{% endautoescape %}
</dd>
{% if object.description.raw %}
<dt class="col-md-2">Description</dt>
<dd class="col-md-10">
<dd class="col-md-12 px-0 mx-0">
<hr />
</dd>
<dd class="col-md-12 my-0">
{% autoescape off %}
{% render_markdown object.description.raw %}
{% endautoescape %}
Expand All @@ -40,14 +46,6 @@ <h2><i class="fa fa-exclamation-triangle"></i> Admin Alert</h2>
</dl>
</div>
</div>

<div class="row">
<a role="button" class="btn btn-secondary ml-auto"
href="{{ request.session.real_referer }}">
<i class="fa fa-arrow-circle-left"></i> Back
</a>
</div>

</div>

{% endblock projectroles %}
6 changes: 3 additions & 3 deletions adminalerts/templates/adminalerts/alert_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
button.classList.remove("btn-warning");
button.innerText = 'ACTIVE';
} else {
button.innerText = 'SUSPENDED';
button.innerText = 'INACTIVE';
button.classList.remove("btn-success");
button.classList.add("btn-warning");
}
Expand All @@ -72,7 +72,7 @@

$.ajax({
type: 'POST',
url: '{% url 'adminalerts:ajax_alert_activation' %}',
url: '{% url 'adminalerts:api_alert_activation' %}',
data: {
'uuid': event.target.dataset.uuid,
},
Expand Down Expand Up @@ -136,7 +136,7 @@ <h2><i class="fa fa-exclamation-triangle"></i> Admin Alerts</h2>
{% elif a.active %}
ACTIVE
{% else %}
SUSPENDED
INACTIVE
{% endif %}
</button>
</td>
Expand Down
2 changes: 1 addition & 1 deletion adminalerts/tests/test_permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def test_alert_detail(self):

def test_alert_activation(self):
"""Test permissions for AdminAlert activation API view"""
url = reverse('adminalerts:ajax_alert_activation')
url = reverse('adminalerts:api_alert_activation')
good_users = [self.superuser]
bad_users = [self.anonymous, self.regular_user]
self.assert_response(
Expand Down
4 changes: 2 additions & 2 deletions adminalerts/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def test_deactivate_alert(self):
self.assertTrue(self.alert.active)

response: JsonResponse = self.client.post(
reverse('adminalerts:ajax_alert_activation'),
reverse('adminalerts:api_alert_activation'),
data={'uuid': self.alert.sodar_uuid},
)
self.assertEquals(response.status_code, 200)
Expand All @@ -257,7 +257,7 @@ def test_activate_alert(self):
self.alert.save()

response: JsonResponse = self.client.post(
reverse('adminalerts:ajax_alert_activation'),
reverse('adminalerts:api_alert_activation'),
data={'uuid': self.alert.sodar_uuid},
)
self.assertEquals(response.status_code, 200)
Expand Down
4 changes: 2 additions & 2 deletions adminalerts/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
name='delete',
),
url(
regex=r'^ajax/update-state',
regex=r'^api/update-state',
view=views.AdminAlertActivationAPIView.as_view(),
name='ajax_alert_activation',
name='api_alert_activation',
),
]
6 changes: 2 additions & 4 deletions adminalerts/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,8 @@ class AdminAlertListView(LoggedInPermissionMixin, ListView):
permission_required = 'adminalerts.create_alert'
template_name = 'adminalerts/alert_list.html'
model = AdminAlert
paginate_by = (
settings.ADMINALERTS_PAGINATION
if hasattr(settings, 'ADMINALERTS_PAGINATION')
else DEFAULT_PAGINATION
paginate_by = getattr(
settings, 'ADMINALERTS_PAGINATION', DEFAULT_PAGINATION
)
slug_url_kwarg = 'uuid'
slug_field = 'sodar_uuid'
Expand Down
6 changes: 1 addition & 5 deletions bgjobs/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,7 @@ class ProjectBackgroundJobView(
template_name = 'bgjobs/project_backgroundjobs.html'
permission_required = 'bgjobs.view_jobs_own'
model = BackgroundJob
paginate_by = (
settings.BGJOBS_PAGINATION
if hasattr(settings, 'BGJOBS_PAGINATION')
else DEFAULT_PAGINATION
)
paginate_by = getattr(settings, 'BGJOBS_PAGINATION', DEFAULT_PAGINATION)

def get_queryset(self):
# TODO: filter to user's job if can only see their own
Expand Down
16 changes: 16 additions & 0 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,9 @@ def set_logging(debug):
# PROJECTROLES_SECRET_LENGTH = 32
# PROJECTROLES_HELP_HIGHLIGHT_DAYS = 7
# PROJECTROLES_SEARCH_PAGINATION = 5
# Support for viewing the site in "kiosk mode" (under work, experimental)
# PROJECTROLES_KIOSK_MODE = env.bool('PROJECTROLES_KIOSK_MODE', False)

PROJECTROLES_HIDE_APP_LINKS = env.list('PROJECTROLES_HIDE_APP_LINKS', None, [])

# Set limit for delegate roles per project (if 0, no limit is applied)
Expand All @@ -490,6 +493,19 @@ def set_logging(debug):
# Warn about unsupported browsers (IE)
PROJECTROLES_BROWSER_WARNING = True

# Disable default CDN JS/CSS includes to replace with your local files
PROJECTROLES_DISABLE_CDN_INCLUDES = env.bool(
'PROJECTROLES_DISABLE_CDN_INCLUDES', False
)

# Paths/URLs to optional global includes to supplement/replace default ones
PROJECTROLES_CUSTOM_JS_INCLUDES = env.list(
'PROJECTROLES_CUSTOM_JS_INCLUDES', None, []
)
PROJECTROLES_CUSTOM_CSS_INCLUDES = env.list(
'PROJECTROLES_CUSTOM_CSS_INCLUDES', None, []
)


# Bgjobs app settings
BGJOBS_PAGINATION = env.int('BGJOBS_PAGINATION', 15)
Expand Down
10 changes: 10 additions & 0 deletions config/settings/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,13 @@
PROJECTROLES_SITE_MODE = 'SOURCE'
PROJECTROLES_SEND_EMAIL = True
PROJECTROLES_SEARCH_PAGINATION = 10


# UI test settings
PROJECTROLES_TEST_UI_CHROME_OPTIONS = [
'headless',
'no-sandbox', # For Gitlab-CI compatibility
'disable-dev-shm-usage', # For testing stability
]
PROJECTROLES_TEST_UI_WINDOW_SIZE = (1400, 1000)
PROJECTROLES_TEST_UI_WAIT_TIME = 30
2 changes: 1 addition & 1 deletion docs/source/app_projectroles_integration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ desired release tag.
.. code-block:: console
-e git://github.com/mikkonie/django-plugins.git@1bc07181e6ab68b0f9ed3a00382eb1f6519e1009#egg=django-plugins
-e git://github.com/bihealth/sodar_core.git@v0.7.0#egg=django-sodar-core
-e git://github.com/bihealth/sodar_core.git@v0.7.1#egg=django-sodar-core
Install the requirements for development:

Expand Down
48 changes: 48 additions & 0 deletions docs/source/app_projectroles_settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,10 @@ The following projectroles settings are **optional**:
can be synchronized from a source during remote project sync if they exist on
the target site. Similarly, local users will be selectable in member dropdowns
when selecting users (bool)
* ``PROJECTROLES_KIOSK_MODE``: If true, allow accessing certain project views
*without* user authentication in order to e.g. demonstrate features in a
kiosk-style deployment. Also hides and/or disables views not intended to be
used in this mode (bool)

Example:

Expand All @@ -244,6 +248,7 @@ Example:
PROJECTROLES_DELEGATE_LIMIT = 1
PROJECTROLES_BROWSER_WARNING = True
PROJECTROLES_ALLOW_LOCAL_USERS = True
PROJECTROLES_KIOSK_MODE = False
.. warning::

Expand All @@ -261,6 +266,11 @@ Example:
users will be synchronized. New local users will have to be added manually
through the Django admin or shell on the target site.

.. warning::

The ``PROJECTROLES_KIOSK_MODE`` setting is under development and considered
experimental. More implementation, testing and documentation is forthcoming.


Backend App Settings
====================
Expand Down Expand Up @@ -387,6 +397,44 @@ This part of the setup is **optional**.
)
Global JS/CSS Include Modifications (Optional)
==============================================

It is possible to supplement (or replace, see below) global Javascript and CSS
includes of your SODAR Core site without altering the base template. You can
place a list of custom includes into the list variables
``PROJECTROLES_CUSTOM_JS_INCLUDES`` and ``PROJECTROLES_CUSTOM_CSS_INCLUDES``.
These can either be local static file paths or web URLs to e.g. CDN served
files.

If using the default CDN imports for JQuery, Bootstrap4 etc. are not an optimal
solution in your use case due to e.g. network issues, you can disable these
includes by setting ``PROJECTROLES_DISABLE_CDN_INCLUDES`` to ``True``.

.. warning::

If disabling the default CDN includes, you **must** provide replacements for
**all** disabled files in your custom includes. Otherwise your SODAR Core
based site will not function correctly!

Example:

.. code-block:: python
PROJECTROLES_DISABLE_CDN_INCLUDES = True
PROJECTROLES_CUSTOM_JS_INCLUDES = [
STATIC_ROOT + '/your/path/jquery-3.3.1.min.js',
STATIC_ROOT + '/your/path/popper.min.js',
'https://some-cdn.com/bootstrap.min.js',
# ...
]
PROJECTROLES_CUSTOM_CSS_INCLUDES = [
STATIC_ROOT + '/your/path/bootstrap.min.css',
STATIC_ROOT + '/your/path/font-awesome.min.css',
# ...
]
Modifying SODAR_CONSTANTS (Optional)
====================================

Expand Down
3 changes: 3 additions & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.. _changelog:

.. include:: ../../CHANGELOG.rst
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# The short X.Y version
version = '0.7'
# The full version, including alpha/beta/rc tags
release = '0.7.0'
release = '0.7.1'


# -- General configuration ---------------------------------------------------
Expand Down Expand Up @@ -76,7 +76,7 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'
html_theme = 'sphinx_rtd_theme'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand Down
Loading

0 comments on commit 019e50e

Please sign in to comment.