Skip to content

Commit

Permalink
Merge branch 'master' into gsoc24
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhanus3133 committed Aug 2, 2024
2 parents 069de84 + 1d28894 commit e4a1d7e
Show file tree
Hide file tree
Showing 30 changed files with 209 additions and 119 deletions.
10 changes: 0 additions & 10 deletions .coveragerc

This file was deleted.

30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: Bug report
about: Open a bug report
title: "[bug] "
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of the bug or unexpected behavior.

**Steps To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**System Informatioon:**
- OS: [e.g. Ubuntu 24.04 LTS]
- Python Version: [e.g. Python 3.11.2]
- Django Version: [e.g. Django 4.2.5]
- Browser and Browser Version (if applicable): [e.g. Chromium v126.0.6478.126]
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[feature] "
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: Question
about: Please use the Discussion Forum to ask questions
title: "[question] "
labels: question
assignees: ''

---

Please use the [Discussion Forum](https://github.com/orgs/openwisp/discussions) to ask questions.

We will take care of moving the discussion to a more relevant repository if needed.
19 changes: 19 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "monthly"
commit-message:
prefix: "[deps] "
- package-ecosystem: "github-actions" # Check for GitHub Actions updates
directory: "/" # The root directory where the Ansible role is located
schedule:
interval: "monthly" # Check for updates weekly
commit-message:
prefix: "[ci] "
20 changes: 20 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## Checklist

- [ ] I have read the [OpenWISP Contributing Guidelines](http://openwisp.io/docs/developer/contributing.html).
- [ ] I have manually tested the changes proposed in this pull request.
- [ ] I have written new test cases for new code and/or updated existing tests for changes to existing code.
- [ ] I have updated the documentation.

## Reference to Existing Issue

Closes #<issue-number>.

Please [open a new issue](https://github.com/openwisp/openwisp-notifications/issues/new/choose) if there isn't an existing issue yet.

## Description of Changes

Please describe these changes.

## Screenshot

Please include any relevant screenshots.
53 changes: 22 additions & 31 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: OpenWISP CI Build
name: OpenWISP Notifications CI Build

on:
push:
Expand All @@ -16,7 +16,7 @@ jobs:

build:
name: Python==${{ matrix.python-version }} | ${{ matrix.django-version }}
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04

services:
redis:
Expand All @@ -37,63 +37,54 @@ jobs:
- django~=4.2.0

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install system packages
- name: Install Dependencies
id: deps
run: |
sudo apt update
sudo apt-get -qq -y install sqlite3 gdal-bin
- name: Upgrade python system packages
run: pip install -U pip wheel setuptools

- name: Install test dependencies
run: |
pip install -U pip wheel setuptools
pip install -U -r requirements-test.txt
- name: Install openwisp-notifications
run: |
pip install -U -e .
pip install ${{ matrix.django-version }}
- name: Install npm dependencies
run: sudo npm install -g jshint stylelint
sudo npm install -g jshint stylelint
- name: QA checks
run: |
./run-qa-checks
- name: Tests
if: ${{ !cancelled() && steps.deps.conclusion == 'success' }}
run: |
SAMPLE_APP=1 ./runtests.py
SAMPLE_APP=1 coverage run ./runtests.py --parallel
coverage run runtests.py --parallel
coverage combine
coverage xml
env:
SELENIUM_HEADLESS: 1

- name: Upload Coverage
run: coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: python-${{ matrix.python-version }}-${{ matrix.django-version }}
COVERALLS_PARALLEL: true
if: ${{ success() }}
uses: coverallsapp/github-action@v2
with:
parallel: true
format: cobertura
flag-name: python-${{ matrix.env.env }}
github-token: ${{ secrets.GITHUB_TOKEN }}

coveralls:
name: Finish Coveralls
needs: build
runs-on: ubuntu-latest
container: python:3-slim
steps:
- name: Finished
run: |
pip3 install --upgrade coveralls
coveralls --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Coveralls Finished
uses: coverallsapp/github-action@v2
with:
parallel-finished: true
73 changes: 38 additions & 35 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ Version 1.0.3 [2022-08-03]
Bugfixes
~~~~~~~~

- Flagged tests that should not be run on a production environment:
These tests depend on the static storage backend of the project.
In a production environment, the filenames could get changed due to
static minification and cache invalidation. Hence, these tests
should not be run on the production environment because they'll fail.
- Flagged tests that should not be run on a production environment: These
tests depend on the static storage backend of the project. In a
production environment, the filenames could get changed due to static
minification and cache invalidation. Hence, these tests should not be
run on the production environment because they'll fail.

Version 1.0.2 [2022-07-01]
--------------------------
Expand All @@ -25,11 +25,11 @@ Bugfixes
~~~~~~~~

- Fixed `hardcoded static image URLs
<https://github.com/openwisp/openwisp-notifications/issues/243>`_.
These create issues when static files are served using an
external service (e.g. S3 storage buckets).
- Fixed `"Organization.DoesNotExist" error on creating
a new organization <https://github.com/openwisp/openwisp-notifications/issues/238>`_.
<https://github.com/openwisp/openwisp-notifications/issues/243>`_. These
create issues when static files are served using an external service
(e.g. S3 storage buckets).
- Fixed `"Organization.DoesNotExist" error on creating a new organization
<https://github.com/openwisp/openwisp-notifications/issues/238>`_.

Version 1.0.1 [2022-06-09]
--------------------------
Expand All @@ -38,10 +38,10 @@ Bugfixes
~~~~~~~~

- Fixed `handling of the "OPENWISP_NOTIFICATIONS_SOUND" setting
<https://github.com/openwisp/openwisp-notifications/issues/239>`_.
The code was not passing the sound file path to the utilities
of ``django.contrib.staticfiles`` and hence the sound file was
not loaded properly when using different static storage backend.
<https://github.com/openwisp/openwisp-notifications/issues/239>`_. The
code was not passing the sound file path to the utilities of
``django.contrib.staticfiles`` and hence the sound file was not loaded
properly when using different static storage backend.

Version 1.0.0 [2022-04-28]
--------------------------
Expand All @@ -56,15 +56,16 @@ Changes
~~~~~~~

Backward incompatible changes
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+++++++++++++++++++++++++++++

- Removed notification widget and toast template tags:
the template tags "notification_widget" and "notification_toast" have been
removed and their HTML is added directly to the admin/base_site.html template
- Changed the API URL prefix to make it consistent with other OpenWISP modules
- Removed notification widget and toast template tags: the template tags
"notification_widget" and "notification_toast" have been removed and
their HTML is added directly to the admin/base_site.html template
- Changed the API URL prefix to make it consistent with other OpenWISP
modules

Dependencies
^^^^^^^^^^^^
++++++++++++

- Dropped support for Python 3.6
- Added support for Python 3.8 and 3.9
Expand All @@ -75,9 +76,10 @@ Dependencies
- Upgraded openwisp-utils to 1.0.x

Other changes
^^^^^^^^^^^^^
+++++++++++++

- Restyled widget to new OpenWISP theme plus various UI fixes and improvements
- Restyled widget to new OpenWISP theme plus various UI fixes and
improvements
- Restyled notification email template
- When clicking on the mark as read button, the notification widget now
instantaneously marks notification as read instead of waiting for the
Expand All @@ -89,27 +91,27 @@ Other changes
(which may take a long time to finish in big installations)
- Changed wording of "unsubscribe" button, which has been renamed to
"Silence notifications"
- Added dedicated channel layer group for each user to avoid
generating warnings like
``63 of 67 channels over capacity in group ow_notification``
- Added dedicated channel layer group for each user to avoid generating
warnings like ``63 of 67 channels over capacity in group
ow_notification``

Bugfixes
~~~~~~~~

- Fixed a bug which caused to lose notification preferences of users
- Fixed extensibility of openwisp-users:
removed openwisp-users as a direct dependency from migrations file
because it was creating issues when extending openwisp-users
- Fixed extensibility of openwisp-users: removed openwisp-users as a
direct dependency from migrations file because it was creating issues
when extending openwisp-users
- Fixed multiple jquery inclusions in ``base_site.html``
- Fixed WSS connection error when running on http
- Fixed creation of notification settings for superuser
- Fixed unregistered notification type breaking API
- Fixed closing notification toast on slow connections
- Fixed notification storms: when many notifications are created
due to severe network outages, the UI is not flooded anymore
- Fixed notification storms: when many notifications are created due to
severe network outages, the UI is not flooded anymore
- Fixed browsable API view for NotificationReadAllView
- Added error handling for sending emails when notification settings
for a specific user are not present
- Added error handling for sending emails when notification settings for a
specific user are not present
- Fixed unsubscribe / silence notifications button alignment
- Fixed Swagger API doc issues
- Fixed ``create_notification`` command to honor organization notification
Expand Down Expand Up @@ -153,13 +155,14 @@ Features

- Added support for Django 3.1
- Added possibility of `silencing notifications for specific objects \
temporarily or permanently <https://github.com/openwisp/openwisp-notifications#silencing-notifications-for-specific-objects-temporarily-or-permanently>`_
temporarily or permanently
<https://github.com/openwisp/openwisp-notifications#silencing-notifications-for-specific-objects-temporarily-or-permanently>`_

Bugfixes
~~~~~~~~

- Resolved accessibility issues with the notification widget:
all clickable items are now browsable with the keyboard as well
- Resolved accessibility issues with the notification widget: all
clickable items are now browsable with the keyboard as well

Version 0.1.0 [2020-09-02]
--------------------------
Expand Down
3 changes: 2 additions & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
Please refer to the `Contribution Guidelines <https://github.com/openwisp/openwisp-notifications#contributing>`_.
Please refer to the `Contribution Guidelines
<https://github.com/openwisp/openwisp-notifications#contributing>`_.
2 changes: 2 additions & 0 deletions openwisp_notifications/CONTRIBUTING.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Please refer to the `OpenWISP Contributing Guidelines
<http://openwisp.io/docs/developer/contributing.html>`_.
2 changes: 1 addition & 1 deletion openwisp_notifications/base/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def _related_object(self, field):
cache.set(
cache_key,
obj,
timeout=app_settings.OPENWISP_NOTIFICATIONS_CACHE_TIMEOUT,
timeout=app_settings.CACHE_TIMEOUT,
)
return obj

Expand Down
2 changes: 1 addition & 1 deletion openwisp_notifications/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
@checks.register
def check_cors_configuration(app_configs, **kwargs):
errors = []
if not app_settings.OPENWISP_NOTIFICATIONS_HOST:
if not app_settings.HOST:
return errors

if not (
Expand Down
6 changes: 2 additions & 4 deletions openwisp_notifications/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

def notification_api_settings(request):
return {
'OPENWISP_NOTIFICATIONS_HOST': app_settings.OPENWISP_NOTIFICATIONS_HOST,
'OPENWISP_NOTIFICATIONS_SOUND': static(
app_settings.OPENWISP_NOTIFICATIONS_SOUND
),
'OPENWISP_NOTIFICATIONS_HOST': app_settings.HOST,
'OPENWISP_NOTIFICATIONS_SOUND': static(app_settings.SOUND),
}
Loading

0 comments on commit e4a1d7e

Please sign in to comment.